query
stringlengths
10
8.11k
document
stringlengths
17
398k
negatives
sequencelengths
19
20
metadata
dict
Operation getDepositUsingGetAsyncWithHttpInfo Retrieve a deposit request
public function getDepositUsingGetAsyncWithHttpInfo($deposit_id) { $returnType = '\com\hydrogen\nucleus\Model\DailyDeposit'; $request = $this->getDepositUsingGetRequest($deposit_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); if ($returnType !== 'string') { $content = json_decode($content); } } return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), $response->getHeaders() ]; }, function ($exception) { $response = $exception->getResponse(); $statusCode = $response->getStatusCode(); throw new ApiException( sprintf( '[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri() ), $statusCode, $response->getHeaders(), $response->getBody() ); } ); }
[ "public function debtorGETRequestDebtorIDGetAsyncWithHttpInfo($accept, $debtor_id, $jiwa_stateful = null)\n {\n $returnType = '\\Jiwa\\Model\\Debtor';\n $request = $this->debtorGETRequestDebtorIDGetRequest($accept, $debtor_id, $jiwa_stateful);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function debtorAPIKeyDebtorGETRequestGetWithHttpInfo($accept, $jiwa_stateful = null)\n {\n $returnType = '\\Jiwa\\Model\\Debtor';\n $request = $this->debtorAPIKeyDebtorGETRequestGetRequest($accept, $jiwa_stateful);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Jiwa\\Model\\Debtor',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Jiwa\\Model\\Debtor',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Jiwa\\Model\\Debtor',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function getDepositByIdWithHttpInfo($deposit_id)\n {\n $request = $this->getDepositByIdRequest($deposit_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\com.blockchain.exchange.rest\\com.blockchain.exchange.rest.model\\DepositInfo' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\com.blockchain.exchange.rest\\com.blockchain.exchange.rest.model\\DepositInfo', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\com.blockchain.exchange.rest\\com.blockchain.exchange.rest.model\\DepositInfo';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\com.blockchain.exchange.rest\\com.blockchain.exchange.rest.model\\DepositInfo',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "protected function getDepositUsingGetRequest($deposit_id)\n {\n // verify the required parameter 'deposit_id' is set\n if ($deposit_id === null || (is_array($deposit_id) && count($deposit_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $deposit_id when calling getDepositUsingGet'\n );\n }\n\n $resourcePath = '/deposit/{deposit_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($deposit_id !== null) {\n $resourcePath = str_replace(\n '{' . 'deposit_id' . '}',\n ObjectSerializer::toPathValue($deposit_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\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 \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 debtorGETRequestDebtorIDGetAsync($accept, $debtor_id, $jiwa_stateful = null)\n {\n return $this->debtorGETRequestDebtorIDGetAsyncWithHttpInfo($accept, $debtor_id, $jiwa_stateful)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function getBudget()\n {\n $ch = new Curl;\n\n return $ch->get(OVOID::BASE_ENDPOINT . 'v1.0/budget/detail', null, $this->_aditionalHeader())->getResponse();\n }", "public function debtorGETRequestDebtorIDGetWithHttpInfo($accept, $debtor_id, $jiwa_stateful = null)\n {\n $returnType = '\\Jiwa\\Model\\Debtor';\n $request = $this->debtorGETRequestDebtorIDGetRequest($accept, $debtor_id, $jiwa_stateful);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Jiwa\\Model\\Debtor',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Jiwa\\Model\\Debtor',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Jiwa\\Model\\Debtor',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Jiwa\\Model\\Debtor',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function testGetDeposit()\n {\n // Parameters for the API call\n $depositId = 'RAD-180426-5407';\n\n // Set callback and perform API call\n $result = null;\n self::$controller->setHttpCallBack($this->httpResponse);\n try {\n $result = self::$controller->getDeposit($depositId);\n } catch (APIException $e) {\n }\n\n // Test response code\n $this->assertEquals(\n 200,\n $this->httpResponse->getResponse()->getStatusCode(),\n \"Status is not 200\"\n );\n\n // Test whether the captured response is as we expected\n $this->assertNotNull($result, \"Result does not exist\");\n\n $this->assertTrue(\n TestHelper::isJsonObjectProperSubsetOf(\n \"{\\n \\\"referenceDepositID\\\": \\\"RAD-180426-5407\\\",\\n \\\"amount\\\": 1.25,\\n \\\"amountCharged\\\": 1.29,\\n\" .\n \" \\\"feePercent\\\": 3.5,\\n \\\"createdDate\\\": \\\"2018-04-26T18:56:28.28Z\\\",\\n \\\"status\\\": \\\"SUCCESS\\\",\" .\n \"\\n \\\"accountNumber\\\": \\\"A32386768\\\"\\n}\",\n $this->httpResponse->getResponse()->getRawBody(),\n true,\n true,\n false\n ),\n \"Response body does not match in keys and/or values\"\n );\n }", "public function deposit(DepositRequest $request) : DepositResponse {\n $requestBuilder = new DepositRequestBuilder($this->httpClient, $request->jwt);\n $queryParameters = array();\n $queryParameters += [\"asset_code\" => $request->assetCode];\n $queryParameters += [\"account\" => $request->account];\n if ($request->memoType) {\n $queryParameters += [\"memo_type\" => $request->memoType];\n }\n if ($request->memo) {\n $queryParameters += [\"memo\" => $request->memo];\n }\n if ($request->emailAddress) {\n $queryParameters += [\"email_address\" => $request->emailAddress];\n }\n if ($request->type) {\n $queryParameters += [\"type\" => $request->type];\n }\n if ($request->walletName) {\n $queryParameters += [\"wallet_name\" => $request->walletName];\n }\n if ($request->walletUrl) {\n $queryParameters += [\"wallet_url\" => $request->walletUrl];\n }\n if ($request->lang) {\n $queryParameters += [\"lang\" => $request->lang];\n }\n if ($request->onChangeCallback) {\n $queryParameters += [\"on_change_callback\" => $request->onChangeCallback];\n }\n if ($request->amount) {\n $queryParameters += [\"amount\" => $request->amount];\n }\n if ($request->countryCode) {\n $queryParameters += [\"country_code\" => $request->countryCode];\n }\n if ($request->claimableBalanceSupported) {\n $queryParameters += [\"claimable_balance_supported\" => $request->claimableBalanceSupported];\n }\n\n $requestBuilder = $requestBuilder->forQueryParameters($queryParameters);\n return $requestBuilder->execute();\n }", "public function depositFundsAsyncWithHttpInfo($id, $deposit_request_body)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\SingleDisbursement';\n $request = $this->depositFundsRequest($id, $deposit_request_body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "protected function getDeposit()\r\n\t{\r\n\t\t$query = \"SELECT deposito FROM \".XNAME.\"_viviendas WHERE id = {$this->id}\";\r\n\t\t$sql = record($query);\r\n\r\n\t\t$deposito = ($sql['deposito']) ? $sql['deposito'] : $this->depositCost;\r\n\r\n\t\treturn $deposito;\r\n\t}", "public function meGetbonusGetAsyncWithHttpInfo()\n {\n $returnType = '';\n $request = $this->meGetbonusGetRequest();\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 get_balance()\n\t{\n\t\t$required = $this->_credentials;\t\t\t\t// Get required credentials and set API method to the request\n\t\t$required[ 'method' ] = PP_METHOD_GET_BALANCE;\n\t\t$required[ 'returnallcurrencies' ] = 1;\n\t\treturn $this->_execute_call(http_build_query($required));\n\t}", "public function getBalanceWithHttpInfo()\n {\n $returnType = '\\Swagger\\Client\\Model\\GetBalanceResponse';\n $request = $this->getBalanceRequest();\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\GetBalanceResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\IApiResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\IApiResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\IApiResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 503:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\IApiResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function get_balance()\n\t{\n\t\t$this->getToken();\n\t\t$path = '/banking/v3/corporates/'.self::$corporate_id.'/accounts/'.self::$account_number;\n\t\t$method = 'GET';\n\t\t$data = array();\n\t\t$this->getSignature($path, $method, $data);\n\t\t$headers = array(\n\t\t\t'X-BCA-Key: '.self::$api_key,\n\t\t\t'X-BCA-Timestamp: '.self::$timestamp,\n\t\t\t'Authorization: Bearer '.self::$access_token,\n\t\t\t'X-BCA-Signature: '.self::$signature,\n\t\t\t'Content-Type: application/json',\n\t\t\t'Origin: '.$_SERVER['SERVER_NAME']\n\t\t);\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, self::$main_url.$path);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // Ignore Verify SSL Certificate\n\t\tcurl_setopt_array($ch, array(\n\t\t\tCURLOPT_RETURNTRANSFER => TRUE,\n\t\t\tCURLOPT_HTTPHEADER => $headers\n\t\t));\n\t\t$response = curl_exec($ch); // This is API Response\n\t\tcurl_close($ch);\n\n\t\t$response_array = array();\n\t\t$response_array = json_decode($response);\n\t\techo '<pre>'; print_r($response_array); echo '</pre>';\n\t\techo 'No.Rek : '.$response_array->AccountDetailDataSuccess['0']->AccountNumber.'<br>';\n\t\techo 'Saldo : '.$response_array->AccountDetailDataSuccess['0']->Balance.'<br>';\n\t\techo 'Token : '.self::$access_token;\n\t\techo 'Signature : '.self::$signature;\n\t}", "public function publicGetOrderBookGetAsyncWithHttpInfo($instrument_name, $depth = null)\n {\n $returnType = 'object';\n $request = $this->publicGetOrderBookGetRequest($instrument_name, $depth);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function getDepositAddressAsyncWithHttpInfo($currency)\n {\n $returnType = '\\com.blockchain.exchange.rest\\com.blockchain.exchange.rest.model\\DepositAddressCrypto';\n $request = $this->getDepositAddressRequest($currency);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function getDepositAddressAsyncWithHttpInfo($currency)\n {\n $returnType = '\\GateApi\\Model\\DepositAddress';\n $request = $this->getDepositAddressRequest($currency);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function voucherGetDebitAsyncWithHttpInfo($id) {\n $returnType = '';\n $request = $this->voucherGetDebitRequest($id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Show important dates tab. If the user have more priviledges than COMP_ADM_LEVEL, then the dates will be editable on the page
function companydates(){ $this->auth(COMP_ADM_LEVEL); $contest_id = $this->uri->segment(3); $data = $this->_getCompanyDataByContestId($contest_id); if($this->session->userdata('role_level') > SUPPORT_ADM_LEVEL){ $data['editable'] = TRUE; } else { $data['editable'] = FALSE; } $this->load->view('admin/company_admin/v_dates', $data); }
[ "function view_dates() {\n if (!$this->assignment->timeavailable && !$this->assignment->timedue) {\n return;\n }\n\n\n print_simple_box_start('center', '', '', '', 'generalbox', 'dates');\n echo '<table border=\"0\">';\n if ($this->assignment->timeavailable) {\n echo '<tr><td class=\"c0\">'.get_string('availabledate','assignment').':</td>';\n echo ' <td class=\"c1\">'.userdate($this->assignment->timeavailable).'</td></tr>';\n }\n if ($this->assignment->timedue) {\n echo '<tr><td class=\"c0\">'.get_string('duedate','assignment').':</td>';\n echo ' <td class=\"c1\">'.userdate($this->assignment->timedue).'</td></tr>';\n }\n echo '</table>';\n print_simple_box_end();\n\n }", "static function showDateRestrictionForm($options = []) {\n\n echo \"<table class='tab_cadre_fixe'>\";\n echo \"<tr class='tab_bg_2'>\";\n\n $enabled = (isset($options['enabled'])?$options['enabled']:false);\n if (!$enabled) {\n echo \"<td colspan='4' class='center'>\";\n echo \"<a href='#' onClick='activateRestriction()'>\".__('Enable filtering by date').\"</a>\";\n echo \"</td></tr>\";\n }\n if ($enabled) {\n echo \"<td>\".__('View updated users').\"</td>\";\n echo \"<td>\".__('from').\"</td>\";\n echo \"<td>\";\n $begin_date = (isset($_SESSION['ldap_import']['begin_date'])\n ?$_SESSION['ldap_import']['begin_date'] :'');\n Html::showDateTimeField(\"begin_date\", ['value' => $begin_date]);\n echo \"</td>\";\n echo \"<td>\".__('to').\"</td>\";\n echo \"<td>\";\n $end_date = (isset($_SESSION['ldap_import']['end_date'])\n ?$_SESSION['ldap_import']['end_date']\n :date('Y-m-d H:i:s', time()-DAY_TIMESTAMP));\n Html::showDateTimeField(\"end_date\", ['value' => $end_date]);\n echo \"</td></tr>\";\n echo \"<tr class='tab_bg_2'><td colspan='4' class='center'>\";\n echo \"<a href='#' onClick='deactivateRestriction()'>\".__('Disable filtering by date').\"</a>\";\n echo \"</td></tr>\";\n }\n echo \"</table>\";\n }", "public function adminDates()\n {\n $this->includeAdminFile('culture24.admin.dates.php');\n }", "public function show_trn_afterdatechg(){\n // load library to cek user session and level\n $this->pageauth->sess_auth();\n $dateVal = $this->input->post('dateVal');\n $this->show_trans($dateVal);\n }", "public function tab_work_days() {\n include WPERP_HRM_VIEWS . '/settings/tab-workdays.php';\n }", "function DashboardEligibilityAdmin()\n\t{\n\t\t$activities_nb = DBGetOne( \"SELECT COUNT(ID) AS ACTIVITIES_NB\n\t\tFROM ELIGIBILITY_ACTIVITIES\n\t\tWHERE SYEAR='\" . UserSyear() . \"'\n\t\tAND SCHOOL_ID='\" . UserSchool() . \"'\n\t\tAND START_DATE<=CURRENT_DATE\n\t\tAND END_DATE>=CURRENT_DATE\" );\n\n\t\t$data = array(\n\t\t\t_( 'Activities' ) => $activities_nb,\n\t\t);\n\n\t\t// Activities this week.\n\t\t$activities_nb = (int) $activities_nb;\n\n\t\tif ( ! $activities_nb )\n\t\t{\n\t\t\treturn array();\n\t\t}\n\n\t\t$activity_students_RET = DBGet( \"SELECT TITLE,\n\t\tCOUNT(sea.STUDENT_ID) AS STUDENTS_NB\n\t\tFROM ELIGIBILITY_ACTIVITIES ea, STUDENT_ELIGIBILITY_ACTIVITIES sea\n\t\tWHERE ea.SYEAR='\" . UserSyear() . \"'\n\t\tAND ea.SCHOOL_ID='\" . UserSchool() . \"'\n\t\tAND ea.START_DATE<=CURRENT_DATE\n\t\tAND ea.END_DATE>=CURRENT_DATE\n\t\tAND sea.SYEAR=ea.SYEAR\n\t\tAND ea.ID=sea.ACTIVITY_ID\n\t\tGROUP BY ea.TITLE\n\t\tORDER BY STUDENTS_NB\n\t\tLIMIT 10\" );\n\n\t\tforeach ( (array) $activity_students_RET as $activity )\n\t\t{\n\t\t\t$data[$activity['TITLE']] = sprintf(\n\t\t\t\t'%d %s',\n\t\t\t\t$activity['STUDENTS_NB'],\n\t\t\t\tngettext( 'Student', 'Students', $activity['STUDENTS_NB'] )\n\t\t\t);\n\t\t}\n\n\t\treturn $data;\n\t}", "private function add_date_menu() {\n\t\t$this->add_sub_menu(\n\t\t\t'date',\n\t\t\t[\n\t\t\t\t'title' => esc_html__( 'SEO Settings for Date Archives', 'rank-math' ),\n\t\t\t\t'href' => Helper::get_admin_url( 'options-titles#setting-panel-global' ),\n\t\t\t\t'meta' => [ 'title' => esc_html__( 'Edit SEO settings for this archive page', 'rank-math' ) ],\n\t\t\t\t'priority' => 35,\n\t\t\t]\n\t\t);\n\t}", "function date_input()\n\t{\n\t\t$data = $this->_get_common_report_data();\n\t\t$data['mode'] = 'sale';\n\t\t$data['am'] = 'reports';\n\t\t$this->load->view(\"reports/date_input\",$data);\n\t}", "public function reportDevelopmentCostAfdAction()\n {\n\t\t$this->view->period = date(\"Y\", strtotime($this->_period));\n $this->_listAction();\n }", "public function opportunity_dates() {\n if ($_SESSION['view_as_admin']) {\n echo $this->load->view('opportunity/calendar', array(\n 'dates' => $this->opportunity_model->get_all_dates_for_location($_SESSION['user']->preferred_location_id)\n ), TRUE);\n }\n else {\n echo $this->load->view('opportunity/calendar', array(\n 'dates' => $this->opportunity_model->get_upcoming_dates_for_training_level_and_location(\n $_SESSION['user']->training_level_id,\n $_SESSION['user']->preferred_location_id\n )\n ), TRUE);\n }\n }", "function _erpal_calendar_helper_manage_date_acl($node, $op) {\n \n if ($op == 'update' || $op == 'insert') { \n //Ensure ACLs existence, but we manage only view access\n $date_view_acl = _erpal_calendar_helper_access_init_date_acl($node->nid, 'view', true);\n \n $participants = isset($node->field_users[LANGUAGE_NONE][0]) ? $node->field_users[LANGUAGE_NONE] : array();\n \n //assign these users to the ACL\n foreach($participants as $uid) {\n $uid = $uid['target_id'];\n acl_add_user($date_view_acl, $uid);\n }\n //assign the ACL to the department (View Yes, Write No, Delete No, prio=5)\n acl_node_add_acl($node->nid,$date_view_acl,1,0,0,CALENDAR_ACL_PRIO); \n node_access_acquire_grants($node);\n } elseif ($op == 'delete') {\n //delete all the ACL of the date node\n _erpal_calendar_helper_access_clear_acls($node->nid);\n return;\n }\n \n}", "public function get_date_vs_for_admin()\n\t{\n\t\t$start_mydate=$this->input->post('start_mydate');\n\t\t$end_mydate=$this->input->post('end_mydate');\n\t\t$engineer=$this->input->post('engineer');\n\t\t$this->load->model(\"complaint_model\");\n\t\t//\n $get_sup_dvr = $this->complaint_model->get_date_dvr_model($start_mydate,$end_mydate,$engineer, 'tbl_vs');\n\t\t $this->load->view('sys/admin_vs', array(\"get_sup_dvr\" => $get_sup_dvr,\n\t\t \t\t\t\t\t\t\t\t\t\t\t\t\"mystartdate\" => $start_mydate,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"myenddate\" => $end_mydate,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"myengineer\" => $engineer\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t));\n\t\n\t}", "public function reportSummaryDevelopmentCostAfdAction()\n {\n\t\t$this->view->period = date(\"Y\", strtotime($this->_period));\n $this->_listAction();\n }", "private function is_license_expiry_notice_hideable() {\n\t\treturn ! AC()->admin()->is_current_page( 'settings' );\n\t}", "public function edit_expiry() {\r\r\n\t\ttry {\r\r\n\t\t\t$data['tab']='EditExpiry';\r\r\n\t\t\t$data['bcum']='Expiry';\r\r\n\t\t\t$data['main']='expiry';\r\r\n\t\t\t$data['mode']='edit';\r\r\n\t\t\t\r\r\n\t\t\t$datas['expiry'] = $this->em->get_expiry();\r\r\n\t\t\t\r\r\n\t\t\t$this->load->view('backend/header', $data);\r\r\n\t\t\t$this->load->view('backend/edit-expiry', $datas);\r\r\n\t\t\t$this->load->view('backend/footer');\r\r\n\t\t}\r\r\n\t\tcatch (Exception $ex) {\r\r\n\t\t\techo $ex->getMessage();\r\r\n\t\t}\r\r\n\t}", "function date_input_excel_export_base_filter() {\n $data['allowed_modules'] = $this->check_module_accessable();\n\n $logged_in_employee_info=$this->Employee->get_logged_in_employee_info();\n $data['allowed_offices'] = $this->Office->select_offices_options($logged_in_employee_info->employee_id);\n $data['massagers'] = $this->Employee->select_emp_massager_option();\n $data['get_report'] = $this->_get_common_report_data(TRUE);\n $this->load->view(\"reports/date_input_excel_export_base_filter\", $data);\n }", "public function isDateVisible() \n {\n return (bool) $this->show_date;\n }", "function date_input()\n\t{\n\t\t$data = $this->_get_common_report_data();\n\t\t$this->load->view(\"reports/date_input\",$data);\n\t}", "function iin_panels_extras_date_comparison_ctools_settings($form, &$form_state, $conf) {\n $form['settings']['date'] = array(\n '#type' => 'date_popup',\n '#title' => 'Date',\n '#description' => t('Choose a date to compare to today\\'s date or current time.'),\n '#default_value' => !empty($conf['date']) ? $conf['date'] : date(\"Y-m-d H:i:s\"),\n '#date_type' => DATE_DATETIME,\n '#date_timezone' => date_default_timezone(),\n '#date_format' => 'm/d/Y h:i a',\n '#date_increment' => 1,\n '#date_year_range' => '-3:+3',\n );\n $form['settings']['comparison'] = array(\n '#type' => 'select',\n '#title' => 'Comparison Type',\n '#description' => t('Choose how the date you chose compares to the chosen moment (\"right now\" or \"today.\")'),\n '#default_value' => !empty($conf['comparison']) ? $conf['comparison'] : 'on',\n '#options' => array(\n 'before' => 'Before',\n 'on_before' => 'On or Before',\n 'on' => 'On',\n 'on_after' => 'On or After',\n 'after' => 'After'\n ),\n );\n $form['settings']['moment'] = array(\n '#type' => 'select',\n '#title' => 'Moment',\n '#description' => t('Choose the moment to compare the date to. \"Now\" will look at the current minute, \"Today\" will match any time during today\\'s date.'),\n '#default_value' => !empty($conf['moment']) ? $conf['moment'] : 'today',\n '#options' => array(\n 'now' => 'Right Now',\n 'today' => 'Today',\n ),\n );\n return $form;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation getUnitRelationshipTypesAsync List Relationship Types
public function getUnitRelationshipTypesAsync() { return $this->getUnitRelationshipTypesAsyncWithHttpInfo() ->then( function ($response) { return $response[0]; } ); }
[ "public function getRelationshipTypes()\n {\n return $this->relationship_types;\n }", "private function getRelationshipTypes() {\n $relTypes = \\Drupal::service('civicrm_entity.api')->get('RelationshipType', [\n 'return' => [\"id\", \"label_a_b\", \"label_b_a\"],\n 'options' => ['limit' => 0],\n ]);\n $options = [];\n foreach ($relTypes as $info) {\n $options[$info['id']] = \"{$info['label_a_b']} | {$info['label_b_a']}\";\n }\n return $options;\n }", "function testGetRelationshipTypes()\r\n {\r\n $customerController = new CustomerController($this->ant, $this->user);\r\n $customerController->debug = true;\r\n \r\n $ret = $customerController->getRelationshipTypes();\r\n $this->assertTrue(is_array($ret));\r\n $this->assertTrue(sizeof($ret) > 0);\r\n $this->assertTrue($ret[0]['id'] > 0);\r\n $this->assertTrue(count($ret[0]['name']) > 0);\r\n }", "public function GetRelationTypes()\r\n {\r\n return $this->relationTypes;\r\n }", "public static function getRelationshipTypes(): array\n {\n return [self::ONE_TO_ONE, self::ONE_TO_MANY, self::MANY_TO_ONE, self::MANY_TO_MANY, self::SCALAR, self::UNDEFINED];\n }", "public function types()\n {\n return $this->all('rdf:type');\n }", "public function setRelationshipTypes($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING);\n $this->relationship_types = $arr;\n\n return $this;\n }", "public function getUnitRelationshipTypesAsyncWithHttpInfo()\n {\n $returnType = '\\Swagger\\Client\\Model\\InlineResponse20022';\n $request = $this->getUnitRelationshipTypesRequest();\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function getLinkedProfileTypes(): array {\n\t\t$types = $this->getEntitiesFromRelationship([\n\t\t\t'relationship' => \\ColdTrick\\ProfileManager\\CustomProfileType::CATEGORY_RELATIONSHIP,\n\t\t\t'inverse_relationship' => true,\n\t\t\t'limit' => false\n\t\t]);\n\t\t\n\t\tif (empty($types)) {\n\t\t\t// return 0 as the default\n\t\t\treturn [0];\n\t\t}\n\t\t\n\t\t$result = [];\n\t\t\t\t\n\t\tforeach ($types as $type) {\n\t\t\t$result[] = $type->guid;\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "function _getRelationTypeList() {\n\t\t$relationTypes = array();\n\t\n\t\t$this->Inference->RelationType1->contain();\n\t\t$relationTypeList = $this->Inference->RelationType1->find('all', array('fields' => array('id', 'title_from', 'title_to'), 'order' => array('title_from' => 'ASC', 'title_to' => 'ASC'), 'conditions' => array('deleted' => 0)));\n\t\tforeach($relationTypeList as $val)\n\t\t\t$relationTypes[$val['RelationType1']['id']] = $val['RelationType1']['title_from'].'/'.$val['RelationType1']['title_to'];\n\n\t\treturn $relationTypes;\t\t\n\t}", "public function getRentTypes()\n {\n $this->rentTypeIds = explode(',', $this->rent_type);\n\n return RentType::findAll($this->rentTypeIds);\n }", "public function getRelationType();", "public function getEntityTypes();", "public function getRelations($relationType = null);", "function user_relationships_ui_types_list_page() {\n $relationship_types = user_relationships_types_load();\n\n $table['headers'] = array(t('Name'), t('Plural'), t('Type'), t('Requires Approval'), t('Expiration'), t('Operations'));\n $table['data'] = array();\n $table['rows'] = array();\n\n foreach ($relationship_types as $relationship) {\n $table['data'][] = $relationship;\n $table['rows'][] = array(\n $relationship->name,\n $relationship->plural_name,\n ($relationship->is_oneway ? ($relationship->is_reciprocal ? t('reciprocal') : t('one way')) : t('mutual')),\n ($relationship->requires_approval ? t('yes') : t('no')),\n ($relationship->expires_val ? t('@expires_val', array('@expires_val' => format_plural($relationship->expires_val, '1 day', '@count days'))) : t('Never')),\n l(t('edit'), \"admin/user/relationships/{$relationship->rtid}/edit\") .' | '.\n l(t('delete'), \"admin/user/relationships/{$relationship->rtid}/delete\")\n );\n }\n\n foreach (module_implements('user_relationships_page_alter') as $module) {\n $function = \"{$module}_user_relationships_page_alter\";\n $function('types list', $page, $table);\n }\n\n if (!sizeof($table['rows'])) {\n $table['rows'][] = array(array('data' => t('No relationships available.'), 'colspan' => sizeof($table['headers'])));\n }\n\n $page['relationships'] = array(\n '#type' => 'fieldset',\n '#title' => t('Relationship Types'),\n '#weight' => 0\n );\n $page['relationships']['list'] = array(\n '#value' => theme('table', $table['headers'], $table['rows'])\n );\n\n return drupal_render($page);\n}", "public function get_types()\n\t{\n\t\treturn $this->driver_query('type_list', FALSE);\n\t}", "public function getRelationshipType()\n {\n return $this->relationshipType;\n }", "public function get_relations_types_for_js() {\n\n\t\t\t$result = array();\n\n\t\t\tforeach ( $this->get_relations_types() as $value => $label ) {\n\t\t\t\t$result[] = array(\n\t\t\t\t\t'value' => $value,\n\t\t\t\t\t'label' => $label,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn $result;\n\t\t}", "public function getOrderTypes();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns slots for Many Bookings for One Day
public function getManyBookingsForOneDaySlots($bookingProductSlot, $requestedDate) { $bookingProduct = $bookingProductSlot->booking_product; $currentTime = Carbon::now(); $availableFrom = $bookingProduct->available_from ? Carbon::createFromTimeString($bookingProduct->available_from) : Carbon::createFromTimeString($currentTime->format('Y-m-d 00:00:00')); $availableTo = $bookingProduct->available_to ? Carbon::createFromTimeString($bookingProduct->available_to) : Carbon::createFromTimeString('2080-01-01 00:00:00'); $timeDuration = $bookingProductSlot->slots[$requestedDate->format('w')] ?? []; if ( ! count($timeDuration) || ! $timeDuration['status'] ) { return []; } $slots = []; $fromChunks = explode(':', $timeDuration['from']); $toChunks = explode(':', $timeDuration['to']); $startDayTime = Carbon::createFromTimeString($requestedDate->format('Y-m-d') . ' 00:00:00'); $startDayTime->addMinutes(($fromChunks[0] * 60) + $fromChunks[1]); $tempStartDayTime = clone $startDayTime; $endDayTime = Carbon::createFromTimeString($requestedDate->format('Y-m-d') . ' 00:00:00'); $endDayTime->addMinutes(($toChunks[0] * 60) + $toChunks[1]); $isFirstIteration = true; while (1) { $from = clone $tempStartDayTime; $tempStartDayTime->addMinutes($bookingProductSlot->duration); if ($isFirstIteration) { $isFirstIteration = false; } else { $from->modify('+' . $bookingProductSlot->break_time . ' minutes'); $tempStartDayTime->modify('+' . $bookingProductSlot->break_time . ' minutes'); } $to = clone $tempStartDayTime; if ( ( $startDayTime <= $from && $from <= $availableTo ) && ( $availableTo >= $to && $to >= $startDayTime ) && ( $startDayTime <= $from && $from <= $endDayTime ) && ( $endDayTime >= $to && $to >= $startDayTime ) ) { // Get already ordered qty for this slot $orderedQty = 0; $qty = isset($timeDuration['qty']) ? ($timeDuration['qty'] - $orderedQty) : 1; if ( $qty && $currentTime <= $from ) { $slots[] = [ 'from' => $from->format('h:i A'), 'to' => $to->format('h:i A'), 'timestamp' => $from->getTimestamp() . '-' . $to->getTimestamp(), 'qty' => $qty, ]; } } else { break; } } return $slots; }
[ "public function slots()\n {\n $pdo = static::getDB();\n $sql_query = \"SELECT * FROM COLLECTION_SLOTS WHERE DAY = :day\";\n\n $result = $pdo->prepare($sql_query);\n $result->execute([$this->DAY]);\n return $result->fetchAll(\\PDO::FETCH_CLASS, self::class);\n }", "public function getBookedSlots($date)\n {\n $appointments = $this->getAppointments($date);\n\n $bookedSlots = [];\n\n foreach ($appointments as $appointment) {\n\n $bookedSlot = $this->createBookedSlot($appointment);\n\n array_push($bookedSlots, $bookedSlot);\n }\n\n return $bookedSlots;\n }", "public function getBookedSlotsByDate(Request $request)\n {\n $validated = $request->validate([\n 'date' => 'required',\n ]);\n $bookedSlots = DB::table('bookings')\n ->select(DB::raw('TIME(datetime) as time'))\n ->where(DB::raw('DATE(datetime)'), '=', $request->get('date'))\n ->where('status', 'scheduled')\n ->get()\n ->pluck('time')\n ->toArray();\n $dayOfWeek = date('w', strtotime($request->get('date')));\n $times = $this->config['types']['allowTimes'][$dayOfWeek];\n\n // This is another example of code that should be part of a utility class\n // In case the requested date is today we need to run some additional checks\n $today = new DateTime('today');\n $requestedDate = new DateTime($request->get('date'));\n $diffDays = $today->diff($requestedDate)->days;\n if($diffDays == 0){\n $currentTime = date('H:i:s');\n foreach($times as $timeString){\n $time = date('H:i:s', strtotime($timeString));\n if ($currentTime > $time){\n if (($key = array_search($timeString, $times)) !== false) {\n unset($times[$key]);\n }\n }\n } \n }\n return array_diff($times, $bookedSlots);\n }", "function scheduler_get_available_slots($studentid, $schedulerid, $studentside=false){\n global $CFG;\n\n /*\n if ($studentside){\n $sql = \"\n SELECT\n s.*,\n MAX(a.studentid = {$studentid}) as appointedbyme,\n MAX(a.studentid) as appointed,\n COUNT(IF(a.attended IS NULL OR a.attended = 0, NULL, 1)) as attended,\n COUNT(IF(a.studentid IS NULL, NULL, 1)) as population\n FROM\n {$CFG->prefix}scheduler_slots AS s\n LEFT JOIN\n {$CFG->prefix}scheduler_appointment AS a\n ON\n a.slotid = s.id\n WHERE\n s.schedulerid = {$schedulerid}\n GROUP BY\n s.id\n HAVING\n ((s.exclusivity > 0 AND population < s.exclusivity) OR\n s.exclusivity = 0) OR appointedbyme\n ORDER BY\n s.starttime ASC\n \";\n }\n else{\n $sql = \"\n SELECT\n s.*,\n MAX(a.studentid = $studentid) as appointedbyme,\n MAX(a.studentid) as appointed,\n COUNT(IF(a.attended IS NULL OR a.attended = 0, NULL, 1)) as attended,\n COUNT(IF(a.studentid IS NULL, NULL, 1)) as population\n FROM\n {$CFG->prefix}scheduler_slots AS s\n LEFT JOIN\n {$CFG->prefix}scheduler_appointment AS a\n ON \n a.slotid = s.id\n WHERE\n s.schedulerid = {$schedulerid}\n GROUP BY\n s.id\n HAVING\n ((s.exclusivity > 0 AND population < s.exclusivity) OR\n s.exclusivity = 0) AND\n (NOT appointedbyme OR appointedbyme IS NULL)\n ORDER BY\n s.starttime\n \";\n }\n\n $recs = get_records_sql($sql);\n return $recs\n */\n\n // more compatible tryout\n $slots = get_records('scheduler_slots', 'schedulerid', $schedulerid, 'starttime');\n $retainedslots = array();\n if ($slots){\n foreach($slots as $slot){\n $slot->population = count_records('scheduler_appointment', 'slotid', $slot->id);\n $slot->appointed = ($slot->population > 0);\n $slot->attended = record_exists('scheduler_appointment', 'slotid', $slot->id, 'attended', 1);\n if ($studentside){\n $slot->appointedbyme = record_exists('scheduler_appointment', 'slotid', $slot->id, 'studentid', $studentid);\n if ($slot->appointedbyme) {\n $retainedslots[] = $slot;\n continue;\n }\n }\n // both side, slot is not complete\n if ($slot->exclusivity == 0 or ($slot->exclusivity > 0 and $slot->population < $slot->exclusivity)){\n $retainedslots[] = $slot;\n continue;\n }\n } \n }\n \n return $retainedslots;\n}", "public function list_bookings_for_day() {\n\t\t$bookings_by_time = array();\n\t\t$all_day_bookings = array();\n\t\t$unqiue_ids = array();\n\n\t\tforeach ( $this->bookings as $booking ) {\n\t\t\tif ( $booking->is_all_day() ) {\n\t\t\t\t$all_day_bookings[] = $booking;\n\t\t\t} else {\n\t\t\t\t$start_time = $booking->get_start_date( '', 'Gi' );\n\n\t\t\t\tif ( ! isset( $bookings_by_time[ $start_time ] ) )\n\t\t\t\t\t$bookings_by_time[ $start_time ] = array();\n\n\t\t\t\t$bookings_by_time[ $start_time ][] = $booking;\n\t\t\t}\n\t\t\t$unqiue_ids[] = $booking->product_id . $booking->resource_id;\n\t\t}\n\n\t\tksort( $bookings_by_time );\n\n\t\t$unqiue_ids = array_flip( $unqiue_ids );\n\t\t$index = 0;\n\t\t$colours = array( '#3498db', '#34495e', '#1abc9c', '#2ecc71', '#f1c40f', '#e67e22', '#e74c3c', '#2980b9', '#8e44ad', '#2c3e50', '#16a085', '#27ae60', '#f39c12', '#d35400', '#c0392b' );\n\n\t\tforeach ( $unqiue_ids as $key => $value ) {\n\t\t\tif ( isset( $colours[ $index ] ) )\n\t\t\t\t$unqiue_ids[ $key ] = $colours[ $index ];\n\t\t\telse\n\t\t\t\t$unqiue_ids[ $key ] = $this->random_color();\n\n\t\t\t$index++;\n\t\t}\n\n\t\t$column = 0;\n\n\t\tforeach ( $all_day_bookings as $booking ) {\n\t\t\techo '<li data-tip=\"' . $this->get_tip( $booking ) . '\" style=\"background: ' . $unqiue_ids[ $booking->product_id . $booking->resource_id ] . '; left:' . 100 * $column . 'px; top: 0; bottom: 0;\"><a href=\"' . admin_url( 'post.php?post=' . $booking->id . '&action=edit' ) . '\">#' . $booking->id . '</a></li>';\n\t\t\t$column++;\n\t\t}\n\n\t\t$start_column = $column;\n\t\t$last_end = 0;\n\n\t\tforeach ( $bookings_by_time as $bookings ) {\n\t\t\tforeach ( $bookings as $booking ) {\n\n\t\t\t\t$start_time = $booking->get_start_date( '', 'Gi' );\n\t\t\t\t$end_time = $booking->get_end_date( '', 'Gi' );\n\n\t\t\t\t$height = ( $end_time - $start_time ) / 1.66666667;\n\t\t\t\tif ( $height < 30 ) {\n\t\t\t\t\t$height = 30;\n\t\t\t\t}\n\n\t\t\t\tif ( $last_end > $start_time )\n\t\t\t\t\t$column++;\n\t\t\t\telse\n\t\t\t\t\t$column = $start_column;\n\n\t\t\t\techo '<li data-tip=\"' . $this->get_tip( $booking ) . '\" style=\"background: ' . $unqiue_ids[ $booking->product_id . $booking->resource_id ] . '; left:' . 100 * $column . 'px; top: ' . ( $start_time * 60 ) / 100 . 'px; height: ' . $height . 'px;\"><a href=\"' . admin_url( 'post.php?post=' . $booking->id . '&action=edit' ) . '\">';\n\t\t\t\t\techo '<small>Booking #' . $booking->id . '</small>';\n\t\t\t\t\techo '</br>';\n\t\t\t\t\techo '<h4>';\n\t\t\t\t\tif ( $product = $booking->get_product() ) {\n\t\t\t\t\t\techo $product->get_title();\n\t\t\t\t\t}\n\t\t\t\t\techo '</h4>';\n\t\t\t\t\t// if ( $resource = $booking->get_resource() )\n\t\t\t\t\t// \techo '<p>' . __( 'Resource #', 'woocommerce-bookings' ) . $resource->ID . ' - ' . $resource->post_title . '</p>';\n\t\t\t\t\tif ( $booking->is_all_day() )\n\t\t\t\t\t\techo '<div>' . __( 'All Day', 'woocommerce-bookings' ) . '</div>';\n\t\t\t\t\telse\n\t\t\t\t\t \techo '<div>' . $booking->get_start_date( '', 'g:ia' ) . '&mdash;' . $booking->get_end_date( '', 'g:ia' ). '</div>' ;\n\t\t\t\t\tif ( ( $customer = $booking->get_customer() ) && ! empty( $customer->name ) ) {\n\t\t\t\t\t\techo '<div>' . __( 'Booked by', 'woocommerce-bookings' ) . ' ' . $customer->name . '</div>';\n\t\t\t\t\t}\n\t\t\t\t\techo '</a>';\n\t\t\t\techo '</li>';\n\n\t\t\t\tif ( $end_time > $last_end )\n\t\t\t\t\t$last_end = $end_time;\n\t\t\t}\n\t\t}\n\t}", "public function slots($from,$to,$from_date,$to_date,$court){\n if($from_date == $to_date){\n $slots = $to - $from;\n $data = [];\n for($i=$from;$i<=$to;$i++){\n $a=[];\n $a['date'] = $from_date;\n $a['slot'] = $i;\n $a['price'] = $this->price_of_slot($a['slot'],$a['date'],$court);\n $f = Carbon::parse('00:00:00 1-1-2020');\n $t = Carbon::parse('00:30:00 1-1-2020');\n $fr =$f->addMinutes(30*$i)->format('H:i');\n $tu =$t->addMinutes(30*$i)->format('H:i');\n $a['from'] = $fr;\n $a['to'] = $tu;\n array_push($data, $a);\n }\n }else{\n $days_difference = Carbon::parse($to_date)->diffInDays(Carbon::parse($from_date));\n $dates = [];\n $dates['dates'] = [];\n $data = [];\n for ($i=0;$i<=$days_difference;$i++){\n if($i==0){\n $dates['from'] = Carbon::parse($from_date)->addDays($i)->format('Y-m-d');\n }elseif($i==$days_difference){\n $dates['to'] = Carbon::parse($from_date)->addDays($i)->format('Y-m-d');\n }else{\n array_push($dates['dates'],Carbon::parse($from_date)->addDays($i)->format('Y-m-d'));\n }\n }\n\n //From slots\n\n for($i=$from;$i<=48;$i++){\n $a=[];\n $a['date'] = $dates['from'];\n $a['slot'] = $i;\n $a['price'] = $this->price_of_slot($a['slot'],$a['date'],$court);\n $f = Carbon::parse('00:00:00 1-1-2020');\n $t = Carbon::parse('00:30:00 1-1-2020');\n $fr =$f->addMinutes(30*$i)->format('H:i');\n $tu =$t->addMinutes(30*$i)->format('H:i');\n $a['from'] = $fr;\n $a['to'] = $tu;\n array_push($data, $a);\n }\n\n\n //Middle slots\n\n if(!empty($dates['dates'])){\n foreach ($dates['dates'] as $obj){\n for($i=1;$i<=48;$i++){\n $a=[];\n $a['date'] = $obj;\n $a['slot'] = $i;\n $a['price'] = $this->price_of_slot($a['slot'],$a['date'],$court);\n $f = Carbon::parse('00:00:00 1-1-2020');\n $t = Carbon::parse('00:30:00 1-1-2020');\n $fr =$f->addMinutes(30*$i)->format('H:i');\n $tu =$t->addMinutes(30*$i)->format('H:i');\n $a['from'] = $fr;\n $a['to'] = $tu;\n array_push($data, $a);\n }\n }\n }\n\n //End slots\n\n for($i=1;$i<=$to;$i++){\n $a=[];\n $a['date'] = $dates['to'];\n $a['slot'] = $i;\n $a['price'] = $this->price_of_slot($a['slot'],$a['date'],$court);\n $f = Carbon::parse('00:00:00 1-1-2020');\n $t = Carbon::parse('00:30:00 1-1-2020');\n $fr =$f->addMinutes(30*$i)->format('H:i');\n $tu =$t->addMinutes(30*$i)->format('H:i');\n $a['from'] = $fr;\n $a['to'] = $tu;\n array_push($data, $a);\n }\n\n\n }\n\n return $data;\n\n\n\n }", "public function getAvailableTimeslots($bandId) {\n \n App::uses('CakeTime', 'Utility');\n \n // get all slots\n $slots = $this->_toWeekCalendarForm($this->find('all', array(\n // contain nothing\n 'contain' => array(\n /*'Slot' => array(\n \n )*/\n )\n )));\n // get today's date\n $today = CakeTime::format(time(), '%G-%m-%d');\n debug(CakeTime::format('+0 days', '%G-%m-%d'));\n // This returns ISO standard Monday => 1 ... Sunday => 7, so -1\n // to get the TTSS standard :)\n $dayOfWeek = CakeTime::format(time(), '%u') -1;\n \n $ret = array('slot_txt' => array(), 'date' => array(), 'slot_id' => array());\n // Create two days\n // Oh my god what a mess...\n for($i=1; $i <= 2; $i++) {\n $date = CakeTime::format('+'.$i.' days', '%G-%m-%d');\n $dow = CakeTime::format('+'.$i.' days', '%u') -1;\n for($j=0; $j < count($slots[$dow]); $j++) { \n $ret['text'][] = $slots[$dow][$j]['text'].' '.$date;\n $ret['date'][] = $date;\n $ret['slot_id'][] = $slots[$dow][$j]['id'];\n }\n }\n \n /*$bandData = $this->find('first', array(\n 'conditions' => array(\n 'Band.id' => $id,\n ),\n 'contain' => array(\n 'HasConstReservAccount' => array(\n 'OwnsSlot',\n ),\n 'HasReservAccount' => array(\n \n ),\n 'Member' => array(\n \n ),\n ),\n \n ));*/\n \n return $ret;\n \n }", "public function findAppointmentQueue($slotid,$bookdate){\r\n $appointment = new UserAppoinment();\r\n $findQueueBook = $appointment->findQueueBooking($slotid,$bookdate);\r\n return $findQueueBook;\r\n \r\n }", "public function booking(){\n\n $arrayBookings = $this->array_bookings;\n $arrival_date = $this->fecha_ini;\n $departure_date = $this->fecha_fin;\n\n $habitaciones = array();\n\n foreach ($arrayBookings as $reservacion) {\n\n\n if (($reservacion->getFechaIni() < $arrival_date) && ($reservacion->getFechaFin()<$departure_date || $reservacion->getFechaFin()>$departure_date)) {\n if($reservacion->getFechaFin()<$arrival_date==false){\n //echo \"<hr>\";\n //echo \"Booked: \".$reservacion->getId().\"<hr>\";\n\n for($i = 0; $i<count($reservacion->getHabitaciones());$i++){\n array_push($habitaciones, $reservacion->getHabitacion($i));\n }\n\n\n }\n }else{\n if($reservacion->getFechaIni()>=$arrival_date && $reservacion->getFechaIni()<=$departure_date){\n if ($reservacion->getFechaFin()<=$departure_date || $reservacion->getFechaFin()>$departure_date) {\n // echo \"<hr>\";\n // echo \"Booked: \".$reservacion->getId().\"<br>\";\n for($i = 0; $i<count($reservacion->getHabitaciones());$i++){\n array_push($habitaciones, $reservacion->getHabitacion($i));\n }\n\n }\n }\n }\n\n }\n\n\n return $habitaciones;\n }", "public function get_next_booking(){\n $booking=array();\n $days=array();\n for($count=0;$count<7;$count++){\n $i=$count;\n $date=date('Y-m-d', strtotime(\"+\".$i.\" days\"));\n $book=$this->Admbookings-> filter_by_date($date);\n array_push($booking,sizeof($book));\n array_push($days,$date);\n }\n return array($days,$booking);\n }", "function getOverbookings($numOfPersonForRoomType, $startDate, $endDate, &$rooms) {\n\t$startDate = str_replace('/', '-', $startDate);\n\t$endDate = str_replace('/', '-', $endDate);\n\tlist($startYear, $startMonth, $startDay) = explode('-', $startDate);\n\tlist($endYear, $endMonth, $endDay) = explode('-', $endDate);\n\t$startMonth = __getNormalizedDate($startMonth);\n\t$startDay = __getNormalizedDate($startDay);\n\t$endMonth = __getNormalizedDate($endMonth);\n\t$endDay = __getNormalizedDate($endDay);\n\t$startDate = \"$startYear-$startMonth-$startDay\";\n\t$endDate = \"$endYear-$endMonth-$endDay\";\n\tlogDebug(\"getOverbookings() - From: $startDate, To: $endDate\");\n\t$overbookings = array();\n\tforeach($numOfPersonForRoomType as $roomTypeId => $numOfPerson) {\n\t\t$datesUnavailable = array();\n\t\tlogDebug(\"getOverbookings() - checking room type ($roomTypeId)\");\n\t\tfor($currDate = $startDate; $currDate <= $endDate; $currDate = date('Y-m-d', strtotime(\"$currDate +1 day\"))) {\n\t\t\t$availableBeds = 0;\n\t\t\tforeach($rooms as $roomId => $roomData) {\n\t//\t\t\tlogDebug(\"for room id: $oneRoomId, the data is: \" . print_r($rooms[$oneRoomId], true));\n\t\t\t\tif($roomData['room_type_id'] != $roomTypeId) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$beds = getNumOfAvailBeds($rooms[$roomId], $currDate);\n\t\t\t\tif((isPrivate($rooms[$roomId]) or isApartment($rooms[$roomId])) and $beds < $rooms[$roomId]['num_of_beds']) {\n\t\t\t\t\t$beds = 0;\n\t\t\t\t}\n\t\t\t\t$availableBeds += $beds;\n\t\t\t}\n\t\t\tlogDebug(\"getOverbookings() - Available beds: $availableBeds for date: $currDate\");\n\n\t\t\tif($availableBeds < $numOfPerson) {\n\t\t\t\t$datesUnavailable[$currDate] = $availableBeds;\n\t\t\t}\n\t\t}\n\t\tif(count($datesUnavailable) > 0) {\n\t\t\t$overbookings[$roomTypeId] = $datesUnavailable;\n\t\t}\n\t}\n\n\tlogDebug(\"getOverbookings() - returning: \" . print_r($overbookings, true));\n\treturn $overbookings;\n}", "function searchBooking($bookings, $start_time, $lab_id, $date)\n {\n $booking = [];\n \n for($x = 0; $x < count($bookings); $x++)\n {\n if (\n $bookings[$x]->start_time == $start_time &&\n $bookings[$x]->lab_id == $lab_id && \n $bookings[$x]->date == $date \n )\n $booking = $bookings[$x];\n }\n return $booking;\n }", "public static function get_available_delivery_slots_by_date( $vendor_id, $vendor_order_per_slot, $date ) {\n global $wpdb;\n\n $delivery_slots = [];\n $blocked_slots = [];\n\n if ( empty( $vendor_id ) || empty( $date ) || -1 === $vendor_order_per_slot ) {\n return $delivery_slots;\n }\n\n $default_delivery_slots_all = self::get_delivery_slot_settings( $vendor_id );\n\n if ( empty( $default_delivery_slots_all ) ) {\n return $delivery_slots;\n }\n\n $current_date = dokan_current_datetime();\n $current_date = $current_date->modify( $date );\n $day = strtolower( trim( $current_date->format( 'l' ) ) );\n $default_delivery_slots = isset( $default_delivery_slots_all[ $day ] ) ? $default_delivery_slots_all[ $day ] : [];\n\n if ( empty( $default_delivery_slots ) ) {\n return $delivery_slots;\n }\n\n // Vendor vacation support\n $vendor_infos = dokan()->vendor->get( $vendor_id )->get_shop_info();\n\n $vendor_vacation_active = isset( $vendor_infos['setting_go_vacation'] ) ? $vendor_infos['setting_go_vacation'] : '';\n $vendor_vacation_style = isset( $vendor_infos['settings_closing_style'] ) ? $vendor_infos['settings_closing_style'] : '';\n\n if ( 'yes' === $vendor_vacation_active && 'instantly' === $vendor_vacation_style ) {\n return $delivery_slots;\n }\n\n $vendor_vacation_dates = ( isset( $vendor_infos['seller_vacation_schedules'] ) && is_array( $vendor_infos['seller_vacation_schedules'] ) ) ? $vendor_infos['seller_vacation_schedules'] : [];\n foreach ( $vendor_vacation_dates as $vacation_date ) {\n if ( ( $date >= $vacation_date['from'] ) && ( $date <= $vacation_date['to'] ) ) {\n return $delivery_slots;\n }\n }\n\n // When vendor order per slot is 0, no limitation on delivery time slots\n if ( 0 === (int) $vendor_order_per_slot ) {\n return $default_delivery_slots;\n }\n\n $blocked_slots_result = $wpdb->get_results(\n $wpdb->prepare(\n \"SELECT slot, COUNT(*) AS count\n FROM {$wpdb->prefix}dokan_delivery_time\n where vendor_id = %d\n AND date = %s\n GROUP BY slot\n HAVING count >= %d\",\n $vendor_id,\n $date,\n absint( $vendor_order_per_slot )\n )\n );\n\n foreach ( $blocked_slots_result as $blocked_slot ) {\n $blocked_slots[ $blocked_slot->slot ] = $blocked_slot->slot;\n }\n\n $delivery_slots = array_diff_key( $default_delivery_slots, array_flip( $blocked_slots ) );\n\n return $delivery_slots;\n }", "public function searchBookingSlots ($id) {\n if (!isset($_SESSION[\"userSession\"])){//if not logged in, do nothing\n return false;\n }else{\n return $this->connectPDO(function($conn) use($id){//closure\n //query\n $st = $conn->prepare(\"SELECT * FROM booking_slots b WHERE b.s_id = :id AND b.availability = TRUE\");\n $st->bindValue(\":id\", $id); // biding id of service provider\n $st->execute();// executing query\n if($st->rowCount() > 0){// if there is any result\n $bookingSlots = []; // initialise booking slots list\n foreach ($st->fetchAll() as $row) {// looping through the result set\n /**\n * openning constructor of BookingSlot, constructor gets 3 parameters (a, b, c)\n */\n $bookingSlot = new BookingSlot(\n $row[\"timestamp\"], $row[\"s_id\"], $row[\"availability\"]\n );\n //appending bookingSlot to the array of bookingSlots.\n array_push($bookingSlots, $bookingSlot);\n }\n //return array of bookings slots\n return $bookingSlots;\n }else{\n return [];// return empty array if no results were found\n }\n });\n }\n }", "public function getSlotsGroupedByDays() {\n\t\t$slots = $this->getSlots();\n\n\t\t$grouped_slots = array();\n\t\tforeach ($slots as $slot) {\n\t\t\t$day = date('Y-m-d', $slot->title);\n\n\t\t\t$grouped_slots[$day][$slot->title] = $slot;\n\t\t}\n\n\t\treturn $grouped_slots;\n\t}", "public function currentDayBookings(){\n\n return $this->where('start_date', date('Y-m-d'))->get();\n\n }", "function get_bookings(){\n\t\t$bookings = array();\n\t\tforeach( $this->get_event()->get_bookings()->bookings as $EM_Booking ){\n\t\t\tforeach($EM_Booking->get_tickets_bookings()->tickets_bookings as $EM_Ticket_Booking){\n\t\t\t\tif( $EM_Ticket_Booking->ticket_id == $this->ticket_id ){\n\t\t\t\t\t$bookings[$EM_Booking->booking_id] = $EM_Booking;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->bookings = new EM_Bookings($bookings);\n\t\treturn $this->bookings;\n\t}", "public function getavailableslotbyapplication (Request $request,Application $application){\n $parameters = $request->all();\n $slots = Slot::all()->groupBy('id');\n // GET BOOKED SLOT\n $selected_date = explode('-', $parameters['date']);\n $holiday = \\Carbon\\Carbon::createFromDate($selected_date[0], $selected_date[1], $selected_date[2])->isWeekend();\n if ($holiday) {\n \treturn response()->json([\n\t 'status' => 500 // holiday\n\t ]);\n }\n $applications = Application::latest();\n $applications = $applications->whereDate('start', '=', $parameters['date']);\n $applications = $applications->whereHas('booking', function ($query) use ($application) {\n\t $query->whereHas('service', function ($query2) use ($application) {\n\t $query2->where('id', '=', $application->booking->service->id);\n\t });\n\t })->get()->groupBy('slot_id');\n // GET BLOCK SLOT\n $allblocks = Block::where('module_id',1)->get();\n // dd($allblacks);\n $allblocks = $allblocks->map(function ($block) use($parameters,$application) {\n $curdata = explode(\",\", $block->data);\n // filter for slot and date\n if ($curdata[1]==$application->booking->service->id && $curdata[2]==$parameters['date']) {\n return [\n 'id' => $block->id,\n 'data' => $curdata,\n 'created_at' => $block->created_at,\n 'updated_at' => $block->updated_at,\n 'module_id' => $block->module_id,\n 'user_id' => $block->user_id\n ];\n }else{\n return null;\n }\n \n });\n // remove the null values\n $allblocks = $allblocks->filter();\n \n // ok begin filter\n // mapkan utk dpt service id je\n $allblocks = $allblocks->mapWithKeys(function ($block) {\n return [$block['data'][0] => ['serviceid'=>$block['data'][1],'blockid'=>$block['id'],'slot_id'=>$block['data'][0]]];\n });\n // dd($slots,$applications->toArray(),$allblocks->toArray());\n // return slots in json\n foreach ($slots as $key => $value) {\n \t// first foreget if booked\n \tif (array_key_exists($key, $applications->toArray())) {\n\t\t\t $slots->forget($key);\n\t\t\t}\n\t\t\tif (array_key_exists($key, $allblocks->toArray())) {\n\t\t\t $slots->forget($key);\n\t\t\t}\n\t\t\t// forget if blocked\n }\n\n return response()->json([\n 'success' => 200,\n 'data' => $slots\n ]);\n // dd($applications,$slots,$application->booking->service->id,$parameters);\n }", "private function __checkAdobeConnectMeetingSlots($date)\n {\n $range1 = strtotime(date('Y-m-d'));\n\t\t$range2 = strtotime(date('Y-m-d'). '+30days');\n\n\t\t$timeT1 = strtotime(date($date));\n\t\t$timeT2 = strtotime(date($date));\n\t\t$timeArray = array();\n\t\t$timeArray[] = date('Y-m-d', $timeT1);\n\t\twhile($timeT1 > strtotime(date('Y-m-d'). '-30days')) {\n\t\t\t$timeT1 = strtotime((date('Y-m-d', $timeT1).' -14days'));\n\t\t\tif($timeT1 >= $range1){\n\t\t\t\t$timeArray[] = date('Y-m-d',$timeT1);\n\t\t\t}\n\t\t}\n\t\twhile(strtotime(date('Y-m-d'). '+30days') > $timeT2) {\n\t\t\t$timeT2 = strtotime((date('Y-m-d', $timeT2).' +14days'));\n\t\t\tif($timeT2 <= $range2){\n\t\t\t\t$timeArray[] = date('Y-m-d',$timeT2);\n\t\t\t}\n\t\t}\n\t\t$data = $this->AdobeConnectMeeting->find('all');\t\t\n\t\t$availableSlots = array();\n\t\tforeach($data as $d) {\n\t\t\t$AdobeId = $d['AdobeConnectMeeting']['nmh'] % 4;\n\t\t\tswitch ($AdobeId) {\n\t\t\t\tcase 1:\n\t\t\t\t$slots = explode(',',Configure::read('SLOT_POSITION_FIRST'));\n\t\t\t\tforeach($slots as $position) {\n\t\t\t\t\t$usedSlots = $this->AvailableSlots->find('all',array('conditions'=>array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'AvailableSlots.nmh'=>$d['AdobeConnectMeeting']['nmh'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'AvailableSlots.slot_id'=>$position,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'AvailableSlots.date'=>$timeArray\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\tif(empty($usedSlots)){\n\t\t\t\t\t\t$availableSlots[][$d['AdobeConnectMeeting']['nmh']] = str_replace('t', '', $position);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t$slots = explode(',',Configure::read('SLOT_POSITION_SECOND'));\n\t\t\t\tforeach($slots as $position) {\n\t\t\t\t\t$usedSlots = $this->AvailableSlots->find('all',array('conditions'=>array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'AvailableSlots.nmh'=>$d['AdobeConnectMeeting']['nmh'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'AvailableSlots.slot_id'=>$position,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'AvailableSlots.date'=>$timeArray\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\tif(empty($usedSlots)){\n\t\t\t\t\t\t$availableSlots[][$d['AdobeConnectMeeting']['nmh']] = str_replace('t', '', $position);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t$slots = explode(',',Configure::read('SLOT_POSITION_THIRD'));\n\t\t\t\tforeach($slots as $position) {\n\t\t\t\t\t$usedSlots = $this->AvailableSlots->find('all',array('conditions'=>array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'AvailableSlots.nmh'=>$d['AdobeConnectMeeting']['nmh'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'AvailableSlots.slot_id'=>$position,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'AvailableSlots.date'=>$timeArray\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\tif(empty($usedSlots)){\n\t\t\t\t\t\t$availableSlots[][$d['AdobeConnectMeeting']['nmh']] = str_replace('t', '', $position);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tcase 0:\n\t\t\t\t$slots = explode(',',Configure::read('SLOT_POSITION_FOURTH'));\n\t\t\t\tforeach($slots as $position) {\n\t\t\t\t\t$usedSlots = $this->AvailableSlots->find('all',array('conditions'=>array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'AvailableSlots.nmh'=>$d['AdobeConnectMeeting']['nmh'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'AvailableSlots.slot_id'=>$position,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'AvailableSlots.date'=>$timeArray\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\tif(empty($usedSlots)){\n\t\t\t\t\t\t$availableSlots[][$d['AdobeConnectMeeting']['nmh']] = str_replace('t', '', $position);\n\t\t\t\t\t}\t\t \t\t\t\t\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t$slotArray = array();\n \t$finalArray = array();\n\t\tforeach($availableSlots as $xVal) {\n\t\t\tforeach($xVal as $key => $value){\t\t\t\t\t\n\t\t\t\tif(!in_array($value,$finalArray)){\n\t\t\t\t\tarray_push($finalArray,$value);\n\t\t\t\t\t$timing = $this->Adobeconnect->getSlotTimes('t'.$value);\n\t\t\t\t\t$slotArray[$value] = $key.';'.$timing;\n\t\t\t\t}\t\t\t \t\t\n\t\t\t}\t\t\t\t\t\n\t\t}\n\t\tksort($slotArray);\n\t\t$positionArray = array();\n\t\tforeach($slotArray as $x => $x_value) {\n\t\t\t$explodeData = explode(';',$x_value);\n\t\t\t$availSlot = $this->Encryption->encode($explodeData[0].':t'.$x);\n\t \t$positionArray[][$availSlot] = $explodeData[1];\n\t\t}\n\t\tif(!empty($positionArray)){\n\t\t\treturn $positionArray;\n\t\t}\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ public function insertFromWebsite Permite insertar un usuario que se ha registrado mediante el formulario del sitio web.
function insertFromWebsite() { $oAccesoDatos = new AccesoDatos(); $sQuery = ""; $nAfectados = -1; if ($this -> id == "" OR $this -> username == "" OR $this -> password == "" OR $this -> salt == "" OR $this -> type == "") throw new Exception("User->insertFromWebsite(): error de codificaci&oacute;n, faltan datos"); else { if ($oAccesoDatos -> conectar()) { $sQuery = "INSERT INTO app_user (id, username, password, salt, type, status, email) VALUES ('" . $this -> id . "', '" . $this -> username . "', '" . $this -> password . "', '" . $this -> salt . "', '" . $this -> type . "', '" . $this -> status . "', '" . $this -> email . "')"; $nAfectados = $oAccesoDatos -> ejecutarComando($sQuery); $oAccesoDatos -> desconectar(); } } return $nAfectados; }
[ "private function insertUser(){\n\t\t$data['tipoUsuario'] = Seguridad::getTipo();\n\t\tView::show(\"user/insertForm\", $data);\n\t}", "function insertUser(){\n\t\t$this->copyFrom('POST');\n\t\t$this->save(); // execute insert into the table\n }", "public function insert() {\n\t\t$this->insert_user();\n\t}", "function registerAdmin()//$RegistreerKlantVoornaam, $RegistreerKlantAchternaam, $RegistreerKlantEmail, $RegistreerKlantGebruikersnaam, $RegistreerKlantWachtwoord)\n {\n $sql = \"INSERT INTO user (firstname, surname, gender, birthday, country, city, postal_code, street, email, password, rights)\n\t\t\t\t\t\tVALUES ('$registerFirstname', '$registerSurname', '$registerGender', '$registerBirthday', '$registerCountry', '$registerCity', '$registerPostalcode', '$registerStreet', '$registerEmail', '$registerPassword', 'admin')\";\n $stm = $this->con->prepare($sql);\n $stm->execute();\n }", "function insertAdminUser() {\n // Insert Admin info;\n $userController = new UserController;\n $this->db->exec(\n \"INSERT INTO users (username, password) VALUES (?, ?)\",\n [\n 1 => $this->formValues['adminUsername'],\n 2 => $userController->cryptPassword($this->formValues['adminPassword_1']),\n ]\n );\n }", "function adicionarUsuario($nome, $CPF, $email, $senha, $cidade,$endereco, $sexo){\n if ($email<>\"adm@adm.com\") {\n $tipoUsuario = \"user\";\n }else{\n $tipoUsuario = \"admin\";\n }\n\n \n \n $insert = \"INSERT INTO tblUsuario(Nome, Email, Senha, CPF, endereco, tipoUsuario, sexo) VALUES('$nome', '$email', '$senha', '$CPF', '$endereco', '$tipoUsuario', '$sexo')\";\n\n $resultado = mysqli_query($cnx = conexao(),$insert);\n if(!$resultado) { die('Erro ao cadastrar usuário' . mysqli_error($cnx)); }\n return 'Usuario cadastrado com sucesso!';\n}", "public function registracija()\n\t{\n\t\t//session_start();\n\t\tif( !isset( $_POST['username'] ) || !isset( $_POST['password'] ) || !isset( $_POST['email'] ) )\n\t\t{\n\t\t\t$this->registry->template->errorMsg = 'Trebate unijeti korisničko ime, lozinku i e-mail adresu.';\n\t\t\t$this->registry->template->show( 'prijava_logiranje' );\n\t\t\texit();\n\t\t}\n\n\t\tif( !preg_match( '/^[A-Za-z]{3,10}$/', $_POST['username'] ) )\n\t\t{\n\t\t\t$this->registry->template->errorMsg = 'Username mora imati između 3 i 10 znakova i biti sastavljen samo od slova.';\n\t\t\t$this->registry->template->show( 'prijava_logiranje' );\n\t\t\texit();\n\t\t}\n\t\telse if( !filter_var( $_POST['email'], FILTER_VALIDATE_EMAIL) )\n\t\t{\n\t\t\t$this->registry->template->errorMsg = 'Email adresa nije valjana.';\n\t\t\t$this->registry->template->show( 'prijava_logiranje' );\n\t\t\texit();\n\t\t}\n\n\t\t$ts = new TrgovinaService();\n\n\t\t$rezultat = $ts->ispravnaRegistracija();\n\n\t\t$this->registry->template->errorMsg = 'Username je vec u upotrebi.';\n\t\tif($rezultat)\n\t\t{\n\t\t\t$this->registry->template->errorMsg = 'Registracija je uspjesno izvrsena. Prije mogucnosti logiranje treba potvrditi registraciju na mailu.';\n\t\t}\n\n\t\t$this->registry->template->show( 'prijava_logiranje' );\t\n\t\texit();\n\n\t}", "public function registerUser() {\n $db = new Database();\n $db->insertInto(\"`users` (`ID`, `email`) VALUES (NULL, :email)\", array(\":email\" => $this->email));\n }", "private function registerNewUser()\n {\n $userName = $_POST['user_name'];\n $userLogin = $_POST['user_login'];\n $userCurso = $_POST['user_curso'];\n $userEmail = $_POST['user_email'];\n $userTelefone = $_POST['user_fone'];\n $userSenha = $_POST['user_senha'];\n $userSenhaRepeat = $_POST['user_senha_repeat'];\n $userMatricula = $_POST['user_matricula'];\n\n\n if (empty($userName)) {\n $this->errors[] = \"Campo nome vazio\";\n } elseif (empty($userSenha) || empty($userSenhaRepeat)) {\n $this->errors[] = \"Campo senha vazio\";\n } elseif ($userSenha != $userSenhaRepeat) {\n $this->errors[] = \"Senhas incompativeis\";\n } elseif (strlen($userSenha) > 6) {\n $this->errors[] = \"A senha deve conter no maximo 6 caracteres\";\n } elseif (strlen($userLogin) > 64 || strlen($userLogin) < 2) {\n $this->errors[] = \"O campo Usuário deve conter no minino 5 caracteres\";\n }elseif (empty($userEmail)) {\n $this->errors[] = \"Campo email vazio\";\n }elseif (empty($userCurso)) {\n $thi->errors[] = \"Campo curso vazio\";\n } elseif (!filter_var($userEmail, FILTER_VALIDATE_EMAIL)) {\n $this->errors[] = \"Formato de email invalido\";\n } elseif (!empty($userName)\n && strlen($userLogin) <= 64\n && preg_match('/^[a-z\\d]{2,64}$/i', $userLogin)\n && !empty($userEmail)\n && filter_var($userEmail, FILTER_VALIDATE_EMAIL)\n && !empty($userSenha)\n && !empty($userSenhaRepeat)\n && ($userSenha === $userSenhaRepeat)\n && !empty($userCurso)\n && !empty($userTelefone)\n && !empty($userMatricula)\n ) {\n // create a database connection\r\n $this->db_connection = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);\r\n\n // change character set to utf8 and check it\r\n if (!$this->db_connection->set_charset(\"utf8\")) {\r\n $this->errors[] = $this->db_connection->error;\r\n }\r\n\r\n // if no connection errors (= working database connection)\n if (!$this->db_connection->connect_errno) {\n // escaping, additionally removing everything that could be (html/javascript-) code\n //$userLogin = $this->db_connection->real_escape_string(strip_tags($_POST['user_login'], ENT_QUOTES));\n //$userEmail = $this->db_connection->real_escape_string(strip_tags($_POST['user_email'], ENT_QUOTES));\n\n // crypt the user's password with PHP 5.5's password_hash() function, results in a 60 character\n // hash string. the PASSWORD_DEFAULT constant is defined by the PHP 5.5, or if you are using\n // PHP 5.3/5.4, by the password hashing compatibility library\n // $userSenhaRepeat = password_hash($userSenha, PASSWORD_DEFAULT);\n\n // check if user or email address already exists\n $sql = \"SELECT * FROM tbl_usuario WHERE USU_LOGIN = '$userLogin' OR USU_EMAIL ='$userEmail';\";\r\n $query_check_user_name = $this->db_connection->query($sql);\r\n\r\n if ($query_check_user_name->num_rows) {\r\n $this->errors[] = \"Usuário já existe no Banco\";\n } else {\n // write new user's data into database\n $sql = \"INSERT INTO tbl_usuario (USU_NOME,USU_TIPO,USU_MATRICULA, USU_CURSO, USU_EMAIL, USU_FONE, USU_ATIVO, USU_SENHA, USU_LOGIN)\r\n VALUES('$userName', '0' , '$userMatricula','$userCurso', '$userEmail', '$userTelefone', '1', '$userSenhaRepeat', '$userLogin ');\";\r\n $query_new_user_insert = $this->db_connection->query($sql);\n\r\n // if user has been added successfully\r\n if ($query_new_user_insert){\r\n $this->messages[] = \"Bolsista cadastrado com Sucesso!\";\n } else {\n $this->errors[] = \"Desculpe, ocorrou um erro ao cadastrar\";\n }\n }\n } else {\n $this->errors[] = \"Desculpe, Banco não conectado.\";\n }\n }else {\n $this->errors[] = \"Ocorreu um erro desconhecido\";\n //echo \" . mysql_error($this) . \\n\";\n\n }\n }", "function d7_pets_registration_insert($values) {\n db_insert('d7_pets_owners')\n ->fields([\n 'name' => $values['userName'],\n 'last_name' => $values['lastName'],\n 'owner_birthday' => $values['ownerBirthday'],\n 'pet_type' => $values['pets'],\n 'email' => $values['email']\n ])\n ->execute();\n cache_clear_all('d7_pets_registration_table', 'cache_d7_pets_registration');\n cache_clear_all('owners_by_pets', 'cache_views_data', TRUE);\n cache_clear_all('pet_owners', 'cache_views_data', TRUE);\n drupal_set_message(\n t(\"!name, you have registered successfully! Congrats!\", ['!name' => $values['userName']])\n );\n}", "private function add_user() {\n\t\t//add entry in login table\n\t\t$sql = \"insert into login(email,password,created_date) values('$this->user_id','$this->password', 'NOW()')\";\n\t\tif(!executeSql($sql, $this->conn)) {\n\t\t\treturn 'error';\n\t\t}\n\n\t\t//Note:- when ever new user is inserted, its pk should be added in register table\n\t\t//this is done by trigger refer db/triggers.txt\n\t\treturn true;\n\t}", "function insertUser($dados_user){\n global $conectar;\n if($dados_user != null){\n $nome = $dados_user[\"nome\"];\n $email = $dados_user[\"email\"];\n $senha = $dados_user[\"senha\"];\n $perfil = $dados_user[\"perfil\"];\n $status = $dados_user[\"status\"];\n //query para validar se existe o email cadastrado no banco\n $query_val = \"SELECT * FROM `tb_usuarios` WHERE `email`='$email'\";\n $result_val = mysql_query($query_val, $conectar);\n $val = mysql_num_rows($result_val);\n //se nao existir cadastra se existir mostra erro\n if ($val <= 0) {\n //executa o cadastro dos dados do usuario\n $query = \"INSERT INTO `tb_usuarios` (`nome`, `email`, `senha`, `perfil`,`status`)\n VALUES ('$nome', '$email', '$senha', '$perfil','$status')\";\n mysql_query($query, $conectar);\n //incerra a conexao com banco\n mysql_close();\n //retorna o resultado como verdadeiro\n return true;\n } else {\n return false;\n }\n }\n }", "function tb_empresa_insert(){\n\tglobal $Translation;\n\n\t// mm: can member insert record?\n\t$arrPerm=getTablePermissions('tb_empresa');\n\tif(!$arrPerm[1]){\n\t\treturn false;\n\t}\n\n\t$data['str_nome_fantasia'] = makeSafe($_REQUEST['str_nome_fantasia']);\n\t\tif($data['str_nome_fantasia'] == empty_lookup_value){ $data['str_nome_fantasia'] = ''; }\n\t$data['str_responsavel'] = makeSafe($_REQUEST['str_responsavel']);\n\t\tif($data['str_responsavel'] == empty_lookup_value){ $data['str_responsavel'] = ''; }\n\t$data['relacionamento_id'] = makeSafe($_REQUEST['relacionamento_id']);\n\t\tif($data['relacionamento_id'] == empty_lookup_value){ $data['relacionamento_id'] = ''; }\n\t$data['cidade'] = makeSafe($_REQUEST['cidade']);\n\t\tif($data['cidade'] == empty_lookup_value){ $data['cidade'] = ''; }\n\t$data['uf'] = makeSafe($_REQUEST['uf']);\n\t\tif($data['uf'] == empty_lookup_value){ $data['uf'] = ''; }\n\tif($data['str_nome_fantasia']== ''){\n\t\techo StyleSheet() . \"\\n\\n<div class=\\\"alert alert-danger\\\">\" . $Translation['error:'] . \" 'Nome fantasia': \" . $Translation['field not null'] . '<br><br>';\n\t\techo '<a href=\"\" onclick=\"history.go(-1); return false;\">'.$Translation['< back'].'</a></div>';\n\t\texit;\n\t}\n\tif($data['str_responsavel']== ''){\n\t\techo StyleSheet() . \"\\n\\n<div class=\\\"alert alert-danger\\\">\" . $Translation['error:'] . \" 'Gerente da conta': \" . $Translation['field not null'] . '<br><br>';\n\t\techo '<a href=\"\" onclick=\"history.go(-1); return false;\">'.$Translation['< back'].'</a></div>';\n\t\texit;\n\t}\n\tif($data['relacionamento_id']== ''){\n\t\techo StyleSheet() . \"\\n\\n<div class=\\\"alert alert-danger\\\">\" . $Translation['error:'] . \" 'Relacionamento': \" . $Translation['field not null'] . '<br><br>';\n\t\techo '<a href=\"\" onclick=\"history.go(-1); return false;\">'.$Translation['< back'].'</a></div>';\n\t\texit;\n\t}\n\tif($data['uf']== ''){\n\t\techo StyleSheet() . \"\\n\\n<div class=\\\"alert alert-danger\\\">\" . $Translation['error:'] . \" 'UF': \" . $Translation['field not null'] . '<br><br>';\n\t\techo '<a href=\"\" onclick=\"history.go(-1); return false;\">'.$Translation['< back'].'</a></div>';\n\t\texit;\n\t}\n\n\t// hook: tb_empresa_before_insert\n\tif(function_exists('tb_empresa_before_insert')){\n\t\t$args=array();\n\t\tif(!tb_empresa_before_insert($data, getMemberInfo(), $args)){ return false; }\n\t}\n\n\t$o = array('silentErrors' => true);\n\tsql('insert into `tb_empresa` set `str_nome_fantasia`=' . (($data['str_nome_fantasia'] !== '' && $data['str_nome_fantasia'] !== NULL) ? \"'{$data['str_nome_fantasia']}'\" : 'NULL') . ', `str_responsavel`=' . (($data['str_responsavel'] !== '' && $data['str_responsavel'] !== NULL) ? \"'{$data['str_responsavel']}'\" : 'NULL') . ', `relacionamento_id`=' . (($data['relacionamento_id'] !== '' && $data['relacionamento_id'] !== NULL) ? \"'{$data['relacionamento_id']}'\" : 'NULL') . ', `cidade`=' . (($data['cidade'] !== '' && $data['cidade'] !== NULL) ? \"'{$data['cidade']}'\" : 'NULL') . ', `uf`=' . (($data['uf'] !== '' && $data['uf'] !== NULL) ? \"'{$data['uf']}'\" : 'NULL'), $o);\n\tif($o['error']!=''){\n\t\techo $o['error'];\n\t\techo \"<a href=\\\"tb_empresa_view.php?addNew_x=1\\\">{$Translation['< back']}</a>\";\n\t\texit;\n\t}\n\n\t$recID = db_insert_id(db_link());\n\n\t// hook: tb_empresa_after_insert\n\tif(function_exists('tb_empresa_after_insert')){\n\t\t$res = sql(\"select * from `tb_empresa` where `id`='\" . makeSafe($recID, false) . \"' limit 1\", $eo);\n\t\tif($row = db_fetch_assoc($res)){\n\t\t\t$data = array_map('makeSafe', $row);\n\t\t}\n\t\t$data['selectedID'] = makeSafe($recID, false);\n\t\t$args=array();\n\t\tif(!tb_empresa_after_insert($data, getMemberInfo(), $args)){ return $recID; }\n\t}\n\n\t// mm: save ownership data\n\tset_record_owner('tb_empresa', $recID, getLoggedMemberID());\n\n\treturn $recID;\n}", "public function classic_register()\n\t\t{\n\t\t\t$user_export = new user_no_id();\n\t\t\t\n\t\t\t$user_export->name = $_POST[\"name\"];\n\t\t\t$user_export->email =$_POST[\"email\"];\n\t\t\t$user_export->password = $_POST[\"password\"];\n\t\t\t$user_export->type = \"CLASSIC\";\n\t\t\t\n\t\t\t$this->add_new_user($user_export);\n\t\t\t$this->login_user($user_export);\n\t\t}", "public function insertUser($post);", "private function insertUser() {\n\t\tif (!Controller::isAdmin()) {\n\t\t\t$cmd = Yii::app()->db->createCommand();\n\t\t\t$cmd->insert('tbl_user_query', array('userID' => Yii::app()->user->getID(), 'queryID' => $this->queryID));\n\t\t}\n\t\t\n\t\t$admins = User::model()->findAllByAttributes(array('role' => User::ROLE_ADMINISTRATOR));\n\t\t$cmd = Yii::app()->db->createCommand();\n\t\t$cmd->text = 'INSERT INTO tbl_user_query(userID, queryID) VALUES (:userID, :queryID)';\n\t\t$cmd->bindValue(':queryID', $this->queryID, PDO::PARAM_INT);\n\t\t\n\t\tforeach ($admins as $admin) {\n\t\t\t$cmd->bindValue(':userID', $admin->userID, PDO::PARAM_INT);\n\t\t\t$cmd->execute();\n\t\t}\n\t}", "private function nuevoAdmin() {\n if ($_SERVER['REQUEST_METHOD'] != \"POST\") {\n $this->mostrarRespuesta($this->convertirJson($this->devolverError(1)), 405);\n }\n if (isset($this->datosPeticion['nombre'], $this->datosPeticion['apellidos'], $this->datosPeticion['expediente'], $this->datosPeticion['dni'], $this->datosPeticion['mail'], $this->datosPeticion['password'] )) {\n\n $nombre = $this->datosPeticion['nombre'];\n $apellidos = $this->datosPeticion['apellidos'];\n $expediente = $this->datosPeticion['expediente'];\n $dni = $this->datosPeticion['dni'];\n $password = $this->datosPeticion['password'];\n $mail = $this->datosPeticion['mail'];\n $rol = 1;\n\n if (!$this->existeUsuario($mail) && !$this->existeUsuario($dni) && !$this->existeUsuario($expediente)) {\n $query = $this->_conn->prepare(\"INSERT into usuarios (nombre,apellidos,expediente,dni,mail,password,rol) VALUES (:nombre,:apellidos,:expediente,:dni,:mail,:password,:rol)\");\n $query->bindValue(\":nombre\", $nombre);\n $query->bindValue(\":apellidos\", $apellidos);\n $query->bindValue(\":expediente\", $expediente);\n $query->bindValue(\":dni\", $dni);\n $query->bindValue(\":mail\", $mail);\n $query->bindValue(\":password\", sha1($password));\n $query->bindValue(\":rol\", $rol);\n $query->execute();\n if ($query->rowCount() == 1) {\n $id = $this->_conn->lastInsertId();\n $respuesta['estado'] = 'correcto';\n $respuesta['msg'] = 'Usuario administrador creado correctamente';\n $respuesta['usuario']['id'] = $id;\n $respuesta['usuario']['nombre'] = $nombre;\n $respuesta['usuario']['mail'] = $mail;\n $this->mostrarRespuesta($this->convertirJson($respuesta), 200);\n }\n else\n $this->mostrarRespuesta($this->convertirJson($this->devolverError(12)), 200);\n }\n else\n $this->mostrarRespuesta($this->convertirJson($this->devolverError(8)), 400);\n } else {\n $this->mostrarRespuesta($this->convertirJson($this->devolverError(7)), 400);\n }\n }", "public function insertNewUser() {\n\t\ttry {\n\t\t\t$insertSQL = \"INSERT INTO users(user_first, user_last, user_email, user_uid, user_pwd) VALUES(:first, :last, :email, :uid, :pwd);\";\n\t\t\t$stmtInsert = $this->connect()->prepare($insertSQL);\n\t\t\t$stmtInsert->execute(['first' => $this->first, 'last' => $this->last, 'email' => $this->email, 'uid' => $this->uid, 'pwd' => $this->pwd]);\n\t\t} catch (PDOException $e) {\n\t\t\techo $e.getMessage();\n\t\t}\n\t}", "public function registrazione(){\n $view = new VMobile();\n $u = $view->recuperaDati();\n $utente = new EUtente($u['username'],$u['password'],$u['email'],$u['nome'],$u['cognome']);\n $pm = FPersistentManager::getInstance();\n $id = $pm->store($utente);\n if(!$id) {\n header(\"HTTP/1.1 500 Internal Server Error\");\n } else {\n $utente = $pm->loadById(\"utente\", $id);\n $utente->codifica64();\n\n $view->mandaDati($utente);\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test load newest articles select.
public function testLoadNewestArticlesSelect() { $this->setTime(100); $sArticleTable = $this->_getArticleTable(); $oArticle = oxNew('oxArticle'); $this->setConfigParam('iNrofNewcomerArticles', 4); $this->setConfigParam('blNewArtByInsert', 0); $sExpt = "select * from $sArticleTable where oxparentid = ''"; $sExpt .= " and " . $oArticle->getSqlActiveSnippet() . " and oxissearch = 1"; $sExpt .= " order by oxtimestamp desc limit 4"; //testing over mock $oTest = $this->getMock(\OxidEsales\Eshop\Application\Model\ArticleList::class, array('selectString')); $oTest->expects($this->once())->method('selectString') ->with($sExpt); $this->setConfigParam('iNewestArticlesMode', 2); $oTest->loadNewestArticles(); $sExpt = "select * from $sArticleTable where oxparentid = ''"; $sExpt .= " and " . $oArticle->getSqlActiveSnippet() . " and oxissearch = 1"; $sExpt .= " order by oxtimestamp desc limit 5"; $oTest = $this->getMock(\OxidEsales\Eshop\Application\Model\ArticleList::class, array('selectString')); $oTest->expects($this->once())->method('selectString') ->with($sExpt); $this->setConfigParam('iNewestArticlesMode', 2); $oTest->loadNewestArticles(5); $sExpt = "select * from $sArticleTable where oxparentid = ''"; $sExpt .= " and " . $oArticle->getSqlActiveSnippet() . " and oxissearch = 1"; $sExpt .= " order by oxtimestamp desc limit 4"; $oTest = $this->getMock(\OxidEsales\Eshop\Application\Model\ArticleList::class, array('selectString')); $oTest->expects($this->once())->method('selectString') ->with($sExpt); $this->setConfigParam('iNewestArticlesMode', 2); $oTest->loadNewestArticles('spiderP'); }
[ "public function testLoadNewestArticlesSelectByInsert()\n {\n\n $this->setTime(100);\n\n $sArticleTable = $this->_getArticleTable();\n $oArticle = oxNew('oxArticle');\n\n $this->setConfigParam('iNrofNewcomerArticles', 4);\n $this->setConfigParam('blNewArtByInsert', 1);\n\n $sExpt = \"select * from $sArticleTable where oxparentid = ''\";\n $sExpt .= \" and \" . $oArticle->getSqlActiveSnippet() . \" and oxissearch = 1\";\n $sExpt .= \" order by oxinsert desc limit 4\";\n\n //testing over mock\n $oTest = $this->getMock(\\OxidEsales\\Eshop\\Application\\Model\\ArticleList::class, array('selectString'));\n $oTest->expects($this->once())->method('selectString')\n ->with($sExpt);\n $this->setConfigParam('iNewestArticlesMode', 2);\n $oTest->loadNewestArticles();\n }", "public function testMainArticlePageLoads() {\n\t\t$articleElement = $this->locatorObj->readConfigData ( \"mainArticleLocator\" );\n\t\t$articleCountLocator = $this->locatorObj->readConfigData ( \"articleCounter\" );\n\t\t$this->currentWindow ()->maximize ();\n\t\t$this->url ( \"/\" );\n\t\t$this->logger->info ( \"*************** start of MainArticlePageLoads testcase*********** \" );\n\t\t$this->applicationFunctionObj->navigateToMainPage ( $this );\n\t\t$this->applicationFunctionObj->waitUntilElementIsVisible ($this,$articleElement,\"name\" );\n\t\t$this->byName($articleElement)->click ();\n\t\t$this->logger->info ( \"Clicked Successfully on Main Article Page menu\" );\n\t\t$this->applicationFunctionObj->waitUntilElementIsVisible ( $this,$articleCountLocator ,\"xpath\" );\n\t\t$MainArticleCount = $this->byXPath ( $articleCountLocator )->text ();\n\t\t$this->logger->info ( \"The count value of the available results is fetched\" );\n\t\t$parts = explode ( ' ', $MainArticleCount );\n\t\t$count = ( int ) array_values ( $parts ) [0];\n\t\tif ($count > 25) {\n\t\t\t$this->logger->info ( \"Main Article page is loaded successfully and cunt is greaterthan 25\" );\n\t\t} else {\n\t\t\t$this->fail ( \"Main article page is not fully loaded\" );\n\t\t}\n\t\t$this->logger->info ( \"*************** end of MainArticlePageLoads testcase********** \" );\n\t}", "public function testLoadCategoryArticlesWithLimit()\n {\n\n $oTest = $this->getMock(\\OxidEsales\\Eshop\\Application\\Model\\ArticleList::class, array('_getCategorySelect', 'selectString'));\n\n $sArticleTable = $this->_getArticleTable();\n\n $oTest->expects($this->once())->method('_getCategorySelect')\n ->with($this->equalTo(\"`$sArticleTable`.`oxid`\"), $this->equalTo('testCat'), $this->equalTo(array(1)))\n ->will($this->returnValue('select * from oxcategories'));\n $oTest->expects($this->once())->method('selectString')\n ->with($this->equalTo('select * from oxcategories LIMIT 2'));\n\n $oTest->loadCategoryArticles('testCat', array(1), 2);\n }", "function fetchLatestFiveArticles() {\n\t\treturn $this->fetchAllArticles ( \"latest_articles_view\" );\n\t}", "public function testGetBasketArticles()\n {\n modConfig::getInstance()->setConfigParam( 'bl_perfLoadSelectLists', true );\n\n $oBasket = new oxbasket();\n $oBasket->addToBasket( $this->oArticle->getId(), 10 );\n $oBasket->addToBasket( $this->oVariant->getId(), 10 );\n $aIds = array( $this->oArticle->getId(), $this->oVariant->getId() );\n\n $iSelArticleId = $this->oArticle->getId();\n $blSelFound = false;\n\n foreach ( $oBasket->getBasketArticles() as $oArticle ) {\n\n // selection list check\n if ( $iSelArticleId == $oArticle->getId() ) {\n $aSelectList = $oArticle->getDispSelList();\n $blSelFound = isset( $aSelectList );\n }\n\n $this->assertTrue( in_array( $oArticle->getId(), $aIds ) );\n }\n\n if ( !$blSelFound ) {\n $this->fail( 'missing selection list' );\n }\n }", "public function testLoadTop5ArticlesAktion()\n {\n //testing over mock\n $oTest = $this->getMock(\\OxidEsales\\Eshop\\Application\\Model\\ArticleList::class, array('loadActionArticles'));\n $oTest->expects($this->once())->method('loadActionArticles')\n ->with('oxtop5');\n\n $this->setConfigParam('iTop5Mode', 1);\n $oTest->loadTop5Articles();\n }", "private function getLatestArticles() {\n/// \\todo: set limit per tsconfig or for each user individually\n/// \\todo: move to tx_newspaper_article?\n\n\t\t$row = tx_newspaper::selectRows(\n\t\t\t'uid',\n\t\t\t'tx_newspaper_article',\n\t\t\t'NOT is_template AND NOT deleted',\n\t\t\t'',\n\t\t\t'tstamp DESC',\n\t\t\tself::number_of_latest_articles\n\t\t);\n\n\t\t$article = array();\n\t\tfor ($i = 0; $i < sizeof($row); $i++) {\n\t\t\t$article[] = new tx_newspaper_Article(intval($row[$i]['uid']));\n\t\t}\n\n\t\treturn $article;\n\n\t}", "public function findTopNewsRecords()\n {\n /** @var $demand \\GeorgRinger\\News\\Domain\\Model\\Dto\\NewsDemand */\n $demand = $this->objectManager->get('GeorgRinger\\\\News\\\\Domain\\\\Model\\Dto\\\\NewsDemand');\n $demand->setStoragePage(2);\n\n // no matter about top news\n $demand->setTopNewsRestriction(0);\n $this->assertEquals((int)$this->newsRepository->findDemanded($demand)->count(), 5);\n\n // Only Top news\n $demand->setTopNewsRestriction(1);\n $this->assertEquals((int)$this->newsRepository->findDemanded($demand)->count(), 3);\n\n // Only non Top news\n $demand->setTopNewsRestriction(2);\n $this->assertEquals((int)$this->newsRepository->findDemanded($demand)->count(), 2);\n }", "public function _loadArticles()\n {\n $response = $this->client->request('GET', $this->_getArticlesUrl($this->page));\n $this->articles = json_decode($response->getBody(), true);\n $this->page++;\n }", "public function testLoadActionArticles()\n {\n if ($this->getTestConfig()->getShopEdition() == 'EE') {\n $this->markTestSkipped('This test is for Community or Professional edition only.');\n }\n\n $oTest = $this->getProxyClass('oxArticleList');\n $oTest->loadActionArticles('oxstart');\n $this->assertEquals(2, count($oTest));\n $this->assertTrue($oTest['2077'] instanceof Article);\n $this->assertTrue($oTest['943ed656e21971fb2f1827facbba9bec'] instanceof Article);\n $this->assertEquals(19, $oTest['2077']->getPrice()->getBruttoPrice());\n $this->assertEquals(\"Kuyichi Jeans Mick\", $oTest['943ed656e21971fb2f1827facbba9bec']->oxarticles__oxtitle->value);\n }", "public function testLazyLoadArticleThumb()\n {\n $oTest = $this->getProxyClass(\"oxArticleList\");\n $this->cleanTmpDir();\n $oTest->selectString(\"select oxid from oxarticles where oxid = '2000' or oxid = '1354' order by oxid\");\n //this should be lazy loaded\n $this->assertEquals('1354_th.jpg', $oTest['1354']->oxarticles__oxthumb->value);\n //article 2\n $this->assertEquals('2000_th.jpg', $oTest['2000']->oxarticles__oxthumb->value);\n }", "public function latest()\n {\n return Article::orderBy('created_at', 'desc')//sort latest first\n ->with('photos')//eager load nested photos\n ->take(config('newsportal.newsstand_articles', 10))//limit to the configured number\n ->get();\n }", "function getLastArticles(Application $app) {\n $sql = \"select art_id as id, art_title as titre, art_content as contenu from article order by art_id desc limit 5\";\n return $app['db']->fetchAll($sql);\n}", "public function test_latestData() {\n\t\t$this->testAction('/reading/latestData/25', array('method' => 'get'));\n\t\t$results = $this->vars;\n\t\t$this->assertEquals(2, count($results[\"readings\"]));\n\t}", "public function testFindRecent()\n {\n $table = TableRegistry::get('DebugKit.Requests');\n $query = $table->find('recent');\n $this->assertSame(10, $query->clause('limit'));\n $this->assertNotEmpty($query->clause('order'));\n }", "public function testFindRecent()\n {\n $table = $this->fetchTable('DebugKit.Requests');\n $query = $table->find('recent');\n $this->assertSame(10, $query->clause('limit'));\n $this->assertNotEmpty($query->clause('order'));\n }", "public function testLoadOrderArticlesWhenOneOfArticlesIsNotAwailableAnyMore()\n {\n $oOrder = oxNew('oxOrder');\n $oOrder->setId('_testOrderId_1');\n $oOrder->save();\n\n $oOrder->setId('_testOrderId_2');\n $oOrder->save();\n\n $oOrderArticle = oxNew('oxorderarticle');\n $oOrderArticle->setId('_testId');\n $oOrderArticle->oxorderarticles__oxartid = new oxField('9999', oxField::T_RAW);\n $oOrderArticle->oxorderarticles__oxorderid = new oxField('_testOrderId_1', oxField::T_RAW);\n $oOrderArticle->save();\n\n $oOrderArticle = oxNew('oxorderarticle');\n $oOrderArticle->setId('_testId2');\n $oOrderArticle->oxorderarticles__oxartid = new oxField('1651', oxField::T_RAW);\n $oOrderArticle->oxorderarticles__oxorderid = new oxField('_testOrderId_2', oxField::T_RAW);\n $oOrderArticle->save();\n\n $oOrders = oxNew('oxList');\n $oOrders->init('oxorder');\n $oOrders->selectString('select * from oxorder where oxid like \"\\_testOrderId%\" ');\n\n $oTest = oxNew('oxArticleList');\n $oTest->loadOrderArticles($oOrders);\n $this->assertEquals(2, $oTest->count());\n\n $this->assertTrue($oTest->offsetExists('9999'));\n $this->assertTrue($oTest->offsetExists('1651'));\n\n $this->assertTrue($oTest->offsetGet('9999')->isNotBuyable());\n $this->assertFalse($oTest->offsetGet('1651')->isNotBuyable());\n }", "public function findLatest($count = 6)\n {\n return $this\n ->createQueryBuilder('article')\n ->orderBy('article.publicationDate', 'desc')\n ->where('article.publicationStatus = :published')\n ->andWhere('article.publicationDate <= :now')\n ->setParameter('published', Article::PUBLICATION_STATUS_PUBLISHED)\n ->setParameter('now', new DateTime())\n ->setMaxResults($count)\n ->getQuery()\n ->getResult();\n }", "public function testPagination()\n {\n // Pagination is currently set at 5\n $articles = factory(Article::class, 6)->create();\n $response = $this->get('admin/articles');\n\n // Check for errors\n $response->assertStatus(200);\n\n // Check that there are 2 pages of results\n $paginator = $response->original->content->getItems();\n $this->assertEquals(2, $paginator->lastPage());\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A hook to be able to modify params prior as they are converted to JSON.
protected function convertParamsHook(&$object) { // Do customisation of the params field here for specific data. }
[ "protected function set_params() {}", "function _setJSONRequestArgument()\n\t{\n\t\tif($this->getRequestMethod() != 'JSON')\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$params = array();\n\t\tparse_str($GLOBALS['HTTP_RAW_POST_DATA'], $params);\n\n\t\tforeach($params as $key => $val)\n\t\t{\n\t\t\t$this->set($key, $this->_filterRequestVar($key, $val, 1), TRUE);\n\t\t}\n\t}", "protected function _serializeParams()\n {\n if (!empty($this->params) && is_array($this->params)) {\n $this->params = serialize($this->params);\n }\n }", "private function assignJSONParameters()\n {\n $_POST = json_decode(file_get_contents('php://input'), true);\n foreach ($_POST as $key => $data) {\n $this->{$key} = $data;\n }\n }", "abstract protected function setCustomParams();", "private function parseParams()\n {\n foreach ($this->input_methods as $key => $type) {\n $property = \"{$type}_params\";\n $this->{$property} = collect( filter_input_array( $type ) )\n ->map( function( $value ) {\n return $this->isJson( $value ) ? json_decode( $value ) : $value;\n });\n }\n }", "protected function processRequestParams(): void\n {\n $this->processLimit();\n $this->processLocale();\n }", "public function getJsonParams();", "protected function initParams()\n {\n $this->accessor->setRawValue\n (\n 'parameters',\n new FixedList(count($this->reflector->getParameters()))\n );\n $this->accessor->setRawValue\n (\n 'nativeParameters',\n new FixedList(count($this->reflector->getParameters()))\n );\n }", "public abstract function otherRequestParams();", "private function _set_param()\n {\n for ($i = 0; ($i + 4) <= (count($this->url_request) - 1); $i++)\n {\n if (!is_null(@$this->url_request[($i + 4)]))\n {\n $this->params[$i] = $this->url_request[($i + 4)];\n }\n else\n {\n break;\n }\n }\n }", "protected function _setParams()\n {\n if(isset($this->getRegistry()->params)) {\n $this->_params = $this->getRegistry()->params;\n }\n }", "public function controllerBeforeParams()\n {\n }", "private function set_params()\n {\n $this->params = json_decode(preg_replace($this->mask[0], $this->mask[1], file_get_contents(_GEN_ROOT . \"/data/params.json\")));\n\n $this->scheme = isset($_POST['scheme']) && in_array(preg_replace('/[^A-Za-z]*/', '', $_POST['scheme']), $this->params->scheme->options)\n ? $_POST['scheme']\n : $this->params->scheme->options[$this->params->scheme->value];\n\n $this->map = json_decode(preg_replace($this->mask[0], $this->mask[1], file_get_contents(_GEN_ROOT . \"/data/maps/$this->scheme.json\")));\n\n if ($this->locale === 'en') {\n $this->params->_template->locale = $this->params->_template->en->locale;\n $this->map->_tabs->width = $this->map->_tabs->width_eng;\n }\n }", "private function resetParams()\n {\n $this->_eventParams = [];\n }", "public function setInitialParams() { }", "protected function setRequestArgumentsFromJSON($request) {\n\t\t$requestArray = json_decode($request, TRUE);\n\t\tif (is_array($requestArray)) {\n\t\t\t\\TYPO3\\CMS\\Core\\Utility\\ArrayUtility::mergeRecursiveWithOverrule($this->requestArguments, $requestArray);\n\t\t}\n\t}", "protected function setParams() {\n if ($this->method === 'GET') {\n $this->params = $_GET;\n } elseif ($this->method = 'POST') {\n $this->params = $_POST;\n } else {\n $this->params = [];\n }\n }", "function __moveParamToNamed() {\n\t\t// convert $this->params['url']['q'] to $this->named['q'] so 'q' can be used by XHR\n\t\tif (!empty($this->params['url']['q'])) {\n\t\t\t$this->params['named']['q'] = $this->params['url']['q'];\n\t\t\t$this->passedArgs['q'] = $this->params['url']['q'];\n\t\t\tunset($this->params['url']['q']);\n\t\t}\t\t\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Pre process ignore values. Define key for array which will be ignored.
public function preProcessIgnoreValues(): array { return []; }
[ "private function preProcessIgnoreValues(array $values): array\n {\n foreach ($this->getItemsByShow($this->actionType) as $key => $element) {\n // auto remove index in case omit=>true\n if ($element['omit'] ?? false) {\n unset($values[$key]);\n }\n\n $ignores = $this->getInternalElement($key)->preProcessIgnoreValues();\n if ($ignores) { // if define ignore\n foreach ($ignores as $ignore) {\n unset($values[$ignore]);\n }\n }\n }\n return $values;\n }", "private function strip_exclusions(&$value, $key, $arr) {\n\t\t\n\t\tif(in_array($value->meta_key, $this->_wp_user_meta_exclusions)) {\n\t\t\t\n\t\t\tunset($arr[$key]);\n\t\t}\n\t}", "protected static function get_ignored_values() {\n\t\treturn array(\n\t\t\t'0',\n\t\t\t'1',\n\t\t\ttrue,\n\t\t\tfalse,\n\t\t\t'$counts',\n\t\t\t'$count',\n\t\t);\n\t}", "function addIgnoreFields($array) {\r\r\n\t\t$this->setIgnoreFields(array_unique(array_merge($this->ignorefields, $array)));\r\r\n\t}", "function sanitizeDataArray(array $data, array $ignoreFields = []): array {\n foreach ($data as $key => $value) {\n if (!in_array($key, $ignoreFields)) {\n $data[$key] = sanitizeData($value);\n }\n }\n\n return $data;\n}", "public function testFilterByKeysDefault()\n {\n $array = ['bar' => 'baz', 'controller' => 'Groups', 'action' => 'index'];\n $allowed = ['plugin', 'controller', 'action', 0];\n $expected = ['plugin' => null, 'controller' => 'Groups', 'action' => 'index', 0 => null];\n\n $result = Hash::filterByKeys($array, $allowed);\n $this->assertEquals($expected, $result);\n }", "function array_exclude($array,$excludeKeys){\n foreach($excludeKeys as $key){\n unset($array[$key]);\n }\n return $array;\n}", "public function testFilterKeysNonDestructive()\n\t{\n\t\t$original = ['a' => 0, 'b' => 1, 'c' => 2];\n\t\t$copy = $original;\n\n\t\tArr::filterKeys($original, []);\n\n\t\t$this->assertEquals($original, $copy);\n\t}", "public function setIgnoreFields($array)\n {\n $this->ignoreFields = array_merge($this->baseIgnoreFields, $array);\n }", "function array_disambiguate_empty_values($array){\n\tif(!is_array($array) || $GLOBALS === $array) return $array;\n\tforeach($array as $key => $value)\n\t\tif(is_array($value)) $array[$key] = call_user_func('array_disambiguate_empty_values', $value);\n\t\telse if(is_bool($value) || $value === NULL) $array[$key] = var_export($value, TRUE);\n\treturn $array;\n}", "public function setIgnore(array $ignore)\n {\n $this->ignore = $ignore;\n }", "function filterArrayKey($arr = array(), $allowedKey = array())\n{\n if (!empty($allowedKey)) {\n $arr = array_filter(\n $arr,\n function ($key) use ($allowedKey) {\n return in_array($key, $allowedKey);\n },\n ARRAY_FILTER_USE_KEY\n );\n }\n\n return $arr;\n}", "function filterKeys($array, $keep){}", "function array_snip($arr, $key){\n\tunset($arr[$key]);\n\treturn $arr;\n}", "function freeze(&$array) {\n \n foreach($array as $k=>$v) {\n $array[$k]->override = $array[$k]->value;\n }\n }", "public function testIgnoreExtraKeysNoException()\n {\n $node = new ArrayNode('roo');\n $node->setIgnoreExtraKeys(true);\n\n $node->normalize(array('foo' => 'bar'));\n $this->assertTrue(true, 'No exception was thrown when setIgnoreExtraKeys is true');\n }", "function correct_keys($array) {\n\t\t\t// after the key replacement phase to correct\n\t\t\t// conditional logic is complete\n\t\t\t$new_array = array();\n\t\t\tif (count($array)) {\n\t\t\t\tforeach ($array as $key => $value) {\n\t\t\t\t\tif (is_array($value)) {\n\t\t\t\t\t\t$new_array[$key] = $this->correct_keys($value);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (substr($value, 0, 6) == 'field_') {\n\t\t\t\t\t\t\t$value = preg_replace('/\\_\\[[0-9]+\\]\\_/', '', $value);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$new_array[$key] = $value;\n\t\t\t\t\t} // end if array else\n\t\t\t\t} // end foreach\n\t\t\t} // end if count\n\t\t\treturn $new_array;\n\t\t}", "function array_whitelist(array $array, array $whitelist = array()) {\n\treturn array_intersect_key($array, array_flip($whitelist));\n}", "protected function loadToIgnore(){\n\t\t\t$otherClass=$this->class;\n\t\t\t$this->toIgnore = array();\n\t\t\tif(isset($otherClass::$ignoreProperties) && is_array($otherClass::$ignoreProperties)){\n\t\t\t\t$this->toIgnore = $otherClass::$ignoreProperties;\n\t\t\t}\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
ensure that the index is current with the workspace
private function indexWorkspace(): void { foreach ($this->workspace as $document) { assert($document instanceof TextDocumentItem); try { $this->indexer->indexDirty( TextDocumentBuilder::fromUri($document->uri)->text($document->text)->build() ); } catch (TextDocumentNotFound) { } } }
[ "public function checkWorkspaceCurrent() {}", "public function indexIsSane() {\n return $this->indexExists();\n }", "public function doesIndexMatchWorkingTree(): bool\n {\n return $this->getStatusCode()[1] === self::UNMODIFIED;\n }", "function rebuild_index() {\n FWP()->indexer->index();\n exit;\n }", "protected function completeReindexMode() {}", "public function checkWorkspaceCurrent()\n {\n if (!isset($this->checkWorkspaceCurrent_cache)) {\n $this->checkWorkspaceCurrent_cache = $this->checkWorkspace($this->workspace);\n }\n return $this->checkWorkspaceCurrent_cache;\n }", "public function getActiveWorkspace();", "protected function getReferenceIndexStatus() {}", "public function getCurrentIndex(): int\n {\n }", "public function hasActiveWorkspace();", "protected function reindexStockIndex()\n {\n /** @var Mage_Index_Model_Indexer $indexer */\n $indexer = Mage::getSingleton('index/indexer');\n $process = $indexer->getProcessByCode('cataloginventory_stock');\n $process->reindexEverything();\n }", "public function is_initial_indexing()\n {\n }", "public function markAsIndexed(): void\n {\n return; // Perform some kind of action to indicate this object has been indexed\n }", "public function takeIndex()\n\t\t{\n\t\t\t$this->csv->takeIndexCSV();\n\t\t\t$this->txt->takeIndexTXT();\n\t\t}", "public function workspaceInit() {}", "public function hasValidIndex();", "public function indexIsEntry();", "function forceCurrentIndex($index)\n {\n $this->_forcedIndex = $index;\n $this->_forcedUrl = ''; \n }", "function is_sidebar_index_active(): bool {\n\treturn osetin_is_active_sidebar( CURRENT_SIDEBAR_INDEX );\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The operation that you want to perform. Set the value to RemoveSubInstance.
public function removeSubInstance($request) { $runtime = new RuntimeOptions([]); return $this->removeSubInstanceWithOptions($request, $runtime); }
[ "function removeSubaccount() {\r\n global $collection; \r\n if (!findAccount(UID)) {\r\n u(OUT)->failure(\"Could not find account\");\r\n return;\r\n } \r\n $subId = $_GET[\"subId\"];\r\n $subaccount = findSubaccount($subId);\r\n if (!$subaccount || $subaccount[\"parent\"] != UID) {\r\n u(OUT)->failure(\"Could not find subaccount\");\r\n } else {\r\n $queryId = array(\"owner_id\" => UID);\r\n $querySubaccount = array('_id' => new MongoID($subId));\r\n $collection->update($queryId, array('$pull' => array(\"subaccounts\" => $subId)));\r\n $collection->remove($querySubaccount);\r\n u(OUT)->success(\"Removed subaccount\", NULL, $subId); //orphaned subaccount contents??\r\n }\r\n }", "public function removeSubService(\\RKW\\RkwConsultant\\Domain\\Model\\SubService $subService)\n {\n $this->subService->detach($subService);\n }", "public function stopRemove()\n {\n $this->stopOperation('remove');\n }", "public function sub(int $subtrahend)\n {\n $this->total -= $subtrahend;\n }", "function removeSubCategory($id){\n }", "public function removeSubtable()\n {\n $this->c[self::DATATABLE_ASSOCIATED] = null;\n }", "public function removeFromParent();", "public function delete_instance() {\r\n\t\t//check the nonce field for security\r\n\t\tcheck_ajax_referer( $this->nonce, 'nonce' );\r\n\r\n\t\tif ( isset( $_POST['category'] )&& isset( $_POST['taxonomy'] ) ) {\r\n\t\t\t$res=$this->data_manager->delete_instance(\r\n\t\t\t\t$_POST['category'],\r\n\t\t\t\t$_POST['taxonomy'],\r\n\t\t\t\t$_POST['post_type'] );\r\n\t\t}\r\n\r\n\t\t$r = isset( $res ) && $res ? \"1\" : \"-1\";\r\n\t\techo $r;\r\n\t\texit;\r\n\t}", "function removeSubImages() {\n\t$removeimgids = processInputVar(\"removeimgid\", ARG_MULTINUMERIC);\n\t$imageid = getContinuationVar(\"imageid\");\n\t$data = getImages(0, $imageid);\n\tif(count($removeimgids)) {\n\t\t# remove selected images\n\t\t$rmids = implode(',', $removeimgids);\n\t\t$query = \"DELETE FROM subimages \"\n\t\t . \"WHERE imagemetaid = {$data[$imageid][\"imagemetaid\"]} AND \"\n\t\t . \"imageid IN ($rmids)\";\n\t\tdoQuery($query, 101);\n\n\t\t# check to see if any subimages left; if not, set subimages to 0\n\t\t$query = \"SELECT COUNT(imageid) \"\n\t\t . \"FROM subimages \"\n\t\t . \"WHERE imagemetaid = {$data[$imageid][\"imagemetaid\"]}\";\n\t\t$qh = doQuery($query, 101);\n\t\t$row = mysql_fetch_row($qh);\n\t\tif($row[0] == 0) {\n\t\t\t$query = \"UPDATE imagemeta \"\n\t\t\t . \"SET subimages = 0 \"\n\t\t\t . \"WHERE id = {$data[$imageid][\"imagemetaid\"]}\";\n\t\t\tdoQuery($query, 101);\n\t\t}\n\t}\n\n\teditOrAddImage(0);\n}", "public function unsetSubContent(AbstractClassContent $subContent)\n {\n foreach ($this->_data as $key => $value) {\n if (is_array($value)) {\n $totalContent = count($value);\n foreach ($value as $cKey => $cValue) {\n $contentUid = $cValue;\n if (is_array($cValue)) {\n $contentUid = array_values($cValue);\n $contentUid = end($contentUid);\n }\n\n if ($subContent->getUid() == $contentUid) {\n if (1 === $totalContent) {\n $this->_data[$key] = [];\n $this->_subcontent->removeElement($subContent);\n } else {\n unset($value[$cKey]);\n $this->_data[$key] = $value;\n }\n }\n }\n }\n }\n\n return $this;\n }", "public function delete_subadmin()\n\t{\n\t\tif ($this->checkLogin('A') == '') \n\t\t{\n\t\t\tredirect('admin');\n\t\t} \n\t\telse \n\t\t{\n\t\t\t$subadmin_id = $this->uri->segment(4, 0);\n\t\t\t$condition = array('id' => $subadmin_id);\n\t\t\t$this->subadmin_model->commonDelete(SUBADMIN, $condition);\n\t\t\t$this->setErrorMessage('success', 'Subadmin deleted successfully');\n\t\t\tredirect('admin/subadmin/display_sub_admin');\n\t\t}\n\t}", "public function deleteSubentryAction() {\r\n \t// check if logged in\r\n \t$this->verifyUser();\r\n\r\n\t\t// get subentry\r\n\t\t$subentry = $this->getSubentry($this->request->getParam('id'));\r\n\r\n\t\t// if owner\r\n\t\tif($subentry->getOwnerId() == $this->auth->getIdentity()->id) {\r\n\t\t\t// set as deleted\r\n\t\t\t$subentry->setDeleted(1);\r\n\t\t\t$subentry->save();\r\n\r\n\t\t\t// message\r\n\t\t\t$this->msg->messages[] = $this->translate->_(\"Diary record subentry deleted successfully.\");\r\n\t\t\t\r\n\t\t// not owner? message\r\n\t\t} else $this->msg->messages[] = $this->translate->_(\"Diary record subentry cannot be deleted. Only the owner of the diary record can delete it.\");\r\n\r\n\t\t// redirector\r\n \treturn $this->_helper->redirector('view', 'diary', 'frontend', array('id' => $subentry->getDiaryRecordId()));\r\n }", "public function setSubtaskId($value)\n {\n return $this->set(self::SUBTASK_ID, $value);\n }", "public function testRemove() {\n $adExtension = new AdExtension();\n $adExtension->id = $this->adExtensionId;\n\n $adExtensionOverride = new AdExtensionOverride();\n $adExtensionOverride->adId = $this->adIdWithExtension;\n $adExtensionOverride->adExtension = $adExtension;\n\n $operations =\n array(new AdExtensionOverrideOperation($adExtensionOverride, 'REMOVE'));\n $testAdExtensionOverride = $this->service->mutate($operations)->value[0];\n\n $this->assertEquals('DELETED', $testAdExtensionOverride->status);\n }", "public function delete_subadmin(){\n\t\tif ($this->checkLogin('A') == ''){\n\t\t\tredirect('admin_ror');\n\t\t}else {\n\t\t\t$subadmin_id = $this->uri->segment(4,0);\n\t\t\t$condition = array('id' => $subadmin_id);\n\t\t\t$this->subadmin_model->commonDelete(SUBADMIN,$condition);\n\t\t\t$this->setErrorMessage('success','Subadmin deleted successfully');\n\t\t\tredirect('admin/subadmin/display_sub_admin');\n\t\t}\n\t}", "public function DeleteInstance()\n {\n $sTmpInstanceID = $this->instanceID;\n $this->OnDeleteInstance();\n $this->instanceID = $sTmpInstanceID;\n $this->_ClearInstance();\n $sPageId = $this->global->GetUserData('pagedef');\n $this->RedirectToEditPage($sPageId);\n }", "public function delsubmeasure()\n\t{\n\t\t$idsubmeasure = $this->input->post('idsubmeasure');\n\t\t$idview = $this->input->post('idview');\n\t\t$parent = $this->input->post('parent');\n\t\t$this->msetup->delsubmeasure($idsubmeasure, $idview, $parent);\n\t}", "public function setSubLabel($sValue)\n {\n return $this->setProperty('subLabel', $sValue);\n }", "public function setSubType($value){\n return $this->setParameter('sub_type', $value);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test spy for mkdir
function mkdir($path, $mode = 0777, $recursive = false) { return DirStub::create($path, $mode, $recursive); }
[ "public function testMkdir() {\n $testDirName = self::TEST_DIR . '/testMkdir';\n\n (new Directory($testDirName))->mkdir();\n\n $this->assertDirectoryExists($testDirName);\n }", "public function testMakeDirectory()\n {\n $this->assertTrue(File::mkdir(self::$temp.DS.'created'));\n $this->assertTrue(is_dir(self::$temp.DS.'created'));\n }", "public function testMake(): void\n {\n $base = __DIR__ . '/directory_test';\n $dir = $base . '/test_make_dir';\n Dir::make($dir);\n $this->assertTrue(file_exists($dir) && is_dir($dir) && (@opendir($dir)));\n @rmdir($dir);\n\n $dir = $base . '/test_make_dir_mode';\n Dir::make($dir, 111);\n $this->assertTrue(file_exists($dir) && is_dir($dir) && (@opendir($dir) === false));\n @rmdir($dir);\n @rmdir($base);\n }", "public function testMkdir()\n {\n $dir = $this->filesystem->getActualFileDir('silvestra.png');\n $this->filesystem->mkdir($dir);\n\n $this->assertFileExists($dir);\n }", "protected function createRealTestdir() {}", "public function testDirectoryCreation()\n {\n $this->assertDirectoryExists($this->directory);\n }", "function createDirectory();", "function createDirectory($name) {}", "public function testCreatingDirectory(): void {\r\n\r\n $this -> assertFalse($this -> directory -> isReadable());\r\n $this -> assertFalse($this -> directory -> isWritable());\r\n $this -> assertFalse($this -> directory -> exists());\r\n\r\n $this -> directory -> create();\r\n $this -> directory -> setOwner('administrator');\r\n $this -> directory -> setGroupId(1000);\r\n\r\n $this -> assertTrue($this -> directory -> isReadable());\r\n $this -> assertTrue($this -> directory -> isWritable());\r\n $this -> assertTrue($this -> directory -> exists());\r\n\r\n $this -> directory -> delete();\r\n }", "public function testCreateDirectory(): void\n {\n $generatedPath = $this->getTestPath('generated/roo/bar/baz/foo');\n $generatedPathBase = $this->getTestPath('generated');\n // Delete the generated directory if it already exists\n if (is_dir($generatedPath)) {\n $this->assertTrue($this->driver->deleteDirectory($generatedPathBase));\n }\n $this->assertTrue($this->driver->createDirectory($generatedPath));\n $this->assertTrue(is_dir($generatedPath));\n }", "abstract function createDirectory($path);", "public function testWriteSupportDirectoriesMethod()\n {\n list($filesystem, $package) = $this->getMocks();\n\n $filesystem->shouldReceive('makeDirectory')->times(3)->andReturn(true)\n ->shouldReceive('put')->times(3)->andReturn(1);\n\n $creator = new PackageCreator($filesystem);\n $creator->writeSupportDirectories($package, __DIR__);\n }", "public function test_factory_not_exist()\n {\n Directory::factory(ROOT.DS.'test_dir');\n }", "public function testMakeDirRecursiveSuccessfully ()\n {\n $mode = 0777;\n $user = 'test';\n $group = 'hdfs';\n\n $response = $this->getCliResponse('mkdir_success');\n\n $cli = $this->getMock('\\\\Hdfs\\\\Cli\\\\HadoopWrapper');\n $cli->expects($this->once())\n ->method('exec')\n ->with('-mkdir', '-p', self::REMOTE_SUBDIR)\n ->will($this->returnValue($response));\n\n $entry = $this->getMockBuilder('\\\\Hdfs\\\\EntryStatus')->disableOriginalConstructor()->getMock();\n $entry->method('isDir')->will($this->returnValue(true));\n\n $hdfs = $this->getMock('\\\\Hdfs\\\\Cli', array('stat', 'changeModeRecursive', 'changeOwnerRecursive'));\n $hdfs->setHadoopWrapper($cli);\n $hdfs->expects($this->at(0))\n ->method('stat')\n ->with(self::REMOTE_SUBDIR)\n ->will($this->throwException(new \\Hdfs\\Exception\\NotFoundException('Dir not exist', false)));\n $hdfs->expects($this->at(1))\n ->method('stat')\n ->with(self::REMOTE_DIR)\n ->will($this->throwException(new \\Hdfs\\Exception\\NotFoundException('Dir not exist', false)));\n $hdfs->expects($this->at(2))\n ->method('stat')\n ->with('/tmp')\n ->will($this->returnValue($entry));\n $hdfs->expects($this->once())\n ->method('changeModeRecursive')\n ->with(self::REMOTE_DIR, $mode);\n $hdfs->expects($this->once())\n ->method('changeOwnerRecursive')\n ->with(self::REMOTE_DIR, $user, $group);\n\n $hdfs->makeDirRecursive(self::REMOTE_SUBDIR, $mode, $user, $group);\n }", "function createDirectory($name);", "public function testMakeRootDirectory()\n {\n $this->assertEquals($this->path->root().' created successfully', $this->generator->root());\n }", "function contestMkdir($dir) {\r\n global $contestFolder;\r\n myMkdir(joinPaths($contestFolder, $dir));\r\n}", "public function testCreateFolder()\n {\n }", "function _create_directory()\r\r\n {\r\r\n try {\r\r\n if (!is_dir($this->file_write_path)) {\r\r\n mkdir($this->file_write_path, 0777, true);\r\r\n }\r\r\n } catch (Exception $exception) {\r\r\n echo $exception->getMessage();\r\r\n }\r\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
listJsFiles returns a list of JavaScript files required for the extension.
public function listJsFiles() { return []; }
[ "public function getJsFiles(): array;", "public function getJSFiles()\n {\n $list = parent::getJSFiles();\n\n $list[] = 'modules/QSL/CloudSearch/cloud_filters/filters.js';\n\n return $list;\n }", "public function getAdditionalJavaScriptFiles();", "public function getAdditionalJavaScriptFiles()\n\t{\n\t\treturn [];\n\t}", "public function loadJsFiles()\r\n {\r\n $files = array();\r\n $html = '';\r\n $path = 'js/';\r\n\r\n foreach (glob('js/*.js') as $file) {\r\n if ($file != 'js/jquery.js')\r\n $html .= '<script type=\"text/javascript\" src=\"' . $file . '\"></script>';\r\n }\r\n return $html;\r\n }", "public function get_js_files()\n\t{\n\t\treturn $this->_js_files;\n\t}", "public function getJsFilesToInclude()\r\n {\r\n return array(\r\n 'Document/js/Models.js',\r\n 'Document/js/Backend.js',\r\n 'Document/js/DocumentsPanel.js',\r\n 'Document/js/AdminPanel.js'\r\n );\r\n }", "public function getFiles()\n\t{\n\t\treturn $this->jsWriter->getFiles();\n\t}", "public function getJSFiles() {\n\t\treturn $this->_jsFiles;\n\t}", "protected function filterJsFiles() {\n\n $response = array_filter(\n $this->files['all'],\n function ($item) {\n return preg_match(\"/.\\.(js)/i\", $item);\n }\n );\n $this->files['js'] = $response;\n }", "public\nfunction getLinkedJsFiles()\n{\n return $this->filterFilesByExtension('js');\n}", "public function getTemplateJavascriptFiles();", "public function listFiles();", "private function _buildJSFileList()\n {\n $currentThemeName = $this->_helper->config->getConfig('currentTheme');\n $currentThemePath = Tools_System_Tools::normalizePath(\n realpath($this->_websiteConfig['path'] . $this->_themeConfig['path'] . $currentThemeName)\n );\n\n $jsFiles = Tools_Filesystem_Tools::findFilesByExtension($currentThemePath, 'js', true);\n $jsFiles = array_filter(preg_replace('~.*(min).js.*~', '', $jsFiles));\n $jsTree = array();\n\n foreach ($jsFiles as $file) {\n preg_match_all(\n '~^' . $currentThemePath . '/([a-zA-Z0-9-_\\s/.]+/)*([a-zA-Z0-9-_\\s.]+\\.js)$~i',\n Tools_System_Tools::normalizePath($file),\n $sequences\n );\n $subfolders = $currentThemeName . '/' . $sequences[1][0];\n $files = array();\n foreach ($sequences[2] as $key => $value) {\n $files[$subfolders . $value] = $value;\n }\n\n if (!array_key_exists($subfolders, $jsTree)) {\n $jsTree[$subfolders] = array();\n }\n $jsTree[$subfolders] = array_merge($jsTree[$subfolders], $files);\n\n }\n\n return $jsTree;\n }", "public function & GetJsSupportFiles ();", "public function getLoadedJSFiles()\n {\n return $this->JSFiles;\n }", "function get_javascripts_list()\n{\n $response = sfContext::getInstance()->getResponse();\n sfConfig::set('symfony.asset.javascripts_included', true);\n\n $list = array(); \n\n foreach ($response->getJavascripts() as $file => $options)\n {\n $list[] = \"'/js/\". $file . \"'\";\n }\n\n return implode(', ', $list);\n}", "public function getServerJsFiles ();", "public function JsList() {\n\t\t$result = array();\n\t\tif (!empty($this->metadata->js)) {\n\t\t\t$aux = explode(\",\",$this->metadata->js);\n\t\t\tif (count($aux) > 0) {\n\t\t\t\tforeach($aux as $key => $value) {\n\t\t\t\t\tif (preg_match(\"/\\.js$/im\",$value)) {\n\t\t\t\t\t\t$aux[$key] = preg_replace(\"/\\.js$/im\",\"\",$value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$result = $aux;\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the full filename (including path) for the given log name pwgroupretrieval
public function getFilename($name) { $name = strtolower($name); if($name !== $this->wire('sanitizer')->pageName($name)) { throw new WireException("Log name must contain only [-_.a-z0-9] with no extension"); } return $this->wire('config')->paths->logs . $name . '.' . $this->logExtension; }
[ "public static function get_log_file_name() {\n\t\t$filename = 'jobroller-' . sanitize_file_name( wp_hash( 'jobroller' ) ) . '.log';\n\n\t\treturn $filename;\n\t}", "protected function getLogFileName() : ?string {\n return ($this->handler && preg_match('/^.*->(\\w+)$/', $this->handler,$m)) ? 'cron_' . $m[1] . '.log' : null;\n }", "private function getLogName()\n {\n $ext = '.log';\n if (defined('LOGGER_LOG_FILENAME')) {\n $file_name = LOGGER_LOG_FILENAME . $ext;\n } else {\n $datetime = date(\"Y-m-d\");\n $file_name = \"$datetime\" . $ext;\n }\n return $file_name;\n }", "public function getAccessLogFilename();", "public function getLogFileName() {\n return $this->getConfigData(\"log_file_name\", \"snowpayu.log\");\n }", "private function getFileName() {\n $fileName = \"/errorlog/\";\n if ($this->newFileFrequency == \"day\") {\n $fileName = $fileName . \"d.\" . date('Y.m.d');\n } else if ($this->newFileFrequency == \"week\") {\n $fileName = $fileName . \"w.\" . date('Y.W');\n } else if ($this->newFileFrequency == \"month\") {\n $fileName = $fileName . \"m.\" . date('Y.F');\n } else {\n $fileName = $fileName . \"log\";\n }\n $fileName = $fileName . \".\" . $this->fileType;\n\n return $fileName;\n }", "protected function getFilePath($group)\n\t{\n\t\treturn $this->getLangPath($this->language . DIRECTORY_SEPARATOR . $group . '.php');\n\t}", "private static function getFilename() {\n FileUtils::createDir(static::$log_path);\n $date = getdate(time());\n return $date['year'] . Utils::pad($date['mon']) . Utils::pad($date['mday']);\n }", "public function getLogFileName()\n {\n $logFileName = \"duitku_\" . date('Ymd') . \".log\";\n return $logFileName;\n }", "static public function getLogFileName()\r\n {\r\n global $tlCfg;\r\n $uID = isset($_SESSION['userID']) ? $_SESSION['userID'] : 0;\r\n\r\n return $tlCfg->log_path . 'userlog' . $uID . \".log\";\r\n }", "public static function GroupLogFile( $group, $withDir=TRUE ) {\n return self::AuctionFile($group, $withDir) . '.log';\n }", "protected static function getFilename($group, $id)\n\t{\n\t\t$id = md5($id);\n\t\t$suffix = (self::$gzip_level > 0) ? '_gz' : '';\n\t\treturn self::$store . self::$prefix . \"{$group}_{$id}{$suffix}\";\n\t}", "function rlip_get_archive_log_filename($logorid) {\n global $CFG, $DB;\n\n // Check whether a record or record ID was passed in, also return false if neither was specified\n if (is_integer($logorid)) {\n $log = $DB->get_record(RLIP_LOG_TABLE, array('id' => $logorid));\n } else if (is_object($logorid)) {\n $log = $logorid;\n } else {\n return false;\n }\n\n $pluginname = str_replace(array('rlipimport_', 'rlipexport_'), '', $log->plugin);\n\n $timestamp = userdate($log->starttime, get_string('logfiledaily_timestamp','block_rlip'), 99);;\n $archivelog = ($log->export == 1 ? 'export' : 'import').'_'.$pluginname.'_'.$timestamp.'.zip';\n\n $logflielocation = '';\n $logfilelocation = get_config($log->plugin, 'logfilelocation');\n\n if (empty($logfilelocation)) {\n $logprefix = $CFG->dataroot.'/';\n } else {\n // Be sure to handle the fact that there might be a back-slash at the beginning or end of the path config variable\n $logprefix = $CFG->dataroot.(substr($logfilelocation, 0, 1) != '/' ? '/' : '').$logfilelocation.\n (substr($logfilelocation, -1, 1) != '/' ? '/' : '');\n }\n\n return $logprefix.$archivelog;\n}", "public function getFileName() {\n return $this->_getLogFileName();\n }", "private function getLogFilename()\n {\n return 'log.' . strtolower(date('d-M-Y') . '-' . gethostname());\n }", "public static function log_file($name) {\n\t\t\treturn self::path('logs', sprintf(self::$names['logs']['file'], $name));\n\t\t}", "function logFileName()\r\n{\r\n global $logfile;\r\n $datetime = date(\"Y-m-d H:i:s\");\r\n $stamp = str_replace(\":\", \"_\", str_replace(\" \", \"_\", $datetime));\r\n return ($logfile!=\"\")?$logfile:\"log.$stamp.log\";\r\n // sample log.2017-10-02-11:52:11.log\r\n}", "function rep_getLogFileName() {\n $logFile = dirname(__FILE__) . '/log/reptilo' . \".\" . date(\"y-m\") . \".log\";\n return $logFile;\n}", "public function getFilename()\n {\n // Generate SNAPSHOT Filename\n $mapdate = date('Ymd_Hi', time());\n $prefix = '';\n if (!empty($this->serverPrefix))\n $prefix = $this->serverPrefix . '-';\n\n return $prefix . $this->mapName . '_' . $mapdate . '.txt';\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Formats a string containing the fullyqualified path to represent a order1 resource.
public static function order1Name(string $order1Id): string { return self::getPathTemplate('order1')->render([ 'order1_id' => $order1Id, ]); }
[ "public function setPath1($var)\n {\n GPBUtil::checkString($var, True);\n $this->path1 = $var;\n\n return $this;\n }", "public function getOrderPath();", "public function getPathStringFormat()\n {\n return $this->getPathFormat($this->path);\n }", "public static function get_path1(){\n return self::PATH1;\n }", "function sha1_to_path_string($sha1)\n{\n\t$sha1_path_parts = sha1_to_path_array($sha1);\n\t\n\t$sha1_path = '/' . join(\"/\", $sha1_path_parts) . '/' . $sha1;\n\n\treturn $sha1_path;\n}", "public function getPath1()\n {\n return isset($this->path1) ? $this->path1 : '';\n }", "public function templateToOpenApiPath(): string\n {\n $pieces = array_map(\n function ($piece) {\n if (substr($piece, 0, 1) == ':') {\n return '{' . str_replace(':', '', $piece) . '}';\n }\n\n return $piece;\n },\n explode('/', $this->template)\n );\n\n return implode('/', $pieces);\n }", "private function formatPath(string $path): string {\n\t\tif (strlen($path) > 250) {\n\t\t\treturn sha1($path);\n\t\t} else {\n\t\t\treturn $path;\n\t\t}\n\t}", "function sha1_to_path_string($sha1)\n{\n\t$sha1_path_parts = sha1_to_path_array($sha1);\n\t\n\t$sha1_path = '/' . join(\"/\", $sha1_path_parts);\n\n\treturn $sha1_path;\n}", "function _format_path($path)\r\n\t{\r\n\t\t$path = trim($path);\r\n\t\tif (substr($path, 0, 1) != '/') {\r\n\t\t\t$path = '/'.$path;\r\n\t\t}\r\n\t\t$split = @parse_url($path);\r\n\t\t$path = $split['path'];\r\n\t\t$path = preg_replace(\"![^/]+?\\\\.[^/]+?\\$!\", '', $path);\r\n\r\n\t\treturn $path;\r\n\t}", "public static function format(string $actionPath): string\n {\n return preg_replace('/_([^_]*)$/', '/$1', str_replace('/', '_', $actionPath));\n }", "protected function formatPath($path)\n {\n // canary...\n if(empty($path)){ return ''; }//if\n \n // make sure path doesn't end with a slash...\n if(mb_substr($path,-1) == DIRECTORY_SEPARATOR)\n {\n $path = mb_substr($path,0,-1);\n }//if\n \n return $path;\n \n }", "function formatPath($f)\n{\n\t$f = preg_replace('/[\\\\\\\\\\/]+/', '/', $f);\n\t$f = preg_replace('`[^/]+/\\.\\./`', '', $f);\n\t$f = preg_replace('`(^|/)\\K\\./`', '', $f);\n\treturn $f;\n}", "private function format($path){\n\t\t$is_index = strripos($path, 'index') === strlen($path)-5;\n\t\tif( $is_index ) return substr($path, 0, -5);\n\t\telseif( substr($path, -1) != '/' ) $path .= '/';\n\t\treturn $path;\n\t}", "private function pathify($format)\n {\n if (is_array($format)) {\n return md5(serialize($format));\n } else {\n return $format;\n }\n }", "public static function formatPath($path){\r\n\r\n \t$osSeparator = FilesManager::getInstance()->getDirectorySeparator();\r\n\r\n \tif($path == null){\r\n\r\n \t\treturn '';\r\n \t}\r\n\r\n \tif(!is_string($path)){\r\n\r\n \t\tthrow new Exception('StringUtils->formatPath: Specified path must be a string');\r\n \t}\r\n\r\n \t// Replace all slashes on the path with the os default\r\n \t$path = str_replace('/', $osSeparator, $path);\r\n \t$path = str_replace('\\\\', $osSeparator, $path);\r\n\r\n \t// Remove duplicate path separator characters\r\n \twhile(strpos($path, $osSeparator.$osSeparator) !== false) {\r\n\r\n \t\t$path = str_replace($osSeparator.$osSeparator, $osSeparator, $path);\r\n \t}\r\n\r\n \t// Remove the last slash only if it exists, to prevent duplicate directory separator\r\n \tif(substr($path, strlen($path) - 1) == $osSeparator){\r\n\r\n \t\t$path = substr($path, 0, strlen($path) - 1);\r\n \t}\r\n\r\n \treturn $path;\r\n }", "public function createFromString(string $path) : Path\n {\n try {\n // If the first character of the path is a slash, we remove it in order to avoid to create an empty parent\n // element.\n if (substr($path, 0, 1) == '/') {\n $path = substr($path, 1);\n }\n $this->entityManager->getConnection()->beginTransaction();\n $path = $this->unstackPath($path);\n $this->entityManager->getConnection()->commit();\n return $path;\n } catch (Exception $e) {\n $this->entityManager->rollback();\n throw $e;\n }\n }", "protected function formatPath($path)\n {\n $path = rtrim($path, '/');\n $path = rtrim($path, '\\\\');\n $path .= DIRECTORY_SEPARATOR;\n return $path;\n }", "private static function formatPath($path)\n {\n if (!preg_match('/\\.php$/', $path)) {\n $path .= '.php';\n }\n $path = preg_replace('/\\/{2,}/', '/', $path);\n return $path;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Shortcut to all dump functions Dumps Name, ID, Class, Value and Style for a typical input attributes
protected function DumpAttributes() { echo "{$this->DumpName()} {$this->DumpID()} {$this->DumpClass()} {$this->DumpValue()} {$this->DumpStyle()}"; }
[ "function attributesToString();", "public static function formatAttributes();", "abstract function exportableAttributes();", "public function dump() \n {\n $dump = parent::dump();\n $dump->fill_method = $this->_overload[\"fill_method\"];\n $dump->fill_choices = $this->_overload[\"fill_choices\"];\n $dump->fill_callback = $this->_overload[\"fill_callback\"];\n if( isset( $this->_overload[\"content_display\"] ) ) {\n $dump->content_display = $this->_overload[\"content_display\"];\n } else {\n $dump->content_display = \"inline\";\n }\n $dump->select_choices = $this->_overload[\"select_choices\"]; //$this->getMaxChoices();\n \n if($dump->select_choices < 1) {\n $dump->select_choices = 1;\n }\n \n return $dump;\n \n }", "public function dump(){ }", "public function dump()\n {\n $attributes = array();\n\n if ($this->id) {\n $attributes['$id'] = $this->id;\n }\n\n foreach ($this->attributes as $key => $value) {\n $schema = $this->schema($key);\n\n if (! empty($schema['transient'])) {\n continue;\n }\n\n $attributes[$key] = $value;\n }\n\n return $attributes;\n }", "public function printAttributes() {\n $string = \"[\";\n foreach($this->attributes as $key => $attr) {\n if($attr != 'created_at' && $attr != 'updated_at' && $attr != 'deleted_at' ) {\n if($string !== \"[\") {\n $string .= \",\";\n }\n $string .= $attr;\n }\n }\n $string .= \"]\";\n return $string;\n }", "protected function formatAttributes()\n {\n foreach (array_keys($this->output) as $key) {\n $method_name = camel_case('format_' . $key);\n if (method_exists($this, $method_name)) {\n $value = $this->model[$key];\n $this->output[$key] = call_user_func([$this, $method_name], $value);\n }\n }\n }", "function dump_fields() {\n // that are currently defined in the instance of the class using the\n // add_field() function.\n\n echo \"<h3>paypal_class->dump_fields() Output:</h3>\";\n echo \"<table width=\\\"95%\\\" border=\\\"1\\\" cellpadding=\\\"2\\\" cellspacing=\\\"0\\\">\n <tr>\n <td bgcolor=\\\"black\\\"><b><font color=\\\"white\\\">Field Name</font></b></td>\n <td bgcolor=\\\"black\\\"><b><font color=\\\"white\\\">Value</font></b></td>\n </tr>\";\n\n ksort($this->fields);\n foreach ($this->fields as $key => $value) {\n echo \"<tr><td>$key</td><td>\".urldecode($value).\"&nbsp;</td></tr>\";\n }\n\n echo \"</table><br>\";\n }", "function wdf_dump($variable,$label=null,$class=null,$force=false){\n if(!DEBUG && !$force){return false;}\n echo \"\\n<!-- dump -->\\n\";\n echo \"<pre class='debug \".$class.\"'>\\n\";\n if($label<>null){echo \"<b>\".$label.\"</b>\\n\";}\n if(is_string($variable)){$variable=str_replace(array(\"<\",\">\"),array(\"&lt;\",\"&gt;\"),$variable);}\n print_r($variable);\n echo \"</pre>\\n<!-- /dump -->\\n\";\n}", "function dump_fields() {\n // that are currently defined in the instance of the class using the\n // add_field() function.\n \n echo \"<h3>paypal_class->dump_fields() Output:</h3>\";\n echo \"<table width=\\\"95%\\\" border=\\\"1\\\" cellpadding=\\\"2\\\" cellspacing=\\\"0\\\">\n <tr>\n <td bgcolor=\\\"black\\\"><b><font color=\\\"white\\\">Field Name</font></b></td>\n <td bgcolor=\\\"black\\\"><b><font color=\\\"white\\\">Value</font></b></td>\n </tr>\"; \n \n ksort($this->fields);\n foreach ($this->fields as $key => $value) {\n echo \"<tr><td>$key</td><td>\".urldecode($value).\"&nbsp;</td></tr>\";\n }\n \n echo \"</table><br>\"; \n }", "function dump_fields() {\n // that are currently defined in the instance of the class using the\n // add_field() function.\n\n echo \"<h3>paypal_class->dump_fields() Output:</h3>\";\n echo \"<table width=\\\"95%\\\" border=\\\"1\\\" cellpadding=\\\"2\\\" cellspacing=\\\"0\\\">\n <tr>\n <td bgcolor=\\\"black\\\"><b><font color=\\\"white\\\">Field Name</font></b></td>\n <td bgcolor=\\\"black\\\"><b><font color=\\\"white\\\">Value</font></b></td>\n </tr>\";\n\n ksort($this->fields);\n foreach ($this->fields as $key => $value) {\n echo \"<tr><td>$key</td><td>\".urldecode($value).\"&nbsp;</td></tr>\";\n }\n\n echo \"</table><br>\";\n }", "function dump_fields() {\n // that are currently defined in the instance of the class using the\n // add_field() function.\n \n echo \"<h3>paypal_class->dump_fields() Output:</h3>\";\n echo \"<table width=\\\"95%\\\" border=\\\"1\\\" cellpadding=\\\"2\\\" cellspacing=\\\"0\\\">\n <tr>\n <td bgcolor=\\\"black\\\"><b><font color=\\\"white\\\">Nome campo</font></b></td>\n <td bgcolor=\\\"black\\\"><b><font color=\\\"white\\\">Valore</font></b></td>\n </tr>\"; \n \n ksort($this->fields);\n foreach ($this->fields as $key => $value) {\n echo \"<tr><td>$key</td><td>\".urldecode($value).\"&nbsp;</td></tr>\";\n }\n \n echo \"</table><br>\"; \n }", "public static function dump()\n {\n $this->objList();\n $this->includeList();\n }", "function dump()\r\n {\r\n echo '<pre>';\r\n print_r($this);\r\n echo '</pre>';\r\n }", "private function printCommonAttributes()\r\n {\r\n foreach ($this->attributes as $name => $value) {\r\n if (is_array($value)) {\r\n $value = implode(' ', $value);\r\n }\r\n\r\n echo \" $name=\\\"$value\\\"\";\r\n }\r\n }", "public function dump() {\n\t\tforeach ($this->options as $key => $value) {\n\t\t\techo \"$key=\\\"$value\\\"\\n\";\n\t\t}\n\t}", "public function dumpDataInfo();", "function dump_fields() {\n // that are currently defined in the instance of the class using the\n // add_field() function.\n \n echo \"<h3>Paypal->dump_fields() Output:</h3>\";\n echo \"<table width=\\\"95%\\\" border=\\\"1\\\" cellpadding=\\\"2\\\" cellspacing=\\\"0\\\">\n <tr>\n <td bgcolor=\\\"black\\\"><b><font color=\\\"white\\\">Field Name</font></b></td>\n <td bgcolor=\\\"black\\\"><b><font color=\\\"white\\\">Value</font></b></td>\n </tr>\"; \n \n ksort($this->fields);\n foreach ($this->fields as $key => $value) {\n echo \"<tr><td>$key</td><td>\".urldecode($value).\"&nbsp;</td></tr>\";\n }\n \n echo \"</table><br>\"; \n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Converte para data por extenso Brasileira.
final public static function converterDataPorExtenso($data) { setlocale(LC_ALL, 'pt_BR', 'pt_BR.utf-8', 'pt_BR.utf-8', 'portuguese'); date_default_timezone_set('America/Sao_Paulo'); return strftime('%A, %d de %B de %Y', strtotime($data) ); }
[ "private function escreverDataPorExtenso() {\n\n $this->oPdf->Ln();\n $oData = new DBDate(date(\"d/m/Y\"));\n $sData = \"{$this->oEscola->getMunicipio()}, \";\n $sData .= $oData->dataPorExtenso();\n $this->oPdf->Cell(205, 4, $sData, 0, 1, \"C\");\n $this->oPdf->Ln();\n\n }", "function funConverteData($data){\n\t//$data_americano = \"2009-04-29\";\n\t//$data_Brasileiro = \"29/04/2012\";\n\t//AGORA VAMOS EXPLODIR ELA PELOS HIFENS E SERÁ CRIADO UM ARRAY COM AS PARTES\n\t$partes_da_data = explode('/',$data);\n\n\t//AGORA REMONTAMOS A DATA NO FORMATO BRASILEIRO, OU SEJA,\n\t//INVERTENDO AS POSICOES E COLOCANDO AS BARRAS\n\t$data = $partes_da_data[2].'-'.$partes_da_data[1].'-'.$partes_da_data[0];\n\n\t//UFA! PRONTINHO, AGORA TEMOS A DATA NO BOM E VELHO FORMATO BRASILEIRO\n\treturn $data;\n}", "function converter_data($data_ori,$tipo='BR',$hora='false')\n{\n if ($data_ori <> \"\")\n {\n $data = explode(' ',$data_ori);\n\n\t\tif ($tipo == 'BR')\n {\n\t\t\t$resul = explode(\"-\",$data[0]);\n\t\t\t$resul = $resul[2].'/'.$resul[1].'/'.$resul[0];\n\t\t}\n\n\t\telse if ($tipo == 'EN')\n {\n\t\t\t$resul = explode(\"/\",$data[0]);\n\t\t\t$resul = $resul[2].'-'.$resul[1].'-'.$resul[0];\n\t\t}\n\n\t\tif ($hora==\"true\")\n {\n\t\t\treturn $resul.' '.$data[1];\n\t\t}\n\t\telse\n {\n\t\t\treturn $resul;\n\t\t}\n\t}\n}", "public function dataForCurrencyConvertingFromBaseCurrency(): array\n {\n return [\n ['1200.11', 'BASE', '1200.11'],\n ['1200.11', 'FIRST', '1379.77'],\n ['1200.11', 'SECOND', '155451'],\n ];\n }", "public function convertExtensionFeatures(array $data = null);", "final public static function converterDataParaBrasileira($data)\n {\n return date( 'd-m-Y', strtotime($data) );\n }", "public function generaBuzon(){\n }", "public function getExtensionsData();", "public function convert($data, $options = []);", "protected function format_data() {}", "public function convertDataGRBSCostsDate($data)\n {\n $result = array();\n foreach ($data as $key => $values) {\n if (is_array($values)) {\n $result[$key] = array(\n //'naimenovanie_grbs' => iconv('CP1251', 'UTF-8', $values['naimenovanie_grbs']),\n 'sum_plan' => $values['sum_plan'],\n 'sum_actual' => $values['sum_actual'],\n 'grbs' => $values['grbs']\n );\n } else {\n $result[$key] = $values;\n }\n }\n\n return json_encode($result);\n }", "public function convertExtension(array $data = null, array $cmisKeys = []);", "public function getBaseData();", "function iconvToData($data)\n {\n return $data;\n }", "function inverteDataBr($dataPadraoBr) { \n\t\t$data = explode('-', $dataPadraoBr);\n\t\t$anod = $data[0];\n\t\t$mesd = $data[1];\n\t\t$diad = $data[2];\n\t\t$dataf = \"\"; $dataf = $diad.\"-\".$mesd.\"-\".$anod;\n\t\treturn $dataf;\n\t}", "public function txtRawDataToArray()\n {\n // Separa uma linha do array pra cada linha, sse código consigo prever\n // tipos dferentes de quebrada de linha\n $tempData = preg_split(\"/\\\\r\\\\n|\\\\r|\\\\n/\", $this->rawData);\n $i = 0;\n\n foreach ($tempData as $key => $value) {\n // Divido cada linha por seu separar e agora dentro de cada linha tb\n // tenho um array com os campos do produto divididos\n $value = explode($this->txtSeparator, $value);\n\n if (count($value) == 3) {\n $this->data[$i]['ean'] = $value[0];\n $this->data[$i]['nome'] = $value[1];\n $this->data[$i]['setor'] = $value[2];\n }\n\n $i++;\n }\n\n $this->totalProdutos = count($this->data);\n\n // Aqui aproveito e checo se o total de produtos está acima do permitido\n if ($this->totalProdutos > $this->_maximoProdutosPermitido) {\n throw new \\Exception(__(\"O arquivo possui {0} produtos para deve conter no máximo {1}\", $this->totalProdutos, $this->_maximoProdutosPermitido));\n }\n }", "abstract protected function convertToResource($data);", "function convert() {\n $fetcher = new Fetcher($this->path);\n $mime = $fetcher->getMimeType();\n //if image is of type svg, we don't want to base64 it because it will often not work and it is larger\n if (strpos($mime, 'svg') !== false) {\n $content = explode(PHP_EOL, $fetcher->getFileData());\n $output = array();\n\n foreach($content as $line) {\n //we dont want to keep <?xml and <!DOCTYPE values from SVG\n if (strpos($line, '<?') === false && strpos($line, '<!') === false) {\n $output[] = str_replace('\"', '\\'', $line);\n }\n }\n\n return 'data:'.$mime.';utf-8,'.implode('', $output);\n }\n\n return 'data:'.$mime.';base64,'.base64_encode($fetcher->getFileData());\n }", "public function ambilData() {\n // read file & get the data (file_get_contents)\n $data = file_get_contents($this->file);\n $this->daftar_barang = json_decode($data, true);\n $this->daftar_barang = array_values($this->daftar_barang);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the absolute path to the folder containing executables
public static function getExecutablePath() { $configFileUpload = new Util_Config('fileupload.ini', APPLICATION_ENV); $useDefaultPath = $configFileUpload->getValue('file.upload.path.default', true); $executableDir = $configFileUpload->getValue('file.upload.executeable.folder', 'executeable'); if ($useDefaultPath) { $uploadsDir = $configFileUpload->getValue('file.upload.path.folder', '_uploads'); $path = APPLICATION_PUBLIC . $uploadsDir; } else { $path = $configFileUpload->getValue('file.upload.path.custom'); } $path .= $executableDir; return $path; }
[ "protected function getExecutable()\n {\n return realpath(__DIR__ . '/../../bin/phptea');\n }", "private function getExecutablePath() {\n $path = $this->config->getWritableUserDir() . DIRECTORY_SEPARATOR . 'credential-helper';\n if (OsUtil::isWindows()) {\n $path .= '.exe';\n }\n\n return $path;\n }", "public function getAbsolutPathToPhpExecutable()\n {\n $executable = StandardProvisioner::PHP_EXECUTABLE_UNIX;\n if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {\n // we have a different executable on Windows systems\n $executable = StandardProvisioner::PHP_EXECUTABLE_WIN;\n }\n return $this->getService()->realpath($executable);\n }", "public static function getAbsPath(): string {\n return getcwd();\n }", "public function getExecutablePath ()\n {\n return self::$executable_path;\n\n }", "public static function getScriptDirAbsPath() {\r\n return dirname(System::getScriptAbsPath());\r\n }", "public function getAbsoluteBinDir()\n {\n return $this->getAbsoluteDir() . $this->getGame()->getBinDir() . '/';\n }", "protected function absolutePath() {\n return dirname(dirname(dirname(__DIR__)));\n }", "public function path()\n {\n return str_replace(DIRECTORY_SEPARATOR, '/', realpath(__DIR__.'/../../bin/Acrylic/'));\n }", "public function getBinDirectory(): string\n {\n return realpath($this->binDirectory);\n }", "public static function getScriptPath()\n {\n return realpath($_SERVER['argv'][0]);\n }", "function getAddonPath()\n\t{\n\t\t//assert(isset($this->addonData['addon_key']));\n\t\treturn PEAR_ROOT_PATH . PEAR_SYSTEM_SOURCES . PEAR_ADDONS_DIRECTORY . $this->addonData['addon_key'] . '/';\n\t}", "public static function atomar_dir() {\n return __DIR__;\n }", "public function GetExecutable() {\n\t\treturn $this->pathBinary;\n\t}", "public function getInstallPath() {\n\t\treturn dirname(dirname(__DIR__));\n\t}", "public static function path()\n {\n return getenv(\"HOME\") . self::RELATIVE_FILE_PATH;\n }", "function getFullPath(){\nreturn getcwd();\n}", "public function getInstallPath()\n {\n if ($this->installPath === '') {\n $this->installPath = realpath(__DIR__ . '/../binaries');\n }\n\n return $this->installPath;\n }", "public static function getCommandPath()\n {\n return implode(DIRECTORY_SEPARATOR, array(self::getShellPath(), \"Command\")) . DIRECTORY_SEPARATOR;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Delete one Acad Yr at a time
function deleteAcadYrById($id){ global $db; $sql = "DELETE FROM tblAcadYr "; $sql .= "WHERE acadYrId = '".$id."' "; $sql .= "LIMIT 1"; $res = mysqli_query($db,$sql); if($res){ return true; } else { echo mysqli_error($db); db_disconnect($db); exit; } }
[ "public function delete()\n\t{\n\t\t$_record = Record::createRecord(Record::AD_REMOVED);\n\t\t$_record->setRef1($this->getID());\n\t\t\n\t\t//Retrieve informations on the ads and its creatives\n\t\t$screens = $this->getScreens();\n\t\t$adPath = $this->getPath(false);\n\t\t\n\t\t//Delete every creatives the ad may contain\n\t\tforeach($screens as $screen)\n\t\t{\n\t\t\t//Delete creatives if exists\n\t\t\t$creative = Creative::getInstance($this->getID(), $screen->getID());\n\t\t\t\n\t\t\tif($creative != false)\n\t\t\t\t$creative->delete();\n\t\t\t\n\t\t\t//Delete the screen folder\n\t\t\trmdir($adPath.$screen->getID().\"/\");\n\t\t}\n\t\t\n\t\t$reviewModel = new \\Models\\ReviewModel();\n\t\t$reviewModel->remove($this->getID());\n\t\t\n\t\t//Delete the ad\n\t\t//Remove files\n\t\trmdir($this->getPath(false));\n\t\t\n\t\t//Delete the entry\n\t\t$this->adModel->delete();\n\t\t\n\t\t$_record->setResult(Record::OK)\n\t\t\t\t->save();\n\t}", "public function delete()\n\t{\n\t\t$stmt = $this->ddb->prepare(\"DELETE FROM ads WHERE ad_id = :adID\");\n\t\t$stmt->execute([\":adID\" => $this->currentAd]);\n\t}", "function DeleteAd() {\n\tglobal $smarty, $config, $dbconn;\n\t\n\t$id = intval($_REQUEST[\"id\"]);\n\t$dbconn->Execute(\"DELETE FROM \".SPONSORS_ADS_TABLE.\" WHERE id='\".$id.\"' \");\n\tListSponsors(\"list\");\n\t\n}", "public function deleteRelationWithYax() {\n $this->adservers()->detach(1);\n $sites = $this->sites;\n foreach ($sites as $site1) {\n $site = Site::find($site1->getId());\n if ($site->isValidated()) {\n //detach sitio - adserver 1\n $site->adservers()->detach(1);\n\n //-----------------------Espacios\n //traer section\n $sections = $site->sections;\n foreach ($sections as $section) {\n //eliminar section\n $section->delete();\n }\n }\n }\n }", "public function testDeleteAppartment() {\n $newAcc = My_Houseshare_Factory::accommodation(4);\n $newAcc->delete();\n\n $accRowAfter = $this->_model->find(4)->current();\n $this->assertTrue(null === $accRowAfter);\n\n My_Houseshare_Appartment::deleteAcc(5);\n\n $accRowAfter = $this->_model->find(5)->current();\n $this->assertTrue(null === $accRowAfter);\n\n }", "function txtad_destroy($campaign_id, $txtad_id) {\n return $this->hook(\"/campaigns/{$campaign_id}/txtads/{$txtad_id}.xml\", \"txtad\", null, 'DELETE');\n }", "function txtad_destroy( $campaign_id, $txtad_id )\n {\n return $this->hook( \"/campaigns/{$campaign_id}/txtads/{$txtad_id}.json\", \"txtad\", null, 'DELETE' );\n }", "public function deleteDacl()\n\t{\n\t\t$this->remove();\n\t}", "function delete_kardex_academico($kardexacad_id)\n {\n return $this->db->delete('kardex_academico',array('kardexacad_id'=>$kardexacad_id));\n }", "public function delete()\n\t{\n\t\t$_record = \\Objects\\Record::createRecord(\\Objects\\Record::CAMPAIGN_REMOVED);\n\t\t$_record->setRef1($this->getID());\n\t\t\n\t\t//Remove ads in the campaign\n\t\t$ads = $this->getAds();\n\t\t\n\t\t//Remove all ads of the campaign\n\t\tforeach($ads as $ad)\n\t\t{\n\t\t\t$ad->delete();\n\t\t}\n\t\t\n\t\t$this->campaignModel->delete();\n\t\t\n\t\t//Remove the campaign Directory\n\t\trmdir(\"campaigns/{$this->getCampaignUID()}\");\n\t}", "public function delete()\n\t{\n\t\t$stmt = $this->ddb->prepare(\"DELETE FROM campaign_screen_medias WHERE campaign_id = :campaignID\");\n\t\t$stmt->execute([\":campaignID\" => $this->currentCampaign]);\n\t\t\n\t\t$stmt = $this->ddb->prepare(\"DELETE FROM campaigns WHERE campaign_id = :campaignID\");\n\t\t$stmt->execute([\":campaignID\" => $this->currentCampaign]);\n\t}", "function deleteAdjunto($IDadjunto) {\n\tglobal $db;\n\n\t$db->exec('DELETE FROM videosAdjuntos WHERE ID = '.$IDadjunto);\n}", "public function advertdelete($id) {\n\n $this->getDb()->exec('UPDATE reponsereply SET reply_advert = null WHERE reply_id = '.$id.'');\n \n }", "public function deleteIrRemout(){\n }", "public function delete()\n {\n $this->refereeOrm->delete();\n }", "public function delete_ads() {\n \n // Delete ads\n (new MidrubBaseUserAppsCollectionFacebook_adsHelpers\\Ad_ads)->delete_ads();\n \n }", "function delete($id) {\n Ad::deleteAd($id);\n unset($_GET['delete']);\n }", "public function delete()\n {\n $this->_record->delete();\n }", "public function delete($arl){\n $idarl=$arl->getIdarl();\n\n try {\n $sql =\"DELETE FROM `arl` WHERE `idarl`='$idarl'\";\n return $this->insertarConsulta($sql);\n } catch (SQLException $e) {\n throw new Exception('Primary key is null');\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the public 'Yoast\WP\Free\Watchers\Primary_Term_Watcher' shared autowired service.
protected function getPrimaryTermWatcherService() { return $this->services['Yoast\\WP\\Free\\Watchers\\Primary_Term_Watcher'] = new \Yoast\WP\Free\Watchers\Primary_Term_Watcher(${($_ = isset($this->services['Yoast\\WP\\Free\\Repositories\\Primary_Term_Repository']) ? $this->services['Yoast\\WP\\Free\\Repositories\\Primary_Term_Repository'] : $this->getPrimaryTermRepositoryService()) && false ?: '_'}); }
[ "protected function getPrimaryTermRepositoryService()\n {\n return $this->services['Yoast\\\\WP\\\\Free\\\\Repositories\\\\Primary_Term_Repository'] = \\Yoast\\WP\\Free\\Repositories\\Primary_Term_Repository::get_instance();\n }", "protected function getPrimaryTermRepositoryService()\n {\n return $this->services['Yoast\\\\WP\\\\SEO\\\\Repositories\\\\Primary_Term_Repository'] = new \\Yoast\\WP\\SEO\\Repositories\\Primary_Term_Repository();\n }", "protected function getWpYoastPrimaryTermService()\n {\n return $this->services['Yoast\\\\WP\\\\SEO\\\\Config\\\\Migrations\\\\WpYoastPrimaryTerm'] = new \\Yoast\\WP\\SEO\\Config\\Migrations\\WpYoastPrimaryTerm(${($_ = isset($this->services['Yoast\\\\WP\\\\Lib\\\\Migrations\\\\Adapter']) ? $this->services['Yoast\\\\WP\\\\Lib\\\\Migrations\\\\Adapter'] : ($this->services['Yoast\\\\WP\\\\Lib\\\\Migrations\\\\Adapter'] = new \\Yoast\\WP\\Lib\\Migrations\\Adapter())) && false ?: '_'});\n }", "protected function getIndexableTermWatcherService()\n {\n }", "protected function getAutoUpdateWatcherService()\n {\n }", "protected function getIndexableAuthorWatcherService()\n {\n return $this->services['Yoast\\\\WP\\\\SEO\\\\Watchers\\\\Indexable_Author_Watcher'] = new \\Yoast\\WP\\SEO\\Watchers\\Indexable_Author_Watcher(${($_ = isset($this->services['Yoast\\\\WP\\\\SEO\\\\Repositories\\\\Indexable_Repository']) ? $this->services['Yoast\\\\WP\\\\SEO\\\\Repositories\\\\Indexable_Repository'] : $this->getIndexableRepositoryService()) && false ?: '_'}, ${($_ = isset($this->services['Yoast\\\\WP\\\\SEO\\\\Builders\\\\Indexable_Author_Builder']) ? $this->services['Yoast\\\\WP\\\\SEO\\\\Builders\\\\Indexable_Author_Builder'] : ($this->services['Yoast\\\\WP\\\\SEO\\\\Builders\\\\Indexable_Author_Builder'] = new \\Yoast\\WP\\SEO\\Builders\\Indexable_Author_Builder())) && false ?: '_'});\n }", "protected function getIndexableSystemPageWatcherService()\n {\n return $this->services['Yoast\\\\WP\\\\SEO\\\\Integrations\\\\Watchers\\\\Indexable_System_Page_Watcher'] = new \\Yoast\\WP\\SEO\\Integrations\\Watchers\\Indexable_System_Page_Watcher(${($_ = isset($this->services['Yoast\\\\WP\\\\SEO\\\\Repositories\\\\Indexable_Repository']) ? $this->services['Yoast\\\\WP\\\\SEO\\\\Repositories\\\\Indexable_Repository'] : $this->getIndexableRepositoryService()) && false ?: '_'}, ${($_ = isset($this->services['Yoast\\\\WP\\\\SEO\\\\Builders\\\\Indexable_Builder']) ? $this->services['Yoast\\\\WP\\\\SEO\\\\Builders\\\\Indexable_Builder'] : $this->getIndexableBuilderService()) && false ?: '_'});\n }", "protected function getPrimaryCategoryService()\n {\n }", "protected function getSylius_PromotionRuleChecker_TaxonomyService()\n {\n return $this->services['sylius.promotion_rule_checker.taxonomy'] = new \\Sylius\\Component\\Core\\Promotion\\Checker\\TaxonomyRuleChecker();\n }", "protected function getIndexerService() {\n\t\treturn GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\Service\\IndexerService');\n\t}", "protected function getSoftReferenceParserHookService()\n {\n return $this->services['TYPO3\\\\CMS\\\\Form\\\\Hooks\\\\SoftReferenceParserHook'] = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstanceForDi(\\TYPO3\\CMS\\Form\\Hooks\\SoftReferenceParserHook::class, ($this->services['Psr\\\\EventDispatcher\\\\EventDispatcherInterface_decorated_1'] ?? $this->getEventDispatcherInterfaceDecorated1Service()));\n }", "public function getTasteometerService()\n {\n return $this->getService('tasteometer');\n }", "protected function getPrimaryCategoryConditionalService()\n {\n return $this->services['Yoast\\\\WP\\\\SEO\\\\Conditionals\\\\Primary_Category_Conditional'] = new \\Yoast\\WP\\SEO\\Conditionals\\Primary_Category_Conditional(${($_ = isset($this->services['Yoast\\\\WP\\\\SEO\\\\Helpers\\\\Current_Page_Helper']) ? $this->services['Yoast\\\\WP\\\\SEO\\\\Helpers\\\\Current_Page_Helper'] : $this->getCurrentPageHelperService()) && false ?: '_'});\n }", "protected function getTokenizer_WordService()\n {\n return $this->services['tokenizer.word'] = new \\Camspiers\\StatisticalClassifier\\Tokenizer\\Word();\n }", "static function primary(){\n\t\tif(!static::$instances[static::$primary_singleton_name]){\n\t\t\tstatic::init();\n\t\t}\n\t\treturn static::$instances[static::$primary_singleton_name];\n\t}", "public function getService ()\n {\n if (null === $this->_service) {\n $this->setService('Default_Service_Spirit');\n }\n return $this->_service;\n }", "public static function getService() {\n\t\tif( !static::$service ) {\n\t\t\tstatic::$service = new static();\n\t\t}\n\t\treturn static::$service;\n\t}", "protected function getClaroline_Common_ThemeServiceService()\n {\n return $this->services['claroline.common.theme_service'] = new \\Claroline\\CoreBundle\\Library\\Themes\\ThemeService($this->get('doctrine.orm.default_entity_manager'), $this);\n }", "protected function getFooService()\n {\n return $this->services['foo'] = new \\Issei\\Classes\\Foo($this->get('bar'), $this->get('stopwatch'), 'symfony-di');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns defined enum values
public function getEnumValues() { return array( 'IGNORE' => self::IGNORE, 'EXPECT_EXIST' => self::EXPECT_EXIST, 'EXPECT_NOT_EXIST' => self::EXPECT_NOT_EXIST, ); }
[ "public function getEnumValues()\n {\n return array(\n 'TEXT_FULL' => self::TEXT_FULL,\n 'TEXT_SEG' => self::TEXT_SEG,\n 'TEXT_SEG_BY_SEP' => self::TEXT_SEG_BY_SEP,\n 'INT_RANGE' => self::INT_RANGE,\n 'REAL_RANGE' => self::REAL_RANGE,\n 'INT_EQUAL' => self::INT_EQUAL,\n 'TWO_DIME_RANGE' => self::TWO_DIME_RANGE,\n 'USER_DEFINE0' => self::USER_DEFINE0,\n 'USER_DEFINE1' => self::USER_DEFINE1,\n 'USER_DEFINE2' => self::USER_DEFINE2,\n 'USER_DEFINE3' => self::USER_DEFINE3,\n 'USER_DEFINE4' => self::USER_DEFINE4,\n 'USER_DEFINE5' => self::USER_DEFINE5,\n 'USER_DEFINE6' => self::USER_DEFINE6,\n 'USER_DEFINE7' => self::USER_DEFINE7,\n 'USER_DEFINE8' => self::USER_DEFINE8,\n 'USER_DEFINE9' => self::USER_DEFINE9,\n );\n }", "public function getEnumValues()\n {\n return array(\n 'searched' => self::searched,\n 'battle' => self::battle,\n 'prepare' => self::prepare,\n 'occupy' => self::occupy,\n 'protect' => self::protect,\n );\n }", "public function getEnumValues()\n {\n return array(\n 'victory' => self::victory,\n 'defeat' => self::defeat,\n 'canceled' => self::canceled,\n 'timeout' => self::timeout,\n );\n }", "public function getEnumValues()\n {\n return array(\n 'NEW' => self::NEW,\n 'PROCESSING' => self::PROCESSING,\n 'FAIL' => self::FAIL,\n 'APPLIED' => self::APPLIED,\n 'CLOSE' => self::CLOSE,\n );\n }", "public function getEnumValues()\n {\n return array(\n 'idle' => self::idle,\n 'hire' => self::hire,\n 'mining' => self::mining,\n );\n }", "public function getEnumValues()\n {\n return array(\n 'get_ok' => self::get_ok,\n 'change_ok' => self::change_ok,\n 'fail' => self::fail,\n );\n }", "public function getEnumValues()\n {\n return array(\n 'open' => self::open,\n 'add' => self::add,\n 'remove' => self::remove,\n 'close' => self::close,\n 'opened' => self::opened,\n 'closed' => self::closed,\n 'query' => self::query,\n 'query_result' => self::query_result,\n 'conflict' => self::conflict,\n 'added' => self::added,\n 'removed' => self::removed,\n 'start' => self::start,\n 'started' => self::started,\n 'joined' => self::joined,\n 'members_joined' => self::members_joined,\n 'left' => self::left,\n 'members_left' => self::members_left,\n 'results' => self::results,\n 'count' => self::count,\n 'result' => self::result,\n 'update' => self::update,\n 'updated' => self::updated,\n 'mute' => self::mute,\n 'unmute' => self::unmute,\n 'status' => self::status,\n 'members' => self::members,\n 'join' => self::join,\n 'invite' => self::invite,\n 'leave' => self::leave,\n 'kick' => self::kick,\n 'reject' => self::reject,\n 'invited' => self::invited,\n 'kicked' => self::kicked,\n 'upload' => self::upload,\n 'uploaded' => self::uploaded,\n );\n }", "public function getEnumValues()\n {\n return array(\n 'guild' => self::guild,\n 'tbc' => self::tbc,\n 'stage' => self::stage,\n 'excav' => self::excav,\n );\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::ELIGIBLE,\nself::NOT_ELIGIBLE, ];\n }", "public static function enums() {\n return [];\n }", "public function enumValueDefinition();", "public static function getAllowableEnumValues()\n {\n return [\n self::_101,\n self::_102,\n self::_103,\n self::_104,\n self::_105,\n self::_106,\n self::_107\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::DBIT,\n self::CRDT,\n ];\n }", "public static function getEnumFields();", "public static function getAllowableEnumValues()\n {\n return [\n self::SP,\n self::LTL,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::ADGROUP,\n self::CRITERION,\n self::UNKNOWN,\n ];\n }", "final public static function getValues()\n {\n $values = [];\n foreach (self::getEnumerators() as $enum) {\n $values[$enum->getOrdinal()] = $enum->getValue();\n }\n\n return $values;\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::NUMBER_0,\n self::NUMBER_1,\n self::NUMBER_2\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::FULL,\n self::READ_ONLY,\n self::PURGE_SELECT,\n self::PURGE_ALL\n ];\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Setup the logging context and run the doWorkChildImpl()
private function doWorkChild() { Log5PHP_MDC::put('Generation', 'child'); $this->doWorkChildImpl(); $this->childCleanup(); exit(); }
[ "abstract protected function startLog();", "public function initLogger(): void\n {\n $logFileName = sprintf(\n '%s-%s-%s.log',\n $this->spider->getName(),\n (new \\DateTime())->format('Y-m-d'),\n $this->id\n );\n $this->logger = new Logger('job-'.$this->id);\n $this->logger->pushHandler(\n new StreamHandler(Config::getenv('LOG_DIR').$logFileName)\n );\n $this->spider->setLogger($this->logger);\n }", "public static function start_logging(task_base $task) {\n global $CFG, $DB;\n\n if (!self::should_log()) {\n return;\n }\n\n // We register a shutdown handler to ensure that logs causing any failures are correctly disposed of.\n // Note: This must happen before the per-request directory is requested because the shutdown handler deletes the logfile.\n if (!self::$tasklogregistered) {\n \\core_shutdown_manager::register_function(function() {\n // These will only actually do anything if capturing is current active when the thread ended, which\n // constitutes a failure.\n \\core\\task\\logmanager::finalise_log(true);\n });\n\n // Create a brand new per-request directory basedir.\n get_request_storage_directory(true, true);\n\n self::$tasklogregistered = true;\n }\n\n if (self::is_current_output_buffer()) {\n // We cannot capture when we are already capturing.\n throw new \\coding_exception('Logging is already in progress for task \"' . get_class(self::$task) . '\". ' .\n 'Nested logging is not supported.');\n }\n\n // Store the initial data about the task and current state.\n self::$task = $task;\n self::$taskloginfo = (object) [\n 'dbread' => $DB->perf_get_reads(),\n 'dbwrite' => $DB->perf_get_writes(),\n 'timestart' => microtime(true),\n ];\n\n // For simplicity's sake we always store logs on disk and flush at the end.\n self::$logpath = make_request_directory() . DIRECTORY_SEPARATOR . \"task.log\";\n self::$fh = fopen(self::$logpath, 'w+');\n\n // Note the level of the current output buffer.\n // Note: You cannot use ob_get_level() as it will return `1` when the default output buffer is enabled.\n if ($obstatus = ob_get_status()) {\n self::$oblevel = $obstatus['level'];\n } else {\n self::$oblevel = null;\n }\n\n self::$outputloggedcontent = !empty($CFG->task_logtostdout);\n\n // Start capturing output.\n ob_start([\\core\\task\\logmanager::class, 'add_line'], self::CHUNKSIZE);\n }", "protected function initLogger(): void\n {\n $customPath = $this->context->getConfigurationService()->getLogPath();\n $severity = $this->context->getConfigurationService()->getLogSeverity();\n\n Logger::resetErrors();\n $this->logger = Logger::getInstance(__CLASS__, $customPath, $severity);\n }", "public function run( LoggerInterface $logger ){\n \t\t//set the $logger var to the passed $logger object //\n \t\t$this->setLogger( $logger );\n\n \t\t// call the addToWriter method to add writers to the $logger //\n \t\t$this->addToWriter();\n \t}", "protected function initWorker()\n {\n $this->getDI()->get('logr')->debug(json_encode(func_get_args()));\n $this->getDI()->get('logr')->info(\"Loading workflow config from {$this->paramHash['workflow']}\");\n $this->workflowConfigDto = WorkflowConfigDtoFactory::get($this->paramHash['workflow']);\n $this->registerClientNS(\n $this->workflowConfigDto->getServicesClassNameSpace(),\n $this->workflowConfigDto->getServicesClassPath()\n );\n $this->workerHostname = php_uname('n');\n $this->workerCode = $this->getWorkerCode($this->paramHash);\n $this->initMq();\n $this->startedAtSec = round(microtime(true));\n }", "public static function start_logging() {\n\t\tadd_action( 'doing_it_wrong_run', array( __CLASS__, 'doing_it_wrong_run' ), 10, 3 );\n\t\tadd_filter( 'doing_it_wrong_trigger_error', '__return_false' );\n\t}", "public static function setupLogger() {\n\t\t## SETUP LOGGER\n\t\tglobal $current_user;\n\t\tget_currentuserinfo();\n\t\tLogger::setID( 'wordpress', $current_user->ID, get_option('pl_id') );\n\t}", "public function log_setup()\n {\n // Get options\n $log = $this->opt['woochimp_enable_log'] == 1 ? $this->opt['woochimp_log_events'] : false;\n\n // Log is enabled\n if ($log !== false && !isset($this->logger)) {\n\n // Set logger object\n $this->logger = new WC_Logger();\n\n // Set type\n $this->log_type = $log;\n\n // Maybe migrate old log\n $this->log_migrate();\n }\n }", "private function log(): void\n {\n LogAccountAudit::dispatch([\n 'company_id' => $this->data['company_id'],\n 'action' => 'task_created',\n 'author_id' => $this->author->id,\n 'author_name' => $this->author->name,\n 'audited_at' => Carbon::now(),\n 'objects' => json_encode([\n 'employee_id' => $this->employee->id,\n 'employee_name' => $this->employee->name,\n 'title' => $this->data['title'],\n ]),\n ])->onQueue('low');\n\n LogEmployeeAudit::dispatch([\n 'employee_id' => $this->data['employee_id'],\n 'action' => 'task_created',\n 'author_id' => $this->author->id,\n 'author_name' => $this->author->name,\n 'audited_at' => Carbon::now(),\n 'objects' => json_encode([\n 'title' => $this->data['title'],\n ]),\n ])->onQueue('low');\n }", "public function run()\n {\n foreach ($this->loaders as $identifier => $loader) {\n try {\n $this->loaderResults = array_merge($this->loaderResults, $loader->load());\n\n if ($loader->stopPropagation()) {\n break;\n }\n } catch (LoaderException $e) {\n //Todo: log here\n }\n }\n\n try {\n\n $this->persist($this->loaderResults);\n\n } catch (PersistorException $e) {\n // todo: log here\n }\n }", "public function initLogger()\n {\n $path = $this->getLogPath();\n if (!$path) {\n return;\n }\n\n $logger = new Monolog(\"task.$this->id.log\");\n\n try {\n $handler = new StreamHandler($path, Monolog::DEBUG);\n\n // formatter\n $format = LineFormatter::SIMPLE_FORMAT;\n $formatter = new LineFormatter($format);\n $handler->setFormatter($formatter);\n\n $logger->pushHandler($handler);\n\n $this->setTaskData('log_path', $path);\n $this->setLogger($logger);\n } catch (Exception $e) {\n $msg = get_exception_msg($e);\n Log::error(__METHOD__. \" Failed to create logger for Task[id=$this->id], reason: $msg\");\n return;\n }\n }", "static private function _initialiseLogging () {\n Log::setLogWriter(new Cmf_Startup_Log_Writer);\n }", "protected function initializeLogger()\n {\n $config = $this->getConfig();\n $loggingPath = $config [\"logging\"] [\"path\"];\n $logFilename = $config [\"logging\"] [\"filename\"];\n\n // Setting up current channel\n $loggingPath = realpath($loggingPath);\n $loggingFilename = Path::combine($loggingPath, $logFilename);\n $appender = new LoggerFileAppender($loggingFilename, \"ab\");\n $this->logger->addAppender($appender);\n $this->logger->setDepartment(\"webapp \");\n $this->logger->info(str_repeat(\"-\", 80));\n }", "public function run()\n\t\t{\n\t\t\t// Sets up the Applog, any other pre-requisites\n\t\t\tparent::run();\n\t\t\t$this->Resolve_Flash_Report($this->start_date);\n\t\t}", "protected function populateLogger()\n {\n // Don't bother initializing more than once\n if ($this->loggerPopulated) {\n return;\n }\n\n // Default the subject to the loaded model\n $this->logger->for($this->model);\n\n // Default the logName to the plugin code of the loaded model\n // TODO: Document ability to control the log name from the model\n if ($this->model->methodExists('trackableGetLogName')) {\n $this->logger->inLog($this->model->trackableGetLogName($this->model));\n } else {\n $this->logger->inLog($this->trackableGetLogName($this->model));\n }\n\n // Default the source to the currently logged in backend user (if there is one)\n $user = BackendAuth::getUser();\n if ($user) {\n // Ensure that impersonators are logged as the true source of the activity\n if (BackendAuth::isImpersonator()) {\n $user = BackendAuth::getImpersonator();\n }\n\n $this->logger->by($user);\n }\n\n $this->loggerPopulated = true;\n }", "protected function daemonize() {\n // fork the current process\n $pid = pcntl_fork();\n switch($pid) {\n case -1 :\n // @codeCoverageIgnoreStart\n throw new Exception('Forking failed. Cannot spawn daemon');\n case 0 :\n // detach from terminal by obtaining a new process group\n posix_setsid();\n\n // detach console log. from this point all regular logging\n // goes to the log file. Note: If a fatal error occurs it\n // will be still sent to the console\n $this->log = new Jm_Log();\n $logfile = $this->configuration->logging->logfile;\n if(!empty($logfile)) {\n $this->log->attach(new Jm_Log_FileObserver($logfile));\n }\n\n try {\n $this->daemon();\n } catch (Exception $e) {\n $this->log($e->getMessage(), Jm_Log_Level::ERROR);\n $this->log('Aborting', Jm_Log_Level::ERROR);\n exit(1);\n }\n exit(0); // should never happen\n // @codeCoverageIgnoreEnd\n default:\n $this->pidfile->content((string)$pid);\n $this->daemonPid = $pid;\n return $this;\n } \n }", "protected function mainRun() {\n if($this->getContext() instanceof \\codename\\core\\context\\customContextInterface) {\n $this->doContextRun();\n } else {\n $this->doAction()->doView();\n }\n $this->doShow()->doOutput();\n }", "public function configureForChildLogs(mixed $sender, mixed $data)\n\t{\n\t\tif (!$this->_childConnection) {\n\t\t\treturn;\n\t\t}\n\t\t$pid = $data['pid'];\n\t\tif ($pid === -1) { //fail\n\t\t\tif ($this->_childConnection) {\n\t\t\t\tstream_socket_shutdown($this->_childConnection[0], STREAM_SHUT_RDWR);\n\t\t\t\tstream_socket_shutdown($this->_childConnection[1], STREAM_SHUT_RDWR);\n\t\t\t\t$this->_childConnection = null;\n\t\t\t}\n\t\t} elseif ($pid === 0) { // Child Process\n\t\t\t$this->_parentConnections = [];\n\t\t\t$this->_childConnection = $this->_childConnection[1];\n\t\t\t$logger = Prado::getLogger();\n\t\t\t$logger->deleteLogs();\n\t\t\t$logs = $logger->deleteProfileLogs();\n\t\t\t$pid = getmypid();\n\t\t\tforeach(array_keys($logs) as $key) { // Reset PROFILE_BEGIN to pid.\n\t\t\t\t$logs[$key][TLogger::LOG_LEVEL] &= ~TLogger::LOGGED;\n\t\t\t\t$logs[$key][TLogger::LOG_PID] = $pid;\n\t\t\t}\n\t\t\t$logger->mergeLogs($logs); // Profiler logs with child pid\n\t\t\t$logger->getEventHandlers('onFlushLogs')->clear();\n\t\t\t$logger->attachEventHandler('onFlushLogs', [$this, 'sendLogsToParent'], $this->getPriority());\n\t\t\t$this->_receiverInstalled = true;\n\t\t} else { // Parent Process\n\t\t\t$this->_parentConnections[$pid] = $this->_childConnection[0];\n\t\t\t$this->_childConnection = null;\n\t\t\tif (!$this->_receiverInstalled) {\n\t\t\t\t$logger = Prado::getLogger();\n\t\t\t\t$logger->attachEventHandler('onCollectLogs', [$this, 'receiveLogsFromChildren'], $this->getPriority());\n\t\t\t\t$this->_receiverInstalled = true;\n\t\t\t}\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation postTelephonyProvidersEdgesDidpools Create a new DID pool
public function postTelephonyProvidersEdgesDidpools($body) { list($response) = $this->postTelephonyProvidersEdgesDidpoolsWithHttpInfo($body); return $response; }
[ "private function _createPool()\n {\n $schedule = Schedule::lookupById((int)$this->m_scheduleId);\n $divisionNameWithGender = $schedule->division->name . \" \" . $schedule->division->gender;\n $this->m_divisionNames[] = $divisionNameWithGender;\n $flight = Flight::lookupById((int)$this->m_flightId);\n $pool = Pool::create($flight, $schedule, $this->m_poolName);\n\n $this->m_messageString = \"Pool $pool->fullName successfully created\";\n }", "public function createPool($pool)\n {\n $_params = array(\"pool\" => $pool);\n return $this->master->call('ips/create-pool', $_params);\n }", "public function createPool($pool)\n {\n return $this->request('create-pool', [\n 'pool' => $pool,\n ]);\n }", "public function testCreatePool()\n {\n }", "public function deleteTelephonyProvidersEdgesDidpool($didPoolId)\n {\n $this->deleteTelephonyProvidersEdgesDidpoolWithHttpInfo($didPoolId);\n }", "public function createPool ( $id )\n\t{\n\t\tif ( !is_array( $this->pools ) || !array_key_exists( $id, $this->pools ) )\n\t\t{\n\t\t\t$this->pools[$id] = TRUE;\n\t\t}\n\t}", "public function postTelephonyProvidersEdgesExtensionpoolsWithHttpInfo($body)\n {\n $returnType = '\\PureCloudPlatform\\Client\\V2\\Model\\ExtensionPool';\n $request = $this->postTelephonyProvidersEdgesExtensionpoolsRequest($body);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ExtensionPool',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 409:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 413:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 415:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 429:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 503:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 504:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "protected function putTelephonyProvidersEdgesExtensionpoolRequest($extensionPoolId, $body)\n {\n // verify the required parameter 'extensionPoolId' is set\n if ($extensionPoolId === null || (is_array($extensionPoolId) && count($extensionPoolId) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $extensionPoolId when calling putTelephonyProvidersEdgesExtensionpool'\n );\n }\n // verify the required parameter 'body' is set\n if ($body === null || (is_array($body) && count($body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling putTelephonyProvidersEdgesExtensionpool'\n );\n }\n\n $resourcePath = '/api/v2/telephony/providers/edges/extensionpools/{extensionPoolId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($extensionPoolId !== null) {\n $resourcePath = str_replace(\n '{' . 'extensionPoolId' . '}',\n ObjectSerializer::toPathValue($extensionPoolId),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\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 static function createPoolAction()\n\t{\n\t\t// Start the session in case we need to save\n\t\tparent::startSession();\n\n\t\t// Prepare POST parameters array\n\t\t$params = self::convertPOST();\n\n\t\t// Instantiate a NewSuicidePool Bean and validate all parameters\n\t\t$newPoolBean = new NewSuicidePoolModel($params);\n\n\t\t$poolsDAO = new SuicidePoolsDAO();\n\t\t$poolsDAO->addPool($newPoolBean);\n\n\t\tparent::sendPositiveHTTPResponse();\n\t}", "public function __construct(array $pools)\n {\n $this->pools = $pools;\n }", "protected function createMockPool()\n {\n $pool = [];\n\n $link1 = new ContainerLink('REDIS_1', 'testing-1', 'testing-3', [\n '1000/tpc' => 'tcp://10.0.0.1:1000'\n ]);\n\n $link2 = new ContainerLink('REDIS_2', 'testing-2', 'testing-3', [\n '1000/tpc' => 'tcp://10.0.0.1:1000'\n ]);\n\n $pool[] = $link1;\n $pool[] = $link2;\n\n $this->app['cache']\n ->store('tutumredisconfig')\n ->forever('redis_pool', $pool);\n }", "public function testDataProvidersIdRegisterPost()\n {\n }", "public function insert($projectName, $zone, \\Google\\Service\\Replicapool\\Pool $postBody, $optParams = array())\n {\n $params = array('projectName' => $projectName, 'zone' => $zone, 'postBody' => $postBody);\n $params = array_merge($params, $optParams);\n return $this->call('insert', array($params), 'Google\\Service\\Replicapool\\Pool');\n }", "public function testPoolAdd()\n {\n\n }", "public function associatPools($candidateId, array $pools)\n {\n return $this->client->post(sprintf(self::BASE_ENDPOINT.'/%s/pools', $candidateId), [\n 'ids' => $pools,\n ]);\n }", "public function postTelephonyProvidersEdgesPhones($body)\n {\n list($response) = $this->postTelephonyProvidersEdgesPhonesWithHttpInfo($body);\n return $response;\n }", "function add_ip_2_pool() {\n\t\trequire_once('../modules/addons/prve/Ipv4/Subnet.php');\n\t\techo '<form method=\"post\">\n\t\t\t<table class=\"form\" border=\"0\" cellpadding=\"3\" cellspacing=\"1\" width=\"100%\">\n\t\t\t\t<tr>\n\t\t\t\t\t<td class=\"fieldlabel\">IP Pool</td>\n\t\t\t\t\t<td class=\"fieldarea\">\n\t\t\t\t\t\t<select class=\"form-control select-inline\" name=\"pool_id\">';\n\t\t\t\t\t\t\tforeach (Capsule::table('mod_prve_ip_pools')->get() as $pool) {\n\t\t\t\t\t\t\t\techo '<option value=\"'.$pool->id.'\">'.$pool->title.'</option>';\n\t\t\t\t\t\t\t\t$gateways[]=$pool->gateway ;\n\t\t\t\t\t\t\t}\n\t\t\t\t echo '</select>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class=\"fieldlabel\">IP Block</td>\n\t\t\t\t\t<td class=\"fieldarea\">\n\t\t\t\t\t\t<input type=\"text\" name=\"ipblock\"/>\n\t\t\t\t\t\tIP Block with CIDR e.g. 172.16.255.230/27, for single IP address just don\\'t use CIDR\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t\t<input type=\"submit\" name=\"assignIP2pool\" value=\"save\"/>\n\t\t\t</form>';\n\t\tif (isset($_POST['assignIP2pool'])) {\n\t\t\t// check if single IP address\n\t\t\tif ((strpos($_POST['ipblock'],'/'))!=false) {\n\t\t\t\t$subnet=Ipv4_Subnet::fromString($_POST['ipblock']);\n\t\t\t\t$ips = $subnet->getIterator();\n\t\t\t\tforeach($ips as $ip) {\n\t\t\t\t\tif (!in_array($ip, $gateways)) {\n\t\t\t\t\t\tCapsule::table('mod_prve_ip_addresses')->insert(\n\t\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t\t'pool_id' => $_POST['pool_id'],\n\t\t\t\t\t\t\t\t\t'ipaddress' => $ip,\n\t\t\t\t\t\t\t\t\t'mask' => $subnet->getNetmask(),\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (!in_array($_POST['ipblock'], $gateways)) {\n\t\t\t\t\tCapsule::table('mod_prve_ip_addresses')->insert(\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t'pool_id' => $_POST['pool_id'],\n\t\t\t\t\t\t\t\t'ipaddress' => $_POST['ipblock'],\n\t\t\t\t\t\t\t\t'mask' => '255.255.255.255',\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\theader(\"Location: \".PRVE_BASEURL.\"&tab=ippools&action=list_ips&id=\".$_POST['pool_id']);\n\t\t\t$_SESSION['prve']['infomsg']['title']='IP Address/Blocks added to Pool.' ;\n\t\t\t$_SESSION['prve']['infomsg']['message']='you can remove IP addresses from the pool.' ;\n\t\t}\n\t}", "public function testCrcePoolAdministrationDeletePool()\n {\n\n }", "public function setTargetPools($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING);\n $this->target_pools = $arr;\n\n return $this;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Method: getJS Returns the expression represented in JavaScript. Parameters: $indent The current indentation string that should be concatenated after newlines. $parser An instance of . In Javascript, some form elements are accessed in different ways, so the expression then needs to know its input type. With a DescParser it can ask this information. Returns: A string representing the expression in JavaScript.
abstract public function getJS($indent, DescParser $parser);
[ "public static function getJSEvaluate()\n {\n return <<<JS\n\t\t\tvar params = this.getParameters(),\n\t\t\t numerator = params[0].evaluate();\n\t\t\t denominator = params[1].evaluate();\n if (denominator == 0) {\n\t\t\t throw \"Division by 0 error\";\n }\n\t\t\treturn this.context.divide(numerator, denominator);\nJS;\n }", "static function getJSEvaluate()\n {\n return <<<EOQ\n var SEE = SUGAR.expressions.Expression,\n params = this.getParameters(),\n cond = params[0].evaluate();\n if (SEE.isTruthy(cond)) {\n return params[1].evaluate();\n } else {\n return params[2].evaluate();\n }\nEOQ;\n }", "static function getJSEvaluate() {\n\t\treturn <<<EOQ\n\t\t\tvar params = this.getParameters();\n\t\t\treturn params;\nEOQ;\n\t}", "public function getScript()\n {\n $sJaxonPrefix = $this->getOption('core.prefix.class');\n // Generate code for javascript objects declaration\n $code = '';\n $classes = array();\n foreach($this->aClassPaths as $sClassPath)\n {\n $offset = 0;\n $sClassPath .= '.Null'; // This is a sentinel. The last token is not processed in the while loop.\n while(($dotPosition = strpos($sClassPath, '.', $offset)) !== false)\n {\n $class = substr($sClassPath, 0, $dotPosition);\n // Generate code for this object\n if(!array_key_exists($class, $classes))\n {\n $code .= \"$sJaxonPrefix$class = {};\\n\";\n $classes[$class] = $class;\n }\n $offset = $dotPosition + 1;\n }\n }\n // Generate code for javascript methods\n foreach($this->aCallableObjects as $xCallableObject)\n {\n $code .= $xCallableObject->getScript();\n }\n return $code;\n }", "public static function getJSEvaluate()\n {\n return <<<JS\n\t\t\tvar params = this.getParameters();\n\n\t\t\tvar base = params[0].evaluate();\n\t\t\tvar precision = params[1].evaluate();\n\n\t\t\treturn this.context.round(base, precision);\nJS;\n }", "public function getJavascriptCode() {}", "public function getJavaScript();", "private function getJavascriptValueSecondWay() {\n $js = \"$(this).\";\n if($this->getSourceAttribute() == 'html') {\n $js .= \"html()\";\n } else if($this->getSourceAttribute() == 'value') {\n $js .= \"val()\";\n } else {\n $js .= \"attr(\\\"{$this->getSourceAttribute()}\\\")\";\n }\n return $js;\n }", "public function convert() {\r\n\t\t$conv = new phpToJS;\r\n\t\t$return = \"\";\r\n\t\t$return .= $this->sanitizedComment;\r\n\t\t$signature = array();\r\n\t\t$params = array();\r\n\t\t$defaultValues = array();\r\n\t\tforeach($this->parameters as $param) {\r\n\t\t\t$name = $conv->sanitizeVariableName($param->getName());\r\n\t\t\t$signature[] = $name;\r\n\t\t\tif ($param->isDefaultValueAvailable()) {\r\n\t\t\t\t$defaultValues[$name] = $param->getDefaultValue();\r\n\t\t\t}\r\n\t\t\t$params[$name] = $name;\r\n\t\t}\r\n\t\t$signature = implode(\", \",$signature);\r\n\t\t$methodName = $this->reflection->name;\r\n\t\tif (substr($methodName,0,2) == \"__\") {\r\n\t\t\t$methodName = substr($methodName,2);\r\n\t\t}\r\n\t\t$methodName = $conv->sanitizeVariableName($methodName);\r\n\t\t$return .= \"Yii.\".$this->declaringClass->name.\".prototype.\".$methodName. \" = function (\".$signature.\") {\\n\";\r\n\t\t\r\n\t\t$code = $conv->printTokens($conv->convertTokens($this->tokens));\r\n\t\tforeach($conv->declaredVars as $n => $item) {\r\n\t\t\tif (isset($params[$item]) || $item == \"this\") {\r\n\t\t\t\t\r\n\t\t\t\tunset($conv->declaredVars[$n]);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (count($conv->declaredVars)) {\r\n\t\t\t$return .= \"\\t\\tvar \".implode(\", \",$conv->declaredVars).\";\\n\";\r\n\t\t}\r\n\t\tforeach($defaultValues as $name => $value) {\r\n\t\t\t$return .= \"\\t\\tif ($name === undefined) {\\n\";\r\n\t\t\t$return .= \"\\t\\t\\t$name = \".CJavaScript::encode($value).\";\\n\";\r\n\t\t\t$return .= \"\\t\\t}\\n\";\r\n\t\t}\r\n\t\t\r\n\t\t$return .= $code;\r\n\t\t$return .= \"\\t\\t\\n\";\r\n\t\t$return .= \"\\t}\";\r\n\t\treturn $return;\r\n\t}", "public function getJsFormat();", "public function getExpression(): string;", "public function getExpression() {\r\n return $this->phpparser_expr;\r\n }", "private function _getJS(){\n \n // Start the JS string\n $js = 'var ' . $this->variableName . ' = ' . $this->variableName . ' || [];' . PHP_EOL;\n $js.= '(function() { ' . PHP_EOL;\n \n foreach($this->_data as $data) { \n // Clean up each item\n foreach($data as $key => $item) {\n \n if(is_string($item)){\n $data[$key] = self::Q . preg_replace('~(?<!\\\\\\)'. self::Q . '~', '\\\\' . self::Q, $item) . self::Q;\n }\n else if(is_bool($item)) {\n $data[$key] = ($item) ? 'true' : 'false';\n }\n \n $prefixed = true;\n }\n\n $js.= ' ' . $this->variableName . '.push([' . implode(',', $data) . ']);' . PHP_EOL;\n }\n $js .= \"var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];\". PHP_EOL;\n $js .= \"g.type='text/javascript'; g.defer=true; g.async=true; g.src='{$this->trackerURL}/piwik.js';\". PHP_EOL;\n $js .= \"s.parentNode.insertBefore(g,s);\". PHP_EOL; \n $js .= \"})();\";\n \n return $js; \n }", "public function getJavaScriptCode()\n\t{\n\t\t$jsonInit = $this->toJson();\n $js = '';\n\n\t\t$js .= <<<JS\n\n\n jQuery(\"{$this->gridIdentifier}\").jqGrid($jsonInit);\n jQuery(\"{$this->gridIdentifier}\").jqGrid('navGrid','$this->pagerDivIdentifier',{edit:false,add:false,del:false})\nJS;\n if(!empty($this->customNavButtons)){\n foreach($this->customNavButtons as $customNavButton){\n $js .= \".jqGrid('navButtonAdd', '$this->pagerDivIdentifier',\" .\n Json::encode(\n $customNavButton,\n false,\n array('enableJsonExprFinder' => true))\n .\")\";\n }\n }\n $js .= ';';\n $js .= <<<JS\n jQuery(\"{$this->gridIdentifier}\").jqGrid('filterToolbar','$this->pagerDivIdentifier',{searchOperators : false});\nJS;\n\n\n\t\tif ($moreJs = $this->_dataTypeStrategy->getAditionalJavaScript() and $js .= $moreJs);\n\t\treturn $js;\n\t}", "public function getJavaScript()\n\t{\n\t\treturn $this->_javaScriptStatements;\n\t}", "function getJS($obj){\n $this->hook('pre-getJS');\n\n $r='';\n foreach($obj->js as $key=>$chains){\n $o='';\n foreach($chains as $chain){\n $o.=$chain->_render().\";\\n\";\n }\n switch($key){\n case 'never':\n // send into debug output\n //if(strlen($o)>2)$this->addOnReady(\"if(console)console.log('Element','\".$obj->name.\"','no action:','\".str_replace(\"\\n\",'',addslashes($o)).\"')\");\n continue;\n\n case 'always':\n $r.=$o;\n break;\n default:\n $o='';\n foreach($chains as $chain){\n $o.=$chain->_enclose($key)->_render().\";\\n\";\n }\n $r.=$o;\n }\n }\n if($r)$this->addOnReady($r);\n return $r;\n }", "function getJavascript()\n\t{\n\t\t\n\t\t$Js = <<<JS\n<script type=\"text/javascript\" src=\"/webEdition/js/libs/yui/yahoo-min.js\"></script>\n<script type=\"text/javascript\" src=\"/webEdition/js/libs/yui/event-min.js\"></script>\n<script type=\"text/javascript\" src=\"/webEdition/js/libs/yui/connection-min.js\"></script>\n\n<script type=\"text/javascript\">\n\nvar ajaxURL = \"/webEdition/rpc/rpc.php\";\nvar ajaxCallback = {\n\tsuccess: function(o) {\n\t\tif(typeof(o.responseText) != 'undefined' && o.responseText != '') {\n\t\t\tdocument.getElementById('tag_edit_area').value = o.responseText;\n\t\t}\n\t},\n\tfailure: function(o) {\n\t\talert(\"Failure\");\n\t}\n}\n\nfunction YUIdoAjax(value) {\n\tYAHOO.util.Connect.asyncRequest('POST', ajaxURL, ajaxCallback, 'protocol=text&cmd=GetSnippetCode&we_cmd[1]=' + value);\n}\n\n</script>\nJS;\n\t\t\n\t\treturn $Js;\n\t\n\t}", "public function getExpression();", "final public function getJsPart(){\n $validators = array();\n foreach($this->validators as $validator) $validators[] = $validator->toJsonData();\n $output = '<script type=\"text/javascript\">';\n $output .= '(function(){var field = $(\"#'.$this->attr->get(\"id\").'\"); if(!field.data(\"formtablefield\")) new FormTableField(field, '.json_encode($validators).')})();';\n $output .= '</script>';\n return $output;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Validate the syntax of a descriptor according to the database driver implementation.
abstract protected function validateDescriptor($storage_descriptor = null);
[ "protected function validateDescriptor($descriptor) {\n // We validate after removing tokens which contain not allowed characters\n // and also make the string longer than the maximum length.\n $token_free_descriptor = $this->removeTokensFromString($descriptor);\n\n if ($token_free_descriptor === '') {\n return ['valid' => TRUE];\n }\n\n // Allowed characters and length described at\n // https://support.bluesnap.com/docs/statement-descriptor.\n $regex = '/\\A[A-Za-z0-9 ' . preg_quote('&,.-#') . ']+\\z/';\n if (!preg_match($regex, $token_free_descriptor)) {\n return [\n 'valid' => FALSE,\n 'error' => $this->t(\n 'Statement descriptors may only contain alphanumeric characters,\n spaces, and these special characters: & , . - #'\n ),\n ];\n }\n\n if (strlen($token_free_descriptor) > 20) {\n return [\n 'valid' => FALSE,\n 'error' => $this->t(\n 'Statement descriptors cannot be longer than 20 characters.'\n ),\n ];\n }\n\n return ['valid' => TRUE];\n }", "private function checkDescription($desc)\n {\n $len = strlen($desc);\n if ($len > 255)\n {\n throw new \\InvalidArgumentException('Description must not be longer than 255 characters.');\n }\n }", "protected function parseDDL($ddl) {}", "public function validDataSourceInstance();", "abstract protected function isValidDefinition(ilADTDefinition $a_def);", "public function checkAttributeDefinition( $definition )\n {\n if ( preg_match( '/[\\x00-\\x1f\\x7f]/', $definition ) )\n throw new System_Api_Error( System_Api_Error::InvalidString );\n\n $info = System_Api_DefinitionInfo::fromString( $definition );\n\n $requiredKeys = array();\n $optionalKeys = array( 'required' => 'i', 'default' => 's' );\n\n switch ( $info->getType() ) {\n case 'TEXT':\n $optionalKeys[ 'multi-line' ] = 'i';\n $optionalKeys[ 'max-length' ] = 'i';\n $optionalKeys[ 'min-length' ] = 'i';\n break;\n\n case 'ENUM':\n $requiredKeys[ 'items' ] = 'a';\n $optionalKeys[ 'editable' ] = 'i';\n $optionalKeys[ 'multi-select' ] = 'i';\n $optionalKeys[ 'max-length' ] = 'i';\n $optionalKeys[ 'min-length' ] = 'i';\n break;\n\n case 'NUMERIC':\n $optionalKeys[ 'decimal' ] = 'i';\n $optionalKeys[ 'min-value' ] = 's';\n $optionalKeys[ 'max-value' ] = 's';\n $optionalKeys[ 'strip' ] = 'i';\n break;\n\n case 'DATETIME':\n $optionalKeys[ 'time' ] = 'i';\n $optionalKeys[ 'local' ] = 'i';\n break;\n\n case 'USER':\n $optionalKeys[ 'members' ] = 'i';\n $optionalKeys[ 'multi-select' ] = 'i';\n break;\n\n default:\n throw new System_Api_Error( System_Api_Error::InvalidDefinition );\n }\n\n if ( !$info->checkMetadataKeys( $requiredKeys, $optionalKeys ) )\n throw new System_Api_Error( System_Api_Error::InvalidDefinition );\n\n foreach ( $info->getAllMetadata() as $key => $value ) {\n switch ( $key ) {\n case 'min-value':\n case 'max-value':\n $this->checkString( $value, System_Const::ValueMaxLength, self::AllowEmpty );\n break;\n\n case 'required':\n case 'multi-line':\n case 'editable':\n case 'multi-select':\n case 'strip':\n case 'time':\n case 'local':\n case 'members':\n $this->checkBooleanValue( $value );\n break;\n\n case 'decimal':\n $this->checkIntegerValue( $value, 0, 6 );\n break;\n\n case 'max-length':\n case 'min-length':\n $this->checkIntegerValue( $value, 1, System_Const::ValueMaxLength );\n break;\n\n case 'items':\n if ( empty( $value ) )\n throw new System_Api_Error( System_Api_Error::NoItems );\n foreach ( $value as $item )\n $this->checkString( $item, System_Const::ValueMaxLength );\n if ( count( array_unique( $value ) ) != count( $value ) )\n throw new System_Api_Error( System_Api_Error::DuplicateItems );\n break;\n }\n }\n\n $default = $info->getMetadata( 'default', '' );\n\n $flags = self::AllowEmpty;\n if ( $info->getType() == 'TEXT' && $info->getMetadata( 'multi-line', 0 ) )\n $flags |= self::MultiLine;\n $this->checkString( $default, System_Const::ValueMaxLength, $flags );\n\n switch ( $info->getType() ) {\n case 'TEXT':\n $minLength = $info->getMetadata( 'min-length' );\n $maxLength = $info->getMetadata( 'max-length' );\n if ( $minLength !== null && $maxLength !== null && (int)$minLength > (int)$maxLength )\n throw new System_Api_Error( System_Api_Error::InvalidLimits );\n break;\n\n case 'ENUM':\n $editable = $info->getMetadata( 'editable', 0 );\n $multiSelect = $info->getMetadata( 'multi-select', 0 );\n $minLength = $info->getMetadata( 'min-length' );\n $maxLength = $info->getMetadata( 'max-length' );\n if ( ( !$editable || $multiSelect ) && ( $minLength !== null || $maxLength !== null ) )\n throw new System_Api_Error( System_Api_Error::InvalidDefinition );\n if ( $minLength !== null && $maxLength !== null && (int)$minLength > (int)$maxLength )\n throw new System_Api_Error( System_Api_Error::InvalidLimits );\n if ( $minLength !== null || $maxLength !== null ) {\n foreach ( $info->getMetadata( 'items' ) as $item )\n $this->checkLength( $item, $minLength, $maxLength );\n }\n if ( $multiSelect ) {\n foreach ( $info->getMetadata( 'items' ) as $item )\n $this->checkItem( $item );\n }\n break;\n\n case 'NUMERIC':\n $decimal = $info->getMetadata( 'decimal', 0 );\n $minimum = $info->getMetadata( 'min-value' );\n $maximum = $info->getMetadata( 'max-value' );\n $strip = $info->getMetadata( 'strip', 0 );\n if ( $minimum !== null )\n $this->checkDecimalNumber( $minimum, $decimal );\n if ( $maximum !== null )\n $this->checkDecimalNumber( $maximum, $decimal );\n if ( $minimum !== null && $maximum !== null && (float)$minimum > (float)$maximum )\n throw new System_Api_Error( System_Api_Error::InvalidLimits );\n if ( $decimal == 0 && $strip )\n throw new System_Api_Error( System_Api_Error::InvalidDefinition );\n break;\n\n case 'DATETIME':\n $time = $info->getMetadata( 'time', 0 );\n $local = $info->getMetadata( 'local', 0 );\n if ( !$time && $local )\n throw new System_Api_Error( System_Api_Error::InvalidDefinition );\n break;\n }\n\n if ( $default != '' )\n $this->checkFilterValue( $info, $default );\n }", "public function supportsSchemas();", "static function validate_db($name, $value)\n\t\t{\n\t\t\t$chomps = explode(\".\", $name);\n\t\t\t//we zoeken de db_meta\n\t\t\t$res = DBConnect::query(\"SELECT * FROM `sys_database_meta` WHERE `tablename`='\" . $chomps[0] . \"' AND `fieldname`='\" . $chomps[1] . \"'\", __FILE__, __LINE__);\n\t\t\tif($row = mysql_fetch_array($res))\n\t\t\t{\n\t\t\t\t$options = data_description::options_convert_to_array($row[\"datadesc\"], $row[\"data_options\"]);\n\t\t\t\treturn data_description::validate($value, $row[\"datadesc\"], $options, $name, $row[\"fieldlabel\"], $row[\"obligated\"]);\n\t\t\t}\n\t\t\telse\n\t\t\t\treturn data_description::validate($value, 1, array(\"length\" => \"255\"), $name, $chomps[count($chomps)-1], 0);\n\t\t}", "public function validateDatabaseConfig(Database_Config $databaseConfig);", "private function _validateDescriptionFile()\n {\n $description_schema =\n self::_getRemoteFileContent(self::$_data_files['description_schema']);\n\n if (false === $description_schema)\n throw new AppDf_ParseException(\n AppDf_ParseException::E_RFILE_ACCESS,\n array('subject' => self::$_data_files['description_schema']),\n 'Unable to access desctiption schema file'\n );\n\n $desc_xml = new DOMDocument();\n if (!@$desc_xml->load($this->_description_xml_file))\n throw new AppDf_ParseException(\n AppDf_ParseException::E_DESCRIPTION_INVALID_XML,\n array('subject' => $this->_description_xml_file),\n 'Description file is invalid'\n );\n\n $old_status = libxml_use_internal_errors(TRUE);\n $validation_status = @$desc_xml->schemaValidateSource($description_schema);\n \n if (!$validation_status) {\n foreach (libxml_get_errors() as $error) {\n $this->_errors[] = array(\n 'subject' => $this->_description_xml_file,\n 'message' => \"$error->message on line $error->line\",\n 'exception_code' => AppDf_ParseException::E_DESCRIPTION_INVALID_XML,\n );\n }\n }\n libxml_clear_errors();\n libxml_use_internal_errors($old_status);\n return $validation_status;\n }", "public function testFailureDescriptionIsCalledWhenCreateDIdPQualAndAndValueIsInvalid(): void\n {\n $this->expectException(ExpectationFailedException::class);\n $this->expectExceptionMessageMatches(\n '` is a no-pointer declarator with foo declarator identifier and bar parameters and qualifiers`'\n );\n \n $didConst = ConceptConstraintDoubleBuilder::createDeclaratorIdConstraint($this)\n ->buildToString('foo declarator identifier')\n ->buildConstraintDescription('foo declarator identifier description')\n ->getDouble();\n $prmQualConst = ConceptConstraintDoubleBuilder::createParametersAndQualifiersConstraint($this)\n ->buildToString('bar parameters and qualifiers')\n ->buildConstraintDescription('bar parameters and qualifiers description')\n ->getDouble();\n \n $sut = NoptrDeclaratorConstraint::createDeclaratorIdParametersAndQualifiers(\n $didConst, \n $prmQualConst\n );\n $sut->evaluate(NULL, '', FALSE);\n }", "public function schemaValidateSource ($source) {}", "public function testFailureDescriptionWhenInstantiatedAndInvalid(): void\n {\n $this->expectException(ExpectationFailedException::class);\n $this->expectExceptionMessageMatches('` is a parameter declaration`');\n \n $declSpecSeqConst = $this->declSpecSeqConstFactory->createConstraintDescription(\n 'foo description'\n );\n \n $sut = new ParameterDeclarationConstraint($declSpecSeqConst);\n $sut->evaluate(NULL, '', FALSE);\n }", "function descrFormat ($value){\n \n if(strlen($value) == 0){\n return true;\n }\n \n else if(!preg_match(VALID_DESCR_FORMAT,$value)){\n return false;\n }\n \n return true;\n}", "function isDsnString($string)\n{\n return (bool)preg_match('/^(mysql|sqlite(\\\\d)*):/', $string);\n}", "public function validate_description()\r\n {\r\n return $this->checkProperty('description',!empty($this->description) &&\r\n strlen($this->description) >= 5 && strlen($this->description) <= 144,\r\n 'Comment %s must be between 5 and 144 characters');\r\n }", "private function getDesignationType()\n {\n $ret = true;\n $key = array_search('begin', $this->myRoutineSourceCodeLines);\n\n if ($key!==false)\n {\n for ($i = 1; $i<$key; $i++)\n {\n $n = preg_match('/^\\s*--\\s+type:\\s*(\\w+)\\s*(.+)?\\s*$/',\n $this->myRoutineSourceCodeLines[$key - $i],\n $matches);\n if ($n==1)\n {\n $this->myDesignationType = $matches[1];\n switch ($this->myDesignationType)\n {\n case 'bulk_insert':\n $m = preg_match('/^([a-zA-Z0-9_]+)\\s+([a-zA-Z0-9_,]+)$/',\n $matches[2],\n $info);\n if ($m==0)\n {\n throw new RuntimeException(\"Error: Expected: -- type: bulk_insert <table_name> <columns> in file '%s'.\",\n $this->mySourceFilename);\n }\n $this->myTableName = $info[1];\n $this->myColumns = explode(',', $info[2]);\n break;\n\n case 'rows_with_key':\n case 'rows_with_index':\n $this->myColumns = explode(',', $matches[2]);\n break;\n\n default:\n if (isset($matches[2])) $ret = false;\n }\n break;\n }\n if ($i==$key - 1) $ret = false;\n }\n }\n else\n {\n $ret = false;\n }\n\n if ($ret===false)\n {\n echo sprintf(\"Error: Unable to find the designation type of the stored routine in file '%s'.\\n\",\n $this->mySourceFilename);\n }\n\n return $ret;\n }", "private function __validate_descr() {\n if (isset($this->initial_data[\"descr\"])) {\n $this->validated_data[\"descr\"] = strval($this->initial_data[\"descr\"]);\n }\n }", "public function validateConventionDeclaration($cd, $context=null) {\n return $this->validateGeneric($cd, $this->constellation->getConventionDeclarations(), \"cd\");\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Print the menu bar with a list of projects to which the user has access
function print_subproject_menu_bar( $p_project_id, $p_parents = '' ) { $t_subprojects = current_user_get_accessible_subprojects( $p_project_id ); $t_char = ':'; foreach( $t_subprojects as $t_subproject ) { if ($t_char == ':') echo '<ul class="sub-menu">'; echo '<li class="menu-item">'; echo '<a href="' . helper_mantis_url( 'set_project.php?project_id=' . $p_parents . $t_subproject ) . '">' . string_html_specialchars( project_get_field( $t_subproject, 'name' ) ) . '</a>'; print_subproject_menu_bar( $t_subproject, $p_parents . $t_subproject . ';' ); echo '</li>'; $t_char = ','; } if ($t_char == ',') echo '</ul>'; }
[ "public function print_project_list() : string\n {\n $row = Tools::query(\"SELECT id, ProjectName FROM \"\n . $this->config['ProjectProfile'], 'ASSOC');\n \n $list = '';\n foreach ($row as $id => $PName) {\n $list .= \"<li><a href='../control/selectproject?id=$id'>$PName</a></li>\";\n }\n \n return $list;\n }", "public function menuAction()\n {\n return $this->render('PumWoodworkBundle:Project:menu.html.twig', array(\n 'projects' => $this->get('pum')->getAllProjects()\n ));\n }", "function showProjectManagerPage()\n{\n $res = atktext(\"pim_page_empty\").\"<br>\";\n $user = atkGetUserId();\n $ids = statusreportutil::getBookedProjectId(14,$user);\n if(!empty($ids))\n {\n $node = &atkGetNode(\"project.project\");\n $node->m_action = 'admin';\n $selector = \"project.coordinator='$user' AND project.id IN(\".implode(\",\",$ids).\")\";\n\n atkimport('atk.datagrid.atkdatagrid');\n $grid = atkDataGrid::create($node, 'pmview');\n\n $grid->setMode('admin');\n $grid->removeFlag(atkDataGrid::EXTENDED_SEARCH|atkDataGrid::SEARCH|atkDataGrid::SORT);\n\n $actions = array();\n $actions[\"edit\"] = dispatch_url(\"project.project\",\"edit\",array(\"atkselector\"=>\"[pk]\"));\n $actions[\"planning\"] = dispatch_url(\"project.project\",\"edit\",array(\"atkselector\"=>\"[pk]\",\"atktab\"=>\"planning\"));\n $actions[\"status_update\"] = dispatch_url(\"statusreport.statusreport\",\"add\",array(\"atkfilter\"=>\"statusreport.project_id=[id]\"));\n\n $grid->setDefaultActions($actions);\n $grid->addFilter($selector);\n\n $res = $grid->render();\n }\n $res .=\"<div>\".href(dispatch_url(\"reports.hoursurvey\", \"report\"),atktext(\"menu_hours_hoursurvey\"),SESSION_NESTED).\"</div>\";\n return $res;\n}", "public function list_projects() {\n\t\t\tforeach ($this->projects as $project)\n\t\t\t\techo \"<li><a href=\\\"show_chart.php?group=\" . $this->get_name() . \"&project=\" . $project . \"\\\">\" . $project . \"</a></li>\" . PHP_EOL;\n\t\t}", "public function projects()\n {\n $git = new \\Devtools\\Git();\n $git->user('seagoj');\n $list = $git->listRepos();\n if ($list) {\n print \"</div><div class='well span10'><h3>Current projects</h3>\\n\";\n print \"<ul>\";\n $count = 1;\n foreach ($list AS $repo) {\n $name = $git->get($repo, 'name');\n $url = $git->get($repo, 'svn_url');\n $description = $git->get($repo, 'description');\n if (substr($repo, strpos($repo, '/')+1, 9)=='cookbook-') {\n $link = $url.'/raw/master/recipes/default.rb';\n } else {\n $link = $url.'/raw/master/src/index.php';\n }\n \n // $file_headers = @get_headers($url);\n // if ($file_headers[0] != 'HTTP/1.1 404 Not Found') {\n // print '<div id=\"codesample'.$count.'\">'\n // .'<a class=\"sampleClose\">x</a>'\n // .'<div class=\"title\">Code Sample</div>'\n // .'<pre class=\"prettyprint\">'\n // .'<code class=\"language-php\">'.$code.\"</code></pre></div>\";\n // print \"<div class='project'><a id='sample\".$count++.\"' href='#'>\".strtoupper($name).\"</a>:\\t\".$description.\"</div>\";\n // } else {\n print \"<div class='project'><a id='sample\".$count++.\"' href='\".$url.\"'>\".strtoupper($name).\"</a>:\\t\".$description.\"</div>\";\n // }\n\n \n }\n print \"</ul>\";\n print \"</div>\"; \n }\n }", "protected function displayProjectsList()\n {\n // Set page title in data array\n $this->addData('page_title', _LANG_PROJECTS);\n }", "private function _getProjectList()\n {\n $oHTML = CDependency::getComponentByName('display');\n $oPage = CDependency::getComponentByName('page');\n\n $oPage->addCssFile($this->getResourcePath().'css/project.css');\n $sHTML = $oHTML->getTitleLine('Project list', $this->getResourcePath().'pictures/project_48.png');\n\n $asTabs = array();\n $asTabs[] = array('tabtitle' => 'In Progress','tabOptions'=>array('tabId'=>'','class'=>'tab_display tab_selected','onclick' => '$(\\'#currentPrjId\\').fadeIn();$(\\'.tabs_list >li\\').removeClass(\\'tab_selected\\');$(this).addClass(\\'tab_selected\\'); $(\\'#oldPrjId\\').fadeOut();'),'content' => $this->_getProjectResultList(false),'contentOptions'=>array('contentId'=>'currentPrjId','class'=>'display_tab','style'=>'display:block;'));\n $asTabs[] = array('tabtitle' => 'Job Done','tabOptions'=>array('tabId'=>'','class'=>'tab_display','onclick' => '$(\\'#currentPrjId\\').fadeOut(); $(\\'#oldPrjId\\').fadeIn();$(\\'.tabs_list >li\\').removeClass(\\'tab_selected\\');$(this).addClass(\\'tab_selected\\');'),'content' => $this->_getProjectResultList(true),'contentOptions'=>array('contentId'=>'oldPrjId','class'=>'display_tab hidden','style'=>'display:none;'));\n\n $sHTML.= $oHTML->getBlocStart('', array('class' =>'bottom_container'));\n $sHTML.= $oHTML->getBlocStart('', array('class' => 'tabs_container'));\n $sHTML.= $oHTML->getTabs('', $asTabs);\n\n $sHTML.= $oHTML->getBlocEnd();\n $sHTML.= $oHTML->getBlocEnd();\n $sHTML.= $oHTML->getCarriageReturn(2);\n\n return $sHTML;\n }", "function main_menu($current_project = NULL, $current_phase = NULL, $current_logged_in_user = NULL) {\n\techo <<<_END\n\n <script>\n dojo.addOnLoad(_initMenuLoader);\n function _initMenuLoader() {\n var menuitem = dojo.byId(\"navMenu\");\n menuitem.style.display = \"block\";\n menuitem = dojo.byId(\"projMenu\");\n menuitem.style.display = \"block\";\n }\n </script>\n \n <div dojoType=\"dijit.MenuBar\" id=\"navMenu\" style=\"float:left; display:none\">\n <div dojoType=\"dijit.PopupMenuBarItem\">\n <span>\n Projects\n </span>\n <div dojoType=\"dijit.Menu\" id=\"projectMenu\" style=\"display:none\">\n <div dojoType=\"dijit.MenuItem\" onclick=\"window.location='index.php?object=project&action=show'\">\n Projects\n </div>\n <div dojoType=\"dijit.MenuItem\" onClick=\"window.location='index.php?object=phase&action=show'\">\n Phases\n </div>\n <div dojoType=\"dijit.MenuItem\" onClick=\"window.location='index.php?object=project&action=selectcurrentprojectphase'\">\n Set Current Project/Phase\n </div>\n </div>\n </div>\n <div dojoType=\"dijit.PopupMenuBarItem\">\n <span>\n Scenarios\n </span>\n <div dojoType=\"dijit.Menu\" id=\"scenarioMenu\" style=\"display:none\">\n <div dojoType=\"dijit.MenuItem\" onClick=\"window.location='index.php?object=scenario&action=show'\">\n Scenarios\n </div>\n <div dojoType=\"dijit.MenuItem\" onClick=\"window.location='index.php?object=testcase&action=show'\">\n Testcases\n </div>\n <div dojoType=\"dijit.MenuItem\" onClick=\"window.location='index.php?object=testlevel&action=show'\">\n Testlevels\n </div>\n <div dojoType=\"dijit.MenuItem\" onClick=\"window.location='index.php?object=hostselectortype&action=query'\">\n Host Selector Types\n </div>\n <div dojoType=\"dijit.MenuItem\" onClick=\"window.location='index.php?object=hostselectorvalue&action=show'\">\n Host Selector Values\n </div>\n <div dojoType=\"dijit.MenuItem\" onClick=\"window.location='index.php?object=outcomeaction&action=show'\">\n Outcome Actions\n </div>\n <div dojoType=\"dijit.MenuItem\" onClick=\"window.location='index.php?object=parameter&action=show'\">\n User Defined Parameters\n </div>\n </div>\n </div>\n <div dojoType=\"dijit.PopupMenuBarItem\">\n <span>\n Teststands\n </span>\n <div dojoType=\"dijit.Menu\" id=\"teststandMenu\" style=\"display:none\">\n <div dojoType=\"dijit.MenuItem\" onclick=\"window.location='index.php?object=teststand&action=show'\">\n Teststands\n </div>\n <div dojoType=\"dijit.MenuItem\" onClick=\"window.location='index.php?object=host&action=show'\">\n Hosts\n </div>\n <div dojoType=\"dijit.MenuItem\" onClick=\"window.location='index.php?object=objecttype&action=show'\">\n Object Types\n </div>\n <div dojoType=\"dijit.MenuItem\" onClick=\"window.location='index.php?object=objectattributetype&action=show'\">\n Object Attribute Types\n </div>\n <div dojoType=\"dijit.MenuItem\" onClick=\"window.location='index.php?object=object&action=query'\">\n Query Objects\n </div>\n </div>\n </div>\n <div dojoType=\"dijit.PopupMenuBarItem\">\n <span>\n Collectors\n </span>\n <div dojoType=\"dijit.Menu\" id=\"collectorMenu\" style=\"display:none\">\n <div dojoType=\"dijit.MenuItem\" onclick=\"window.location='index.php?object=collectortype&action=show'\">\n Collector Types\n </div>\n <div dojoType=\"dijit.MenuItem\" onClick=\"window.location='index.php?object=collectorvalue&action=show'\">\n Collector Values\n </div>\n <div dojoType=\"dijit.MenuItem\" onClick=\"window.location='index.php?object=collectorset&action=show'\">\n Collector Sets\n </div>\n <div dojoType=\"dijit.MenuItem\" onClick=\"window.location='index.php?object=collectorsetmember&action=show'\">\n Collector Set Members\n </div>\n </div>\n </div>\n <div dojoType=\"dijit.PopupMenuBarItem\">\n <span>\n Environments\n </span>\n <div dojoType=\"dijit.Menu\" id=\"environmentMenu\" style=\"display:none\">\n <div dojoType=\"dijit.MenuItem\" onclick=\"window.location='index.php?object=environment&action=show'\">\n Environments\n </div>\n </div>\n </div>\n <div dojoType=\"dijit.PopupMenuBarItem\">\n <span>\n Levels\n </span>\n <div dojoType=\"dijit.Menu\" id=\"levelMenu\" style=\"display:none\">\n <div dojoType=\"dijit.MenuItem\" onclick=\"window.location='index.php?object=level&action=show'\">\n Levels\n </div>\n <div dojoType=\"dijit.MenuItem\" onclick=\"window.location='index.php?object=levelinstance&action=show'\">\n Level Instances\n </div>\n </div>\n </div>\n <div dojoType=\"dijit.PopupMenuBarItem\">\n <span>\n Users\n </span>\n <div dojoType=\"dijit.Menu\" id=\"userMenu\" style=\"display:none\">\n <div dojoType=\"dijit.MenuItem\" onclick=\"window.location='index.php?object=user&action=show'\">\n Users\n </div>\n <div dojoType=\"dijit.MenuItem\" onclick=\"window.location='index.php?object=maillist&action=show'\">\n Mail Lists\n </div>\n </div>\n </div>\n <div dojoType=\"dijit.PopupMenuBarItem\">\n <span>\n What is running?\n </span>\n <div dojoType=\"dijit.Menu\" id=\"runningMenu\" style=\"display:none\">\n <div dojoType=\"dijit.MenuItem\" onclick=\"window.location='index.php?object=active_workrequest&action=query'\">\n Active Scenarios\n </div>\n <div dojoType=\"dijit.MenuItem\" onclick=\"window.location='index.php?object=active_workqueue&action=query'\">\n Workqueue items\n </div>\n </div>\n </div>\n <div dojoType=\"dijit.PopupMenuBarItem\">\n <span>\n Results\n </span>\n <div dojoType=\"dijit.Menu\" id=\"resultMenu\" style=\"display:none\">\n <div dojoType=\"dijit.MenuItem\" onclick=\"window.location='index.php?object=scenarioresult&action=show'\">\n Scenario Results\n </div>\n <div dojoType=\"dijit.MenuItem\" onclick=\"window.location='index.php?object=scenarioresult&action=query'\">\n Query Scenario Results\n </div>\n <div dojoType=\"dijit.MenuItem\" onclick=\"window.location='index.php?object=actionresult&action=show'\">\n Testcase Action Results\n </div>\n <div dojoType=\"dijit.MenuItem\" onclick=\"window.location='index.php?object=archive_workrequest&action=show'\">\n Archived Work Requests\n </div>\n <div dojoType=\"dijit.MenuItem\" onclick=\"window.location='index.php?object=archive_workqueue&action=show'\">\n Archived Work Queue\n </div>\n </div>\n </div>\n <div dojoType=\"dijit.PopupMenuBarItem\">\n <span>\n Admin\n </span>\n <div dojoType=\"dijit.Menu\" id=\"adminMenu\" style=\"display:none\">\n <div dojoType=\"dijit.MenuItem\" onclick=\"window.location='index.php?object=backup&action=show'\">\n Backup and Restore\n </div>\n <div dojoType=\"dijit.MenuItem\" onclick=\"window.location='index.php?object=dafserver&action=show'\">\n DAF Server administration\n </div>\n <div dojoType=\"dijit.MenuItem\" onclick=\"window.location='index.php?object=auditlog&action=show'\">\n Show Audit Log\n </div>\n <div dojoType=\"dijit.MenuItem\" onclick=\"window.location='index.php?object=licence&action=show'\">\n Show Licence Information\n </div>\n <div dojoType=\"dijit.MenuItem\" onclick=\"window.location='index.php?object=licence&action=update'\">\n Update Licence Information\n </div>\n </div>\n </div>\n </div>\n\n_END;\n\t\n\techo '<div dojoType=\"dijit.MenuBar\" id=\"projMenu\" style=\"display:none\" dir=\"rtl\">' . \"\\n\";\n\t\n\tif (isset ( $current_logged_in_user )) {\n\t\t\n\t\techo <<<_END\n \n <div dojoType=\"dijit.MenuBarItem\" id=\"LogoutMenu\">\n <div dojoType=\"dijit.MenuItem\" onclick=\"window.location = 'index.php?action=logout'\">\n Logout\n </div>\n </div>\n <div dojoType=\"dijit.MenuBarItem\">|</div>\n\n_END;\n\t}\n\t\n\techo \"<div dojoType=\\\"dijit.MenuBarItem\\\">\\n\";\n\tif (isset ( $current_project ) && isset ( $current_phase )) {\n\t\techo \"<span>Project: $current_project &nbsp; &nbsp; Phase: $current_phase</span>\\n\";\n\t} else {\n\t\t// must have something in the menubar, otherwise it appears as a thinner bar than normal\n\t\techo \"<span>&nbsp;</span>\\n\";\n\t}\n\techo \"</div>\\n\";\n\t\n\techo \"<div dojoType=\\\"dijit.MenuBarItem\\\">|</div>\\n\";\n\t\n\techo \"<div dojoType=\\\"dijit.MenuBarItem\\\">\\n\";\n\tif (isset ( $current_logged_in_user )) {\n\t\techo \"<span>User: $current_logged_in_user &nbsp; &nbsp; &nbsp;</span>\";\n\t}\n\techo \"</div>\\n\";\n\t\n\techo \"</div>\\n\";\n}", "function show_projects()\n{\n $table = get_table();\n foreach ($table as $project)\n {\n print $project . \"\\n\";\n }\n return 0;\n}", "function print_project_user_option_list( $p_project_id = null ) {\n\tprint_user_option_list( 0, $p_project_id );\n}", "public function projectsAction()\n {\n $projectsList = $this->mainModel->getProjectsList();\n\n $this->smarty->assign(\"projectsList\", $projectsList);\n $this->smarty->display(\"contents/projectsListPage.tpl\");\n }", "static function Header_Projects()\n\t\t{\n\t\t\tif(!empty($_COOKIE['mup_user_id'])){\n\t\t\t\t$_[] = '<div class=\"project-context hidden-xs\">';\n\t\t\t\t$_[] = '<span class=\"label\">&nbsp;</span>';\n\t\t\t\t$_[] = '<span id=\"project-selector\" class=\"popover-trigger-element dropdown-toggle\" data-toggle=\"dropdown\">Recent Assignments <i class=\"fa fa-angle-down\"></i></span>';\n\t\t\t\t$_[] = '<ul class=\"dropdown-menu\" style=\"min-width:450px;\">';\n\t\t\t\t$_[] = '<li><a href=\"#\">Oops! No Assignments Found...</a></li>';\n\t\t\t\t$_[] = '<li class=\"divider\"></li>';\n\t\t\t\t$_[] = '<li>';\n\t\t\t\t$_[] = '<div class=\"row\" style=\"padding:0px 25px 4px;\">';\n\t\t\t\t$_[] = '<a class=\"btn btn-xs btn-primary '.self::Cols(8).'\"><i class=\"fa fa-list-alt\"></i> View All</a>';\n\t\t\t\t$_[] = '<a class=\"btn btn-xs btn-success '.self::Cols(4).'\"><i class=\"fa fa-plus-circle\"></i> Add New</a>';\n\t\t\t\t$_[] = '</div>';\n\t\t\t\t$_[] = '</li>';\n\t\t\t\t$_[] = '</ul>';\n\t\t\t\t$_[] = '</div>';\n\t\t\t\t$_ = implode('',$_);\n\t\t\t\treturn $_;\n\t\t\t}\n\t\t\treturn false;\n\t\t}", "public function getProjectSubMenu()\n\t{\n\t\t $project = $this->_request->getParam(\"project\");\n return array(\n array(\n \"title\" => T_(\"Browser\"),\n \"link\"=> \"project/\" . $project . \"/browser/\",\n \"controller\" => \"index\",\n \"action\" => \"\"\n )\n );\n }", "private function showprojects(){\n\t\tglobal $DB, $USER,$OUTPUT, $CFG ;\n\t\trequire_once($CFG->libdir.'/filelib.php');\n\t\t$content = '';\n\t\t$mid = theme_get_roleidbyname('student');\n\t\t\n\t\t$content = $content.'\n\t\t<div class=\"mentorrow clearfix\">\n\t\t\t<div class=\"recomendproj\">\n\t\t\t\t<div class=\"projimage\"><img src=\"'.$OUTPUT->image_url('folder', 'theme').'\"></div>\n\t\t\t\t<div class=\"sugprojecttitle\">Design a Unique Rain Water harvesting System</div>\n\t\t\t</div>\n\t\t\t<div class=\"recomendproj\">\n\t\t\t\t<div class=\"projimage\"><img src=\"'.$OUTPUT->image_url('folder', 'theme').'\"></div>\n\t\t\t\t<div class=\"sugprojecttitle\">Making an Intelligent Robot</div>\n\t\t\t</div>\n\t\t\t<div class=\"watsonlist\">\n\t\t\t\t<div style=\"float:left;\">\n\t\t\t\t<input type=\"text\" name=\"wastsonsearch\" size=\"10\">\n\t\t\t\t</div>\n\t\t\t\t<div style=\"float:left;\"><a href=\"javascript:void(0);\"><img src=\"'.$OUTPUT->image_url('watson', 'theme').'\"></a>\n\t\t\t</div>\n\t\t</div>';\n\t\t\n\t\t//}\n\t\t//}\n\t\treturn $content;\n\t}", "function print_menu() {\n/*\tif( auth_is_user_authenticated() ) {\n\t\t$t_protected = current_user_get_field( 'protected' );\n\t\t$t_current_project = helper_get_current_project();\n\n\t\techo '<table class=\"width100\" cellspacing=\"0\">';\n\t\techo '<tr>';\n\t\techo '<td class=\"menu\">';\n\t\t$t_menu_options = array();\n\n\t\t# Main Page\n\t\t$t_menu_options[] = '<a href=\"' . helper_mantis_url( 'main_page.php' ) . '\">' . lang_get( 'main_link' ) . '</a>';\n\n\t\t# Plugin / Event added options\n\t\t$t_event_menu_options = event_signal( 'EVENT_MENU_MAIN_FRONT' );\n\t\tforeach( $t_event_menu_options as $t_plugin => $t_plugin_menu_options ) {\n\t\t\tforeach( $t_plugin_menu_options as $t_callback => $t_callback_menu_options ) {\n\t\t\t\tif( is_array( $t_callback_menu_options ) ) {\n\t\t\t\t\t$t_menu_options = array_merge( $t_menu_options, $t_callback_menu_options );\n\t\t\t\t} else {\n\t\t\t\t\tif ( !is_null( $t_callback_menu_options ) ) {\n\t\t\t\t\t\t$t_menu_options[] = $t_callback_menu_options;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t# My View\n\t\t$t_menu_options[] = '<a href=\"' . helper_mantis_url( 'my_view_page.php\">' ) . lang_get( 'my_view_link' ) . '</a>';\n\n\t\t# View Bugs\n\t\t$t_menu_options[] = '<a href=\"' . helper_mantis_url( 'view_all_bug_page.php\">' ) . lang_get( 'view_bugs_link' ) . '</a>';\n\n\t\t# Report Bugs\n\t\tif( access_has_project_level( config_get( 'report_bug_threshold' ) ) ) {\n\t\t\t$t_menu_options[] = string_get_bug_report_link();\n\t\t}\n\n\t\t# Changelog Page\n\t\tif( access_has_project_level( config_get( 'view_changelog_threshold' ) ) ) {\n\t\t\t$t_menu_options[] = '<a href=\"' . helper_mantis_url( 'changelog_page.php\">' ) . lang_get( 'changelog_link' ) . '</a>';\n\t\t}\n\n\t\t# Roadmap Page\n\t\tif( access_has_project_level( config_get( 'roadmap_view_threshold' ) ) ) {\n\t\t\t$t_menu_options[] = '<a href=\"' . helper_mantis_url( 'roadmap_page.php\">' ) . lang_get( 'roadmap_link' ) . '</a>';\n\t\t}\n\n\t\t# Summary Page\n\t\tif( access_has_project_level( config_get( 'view_summary_threshold' ) ) ) {\n\t\t\t$t_menu_options[] = '<a href=\"' . helper_mantis_url( 'summary_page.php\">' ) . lang_get( 'summary_link' ) . '</a>';\n\t\t}\n\n\t\t# Project Documentation Page\n\t\tif( ON == config_get( 'enable_project_documentation' ) ) {\n\t\t\t$t_menu_options[] = '<a href=\"' . helper_mantis_url( 'proj_doc_page.php\">' ) . lang_get( 'docs_link' ) . '</a>';\n\t\t}\n\n\t\t# Project Wiki\n\t\tif( config_get_global( 'wiki_enable' ) == ON ) {\n\t\t\t$t_menu_options[] = '<a href=\"' . helper_mantis_url( 'wiki.php?type=project&amp;id=' ) . $t_current_project . '\">' . lang_get( 'wiki' ) . '</a>';\n\t\t}\n\n\t\t# Plugin / Event added options\n\t\t$t_event_menu_options = event_signal( 'EVENT_MENU_MAIN' );\n\t\tforeach( $t_event_menu_options as $t_plugin => $t_plugin_menu_options ) {\n\t\t\tforeach( $t_plugin_menu_options as $t_callback => $t_callback_menu_options ) {\n\t\t\t\tif( is_array( $t_callback_menu_options ) ) {\n\t\t\t\t\t$t_menu_options = array_merge( $t_menu_options, $t_callback_menu_options );\n\t\t\t\t} else {\n\t\t\t\t\tif ( !is_null( $t_callback_menu_options ) ) {\n\t\t\t\t\t\t$t_menu_options[] = $t_callback_menu_options;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t# Manage Users (admins) or Manage Project (managers) or Manage Custom Fields\n\t\tif( access_has_global_level( config_get( 'manage_site_threshold' ) ) ) {\n\t\t\t$t_link = helper_mantis_url( 'manage_overview_page.php' );\n\t\t\t$t_menu_options[] = \"<a href=\\\"$t_link\\\">\" . lang_get( 'manage_link' ) . '</a>';\n\t\t} else {\n\t\t\t$t_show_access = min( config_get( 'manage_user_threshold' ), config_get( 'manage_project_threshold' ), config_get( 'manage_custom_fields_threshold' ) );\n\t\t\tif( access_has_global_level( $t_show_access ) || access_has_any_project( $t_show_access ) ) {\n\t\t\t\t$t_current_project = helper_get_current_project();\n\t\t\t\tif( access_has_global_level( config_get( 'manage_user_threshold' ) ) ) {\n\t\t\t\t\t$t_link = helper_mantis_url( 'manage_user_page.php' );\n\t\t\t\t} else {\n\t\t\t\t\tif( access_has_project_level( config_get( 'manage_project_threshold' ), $t_current_project ) && ( $t_current_project <> ALL_PROJECTS ) ) {\n\t\t\t\t\t\t$t_link = helper_mantis_url( 'manage_proj_edit_page.php?project_id=' ) . $t_current_project;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$t_link = helper_mantis_url( 'manage_proj_page.php' );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$t_menu_options[] = \"<a href=\\\"$t_link\\\">\" . lang_get( 'manage_link' ) . '</a>';\n\t\t\t}\n\t\t}\n\n\t\t# News Page\n\t\tif ( news_is_enabled() && access_has_project_level( config_get( 'manage_news_threshold' ) ) ) {\n\n\t\t\t# Admin can edit news for All Projects (site-wide)\n\t\t\tif( ALL_PROJECTS != helper_get_current_project() || current_user_is_administrator() ) {\n\t\t\t\t$t_menu_options[] = '<a href=\"' . helper_mantis_url( 'news_menu_page.php\">' ) . lang_get( 'edit_news_link' ) . '</a>';\n\t\t\t} else {\n\t\t\t\t$t_menu_options[] = '<a href=\"' . helper_mantis_url( 'login_select_proj_page.php\">' ) . lang_get( 'edit_news_link' ) . '</a>';\n\t\t\t}\n\t\t}\n\n\t\t# Account Page (only show accounts that are NOT protected)\n\t\tif( OFF == $t_protected ) {\n\t\t\t$t_menu_options[] = '<a href=\"' . helper_mantis_url( 'account_page.php\">' ) . lang_get( 'account_link' ) . '</a>';\n\t\t}\n\n\t\t# Add custom options\n\t\t$t_custom_options = prepare_custom_menu_options( 'main_menu_custom_options' );\n\t\t$t_menu_options = array_merge( $t_menu_options, $t_custom_options );\n\n\t\t# Time Tracking / Billing\n\t\tif( config_get( 'time_tracking_enabled' ) && access_has_global_level( config_get( 'time_tracking_reporting_threshold' ) ) ) {\n\t\t\t$t_menu_options[] = '<a href=\"' . helper_mantis_url( 'billing_page.php\">' ) . lang_get( 'time_tracking_billing_link' ) . '</a>';\n\t\t}\n\n\t\t# Logout (no if anonymously logged in)\n\t\tif( !current_user_is_anonymous() ) {\n\t\t\t$t_menu_options[] = '<a href=\"' . helper_mantis_url( 'logout_page.php\">' ) . lang_get( 'logout_link' ) . '</a>';\n\t\t}\n\t\techo implode( $t_menu_options, ' | ' );\n\t\techo '</td>';\n\t\techo '<td class=\"menu right nowrap\">';\n\t\techo '<form method=\"post\" action=\"' . helper_mantis_url( 'jump_to_bug.php\">' );\n\t\t# CSRF protection not required here - form does not result in modifications\n\n\t\tif( ON == config_get( 'use_javascript' ) ) {\n\t\t\t$t_bug_label = lang_get( 'issue_id' );\n\t\t\techo \"<input type=\\\"text\\\" name=\\\"bug_id\\\" size=\\\"10\\\" class=\\\"small\\\" value=\\\"$t_bug_label\\\" onfocus=\\\"if (this.value == '$t_bug_label') this.value = ''\\\" onblur=\\\"if (this.value == '') this.value = '$t_bug_label'\\\" />&#160;\";\n\t\t} else {\n\t\t\techo \"<input type=\\\"text\\\" name=\\\"bug_id\\\" size=\\\"10\\\" class=\\\"small\\\" />&#160;\";\n\t\t}\n\n\t\techo '<input type=\"submit\" class=\"button-small\" value=\"' . lang_get( 'jump' ) . '\" />&#160;';\n\t\techo '</form>';\n\t\techo '</td>';\n\t\techo '</tr>';\n\t\techo '</table>';\n\t}\n*/\n\n}", "public function listAction()\n {\n $this->view->projects = ProjectCatalog::getInstance()->getActives();\n $this->setTitle('List the Project');\n }", "public function active_projects()\n\t{\n\t\t$this->view->projects = $_SESSION['auth_user']->find_assigned_projects();\n\t}", "public function display_project(){\n\t\techo \"<dl>\\n\";\n\t\techo \"<dt>Short name:</dt> <dd>\" . $this->get_short_name() . \"</dd>\\n\";\n\t\techo \"<dt>Full name:</dt> <dd>\" . $this->get_full_name() . \"</dd>\\n\";\n\t\techo \"<dt>Manager:</dt> <dd>\" . $this->get_manager_id() . \"</dd>\\n\";\n\t\techo \"<dt>Start date:</dt> <dd>\" . $this->get_start_date() . \"</dd>\\n\";\n\t\techo \"<dt>End date:</dt> <dd>\" . $this->get_end_date() . \"</dd>\\n\";\n\t\techo \"</dl>\\n\";\n\t}", "function projectactivity_menu2($args) {\n global $_lib;\n\n $query = \"select ProjectActivityID, Description from projectactivity where Active='1' and ProjectID='$args[project_id]' order by ProjectID\";\n $result = $_lib['db']->db_query($query);\n\n if(!$conf['num_letters']) {\n $num_letters = '20';\n } else {\n $num_letters = $conf['num_letters'];\n }; #Default number of letters in menu\n\n\n if($args['pk']) {\n print \"<select name=\\\"$args[table].$args[field].$args[pk]\\\" tabindex=\\\"$args[tabindex]\\\" accesskey=\\\"$args[accesskey]\\\">\\n\";\n } else {\n print \"<select name=\\\"$args[table].$args[field]\\\" tabindex=\\\"$args[tabindex]\\\" accesskey=\\\"$args[accesskey]\\\">\\n\";\n }\n if($conf['value']) {\n print \"<option value=\\\"\\\">\" . substr(\"Finnes ikke: . $conf[value]\",0, $num_letters);\n } else {\n print \"<option value=\\\"\\\">\" . substr('Velg aktivitet',0, $num_letters);\n }\n while($_row = $_lib['db']->db_fetch_object($result)) {\n if($_row->ProjectActivityID == $args[value])\n print \"<option value=\\\"$_row->ProjectActivityID\\\" selected>$_row->ProjectActivityID - \" . substr($_row->Description,0,$num_letters) . \"\\n\";\n else\n print \"<option value=\\\"$_row->ProjectActivityID\\\">$_row->ProjectActivityID - \" . substr($_row->Description,0,$num_letters) . \"\\n\";\n }\n\n print \"</select>\\n\";\n #$_lib['db']->db_free_result($result);\n ?>\n <? }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the max width.
public function getMaxWidth() { return $this->maxWidth; }
[ "public function get_max_width() {\n return $this->max_width;\n }", "public function getMaxWidth()\n {\n return $this->maxWidth;\n }", "public function getMaxWidth()\n {\n return ( !empty( $this->get( 'width' ) ) ) ? (int)$this->get( 'width' ) : self::WIDTH;\n }", "public function getMaxWidth() {}", "public function getMaxWidth();", "public function max_width() {\n return strlen($this->leftText) + $this->widestCell + strlen($this->rightText);\n }", "function AutoCompGetMaxWidth(){}", "protected function width()\n {\n \treturn Arr::get($this->options, 'w');\n }", "public function getMaxWidthForPictures()\n {\n return $this->maxWidthForPictures;\n }", "protected function determineMaximumGalleryWidth() {}", "public function get_resize_width() {\r\n\r\n $width = absint( get_option( 'large_size_w' ) );\r\n if ( ! $width ) {\r\n $width = 1400;\r\n }\r\n\r\n return $width;\r\n\r\n }", "function GetMinWidth(){}", "public function getPageImgMaxWidth() : string\n {\n return $this->json['page']['img_maxwidth'] ?? IMG_MAX_WIDTH;\n }", "public function getWidthLimit()\n {\n }", "protected function width(): float|int\n {\n return max(array_map(function ($item) {\n return $item['width'];\n }, $this->items));\n }", "public function getDefaultWidthMaxTxt(){\n\t\treturn ('width: ' . $this->getDefaultWidthMax() . 'px;');\n\t}", "public function getMaxDimension(): int\n {\n return $this->getHeight() >= $this->getWidth() ? $this->getHeight() : $this->getWidth();\n }", "public function getMinimalWidth();", "function wpg_glossary_get_tooltip_max_width() {\n\t$wpg_glossary_tooltip_max_width = get_option( 'wpg_glossary_tooltip_max_width' );\n\t\n\tif( $wpg_glossary_tooltip_max_width == '' ) {\n\t\t$wpg_glossary_tooltip_max_width = 500;\n\t}\n\t\n\treturn apply_filters( 'wpg_glossary_tooltip_max_width', $wpg_glossary_tooltip_max_width );\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the committer's local epoch
public function GetCommitterLocalEpoch() { $epoch = $this->GetCommitterEpoch(); $tz = $this->GetCommitterTimezone(); if (preg_match('/^([+\-][0-9][0-9])([0-9][0-9])$/', $tz, $regs)) { $local = $epoch + ((((int)$regs[1]) + ($regs[2]/60)) * 3600); return $local; } return $epoch; }
[ "public function GetTaggerLocalEpoch()\n\t{\n\t\t$epoch = $this->GetTaggerEpoch();\n\t\t$tz = $this->GetTaggerTimezone();\n\t\tif (preg_match('/^([+\\-][0-9][0-9])([0-9][0-9])$/', $tz, $regs)) {\n\t\t\t$local = $epoch + ((((int)$regs[1]) + ($regs[2]/60)) * 3600);\n\t\t\treturn $local;\n\t\t}\n\t\treturn $epoch;\n\t}", "private function ReadEpoch()\n\t{\n\t\t$this->epochRead = true;\n\n\t\t$exe = new GitPHP_GitExe($this);\n\n\t\t$args = array();\n\t\t$args[] = '--format=\"%(committer)\"';\n\t\t$args[] = '--sort=-committerdate';\n\t\t$args[] = '--count=1';\n\t\t$args[] = 'refs/heads';\n\n\t\t$epochstr = trim($exe->Execute(GIT_FOR_EACH_REF, $args));\n\n\t\tif (preg_match('/ (\\d+) [-+][01]\\d\\d\\d$/', $epochstr, $regs)) {\n\t\t\t$this->epoch = $regs[1];\n\t\t}\n\n\t\tunset($exe);\n\t}", "public function GetCreationEpoch()\n\t{\n\t\tif (!$this->dataRead)\n\t\t\t$this->ReadData();\n\n\t\tif ($this->LightTag())\n\t\t\treturn $this->GetCommit()->GetCommitterEpoch();\n\t\telse\n\t\t\treturn $this->taggerEpoch;\n\t}", "public function GetEpoch()\n\t{\n\t\tif (!$this->epochRead)\n\t\t\t$this->ReadEpoch();\n\n\t\treturn $this->epoch;\n\t}", "public function getEpochNum()\n {\n return $this->epoch_num;\n }", "public function GetTaggerEpoch()\n\t{\n\t\tif (!$this->dataRead)\n\t\t\t$this->ReadData();\n\n\t\treturn $this->taggerEpoch;\n\t}", "public function getCreatedEpoch()\n {\n $value = $this->get(self::CREATED_EPOCH);\n\n return $value === null ? (int) $value : $value;\n }", "public static function epoch(DateTime $t): string\n {\n return $t->format('U');\n }", "function convertToEpoch($timestamp) {\n list($date, $time) = explode(\"/\", $timestamp);\n list($day, $month, $year) = explode(\".\", $date);\n list($hour, $min) = explode(\":\", $time);\n $t = mktime($hour, $min, 0, $month, $day, $year, -1);\n // +date(\"Z\") is used to realigned UTC time to server timezone\n $t = $t + date(\"Z\");\n return ($t);\n}", "public function GetAge()\n\t{\n\t\tif (!$this->dataRead)\n\t\t\t$this->ReadData();\n\n\t\tif (!empty($this->committerEpoch))\n\t\t\treturn time() - $this->committerEpoch;\n\n\t\treturn '';\n\t}", "public function GetAge()\n\t{\n\t\tif (!$this->dataRead)\n\t\t\t$this->ReadData();\n\n\t\tif (!empty($this->committerEpoch))\n\t\t\treturn time() - $this->committerEpoch;\n\t\t\n\t\treturn '';\n\t}", "public function getGitHubLastCheckedTimestamp(): int\n {\n return (int) $this->get('github_last_checked');\n }", "public function forumCatchupEpoch() {\n if (!isset($this->lastReadForum)) {\n $this->lastReadForum = (int)self::$db->scalar(\"\n SELECT unix_timestamp(last_read) FROM user_read_forum WHERE user_id = ?\n \", $this->id\n );\n }\n return $this->lastReadForum;\n }", "protected static function getEpochDate(): DateTime\n {\n return new DateTime(static::$epochDate, new DateTimeZone('UTC'));\n }", "public function myEpochConverter($epoch){\n /* \n if (ini_get('date.timezone')) {\n echo '<br><br>PHP.ini date.timezone: ' . ini_get('date.timezone');\n }\n if (date_default_timezone_get()) {\n echo \"<br>Current Time Zone: \" . date_default_timezone_get() . '<br />';\n }\n */\n //$epoch time is represented in Milliseconds from Luno API\n //convert to seconds /1000 and discarding the modulo\n $epoch = round($epoch / 1000);\n $dt = new DateTime(\"@$epoch\"); // convert UNIX timestamp to PHP DateTime\n // $dt->setTimestamp($epoch);\n echo \"<br><br>Not adjusted for TimeZone: $epoch\";\n echo \"<br>Using DateTime { $epoch } : \".$dt->format('Y-m-d H:i:s'); // output = 2017-01-01 00:00:00\n \n \n $ts = $epoch+7200; //Adjust for Local Time zone -7200000\n date_default_timezone_set('Africa/Windhoek');\n if (date_default_timezone_get()) {\n echo \"<br><br>Time Zone Adjusted to : \" . date_default_timezone_get();\n }\n $datetime = new DateTime(\"@$ts\");\n echo \"<br>Timestamp adjusted for TimeZone +7200000: $ts\";\n echo \"<br>Timestamp Conversion { $ts } :\".$datetime->format('Y-m-d H:i:s');\n}", "public static function CompareAuthorEpoch($a, $b)\n\t{\n\t\tif ($a->GetAuthorEpoch() === $b->GetAuthorEpoch()) {\n\t\t\treturn 0;\n\t\t}\n\t\treturn ($a->GetAuthorEpoch() < $b->GetAuthorEpoch() ? -1 : 1);\n\t}", "public function getGmLastPlayedStamp()\n {\n return $this->getLastPlayedStamp() + (-1 * ($this->getTimeZoneOffset()));\n }", "public function determineLastBatchId() {\n\n return date('Y-m-d', time());\n\n }", "public function setEpochNum($var)\n {\n GPBUtil::checkUint64($var);\n $this->epoch_num = $var;\n\n return $this;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
generar el primer folio
function primerFolio($claveCliente) { //llamar el metodo de clave cliente $claveCliente = "R1-001"; //anio actual $anioActual = date("Y"); //parte numerica $numero = "000001"; $primerFolio = $claveCliente."/".$numero."/".$anioActual; return $primerFolio; }
[ "function generarFolioPago() {\n include './conexion.php';\n $cons = $this->lastIdVenta(); //consecutivo de venta\n $key = $this->generarCodigo(6); //string de 6 numeros\n $folio = $key . '-' . $cons;\n $sql = \"INSERT INTO venta (folio) VALUES ('\" . strtoupper($folio) . \"')\";\n if ($conn->query($sql) === TRUE) {\n $last_id = $conn->insert_id; // devuelve el id de registro\n return $last_id;\n } else {\n echo \"Error: \" . $sql . \"<br>\" . $conn->error;\n }\n $conn->close();\n }", "public function genero(){\n \n \n \n // se carga la vista genero deseado\n frame($this,'libro/genero_deseado');}", "function generateFolio($number, $number_zeros = 11) {\n\n\t $string_folio = str_pad($number, $number_zeros, '0', STR_PAD_LEFT);\n\t return $string_folio;\n\t }", "public function getGenero_id()\n {\n return $this->genero_id;\n }", "public function getGeneroId()\n\t{\n\t\treturn $this->generoId;\n\t}", "public function generaCodiceSequenza(){\n \n $utente=$this->utente;\n \n if($utente==null OR $utente==0){\n $utente=$_SESSION[\"LOGGEDIN\"][\"userid\"];\n }\n \n $query=$this->db->query(\"SELECT max(codice_seq) as max FROM lm_fatture_generate WHERE utente=? \",array($utente));\n \n $result=$query->result_array();\n if(count($result)>0){\n $result=intval($result[0][\"max\"]);\n $result++;\n }else{\n $result=1;\n }\n \n \n return $result;\n }", "public function buscarUltimo() {\n }", "public static function getUltimaFolha() {\n return new FolhaPagamentoRescisao(FolhaPagamento::getCodigoFolha(FolhaPagamento::TIPO_FOLHA_RESCISAO)); \n }", "function mostraPagina()\n\t\t{\n\t\t$this->aggiungiElemento(\"Modulo allievi\", \"titolo\");\n\t\t$this->aggiungiElemento($this->modulo);\n\t\t$this->mostra();\n\t\t\t\n\t\t}", "final protected function genId(){\n\t\t$this->id = 'bele' . self::$ID_INDEX++;\n\t}", "function ultimoIdInserito()\n\t\t{\n\t\t}", "function crear_xml_factura($gen,$emp,$tip,$num){\n include \"__doc.php\";\n include \"__xml_factura.php\";\n }", "function nombre_pagina($pagina){\r\n\t$base=substr ($pagina, 0,-4); //4=num de caracteres de la extension php(3) + 1\r\n\t//echo \"<b>nombre pagina=$base\\n</b>\";\r\n\treturn $base;\r\n\t}", "function generateFileNamePrefixNumber() {\r\n // Below logic based on file modified date\r\n global $working_dir;\r\n $latest_ctime = 0;\r\n $latest_filename = false; \r\n $d = dir($working_dir);\r\n while(false !== ($entry = $d->read())) {\r\n $filepath = \"{$working_dir}/{$entry}\";\r\n if(is_file($filepath) && filemtime($filepath) > $latest_ctime) {\r\n $latest_ctime = filemtime($filepath);\r\n $latest_filename = $entry;\r\n }\r\n }\r\n if($latest_filename) {\r\n $f_nm_ar = explode(\".\", $latest_filename);\r\n $new_file_num = intval($f_nm_ar[0]) + 1;\r\n if($new_file_num >=0 && $new_file_num <= 9) return \"00$new_file_num.\";\r\n if($new_file_num >=10 && $new_file_num <= 99) return \"0$new_file_num.\";\r\n else return \"$new_file_num.\";\r\n } else {\r\n return \"001.\";\r\n }\r\n }", "function generaCodigotodos() {\n $actor = $this->AutoLoadModel('actor');\n $dataActor = $actor->listaTodosActores();\n $cantidad = count($dataActor);\n $cont = 0;\n $cont2 = 0;\n for ($i = 0; $i < $cantidad; $i++) {\n $idactor = $dataActor[$i]['idactor'];\n $filtro = \"idactor='$idactor'\";\n $data['codigo'] = 'GC' . str_pad($idactor, 5, '0', STR_PAD_LEFT);\n $exito = $actor->ActualizaActor($data, $filtro);\n if ($exito) {\n $cont++;\n } else {\n $cont2++;\n }\n }\n echo 'Cantidad Registros correctos :' . $cont;\n echo 'Cantidad Errores : ' . $cont2;\n }", "public function generateNumeration() {\n $_this_id = \"\" . $this->id;\n $number = date(\"y\") . \"_\";\n \n if(strlen($_this_id)<5) {\n\n for ($x = 0; $x <= (5-strlen($_this_id)); $x++) {\n $number .= \"0\";\n }\n $number .= $this->id;\n }\n $this->number = $number;\n $this->save();\n }", "private function randFiche() {\n $fiche_key = array_rand($this->fichesstack);\n $number = $this->fichesstack[$fiche_key];\n\n unset($this->fichesstack[$fiche_key]);\n\n return $number;\n }", "public function generateInvoiceNumber()\n \t{\n \t\t\t$getNum = purchase_invoice::latest()->first();\n \t\t\tif(!empty($getNum))\n \t\t\t{\n \t\t\t\t$num = $getNum->id+1;\n \t\t\t}\n \t\t\telse\n \t\t\t{\n \t\t\t\t$num = 0+1;\n \t\t\t}\n\t\t\t\t$invoice_num = str_pad($num, 5, '0', STR_PAD_LEFT);\n\t\t\t\treturn date(\"Y-m-\").$invoice_num;\n \t}", "public function generarVotos(){\n\t\t$codvototemp = new CodVoto();\n\t\tif(isset($_GET[\"idPi\"])){\n\t\t\t$idPi = $_GET[\"idPi\"];\n\t\t}\n\t\t$pinchotemp = $this->pincho->showDatesPi($idPi);\n\t\t$numV=$pinchotemp->getNumVotePi();\n\n\t\t$codvototemp->generateMoreCV($idPi, $numV);\n\t\t$numV+=4;\n\t\t$pinchotemp->setNumVotePi($numV);\n\t\t$pinchotemp->upDateVotoPi($idPi);\n\t\techo \"<script> alert('Se han generado 4 codigos mas para este pincho'); </script>\";\n\t\techo \"<script>window.location.replace('index.php?controller=pincho&action=listadoPincho');</script>\";\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Constant for the mailing feature id. This constant is used internally only.
public static final function INTERNAL_MAILING_FEATURE_ID() { if(null === self::$INTERNAL_MAILING_FEATURE_ID) self::$INTERNAL_MAILING_FEATURE_ID = new Inx_Api_TriggerMailing_TriggerMailingAttribute( 2, false ); return self::$INTERNAL_MAILING_FEATURE_ID; }
[ "public function getFeatureId()\n {\n return $this->feature_id;\n }", "public function getFeatureElementId()\n {\n \t$value = false;\n \t$urlPart = strrchr($this->getId(), '/');\n \tif( $urlPart ) {\n \t\t$value = trim( $urlPart, '/');\n \t} \t\n \treturn $value;\n }", "private function defineForumId() {\r\n\t\tif ($this->forumId != - 1)\r\n\t\t\treturn $this->forumId;\r\n\t\t\r\n\t\t$buddypress_id = get_post_meta ( $_REQUEST ['postId'], 'buddypress_id', true );\r\n\t\t$forumList = bbp_get_group_forum_ids ( $buddypress_id );\r\n\t\t$forumId = ! empty ( $forumList ) ? $forumList [0] : null;\r\n\t\t$this->forumId = $forumId;\r\n\t\treturn $forumId;\r\n\t}", "public function getFeatureId(): int\n {\n return $this->feature_id;\n }", "public function getForumID() {\n\n $forum_id = 39;\n\n return $forum_id;\n\n }", "public function getIdFeature()\n\t{\n\t\treturn $this->id_feature;\n\t}", "public function getIdFeature()\n {\n return $this->id_feature;\n }", "public static final function FILTER_ID()\r\n\t{\r\n\t\tif(null === self::$FILTER_ID)\r\n\t\t\tself::$FILTER_ID = new Inx_Api_TriggerMailing_TriggerMailingAttribute( 9, false );\r\n\t\t\r\n\t\treturn self::$FILTER_ID;\r\n\t}", "public function getMailingId();", "public function get_simplefeature_id() {\n return $this->simplefeature_id;\n }", "public static function getDummyId(): string {\n return 'wcmf'.str_replace('-', '', StringUtil::guidv4());\n }", "public function getFeatureAmenityId() {\n\t\treturn ($this->featureAmenityId);\n\t}", "public function getFlaggableId();", "public function getFeatureGroupId(): ?string\n {\n return $this->featureGroupId;\n }", "public function getOpFreqStatMailId()\n {\n\n return $this->op_freq_stat_mail_id;\n }", "public function getFlagId() {\n if (!$this->flagId) {\n $flag = flag_get_flag('c4m_og_content_recommend');\n\n if ($flag) {\n $this->flagId = $flag->fid;\n }\n }\n\n return $this->flagId;\n }", "function getID() {\n\t\treturn $this->data_array['group_forum_id'];\n\t}", "public function getForumId();", "public function getForumId()\n {\n return $this->forum_id;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get fake instance of SupOrderPosition
public function fakeSupOrderPosition($supOrderPositionFields = []) { return new SupOrderPosition($this->fakeSupOrderPositionData($supOrderPositionFields)); }
[ "public function getPosition()\n\t{\n\t\t$ci =& get_instance();\n\t\t$ci->load->library('position');\t\t\n\t\t\t\t\t\t\n\t\t$position = new Position($this->position_id);\n\n\t\treturn $position;\n\t}", "private function getPositionInstance()\n {\n return $this->position;\n }", "public function testGetposition()\n {\n // get testData\n $ipClass = new IpHandler();\n $ipNumber = $ipClass->getUserIp();\n \n $geo = new IpPosition();\n $res = $geo->getPosition($ipNumber);\n $this->assertNotNull($res);\n }", "function GetSashPosition(){}", "public function testConstructSetPosition()\n {\n // Do not set position explicitly\n $slip = new TestablePaymentSlip($this->slipData);\n $this->assertEquals(0, $slip->getSlipPosX());\n $this->assertEquals(191, $slip->getSlipPosY());\n\n // Set X and Y position\n $slip = new TestablePaymentSlip($this->slipData, 100, 200);\n $this->assertEquals(100, $slip->getSlipPosX());\n $this->assertEquals(200, $slip->getSlipPosY());\n\n // Set X position only\n $slip = new TestablePaymentSlip($this->slipData, 50);\n $this->assertEquals(50, $slip->getSlipPosX());\n $this->assertEquals(191, $slip->getSlipPosY());\n\n // Set X position only\n $slip = new TestablePaymentSlip($this->slipData, null, 150);\n $this->assertEquals(0, $slip->getSlipPosX());\n $this->assertEquals(150, $slip->getSlipPosY());\n }", "public function fakeCollectiveinvoiceOrderposition($collectiveinvoiceOrderpositionFields = [])\n {\n return new CollectiveinvoiceOrderposition($this->fakeCollectiveinvoiceOrderpositionData($collectiveinvoiceOrderpositionFields));\n }", "protected function generateLocationFix(Position $position) : Signature\\LocationFix\n {\n $location = $position->createRandomized();\n\n $locationFix = new Signature\\LocationFix();\n $locationFix->setProvider(\"network\");\n $locationFix->setProviderStatus(3);\n $locationFix->setLocationType(1);\n $locationFix->setTimestampSnapshot(rand(10000,35000));\n $locationFix->setAltitude($location->getAltitude());\n $locationFix->setLongitude($location->getLongitude());\n $locationFix->setLatitude($location->getAltitude());\n\n return $locationFix;\n }", "public function fakeSupOrderPositionData($supOrderPositionFields = [])\n {\n $fake = Faker::create();\n\n return array_merge([\n 'suporder' => $fake->randomDigitNotNull,\n 'article' => $fake->randomDigitNotNull,\n 'amount' => $fake->randomDigitNotNull,\n 'colinvoice' => $fake->randomDigitNotNull\n ], $supOrderPositionFields);\n }", "public function Get_Services_Position();", "public function getSPosition()\n\t{\n\t\treturn $this->s_position;\n\t}", "public function testPosition()\n {\n $coordinateTest = new Coordinate(1.1, 1.1, true);\n self::$object->setPosition($coordinateTest);\n $this->assertEquals(self::$object->getPosition()->getLatitude(), 1.1);\n $this->assertEquals(self::$object->getPosition()->getLongitude(), 1.1);\n $this->assertTrue(self::$object->getPosition()->isNoWrap());\n\n self::$object->setPosition(2.1, 2.1, false);\n $this->assertEquals(self::$object->getPosition()->getLatitude(), 2.1);\n $this->assertEquals(self::$object->getPosition()->getLongitude(), 2.1);\n $this->assertFalse(self::$object->getPosition()->isNoWrap());\n\n self::$object->setPosition(null);\n $this->assertNull(self::$object->getPosition());\n\n $this->setExpectedException('InvalidArgumentException');\n self::$object->setPosition('foo');\n }", "public function testReturnUpsLocatorInstance()\n {\n $loggerMock = $this->getMock('Psr\\Log\\LoggerInterface');\n $upsLocatorInstance = LocatorFactory::create(\n 'accessKey',\n 'userId',\n 'password',\n $loggerMock\n );\n $this->assertInstanceOf('Octante\\UpsAPIBundle\\Library\\LocatorWrapper', $upsLocatorInstance);\n }", "public function getShiporder()\n {\n return $this->shiporder;\n }", "public function getPos()\n {\n return $this->Pos;\n }", "public function getPosition();", "public function getPos()\n {\n return $this->pos;\n }", "function getPosition() {\n\t\treturn $this->_Position;\n\t}", "protected function getPosition($data): Position\n {\n $position = GeneralUtility::makeInstance(Position::class);\n $position->setFormattedAddress($data['formatted_address']);\n\n try {\n $position->setLatitude((float)ArrayUtility::getValueByPath($data, 'geometry/location/lat'));\n $position->setLongitude((float)ArrayUtility::getValueByPath($data, 'geometry/location/lng'));\n } catch (\\RuntimeException $exception) {\n // Path of ArrayUtility does not exist\n $position->setLatitude(0.0);\n $position->setLongitude(0.0);\n }\n\n return $position;\n }", "function getPositionDetails($baseData = NULL) {\n\n\t\t$positionId = $this->getId();\n\n\t\tif (!$positionId) {\n\t\t\tthrow new Exception('getPositionDetails called without a set cart position id.');\n\t\t}\n\n\t\tif ($baseData == NULL) {\n\t\t\t$position = $this->getPosition($positionId);\n\t\t}\n\t\telse {\n\t\t\t$position = $baseData;\n\t\t}\n\t\t/** @var ConfigboxCartPositionData $position */\n\n\t\tif (!$position) {\n\t\t\tKLog::log('getPositionDetails called. Could not load base position data', 'warning');\n\t\t\treturn NULL;\n\t\t}\n\n\t\tif (empty($position->quantity)) {\n\t\t\t$position->quantity = 1;\n\t\t}\n\n\t\t$productModel = KenedoModel::getModel('ConfigboxModelProduct');\n\n\t\t// Get the product data\n\t\t$position->productData = $productModel->getProduct($position->prod_id);\n\n\t\t// Store if the product is configurable\n\t\t$position->isConfigurable = ($position->productData->isConfigurable != 0);\n\n\t\t// Set the order's product title (see later for product title override)\n\t\t$position->productTitle = $position->productData->title;\n\n\t\t// Product base prices\n\t\t$position->baseProductBasePriceNet\t\t= $position->productData->basePriceNet;\n\t\t$position->baseProductBasePriceTax\t\t= $position->productData->basePriceTax;\n\t\t$position->baseProductBasePriceGross\t= $position->baseProductBasePriceNet + $position->baseProductBasePriceTax;\n\n\t\t// Same for recurring\n\t\t$position->baseProductBasePriceRecurringNet \t= $position->productData->basePriceRecurringNet;\n\t\t$position->baseProductBasePriceRecurringTax \t= $position->productData->basePriceRecurringTax;\n\t\t$position->baseProductBasePriceRecurringGross \t= $position->baseProductBasePriceRecurringNet + $position->baseProductBasePriceRecurringTax;\n\n\t\t// Init the order totals - Not to be confused with the baseProductBasePrice, which is just the product base price and not any total\n\t\t$position->baseTotalUnreducedNet \t= $position->productData->basePriceNet;\n\t\t$position->baseTotalUnreducedTax \t= $position->productData->basePriceTax;\n\t\t$position->baseTotalUnreducedGross \t= $position->baseTotalUnreducedNet + $position->baseTotalUnreducedTax;\n\n\t\t// Same for recurring\n\t\t$position->baseTotalUnreducedRecurringNet \t= $position->productData->basePriceRecurringNet;\n\t\t$position->baseTotalUnreducedRecurringTax \t= $position->productData->basePriceRecurringTax;\n\t\t$position->baseTotalUnreducedRecurringGross = $position->baseTotalUnreducedRecurringNet + $position->baseTotalUnreducedRecurringTax;\n\n\t\t// Init order weight\n\t\t$position->weight = $position->productData->baseweight;\n\n\n\t\t$configuration = ConfigboxConfiguration::getInstance($position->id);\n\t\t$selectedQuestionIds = $configuration->getQuestionIdsWithSelection(false);\n\n\t\t// Sort the questions per page and question\n\t\t$selectedQuestionIds = $this->getQuestionIdsSorted($selectedQuestionIds, $position->productData->id);\n\n\n\t\t$position->selections = array();\n\n\t\tforeach ($selectedQuestionIds as $questionId) {\n\n\t\t\t/**\n\t\t\t * @var ConfigboxCartPositionSelectionsData $selection\n\t\t\t */\n\t\t\t$selection = new stdClass;\n\n\t\t\t$question = ConfigboxQuestion::getQuestion($questionId);\n\n\t\t\t// Base data\n\t\t\t$selection->type = $question->getType();\n\t\t\t$selection->questionId = $questionId;\n\t\t\t$selection->questionTitle = $question->title;\n\t\t\t$selection->selection = $configuration->getSelection($questionId);\n\n\t\t\t// Workaround for any no-longer-selected checkbox questions that are still selected with '' value\n\t\t\tif ($selection->type == 'checkbox' && $selection->selection == '') {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$selection->outputValue = $question->getOutputValue($configuration->getSelection($questionId));\n\t\t\t$selection->showInOverviews = ($question->show_in_overview != 0);\n\n\t\t\t// Selection pricing\n\t\t\t$selection->basePriceNet \t= $question->getPrice(true, true);\n\t\t\t$selection->basePriceGross \t= $question->getPrice(false, true);\n\t\t\t$selection->basePriceTax \t= $selection->basePriceGross - $selection->basePriceNet;\n\n\t\t\t// Selection recurring pricing\n\t\t\t$selection->basePriceRecurringGross \t= $question->getPriceRecurring(false, true);\n\t\t\t$selection->basePriceRecurringNet \t\t= $question->getPriceRecurring(true, true);\n\t\t\t$selection->basePriceRecurringTax \t\t= $selection->basePriceRecurringGross - $selection->basePriceRecurringNet;\n\n\t\t\t// Add static price overrides\n\t\t\t$selection->priceOverrides = '[]';\n\t\t\t$selection->priceRecurringOverrides = '[]';\n\t\t\tif (count($question->answers) && isset($question->answers[$selection->selection])) {\n\t\t\t\t$selection->priceOverrides = $question->answers[$selection->selection]->price_overrides;\n\t\t\t\t$selection->priceRecurringOverrides = $question->answers[$selection->selection]->price_recurring_overrides;\n\t\t\t}\n\n\t\t\t// Add price calculation overrides\n\t\t\t$selection->priceCalculationOverrides = '[]';\n\t\t\t$selection->priceRecurringCalculationOverrides = '[]';\n\t\t\tif (count($question->answers) && isset($question->answers[$selection->selection])) {\n\t\t\t\t$selection->priceCalculationOverrides = $question->answers[$selection->selection]->price_calculation_overrides;\n\t\t\t\t$selection->priceRecurringCalculationOverrides = $question->answers[$selection->selection]->price_recurring_calculation_overrides;\n\t\t\t}\n\n\t\t\t// Selection weight\n\t\t\t$selection->weight = $question->getWeight();\n\n\t\t\t// Append currency prices\n\t\t\tConfigboxCurrencyHelper::appendCurrencyPrices($selection);\n\n\t\t\t// Add the selection to the position's selections\n\t\t\t$position->selections[] = $selection;\n\n\t\t}\n\n\t\t// Add selection's price and weight to the cart position\n\t\tforeach ($position->selections as $selection) {\n\n\t\t\t// Increment the position totals\n\t\t\t$position->baseTotalUnreducedNet \t\t\t+= round($selection->basePriceNet, 4);\n\t\t\t$position->baseTotalUnreducedRecurringNet \t+= round($selection->basePriceRecurringNet, 4);\n\n\t\t\t// Increment the weight\n\t\t\t$position->weight += $selection->weight;\n\n\t\t}\n\n\t\t// Deal with position product title overrides\n\t\tforeach ($position->selections as $selection) {\n\n\t\t\t$question = ConfigboxQuestion::getQuestion($selection->questionId);\n\n\t\t\t// Set the position's product title if the question setting is there\n\t\t\tif (!empty($question->asproducttitle) && $question->getOutputValue($selection->selection)) {\n\t\t\t\t$position->productTitle = $question->getOutputValue($selection->selection);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// Multiply position prices with quantity now\n\t\t$position->baseTotalUnreducedNet = $position->baseTotalUnreducedNet * $position->quantity;\n\t\t$position->baseTotalUnreducedRecurringNet = $position->baseTotalUnreducedRecurringNet * $position->quantity;\n\n\t\t$position->baseTotalUnreducedGross = ConfigboxPrices::getPositionPriceGross($position->baseTotalUnreducedNet, $position->productData->id, true);\n\t\t$position->baseTotalUnreducedTax = $position->baseTotalUnreducedGross - $position->baseTotalUnreducedNet;\n\n\t\t$position->baseTotalUnreducedRecurringGross = ConfigboxPrices::getPositionPriceRecurringGross($position->baseTotalUnreducedRecurringNet, $position->productData->id, true);\n\t\t$position->baseTotalUnreducedRecurringTax = $position->baseTotalUnreducedRecurringGross - $position->baseTotalUnreducedRecurringNet;\n\n\t\t// Indicate if position got recurring pricing\n\t\t$position->usesRecurring = ($position->baseTotalUnreducedRecurringNet != 0);\n\n\t\t// Append the currency prices\n\t\tConfigboxCurrencyHelper::appendCurrencyPrices($position);\n\n\t\tif (function_exists('postGetPositionDetails')) {\n\t\t\tpostGetPositionDetails($position);\n\t\t}\n\n\t\treturn $position;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Filter the query on the date_add column Example usage: $query>filterByDateAdd('20110314'); // WHERE date_add = '20110314' $query>filterByDateAdd('now'); // WHERE date_add = '20110314' $query>filterByDateAdd(array('max' => 'yesterday')); // WHERE date_add > '20110313'
public function filterByDateAdd($dateAdd = null, $comparison = null) { if (is_array($dateAdd)) { $useMinMax = false; if (isset($dateAdd['min'])) { $this->addUsingAlias(Oops_Db_ReferrerPeer::DATE_ADD, $dateAdd['min'], Criteria::GREATER_EQUAL); $useMinMax = true; } if (isset($dateAdd['max'])) { $this->addUsingAlias(Oops_Db_ReferrerPeer::DATE_ADD, $dateAdd['max'], Criteria::LESS_EQUAL); $useMinMax = true; } if ($useMinMax) { return $this; } if (null === $comparison) { $comparison = Criteria::IN; } } return $this->addUsingAlias(Oops_Db_ReferrerPeer::DATE_ADD, $dateAdd, $comparison); }
[ "public function filterByDateAdd($dateAdd = null, $comparison = null)\n\t{\n\t\tif (is_array($dateAdd)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($dateAdd['min'])) {\n\t\t\t\t$this->addUsingAlias(Oops_Db_StorePeer::DATE_ADD, $dateAdd['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($dateAdd['max'])) {\n\t\t\t\t$this->addUsingAlias(Oops_Db_StorePeer::DATE_ADD, $dateAdd['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(Oops_Db_StorePeer::DATE_ADD, $dateAdd, $comparison);\n\t}", "public function filterByDateAdd($dateAdd = null, $comparison = null)\n\t{\n\t\tif (is_array($dateAdd)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($dateAdd['min'])) {\n\t\t\t\t$this->addUsingAlias(Oops_Db_CustomerPeer::DATE_ADD, $dateAdd['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($dateAdd['max'])) {\n\t\t\t\t$this->addUsingAlias(Oops_Db_CustomerPeer::DATE_ADD, $dateAdd['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(Oops_Db_CustomerPeer::DATE_ADD, $dateAdd, $comparison);\n\t}", "public function filterByDateAdd($dateAdd = null, $comparison = null)\n\t{\n\t\tif (is_array($dateAdd)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($dateAdd['min'])) {\n\t\t\t\t$this->addUsingAlias(Oops_Db_ConnectionsSourcePeer::DATE_ADD, $dateAdd['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($dateAdd['max'])) {\n\t\t\t\t$this->addUsingAlias(Oops_Db_ConnectionsSourcePeer::DATE_ADD, $dateAdd['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(Oops_Db_ConnectionsSourcePeer::DATE_ADD, $dateAdd, $comparison);\n\t}", "public function filterByDateAdd($dateAdd = null, $comparison = null)\n\t{\n\t\tif (is_array($dateAdd)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($dateAdd['min'])) {\n\t\t\t\t$this->addUsingAlias(Oops_Db_CmsCategoryPeer::DATE_ADD, $dateAdd['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($dateAdd['max'])) {\n\t\t\t\t$this->addUsingAlias(Oops_Db_CmsCategoryPeer::DATE_ADD, $dateAdd['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(Oops_Db_CmsCategoryPeer::DATE_ADD, $dateAdd, $comparison);\n\t}", "private function setQueryDateFilter($addEndDate = true) {\n\t\tlist($day, $month, $year) = explode('/', $this->conf['filter.']['startDate']);\n\t\t$startDate = mktime(0,0,0,$month,$day,$year);\n\t\t$StartDateFilter = t3lib_div::makeInstance('tx_icssitlorquery_StartDateFilter', $startDate);\n\t\t$this->queryService->addFilter($StartDateFilter);\n\t\tif ($addEndDate && $this->conf['filter.']['endDate']) {\n\t\t\tlist($day, $month, $year) = explode('/', $this->conf['filter.']['endDate']);\n\t\t\t$endDate = mktime(23,59,59,$month,$day,$year);\n\t\t\t$EndDateFilter = t3lib_div::makeInstance('tx_icssitlorquery_EndDateFilter', $endDate);\n\t\t\t$this->queryService->addFilter($EndDateFilter);\n\t\t}\n\t\t$noDateFilter = t3lib_div::makeInstance('tx_icssitlorquery_NoDateFilter', true);\n\t\t$this->queryService->addFilter($noDateFilter);\n\t}", "public function filterByDateAdd($dateAdd = null, $comparison = null)\n\t{\n\t\tif (is_array($dateAdd)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($dateAdd['min'])) {\n\t\t\t\t$this->addUsingAlias(Oops_Db_GroupPeer::DATE_ADD, $dateAdd['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($dateAdd['max'])) {\n\t\t\t\t$this->addUsingAlias(Oops_Db_GroupPeer::DATE_ADD, $dateAdd['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(Oops_Db_GroupPeer::DATE_ADD, $dateAdd, $comparison);\n\t}", "public function filterByAddDate($addDate = null, $comparison = null)\n {\n if (is_array($addDate)) {\n $useMinMax = false;\n if (isset($addDate['min'])) {\n $this->addUsingAlias(FinCreditCardTableMap::COL_ADD_DATE, $addDate['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($addDate['max'])) {\n $this->addUsingAlias(FinCreditCardTableMap::COL_ADD_DATE, $addDate['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(FinCreditCardTableMap::COL_ADD_DATE, $addDate, $comparison);\n }", "public function addDateFilter()\n\t{\n\t\t$this->_addFilter(new DataGrid\\Filters\\DateFilter());\n\t\treturn $this->getFilter();\n\t}", "public function setDateAdd($date_add)\n {\n $this->date_add = $date_add;\n }", "public function setDateAdd($date_add)\n {\n $this->date_add = $date_add;\n\n return $this;\n }", "protected function addIncrementalFilter($collection, $incrementalDate=Null)\n {\n if (strtotime($incrementalDate)) { // if a valid date string\n // convert given date into GMT (Magento) time\n $dateStart = date(\"Y-m-d H:i:s\", Mage::getModel('core/date')->timestamp(strtotime($incrementalDate . \"00:00:00\")));\n $dateEnd = date(\"Y-m-d H:i:s\", Mage::getModel('core/date')->timestamp(strtotime($incrementalDate . \"23:59:59\")));\n\n $collection->getSelect()\n ->where(\"date(main_table.created_at) between '\" . $dateStart . \"' AND '\" . $dateEnd . \"'\");\n }\n return $collection;\n }", "public function setAddDate($add_date)\n\t{\n\t\t$this->add_date = $add_date;\n\t\treturn $this;\n\t}", "public function setDateAdd($dateAdd, $forceAcceptNull = false) {\n\t\t$this->setColumn('date_add', $dateAdd, $forceAcceptNull);\n\t\treturn $this;\n\t}", "protected function addIncrementalFilter($collection, $incrementalDate = NULL)\n {\n Mage::helper('mybuys')->log('Adding incremental filters to product feed', Zend_Log::INFO, Mybuys_Connector_Helper_Data::LOG_FILE);\n // daily feeds do not include out of stock items Filter on in_stock\n $collection->\n addAttributeToFilter('is_in_stock', 1);\n\n // No incremental date filtering of this feed\n return $collection;\n }", "public function filterByDateAdded($date, $comparison = '=')\n {\n $this->query->andWhere($this->query->expr()->comparison(\n 'u.uDateAdded',\n $comparison,\n $this->query->createNamedParameter($date)\n ));\n }", "protected function addIncrementalFilter($collection, $incrementalDate=null)\n\t{\n\t\t// No incremental date filtering of this feed\n\t\treturn $collection;\n\t}", "protected function addIncrementalFilter($collection, $incrementalDate=null)\n\t{\n\t\t// Don't do any date filtering on this data, its not easy to detect which parts have changed\n\t\treturn $collection;\n\t}", "function getDateFilter()\n {\n $qstartdate = makeStartDate($this->weekno_, $this->yearno_, $this->monthno_, $this->\n startweekno_, $this->startDate_);\n $qenddate = makeEndDate($this->weekno_, $this->yearno_, $this->monthno_, $this->\n endDate_);\n //var_dump($qstartdate);\n //var_dump($qenddate);\n if ($qstartdate)\n $sql .= \" kll.kll_timestamp >= '\" . gmdate('Y-m-d H:i', $qstartdate) . \"' \";\n if ($qstartdate && $qenddate)\n $sql .= \" AND \";\n if ($qenddate)\n $sql .= \" kll.kll_timestamp <= '\" . gmdate('Y-m-d H:i', $qenddate) . \"' \";\n return $sql;\n }", "public function filterByAddTime($value, $operator = Rule::OP_EQ)\n\t{\n\t\treturn $this->filterBy('add_time', $value, $operator);\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the value of duree
public function getDuree() { return $this->duree; }
[ "public function getValue();", "public function getDuree():int\n {\n return $this->duree;\n }", "public function get_value() {\n return $this->value;\n }", "public function getValue(){\n\t\tif(!($value = $this->getData('value'))){\n\t\t\treturn $this->getDefaultValue();\n\t\t}\n\t\treturn $value;\n\t}", "function getDie2Value(){\n\t\t\treturn $this->die2->getValue();\n\t\t}", "public function getValue()\n {\n \treturn $this->applyFilters( $this->_value );\n }", "public function getVal()\n {\n return $this->val;\n }", "public function getDureeReelle()\n {\n return $this->_dureeReelle;\n }", "public function get_value()\r\n\t{\r\n\t\treturn $this->get_attr('value');\r\n\t}", "public function getValue()\n\t{\n\t\treturn $this->amount * $this->unit->getUnit();\n\t}", "public function getValue(): mixed;", "public function getValue()\n\t\t{\n\t\t\treturn $this->trade_value;\n\t\t}", "public function getresistanceValue()\n {\n return $this->value;\n }", "public function getValor()\n {\n return $this->valor;\n }", "function getValor()\n {\n return $this->valor;\n }", "public function getValue()\n {\n return $this->price;\n }", "public function getValor()\n {\n return $this->valor;\n }", "public function getValue ()\n\t{\n\t\treturn $this->output;\n\t}", "protected function _value()\n {\n return $this->_getIteration()->getValue();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
check if quiz is ready to be published
function checkPublish(){ require('variables.php'); // check the number of results $numResults = $this->getResults("count"); // check the number of questions $numQuestions = $this->getQuestions("count"); // check the number of options $listQuestion = explode(',', $this->getQuestions()); if($numQuestions != 0){ $questionState = true; $optionState = true; foreach($listQuestion as $question){ // check the number of options for this question $numOptions = $this->getOptions($question, "count"); if($numOptions < $VAR_QUIZ_MIN_OPTIONS){ $optionState = false; } } }else{ $questionState = false; $optionState = false; } // run through the checks, return false if failed if($numResults < $VAR_QUIZ_MIN_RESULT || $numQuestions < $VAR_QUIZ_MIN_QUESTIONS || !$optionState){ return false; }else{ return true; } }
[ "public function publish() {\n $user = Auth::user();\n // set an answer as publish status\n // check if answer belongs to the current user\n if ($user->id != $this->owner->id || $this->status != 2) {\n // only draft status answer can be pulished\n return false;\n }\n\n // change question status\n $this->status = 1;\n // update time\n $this->created_at = Carbon::now();\n $this->save();\n\n return true;\n }", "public function hasBeenPublished();", "function checkPublishMulti(){\n\t\trequire('variables.php');\t\t\n\t\t// check the number of results\n\t\t$numResults = $this->getResultsMulti(\"count\");\n\t\t// check the number of questions\n\t\t$numQuestions = $this->getQuestions(\"count\");\n\t\t// check the number of options\n\t\t$listQuestion = explode(',', $this->getQuestions());\n\t\t\n\t\tif($numQuestions != 0){\n\t\t\t$questionState = true;\n\t\t\t$optionState = true;\n\t\t\tforeach($listQuestion as $question){\n\t\t\t\t// check the number of options for this question\n\t\t\t\t$numOptions = $this->getOptionsMulti($question, \"count\");\n\t\t\t\tif($numOptions < $VAR_QUIZ_MIN_OPTIONS){\n\t\t\t\t\t$optionState = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}else{\n\t\t\t$questionState = false;\n\t\t\t$optionState = false;\n\t\t}\n\t\t//run through the checks, return false if failed\n\t\tif($numResults < $VAR_QUIZ_MIN_RESULT || $numQuestions < $VAR_QUIZ_MIN_QUESTIONS || !$optionState){\n\t\t\treturn false;\n\t\t}else{\n\t\t\treturn true;\n\t\t}\n\t}", "public function isPublished() {}", "public function isPublished() {\n\n\t\t// get dates\n\t\t$now = $this->app->date->create()->toSQL();\n\t\t$null = $this->app->database->getNullDate();\n\n\t\treturn $this->state == 1\n\t\t\t\t&& ($this->publish_up == $null || $this->publish_up <= $now)\n\t\t\t\t&& ($this->publish_down == $null || $this->publish_down >= $now);\n\t}", "public function hasPendingQuiz()\n {\n return $this->getLatestQuiz() && $this->getLatestQuiz()->completed_at === null;\n }", "public function member_can_publish_a_question()\n {\n $this->signIn();\n\n $question = create(Question::class, ['user_id' => auth()->id()]);\n\n $this->assertCount(0, Question::published()->get());\n\n $this->postJson(route('published-questions.store', ['question' => $question]));\n\n $this->assertCount(1, Question::published()->get());\n }", "public function isReady()\n {\n if($this->ready == 'yes' || $this->ready === true){\n return true;\n }else{\n return false;\n }\n }", "public function isPublishable(){\n return ( ! $this->isDeleted()) && $this->isContentReady();\n }", "public function hasQuestions();", "public function isPublished()\n\t{\n\t\treturn $this->getPostStatus() == 'publish';\n\t}", "public function isPublished()\n {\n return (null !== $this->publishDate);\n }", "public function isPublished(): bool\n {\n return $this->status() === self::PAGE_STATUS_PUBLISHED;\n }", "public function IsReady ()\r\n\t{\r\n\t\treturn (count ($this->langBase) > 0);\r\n\t}", "function LPH_IsPublishing(){\n\t\treturn LivePubHelper::is_publishing();\n\t}", "public function started()\n\t{\n\t\t// If it doesn't exist or isn't published\n\t\tif ($this->isNew())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tif ($this->get('publish_up')\n\t\t && $this->get('publish_up') != '0000-00-00 00:00:00'\n\t\t && $this->get('publish_up') > Date::toSql())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "static function hasAnAnswerPage ()\n {\n return true;\n }", "public function isPublishedFuture()\n\t{\n\t\treturn $this->published && !is_null($this->published_at) && strtotime($this->published_at) > time();\n\t}", "public function getIsReadyToGo();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Deletes the specified BackendService resource. (backendServices.delete)
public function delete($project, $backendService, $optParams = array()) { $params = array('project' => $project, 'backendService' => $backendService); $params = array_merge($params, $optParams); return $this->call('delete', array($params), "Appointments_Google_Service_Compute_Operation"); }
[ "public function deleteBackendService($backendServiceName) {\n\n $notReady = true;\n while ($notReady) {\n try {\n $this->computeService->backendServices->delete($this->projectId, $backendServiceName);\n $notReady = false;\n } catch (\\Google_Service_Exception $e) {\n $reason = $e->getErrors()[0][\"reason\"] ?? null;\n if ($reason != \"resourceInUseByAnotherResource\") {\n throw ($e);\n }\n sleep(1);\n\n }\n }\n\n }", "public function deleteService($id);", "public function delete($project, $backendService, $optParams = array())\n {\n $params = array('project' => $project, 'backendService' => $backendService);\n $params = array_merge($params, $optParams);\n return $this->call('delete', array($params), \"Forminator_Google_Service_Compute_Operation\");\n }", "protected function serviceDelete()\n {\n $delete = Str::studly(class_basename($this->argument('name')));\n\n $this->callSilent('service:delete', [\n 'name' => \"{$delete}Delete\",\n ]);\n }", "public function deleting(Service $Service)\n {\n //code...\n }", "public function deleteBackendRequest($options)\n {\n // unbox the parameters from the associative array\n $service_id = array_key_exists('service_id', $options) ? $options['service_id'] : null;\n $version_id = array_key_exists('version_id', $options) ? $options['version_id'] : null;\n $backend_name = array_key_exists('backend_name', $options) ? $options['backend_name'] : null;\n\n // verify the required parameter 'service_id' is set\n if ($service_id === null || (is_array($service_id) && count($service_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $service_id when calling deleteBackend'\n );\n }\n // verify the required parameter 'version_id' is set\n if ($version_id === null || (is_array($version_id) && count($version_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $version_id when calling deleteBackend'\n );\n }\n // verify the required parameter 'backend_name' is set\n if ($backend_name === null || (is_array($backend_name) && count($backend_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $backend_name when calling deleteBackend'\n );\n }\n\n $resourcePath = '/service/{service_id}/version/{version_id}/backend/{backend_name}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($service_id !== null) {\n $resourcePath = str_replace(\n '{' . 'service_id' . '}',\n ObjectSerializer::toPathValue($service_id),\n $resourcePath\n );\n }\n // path params\n if ($version_id !== null) {\n $resourcePath = str_replace(\n '{' . 'version_id' . '}',\n ObjectSerializer::toPathValue($version_id),\n $resourcePath\n );\n }\n // path params\n if ($backend_name !== null) {\n $resourcePath = str_replace(\n '{' . 'backend_name' . '}',\n ObjectSerializer::toPathValue($backend_name),\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 'DELETE',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function delete(Service $service)\r\n {\r\n return $service->delete();\r\n }", "function bundle_service_delete($id_service)\n\t{\n\t\tlog_write(\"debug\", \"inc_services\", \"Executing bundle_service_delete($id_service))\");\n\n\n\t\t/*\n\t\t\tBegin Transaction\n\t\t*/\n\t\t$sql_obj = New sql_query;\n\t\t$sql_obj->trans_begin();\n\n\t\t\n\t\t/*\n\t\t\tApply Changes\n\t\t*/\n\n\t\t$sql_obj->string = \"SELECT id FROM `services_bundles` WHERE id_bundle='\". $this->id .\"' AND id_service='$id_service' LIMIT 1\";\n\t\t$sql_obj->execute();\n\t\t$sql_obj->fetch_array();\n\n\t\t$option_id = $sql_obj->data[0][\"id\"];\n\n\n\n\t\t$sql_obj->string = \"DELETE FROM `services_bundles` WHERE id='$option_id' LIMIT 1\";\n\t\t$sql_obj->execute();\n\n\t\t$sql_obj->string = \"DELETE FROM `services_options` WHERE option_type='bundle' AND option_type_id='$option_id'\";\n\t\t$sql_obj->execute();\n\n\n\t\t/*\n\t\t\tUpdate the Journal\n\t\t*/\n\t\tjournal_quickadd_event(\"services\", $this->id, \"Service component removed from bundle.\");\n\n\n\n\t\t/*\n\t\t\tCommit\n\t\t*/\n\t\tif (error_check())\n\t\t{\n\t\t\t$sql_obj->trans_rollback();\n\n\t\t\tlog_write(\"error\", \"process\", \"An error occured whilst attempting to remove a service from the bundle. No changes have been made.\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$sql_obj->trans_commit();\n\n\t\t\tlog_write(\"notification\", \"process\", \"Service successfully removed from bundle.\");\n\t\t}\n\n\n\t\treturn 0;\n\t}", "public function deleteHostedService($serviceName)\n {\n \tif ($serviceName == '' || is_null($serviceName)) {\n\t\t\trequire_once 'Zend/Service/WindowsAzure/Management/Exception.php';\n \t\tthrow new Zend_Service_WindowsAzure_Management_Exception('Service name should be specified.');\n \t}\n\n $response = $this->_performRequest(self::OP_HOSTED_SERVICES . '/' . $serviceName, '', Zend_Http_Client::DELETE);\n\n \tif (!$response->isSuccessful()) {\n\t\t\trequire_once 'Zend/Service/WindowsAzure/Management/Exception.php';\n\t\t\tthrow new Zend_Service_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));\n\t\t}\n }", "public function remove(BackendInterface $backend);", "public function deleteServiceById($id)\n\t\t{\n\t\t\t$this->_db->exec('DELETE FROM Service WHERE NomService = '.$id);\n\t\t}", "public function delete()\n {\n $this->getService()->delete($this);\n }", "public function delete($id) {\n \t//Delete the service\n \t$this->getDb()->delete('t_service', array('serv_id' => $id));\n }", "function DeleteService($id) {\n $resp = Model::getEM()->getRepository(\"ServiceUser\")->getByService($id);\n foreach ($resp as $key) {\n Model::getEM()->remove($key);\n Model::getEM()->flush(); \n }\n //delete service\n $service = Model::getEM()->getRepository(\"Service\")->find($id);\n Model::getEM()->remove($service);\n Model::getEM()->flush();\n FlashMsgView::add(MsgType::Successful, \"El servicio se ha borrado correctamente\");\n // redirect to view services\n $this->data[\"services\"] = Model::getEM()->getRepository(\"Service\")->findAll();\n \n $this->redirect(Router::url(\"/home/admin/service\"));\n }", "public function deleteDomainService(Request $request){\n $service_id = $request->id;\n // Delete record from tbl_admin_users table\n DB::table('tbl_domain_service')->where('id', '=', $service_id)->delete();\n return Redirect::to('/backend/domainservice-list');\n }", "public function serviceDelete()\r\n {\r\n if(isset($_SESSION['user_type']) && $_SESSION['user_type'] == 'admin') { \r\n $deleteId = $_POST['service_id']; \r\n $serviceModel = new ServiceModel();\r\n $serviceModel->deleteService($deleteId);\r\n\r\n flash('success', $_POST['service_name'] . ' service is inactived and will not be shown to Users');\r\n\r\n $data['title'] = 'Services';\r\n $data['slug'] = 'admin_services'; \r\n $page = $data['slug']; \r\n \r\n header('Location: admin_services');\r\n die;\r\n }\r\n }", "public function removeBackend($backend);", "public function forceDeleted(Service $service)\n {\n //\n }", "function win32_delete_service($servicename, $machine){}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the code lib b plaf4.
public function getCodeLibBPlaf4() { return $this->codeLibBPlaf4; }
[ "public function getCodeLibBrut4() {\n return $this->codeLibBrut4;\n }", "public function getCodeLibBPlaf4(): ?string {\n return $this->codeLibBPlaf4;\n }", "public function getCodeLibBrut4(): ?string {\n return $this->codeLibBrut4;\n }", "public function getCodeLibBPlaf() {\n return $this->codeLibBPlaf;\n }", "public function getCodeLibelle() {\n return $this->codeLibelle;\n }", "public function getCodeRef4() {\n return $this->codeRef4;\n }", "public function getCodeLibBrut(): ?string {\n return $this->codeLibBrut;\n }", "public function getCodeLibelle(): ?string {\n return $this->codeLibelle;\n }", "public function getCodeLibSomme() {\n return $this->codeLibSomme;\n }", "public function getCodeTypeBPlaf4(): ?string {\n return $this->codeTypeBPlaf4;\n }", "public function getCodeLibBrut5() {\n return $this->codeLibBrut5;\n }", "protected function getCodeData()\n {\n $code = $this->code;\n // array of symbols\n $code_data = array();\n // length of the code\n $len = strlen($code);\n $startid = 104;\n $this->getCodeDataB($code_data, $code, $len);\n return $this->finalizeCodeData($code_data, $startid);\n }", "public static function lib()\n {\n return $this->lib; \n }", "public function getCodeLibAuto(): ?string {\n return $this->codeLibAuto;\n }", "public function getCodeLibBPlaf2(): ?string {\n return $this->codeLibBPlaf2;\n }", "public function getCode()\n\t{\n\t\t$result =\t'#include <phpcpp.h>'\t\t\t\t.\"\\n\".\n\t\t\t\t\t'#include <math.h>'\t\t\t\t\t.\"\\n\".\n\t\t\t\t\t'#include <iostream>'\t\t\t\t.\"\\n\".\n\t\t\t\t\t'#include \"cpp/header.h\"' .\"\\n\".\n\t\t\t\t\t'#include \"cpp/PhpValue.cpp\"' .\"\\n\".\n\t\t\t\t\t'#include \"cpp/PhpValString.cpp\"'\t.\"\\n\".\n\t\t\t\t\t'#include \"cpp/PhpValFloat.cpp\"'\t.\"\\n\".\n\t\t\t\t\t\"\\n\\n\";\n\n\t\tforeach ($this->functions as $function)\n\t\t{\n\t\t\t$result .= $function->getCode();\n\t\t}\n\n\t\t$result .=\t'extern \"C\"'\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.\"\\n\".\n\t\t\t\t\t'{'\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.\"\\n\".\n\t\t\t\t\t'\tPHPCPP_EXPORT void *get_module()'\t\t\t\t\t\t\t\t\t.\"\\n\".\n\t\t\t\t\t'\t{'\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.\"\\n\".\n\t\t\t\t\t'\t\tstatic Php::Extension extension(\"TestExtension-dev\", \"1.0\");'\t.\"\\n\".\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\"\\n\";\n\n\t\tforeach ($this->functions as $function)\n\t\t{\n\t\t\t$result .= '\t\textension.add(\"'.$function->getName().'\", phpFunc_'.$function->getName().$function->generateArguments().');'.\"\\n\";\n\t\t}\n\n\t\t$result .=\t'\t\treturn extension;'\t\t\t\t\t\t\t\t\t\t\t\t.\"\\n\".\n\t\t\t\t\t'\t}'\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.\"\\n\".\n\t\t\t\t\t'}';\n\n\t\treturn $result;\n\t}", "public function getExternalCode()\n {\n return $this->get(self::EXTERNALCODE);\n }", "public function getCodeLibBrut2() {\n return $this->codeLibBrut2;\n }", "public function getz5bLibelle() {\n return $this->z5bLibelle;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Searches the 'AdvisingSchedules' table for an advising schedule model with a specified advisor user id and academic quarter id
public function loadPropertiesFromAdvisorIDAndAcademicQuarterID($advisorUserID, $academicQuarterID) { if($advisorUserID != null && filter_var($advisorUserID, FILTER_VALIDATE_INT) && $academicQuarterID != null && filter_var($academicQuarterID, FILTER_VALIDATE_INT)) { $this->db->where('AdvisorUserID', $advisorUserID); $this->db->where('AcademicQuarterID', $academicQuarterID); $results = $this->db->get('AdvisingSchedules'); if($results->num_rows() > 0) { $row = $results->row_array(); $this->advisingScheduleID = $row['AdvisingScheduleID']; $this->advisorUserID = $row['AdvisorUserID']; $this->academicQuarterID = $row['AcademicQuarterID']; return true; } } return false; }
[ "function scheduler_get_appointed($slotid){\n global $CFG;\n \n $sql = \"\n SELECT\n u.*\n FROM\n {$CFG->prefix}user AS u,\n {$CFG->prefix}scheduler_appointment AS a\n WHERE\n u.id = a.studentid AND\n a.slotid = {$slotid}\n \"; \n return get_records_sql($sql);\n}", "public function exam_schedule_by_student_id($student_id) {\n\t\treturn $this->db\n\t\t\t->select('x2.exam_date, x2.exam_start_time, x2.exam_end_time, x6.subject_name, x4.building_name, x3.room_name')\n\t\t\t->join('admission_exam_schedules x2', 'x1.exam_schedule_id = x2.id', 'LEFT')\n\t\t\t->join('rooms x3', 'x2.room_id = x3.id', 'LEFT')\n\t\t\t->join('buildings x4', 'x3.building_id = x4.id', 'LEFT')\n\t\t\t->join('admission_subject_setting_details x5', 'x2.subject_setting_detail_id = x5.id', 'LEFT')\n\t\t\t->join('subjects x6', 'x5.subject_id = x6.id', 'LEFT')\n\t\t\t->where('x1.student_id', (int) $student_id)\n\t\t\t->where('x1.is_deleted', 'false')\n\t\t\t->where('x2.is_deleted', 'false')\n\t\t\t->where('x3.is_deleted', 'false')\n\t\t\t->where('x4.is_deleted', 'false')\n\t\t\t->where('x5.is_deleted', 'false')\n\t\t\t->where('x6.is_deleted', 'false')\n\t\t\t->order_by('x2.exam_date', 'ASC')\n\t\t\t->order_by('x2.exam_start_time', 'ASC')\n\t\t\t->get('admission_exam_attendances x1');\n\t}", "private function checkPrimaryActive($insuranceRank, $startDate, $endDate, $patientId, $serviceQue, $program = '', $patientInsuranceId = '', $claimId = '') {\n// fetching insurance data from db\n $searchKey = [];\n $searchKey[0]['type'] = self::CURRENT_OBJ;\n if (!empty($endDate)) {\n\n $searchKey[0]['conditions'] = array(\n array(\n array('coverageStartDate' => array('GE' => $startDate)),\n array('coverageStartDate' => array('LE' => $endDate))\n ),\n 'OR',\n array(\n array('coverageEndDate' => array('GE' => $startDate)),\n array('coverageEndDate' => array('LE' => $endDate))\n ),\n 'OR',\n array(\n array('coverageStartDate' => array('LE' => $startDate)),\n array('coverageEndDate' => array('GE' => $endDate))\n ),\n 'OR',\n array(\n array('coverageStartDate' => array('LE' => $startDate)),\n array('coverageEndDate' => array('ISNULL' => true))\n )\n );\n } else {\n\n $searchKey[0]['conditions'] = array(\n array(\n array('coverageStartDate' => array('LE' => $startDate)),\n array('coverageEndDate' => array('GE' => $startDate))\n )\n ,\n 'OR',\n array(\n array('coverageStartDate' => array('GE' => $startDate))\n )\n ,\n 'OR',\n array(\n array('coverageStartDate' => array('LE' => $startDate)),\n array('coverageEndDate' => array('ISNULL' => true))\n )\n );\n }\n $searchKey[0]['conditions'][] = [self::RANK => $insuranceRank];\n $searchKey[0]['conditions'][] = ['patientId' => $patientId];\n\n if (!empty($patientInsuranceId)) {\n $searchKey[0]['conditions'][] = array('id' => array('NE' => $patientInsuranceId));\n }\n if (!empty($claimId)) {\n $searchKey[0]['conditions'][] = array('claimId' => $claimId);\n } else {\n $searchKey[0]['conditions'][] = array('claimId' => array('ISNULL' => TRUE));\n }\n\n $searchKey[0]['outKey'] = 'response';\n $insResp = $serviceQue->executeQue(\"ws_oml_read\", $searchKey);\n $insDBData = $insResp['data']['response'];\n// If response comes based on date\n if (!empty($insDBData[0])) {\n throw new SynapExceptions(SynapExceptionConstants::ONLY_ONE_ACTIVE_INSURANCE_PER_TIER, 400);\n }\n }", "function get_assessment_byassessid($assessid)\n {\n try\n {\n $sql = \"\n SELECT TOP (1) Assessment.AssessID,\n Assessment.SiteID,\n Assessment.AssessorID,\n Assessment.AssessTypeText,\n (CASE WHEN Assessment.AssessStatus IS NULL THEN '' ELSE Assessment.AssessStatus END) AS AssessStatus ,\n\n Assessment.ObservationMode,\n\n\n (CASE WHEN Assessment.AssessDate IS NULL THEN '' ELSE CONVERT(varchar(10), Assessment.AssessDate, 120) END) AS AssessDate,\n Assessment.AssessStatus,\n -- Assessment.UpdateDate,\n User2.FName,\n User2.LName,\n User2.Phone, User2.email, Organization.OrgName, Site.SiteName, Site.SiteStreet, Site.SiteCity, Site.SiteState, Site.SiteURL, Site.PayingParty\nFROM Organization INNER JOIN\n User2 ON Organization.OrgID = User2.OrgID INNER JOIN\n Assessment ON User2.UserID2 = Assessment.AssessorID INNER JOIN\n Site ON Assessment.SiteID = Site.SiteID\nWHERE (Assessment.AssessID = ?)\nORDER BY Assessment.AssessID DESC\n \";\n\n $query = $this->msterradex->query($sql, array($assessid));\n return $query->result_array();\n } catch (Exception $e)\n {\n throw $e;\n }\n }", "public function scheduleSearchByDoctorId($id){\n\t\t$hospital = DB::table('hospitals')\n\t\t\t\t\t\t->where('user_id', '=', Auth::id())\n\t\t\t\t\t\t->first();\n\n\t\t$schedules = Schedule::where('hospital', '=', $hospital->id)\n\t\t\t\t\t\t->where('doctor_id', '=', $id)\n\t\t\t\t\t\t->get();\n\t\t\t\t\t\n\t\tif(sizeOf($schedules) > 0){\n\t\t\treturn Response::json([\n\t\t\t\t'status' => 200,\n\t\t\t\t'message' => 'doctor schedule',\n\t\t\t\t'data' => [\n\t\t\t\t\t'doctor_schedule' => $schedules,\n\t\t\t\t],\n\t\t\t]);\n\t\t}\n\t\treturn Response::json([\n\t\t\t\t'status' => 404,\n\t\t\t\t'message' => 'data not found',\n\t\t\t]);\n\t}", "public function fetchSchedulesForSpecificInstructor($aId)\n {\n // Prepare a select query.\n $statement = $this->oConnection->prepare(\"\n SELECT\n tc.courseCode, ts.id AS scheduleId,\n ts.fromDate, ts.toDate, tv.venue\n FROM tbl_schedules ts\n INNER JOIN tbl_courses tc\n ON ts.courseId = tc.id\n INNER JOIN tbl_venue tv\n ON ts.venueId = tv.id\n WHERE 1 = 1\n AND ts.instructorId = :userId\n AND ts.fromDate > CURDATE()\n AND ts.toDate > CURDATE()\n \");\n\n // Execute the above statement.\n $statement->execute($aId);\n\n // Return the number of rows returned by the executed query.\n return $statement->fetchAll();\n }", "static public function oGetScheduleByQuuid($sQuuid){\n\t\t$oDB = self::oDB(self::$sDBName);\n\t\t$sSql = \"SELECT `project_schedule_uuid` FROM project_schedule_queue WHERE `queue_uuid`='$sQuuid'\";\n\t\t$iDbq = $oDB->iQuery($sSql);\n\t\t$aRow = $oDB->aFetchAssoc($iDbq);\n\t\tif($aRow === false || $oDB->iNumRows($iDbq)>1)\n\t\t\treturn null;\n\t\t$sScheduleUuid = $aRow['project_schedule_uuid'];\n\t\treturn self::oGetSchedule($sScheduleUuid);\n\t}", "function professor_class_routine_attendance($professor_id, $date) {\n return $this->db->select()\n ->from('class_routine')\n ->join('subject_manager', 'subject_manager.sm_id = class_routine.SubjectID')\n ->join('degree', 'degree.d_id = class_routine.DepartmentID')\n ->join('course', 'course.course_id = class_routine.BranchID')\n ->join('semester', 'semester.s_id = class_routine.SemesterID')\n ->join('class', 'class.class_id = class_routine.ClassID')\n ->where(array(\n //'class_routine.DepartmentID' => $where['department_id'],\n 'DATE_FORMAT(class_routine.Start, \"%Y-%m-%d\") <= ' => date('Y-m-d', strtotime($date)),\n //'class_routine.BranchID' => $where['branch_id'],\n // 'class_routine.BatchID' => $where['batch_id'],\n //'class_routine.SemesterID' => $where['semester_id'],\n //'class_routine.ClassID' => $where['class_id'],\n 'class_routine.ProfessorID' => $professor_id\n ))->order_by('class_routine.ClassRoutineId', 'ASC')->get()->result();\n }", "public function getActiveQuizForUser($user, $quiz)\n {\n $uq = $this->repository->createQueryBuilder('uq');\n \n if ($quiz->getTime() != 0)\n {\n /**\n * @todo hook. Doctrine developers didn't implement TIMEDIFF support. So we need in a ... hook!\n * Let's calculated possible started_at range from current time ($diff)\n */\n $now = time();\n $diff = date('Y-m-d H:i:s', $now-$quiz->getTime());\n $uq->where('(uq.user_id = :user_id) AND (uq.quiz_id = :quiz_id) AND (uq.started_at > :time) AND (uq.is_active = 1) AND (uq.is_closed = 0)')\n ->setParameter('time', $diff);\n } else\n {\n $uq->where('(uq.user_id = :user_id) AND (uq.quiz_id = :quiz_id) AND (uq.is_active = 1) AND (uq.is_closed = 0)');\n }\n \n $uq = $uq->setParameter('user_id', $user->getId())\n ->setParameter('quiz_id', $quiz->getId())\n ->setMaxResults(1)\n ->getQuery()\n ->getResult();\n if (isset($uq[0]) && $uq[0])\n {\n return $uq[0];\n }\n return false;\n }", "public function getSurveysAndCohortsHavingAccessibleISQs($loggedInUserId, $orgId, $isAggregateReporting, $userHasCoordinatorAccess, $orgAcademicYearId = null, $surveyStatus = null)\n {\n $permissionSets = $this->orgPermissionsetRepository->getAllPermissionsetIdsByPerson($loggedInUserId, $orgId);\n $permissionSets = array_column($permissionSets, 'org_permissionset_id');\n\n $userHasAccessToAllISQs = $this->orgPermissionsetQuestionRepository->permissionsetsHaveAccessToEveryCurrentAndFutureISQ($permissionSets, $isAggregateReporting);\n\n if ($userHasAccessToAllISQs || $userHasCoordinatorAccess) {\n $surveysAndCohorts = $this->wessLinkRepository->getCohortsAndSurveysForOrganizationForSetup($orgId, 'isq', $orgAcademicYearId, $surveyStatus);\n } else {\n $surveysAndCohorts = $this->wessLinkRepository->getSurveysAndCohortsHavingAccessibleISQs($orgId, $permissionSets, $isAggregateReporting, $orgAcademicYearId, $surveyStatus);\n }\n\n return $surveysAndCohorts;\n }", "public function get_schedule($doctor_id, $day){\n\n $this->db->select('*');\n $this->db->where('doctor_id',$doctor_id);\n $this->db->where('day',$day);\n $query = $this->db->get('schedule');\n\n if($query->num_rows() == 1) {\n return $query;\n }\n\n\n }", "public function getScheduleByUserId($userId)\n {\n $result = DB::table('schedule')\n ->join('schedule_status', 'schedule.schedule_status_type_id', '=', 'schedule_status.schedule_status_type_id')\n ->select('schedule.*', 'schedule_status.name as schedule_status_name', 'schedule_status.description as schedule_status_description')\n ->where('schedule.driver_id',$userId)\n ->orderBy('schedule.intend_start_time')\n ->get();\n return response()->json(array(\n 'error' => false,\n 'content' => $result,\n 'status_code' => 200\n ));\n }", "function getStudentSchedule($dbh, $studentId, $semester){\n // TODO Implement this.\n $statement = $dbh->prepare('Select stu_id, courseOfStudy.course_num, courseOfStudy.inst_id, courseOfStudy.time, courseOfStudy.room_num, courseOfStudy.section_num, courses.title From studentSchedule Inner Join courseOfStudy ON studentSchedule.cos_id=courseOfStudy.id Inner Join courses On courseOfStudy.course_num=courses.course_num where stu_id = :studentId and courseOfStudy.semester = :semester;');\t\n\t$statement->execute(array(':studentId' => $studentId,':semester'=> $semester));\n\t//echo \"<tr><td> Student ID</tr> </td>\";\n\t$res = $statement->fetchAll();\n\tforeach($res as $row){\n \t\tprint \"<tr><td> {$row[\"stu_id\"]}</td> <td> {$row[\"course_num\"]}</td> <td> {$row[\"inst_id\"]}</td> <td> {$row[\"time\"]}</td> <td> {$row[\"room_num\"]}</td> <td> {$row[\"section_num\"]}</td> <td> {$row[\"title\"]}</td></tr>\";\n\t}\n\techo \" The student was not found in the database.\";\n}", "function check_attendance($kwds) {\n $kwds = mysqli_real_escape_string($this->connection, $kwds); \n return $this->query(\"SELECT DISTINCT class.id as id FROM class\n INNER JOIN coteacher ON class.id = coteacher.class_id\n INNER JOIN attendance ON attendance.user_id = coteacher.user_id\n WHERE class.kwds_id = $kwds\n AND (arrival > day or departure < ADDTIME(day, SEC_TO_TIME(hours*60)))\");\n }", "function get_tutorschedule_where($params)\n {\n return $this->db->get_where('tutorschedules', $params)->row_array();\n }", "public function marketingSchedule()\n {\n return $this->hasOne('App\\Schedules\\StudentMarketingSchedule', 'user_id');\n }", "public function get_course_schedule($student);", "function get_users_assessments($user) {\n $sql = \"SELECT * FROM `assignment` as A, `courseenrolment` as B WHERE A.CourseID=B.CourseID AND \n\t\t\tA.Semester=B.Semester AND A.InstitutionID=B.InstitutionID AND B.UserID=?\";\n $query = MySQL::getInstance()->prepare($sql);\n $query->execute(array($user));\n return $query->fetchAll(PDO::FETCH_ASSOC);\n}", "public function vcp_schedule() {\n\t\tglobal $I2_SQL,$I2_USER;\n\t\tif($this->op == '') {\n\t\t\t$this->template = 'vcp_schedule.tpl';\n\t\t\tif(!empty($this->args['uid'])) {\n\t\t\t\t$this->template_args['users'] = array(new User($this->args['uid']));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (isset($this->args['fname']) && $this->args['fname']!=\"\")\n\t\t\t\t{\n\t\t\t\t\t$this->template_args['users'] = User::search_info(\"{$this->args['fname']} {$this->args['name_id']}\");\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$this->args['name_id'] = isset($this->args['name_id']) ? $this->args['name_id'] : \"\";\n\t\t\t\t\t$this->template_args['users'] = User::search_info(\"{$this->args['name_id']}\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(count($this->template_args['users']) == 1) {\n\t\t\t\tredirect(\"eighth/vcp_schedule/view/uid/{$this->template_args['users'][0]->uid}\");\n\t\t\t}\n\t\t\tusort($this->template_args['users'], array('User', 'name_cmp'));\n\t\t\t$this->title = 'Search Students';\n\t\t}\n\t\telse if($this->op == 'view') {\n\t\t\t$start_date = $this->args['start_date'];\n\n\t\t\t$temp = new DateTime($start_date);\n\t\t\t$temp->modify(\"+2 weeks\");\n\t\t\t$this->template_args['next_date'] = $temp->format(\"Y-m-d\");\n\t\t\t//modify works in-place, so we have to cancel out the +2 in addition to\n\t\t\t//the new -2\n\t\t\t$temp->modify(\"-4 weeks\");\n\t\t\t$this->template_args['prev_date'] = $temp->format(\"Y-m-d\");\n\n\t\t\t$user = new User($this->args['uid']);\n\t\t\t$this->template_args['user'] = $user;\n\t\t\t$this->template_args['comments'] = $user->comments;\n\t\t\t$this->template_args['activities'] = EighthActivity::id_to_activity(EighthSchedule::get_activities($this->args['uid'], $start_date), FALSE);\n\t\t\t$this->template_args['absences'] = EighthSchedule::get_absences($this->args['uid']);\n\t\t\t//TODO: Do this in the the template\n\t\t\t$this->template_args['absence_count'] = count($this->template_args['absences']);\n\n\t\t\tif(strlen($user->counselor_name) == 0) {\n\t\t\t\t$this->template_args['counselor_name'] = \"N/A\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->template_args['counselor_name'] = $user->counselor_name;\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tif($user->schedule()->last() != null) {\n\t\t\t\t\t$lastclass = $user->schedule()->last();\n\t\t\t\t\tif($lastclass->period != 8) {\n\t\t\t\t\t\t$this->template_args['ta'] = \"N/A\";\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$this->template_args['ta'] = $lastclass->teacher->sn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$this->template_args['ta'] = \"N/A\";\n\t\t\t\t}\n\t\t\t} catch (I2Exception $e) {\n\t\t\t\t//There is something wrong with the schedule or teacher.\n\t\t\t}\n\n\t\t\t$this->template = 'vcp_schedule_view.tpl';\n\t\t\t$this->title = 'View Schedule';\n\t\t}\n\t\telse if ($this->op == 'history') {\n\t\t\t$date = getdate();\n\t\t\t$date = ($date['mon'] > 7 ? $date['year'] : $date['year']-1).'-09-01';\n\t\t\t$days = intval((time()-strtotime($date))/86400);\n\t\t\t$this->template_args['start_date'] = strtotime($date);\n\n\t\t\t$user = new User($this->args['uid']);\n\t\t\t$this->template_args['user'] = $user;\n\t\t\t$this->template_args['comments'] = $user->comments;\n\t\t\t$this->template_args['activities'] = EighthActivity::\n\t\t\t\tid_to_activity(EighthSchedule::get_activities(\n\t\t\t\t$this->args['uid'], $date, $days), FALSE);\n\t\t\t$this->template_args['absences'] = EighthSchedule::get_absences($this->args['uid']);\n\t\t\t//TODO: Do this in the the template\n\t\t\t$this->template_args['absence_count'] = count($this->template_args['absences']);\n\n\t\t\tif(strlen($user->counselor_name) == 0) {\n\t\t\t\t$this->template_args['counselor_name'] = \"N/A\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->template_args['counselor_name'] = $user->counselor_name;\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tif($user->schedule()->last() != null) {\n\t\t\t\t\t$lastclass = $user->schedule()->last();\n\t\t\t\t\tif($lastclass->period != 8) {\n\t\t\t\t\t\t$this->template_args['ta'] = \"N/A\";\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$this->template_args['ta'] = $lastclass->teacher->sn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$this->template_args['ta'] = \"N/A\";\n\t\t\t\t}\n\t\t\t} catch (I2Exception $e) {\n\t\t\t\t//There is something wrong with the schedule or teacher.\n\t\t\t}\n\t\t\t$this->title = 'Eighth Periods Attended';\n\t\t\t$this->template = 'vcp_schedule_history.tpl';\n\n\t\t}\n\t\telse if($this->op == 'mostoften') {\n\t\t\t// header\n\t\t\t$user = new User($this->args['uid']);\n\t\t\t$this->template_args['user'] = $user;\n\t\t\t$this->template_args['comments'] = $user->comments;\n\t\t\t$this->template_args['absences'] = EighthSchedule::get_absences($this->args['uid']);\n\t\t\t//TODO: Do this in the the template\n\t\t\t$this->template_args['absence_count'] = count($this->template_args['absences']);\n\n\t\t\tif(strlen($user->counselor_name) == 0) {\n\t\t\t\t$this->template_args['counselor_name'] = \"N/A\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->template_args['counselor_name'] = $user->counselor_name;\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tif($user->schedule()->last() != null) {\n\t\t\t\t\t$lastclass = $user->schedule()->last();\n\t\t\t\t\tif($lastclass->period != 8) {\n\t\t\t\t\t\t$this->template_args['ta'] = \"N/A\";\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$this->template_args['ta'] = $lastclass->teacher->sn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$this->template_args['ta'] = \"N/A\";\n\t\t\t\t}\n\t\t\t} catch (I2Exception $e) {\n\t\t\t\t//There is something wrong with the schedule or teacher.\n\t\t\t}\n\t\t\t// end header\n\t\t\t$uid = $this->args['uid'];\n\t\t\t$date = getdate();\n\t\t\t$date = ($date['mon'] > 7 ? $date['year'] : $date['year']-1).'-09-01';\n\t\t\t$days = intval((time()-strtotime($date))/86400);\n\t\t\t$acts = EighthActivity::id_to_activity(EighthSchedule::get_activities($uid, $date, $days), FALSE);\n\n\t\t\t$this->template_args['activities'] = $acts;\n\t\t\t$moa = array();\n\t\t\t$actd = array();\n\t\t\t// Loop through all activities and get counts\n\t\t\tforeach($acts as $act) {\n\t\t\t\tif(isset($moa[$act->aid])) {\n\t\t\t\t\t$moa[$act->aid]++;\n\t\t\t\t} else {\n\t\t\t\t\t$moa[$act->aid] = 1;\n\t\t\t\t}\n\t\t\t\t// cut down on requests by saving the activity object\n\t\t\t\tif(!isset($actd[$act->aid])) {\n\t\t\t\t\t$actd[$act->aid] = $act;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Sort highest to lowest by value\n\t\t\tarsort($moa);\n\t\t\t$moao = array();\n\t\t\t// Loop through the sorted values and make an array with the activity object, not the id\n\t\t\tforeach($moa as $aid => $mo) {\n\t\t\t\t$moao[] = array(\n\t\t\t\t\t\"num\" => $mo,\n\t\t\t\t\t\"act\" => $actd[$aid]\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$this->template_args['mostoften'] = $moao;\n\n\t\t\t$this->title = 'Most Often Attended Eighth Periods';\n\t\t\t$this->template = 'vcp_schedule_mostoften.tpl';\n\n\t\t}\n\t\telse if($this->op == 'format') {\n\t\t\t$this->setup_format_selection('vcp_schedule', 'Student Schedule', array('uid' => $this->args['uid']), TRUE);\n\t\t}\n\t\telse if($this->op == 'print') {\n\t\t\tEighthPrint::print_student_schedule($this->args['uid'], $this->args['start_date'], $this->args['format']);\n\t\t}\n\t\telse if($this->op == 'choose') {\n\t\t\t$valids = [];\n\t\t\t$validdata = [];\n\t\t\t$activities = EighthActivity::get_all_activities($this->args['bids'],FALSE);\n\t\t\tif(count($this->args['bids'])==1)\n\t\t\t\t$selected_aid = EighthSchedule::get_activities_by_block($this->args['uid'],$this->args['bids'][0]);\n\t\t\telse\n\t\t\t\t$selected_aid = \"\";\n\n\t\t\t$faves = [];\n\t\t\t$restricted = [];\n\t\t\t$general = [];\n\t\t\t$full = [];\n\t\t\t$filling = [];\n\t\t\t$selected = [];\n\t\t\t$cancelled = [];\n\t\t\tforeach ($activities as $i) {\n\t\t\t\tif($i->aid == $selected_aid)\n\t\t\t\t\t$selected[] = $i;\n\n\t\t\t\tif($i->favorite)\n\t\t\t\t\t$faves[] = $i;\n\n\t\t\t\tif($I2_USER->uid!=9999) { // Eighth office doesn't need sections\n\t\t\t\t\tif($i->restricted)\n\t\t\t\t\t\t$restricted[] = $i;\n\n\t\t\t\t\tif($i->capacity != -1) {\n\t\t\t\t\t\tif($i->member_count>=$i->capacity)\n\t\t\t\t\t\t\t$full[] = $i;\n\t\t\t\t\t\telse if($i->member_count>=$i->capacity*.9)\n\t\t\t\t\t\t\t$filling[] = $i;\n\t\t\t\t\t}\n\n\t\t\t\t\tif($i->cancelled)\n\t\t\t\t\t\t$cancelled[] = $i;\n\t\t\t\t}\n\n\t\t\t\t$general[] = $i;\n\t\t\t}\n\n\t\t\t$this->template_args['selected_aid']=$selected_aid;\n\t\t\t$this->template_args['selected']=$selected;\n\t\t\t//$this->template_args['restricted']=$restricted;\n\t\t\t$this->template_args['favorites'] = $faves;\n\t\t\t$this->template_args['general'] = $general;\n\t\t\t//$this->template_args['filling'] = $filling;\n\t\t\t//$this->template_args['cancelled'] = $cancelled;\n\t\t\t//$this->template_args['full'] = $full;\n\t\t\t$this->template_args['uid'] = $this->args['uid'];\n\t\t\t$this->template = 'vcp_schedule_choose.tpl';\n\n\t\t\tif(!is_array($this->args['bids'])) {\n\t\t\t\t$this->template_args['bids'] = $this->args['bids'];\n\t\t\t\t$blockdate = ' for ';\n\t\t\t\t$blockdate = $blockdate.$I2_SQL->query('SELECT DATE_FORMAT((SELECT date FROM eighth_blocks WHERE bid=%d), %s)', $this->args['bids'], '%W, %M %d, %Y')->fetch_single_value();\n\t\t\t\t$blockdate = $blockdate.', '.$I2_SQL->query('SELECT block FROM eighth_blocks WHERE bid=%d', $this->args['bids'])->fetch_single_value().' Block';\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->template_args['bids'] = implode(',', $this->args['bids']);\n\t\t\t\t$this->template_args['manybids'] = TRUE; //Tell the template not to offer \"Show Rosters.\"\n\t\t\t\tif(count($this->args['bids']) > 1) {\n\t\t\t\t\t$blockdate = ' for Multiple Blocks';\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$blockdate = ' for ';\n\t\t\t\t\t$blockdate = $blockdate.$I2_SQL->query('SELECT DATE_FORMAT((SELECT date FROM eighth_blocks WHERE bid=%d), %s)', implode($this->args['bids']), '%W, %M %d, %Y')->fetch_single_value();\n\t\t\t\t\t$blockdate = $blockdate.', '.$I2_SQL->query('SELECT block FROM eighth_blocks WHERE bid=%d', implode($this->args['bids']))->fetch_single_value().' Block';\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->title = 'Choose an Activity'.$blockdate;\n\t\t}\n\t\telse if($this->op == 'change') {\n\t\t\tif(isset($_POST['submit']) && $_POST['submit'] == \"View Roster\") {\n\t\t\t\t//We don't actually want to change activities, we just want to check an activity roster before signing up for the activity.\n\t\t\t\tredirect(\"eighth/vcp_schedule/roster/bid/{$this->args['bids']}/aid/{$this->args['aid']}\");\n\t\t\t}\n\t\t\tif (isset($this->args['bids']) && isset($this->args['aid'])) {\n\t\t\t\t$status = [];\n\t\t\t\t$bids = explode(',', $this->args['bids']);\n\t\t\t\td(\"force: \".isset($this->args['force']), 0);\n\t\t\t\tforeach($bids as $bid) {\n\t\t\t\t\tif(EighthSchedule::is_activity_valid($this->args['aid'], $bid)) {\n\t\t\t\t\t\t$activity = new EighthActivity($this->args['aid'], $bid);\n\t\t\t\t\t\td(\"Current members of the activity: \".print_r($activity->get_members(), true), 0);\n\t\t\t\t\t\tself::start_undo_transaction();\n\t\t\t\t\t\tif (self::is_admin())\n\t\t\t\t\t\t\tEighthSchedule::remove_absentee($bid, $this->args['uid']);\n\t\t\t\t\t\t$ret = $activity->add_member(new User($this->args['uid']), isset($this->args['force']));\n\t\t\t\t\t\tself::end_undo_transaction();\n\n\n\n\t\t\t\t\t\t$act_status = [];\n\t\t\t\t\t\tif($ret & EighthActivity::CANCELLED) {\n\t\t\t\t\t\t\t$act_status['cancelled'] = TRUE;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($ret & EighthActivity::PERMISSIONS) {\n\t\t\t\t\t\t\t$act_status['permissions'] = TRUE;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($ret & EighthActivity::CAPACITY) {\n\t\t\t\t\t\t\t$act_status['capacity'] = TRUE;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($ret & EighthActivity::STICKY) {\n\t\t\t\t\t\t\t$act_status['sticky'] = TRUE;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($ret & EighthActivity::ONEADAY) {\n\t\t\t\t\t\t\t$act_status['oneaday'] = TRUE;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($ret & EighthActivity::PRESIGN) {\n\t\t\t\t\t\t\t$act_status['presign'] = TRUE;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($ret & EighthActivity::LOCKED) {\n\t\t\t\t\t\t\t$act_status['locked'] = TRUE;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($ret & EighthActivity::PAST) {\n\t\t\t\t\t\t\t$act_status['past'] = TRUE;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(count($act_status) != 0) {\n\t\t\t\t\t\t\t$act_status['activity'] = $activity;\n\t\t\t\t\t\t\t$status[$bid] = $act_status;\n\t\t\t\t\t\t\t$stat = array_keys($act_status);\n\t\t\t\t\t\t\t$this->template_args['forcereason'] = $stat[0];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$activity = new EighthActivity($this->args['aid'], $bid);\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t$actmembers = $activity->get_members();\n\t\t\t\t\t\t\t\td(\"New members of the activity: \".print_r($actmembers, true), 0);\n\t\t\t\t\t\t\t\tif(!in_array($this->args['uid'], $actmembers) && ($activity->restricted || $activity->sticky)) {\n\t\t\t\t\t\t\t\t\td(\"User ID \".$this->args['uid'].\" wasn't added into the activity! Trying again.\", 0);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$ret = $activity->add_member(new User($this->args['uid']), isset($this->args['force']));\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} catch(Exception $e) {\n\t\t\t\t\t\t\t\td(\"Failed activity add member checking.\", 0);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$this->template_args['act_status'] = $act_status;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(count($status) == 0) {\n\n\t\t\t\t\t$start_date = $this->args['start_date'];\n\t\t\t\t\tif ($start_date != self::$default_start_date) {\n\t\t\t\t\t\t$append = \"/start_date/{$start_date}\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$append = NULL;\n\t\t\t\t\t}\n\t\t\t\t\tredirect(\"eighth/vcp_schedule/view/uid/{$this->args['uid']}$append\");\n\t\t\t\t}\n\t\t\t\t$this->template = 'vcp_schedule_change.tpl';\n\t\t\t\t$this->template_args['status'] = $status;\n\t\t\t\t$this->template_args['uid'] = $this->args['uid'];\n\t\t\t\t$this->template_args['bids'] = $this->args['bids'];\n\t\t\t\t$this->template_args['aid'] = $this->args['aid'];\n\t\t\t}\n\t\t}\n\t\t/*Callins are currently disabled, however, this function is required to accept passes*/\n\t\telse if($this->op == 'callin') {\n\t\t\tif (isset($this->args['name_id']) && isset($this->args['bid']) && isset($this->args['aid'])) {\n\n\t\t\t\t\t$users = User::search_info(\"{$this->args['name_id']}\");\n\t\t\t\t\tif (count($users) == 1) {\n\t\t\t\t\t\t$user = $users[0];\n\t\t\t\t\t\t$activity = new EighthActivity($this->args['aid'], $this->args['bid']);\n\t\t\t\t\t\t$activity->add_member_callin($user, $this->args['aid'], $this->args['bid']);\n\t\t\t\t\t\tredirect(\"eighth/vcp_attendance/view/bid/{$this->args['bid']}/aid/{$this->args['aid']}\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new I2Exception(\"You did not provide enough information to unambiguously identify a student\");\n\t\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\tthrow new I2Exception(\"You did not provide a required argument\");\n\t\t\t}\n\n\t\t}\n\t\telse if($this->op == 'acceptallpasses') {\n\t\t\tif(isset($this->args['bid']) && isset($this->args['aid'])) {\n\n\t\t\t\t$activity = new EighthActivity($this->args['aid'], $this->args['bid']);\n\t\t\t\t$activity->accept_all_passes($this->args['aid'], $this->args['bid']);\n\t\t\t\tredirect(\"eighth/vcp_attendance/view/bid/{$this->args['bid']}/aid/{$this->args['aid']}\");\n\n\t\t\t} else {\n\t\t\t\tthrow new I2Exception(\"you did not provide a required argument\");\n\t\t\t}\n\n\t\t}\n\t\telse if($this->op == 'roster') {\n\t\t\t$activity = new EighthActivity($this->args['aid'], $this->args['bid']);\n\t\t\t$this->template_args['activity'] = $activity;\n\t\t\t$this->template = 'vcp_schedule_roster.tpl';\n\t\t\t$this->title = 'Activity Roster';\n\t\t}\n\t\telse if($this->op == 'absences') {\n\t\t\t$absences = EighthActivity::id_to_Activity(EighthSchedule::get_absences($this->args['uid']));\n\t\t\t$this->template_args['absences'] = $absences;\n\t\t\t$user = new User($this->args['uid']);\n\t\t\t$this->template_args['user'] = $user;\n\t\t\t$this->template_args['admin'] = $this->admin;\n\t\t\t$this->template_args['count'] = count($absences);\n\t\t\t$this->title = 'Absence Information';\n\t\t\t$this->template = 'vcp_schedule_absences.tpl';\n\t\t}\n\t\telse if($this->op == 'remove_absence') {\n\t\t\tself::start_undo_transaction();\n\t\t\tEighthSchedule::remove_absentee($this->args['bid'], $this->args['uid']);\n\t\t\tself::end_undo_transaction();\n\t\t\tredirect('eighth/vcp_schedule/absences/uid/'.$this->args['uid']);\n\t\t}\n\t\telse if($this->op == 'favorite') {\n\t\t\t// The uid field here is used for the aid instead\n\t\t\tEighthActivity::favorite_change($this->args['uid']);\n\t\t\t$this->template_args['bids'] = $this->args['bids'];\n\t\t\tif(is_numeric($this->args['bids']))\n\t\t\t\tredirect(\"eighth/vcp_schedule/choose/uid/{$I2_USER->uid}/bids/{$this->args['bids']}\");\n\t\t\telse\n\t\t\t\tredirect(\"eighth/vcp_schedule/choose/uid/{$I2_USER->uid}/bids/\" . substr($this->args['bids'],0,strpos($this->args['bids'],\",\")));\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the public 'TYPO3\CMS\Filelist\Controller\FileListController' autowired service.
protected function getFileListControllerService() { $instance = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstanceForDi(\TYPO3\CMS\Filelist\Controller\FileListController::class); $instance->setLogger(($this->services['_early.TYPO3\\CMS\\Core\\Log\\LogManager'] ?? $this->get('_early.TYPO3\\CMS\\Core\\Log\\LogManager', 1))->getLogger('TYPO3\\CMS\\Filelist\\Controller\\FileListController')); $instance->injectFileRepository(($this->services['TYPO3\\CMS\\Core\\Resource\\FileRepository'] ?? ($this->services['TYPO3\\CMS\\Core\\Resource\\FileRepository'] = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstanceForDi(\TYPO3\CMS\Core\Resource\FileRepository::class)))); $instance->injectConfigurationManager(($this->services['TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManager'] ?? $this->getConfigurationManagerService())); $instance->injectObjectManager(($this->services['TYPO3\\CMS\\Extbase\\Object\\ObjectManager'] ?? $this->getObjectManagerService())); $instance->injectSignalSlotDispatcher(($this->services['TYPO3\\CMS\\Extbase\\SignalSlot\\Dispatcher'] ?? $this->getDispatcher2Service())); $instance->injectValidatorResolver(($this->services['TYPO3\\CMS\\Extbase\\Validation\\ValidatorResolver'] ?? $this->getValidatorResolverService())); $instance->injectViewResolver(($this->privates['TYPO3\\CMS\\Extbase\\Mvc\\View\\GenericViewResolver'] ?? $this->getGenericViewResolverService())); $instance->injectReflectionService(($this->services['TYPO3\\CMS\\Extbase\\Reflection\\ReflectionService'] ?? $this->getReflectionServiceService())); $instance->injectCacheService(($this->services['TYPO3\\CMS\\Extbase\\Service\\CacheService'] ?? $this->getCacheServiceService())); $instance->injectHashService(($this->services['TYPO3\\CMS\\Extbase\\Security\\Cryptography\\HashService'] ?? $this->getHashServiceService())); $instance->injectMvcPropertyMappingConfigurationService(($this->services['TYPO3\\CMS\\Extbase\\Mvc\\Controller\\MvcPropertyMappingConfigurationService'] ?? $this->getMvcPropertyMappingConfigurationServiceService())); $instance->injectEventDispatcher(($this->services['Psr\\EventDispatcher\\EventDispatcherInterface_decorated_1'] ?? $this->getEventDispatcherInterfaceDecorated1Service())); $instance->initializeObject(); return $instance; }
[ "protected function getFileDumpControllerService()\n {\n return $this->services['TYPO3\\\\CMS\\\\Core\\\\Controller\\\\FileDumpController'] = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstanceForDi(\\TYPO3\\CMS\\Core\\Controller\\FileDumpController::class, ($this->services['TYPO3\\\\CMS\\\\Core\\\\Resource\\\\ResourceFactory'] ?? $this->getResourceFactoryService()));\n }", "protected function getOneupFlysystem_Plugin_ListFilesService()\n {\n return $this->services['oneup_flysystem.plugin.list_files'] = new \\League\\Flysystem\\Plugin\\ListFiles();\n }", "protected function getLiipImagine_ControllerService()\n {\n return $this->services['liip_imagine.controller'] = new \\Liip\\ImagineBundle\\Controller\\ImagineController($this->get('liip_imagine.data.manager'), $this->get('liip_imagine.filter.manager'), $this->get('liip_imagine.cache.manager'), $this->get('liip_imagine.cache.signer'), $this->get('logger', ContainerInterface::NULL_ON_INVALID_REFERENCE));\n }", "protected function getFosRest_Routing_Loader_Reader_ControllerService()\n {\n return $this->services['fos_rest.routing.loader.reader.controller'] = new \\FOS\\RestBundle\\Routing\\Loader\\Reader\\RestControllerReader($this->get('fos_rest.routing.loader.reader.action'), $this->get('annotation_reader'));\n }", "protected function getPaul999_Mention_ControllerService()\n {\n return $this->services['paul999.mention.controller'] = new \\paul999\\mention\\controller\\main($this->get('user'), $this->get('dbal.conn'), $this->get('auth'), $this->get('request'), $this->get('config'));\n }", "protected function getLiipImagine_ControllerService()\n {\n return $this->services['liip_imagine.controller'] = new \\Liip\\ImagineBundle\\Controller\\ImagineController($this->get('liip_imagine.data.manager'), $this->get('liip_imagine.filter.manager'), $this->get('liip_imagine.cache.manager'));\n }", "protected function getFosRest_Routing_Loader_ControllerService()\n {\n return $this->services['fos_rest.routing.loader.controller'] = new \\FOS\\RestBundle\\Routing\\Loader\\RestRouteLoader($this, $this->get('file_locator'), $this->get('controller_name_converter'), $this->get('fos_rest.routing.loader.reader.controller'), NULL);\n }", "protected function getSensioFrameworkExtra_Controller_ListenerService()\n {\n return $this->privates['sensio_framework_extra.controller.listener'] = new \\Sensio\\Bundle\\FrameworkExtraBundle\\EventListener\\ControllerListener(($this->privates['annotations.cached_reader'] ?? $this->getAnnotations_CachedReaderService()));\n }", "protected function getLiipImagine_ControllerService()\n {\n return $this->services['liip_imagine.controller'] = new \\Liip\\ImagineBundle\\Controller\\ImagineController(${($_ = isset($this->services['liip_imagine.data.manager']) ? $this->services['liip_imagine.data.manager'] : $this->get('liip_imagine.data.manager')) && false ?: '_'}, ${($_ = isset($this->services['liip_imagine.filter.manager']) ? $this->services['liip_imagine.filter.manager'] : $this->get('liip_imagine.filter.manager')) && false ?: '_'}, ${($_ = isset($this->services['liip_imagine.cache.manager']) ? $this->services['liip_imagine.cache.manager'] : $this->get('liip_imagine.cache.manager')) && false ?: '_'}, ${($_ = isset($this->services['liip_imagine.cache.signer']) ? $this->services['liip_imagine.cache.signer'] : $this->get('liip_imagine.cache.signer')) && false ?: '_'}, ${($_ = isset($this->services['logger']) ? $this->services['logger'] : $this->get('logger', ContainerInterface::NULL_ON_INVALID_REFERENCE)) && false ?: '_'}, 301);\n }", "protected function getSymfonyCmfContent_ControllerService()\n {\n return $this->services['symfony_cmf_content.controller'] = new \\Symfony\\Cmf\\Bundle\\ContentBundle\\Controller\\ContentController($this->get('templating'), 'SymfonyCmfContentBundle:StaticContent:index.html.twig', $this->get('fos_rest.view_handler'), $this->get('symfony_cmf_core.publish_workflow_checker'));\n }", "protected function getDownloadControllerService()\n {\n $instance = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstanceForDi(\\TYPO3\\CMS\\Extensionmanager\\Controller\\DownloadController::class);\n\n $instance->injectExtensionRepository(($this->services['TYPO3\\\\CMS\\\\Extensionmanager\\\\Domain\\\\Repository\\\\ExtensionRepository'] ?? $this->getExtensionRepositoryService()));\n $instance->injectManagementService(($this->services['TYPO3\\\\CMS\\\\Extensionmanager\\\\Service\\\\ExtensionManagementService'] ?? $this->getExtensionManagementServiceService()));\n $instance->injectDownloadUtility(($this->services['TYPO3\\\\CMS\\\\Extensionmanager\\\\Utility\\\\DownloadUtility'] ?? $this->getDownloadUtilityService()));\n $instance->injectConfigurationManager(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Configuration\\\\ConfigurationManager'] ?? $this->getConfigurationManagerService()));\n $instance->injectObjectManager(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Object\\\\ObjectManager'] ?? $this->getObjectManagerService()));\n $instance->injectSignalSlotDispatcher(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\SignalSlot\\\\Dispatcher'] ?? $this->getDispatcher2Service()));\n $instance->injectValidatorResolver(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Validation\\\\ValidatorResolver'] ?? $this->getValidatorResolverService()));\n $instance->injectViewResolver(($this->privates['TYPO3\\\\CMS\\\\Extbase\\\\Mvc\\\\View\\\\GenericViewResolver'] ?? $this->getGenericViewResolverService()));\n $instance->injectReflectionService(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Reflection\\\\ReflectionService'] ?? $this->getReflectionServiceService()));\n $instance->injectCacheService(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Service\\\\CacheService'] ?? $this->getCacheServiceService()));\n $instance->injectHashService(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Security\\\\Cryptography\\\\HashService'] ?? $this->getHashServiceService()));\n $instance->injectMvcPropertyMappingConfigurationService(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Mvc\\\\Controller\\\\MvcPropertyMappingConfigurationService'] ?? $this->getMvcPropertyMappingConfigurationServiceService()));\n $instance->injectEventDispatcher(($this->services['Psr\\\\EventDispatcher\\\\EventDispatcherInterface_decorated_1'] ?? $this->getEventDispatcherInterfaceDecorated1Service()));\n\n return $instance;\n }", "protected function getAutocompleteControllerService()\n {\n $instance = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstanceForDi(\\TYPO3\\CMS\\Fluid\\ViewHelpers\\Widget\\Controller\\AutocompleteController::class);\n\n $instance->injectConfigurationManager(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Configuration\\\\ConfigurationManager'] ?? $this->getConfigurationManagerService()));\n $instance->injectObjectManager(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Object\\\\ObjectManager'] ?? $this->getObjectManagerService()));\n $instance->injectSignalSlotDispatcher(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\SignalSlot\\\\Dispatcher'] ?? $this->getDispatcher2Service()));\n $instance->injectValidatorResolver(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Validation\\\\ValidatorResolver'] ?? $this->getValidatorResolverService()));\n $instance->injectViewResolver(($this->privates['TYPO3\\\\CMS\\\\Extbase\\\\Mvc\\\\View\\\\GenericViewResolver'] ?? $this->getGenericViewResolverService()));\n $instance->injectReflectionService(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Reflection\\\\ReflectionService'] ?? $this->getReflectionServiceService()));\n $instance->injectCacheService(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Service\\\\CacheService'] ?? $this->getCacheServiceService()));\n $instance->injectHashService(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Security\\\\Cryptography\\\\HashService'] ?? $this->getHashServiceService()));\n $instance->injectMvcPropertyMappingConfigurationService(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Mvc\\\\Controller\\\\MvcPropertyMappingConfigurationService'] ?? $this->getMvcPropertyMappingConfigurationServiceService()));\n $instance->injectEventDispatcher(($this->services['Psr\\\\EventDispatcher\\\\EventDispatcherInterface_decorated_1'] ?? $this->getEventDispatcherInterfaceDecorated1Service()));\n\n return $instance;\n }", "protected function getOroSecurity_Listener_ControllerService()\n {\n return $this->services['oro_security.listener.controller'] = new \\Oro\\Bundle\\SecurityBundle\\EventListener\\ControllerListener($this->get('oro_security.security_facade'), $this->get('monolog.logger.security'));\n }", "protected function getFileLocatorService()\n {\n return $this->services['file_locator'] = new \\Symfony\\Component\\HttpKernel\\Config\\FileLocator($this->get('kernel'), ($this->targetDirs[2].'/Resources'));\n }", "protected function getPaginateControllerService()\n {\n $instance = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstanceForDi(\\TYPO3\\CMS\\Fluid\\ViewHelpers\\Be\\Widget\\Controller\\PaginateController::class);\n\n $instance->injectConfigurationManager(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Configuration\\\\ConfigurationManager'] ?? $this->getConfigurationManagerService()));\n $instance->injectObjectManager(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Object\\\\ObjectManager'] ?? $this->getObjectManagerService()));\n $instance->injectSignalSlotDispatcher(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\SignalSlot\\\\Dispatcher'] ?? $this->getDispatcher2Service()));\n $instance->injectValidatorResolver(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Validation\\\\ValidatorResolver'] ?? $this->getValidatorResolverService()));\n $instance->injectViewResolver(($this->privates['TYPO3\\\\CMS\\\\Extbase\\\\Mvc\\\\View\\\\GenericViewResolver'] ?? $this->getGenericViewResolverService()));\n $instance->injectReflectionService(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Reflection\\\\ReflectionService'] ?? $this->getReflectionServiceService()));\n $instance->injectCacheService(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Service\\\\CacheService'] ?? $this->getCacheServiceService()));\n $instance->injectHashService(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Security\\\\Cryptography\\\\HashService'] ?? $this->getHashServiceService()));\n $instance->injectMvcPropertyMappingConfigurationService(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Mvc\\\\Controller\\\\MvcPropertyMappingConfigurationService'] ?? $this->getMvcPropertyMappingConfigurationServiceService()));\n $instance->injectEventDispatcher(($this->services['Psr\\\\EventDispatcher\\\\EventDispatcherInterface_decorated_1'] ?? $this->getEventDispatcherInterfaceDecorated1Service()));\n\n return $instance;\n }", "protected function getActionControllerService()\n {\n $instance = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstanceForDi(\\TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ActionController::class);\n\n $instance->injectConfigurationManager(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Configuration\\\\ConfigurationManager'] ?? $this->getConfigurationManagerService()));\n $instance->injectObjectManager(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Object\\\\ObjectManager'] ?? $this->getObjectManagerService()));\n $instance->injectSignalSlotDispatcher(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\SignalSlot\\\\Dispatcher'] ?? $this->getDispatcher2Service()));\n $instance->injectValidatorResolver(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Validation\\\\ValidatorResolver'] ?? $this->getValidatorResolverService()));\n $instance->injectViewResolver(($this->privates['TYPO3\\\\CMS\\\\Extbase\\\\Mvc\\\\View\\\\GenericViewResolver'] ?? $this->getGenericViewResolverService()));\n $instance->injectReflectionService(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Reflection\\\\ReflectionService'] ?? $this->getReflectionServiceService()));\n $instance->injectCacheService(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Service\\\\CacheService'] ?? $this->getCacheServiceService()));\n $instance->injectHashService(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Security\\\\Cryptography\\\\HashService'] ?? $this->getHashServiceService()));\n $instance->injectMvcPropertyMappingConfigurationService(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Mvc\\\\Controller\\\\MvcPropertyMappingConfigurationService'] ?? $this->getMvcPropertyMappingConfigurationServiceService()));\n $instance->injectEventDispatcher(($this->services['Psr\\\\EventDispatcher\\\\EventDispatcherInterface_decorated_1'] ?? $this->getEventDispatcherInterfaceDecorated1Service()));\n\n return $instance;\n }", "protected function getApp_Controller_MaterialControllerService()\n {\n return $this->services['App\\Controller\\MaterialController'] = new \\App\\Controller\\MaterialController();\n }", "private function getFileService()\n {\n $service = new FileService();\n\n return $service;\n }", "protected function getLoginControllerService()\n {\n $this->services['TYPO3\\\\CMS\\\\Backend\\\\Controller\\\\LoginController'] = $instance = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstanceForDi(\\TYPO3\\CMS\\Backend\\Controller\\LoginController::class, ($this->privates['TYPO3\\\\CMS\\\\Core\\\\Information\\\\Typo3Information'] ?? $this->getTypo3InformationService()), ($this->services['Psr\\\\EventDispatcher\\\\EventDispatcherInterface_decorated_1'] ?? $this->getEventDispatcherInterfaceDecorated1Service()), ($this->services['TYPO3\\\\CMS\\\\Backend\\\\Routing\\\\UriBuilder'] ?? $this->getUriBuilderService()), \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstanceForDi(\\TYPO3\\CMS\\Core\\Configuration\\Features::class));\n\n $instance->setLogger(($this->services['_early.TYPO3\\\\CMS\\\\Core\\\\Log\\\\LogManager'] ?? $this->get('_early.TYPO3\\\\CMS\\\\Core\\\\Log\\\\LogManager', 1))->getLogger('TYPO3\\\\CMS\\\\Backend\\\\Controller\\\\LoginController'));\n\n return $instance;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generates the name for the current proxy from a prefix and a counter.
public function getProxyName() { return MOCK_PROXY_PREFIX.(self::$num); }
[ "private static function _getNextVarName($prefix='var')\n {\n self::$_templateVarCounter++;\n $key = str_replace('::', '', self::$_currentTemplateKey);\n $name = $prefix.'_'.$key.'_'.self::$_templateVarCounter;\n return $name;\n\n }", "public function prefixName($prefix);", "protected function generateVarName($prefix = '')\n\t{\n\t\tif (!$this->var_uniq) {\n\t\t\t$this->var_uniq = substr(md5(mt_rand()), 1, 4);\n\t\t}\n\t\t$name = $this->var_uniq . (++$this->var_id);\n\t\treturn '$'.$prefix.'_'.$name;\n\t}", "protected function generateName()\n\t{\n\t\t$n = $this->cnt;\n\t\t$chars = '_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';\n\n\t\t// Increment the counter and skip over the digits range if the name would start with one\n\t\t$this->cnt += ($this->cnt % 63 < 52) ? 1 : 11;\n\n\t\t$varName = '$';\n\t\tdo\n\t\t{\n\t\t\t$varName .= $chars[$n % 63];\n\t\t\t$n = floor($n / 63);\n\t\t}\n\t\twhile ($n > 0);\n\n\t\treturn $varName;\n\t}", "public function getProxyName();", "public function variableName($prefix)\n {\n return '$' . $prefix . $this->variableCounter++;\n }", "public function buildPrefix();", "private function createCopyName() {\n\n $copySuffix = JText::_('COM_EASYSDI_SHOP_BASKET_COPY_ORDER_NAME_SUFFIX');\n $incrementSeparator = ' ';\n $pattern = '/.*' . $copySuffix . '(?:$|' . $incrementSeparator . '(\\d*)$)/';\n $matches = array();\n $matched = preg_match($pattern, $this->name, $matches, PREG_OFFSET_CAPTURE);\n\n //order name contains the copy suffix\n if ($matched) {\n if (count($matches) > 1) { //is third copy or more, change increment\n $newName = substr($this->name, 0, $matches[1][1]) . (((int) $matches[1][0]) + 1);\n } else { //is the second copy, add increment\n $newName = $this->name . $incrementSeparator . '2';\n }\n } else { //is the first copy\n $newName = $this->name . $copySuffix;\n }\n\n return $newName;\n }", "public function getPrefix(): string {\n\t\treturn implode( '', array_map( static function ( $part ) {\n\t\t\treturn ucfirst( $part );\n\t\t}, explode( '-', $this->wikiId ) ) );\n\t}", "private function prefix($string)\n {\n return $this->identifier . '_' . $string;\n }", "public function getPrefix () {}", "public function get_name_prefix() {\n return $this->get_person_name_field( 'prefix' );\n }", "public function getPrefix()\n {\n if (empty($this->prefix)) {\n return '';\n }\n\n return Format::personName($this->prefix);\n }", "protected function computeCredentialsName($prefix = null) {\n\t\tif (!$prefix) {\n\t\t\t$paths = $this->get('paths');\n\t\t\tif ($paths && isset($paths['default'])) {\n\t\t\t\t$prefix = $paths['default'];\n\t\t\t}\n\t\t}\n\t\tpreg_match('/([http:\\/\\/|https:\\/\\/|ssh:\\/\\/])*(\\w@)*([\\w\\.\\-_]{1,}+)/', $prefix, $prefix);\n\t\tif (count($prefix)) return end($prefix);\n\t\treturn basename($this->repository->getDir());\n }", "protected function prefixIt( $name_id ){\n if( substr( $name_id, -1 ) == '_' )\n $prefix = $name_id;\n else\n $prefix = $name_id . '_';\n return $prefix;\n }", "private function makeVar( $prefix ) {\n\t\tif ( ! isset( $this->vars[ $prefix ] ) ) {\n\t\t\t$this->vars[ $prefix ] = 0;\n\n\t\t\treturn '$' . $prefix;\n\t\t}\n\n\t\treturn '$' . $prefix . ++ $this->vars[ $prefix ];\n\t}", "protected function _getPrefix()\n {\n $prefix = $this->param('prefix');\n if (!$prefix) {\n return '';\n }\n $parts = explode('/', $prefix);\n\n return implode('/', array_map([$this, '_camelize'], $parts));\n }", "private function getPrefixedToken($prefix)\n {\n return uniqid($prefix);\n }", "private function _generatePrefix()\n {\n $str = null;\n $range = range('a', 'z');\n for($i = 0; $i != 4; $i++) {\n $c = rand(0, 23);\n $str .= $range[$c];\n }\n\n if (array_key_exists($str, $this->_prefix)) {\n $str = $this->_generatePrefix();\n } else {\n $this->_prefix[$str] = $str;\n }\n\n return $str;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ rewrites all tokens in a Twelf source code line to links
function processTwelfLine($line) { // TODO this regular expression needs improvement return ' ' . preg_replace_callback('/[^ \n\t.()0-9][^ \n\t.()]*/', create_function('$matches', 'return linkSymbol($matches[0]);'), $line); }
[ "public function linksToProxy()\n\t{\n\t\t$this->buffer = str_replace($this->links_from, $this->links_to, $this->buffer);\n\t}", "private function refill_line()\n\t{\n\t\t$attrs = '';\n\t\t// compile attributes\n\t\tforeach($this->attr as $type => $val)\n\t\t{\n\t\t\t$val = addslashes(trim($val));\n\t\t\t$attrs .= ($this->quotes == \"double\")\n\t\t\t\t\t? \" $type=\\\"$val\\\"\"\n\t\t\t\t\t: \" $type='$val'\";\n\t\t}\n\t\t$replace = array('[[KOHAML::ATTR]]', '&nbsp;');\n\t\t$fill = array($attrs, ' ');\n\t\t$this->line = str_replace($replace, $fill, $this->line);\n\t\t// replace php\n\t\tif ($this->php)\n\t\t{\n\t\t\tforeach($this->php as $php)\n\t\t\t{\n\t\t\t\t$this->line = preg_replace('/\\[\\[KOHAML::PHP\\]\\]/', $php, $this->line, 1);\n\t\t\t}\n\t\t}\n\t}", "function process(&$matches)\n {\n // when prefixed with !, it's explicitly not a wiki link.\n // return everything as it was.\n if ($matches[2][0] == '!') {\n return $matches[1] . substr($matches[2], 1) . $matches[3];\n }\n\n // set the options\n $options = array(\n 'page' => $matches[2],\n 'text' => $matches[2] . $matches[3],\n 'anchor' => $matches[3]\n );\n\n // create and return the replacement token and preceding text\n return $matches[1] . $this->addToken($options);\n }", "function put_links($text) {\r\n return preg_replace('#[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]#', '<a href=\"\\0\" rel=\"nofollow\">\\0</a>', $text);\r\n}", "function redlinks($_) {\n return preg_replace_callback(\"/<a href=\\\"?\\/([^'\\\">]+)\\\"?>/\", function($matches){\n if (is_link(filename($matches[1])))\n return $matches[0];\n else\n return preg_replace(\"/<a/\", \"<a class=redlink\", $matches[0]);\n }, $_);\n}", "function pnForum_undo_make_clickable($text)\n{\n\t$text = preg_replace(\"#<!-- BBCode auto-link start --><a href=\\\"(.*?)\\\" target=\\\"_blank\\\">.*?</a><!-- BBCode auto-link end -->#i\", \"\\\\1\", $text);\n\t$text = preg_replace(\"#<!-- BBcode auto-mailto start --><a href=\\\"mailto:(.*?)\\\">.*?</a><!-- BBCode auto-mailto end -->#i\", \"\\\\1\", $text);\n return $text;\n}", "public function highlightAndAddLineNumbers($sourceCode);", "public static function alterLinks()\n {\n //--------------------------------------------\n // BELOW IS A SNIPPET I USED TO ALTER THE UNIVERSE STRUCTURE...,\n // I KEEP IT AS A MEMO JUST IN CASE...\n //--------------------------------------------\n ini_set('max_execution_time', 0);\n $lingDir = \"/myphp/universe/Ling\";\n $files = YorgDirScannerTool::getFiles($lingDir, true);\n foreach ($files as $file) {\n $content = file_get_contents($file);\n if (preg_match('!https://github\\.com/karayabin/universe-snapshot/(tree|blob)/master/universe/([a-zA-Z0-9_]*)!', $content, $match)) {\n $newContent = preg_replace('!https://github\\.com/karayabin/universe-snapshot/(tree|blob)/master/universe/([a-zA-Z0-9_]*)!',\n 'https://github.com/karayabin/universe-snapshot/$1/master/universe/Ling/$2', $content);\n FileSystemTool::mkfile($file, $newContent);\n }\n }\n }", "function wikitext_named_url($line) {\n \t$line = substr($line, 1);\n \t$line = rtrim(chop($line), \"]\");\n \t$url = (preg_split(\"/\\s(?=([^\\\"]*\\\"[^\\\"]*\\\")*[^\\\"]*$)/\", $line))[0];\n \t$name = substr($line, strlen($url));\n \t?>\n \t<html>\n \t<a href=\"<?php $GLOBALS[\"endString\"] .= $url; ?>\"><?php $GLOBALS[\"endString\"] .= $name; ?></a>\n \t</html>\n \t<?php\n }", "function icph_links($content) {\n\t//$content = str_replace('href=\"' . site_url('/'), 'href=\"', $content);\n\t//$content = str_replace('href=\"', 'href=\"#', $content);\n\t$content = str_replace('href=\"' . site_url('/'), 'href=\"#', $content);\n\t$content = str_replace('href=\"#map_point/', 'href=\"#', $content);\n\treturn $content;\t\n}", "static function urlRewriter($content, $code) {\n\t\t$attribs = array(\"src\",\"background\",\"a\" => \"href\",\"link\" => \"href\", \"base\" => \"href\");\n\t\tforeach($attribs as $tag => $attrib) {\n\t\t\tif(!is_numeric($tag)) $tagPrefix = \"$tag \";\n\t\t\telse $tagPrefix = \"\";\n\n\t\t\t$regExps[] = \"/(<{$tagPrefix}[^>]*$attrib *= *\\\")([^\\\"]*)(\\\")/ie\";\n\t\t\t$regExps[] = \"/(<{$tagPrefix}[^>]*$attrib *= *')([^']*)(')/ie\";\n\t\t\t$regExps[] = \"/(<{$tagPrefix}[^>]*$attrib *= *)([^\\\"' ]*)( )/ie\";\n\t\t}\n\t\t$regExps[] = '/(background-image:[^;]*url *\\()([^)]+)(\\))/ie';\n\t\t$regExps[] = '/(background:[^;]*url *\\()([^)]+)(\\))/ie';\n\n\t\t// Make\n\t\t$code = 'stripslashes(\"$1\") . (' . str_replace('$URL', 'stripslashes(\"$2\")', $code) . ') . stripslashes(\"$3\")';\n\n\t\tforeach($regExps as $regExp) {\n\t\t\t$content = preg_replace($regExp, $code, $content);\n\t\t}\n\n\t\treturn $content;\n\t}", "function __makeClickableLinks($text) { \n\t\t$text = preg_replace(\"#(^|[\\n ])([\\w]+?://[\\w]+[^ \\\"\\n\\r\\t< ]*)#\", \"\\\\1<a rel=\\\"nofollow\\\" href=\\\"\\\\2\\\" target=\\\"_blank\\\">\\\\2</a>\", $text);\n\t\t$text = preg_replace(\"#(^|[\\n ])((www|ftp)\\.[^ \\\"\\t\\n\\r< ]*)#\", \"\\\\1<a rel=\\\"nofollow\\\" href=\\\"http://\\\\2\\\" target=\\\"_blank\\\">\\\\2</a>\", $text);\n\t\t$text = preg_replace(\"/@(\\w+)/\", \"<a rel=\\\"nofollow\\\" href=\\\"http://www.twitter.com/\\\\1\\\" target=\\\"_blank\\\">@\\\\1</a>\", $text);\n\t\t$text = preg_replace(\"/#(\\w+)/\", \"<a rel=\\\"nofollow\\\" href=\\\"?q=/tags/\\\\1\\\" target=\\\"_blank\\\">#\\\\1</a>\", $text);\n\t\t$text = preg_replace(\"/&gt;&gt;([0-9]+)\\b/i\", \"<a rel=\\\"nofollow\\\" href=\\\"#\\\\1\\\" >>>\\\\1</a>\", $text);\n\t\t//$text = preg_replace(\"/\\/\\/(\\w+)/\", \"<span style='color:green;font-style:bold;'>//\\\\1</span>\", $text);\n\t\treturn $text; \n\t}", "function hook_tokens($type, $tokens, array $data = array(), array $options = array()) {\n $url_options = array('absolute' => TRUE);\n if (isset($options['language'])) {\n $url_options['language'] = $options['language'];\n $language_code = $options['language']->language;\n }\n else {\n $language_code = NULL;\n }\n $sanitize = !empty($options['sanitize']);\n\n $replacements = array();\n\n if ($type == 'node' && !empty($data['node'])) {\n $node = $data['node'];\n\n foreach ($tokens as $name => $original) {\n switch ($name) {\n // Simple key values on the node.\n case 'nid':\n $replacements[$original] = $node->nid;\n break;\n\n case 'title':\n $replacements[$original] = $sanitize ? check_plain($node->title) : $node->title;\n break;\n\n case 'edit-url':\n $replacements[$original] = url('node/' . $node->nid . '/edit', $url_options);\n break;\n\n // Default values for the chained tokens handled below.\n case 'author':\n $name = ($node->uid == 0) ? variable_get('anonymous', t('Anonymous')) : $node->name;\n $replacements[$original] = $sanitize ? filter_xss($name) : $name;\n break;\n\n case 'created':\n $replacements[$original] = format_date($node->created, 'medium', '', NULL, $language_code);\n break;\n }\n }\n\n if ($author_tokens = token_find_with_prefix($tokens, 'author')) {\n $author = user_load($node->uid);\n $replacements += token_generate('user', $author_tokens, array('user' => $author), $options);\n }\n\n if ($created_tokens = token_find_with_prefix($tokens, 'created')) {\n $replacements += token_generate('date', $created_tokens, array('date' => $node->created), $options);\n }\n }\n\n return $replacements;\n}", "private function expandLinksAndImages ($line) {\n\n //--recognize href or image--------\n $pattern = '|^(!?)\\[(\\s*?.+?\\s*?)\\]\\s*?\\((\\s*?.+?\\s*?)\\)\\s*?(\\{.*\\})?|m'; // [ link name ] ( link_url )\n\n $line = preg_replace_callback($pattern, \n function ($matches){\n $is_image = FALSE;\n $class = '';\n $caption = '';\n $title = '';\n $href = '';\n $image_link = '';\n $id = '';\n $pattern = '|\\s*\\{(.*?)\\}|';\n if ($matches[1] === '!') {\n $is_image = TRUE;\n }\n $title = $matches[2];\n $href = $matches[3];\n\n //--process any brace-delimited options-------------\n if (isset($matches[4])) { // brace delimited text\n preg_match_all($pattern,$matches[4],$options);\n foreach($options[1] as $option) { // brace delimited text\n $option = trim($option);\n $pattern = '|^(\\w*)([.#:=])(.*)|'; // [verb] <separator> <value> \n preg_match($pattern,$option,$spec);\n $verb = trim(strtolower($spec[1]));\n if ($spec[2] === '.') {\n $verb = 'class';\n }\n if ($spec[2] === '#') {\n $verb = 'id';\n }\n $value = trim($spec[3]);\n if ($verb === 'caption') {\n $caption = $value;\n }\n if ($verb === 'href') {\n $href = $value;\n }\n if ($verb === 'class') {\n $value = str_replace('.', '', $value);\n $class = $value;\n }\n if ($verb === 'id') {\n $value = str_replace('#', '', $value);\n $id = $value;\n }\n }\n }\n \n //--class and id clauses---------\n $class_and_id = '';\n if ($class) {\n $class_and_id = 'class=\"' . $class . '\" ';\n }\n if ($id) {\n $class_and_id = 'id=\"' . $id . '\" ';\n }\n\n //--construct html for image or link\n $html = '';\n if ($is_image) {\n $html .= \"<figure $class_and_id>\\n\";\n $html .= \" <img src=\\\"$href\\\" alt=\\\"$title\\\" />\\n\";\n if (!$caption) {\n $caption = $title;\n }\n if ($caption) {\n $html .= \" <figcaption>$caption</figcaption>\\n\";\n }\n $html .= \"</figure>\\n\";\n } else {\n $html .= \"<a href=\\\"$href\\\" $class_and_id>$title</a>\\n\"; \n }\n return ($html);\n },\n $line\n );\n\n return ($line);\n }", "public function lanman_link_callback($matches) {\n $x0 = $matches[0];\n $n0 = $matches[1]; # lan,16,4 or wg,1235\n $txt = $matches[2]; # text of <ls> tag}\n $parts = explode(\",\",$n0);\n if ($parts[0] == \"lan\") {\n $page = $parts[1];\n $linenum = $parts[2];\n $url = 'https://www.sanskrit-lexicon.uni-koeln.de/scans/csl-apidev/servepdf.php?dict=LAN'; #&page=111-a\n # This ampersand causes problems in basicdisplay parsing!\n #$href = \"$url\" . \"&page=$page\";\n $href = \"$url\" . \"_page=$page\";\n # It is useful to also have the line number visible in the url of the displayed url\n $href = \"$href\" . \"_line=$linenum\";\n $tooltip = \"Lanman Sanskrit Reader, page $page, line $linenum\";\n $x = \"<lanlink href='$href' n='$tooltip' target='_lanlink'>$txt</lanlink>\";\n }else if ($parts[0] == \"wg\") {\n // https://funderburkjim.github.io/WhitneyGrammar/step1/pages2c.html#section_1234\n $section = $parts[1];\n $url = 'https://funderburkjim.github.io/WhitneyGrammar/step1/pages2c.html';\n $href = \"$url#section_$section\";\n $tooltip = \"Whitney Grammar, section $section\";\n $x = \"<lanlink href='$href' n='$tooltip' target='_wglink'>$txt</lanlink>\";\n }else { // $n0 mal-formed\n $x = $x0; // return unchanged\n }\n return $x;\n}", "function highlight_source($file) {\n // TODO: highlight sources of different languages (besides PHP)\n\n //Strip code and first span\n $src = _highlight_file2($file, true);\n $code = substr($src[1], 36, -12);\n //Split lines\n $lines = explode('<br />', $code);\n //Count\n $lineCount = count($lines);\n //Calc pad length\n $padLength = strlen($lineCount);\n \n //Loop lines\n $out = '';\n foreach($lines as $i => $line) {\n //Create line number\n $lineNumber = str_pad($i + 1, $padLength, '0', STR_PAD_LEFT);\n //Print line\n $out .= sprintf('<br><span class=\"num\">%s</span><span>%s</span>', $lineNumber, $line);\n }\n\n //Re-Print the code and span again\n echo $src[0] .'<code><span style=\"color:#000\">'. substr($out, 4) .'</span></code>';\n}", "function run_inline($line) {\n $snippets = $this->snippets;\n # inline Raw, Mono, Tagged\n if(preg_match_all('/(\\'|\"|`){2}([^\\\\s](.*?[^\\\\s])?\\\\1*)\\\\1\\\\1/', $line, $m, PREG_SET_ORDER)) {\n foreach($m as $a) {\n $type = $a[1].$a[1];\n $c = $this->PSS($a[2]);\n $tmp = $this->closeRTV($type, $c);\n $line = preg_replace('/(\\'|\"|`){2}([^\\\\s](.*?[^\\\\s])?\\\\1*)\\\\1\\\\1/', $tmp, $line, 1);\n }\n }\n # macros\n $line = $this->run_macros($line);\n \n # <[img]>\n $imgrx = \"\\\\[([\\034\\\\w_,.+%$#@!?+~\\\\/-]+\\\\.(?:png|jpe?g|gif|bmp))\\\\]\";\n \n $line = preg_replace(\"/^$imgrx(?=.)/ei\",\n \"\\$this->Keep(sprintf(\\$snippets['img'], 'left', '$1'))\", $line);\n $line = preg_replace(\"/(?<=.)$imgrx$/ei\",\n \"\\$this->Keep(sprintf(\\$snippets['img'], 'right', '$1'))\", $line);\n \n \n $line = preg_replace(\"/$imgrx/ei\",\n \"\\$this->Keep(sprintf(\\$snippets['img'], 'middle', '$1', 'middle'))\", $line);\n \n $UEX = '<>\"{}|\\\\\\\\^`()\\\\[\\\\]\\''; # UrlExcludeChars\n $PRT = '(?:https?|ftp|news|telnet|gopher|wais|mailto):';\n \n $Links = array(\n \"{$PRT}[^\\\\s$UEX]+\" =>'',\n \"www\\\\d?\\\\.[^\\\\s$UEX]+\" =>'http://', # lazy links\n \"ftp\\\\d?\\\\.[^\\\\s$UEX]+\" =>'ftp://', # lazy links\n \"\\\\w[\\\\w.-]+@[\\\\w-.]+[^\\\\s$UEX]+\" =>'mailto:', # lazy links\n ); # \n \n # [txt link], [txt #anchor]\n foreach($Links as $k=>$v) {\n $line = preg_replace(\"/\\\\[([^\\\\]]+?) +($k)\\\\]/ei\", \n \"\\$this->Keep(sprintf(\\$snippets['link'], \\$this->esc('$v$2'), \\$this->esc('$1', 1)))\", $line);\n }\n # local links\n $line = preg_replace(\"/\\\\[([^\\\\]]+?) +([^\\\\s$UEX]+)\\\\]/ei\", \n \"\\$this->Keep(sprintf(\\$snippets['link'], \\$this->esc('$2'), \\$this->esc('$1', 1)))\", $line);\n \n # free links www.link, e@mail, http://link\n foreach($Links as $k=>$v) {\n if($v=='mailto:' && $this->maskemail) {\n $line = preg_replace(\"/\\\\b({$k}[^\\\\s.,?!$UEX])/ei\",\n \"\\$this->Keep('&lt;' . str_replace(array('@', '.'), array(' (a) ', ' '), '$1') . '&gt;$2')\", $line);\n }\n else\n $line = preg_replace(\"/\\\\b({$k}[^\\\\s.,?!$UEX])/ei\", \n \"\\$this->Keep(sprintf(\\$snippets['link'], \\$this->esc('$v$1'), \\$this->esc('$1')))\", $line);\n }\n \n $line = $this->esc($line);\n \n # Bold, Italic, Underline, Strike\n $b = array('*', '/', '_', '-');\n foreach($b as $c) {\n $q = preg_quote($c, '/');\n $line = preg_replace(\"/($q){2}([^\\s](?:.*?\\\\S)?\\\\1*)\\\\1\\\\1/e\", \n \"sprintf(\\$snippets['$c$c'], \\$this->PSS('$2'))\", $line);\n }\n return $line;\n }", "protected function parseReferenceLinks()\n\t{\n\t\t$labels = $this->getLabels();\n\t\tforeach ($labels as $startPos => $id)\n\t\t{\n\t\t\t$labelPos = $startPos + 2 + strlen($id);\n\t\t\t$endPos = $labelPos - 1;\n\t\t\t$endLen = 1;\n\n\t\t\tif ($this->text->charAt($labelPos) === ' ')\n\t\t\t{\n\t\t\t\t++$labelPos;\n\t\t\t}\n\t\t\tif (isset($labels[$labelPos], $this->text->linkReferences[$labels[$labelPos]]))\n\t\t\t{\n\t\t\t\t$id = $labels[$labelPos];\n\t\t\t\t$endLen = $labelPos + 2 + strlen($id) - $endPos;\n\t\t\t}\n\t\t\tif (isset($this->text->linkReferences[$id]))\n\t\t\t{\n\t\t\t\t$this->addLinkTag($startPos, $endPos, $endLen, $this->text->linkReferences[$id]);\n\t\t\t}\n\t\t}\n\t}", "function update_relative_links($new_id, $orig_id) {\n\t global $orig_namespace, $openas_debug;\n\t\t$orig_namespace = rtrim(getNS($orig_id),':') . ':';\t\t\t\n\t\t$openas_debug = $this;\n $current_wikifn=wikiFN($new_id);\n\t\t$data = io_readFile($current_wikifn);\n\t\t$metafn=$this->metaFilePath($orig_id,'orig');\n\t\n\t\tio_saveFile($metafn,$data);\t\n\n\t $data = preg_replace_callback('/\\[\\[(.*?)\\]\\]/', \n\t\t create_function(\n\t\t\t '$matches',\n\t\t\t 'global $openas_debug,$orig_namespace;\t\t \t\t\t \n\t\t\t $link_array = explode(\"|\",$matches[1]);\t\t \n\t\t\t $c_link = $link_array[0];\t\t\t\t\t\t \n\t\t\t $link_text = isset($link_array[1]) ? $link_array[1] : \"\"; \n\t\t\t resolve_pageid($orig_namespace,$c_link,$c_exists);\n\t\t\t if($c_exists) {\n\t\t\t\t return \"[[:$c_link|$link_text]]\";\n\t\t\t }\n\t\t\t return $matches[0];'\n\t\t )\t,\n\t\t$data\n\t\t);\n\n\t\t$dir = dirname($current_wikifn);\t\t\n\t $fname = basename($current_wikifn, '.txt');\t\n\t\t$path = \"$dir/$fname\" . $this->ext;\n\t\tio_saveFile($path,$data);\t\n\t \t\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
multiplica todos os valores do array
public function mult() { return array_product($this->valores); }
[ "function array_product (array $array) {}", "function array_product ($arg) {}", "function valueTimesArray($v1,$value){\n\n $p[0]=$v1[0]*$value;\n $p[1]=$v1[1]*$value;\n $p[2]=$v1[2]*$value;\n\n return $p;\n}", "function multi($a){\n\t$acu = 1;\n\t\tforeach($a as $v){\n\t\t\t$acu *= $v;\n\t\t}\n\techo \"La multiplicación vale $acu\";\n\t}", "function multiply($num, $multiple){\n $new_array= array();\n foreach ($num as $number) {\n array_push($new_array, $number * $multiple);\n }\n return $new_array;\n}", "public function array_product() {\n return array_product($this->_array);\n }", "function prpductoMatrizEscalar($matriz,$escalar) {\n $matxesc = array();\n \n foreach ($matriz as $row_key => $row) {\n foreach ($row as $column_key => $element) {\n $matxesc[$row_key][$column_key] = $escalar*$element;\n }\n }\n return $matxesc; \n}", "public function produto(array $array)\n\t{\n\t\treturn array_product($array);\n\t}", "public static function multiply($values) {\n\t\treturn array_product($values);\n\t}", "function mmult($a, $m) {\n foreach ($a as $i=>$v) {\n $a[$i] = $v*$m;\n }\n return $a;\n}", "public function mult(array $real0, array $real1): array;", "function mezclar ( $altura, $apellido, $nombre){\n\t\t\t\t//busco el mayor tamaño de todos los arrays\n\t\t\t\t$maximo = max(sizeof($altura), sizeof($apellido),sizeof($nombre));\n\t\t\t\t$union =array( );\n\t\t\t\tfor ($i=0; $i<= $maximo-1; $i++){\n\t\t\t\t\t$union[$i][0] = $altura[$i];\n\t\t\t\t\t$union[$i][1] = $apellido[$i];\n\t\t\t\t\t$union[$i][2] = $nombre[$i];\n\t\t\t\t}\n\t\t\t\treturn $union;\n\t\t\t}", "protected function processArrays(): void\n\t{\n\t\tforeach($this->values as $placeholder => $list)\n\t\t{\n\t\t\tif($list instanceof ArrayDataProvider)\n\t\t\t{\n\t\t\t\t$this->initDomDocument();\n\t\t\t\t$block = $this->collectMultiplyNodes($placeholder);\n\t\t\t\twhile(isset($block['content']) && !empty($block['content']))\n\t\t\t\t{\n\t\t\t\t\t$this->processMultiplyingBlock($list, $placeholder, $block);\n\t\t\t\t\t$block = $this->collectMultiplyNodes($placeholder);\n\t\t\t\t}\n\t\t\t\t$this->saveContent();\n\t\t\t}\n\t\t}\n\t}", "function M_multiplication_entrywise($vector_0,$vector_1)\r\n{\r\n $result = [];\r\n foreach ($vector_0 as $key => $value)\r\n {\r\n $result[$key] = $vector_0[$key]*$vector_1[$key];\r\n }\r\n\r\n return $result;\r\n}", "public function dataProviderForMultiply() {\n\t\treturn array(\n\t\t\tarray(1, 1, 1),\n\t\t\tarray(-1, -1, 1),\n\t\t\tarray(0, 0, 0),\n\t\t\tarray(2, 2, 1),\n\t\t\tarray(8, 2, 4),\n\t\t);\n\t}", "function matrice_product($array=[], $array2=[]){\n $array3=[];\n\n $ligne=count($array);\n $colonne=count($array[0]);\n $colonne2=count($array2);\n $ligne2=count($array2[0]);\n\n if($colonne != $ligne2){ // previens si les matrices ne sont pas compatibles\n echo(\"matrices incompatibles \");\n exit;\n }\n \n for($lignei=0; $lignei<$ligne ; $lignei++){ // fait le produit matriciel (pour plus d'info: \"https://fr.wikipedia.org/wiki/Produit_matriciel\")\n for($colonne2i=0; $colonne2i<$colonne ; $colonne2i++){\n $array3[$lignei][$colonne2i]=0;\n for($j=0; $j<$colonne2 ; $j++){\n $array3[$lignei][$colonne2i]+=$array[$lignei][$j]*$array2[$j][$colonne2i];\n }\n }\n }\n\n\n return $array3;\n}", "function get_mult_set($a_cols, $a_vals, $simb=',', $sign='=', $comillas=true){\n\t$temp='';\n\tfor($x=0;$x<count($a_cols);$x++){\n\t\tif($temp!='') $temp.=\" $simb \";\n\t $temp.= get_simp_set($a_cols[$x],$a_vals[$x], $sign, $comillas);\n\t}\n\treturn $temp;\n}", "function productOfAllOthers(array $numbers)\r\n{\r\n $result = [];\r\n \r\n foreach ($numbers as $key => $number) {\r\n\r\n $temp = $numbers;\r\n \r\n unset($temp[$key]);\r\n \r\n $result[] = array_product($temp);\r\n \r\n }\r\n\r\n return $result;\r\n}", "public function executeArrayMultiply($request)\r\n {\r\n $this->result = 1;\r\n\r\n foreach($request->getParameter('factors') as $factor)\r\n {\r\n $this->result *= $factor;\r\n }\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Deletes a specified board message from the database. Note that the message will be deleted only if this user is the message's writer.
public function DeleteBoardMessage($messageId) { // We'll need the message number later if ($result = $this->_db->ExecuteStmt(Statements::SELECT_USER_BOARD_MESSAGE_NUMBER, $this->_db->BuildStmtArray("i", $messageId))) { $row = $result->fetch_assoc(); $messageNumber = $row['message_number']; } else return false; // We must update the message's numbers in order to maintain the structure used to obtain the messages. if ($this->_db->ExecuteStmt(Statements::UPDATE_USER_BOARD_MESSAGE_NUMBERS, $this->_db->BuildStmtArray("ii", $this->GetId(), $messageNumber))) { // Note that we don't need to delete the related rows in tables like user_board_replies // because the FK has the ON DELETE CASCADE and ON UPDATE CASCADE properties. This rows are going to be deleted automatically. // Also note that the operation that checks that the user is the writer of the message is in the SQL statement itself. if ($this->_db->ExecuteStmt(Statements::DELETE_USER_BOARD, $this->_db->BuildStmtArray("ii", $messageId, $this->GetId()))) return true; } return false; }
[ "public function delete() {\r\n\t\tImperator::getDatabaseManager()->getChatTable()->deleteMessage($this);\r\n\t}", "public function delete()\n {\n $db = $_SESSION[\"database\"];\n $db->delete(\"ChatMessage\", \"MessageID = '$this->id'\");\n }", "protected function deleteMessage( $message ) {\n\t\tPendingDatabase::get()\n\t\t\t->deleteMessage( $message );\n\t}", "public function deleteMessage()\n {\n $m = Message::get($this->m_id);\n\n $m->delete();\n\n global $conn;\n\n $sql = \"UPDATE `reports` SET `flags` = flags | (1 << 1) WHERE `r_id` = '\" . $conn->real_escape_string($this->r_id) . \"'\";\n $conn->query($sql);\n }", "public function deleted(Board $board)\n {\n //\n }", "public function deleteMessage()\n {\n }", "public static function deleteBoard($boardId) {\n//delete board\n DatabaseConnector::query('DELETE FROM boards WHERE ID = :boardId',array(':boardId'=>$boardId));\n //delete board items\n DatabaseConnector::query('DELETE FROM board_items WHERE board_id=:boardId', array(':boardId'=>$boardId));\n}", "public function deleted(ChatMessage $chatMessage)\n {\n //\n }", "public function deleteMessage($messageHash){\n\t\t//Delete message from the database\n\t\tif($this->db->delete('messages', array('messageHash' => $messageHash))){\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function deleteMessage( $message ) {\n\t\tif ( !isset( $message['order_id'] ) ) {\n\t\t\tthrow new RuntimeException( 'Message doesn\\'t have an order_id!' );\n\t\t}\n\n\t\t$prepared = self::$db->prepare( '\n\t\t\tdelete from pending\n\t\t\twhere gateway = :gateway\n\t\t\t\tand order_id = :order_id' );\n\t\t$prepared->bindValue( ':gateway', $message['gateway'], PDO::PARAM_STR );\n\t\t$prepared->bindValue( ':order_id', $message['order_id'], PDO::PARAM_STR );\n\t\t$prepared->execute();\n\t}", "public function deleteMessages(): void\n {\n $this->messages()->delete();\n }", "public function delete() {\n $this->deleteAssociations('Author2Message');\n $this->deleteAssociations('User2UnreadMessage');\n $this->getDataComponent()->deleteObject($this);\n }", "public function deleteMessage(Zend_Queue_Message $message)\n {\n \treturn $this->_pheanstalk->delete($message->handle);\n }", "public function deleteMessage()\n {\n // need to delete the message from the server?\n if (!$this->info['ema_leave_copy']) {\n imap_delete($this->mbox, $this->num);\n } else {\n // mark the message as already read\n imap_setflag_full($this->mbox, $this->num, '\\\\Seen');\n }\n }", "public function deleteMessage( array $message ) {\n\t\tif ( !isset( $message['order_id'] ) ) {\n\t\t\t$json = json_encode( $message );\n\t\t\tLogger::warning( \"Trying to delete pending message with no order id: $json\" );\n\t\t\treturn;\n\t\t}\n\n\t\t$sql = '\n\t\t\tdelete from pending\n\t\t\twhere gateway = :gateway\n\t\t\t\tand order_id = :order_id';\n\t\t$params = [\n\t\t\t'gateway' => $message['gateway'],\n\t\t\t'order_id' => $message['order_id'],\n\t\t];\n\n\t\t$this->prepareAndExecute( $sql, $params );\n\t}", "public function DBdelete(Request $request) {\n // gets requested message entry\n $row = Message::find($request['message_id']);\n\n // deletes entry if found\n if ($row != NULL) {\n $row->delete();\n }\n\n // redirects with success\n return redirect('messages')->with('success', 'Message successfully deleted');\n }", "public function deleteMessage(array $data): void\n {\n $uri = 'chats/messages/delete-message';\n $required = [\n 'channel' => self::TYPE_STRING,\n 'id' => self::TYPE_STRING,\n ];\n $this->throwIfInvalid($required, $data);\n\n $this->client->post($this->buildUrl($uri), $data);\n }", "function delteboard()\n {\n $user = JFactory::getUser();\n $id_user = $user->id;\n $id_b = JRequest::getInt('id_board');\n $db = JFactory::getDbo();\n $sql = \"delete from #__tz_pinboard_boards where id =$id_b AND created_user_id =$id_user\";\n $db->setQuery($sql);\n $db->query();\n }", "public function deleteMessage(Zend_Queue_Message $message) {\n $headers = (4 === func_num_args()) ? (array) func_get_arg(3) : array();\n $this->connect();\n $frame = $this->getDeleteFrame($message, $headers);\n $this->getStompClient()->send($frame);\n\n return true;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Whether current handler can handle provided alert.
public function can_handle( Alert $alert ) { return in_array( $alert->get_type(), [ Alerts::FAILED_EMAIL ], true ); }
[ "public function hasAlert()\n {\n return isset($this->alert);\n }", "public function is_allowed($alert_identifier)\n {\n }", "public function getHasAlert()\n {\n return $this->has_alert;\n }", "public function hasHandler()\n {\n }", "public function isAlertPresent(): bool\n {\n return $this->getAlertMessage() !== null;\n }", "public function isAlertPresent()\n {\n try {\n $this->browser->getAlertText();\n return true;\n } catch (\\Exception $e) {\n return false;\n }\n }", "public function canHandle()\n {\n }", "public function hasHandlers(?string $eventType = null): bool;", "public function hasHandler()\n {\n return (bool) $this->handler;\n }", "public function hasHandler(): bool{\n return isset($this->_handler) && $this->_handler !== null;\n }", "public function hasHandler(): bool\n {\n return app()->make('slack.slash.commander')->hasHandler($this->getCommand());\n }", "public function isPriceAlertAllowed()\n {\n return $this->scopeConfig->isSetFlag(\n \\Magento\\ProductAlert\\Model\\Observer::XML_PATH_PRICE_ALLOW,\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }", "public function hasHandler(): bool\n {\n return $this->handler !== null;\n }", "function IsAlert($type) {\r\n return (is_array($_SESSION[$type]) && count($_SESSION[$type]) > 0);\r\n }", "protected function hasHandlers(): bool\n {\n return !empty(config('resumablejs.handlers', false));\n }", "public function canHandleRequest()\n {\n return isset($_GET['Ecodev\\\\Newsletter\\\\ExtDirectRequest']);\n }", "public function canSendAlertEmails() {\n if(null !== $this->accepted_alerts_date && $this->accepted_alerts_date instanceof \\DateTime) {\n return true;\n }\n return false;\n }", "public function issetAjaxAlert()\r\n {\r\n \treturn (boolean) $this->ajaxAlert;\r\n }", "protected function isHandler($object, $event)\n {\n return true;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check equivalent rate weekly or anual.
public function checkEquivalentRate($type) { return $this->settings->value('TASA_ANUAL') / ('Q' == $type ? 52.143 : 12) / 100; }
[ "private function _checkRatePAY()\n {\n return $this->_checkCurrency() && $this->_checkCountry() && !$this->_checkDenied() && $this->_checkAge();\n }", "function checkSpecialRateValidate($data)\r\n {\r\n if(isset($data['BankID'])&&!unsigned($data['BankID'])) return 13065;\r\n if(isset($data['StockID'])&&!unsigned($data['StockID'])) return 13072;\r\n if(isset($data['FromValue'])&&(strlen($data['FromValue'])>0)&&!numeric($data['FromValue'])) return 13066;\r\n if(isset($data['ToValue'])&&(strlen($data['ToValue'])>0)&&!numeric($data['ToValue'])) return 13067;\r\n if(isset($data['FromValue']) && (isset($data['ToValue'])) && ($data['FromValue']>$data['ToValue'])) return 13073;\r\n if(isset($data['PercentRate'])&&(strlen($data['PercentRate'])>0)&&!numeric($data['PercentRate'])) return 13068;\r\n if(isset($data['UseMarketPrice'])&&(strlen($data['UseMarketPrice'])>0)&&!numeric($data['UseMarketPrice'])) return 13069;\r\n if(isset($data['CreatedBy']) &&!required($data['CreatedBy'])) return 13070;\r\n if(isset($data['UpdatedBy']) &&!required($data['UpdatedBy'])) return 13071;\r\n return 0;\r\n }", "public function updateCurrencyBaseRate()\n {\n return !in_array($this->sales_stage, $this->getClosedStages());\n }", "public function testRate(){\n $util = new Utilities();\n $rate = $util->getRate('GBP');\n $this->assertEquals(round($rate,1),round('0.9012',1));\n }", "public function hasRates()\n {\n return $this->getInvoker()->getNbRates() > 0;\n }", "function wct_is_user_profile_rates() {\n\treturn (bool) apply_filters( 'wct_is_user_profile_rates', wct_get_global( 'is_user_rates' ) );\n}", "private function isRated()\n\t{\n\t\t$rate = $this->rates()->find( Request()->user()->id);\n\t\treturn $rate ? $rate->pivot->rate : 0;\n\t}", "public function canRate()\n {\n \tif ($this->canRead() \n \t\t&& SimpleForumTools::checkAccess($this->topic()->forumNode(), 'response', 'rate'))\n \t{\n \t\treturn true;\n \t}\n \t\n \treturn false;\n }", "public function testAffirm()\n {\n $this->exchangeDao->updateRate('GBP', 1, time()-(60 * 60 * 3));\n $this->assertTrue($this->ratesService->affirmRate('GBP'));\n $this->assertFalse($this->ratesService->affirmRate('GBP'));\n \n $this->exchangeDao->updateRate('GBP', 1, time()-(60 * 60 * 1));\n $this->assertFalse($this->ratesService->affirmRate('GBP'));\n \n $this->ratesService->updateRate('GBP');\n }", "private static function has_tax_rate() {\r\n\t\tglobal $wpdb;\r\n\r\n\t\t$wootax_rate_id = get_option( 'wootax_rate_id' ); // WT_RATE_ID is not defined yet when this method is executed\r\n\r\n\t\tif ( !$wootax_rate_id ) {\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\t$name = $wpdb->get_var( \"SELECT tax_rate_name FROM {$wpdb->prefix}woocommerce_tax_rates WHERE tax_rate_id = $wootax_rate_id\" );\r\n\r\n\t\t\tif ( empty( $name ) ) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\t\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}", "public function calculateValuation(): bool\n {\n return 0;\n }", "function filter_post_rate($a) {\n\t\tif (isset($a['PostRate'])) {\n\t\t\tif ($a['PostRate'] == $this->num) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}", "function APR($nper, $rate) {\n\t\n\t\tif ($nper <= 0) {\n\t\t\ttrigger_error(\"compunding periods must be > 0\");\n\t\t\treturn FALSE;\n\t\t}\n\t\t\t\n\t\treturn (float) (pow ( 1 + (($rate*0.01)/$nper) , $nper) - 1);\n\t\t\n\t}", "public function RATE($nper, $apr) {\n \n if ($nper <= 0) {\n trigger_error(\"compunding periods must be > 0\");\n return FALSE;\n }\n \n return (float) (pow( 1 + ($apr*0.01) , 1/$nper) - 1) ;\n \n }", "function enableInputPayRates($rateid)\n\t{\n\t\tglobal $db;\n\t\t$returnVal = true;\n\t\t$queJO = \"SELECT COUNT(1) FROM multiplerates_joborder WHERE ratemasterid = '\".$rateid.\"' AND status = 'ACTIVE'\";\n\t\t$resJO = mysql_query($queJO,$db);\n\t\t$resJO = mysql_fetch_row($resJO);\n\t\t\n\t\t$queASG = \"SELECT COUNT(1) FROM multiplerates_assignment WHERE ratemasterid = '\".$rateid.\"' AND status = 'ACTIVE'\";\n\t\t$resASG = mysql_query($queASG,$db);\n\t\t$resASG = mysql_fetch_row($resASG);\n\t\t\n\t\tif($resJO[0] > 0 || $resASG[0] > 0){\n\t\t\t$returnVal = false;\n\t\t}\n\t\treturn $returnVal;\n\t}", "public function isVatRateCurrentlyApplicable($vat_rate_commencement_date,$order_id,$product_id){\n //get the date when this order was done\n $order_date = getdate(strtotime($this->getTheDateOfThisOrder($order_id,$product_id)));\n $date_vat_commenced = getdate(strtotime($vat_rate_commencement_date));\n \n if(($order_date['year'] - $date_vat_commenced['year'])>0){\n return true;\n }else if(($order_date['year'] - $date_vat_commenced['year'])<0){\n return false;\n }else{\n if(($order_date['mon'] - $date_vat_commenced['mon'])>0){\n return true;\n }else if(($order_date['mon'] - $date_vat_commenced['mon'])<0){\n return false;\n }else{\n if(($order_date['mday'] - $date_vat_commenced['mday'])>0){\n return true;\n }else if(($order_date['mday'] - $date_vat_commenced['mday'])==0){\n return true;\n }else{\n return false;\n }\n }\n }\n \n \n }", "public function showRate() {\n return $this->getRatingStatus() != AW_Vidtest_Model_System_Config_Source_Rating::STATUS_DISABLED;\n }", "public function frequencyIsWeekly()\n {\n return $this->frequency == Frequencies::WEEKLY;\n }", "private function obtain_valid_rate($iso_currency) {\n\t\t$iso_rate = False;\n\n\t\t// We could totally cache this call...\n\t\t$result = $this->mysql_conn->query(sprintf(\"SELECT curdate(), validasof, rate FROM exchange_rates WHERE currency='%s' ORDER BY validasof DESC LIMIT 1;\",\n\t\t\t\t\t\t\t\t$this->mysql_conn->real_escape_string($iso_currency)));\n\t\t\n\t\t\n\t\tif (($result != False) && ($result->num_rows == 1)) {\n\t\t\t// Data was returned!\n\t\t\t$data = $result->fetch_row();\n\t\t\tif (($data[0] != $data[1]) && ($this->rates_gather_failed == False))\n\t\t\t{\n\t\t\t\t// Stale data! ARGHHH, get new data...\n\t\t\t\t$new_rates = $this->query_rate_server();\n\t\t\t\t$this->store_rate_results($new_rates);\n\n\t\t\t\t// Is our rate in this new data?\n\t\t\t\tif (array_key_exists($iso_currency, $new_rates)) {\n\t\t\t\t\t$iso_rate = $new_rates[$iso_currency];\n\t\t\t\t} else {\n\t\t\t\t\t// We shall have to use the old rate\n\t\t\t\t\t$iso_rate = $data[2];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Data in database is new enough to use\n\t\t\t\t$iso_rate = $data[2];\n\t\t\t}\n\t\t} else {\n\t\t\t// No data :( but can we get data?\n\t\t\t$new_rates = $this->query_rate_server();\n\t\t\t$this->store_rate_results($new_rates);\n\n\t\t\tif (array_key_exists($iso_currency, $new_rates)) {\n\t\t\t\t$iso_rate = $new_rates[$iso_currency];\n\t\t\t}\n\t\t}\n\n\t\t// If we're here, we either have a valid rate, or the rate is still false\n\t\tif (($iso_rate == False) && ($this->rates_gather_failed == False)) {\n\t\t\t$rates_gather_failed = time();\n\t\t} elseif (($iso_rate != False) && ($this->rates_gather_failed != False) && ($rates_gather_failed < (time() - 60))) {\n\t\t\t// Reset the fail flag, 60 seconds have passed and we have valid data!\n\t\t\t$this->rates_father_failed = False;\n\t\t}\n\t\t\n\t\treturn $iso_rate;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a `VectorInterface` containing the values of the current `VectorInterface` that meet a supplied condition applied to its keys and values. Only keys and values that meet a certain criteria are affected by a call to `filterWithKey()`, while all values are affected by a call to `mapWithKey()`. The keys associated with the current `VectorInterface` remain unchanged in the returned `VectorInterface`; the keys will be used in the filtering process only.
public function filterWithKey(Closure $fn): VectorInterface;
[ "public function filter(Closure $fn): VectorInterface;", "public function mapWithKey(Closure $fn): VectorInterface;", "public function where(callable $condition): IEnumerable;", "public function values(): MutableVectorInterface;", "public function getBy($condition);", "public function addWhere(Section $filter, $values);", "public function filter(callable $predicate): Map;", "public function searchBy(callable $matchingCondition)\n {\n $list = listOf(...array_filter($this->array));\n return $list\n ->filter($matchingCondition)\n ->getOrElse(0, fn() => null);\n }", "public function getBy($condition)\n {\n $entities = CandidateElectionPosition::whereNull('deleted_at');\n foreach($condition as $column => $data)\n $entities->where($column, $data);\n\n return $entities->get();\n }", "public function getBy($condition)\n {\n $entities = ElectionPosition::whereNull('deleted_at');\n foreach($condition as $column => $data)\n $entities->where($column, $data);\n\n return $entities->get();\n }", "private static function applyCondition($query, $condition)\n {\n if(is_array($condition))\n {\n $keys = array_keys($condition);\n $firstKey = $keys[0];\n \n if(is_int($firstKey))\n {\n // int[] ids\n \n $ids = $condition;\n \n foreach($ids as &$id)\n {\n $id = (int) $id;\n }\n \n return $query->where('id', 'in', $ids);\n }\n else\n {\n // [key => val]\n \n foreach($condition as $key => $value); // a trick to get key name and value\n \n return $query->where($key, $value);\n }\n }\n else\n {\n // int id\n \n $id = $condition;\n \n return $query->where('id', (int) $id);\n }\n }", "public function takeWhile(Closure $fn): VectorInterface;", "public function exportCondition(SearchConditionInterface $condition);", "public function filter(\\Closure $callback): self\n {\n $collection = new static();\n\n foreach ($this->props as $key => $value) {\n if ($callback($value, $key)) {\n $collection->add($key, $value);\n }\n }\n\n return $collection;\n }", "public function getConditionArgs(Betanet_Helpdesk_Model_ConditionInterface $condition);", "public function select_where()\n\t{\n\t\t$args = func_get_args();\n\t\t$select = array_map('trim', explode(\",\", $args[0]));\n\t\t$op = $o = [];\t\n\t\t$cond = $args[1];//Format conditions\t\t\n\t\tarray_walk($cond, function($v, $k) use(&$o) {\n\t\t\t$key = array_map('trim', explode(\" \", $k));\n\t\t\t$key[1] = (isset($key[1]) && $key[1] != \"\") ? $key[1] : '==';\n\t\t\t$key[2] = $v;\n\t\t\t$o[] = $key;\n\t\t});\n\t\t //Filter and select it\n\t\tarray_filter($this->source, function($src, $key) use ($o, $select, &$op){\n\t\t\t$resp = FALSE;\n\t\t\tforeach ($o as $k => $v) {\n\t\t\t\t$resp = (isset($src[$v[0]])) ? ($this->_operator_check($src[$v[0]], $v[1], $v[2])) : $resp;\n\t\t\t\tif($resp==FALSE) break; //If one condition fails break it. It's not the one, we are searching\n\t\t\t}\n\t\t\t($resp==TRUE) ? ($op[$key] = array_intersect_key($src, array_flip($select))) : FALSE;\n\t\t\treturn $resp;\n\t\t},ARRAY_FILTER_USE_BOTH);\t\t\n\t\t$preserve = isset($args[2]) && $args[2] ? TRUE : FALSE;\n\t\t$this->_preserve_keys($op, $preserve);\n\t\treturn $this;\n\t}", "function filterNotIn(string $key, array $values, bool $strict = true, bool $preserve_keys = false): Collection\n {\n $found = $this->makeSibling();\n if ($strict) {\n foreach ($this->items as $item) {\n $item_value = $this->getItemValue($item, $key);\n $not_in = true;\n foreach ($values as $value) {\n if ($item_value === $value) {\n $not_in = false;\n }\n }\n if ($not_in) {\n $found->addItem($key, $item, $preserve_keys);\n }\n }\n } else {\n foreach ($this->items as $item) {\n $item_value = $this->getItemValue($item, $key);\n $not_in = true;\n foreach ($values as $value) {\n if ($item_value == $value) {\n $not_in = false;\n }\n }\n if ($not_in) {\n $found->addItem($key, $item, $preserve_keys);\n }\n }\n }\n return $found;\n }", "public function setFilteredAttributes($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Opentelemetry\\Proto\\Common\\V1\\KeyValue::class);\n $this->filtered_attributes = $arr;\n\n return $this;\n }", "public function createWhere($valueId){\n return $this->createWhereByValue( $this->findValueById($valueId) );\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Remove um anexo de um processo.
public function removerAnexos() { $id = request('id'); $anexo = Anexo::find($id); $anexo->delete(); $processo = Processo::with('anexos')->find($anexo->id_processo); $anexos = $processo->anexos; $view = view('processos.abas._anexos_itens', compact('anexos'))->render(); return response()->json(['view' => $view]); }
[ "function removeProcessoPronto(){\n\tunset($_SESSION['processosProntos'][0]);\n\n\t/*REORGANIZA O ARRAY DE PROCESSOS PRONTOS*/\n\t$_SESSION['processosProntos'] = array_values($_SESSION['processosProntos']);\n}", "public function clearAnotacaoProcessos()\n\t{\n\t\t$this->collAnotacaoProcessos = null; // important to set this to NULL since that means it is uninitialized\n\t}", "public function remove( $index )\n {\n if(isset($this->processes[$index]))\n {\n unset($this->processes[$index]);\n }\n }", "function removeProcessoPronto($indice){\n\tunset($_SESSION['processosProntos'][$indice]);\n\n\t/*REORGANIZA O ARRAY DE PROCESSOS PRONTOS*/\n\t$_SESSION['processosProntos'] = array_values($_SESSION['processosProntos']);\n}", "public function Eliminar(){\n\t\t\t$enlace = AccesoBD::Conexion();\n\n\t\t\t$sql = \"DELETE FROM miembro_ageia WHERE ID_MIEMBRO = '$this->id'\";\n\n\t\t\tif ($enlace->query($sql) !== TRUE) {\n \t\t\techo \"Error al eliminar el miembro\";\n \t\t\texit();\n\t\t\t}\n\t\t\techo \"Miembro eliminado\";\n\t\t}", "function eliminaProyecto(){\n \t$this->buffer=0;\n \tif(count($this->data) > 0){\n \t\t$this->buffer = $this->eliminaProyectoCompleto($this->data,$this->session);\n \t}\n }", "public function Eliminar()\n {\n $sentenciaSql = \"DELETE FROM generar_pago \n WHERE id_generar_pago = $this->idGenerarPago\";\n $this->conn->preparar($sentenciaSql);\n $this->conn->ejecutar();\n }", "public function EliminarEmpleado($persona)\n {\n unset($this->_empleados[array_search($persona,$this->_empleados)]);\n $this->_empleados = array_values($this->_empleados);\n echo(\"Se se elimino el empleado: \" . $persona->GetNombre() . \"<br><br>\");\n }", "function opcion__eliminar()\n\t{\n\t\t$id_proyecto = $this->get_id_proyecto_actual();\n\t\tif ( $id_proyecto == 'toba' ) {\n\t\t\tthrow new toba_error(\"No es posible eliminar el proyecto 'toba'\");\n\t\t}\n\t\ttry {\n\t\t\t$p = $this->get_proyecto();\n\t\t\tif ( $this->consola->dialogo_simple(\"Desea ELIMINAR los metadatos y DESVINCULAR el proyecto '\"\n\t\t\t\t\t.$id_proyecto.\"' de la instancia '\"\n\t\t\t\t\t.$this->get_id_instancia_actual().\"'\") ) {\n\t\t\t\t$p->eliminar_autonomo();\n\t\t\t}\n\t\t} catch (toba_error $e) {\n\t\t\t$this->consola->error($e->__toString());\n\t\t}\n\t\t$this->get_instancia()->desvincular_proyecto( $id_proyecto );\n\t}", "public function removeProcess(Process $proc)\n {\n $em = $this->doctrine->getManager();\n $em->remove($proc->getEntity());\n }", "public function removerAmparo () {\n\n $oAmparo = $this->getAmparo();\n $oAmparo->excluir();\n $this->oAmparo = null;\n }", "public function DeleteOrdemProducao() {\n\t\t\t$this->objOrdemProducao->Delete();\n\t\t}", "public function remove() {\n\t\t\tif ($this->id) {\n\t\t\t\t$delete_query = \"delete from process_form where process_id = '$this->id' ;\";\n\t\t\t\tdb_query($delete_query);\n\t\t\t\tunset($this);\n\t\t\t} else {\n\t\t\t\tthrow new Exception('Trying to remove process_form with no process id');\n\t\t\t}\n\t\t}", "private function gravaProcesso(){\n \n $oDaoIssMovAlvaraProcesso = db_utils::getDAO(\"issmovalvaraprocesso\",true);\n \n $oDaoIssMovAlvaraProcesso->q124_codproc = $this->getCodigoProcesso();\n $oDaoIssMovAlvaraProcesso->q124_issmovalvara = $this->getCodigoMovimentacao();\n $oDaoIssMovAlvaraProcesso->incluir(\"\");\n if($oDaoIssMovAlvaraProcesso->erro_status == \"0\"){\n throw new ErrorException($oDaoIssMovAlvaraProcesso->erro_msg);\n }\n }", "public function excluirProgressoEstudo($idProgresso)\n\t{\n\t\t$this->db->delete('progresso_estudo', array('id_progresso' => $idProgresso));\n\t}", "public function eliminarAlimento(){\n $this->modeloAlimentos->eliminarAlimentoRecetaById($_POST['id']);\n $resultado=$this->modeloAlimentos->eliminarAlimentoById($_POST['id']);\n echo $resultado;\n }", "function excluirEvento($id){\n\n\t\t\t$sql = \"DELETE FROM cronograma WHERE id = :id\";\n\t\t\t$sql = $this->db->prepare($sql);\n\t\t\t$sql->bindValue(':id', $id);\n\t\t\t$sql->execute();\n\t\t}", "public function eliminarExperimento($exp){\n\t$this->query(\"DELETE FROM \texperimento\tWHERE idExperimento= \".$exp);\t\n\t}", "final protected function eliminar(){\n\t\tif($this->sublinea != null){\n\t\t\tthrow new Exception('Sublinea sin datos');\n\t\t}\n\t\tDataAccess::delete($this->sublinea);\t\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Number of days before the DueDate on whichthe article can no longer be shipped.
public function getNrDaysNoDeliveryForDueDate() { return $this->nrDaysNoDeliveryForDueDate; }
[ "public function daysRemaining()\n\t{\n\t\t$days_remaining = 0;\n\t\t$today = strtotime(date('Y-m-d H:i:s'));\n\t\t$due_date = strtotime($this->due_date);\n\n\t\tif ($due_date > $today) {\n\t\t\t$days_remaining = floor(($due_date - $today) / 86400);\n\t\t}\n\n\t\treturn $days_remaining;\n\t}", "static public function overdueDays($dueDate) {\n if(is_object($dueDate) && array_key_exists('isNull', get_class_vars( get_class($dueDate))) && ($dueDate->isNull === true)){\n throw new Exception('$dueDate->isNull is true', self);\n } \n $dateDiff = date_diff(is_object($dueDate) ? $dueDate : RO::flexiDateToDateTime($dueDate),\n new \\DateTime());\n if ($dateDiff->invert == 1) {\n $ddif = $dateDiff->days * -1;\n } else {\n $ddif = $dateDiff->days;\n }\n\n return $ddif;\n }", "public function getRemainingDays()\n {\n if ($this->isCancelled() || $this->isCompleted()) {\n return 0;\n }\n $today = new \\DateTime();\n $diff = $this->getEnddate()->diff($today);\n return $diff->format('%d');\n }", "function getRemainingDays(){\n\t\t$nowstamp = time();\n\t\t$endstamp = strtotime($this->getEndDate());\n\t\t$startstamp = strtotime($this->getStartDate());\n\t\t$days = '--';\n\t\tif($startstamp > $nowstamp){\n\t\t\t$days = $this->getDaysAssigned();\n\t\t} else {\n\t\t\t$days = ceil(abs($endstamp - $nowstamp) / 86400);\n\t\t}\n\t\t\n\t\treturn $days;\n\t}", "public function remainingDays()\n {\n if ($this->hasExpired()) {\n return (int) 0;\n }\n\n return (int) Carbon::now()->diffInDays(Carbon::parse($this->expires_on));\n }", "public function getWouldBeDaysLate() {\n return max(0, $this->hasDueDate() ? DateUtils::calculateDayDiff($this->getSubmissionDueDate()) : 0);\n }", "public function getRemainingDays()\n {\n $now = new DateTime();\n $deadline = (new DateTime($this->deadline))->modify('+1 day');\n $remainingDays = $deadline->diff($now)->format(\"%a\");\n\n return intval($remainingDays);\n }", "public function getDaysLeftInBillingCycle() : int\n {\n return $this->daysLeftInBillingCycle;\n }", "public function getRemainingDay() {\n $days_left = date_diff(new DateTime(), $this->getEndDay(), $absolute = false);\n $days_left_num = (int)$days_left->format('%r%a');\n return $days_left_num;\n }", "public function getBillingDaysLeft(){\n $expiresOn = new \\DateTime($this->agent_billing_active_until);\n $today = new \\DateTime();\n\n $daysLeft = $expiresOn->diff($today)->days;\n\n if($expiresOn > $today){\n return $daysLeft + 1;\n }\n\n // Allow 24 hours additional for user to sort out billing issues\n if($daysLeft == 0){\n return 1;\n }\n\n return 0;\n }", "public function getDaysLeftInFreeTrial() {\n $creation_date = new DateTime($this->creation_time);\n $now = new DateTime();\n $end_of_trial = $creation_date->add(new DateInterval('P15D'));\n $days_left = 0;\n if ($end_of_trial >= $now) {\n $interval = $now->diff($end_of_trial);\n $days_left = $interval->format('%a');\n }\n return intval($days_left);\n }", "public function getDaysRemaining() {\n $end = $this->getDateEnd('U');\n $start = $this->getDateStart('U');\n $now = time();\n\n if ($end < $now) {\n return 0;\n }\n elseif ($start < $now && $now < $end) {\n return ceil(($end - $now) / 86400);\n }\n elseif ($end < $now) {\n return 0;\n }\n }", "public function getDaysUntilDue(): ?int\n {\n return $this->daysUntilDue;\n }", "public function daysRemainingInWeek() : int\n {\n return 7 - $this->dayOfWeek();\n }", "public function nearOfDueDate()\n {\n return Carbon::parse($this->due_date)->diffInDays(Carbon::now()) < 60;\n }", "public function cakeFestDaysLeft()\n {\n $startDate = Configure::read('Site.cakefest.start_date');\n\n return (new Time($startDate))->diff(new Time())->days;\n }", "protected function getDaysRemainingAttribute()\n {\n $enddate = Carbon::parse($this->expired_at);\n $now = Carbon::now();\n\n if($now >= $enddate) {\n return 0;\n }\n\n return $now->diffInDays($enddate) . ' days remaining';\n }", "public function getDaysLeft()\n {\n if (!$this->usageCrawler) {\n $this->login();\n }\n\n $daysLeft = $this->usageCrawler->filter('.days-remaining span.number')->text();\n\n return $daysLeft;\n }", "public function getPastDue()\n {\n return intval($this->PastDue);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Authenticates the user using the DIGESTMD5 method.
function _authDigest_MD5($uid, $pwd, $euser) { if ( PEAR::isError( $challenge = $this->_doCmd('AUTHENTICATE "DIGEST-MD5"') ) ) { $this->_error=challenge ; return challenge ; } $challenge = base64_decode( $challenge ); $digest = &Auth_SASL::factory('digestmd5'); if(PEAR::isError($param=$digest->getResponse($uid, $pwd, $challenge, "localhost", "sieve" , $euser) )) { return $param; } $auth_str = base64_encode($param); if ( PEAR::isError($error = $this->_sendStringResponse( $auth_str ) ) ) { $this->_error=$error; return $error; } if ( PEAR::isError( $challenge = $this->_doCmd() ) ) { $this->_error=$challenge ; return $challenge ; } if( strtoupper(substr($challenge,0,2))== 'OK' ){ return true; } /** * We don't use the protocol's third step because SIEVE doesn't allow * subsequent authentication, so we just silently ignore it. */ if ( PEAR::isError($error = $this->_sendStringResponse( '' ) ) ) { $this->_error=$error; return $error; } if (PEAR::isError($res = $this->_doCmd() )) { return $res; } }
[ "protected function authCRAMMD5()\n {\n $this->_send('AUTH CRAM-MD5');\n $challenge = $this->_expect(334);\n $challenge = base64_decode($challenge);\n $digest = $this->hmacMD5($this->getPassword(), $challenge);\n $this->_send(base64_encode($this->getUsername() . ' ' . $digest));\n $this->_expect(235);\n $this->auth = true;\n }", "protected function authDigestMd5()\n {\n $this->sendData( 'AUTH DIGEST-MD5' );\n if ( $this->getReplyCode( $serverResponse ) !== '334' )\n {\n throw new ezcMailTransportSmtpException( 'SMTP server does not accept AUTH DIGEST-MD5.' );\n }\n\n $serverDigest = base64_decode( trim( substr( $serverResponse, 4 ) ) );\n $parts = explode( ',', $serverDigest );\n foreach ( $parts as $part )\n {\n $args = explode( '=', $part, 2 );\n $params[trim( $args[0] )] = trim( $args[1] );\n }\n\n if ( !isset( $params['nonce'] ) ||\n !isset( $params['algorithm'] ) )\n {\n throw new ezcMailTransportSmtpException( 'SMTP server did not send a correct DIGEST-MD5 challenge.' );\n }\n\n $nonce = trim( $params['nonce'], '\"' );\n $algorithm = trim( $params['algorithm'], '\"' );\n\n $qop = 'auth';\n $realm = isset( $params['realm'] ) ? trim( $params['realm'], '\"' ) : $this->serverHost;\n $cnonce = $this->generateNonce( 32 );\n $digestUri = \"smtp/{$this->serverHost}\";\n $nc = '00000001';\n $charset = isset( $params['charset'] ) ? trim( $params['charset'], '\"' ) : 'utf-8';\n $maxbuf = isset( $params['maxbuf'] ) ? trim( $params['maxbuf'], '\"' ) : 65536;\n\n $response = '';\n $A2 = \"AUTHENTICATE:{$digestUri}\";\n $A1 = pack( 'H32', md5( \"{$this->user}:{$realm}:{$this->password}\" ) ) . \":{$nonce}:{$cnonce}\";\n $response = md5( md5( $A1 ) . \":{$nonce}:{$nc}:{$cnonce}:{$qop}:\" . md5( $A2 ) );\n\n $loginParams = array(\n 'username' => \"\\\"{$this->user}\\\"\",\n 'cnonce' => \"\\\"{$cnonce}\\\"\",\n 'nonce' => \"\\\"{$nonce}\\\"\",\n 'nc' => $nc,\n 'qop' => $qop,\n 'digest-uri' => \"\\\"{$digestUri}\\\"\",\n 'charset' => $charset,\n 'realm' => \"\\\"{$realm}\\\"\",\n 'response' => $response,\n 'maxbuf' => $maxbuf\n );\n\n $parts = array();\n foreach ( $loginParams as $key => $value )\n {\n $parts[] = \"{$key}={$value}\";\n }\n $login = base64_encode( implode( ',', $parts ) );\n\n $this->sendData( $login );\n if ( $this->getReplyCode( $serverResponse ) !== '334' )\n {\n throw new ezcMailTransportSmtpException( 'SMTP server did not accept the provided username and password.' );\n }\n\n $serverResponse = base64_decode( trim( substr( $serverResponse, 4 ) ) );\n $parts = explode( '=', $serverResponse );\n $rspauthServer = trim( $parts[1] );\n\n $A2 = \":{$digestUri}\";\n $rspauthClient = md5( md5( $A1 ) . \":{$nonce}:{$nc}:{$cnonce}:{$qop}:\" . md5( $A2 ) );\n\n if ( $rspauthServer !== $rspauthClient )\n {\n throw new ezcMailTransportSmtpException( 'SMTP server did not responded correctly to the DIGEST-MD5 authentication.' );\n }\n\n $this->sendData( '' );\n if ( $this->getReplyCode( $serverResponse ) !== '235' )\n {\n throw new ezcMailTransportSmtpException( 'SMTP server did not allow DIGEST-MD5 authentication.' );\n }\n\n return true;\n }", "function digest_md5($username, $password)\n\t{\n\t\tglobal $config, $user;\n\n\t\t$this->server_send('AUTH DIGEST-MD5');\n\t\tif ($err_msg = $this->server_parse('334', __LINE__))\n\t\t{\n\t\t\treturn ($this->numeric_response_code == 503) ? false : $err_msg;\n\t\t}\n\n\t\t$md5_challenge = base64_decode($this->responses[0]);\n\n\t\t// Parse the md5 challenge - from AUTH_SASL (PEAR)\n\t\t$tokens = array();\n\t\twhile (preg_match('/^([a-z-]+)=(\"[^\"]+(?<!\\\\\\)\"|[^,]+)/i', $md5_challenge, $matches))\n\t\t{\n\t\t\t// Ignore these as per rfc2831\n\t\t\tif ($matches[1] == 'opaque' || $matches[1] == 'domain')\n\t\t\t{\n\t\t\t\t$md5_challenge = substr($md5_challenge, strlen($matches[0]) + 1);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Allowed multiple \"realm\" and \"auth-param\"\n\t\t\tif (!empty($tokens[$matches[1]]) && ($matches[1] == 'realm' || $matches[1] == 'auth-param'))\n\t\t\t{\n\t\t\t\tif (is_array($tokens[$matches[1]]))\n\t\t\t\t{\n\t\t\t\t\t$tokens[$matches[1]][] = preg_replace('/^\"(.*)\"$/', '\\\\1', $matches[2]);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$tokens[$matches[1]] = array($tokens[$matches[1]], preg_replace('/^\"(.*)\"$/', '\\\\1', $matches[2]));\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (!empty($tokens[$matches[1]])) // Any other multiple instance = failure\n\t\t\t{\n\t\t\t\t$tokens = array();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$tokens[$matches[1]] = preg_replace('/^\"(.*)\"$/', '\\\\1', $matches[2]);\n\t\t\t}\n\n\t\t\t// Remove the just parsed directive from the challenge\n\t\t\t$md5_challenge = substr($md5_challenge, strlen($matches[0]) + 1);\n\t\t}\n\n\t\t// Realm\n\t\tif (empty($tokens['realm']))\n\t\t{\n\t\t\t$tokens['realm'] = (function_exists('php_uname')) ? php_uname('n') : $user->host;\n\t\t}\n\n\t\t// Maxbuf\n\t\tif (empty($tokens['maxbuf']))\n\t\t{\n\t\t\t$tokens['maxbuf'] = 65536;\n\t\t}\n\n\t\t// Required: nonce, algorithm\n\t\tif (empty($tokens['nonce']) || empty($tokens['algorithm']))\n\t\t{\n\t\t\t$tokens = array();\n\t\t}\n\t\t$md5_challenge = $tokens;\n\n\t\tif (!empty($md5_challenge))\n\t\t{\n\t\t\t$str = '';\n\t\t\tfor ($i = 0; $i < 32; $i++)\n\t\t\t{\n\t\t\t\t$str .= chr(mt_rand(0, 255));\n\t\t\t}\n\t\t\t$cnonce = base64_encode($str);\n\n\t\t\t$digest_uri = 'smtp/' . $config['smtp_host'];\n\n\t\t\t$auth_1 = sprintf('%s:%s:%s', pack('H32', md5(sprintf('%s:%s:%s', $username, $md5_challenge['realm'], $password))), $md5_challenge['nonce'], $cnonce);\n\t\t\t$auth_2 = 'AUTHENTICATE:' . $digest_uri;\n\t\t\t$response_value = md5(sprintf('%s:%s:00000001:%s:auth:%s', md5($auth_1), $md5_challenge['nonce'], $cnonce, md5($auth_2)));\n\n\t\t\t$input_string = sprintf('username=\"%s\",realm=\"%s\",nonce=\"%s\",cnonce=\"%s\",nc=\"00000001\",qop=auth,digest-uri=\"%s\",response=%s,%d', $username, $md5_challenge['realm'], $md5_challenge['nonce'], $cnonce, $digest_uri, $response_value, $md5_challenge['maxbuf']);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn (isset($user->lang['INVALID_DIGEST_CHALLENGE'])) ? $user->lang['INVALID_DIGEST_CHALLENGE'] : 'Invalid digest challenge';\n\t\t}\n\n\t\t$base64_method_digest_md5 = base64_encode($input_string);\n\t\t$this->server_send($base64_method_digest_md5, true);\n\t\tif ($err_msg = $this->server_parse('334', __LINE__))\n\t\t{\n\t\t\treturn $err_msg;\n\t\t}\n\n\t\t$this->server_send(' ');\n\t\tif ($err_msg = $this->server_parse('235', __LINE__))\n\t\t{\n\t\t\treturn $err_msg;\n\t\t}\n\n\t\treturn false;\n\t}", "protected function authCramMd5()\n {\n $this->sendData( 'AUTH CRAM-MD5' );\n if ( $this->getReplyCode( $response ) !== '334' )\n {\n throw new ezcMailTransportSmtpException( 'SMTP server does not accept AUTH CRAM-MD5.' );\n }\n\n $serverDigest = trim( substr( $response, 4 ) );\n $clientDigest = hash_hmac( 'md5', base64_decode( $serverDigest ), $this->password );\n $login = base64_encode( \"{$this->user} {$clientDigest}\" );\n\n $this->sendData( $login );\n if ( $this->getReplyCode( $error ) !== '235' )\n {\n throw new ezcMailTransportSmtpException( 'SMTP server did not accept the provided username and password.' );\n }\n\n return true;\n }", "public function verifyMD5Hash()\n {\n #URL can be look like this: http://127.0.0.1/RastgoFramework/authentication/registerBcrypt/username:hossein/password:yourpasswordhere/email:yourmail@gmail.com/\n $obj = new Authentication();\n $obj->initDbTableName('auth');\n $userInfo = self::$registry->request->getArgs();\n $username = explode(':', $userInfo[0]);\n $password = explode(':', $userInfo[1]);\n $email = explode(':', $userInfo[2]);\n\n// echo $username[1];\n// echo '<br />';\n// echo $password[1];\n// echo '<br />';\n// echo $email[1];\n\n\n $storedSaltInDatabase = '155ee3a3edd7a2fdf90ef7116658e71f';\n $storedHashOfPasswordInDatabase = '7c6e3b3bd9b5d7b46246cc02700d21da';\n\n\n echo '<br /><pre>';\n var_dump($obj->makePassHashMD5($password[1], $storedSaltInDatabase, $storedHashOfPasswordInDatabase));\n echo '</pre><br />';\n }", "function _authCRAM_MD5($uid, $pwd, $euser)\n {\n if ( PEAR::isError( $challenge = $this->_doCmd( 'AUTHENTICATE \"CRAM-MD5\"' ) ) ) {\n $this->_error=challenge ;\n return challenge ;\n }\n $challenge=trim($challenge);\n $challenge = base64_decode( trim($challenge) );\n $cram = &Auth_SASL::factory('crammd5');\n if ( PEAR::isError($resp=$cram->getResponse( $uid , $pwd , $challenge ) ) ) {\n $this->_error=$resp;\n return $resp;\n }\n $auth_str = base64_encode( $resp );\n if ( PEAR::isError($error = $this->_sendStringResponse( $auth_str ) ) ) {\n $this->_error=$error;\n return $error;\n }\n\n }", "function _digestMd5Login($challenge) {\n $result = $this->_digestmd5_parse_challenge($challenge);\n\n // verify server supports qop=auth\n // $qop = explode(\",\",$result['qop']);\n //if (!in_array(\"auth\",$qop)) {\n // rfc2831: client MUST fail if no qop methods supported\n // return false;\n //}\n $cnonce = base64_encode(bin2hex($this->_hmac_md5(microtime())));\n $ncount = \"00000001\";\n\n /* This can be auth (authentication only), auth-int (integrity protection), or\n auth-conf (confidentiality protection). Right now only auth is supported.\n DO NOT CHANGE THIS VALUE */\n $qop_value = \"auth\";\n\n $digest_uri_value = 'smtp/'.$this->SERVER;\n\n // build the $response_value\n //FIXME This will probably break badly if a server sends more than one realm\n $string_a1 = utf8_encode($this->AUTHID).\":\";\n $string_a1 .= utf8_encode($result['realm']).\":\";\n $string_a1 .= utf8_encode($this->AUTHPWD);\n $string_a1 = $this->_hmac_md5($string_a1);\n $A1 = $string_a1 . \":\" . $result['nonce'] . \":\" . $cnonce;\n $A1 = bin2hex($this->_hmac_md5($A1));\n $A2 = \"AUTHENTICATE:$digest_uri_value\";\n // If qop is auth-int or auth-conf, A2 gets a little extra\n if ($qop_value != 'auth') {\n $A2 .= ':00000000000000000000000000000000';\n }\n $A2 = bin2hex($this->_hmac_md5($A2));\n\n $string_response = $result['nonce'] . ':' . $ncount . ':' . $cnonce . ':' . $qop_value;\n $response_value = bin2hex($this->_hmac_md5($A1.\":\".$string_response.\":\".$A2));\n\n $response = 'charset=utf-8,username=\"' . $this->AUTHID . '\",realm=\"' . $result[\"realm\"] . '\",';\n $response .= 'nonce=\"' . $result['nonce'] . '\",nc=' . $ncount . ',cnonce=\"' . $cnonce . '\",';\n $response .= \"digest-uri=\\\"$digest_uri_value\\\",response=$response_value\";\n $response .= ',qop=' . $qop_value;\n $response = base64_encode($reply);\n return $response . \"\\r\\n\";\n\n}", "private function generateMD5Pass() {\n $plaintext = $this->generator->generateString(8, '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^+');\n $hash = md5($plaintext);\n return $hash;\n }", "private function Md5smspwd()\n {\n return strtoupper(md5($this->_sn . $this->_pwd));\n }", "public function md5($input);", "public function getDigestAuth()\n {\n }", "function hashpassword($clean_password){ \n \n return md5($clean_password);\n \n}", "private function authenticate() {\n $checksum = $this->getXssCleanedInput('CHECKSUM');\n $this->commonLib->authenticateChecksum($checksum);\n }", "public function http_authentication_check_digest($allowed_groups = array())\n\t{\n\t\tif (empty($_SERVER) OR ! isset($_SERVER['PHP_AUTH_DIGEST']))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t$this->auth_attempt = TRUE;\n\n\t\t$required = array('uri'\t\t\t=> '',\n\t\t\t\t\t\t 'response'\t=> '',\n\t\t\t\t\t\t 'realm'\t\t=> $this->realm,\n\t\t\t\t\t\t 'username'\t=> '',\n\t\t\t\t\t\t 'nonce'\t\t=> 1,\n\t\t\t\t\t\t 'nc'\t\t\t=> 1,\n\t\t\t\t\t\t 'cnonce'\t\t=> 1,\n\t\t\t\t\t\t 'qop'\t\t\t=> 1);\n\n\t\t$params = ee('Variables/Parser')->parseTagParameters($_SERVER['PHP_AUTH_DIGEST']);\n\n\t\textract($required);\n\t\textract($params);\n\n\t\t/** ----------------------------------------\n\t\t/** Check password lockout status\n\t\t/** ----------------------------------------*/\n\n\t\tif (ee()->session->check_password_lockout($username) === TRUE)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t/** ----------------------------------\n\t\t/** Validate Username and Password\n\t\t/** ----------------------------------*/\n\n\t\t$query = ee()->db->query(\"SELECT password, group_id FROM exp_members WHERE username = '\".ee()->db->escape_str($username).\"'\");\n\n\t\tif ($query->num_rows() == 0)\n\t\t{\n\t\t\tee()->session->save_password_lockout($username);\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// make sure Super Admins are always allowed\n\t\tif ( ! in_array($allowed_groups, 1))\n\t\t{\n\t\t\t$allowed_groups[] = 1;\n\t\t}\n\n\t\tif ( ! in_array($query->row('group_id') , $allowed_groups))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t$parts = array(\n\t\t\t\t\t\tmd5($username.':'.$realm.':'.$query->row('password') ),\n\t\t\t\t\t\tmd5($_SERVER['REQUEST_METHOD'].':'.$uri)\n\t\t\t\t\t );\n\n\t\t$valid_response = md5($parts['0'].':'.$nonce.':'.$nc.':'.$cnonce.':'.$qop.':'.$parts['1']);\n\n\t\tif ($valid_response == $response)\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tee()->session->save_password_lockout($username);\n\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function yourls_has_md5_password( $user ) {\n\tglobal $yourls_user_passwords;\n\treturn( isset( $yourls_user_passwords[ $user ] )\n\t && substr( $yourls_user_passwords[ $user ], 0, 4 ) == 'md5:'\n\t\t && strlen( $yourls_user_passwords[ $user ] ) == 42 // http://www.google.com/search?q=the+answer+to+life+the+universe+and+everything\n\t\t );\n}", "public function authenticationWithValidAlphaCharClassPasswordAndFixedHash() {}", "function make_md5() {\n $this->email_md5=md5($this->email.$this->salt);\n return true;\n }", "function Md5($str){\r\n\t\treturn md5($str);\r\n\t}", "function crypt_md5($password) {\r\n $salt = '$1$kocmoc47$';\r\n return crypt($password, $salt);\r\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
.google.protobuf.Timestamp statusChangedTo = 8;
public function getStatusChangedTo() { return $this->statusChangedTo; }
[ "public function setStatusChangedTo(&$var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Timestamp::class);\n $this->statusChangedTo = $var;\n }", "public function getChangedTime() {\n return $this->get('changed')->value;\n }", "public function setChangedTime($timestamp);", "function stampStatusModified() {\n\t\treturn $this->setDateStatusModified(Core::getCurrentDate());\n\t}", "function setStatusModified( $timestamp )\n {\n $this->StatusModified = $timestamp;\n }", "public function get410Timestamp(): string;", "public function getTimestamp()\n {\n return $this->readOneof(22);\n }", "public function getChangedAt()\n {\n return $this->changed_at;\n }", "public function set_written_stamp( $written_stamp )\n{\n $this->written_stamp = $written_stamp;\n}", "public function setLastStatusUpdate($value) {\n\t\t$value = date('d-M-Y', strtotime($value));\n\t\tself::$_lastStatusUpdate = $value;\n\t}", "public function statusSince() {\n\n // get the latest entry that a) had a different status and b) happened before this one\n try {\n $minTime = $this->app->dbConn->table(static::$TABLE)\n ->fields('MAX('.static::$FIELDS['time']['db'].') AS '.static::$FIELDS['time']['db'])\n ->where([\n [static::$FIELDS['time']['db'].' <= ?', $this->time->format('Y-m-d H:i:s')],\n [static::$FIELDS['status']['db'].' != ?', intval($this->status)]\n ])\n ->firstValue();\n $minTime = new \\DateTime($minTime, $this->app->serverTimeZone);\n } catch (NoDatabaseRowsRetrievedException $e) {\n // there are no other statuses prior to this.\n $minTime = Null;\n }\n\n // get the earliest entry that a) has the current status and b) happened after minTime\n $startTime = $this->app->dbConn->table(static::$TABLE)\n ->fields('MIN('.static::$FIELDS['time']['db'].') AS '.static::$FIELDS['time']['db'])\n ->where([\n [static::$FIELDS['time']['db'].' >= ?', $minTime->format('Y-m-d H:i:s')],\n [static::$FIELDS['status']['db'].' = ?', intval($this->status)]\n ])\n ->firstValue();\n $startTime = new \\DateTime($startTime, $this->app->serverTimeZone);\n\n /*\n $sinceQuery = $this->app->dbConn->query(\"SELECT list_table.\".static::$TYPE_ID.\", list_table.time FROM \".static::$TABLE.\" list_table\n LEFT OUTER JOIN \".static::$TABLE.\" list_table2 ON list_table.\".static::$FIELDS['userId']['db'].\" = list_table2.\".static::$FIELDS['userId']['db'].\"\n AND list_table.\".static::$TYPE_ID.\" = list_table2.\".static::$TYPE_ID.\"\n AND list_table.\".static::$FIELDS['time']['db'].\" < list_table2.\".static::$FIELDS['time']['db'].\"\n AND list_table2.\".static::$FIELDS['status']['db'].\" != :status\n WHERE list_table.\".static::$FIELDS['userId']['db'].\" = \".intval($this->id).\"\n AND list_table.\".static::$TYPE_ID.\" = :anime_id\n AND list_table.\".static::$FIELDS['status']['db'].\" = :status\n AND list_table2.\".static::$FIELDS['time']['db'].\" IS NULL\n ORDER BY \".static::$TYPE_ID.\" ASC;\",\n [':anime_id' => $this->]);\n $startedAnime = [];\n while ($row = $sinceQuery->fetch()) {\n $startedAnime[intval($row['anime_id'])] = new \\DateTime($row['time'], $this->app->serverTimeZone);\n }\n */\n return $startTime;\n }", "public function testUpdateActivityStatus()\n {\n\n }", "public function changeStatusDate()\n {\n $modified = $this->getModified();\n\n if (array_key_exists('status_id', $modified)) {\n if ($this->status_id !== self::VEHICLE_STATUS_AVAILABLE) {\n $date = new Zend_Date();\n $this->status_modified_at = $date->toString('YYYY-MM-dd HH:mm:ss');\n }\n }\n }", "public function statusMessage()\n {\n }", "function last_update_status(){\n $this->log->logTrace(__FUNCTION__);\n\n if (count($this->_status_uri)>=1){\n return $this->_status_uri[count($this->_status_uri) - 1];\n }\n }", "public function set_read_stamp( $read_stamp )\n{\n $this->read_stamp = $read_stamp;\n}", "function getDateStatusModified() {\n\t\treturn $this->getData('dateStatusModified');\n\t}", "public function testMeetingLiveStreamStatusUpdate()\n {\n }", "public function getOriginalStatus();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Converts spaces ( ) and dashes () to underscores (_)
private function spaceToUnderscore( $original ) { return ( string )str_replace( array( " ", "-" ), "_", $original ); }
[ "function dasherize($underscore_word)\n{\n return preg_replace('/_/', '-', $underscore_word);\n}", "function underscore($str){\r\n return strtolower(preg_replace('/(.)([A-Z])/', '$1_$2', $str));\r\n }", "function underscore($string)\n{\n return strtolower(preg_replace('/(?<!^)([A-Z])/', '_$1', str_replace('-', '_', $string)));\n}", "public function underscore($string);", "function underscore($str) {\n $str[0] = strtolower($str[0]);\n $func = create_function('$c', 'return \"_\" . strtolower($c[1]);');\n return preg_replace_callback('/([A-Z])/', $func, $str);\n}", "function underscore($camel_cased_word)\n{\n return strtolower(preg_replace('/([a-z\\d])([A-Z])/', '\\1_\\2', \n preg_replace('/([A-Z]+)([A-Z][a-z])/', '\\1_\\2', $camel_cased_word)));\n}", "private function spaceToUnderscore ($filename) {\n\t\treturn str_replace(' ','_',$filename);\n\t}", "function underscoresToSpaces($postedData) {\n\t\t\t// Replace spaces with underscores\n\t\t\t$output = preg_replace(\"/_/e\" , \" \" , $postedData);\n\n\t\t\t// Remove non-word characters\n\t\t\t$output = preg_replace(\"/\\W/e\" , \"_\" , $output);\n\n\t\t\treturn strtolower($output);\n\t\t\t}", "protected function normalize_( $name ) {\n $name = strtolower( $name );\n if( $name[0]=='_') $name = substr( $name, 1 );\n $name = str_replace( '_', '-', $name );\n return $name;\n }", "function humanize($lowerCaseAndUnderscoredWord)\n{\n\t$replace = ucwords(str_replace(\"_\", \" \", $lowerCaseAndUnderscoredWord));\n\treturn $replace;\n}", "private function toLowercaseAndSpaceToUnderscore($str) {\n return mb_strtolower(preg_replace(\"/\\s+/\", \"_\", $str), \"UTF-8\");\n }", "function underscore($camel_cased_word)\n{\n\treturn strtolower(preg_replace('/(?<=\\\\w)([A-Z])/', '_\\\\1', $camel_cased_word));\n}", "function overlap_string_to_underscore_name( $string )\r\n{\r\n $string = preg_replace('/[\\'\"]/', '', $string);\r\n $string = preg_replace('/[^a-zA-Z0-9]+/', '_', $string);\r\n $string = trim($string, '_');\r\n $string = strtolower($string);\r\n \r\n return $string;\r\n}", "public function underscore($camelCasedWord);", "function papi_underscorify( $str ) {\n\tif ( ! is_string( $str ) ) {\n\t\treturn '';\n\t}\n\n\treturn str_replace( ' ', '_', str_replace( '-', '_', $str ) );\n}", "function gogreen_string_to_underscore_name( $string )\n{\n $string = preg_replace('/[\\'\"]/', '', $string);\n $string = preg_replace('/[^a-zA-Z0-9]+/', '_', $string);\n $string = trim($string, '_');\n $string = strtolower($string);\n \n return $string;\n}", "function add_underscores($str) {\n\t$str = str_replace(\" \", \"_\", $str);\n\tif(preg_match(\"(')\", $str)) $str = str_replace('\\'', '&#39;', $str);\n\treturn $str;\t\n}", "function apostrophes_espaces_2_underscore($chaine) {\n\t$retour=preg_replace(\"/'/\",\"_\",preg_replace(\"/ /\",\"_\",$chaine));\n\treturn $retour;\n}", "public static function underscore($str) // {{{\n {\n if (is_array($str)) {\n return $str[1][0] . '_' . strtolower($str[1][1]);\n }\n return preg_replace_callback(\n '/([a-z][A-Z])/', array(__CLASS__, __FUNCTION__), (string) $str\n );\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Action confirm transaction page
public function actionConfirm() { $this->checkDetails(); }
[ "public function actionConfirm()\n {\n parent::actionConfirm();\n $api = $this->buildApi();\n\n $details = HelperCommon::getStore('details');\n $api->updateData($details);\n\n // fill items with product details\n $items = array();\n foreach ($api->getBasket()->getItems() as $item)\n {\n $items[] = array(\n 'productUrlImage' => $this->getProductUrlImage($item->getDescription()),\n 'description' => $item->getDescription(),\n 'quantity' => $item->getQuantity(),\n 'unitGrossAmount' => number_format($item->getUnitGrossAmount(), 2),\n 'totalGrossAmount' => number_format($item->getTotalGrossAmount(), 2),\n );\n }\n\n $env = $this->sagepayConfig->getEnv();\n\n // Render confirm page for form payment\n $view = new HelperView('form/confirm');\n $view->setData(array(\n 'basket' => array(\n 'items' => $items,\n 'deliveryGrossPrice' => number_format($api->getBasket()->getDeliveryGrossAmount(), 2),\n 'totalGrossPrice' => number_format($api->getBasket()->getAmount(), 2),\n ),\n 'env' => $env,\n 'vendorName' => $this->sagepayConfig->getVendorName(),\n 'integrationType' => $this->integrationType,\n 'currency' => $this->sagepayConfig->getCurrency(),\n 'purchaseUrl' => $this->sagepayConfig->getPurchaseUrl('form', $env),\n 'request' => $api->createRequest(),\n 'displayQueryString' => htmlspecialchars(rawurldecode(utf8_encode($api->getQueryData()))),\n 'details' => $details,\n ));\n $view->render();\n }", "public function confirmAction()\n {\n if ($this->_getSession()->isLoggedIn()) {\n $this->_redirect('*/*/');\n return;\n }\n try {\n $id = $this->getRequest()->getParam('id', false);\n $key = $this->getRequest()->getParam('key', false);\n echo $backUrl = $this->getRequest()->getParam('back_url', false);\n\t \n\t //die;\n if (empty($id) || empty($key)) {\n throw new Exception($this->__('Bad request.'));\n }\n\n // load customer by id (try/catch in case if it throws exceptions)\n try {\n $customer = Mage::getModel('customer/customer')->load($id);\n if ((!$customer) || (!$customer->getId())) {\n throw new Exception('Failed to load customer by id.');\n }\n }\n catch (Exception $e) {\n throw new Exception($this->__('Wrong customer account specified.'));\n }\n\n // check if it is inactive\n if ($customer->getConfirmation()) {\n if ($customer->getConfirmation() !== $key) {\n throw new Exception($this->__('Wrong confirmation key.'));\n }\n\n // activate customer\n try {\n $customer->setConfirmation(null);\n $customer->save();\n }\n catch (Exception $e) {\n throw new Exception($this->__('Failed to confirm customer account.'));\n }\n\n // log in and send greeting email, then die happy\n $this->_getSession()->setCustomerAsLoggedIn($customer);\n $successUrl = $this->_welcomeCustomer($customer, true);\n $this->_redirectSuccess('social/user/interesttab');\n //$this->_redirectSuccess($backUrl ? $backUrl : $successUrl);\n\t\t$this->_redirect('social/user/interesttab');\n return;\n }\n\t\t$this->_redirect('social/user/interesttab');\n // die happy\n // $this->_redirectSuccess(Mage::getUrl('*/*/index', array('_secure'=>true)));\n return;\n }\n catch (Exception $e) {\n // die unhappy\n $this->_getSession()->addError($e->getMessage());\n $this->_redirectError(Mage::getUrl('*/*/index', array('_secure'=>true)));\n return;\n }\n }", "public function confirmAction()\n {\n $session = $this->_getSession();\n if ($session->isLoggedIn()) {\n $this->_getSession()->logout()->regenerateSessionId();\n }\n try {\n $id = $this->getRequest()->getParam('id', false);\n $key = $this->getRequest()->getParam('key', false);\n $backUrl = $this->getRequest()->getParam('back_url', false);\n if (empty($id) || empty($key)) {\n throw new Exception($this->__('Bad request.'));\n }\n\n // load customer by id (try/catch in case if it throws exceptions)\n try {\n $customer = $this->_getModel('customer/customer')->load($id);\n if ((!$customer) || (!$customer->getId())) {\n throw new Exception('Failed to load customer by id.');\n }\n }\n catch (Exception $e) {\n throw new Exception($this->__('Wrong customer account specified.'));\n }\n\n // check if it is inactive\n if ($customer->getConfirmation()) {\n if ($customer->getConfirmation() !== $key) {\n throw new Exception($this->__('Wrong confirmation key.'));\n }\n\n // activate customer\n try {\n $customer->setConfirmation(null);\n $customer->save();\n }\n catch (Exception $e) {\n throw new Exception($this->__('Failed to confirm customer account.'));\n }\n\n // log in and send greeting email, then die happy\n $session->setCustomerAsLoggedIn($customer);\n $successUrl = $this->_welcomeCustomer($customer, true);\n $this->_redirectSuccess($backUrl ? $backUrl : $successUrl);\n return;\n }\n\n // die happy\n $this->_redirectSuccess($this->_getUrl('*/*/index', array('_secure' => true)));\n return;\n }\n catch (Exception $e) {\n // die unhappy\n $this->_getSession()->addError($e->getMessage());\n $this->_redirectError($this->_getUrl('*/*/index', array('_secure' => true)));\n return;\n }\n }", "public function action_account_transaction() {\n $package = Model::factory('package');\n $invoice_id = explode('/', $_SERVER['REQUEST_URI']);\n $transaction_info = $package->account_transaction($invoice_id[3]);\n $this->template->title = CLOUD_SITENAME . ' | Account';\n $this->template->page_title = __('account_transaction_details');\n $this->meta_description = \"\";\n $this->template->content = View::factory(\"admin/package_plan/account_transaction\")\n ->bind('transaction_info', $transaction_info);\n }", "public function Confirmation(){\n\n /* * * * * * * * * * * * * * * * * * * * * * * *\n * <head> STUFF </head>\n */\n define(\"PAGE_TITLE\", SITE_NAME);\n define(\"PAGE_DESCR\", SITE_NAME);\n define(\"PAGE_ID\", \"confirmation\");\n \n /* Load the view */\n // In a V2 project, we will implement the real paiement via visa card\n\t $array = '';\n\t $this->load->view('cart', 'confirmation', $array); \n\t\t\t$_SESSION['doneff'] = false;\n \n \n }", "public function seamlessConfirmAction()\r\n {\r\n try {\r\n $data = $this->_checkReturnedPost(true);\r\n $storeId = $this->order->getStoreId();\r\n $methodCode = $this->paymentInst->getCode();\r\n $secretKey = Mage::getStoreConfig('payment/'.$methodCode.'/secret_key', $storeId);\r\n $confirmResponse = WirecardCEE_Client_QPay_Return::generateConfirmResponseString();\r\n $return = WirecardCEE_Client_QPay_Return::createReturnInstance($data['raw'], $secretKey);\r\n\r\n if($return->validate()) {\r\n $this->_confirmState($data['post'], $return);\r\n\r\n } else {\r\n throw new Exception('Unhandled Wirecard Checkout Seamless action \"'.$data['paymentState'].'\".');\r\n }\r\n\r\n $this->order->save();\r\n // send confirmation for status change\r\n die($confirmResponse);\r\n\r\n } catch (Exception $e) {\r\n $orderId = (!empty($data['orderId'])) ? $data['orderId'] : '';\r\n Mage::log('Wirecard Checkout Page transaction status update failed: '.$e->getMessage(). '('.$orderId.')');\r\n Mage::log($e->getMessage() . \"\\n\" . $e->getTraceAsString(), null, 'wirecard_checkout_page_exception.log');\r\n $confirmResponse = WirecardCEE_Client_QPay_Return::generateConfirmResponseString($e->getMessage());\r\n die($confirmResponse);\r\n }\r\n }", "public function transactionsAction()\n {\n $this->_initOrder();\n $this->loadLayout(false);\n $this->renderLayout();\n }", "public function subscription_confirm()\n {\n $model = & $this->getModel('jms');\n $model->subscriptionConfirm();\n\n\n // $this->setRedirect('index.php?option=com_jms&task=jms.subscription_confirm&payment_method=iwl_paypal');\n }", "public function actionConfirm() {\n $this->renderPartial('manage/show',\n array('model' => $this->loadAuthItem(), 'updateList' => false, 'delete' => true),\n false, true);\n }", "function viewtransactionAction() {\n /**\n * Checked that user is loggin or not.\n */\n if (! $this->_getSession ()->isLoggedIn ()) {\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( 'You must have a Seller Account to access this page' ) );\n $this->_redirect ( 'marketplace/seller/login' );\n return;\n }\n /**\n * load and render layout\n */\n $this->loadLayout ();\n $this->getLayout ()->getBlock ( 'head' )->setTitle ( $this->__ ( 'Transaction History' ) );\n $this->renderLayout ();\n }", "public function confirm() {\n\n\t\t//Use false to prevent valid boolean to get deleted\n\t\t$cart = retinashopCart::getCart();\n\t\tif ($cart) {\n\t\t\t$cart->confirmDone();\n\t\t\t$view = $this->getView('cart', 'html');\n\t\t\t$view->setLayout('order_done');\n\t\t\t// Display it all\n\t\t\t$view->display();\n\t\t} else {\n\t\t\t$mainframe = JFactory::getApplication();\n\t\t\t$mainframe->redirect(JRoute::_('index.php?option=com_retinashop&view=cart'), RText::_('COM_RETINASHOP_CART_DATA_NOT_VALID'));\n\t\t}\n\t}", "public function requestconfirmAction() {\n $purchaseOrderId = $this->getRequest()->getParam('id');\n $purchaseOrder = Mage::getModel('inventorypurchasing/purchaseorder')->load($purchaseOrderId);\n try {\n $purchaseOrder->setStatus(Magestore_Inventorypurchasing_Model_Purchaseorder::WAITING_CONFIRM_STATUS)\n ->save();\n if (Mage::getStoreConfig('inventoryplus/purchasing/send_email_to_supplier_after_request_confirmation')) {\n $purchaseOrderProducts = Mage::getModel('inventorypurchasing/purchaseorder_product')->getCollection()\n ->addFieldToFilter('purchase_order_id', $purchaseOrderId);\n\n $sqlNews = $purchaseOrderProducts->getData();\n $this->sendEmail($purchaseOrder->getSupplierId(), $sqlNews, $purchaseOrderId);\n $purchaseOrder->setSendMail(1)->save();\n }\n Mage::getSingleton('vendors/session')->addSuccess(\n Mage::helper('inventorypurchasing')->__('Purchase order has been requested for confirmation.')\n );\n $this->_redirect('*/*/edit', array('id' => $purchaseOrderId));\n } catch (Exception $e) {\n Mage::getSingleton('vendors/session')->addError(\n Mage::helper('inventorypurchasing')->__('There is error while confirming purchase order.')\n );\n Mage::getSingleton('vendors/session')->addError(\n $e->getMessage()\n );\n $this->_redirect('*/*/edit', array('id' => $purchaseOrderId));\n }\n }", "public function transactionAction() {\n\n//Project ID\n $this->view->project_id = $project_id = $this->_getParam('project_id', null);\n $project = Engine_Api::_()->getItem('sitecrowdfunding_project', $project_id);\n\n $viewer = Engine_Api::_()->user()->getViewer();\n\n if (!$this->_helper->requireAuth()->setAuthParams($project, $viewer, \"edit\")->isValid()) {\n return;\n }\n\n $this->view->call_same_action = $this->_getParam('call_same_action', 0);\n $this->view->transaction_state = Engine_Api::_()->getDbtable('transactions', 'sitecrowdfunding')->getTransactionState(true, $project_id);\n\n $params = array();\n $params['page'] = $this->_getParam('page', 1);\n $params['limit'] = 20;\n $params['project_id'] = $project_id;\n\n if (isset($_POST['search'])) {\n $this->_helper->layout->disableLayout();\n $params['search'] = 1;\n $params['date'] = $_POST['date'];\n $params['response_min_amount'] = $_POST['response_min_amount'];\n $params['response_max_amount'] = $_POST['response_max_amount'];\n $params['state'] = $_POST['state'];\n $this->view->only_list_content = true;\n }\n\n//MAKE PAGINATOR\n $this->view->paginator = Engine_Api::_()->getDbtable('paymentrequests', 'sitecrowdfunding')->getAllAdminTransactionsPaginator($params);\n $this->view->total_item = $this->view->paginator->getTotalItemCount();\n }", "public function confirm() {\n\n\t\t//Use false to prevent valid boolean to get deleted\n\t\t$cart = VirtueMartCart::getCart();\n\t\tif ($cart) {\n\t\t\t$cart->confirmDone();\n\t\t\t$view = $this->getView('cart', 'html');\n\t\t\t$view->setLayout('order_done');\n\t\t\t// Display it all\n\t\t\t$view->display();\n\t\t} else {\n\t\t\t$mainframe = JFactory::getApplication();\n\t\t\t$mainframe->redirect(JRoute::_('index.php?option=com_virtuemart&view=cart', FALSE), JText::_('COM_VIRTUEMART_CART_DATA_NOT_VALID'));\n\t\t}\n\t}", "public function actionConfirm() {\n $this->checkLogin();\n $member_id = Yii::app()->loginUser->getUserId();\n $error = '';\n //查找会员密保问题关联id\n $member_to_security = UcMemberToSecurityQuestion::model()->findByAttributes(array('member_id' => $member_id));\n if (isset($_POST['SecurityQuestion']['answer']) && $_POST['SecurityQuestion']['answer']) {\n if ($member_to_security->answer_1 != $this->getString($_POST['SecurityQuestion']['answer'])) {\n $error = '密保答案不正确';\n } else {\n $member_to_security->status = 1;\n $member_to_security->save();\n $this->redirect('ucenter.php?r=account/questionDone');\n }\n }\n //查找会员密保问题\n $member_question = UcSecurityQuestion::model()->findByPk($member_to_security->security_question_id_1);\n $arrRender = array(\n 'error' => $error,\n 'member_id' => $member_id,\n 'gShowHeader' => true,\n 'return_url' => $this->createAbsoluteUrl('account/index'),\n 'headerTitle' => '确认安全问题',\n 'question' => $member_question->question_text,\n );\n $this->smartyRender('account/confirm_one.tpl', $arrRender);\n }", "public function retrievetrfrconfirmAction() {\n $this->title = 'Corporate Fund Reversal Confirm';\n $user = Zend_Auth::getInstance()->getIdentity();\n $id = $this->_getParam('id');\n $trfrAmount = $this->_getParam('trframount');\n $this->validateTxnCorporate($id);\n $form = new CorporateFundTransferConfirmForm();\n $form->getElement(\"submit\")->setLabel(\"Yes, Reverse Fund\");\n if ($this->getRequest()->isPost()) {\n if ($form->isValid($this->getRequest()->getPost())) {\n try {\n $validator = new Validator_LimitValidator();\n $res = $validator->chkAvailableCorporateBalance($id, $trfrAmount);\n } catch (App_Exception $e) {\n $res = false;\n $msg = $e->getMessage();\n } catch (Exception $e) {\n $res = false;\n $msg = $e->getMessage();\n }\n if ($res) {\n //echo 'Transfering Fund';exit;\n try {\n $baseTxnModel = new BaseTxn();\n $baseTxnModel->corporateToCorporate(array(\n 'txn_corporate_id' => $id,\n 'corporate_id' => $user->id,\n 'amount' => $trfrAmount,\n 'txn_type' => TXNTYPE_CORPORATE_TOCORPORATE_FUND_REVERSAL,\n ));\n } catch (App_Exception $e) {\n $res = false;\n $msg = $e->getMessage();\n } catch (Exception $e) {\n $res = false;\n $msg = $e->getMessage();\n }\n }\n if ($res) {\n $this->_helper->FlashMessenger(\n array(\n 'msg-success' => 'Fund Reverse from Corpoate Successfully.',\n )\n );\n\n //Redirect to Confirm URL\n $this->_redirect($this->formatURL('/linkedcorporates/subcorporatelisting'));\n } else {\n $this->_helper->FlashMessenger(\n array(\n //'msg-error' => $agentBalance . ' is less then ' . $trfrAmount,\n //'msg-error' => 'Your balance is less then ' . $trfrAmount,\n 'msg-error' => $msg,\n )\n );\n }\n } // valid\n\n $row = $this->_request->getPost();\n $form->populate($row);\n }\n\n //Pending Error Handling if agent not found\n $this->view->corporateId = $id;\n $this->view->form = $form;\n\n $agent = new CorporateBalance();\n $balanceInfo = $agent->getCorporateBalance($user->id);\n $myBalance = $balanceInfo + $trfrAmount;\n $txnAgentbalanceInfo = $agent->getCorporateBalance($id);\n $txnAgentBalance = $txnAgentbalanceInfo - $trfrAmount;\n \n $coporate = new Corporates();\n $agentInfo = $coporate->findById($id);\n\n\n $items = new stdClass();\n $items->name = $agentInfo['first_name'] . ' ' . $agentInfo['last_name'];\n $items->txn_amount = Util::numberFormat($trfrAmount);\n $items->my_balance = Util::numberFormat($myBalance);\n $items->txn_agent_balance = Util::numberFormat($txnAgentBalance);\n $this->view->items = $items;\n }", "public function confirm($action, $id = null);", "public function makePaymentAction()\n {\n if ($_SESSION['actionAvailable']) {\n try {\n $id = $_SESSION['id'];\n $account = new BankAccountModel(null, $id);\n $toAccountID = $_POST['accountTo'];\n\n\n $fromAccountID = $account->findID($_POST['accountFrom']);\n $transaction = new TransactionModel();\n $transaction->validateTransfer($toAccountID, $fromAccountID);\n $transaction->makeTransfer();\n $transaction->save();\n\n $view = new View('transactionComplete');\n echo $view->render();\n $_SESSION['actionAvailable'] = false;\n } catch (\\UnexpectedValueException $e) {\n $_SESSION['emptyField'] = true;\n $this->redirect('paymentPage');\n } catch (\\LogicException $e) {\n $_SESSION['validTransaction'] = false;\n $this->redirect('paymentPage');\n }\n }\n }", "public function confirm()\n {\n $task = $this->getTask();\n $link = $this->getExternalTaskLink($task);\n\n $this->response->html($this->template->render('task_external_link/remove', array(\n 'link' => $link,\n 'task' => $task,\n )));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
add the relevant ticket information and meta to each order item that needs it, along with a change button for event swaps
protected function _draw_item_ticket_info( $item_id, $item, $product ) { // if the product is not a ticket, then never display event meta if ( ! is_object( $product ) || get_post_meta( $product->get_id(), '_ticket', true ) != 'yes' ) return; $event_id = isset( $item['event_id'] ) && $item['event_id'] > 0 ? $item['event_id'] : false; ?> <div class="meta-list ticket-info" rel="ticket-info"> <div class="change-button-wrap"><a href="#" class="button change-ticket" item-id="<?php echo esc_attr( $item_id ) ?>" event-id="<?php echo esc_attr( $event_id ) ?>" qty="<?php echo esc_attr( $item['qty'] ) ?>"><?php _e( 'Change', 'opentickets-community-edition' ) ?></a></div> <?php if ( $event_id ): ?> <?php $event = get_post( $event_id ); $area_type = apply_filters( 'qsot-event-area-type-for-event', false, $event ); ?> <div class="info"> <?php $format = '<a rel="edit-event" target="_blank" href="%s">%s</a>' ?> <strong><?php _e( 'Event:', 'opentickets-community-edition' ) ?></strong> <?php echo sprintf( $format, get_edit_post_link( $event->ID ), apply_filters( 'the_title', $event->post_title, $event->ID ) ) ?> </div> <?php $area_type->order_item_display( $item, $product, $event ) ?> <?php else: ?> <div class="info"><strong><?php _e( 'Event:', 'opentickets-community-edition' ) ?></strong> <span class="event-name"><?php _e( '(no event selected)', 'opentickets-community-edition' ) ?></span></div> <?php endif; ?> <?php do_action( 'qsot-ticket-item-meta', $item_id, $item, $product ) ?> </div> <?php }
[ "public function track_add_order_from_edit()\n {\n }", "function my_em_event_order_boxes(){ \n\tadd_meta_box('em-event-order', 'Order Details', 'my_em_event_order_metabox','tribe_events', 'side','low');\n}", "public function wcla_woocommerce_order_items_meta_box($post) {\n global $wpdb, $thepostid, $theorder, $woocommerce;\n\n if (!is_object($theorder))\n $theorder = new WC_Order($thepostid);\n\n $order = $theorder;\n\n $data = get_post_meta($post->ID);\n ?>\n <div class=\"woocommerce_order_items_wrapper\">\n <table cellpadding=\"0\" cellspacing=\"0\" class=\"woocommerce_order_items\">\n <thead>\n <tr>\n <th><input type=\"checkbox\" class=\"check-column\" /></th>\n <th class=\"item\" colspan=\"2\"><?php _e('Item', 'woocommerce'); ?></th>\n\n <?php do_action('woocommerce_admin_order_item_headers'); ?>\n\n <?php if (get_option('woocommerce_calc_taxes') == 'yes') : ?>\n <th class=\"tax_class\"><?php _e('Tax Class', 'woocommerce'); ?>&nbsp;<a class=\"tips\" data-tip=\"<?php _e('Tax class for the line item', 'woocommerce'); ?>.\" href=\"#\">[?]</a></th>\n <?php endif; ?>\n\n <th class=\"quantity\"><?php _e('Qty', 'woocommerce'); ?></th>\n\n <th class=\"line_cost\"><?php _e('Totals', 'woocommerce'); ?>&nbsp;<a class=\"tips\" data-tip=\"<?php _e('Line subtotals are before pre-tax discounts, totals are after.', 'woocommerce'); ?>\" href=\"#\">[?]</a></th>\n\n <?php if (get_option('woocommerce_calc_taxes') == 'yes') : ?>\n <th class=\"line_tax\"><?php _e('Tax', 'woocommerce'); ?></th>\n <?php endif; ?>\n </tr>\n </thead>\n <tbody id=\"order_items_list\">\n\n <?php\n // List order items\n $order_items = $order->get_items(apply_filters('woocommerce_admin_order_item_types', array('line_item', 'fee')));\n\n foreach ($order_items as $item_id => $item) {\n\n switch ($item['type']) {\n case 'line_item' :\n $_product = $order->get_product_from_item($item);\n $item_meta = $order->get_item_meta($item_id);\n include( DESIGNER_DIR . 'woocommerce/admin/post-types/writepanels/order-item-html.php' );\n break;\n case 'fee' :\n\n include( PLUGINDIR . '/' . plugin_basename('woocommerce') . '/admin/post-types/writepanels/order-fee-html.php' );\n break;\n }\n\n do_action('woocommerce_order_item_' . $item['type'] . '_html');\n }\n ?>\n </tbody>\n </table>\n </div>\n\n <p class=\"bulk_actions\">\n <select>\n <option value=\"\"><?php _e('Actions', 'woocommerce'); ?></option>\n <optgroup label=\"<?php _e('Edit', 'woocommerce'); ?>\">\n <option value=\"delete\"><?php _e('Delete Lines', 'woocommerce'); ?></option>\n </optgroup>\n <optgroup label=\"<?php _e('Stock Actions', 'woocommerce'); ?>\">\n <option value=\"reduce_stock\"><?php _e('Reduce Line Stock', 'woocommerce'); ?></option>\n <option value=\"increase_stock\"><?php _e('Increase Line Stock', 'woocommerce'); ?></option>\n </optgroup>\n </select>\n\n <button type=\"button\" class=\"button do_bulk_action wc-reload\" title=\"<?php _e('Apply', 'woocommerce'); ?>\"><span><?php _e('Apply', 'woocommerce'); ?></span></button>\n </p>\n\n <p class=\"add_items\">\n <select id=\"add_item_id\" class=\"ajax_chosen_select_products_and_variations\" multiple=\"multiple\" data-placeholder=\"<?php _e('Search for a product&hellip;', 'woocommerce'); ?>\" style=\"width: 400px\"></select>\n\n <button type=\"button\" class=\"button add_order_item\"><?php _e('Add item(s)', 'woocommerce'); ?></button>\n <button type=\"button\" class=\"button add_order_fee\"><?php _e('Add fee', 'woocommerce'); ?></button>\n </p>\n <div class=\"clear\"></div>\n <?php\n }", "function order_meta_box() {\n global $post;\n $order_id = $post->ID;\n $user_id = get_post_meta( $order_id, '_customer_user', true );\n $order_date = get_post_meta( $order_id, 'order_date', true );\n $items = $this->get_order_items( $order_id );\n $lines = array();\n foreach ( $items as $item ) {\n $product_id = intval( $item['product_id'] );\n $quantity = intval( $item['quantity'] );\n $meal = $this->get_meal_data( $product_id, $user_id, $order_date );\n if ( is_null( $meal ) ) {\n $product = get_post( $product_id );\n $meal_name = $product->post_title;\n } else {\n $meal_name = $meal->post_title;\n }\n $lines[] = $meal_name . ' x ' . $quantity;\n }\n echo '<p><strong>' . __('Date') . ':</strong> ' . esc_html( get_post_meta( $order_id, 'order_date', true ) ) . '</p>';\n echo '<p><strong>' . __('Notes') . ':</strong> ' . esc_html( $post->post_excerpt ) . '</p>';\n echo '<p><strong>' . __('Meal') . ':</strong> <ul style=\"list-style-type: disc;margin-left: 20px;\">';\n foreach ( $lines as $line ) {\n echo '<li>' . esc_html( $line ) . '</li>';\n }\n echo '</ul></p>';\n }", "function render_meta_on_cart_and_checkout($cart_data, $cart_item = null) {\n\n $custom_items = array();\n /* Woo 2.4.2 updates */\n if (!empty($cart_data)) {\n $custom_items = $cart_data;\n }\n if (isset($cart_item['bathroom'])) {\n $custom_items[] = array(\"name\" => _e(\"Bathroom\", \"Avada\"), \"value\" => $cart_item['bathroom']);\n }\n if (isset($cart_item['bedroom'])) {\n $custom_items[] = array(\"name\" => _e(\"Bedroom\", \"Avada\"), \"value\" => $cart_item['bedroom']);\n }\n\n if (isset($cart_item['recommended_hour'])) {\n $custom_items[] = array(\"name\" => 'Recommended Hours', \"value\" => $cart_item['recommended_hour']);\n }\n if (isset($cart_item['hourly_charges'])) {\n $custom_items[] = array(\"name\" => 'Hourly Charges', \"value\" => $cart_item['hourly_charges']);\n }\n if (isset($cart_item['total_charges'])) {\n \n $total_extra_minutes = 0;\n $emc = 0;\n if($cart_item[\"extra_services\"]!=\"\"){\n foreach($cart_item[\"extra_services\"] as $services){\n $total_extra_minutes = $total_extra_minutes + $services['extra_time'];\n }\n }\n if($total_extra_minutes>0){\n $emc = ($total_extra_minutes * $cart_item['hourly_charges'])/60;\n }\n $cart_tc = $cart_item['total_charges'] + $emc;\n \n $custom_items[] = array(\"name\" => 'Total Charges', \"value\" => $cart_tc);\n }\n if (isset($cart_item['date'])) {\n $custom_items[] = array(\"name\" => 'Date', \"value\" => $cart_item['date']);\n }\n if (isset($cart_item['time'])) {\n $custom_items[] = array(\"name\" => 'Time', \"value\" => $cart_item['time']);\n }\n if (isset($cart_item['email'])) {\n $custom_items[] = array(\"name\" => 'Email', \"value\" => $cart_item['email']);\n }\n if (isset($cart_item['service_hour'])) {\n $sh = explode(':',$cart_item['service_hour']);\n $sh_h = $sh[0];\n $sh_m = $sh[1];\n if($sh_m == ''){\n $sh_m = 0;\n }\n $total_extra_minutes = 0;\n $total_extra_minutes = $total_extra_minutes + $sh_m;\n if($cart_item[\"extra_services\"]!=\"\"){\n foreach($cart_item[\"extra_services\"] as $services){\n $total_extra_minutes = $total_extra_minutes + $services['extra_time'];\n }\n if($total_extra_minutes>=60){\n $total_extra_hours = intdiv($total_extra_minutes, 60);\n $total_extra_minutes = ($total_extra_minutes % 60);\n }\n }\n $total_hours = 0;\n $total_minutes = '';\n if($total_extra_hours > 0){\n $total_hours = $sh_h + $total_extra_hours;\n }\n else{\n $total_hours = $sh_h;\n }\n if($total_extra_minutes!=0){\n $total_hours = $total_hours.':'.$total_extra_minutes;\n }\n\n\n $custom_items[] = array(\"name\" => 'Service Hours', \"value\" => $total_hours);\n }\n if (isset($cart_item['extraservices'])) {\n $custom_items[] = array(\"name\" => 'Extra Services', \"value\" => $cart_item['extraservices'][0]['title']);\n }\n if (isset($values['extra_services'])) {\n wc_add_order_item_meta($item_id, \"extra_services\", $values['extra_services']);\n }\n if (isset($values['service_hour'])) {\n wc_add_order_item_meta($item_id, \"service_hour\", $values['service_hour']);\n }\n /* if (isset($values['extra_hours'])) {\n wc_add_order_item_meta($item_id, \"extra_hours\", $values['extra_hours']);\n } */\n\n return $custom_items;\n}", "function save_special_fields(){\r\n\t\t\r\n\t\tadd_action( 'woocommerce_checkout_update_order_meta', [$this,'save_speical_fields_to_order_meta'] );\r\n\t}", "function set_ticket_data() {\n\n // Get codeigniter object instance\n $CI = &get_instance();\n\n // Verify if ticket's ID is numeric\n if ( is_numeric( $CI->input->get('ticket', true) ) ) {\n\n // Get ticket\n $ticket = $CI->tickets_model->get_ticket($CI->input->get('ticket', true));\n\n // If ticket exists will be added ticket in the queue\n if ( $ticket ) {\n\n // Add the ticket in the queue\n md_set_component_variable('support_single_ticket', $ticket);\n\n // Get ticket's replies\n $replies = $CI->tickets_model->get_ticket_replies($CI->input->get('ticket', true));\n\n // Verify if the ticket has replies\n if ( $replies ) {\n\n // Add the ticket's replies in the queue\n md_set_component_variable('support_single_ticket_replies', $replies);\n \n }\n\n }\n\n }\n \n }", "public function yith_ywpi_add_item_metas( $order_id ){\n\n\t\t $order = wc_get_order( $order_id );\n\t\t $items = $order->get_items();\n\n\t\t foreach ( $items as $item_id => $item ){\n\n\t\t $product = $order->get_product_from_item( $item );\n\n\t\t $product_regular_price = $product->get_regular_price();\n\t\t $product_sku = $product->get_sku();\n\t\t $product_short_description = $product->get_short_description();\n\n\t\t wc_update_order_item_meta( $item_id, '_ywpi_product_regular_price', $product_regular_price );\n wc_update_order_item_meta( $item_id, '_ywpi_product_sku', $product_sku );\n wc_update_order_item_meta( $item_id, '_ywpi_product_short_description', $product_short_description );\n\n do_action( 'yith_ywpi_custom_item_metas', $item_id, $order );\n }\n\n }", "function carton_order_items_meta_box( $post ) {\n\tglobal $wpdb, $thepostid, $theorder, $carton;\n\n\tif ( ! is_object( $theorder ) )\n\t\t$theorder = new CTN_Order( $thepostid );\n\n\t$order = $theorder;\n\n\t$data = get_post_meta( $post->ID );\n\t?>\n\t<div class=\"carton_order_items_wrapper\">\n\t\t<table cellpadding=\"0\" cellspacing=\"0\" class=\"carton_order_items\">\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<th><input type=\"checkbox\" class=\"check-column\" /></th>\n\t\t\t\t\t<th class=\"item\" colspan=\"2\"><?php _e( 'Item', 'carton' ); ?></th>\n\n\t\t\t\t\t<?php do_action( 'carton_admin_order_item_headers' ); ?>\n\n\t\t\t\t\t<?php if ( get_option( 'carton_calc_taxes' ) == 'yes' ) : ?>\n\t\t\t\t\t\t<th class=\"tax_class\"><?php _e( 'Tax Class', 'carton' ); ?>&nbsp;<a class=\"tips\" data-tip=\"<?php _e( 'Tax class for the line item', 'carton' ); ?>.\" href=\"#\">[?]</a></th>\n\t\t\t\t\t<?php endif; ?>\n\n\t\t\t\t\t<th class=\"quantity\"><?php _e( 'Qty', 'carton' ); ?></th>\n\n\t\t\t\t\t<th class=\"line_cost\"><?php _e( 'Cost', 'carton' ); ?>&nbsp;<a class=\"tips\" data-tip=\"<?php _e( 'Line subtotals are before pre-tax discounts, totals are after.', 'carton' ); ?>\" href=\"#\">[?]</a></th>\n\n\t\t\t\t\t<?php if ( get_option( 'carton_calc_taxes' ) == 'yes' ) : ?>\n\t\t\t\t\t\t<th class=\"line_tax\"><?php _e( 'Tax', 'carton' ); ?></th>\n\t\t\t\t\t<?php endif; ?>\n\t\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<tbody id=\"order_items_list\">\n\n\t\t\t\t<?php\n\t\t\t\t\t// List order items\n\t\t\t\t\t$order_items = $order->get_items( apply_filters( 'carton_admin_order_item_types', array( 'line_item', 'fee' ) ) );\n\n\t\t\t\t\tforeach ( $order_items as $item_id => $item ) {\n\n\t\t\t\t\t\tswitch ( $item['type'] ) {\n\t\t\t\t\t\t\tcase 'line_item' :\n\t\t\t\t\t\t\t\t$_product \t= $order->get_product_from_item( $item );\n\t\t\t\t\t\t\t\t$item_meta \t= $order->get_item_meta( $item_id );\n\n\t\t\t\t\t\t\t\tif ( $_product )\n\t\t\t\t\t\t\t\t\tinclude( 'order-item-html.php' );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'fee' :\n\t\t\t\t\t\t\t\tinclude( 'order-fee-html.php' );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdo_action( 'carton_order_item_' . $item['type'] . '_html' );\n\n\t\t\t\t\t}\n\t\t\t\t?>\n\t\t\t</tbody>\n\t\t</table>\n\t</div>\n\n\t<p class=\"bulk_actions\">\n\t\t<select>\n\t\t\t<option value=\"\"><?php _e( 'Actions', 'carton' ); ?></option>\n\t\t\t<optgroup label=\"<?php _e( 'Edit', 'carton' ); ?>\">\n\t\t\t\t<option value=\"delete\"><?php _e( 'Delete Lines', 'carton' ); ?></option>\n\t\t\t</optgroup>\n\t\t\t<optgroup label=\"<?php _e( 'Stock Actions', 'carton' ); ?>\">\n\t\t\t\t<option value=\"reduce_stock\"><?php _e( 'Reduce Line Stock', 'carton' ); ?></option>\n\t\t\t\t<option value=\"increase_stock\"><?php _e( 'Increase Line Stock', 'carton' ); ?></option>\n\t\t\t</optgroup>\n\t\t</select>\n\n\t\t<button type=\"button\" class=\"button do_bulk_action wc-reload\" title=\"<?php _e( 'Apply', 'carton' ); ?>\"><span><?php _e( 'Apply', 'carton' ); ?></span></button>\n\t</p>\n\n\t<p class=\"add_items\">\n\t\t<select id=\"add_item_id\" class=\"ajax_chosen_select_products_and_variations\" multiple=\"multiple\" data-placeholder=\"<?php _e( 'Search for a product&hellip;', 'carton' ); ?>\" style=\"width: 400px\"></select>\n\n\t\t<button type=\"button\" class=\"button add_order_item\"><?php _e( 'Add item(s)', 'carton' ); ?></button>\n\t\t<button type=\"button\" class=\"button add_order_fee\"><?php _e( 'Add fee', 'carton' ); ?></button>\n\t</p>\n\t<div class=\"clear\"></div>\n\t<?php\n}", "public function addOrderDetailsToQueue($observer)\n {\n if (!Mage::getStoreConfigFlag('factfinder/export/track_checkout')\n || !Mage::helper('factfinder')->isEnabled('tracking')\n || Mage::helper('factfinder')->isInternal()\n ) {\n return;\n }\n\n $order = $observer->getOrder();\n $customerId = $order->getCustomerId();\n if ($customerId) {\n $customerId = md5('customer_' . $customerId);\n }\n\n $trackingIdFieldName = Mage::helper('factfinder_tracking')->getIdFieldName();\n $masterIdFieldName = Mage::helper('factfinder/search')->getIdFieldName();\n\n /** @var Mage_Sales_Model_Order_Item $item */\n foreach ($order->getAllItems() as $item) {\n if ($item->getChildrenItems()) {\n continue;\n }\n\n // use product id as default value in case there's no parent item\n $parentProductId = $item->getProduct()->getData($masterIdFieldName);\n $price = $item->getPriceInclTax();\n\n $parentItem = $item->getParentItem();\n\n if ($parentItem) {\n $parentProductId = $parentItem->getProduct()->getData($masterIdFieldName);\n if ($parentItem->getProduct()->isConfigurable()) {\n $price = $parentItem->getPriceInclTax();\n }\n }\n\n try {\n Mage::getModel('factfinder_tracking/queue')\n ->setProductId($item->getProduct()->getData($trackingIdFieldName))\n ->setParentProductId($parentProductId)\n ->setProductName($item->getName())\n ->setSid(Mage::helper('factfinder_tracking')->getSessionId())\n ->setUserid($customerId)\n ->setPrice($price)\n ->setCount($item->getQtyOrdered())\n ->setStoreId($order->getStoreId())\n ->save();\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }\n }", "function action_woocommerce_order_item_add_line_buttons( $order ) { \n\n print '<button type=\"button\" class=\"button add-order-custom-item\">';\n esc_html_e( 'Add Custom Order Item', 'custom-products' );\n print'</button>';\n ?>\n <script type=\"text/template\" id=\"tmpl-wc-modal-add-custom-item\">\n <div class=\"wc-backbone-modal\">\n <div class=\"wc-backbone-modal-content\">\n <section class=\"wc-backbone-modal-main\" role=\"main\">\n <header class=\"wc-backbone-modal-header\">\n <h1><?php _e(\"Add Custom Item\", 'custom-products'); ?></h1>\n <button class=\"modal-close modal-close-link dashicons dashicons-no-alt\">\n <span class=\"screen-reader-text\">Close modal panel</span>\n </button>\n </header>\n <article>\n <form action=\"\" method=\"post\">\n <table class=\"form-table\">\n\n <tbody><tr><th scope=\"row\"><label for=\"custom_item_description\"><?php _e(\"Order line description\", 'custom-products'); ?>:</label></th>\n <td>\n <textarea name=\"description\" id=\"custom_item_description\" cols=\"60\" rows=\"3\"></textarea>\n <p class=\"description\" id=\"tagline-description\"><?php _e(\"Describe this custom order item\", 'custom-products'); ?>.</p></td>\n </tr>\n <tr><th scope=\"row\"><label for=\"custom-item-cost\"><?php _e(\"Cost\", 'custom-products'); ?>:</label></th>\n <td><input id=\"custom-item-cost\" name=\"value\" type=\"text\">\n <p class=\"description\" id=\"tagline-description\"><?php _e(\"Set the price for this item (use decimal notation (.) )\", 'custom-products'); ?>.</p></td>\n </tr>\n </tbody>\n </table>\n </form>\n </article>\n <footer>\n <div class=\"inner\">\n <button id=\"btn-ok\" class=\"button button-primary button-large\"><?php _e(\"Add\"); ?></button>\n </div>\n </footer>\n </section>\n </div>\n </div>\n\t <div class=\"wc-backbone-modal-backdrop modal-close\"></div>\n </script>\n <?php\n}", "function sv_wc_admin_custom_order_fields_add_to_notes( $order_id, $post) {\n\terror_log( 'sv_wc_admin_custom_order_fields_add_to_notes1 $order_id:' . print_r( $order_id, true ) );\n\n\t//error_log( 'method_name1 $var:' . print_r( $var, true ) );\n\n\t$updated_custom_fields = isset( $_POST['wc-admin-custom-order-fields'] ) ? $_POST['wc-admin-custom-order-fields'] : null;\n\n\tif ( empty( $updated_custom_fields ) ) {\n\t\treturn;\n\t}\n\terror_log( 'sv_wc_admin_custom_order_fields_add_to_notes2 $order_id:' . print_r( $order_id, true ) );\n\n\t$order = wc_get_order( $post );\n\t$order_fields = wc_admin_custom_order_fields()->get_order_fields();\n\n\tforeach ( $order_fields as $custom_field ) {\n\t\terror_log( 'sv_wc_admin_custom_order_fields_add_to_notes3 $order_id:' . print_r( $order_id, true ) );\n\n\t\t$field_id = $custom_field->get_id();\n\t\t$field_meta_key = $custom_field->get_meta_key();\n\t\t$updated_value = isset( $updated_custom_fields[ $field_id ] ) ? $updated_custom_fields[ $field_id ] : '';\n\n\t\t// Update a custom field value unless it's empty...\n\t\t// A value of 0 is valid, so check for that first.\n\t\t// Empty string is also allowed to clear out custom fields completely.\n\t\tif ( '0' === $updated_value || '' === $updated_value || ! empty( $updated_value ) ) {\n\t\t\terror_log( 'sv_wc_admin_custom_order_fields_add_to_notes4 $order_id:' . print_r( $order_id, true ) );\n\n\t\t\t// Special handling for date fields.\n\t\t\tif ( 'date' === $order_fields[ $field_id ]->get_type() ) {\n\t\t\t\terror_log( 'sv_wc_admin_custom_order_fields_add_to_notes5 $order_id:' . print_r( $order_id, true ) );\n\n\t\t\t\t$updated_value = strtotime( $updated_value );\n\t\t\t\t// Add Order Note\n\t\t\t\t$order->add_order_note( $order, 'updated value: ' . $updated_value);\n\n\t\t\t\t$order_fields[ $field_id ]->set_value( $updated_value );\n\n\t\t\t\t$order->update_meta_data( $field_meta_key, $order_fields[ $field_id ]->get_value() );\n\n\t\t\t\t// This column is used so that date fields can be searchable.\n\t\t\t\t$order->update_meta_data( $field_meta_key . '_formatted', $order_fields[ $field_id ]->get_value_formatted() );\n\n\t\t\t} else {\n\t\t\t\terror_log( 'sv_wc_admin_custom_order_fields_add_to_notes6 $order_id:' . print_r( $order_id, true ) );\n\n\t\t\t\t$order->update_meta_data( $field_meta_key, $updated_value );\n\t\t\t}\n\n\t\t// ...Or if it's empty, delete the custom field meta altogether.\n\t\t} else {\n\n\t\t\terror_log( 'sv_wc_admin_custom_order_fields_add_to_notes7 $order_id:' . print_r( $order_id, true ) );\n\n\t\t\t\t// Remove order note\n\t\t\t$order->add_order_note( $order, 'removed value/set blank: ' . $updated_value);\n\t\t\t\n\t\t\t$order->delete_meta_data( $field_meta_key );\n\t\t\t$order->delete_meta_data( $field_meta_key . '_formatted' );\n\t\t}\n\n\t\t$order->save_meta_data();\n\t}\n\t\n}", "function ticket_edit() {\n\t\t//to be written later\n\t}", "function add_order_f( $entry, $form) {\n global $wpdb;\n global $QUOTE_DUR_NON_3D_PRINT_DAYS;\n global $QUOTE_DUR_3D_PRINT_DAYS;\n global $QUOTE_SELECTION_DAYS;\n\n $dsr_input = substr($entry['4'],0,1); //Populate DSR per first character in string\n $usercid = return_cid();\n $order_type = $entry['18'];\n $quote_dur;\n if ($order_type == '3D-Printed Part') {\n $quote_dur = $QUOTE_DUR_3D_PRINT_DAYS;\n } else $quote_dur = $QUOTE_DUR_NON_3D_PRINT_DAYS;\n\n //$curtime_mysql = current_time('mysql'); //curent time in the mysql format in the server's time zone (EST)\n $quotes_due_mysql = no_holidays(date(\"Y-m-d\"),date(\"Y-m-d\",strtotime(\" + \". $quote_dur. ' weekdays'))); //current time converted to unix format, quote duration added, converted back to mysql format\n $atp_mysql = no_holidays($quotes_due_mysql,date(\"Y-m-d\",strtotime($quotes_due_mysql. \" + \". $QUOTE_SELECTION_DAYS. ' weekdays'))); //quotes due time converted to unix format, selection duration added, converted back to mysql format\n\n $data = array(\n 'cid' => $usercid,\n 'dsr' => $dsr_input,\n 'order_name' => $entry['1'],\n 'need_date' => $entry['8'],\n 'material' => $entry['5'],\n 'ship_name' => $entry['13'],\n 'ship_street' => $entry['12.1'],\n 'ship_street2' => $entry['12.2'],\n 'ship_city' => $entry['12.3'],\n 'ship_state' => $entry['12.4'],\n 'ship_zip' => $entry['12.5'],\n 'qty' => $entry['2'],\n 'order_addl_rqmts' => $entry['10'],\n 'order_comments' => $entry['11'],\n 'quotes_due' => $quotes_due_mysql,\n 'atp_due' => $atp_mysql,\n 'order_type' => $order_type,\n 'bid_cost' => $entry['19']\n );\n //Checks if firm need by parsing string for Yes\n $f_need = false;\n if (strpos($entry['9'], 'Yes') !== false) {\n $f_need = true;\n }\n\n //Extracts qual level from first character of string\n $qual_reqd = $entry['6'];\n $qual_reqd_num = $qual_reqd[0];\n\n //qual_set corresponds to binary number with a 1 in each position where a checkbox is checked\n $qual_set = 0;\n for ($q_num = 1; $q_num <= 5; $q_num++) {\n $entry_num = \"7.{$q_num}\";\n if($entry[$entry_num] != '') {\n $qual_set = $qual_set | (1<<($q_num-1));\n }\n }\n $data = array_merge($data, array('firm_need' => $f_need, 'order_vqual' => $qual_set, 'order_qual' => $qual_reqd_num));\n //Insert Order to DB\n $wpdb->insert(\n 'orders',\n $data\n );\n $oid = $wpdb->insert_id; //Get auto-increment order id (oid)\n $order_files = $entry['3'];\n upload_files_from_gform($order_files, $oid, $usercid);\n $wpdb->insert('logs', array('user_type' => 'customer', 'log_type' => 'New Order', 'log_entry' => \"Order $oid created\")); //log the event\n\n //send_alert(\"Thank you, your order has been submitted. We will email you when quotes have been received.\");\n}", "function update_order_info($order){\n }", "function hnd_add_trade_items( $post ) {\n\n\tif( get_post_type() !== 'trades' )\n\t\treturn;\n\n\t// get attached label\n\t$label = get_post_meta( $post->ID, 'contact', true );\n\t$label_slug = $label['post_name'];\n\t\n\t// get the trade content\n\t$trade_parts = explode( '<h1', $post->post_content );\n\t$trade_content = wpautop( $trade_parts[0] );\n\t$trade_items = explode( '<p>', $trade_content );\n\t$trade_items = hnd_clean_array( $trade_items );\n\t\n\t// loop through trade items and add to inventory\n\tforeach( $trade_items as $item ) {\n\n\t\t// set default title\n\t\t$title = trim( $item );\n\t\t\n\t\t// determine qty\n\t\t$qty = hnd_get_trade_item_qty( $item );\n\n\t\t// determine serial\n\t\t$serial = hnd_get_trade_item_serial( $item );\n\t\t\n\t\t// determine format\n\t\t#$format = hnd_get_trade_item_format( $item );\n\t\t \n\t\t// determine title (strip qty and serial)\n\t\t$title = hnd_get_trade_item_title( $item );\n\n\t\t// add item\n\t\t$item_id = wp_insert_post( array(\n\t\t\t'post_type' => 'items',\n\t\t\t'post_status' => 'draft',\n\t\t\t'post_title' => strip_tags( $title ),\n\t\t) );\n\n\t\tif( $item_id ) {\n\n\t\t\t# TODO: set formats\n\t\t\t#wp_set_post_terms( $item_id, $format, 'formats' );\n\n\t\t\t// set labels\n\t\t\twp_set_post_terms( $item_id, $label_slug, 'labels' );\n\n\t\t\t// set meta values\n\t\t\tif( $qty ) update_post_meta( $item_id, 'stock', $qty );\n\t\t\tif( $serial ) update_post_meta( $item_id, 'serial', $serial );\t\t\n\t\t}\n\t}\n\n\t// get inventory content\n\t$stock_parts = explode( '/h1>', $post->post_content );\n\t$stock_content = wpautop( end( $stock_parts ) );\n\t$stock_items = explode( '<p>', $stock_content );\n\t$stock_items = hnd_clean_array( $stock_items );\n\n\t// loop through Handstand items and update inventory\n\tforeach( $stock_items as $item ) {\n\n\t\t// determine qty\n\t\t$qty = hnd_get_trade_item_qty( $item );\n\n\t\t// determine serial\n\t\t$serial = hnd_get_trade_item_serial( $item );\n\n\t\tif( $qty && $serial ) {\n\n\t\t\t// get item from serial\n\t\t\t$hnd_items = new WP_Query( array(\n\t\t\t\t'post_type' => 'items',\n\t\t\t\t'posts_per_page' => 1,\n\t\t\t\t'meta_query' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'key' => 'serial',\n\t\t\t\t\t\t'value' => $serial,\n\t\t\t\t\t\t'compare' => '=',\n\t\t\t\t\t)\n\t\t\t\t)\t\t\t\t\n\t\t\t) );\n\n\t\t\tif( $hnd_items->have_posts() ) :\n\t\t\t\twhile( $hnd_items->have_posts()) : $hnd_items->the_post();\n\t\t\t\t\t\n\t\t\t\t\t// get existing stock and reduce \n\t\t\t\t\t$current_qty = get_post_meta( get_the_ID(), 'stock', true );\n\t\t\t\t\t$new_qty = $current_qty - $qty;\n\t\t\t\t\tupdate_post_meta( get_the_ID(), 'stock', $new_qty );\n\n\t\t\t\tendwhile;\t\t\t\n\t\t\tendif;\n\n\t\t\twp_reset_query();\n\t\t}\t\t\n\t}\n}", "function add_order_meta_box_actions( $actions ) {\n $actions['shiphawk_book_manual'] = __( 'ShipHawk Book' );\n //$actions['shiphawk_subscribe_tracking'] = __( 'ShipHawk Subscribe Tracking' );\n return $actions;\n}", "function get_ticket_data( $entry, $form, $settings ){\n\t\t$summary = GFCommon::replace_variables( $settings['myit_summary'], $form, $entry, false, true, false );\n\t\t$gatorlink = $this->get_mapped_field_value( 'myit_gatorlink', $form, $entry, $settings);\n\t\t$ufid = $this->get_mapped_field_value( 'myit_ufid', $form, $entry, $settings);\n\t\t$description = GFCommon::replace_variables( $settings['myit_description'], $form, $entry, false, true, false );\n\t\t$description = nl2br($description);\n\t\t\n\t\t$ticket = array(\n\t\t\t'Portfolio' => $settings['myit_portfolio'], \n\t\t\t'Service' => $settings['myit_service'], \n\t\t\t'Category' => $settings['myit_category'],\n\t\t\t'Subcategory' => $settings['myit_subcategory'],\n\t\t\t'Source' => $settings['myit_source'],\n\t\t\t'Priority' => $settings['myit_priority'],\n\t\t\t'AssignedSupportLevel' => $settings['myit_assigned_support_level'],\n\t\t\t'OwnedByTeam' => $settings['myit_owned_by_team'],\n\t\t\t'LastModifiedByEmail' => $settings['myit_last_modified_by_email'],\n\t\t\t'Summary' => $summary,\n\t\t\t'Description' => $description,\n\t\t\t'CustomersUFID' => $ufid,\n\t\t\t'GatorlinkID' => $gatorlink,\n\t\t);\n\t\t\n\t\t// Add specifics data if exists\n\t\t$specifics_data = $this->get_specifics_data( $entry, $form, $settings['myit_specifics'] );\n\t\t\n\t\treturn array_merge( $ticket, $specifics_data );\n\t}", "function populate_order_track_info() {\n global $wpdb;\n $oid_filter = filter_input( INPUT_GET, \"oid\", FILTER_SANITIZE_STRING );\n $order_row = $wpdb->get_row(\"SELECT * FROM orders WHERE oid = $oid_filter\", ARRAY_A);\n if ($order_row['order_phase'] == \"Order Shipped\") {\n $carrier = $order_row['order_ship_carrier'];\n $tracking = $order_row['order_ship_tracking'];\n echo \"<p>Carrier: $carrier </p>\";\n echo \"<p>Tracking Number: $tracking </p>\";\n echo \"<input id=\\\"order_received_button\\\" type=\\\"button\\\" value=\\\"Mark as Received\\\" onclick=\\\"location.href = 'https://merafab.com/order-received?oid=$oid_filter'\\\" />\";\n }\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Databinding properties of the control.
protected function dataBindProperties() { Prado::trace("Data bind properties",'Prado\Web\UI\TControl'); if(isset($this->_rf[self::RF_DATA_BINDINGS])) { if(($context=$this->getTemplateControl())===null) $context=$this; foreach($this->_rf[self::RF_DATA_BINDINGS] as $property=>$expression) $this->setSubProperty($property,$context->evaluateExpression($expression)); } }
[ "protected function databind ()\n {\n if (isset($this->bindings))\n foreach ($this->bindings as $attrName => $bindExp) {\n $value = $this->evalBinding ($bindExp);\n if (is_object ($value))\n $this->props->$attrName = $value;\n else $this->props->set ($attrName, $value);\n }\n }", "protected function autoDataBindProperties()\n\t{\n\t\tif(isset($this->_rf[self::RF_AUTO_BINDINGS]))\n\t\t{\n\t\t\tif(($context=$this->getTemplateControl())===null)\n\t\t\t\t$context=$this;\n\t\t\tforeach($this->_rf[self::RF_AUTO_BINDINGS] as $property=>$expression)\n\t\t\t\t$this->setSubProperty($property,$context->evaluateExpression($expression));\n\t\t}\n\t}", "public function dataBind()\n\t{\n\t\t$this->dataBindProperties();\n\t\t$this->onDataBinding(null);\n\t\t$this->dataBindChildren();\n\t}", "public function bind() {\n\t\tTCompositeControl::bind();\n\t}", "protected function setProperties() {\n\t\tself::setPropertiesTo($this->Plot, 1, $this->Training, $this->Data);\n\t}", "protected function setProperties()\n {\n foreach ($this->data as $key => $value) {\n $this->$key = $value;\n }\n }", "public function editableProperties();", "protected function setProperties() {\r\n\t\tself::setPropertiesTo($this->Plot, 1, $this->Training, $this->Data);\r\n\t}", "protected function applyControlProperties()\n\t{\n\t\t$this->applyHeaderProperties();\n\t\t$this->applySideBarProperties();\n\t\t$this->applyStepContentProperties();\n\t\t$this->applyNavigationProperties();\n\t}", "protected function registerTemplateDataProperty()\n {\n $this->app->bind(PropertyInterface::class, function($app){\n return new Property([], $app);\n });\n }", "public function initMutateProperty()\n {\n foreach ( $this->initMutateProperties as $property ) {\n $this->mutateProperties[ $property ] = $this->{$property};\n }\n $this->view->addParams( [\n 'mutateProperties' => $this->mutateProperties\n ] );\n }", "public function getIsBindable()\n {\n return false;\n }", "function get_binding()\r\n {\r\n return $this->get_additional_property(self :: PROPERTY_BINDING);\r\n }", "public function setPropertyBehavior() {\n $this->isInPropertyBehavior= TRUE;\n }", "public function getIsBindable()\n {\n return $this->isBindable;\n }", "protected function editProperties() : void\n {\n $this->tabs->activateTab(\"properties\");\n $form = $this->initPropertiesForm();\n $this->addValuesToForm($form);\n $this->tpl->setContent($form->getHTML());\n }", "public function configure_widget_properties() {\n $this->slug = 'states';\n $this->description_admin = __('List the states for your locations and link to the map or listing page.', 'slp-experience');\n $this->title_admin = __('SLP States', 'slp-experience');\n $this->title_ui = __('We Are In These States', 'slp-experience');\n }", "public function setIsBindable($value);", "protected function setProperties() {\r\n\t\tTrainingPlotPace::setPropertiesTo($this->Plot, 1, $this->Training, $this->DataPace);\r\n\r\n\t\t$this->Plot->addYAxis(2, 'right', false);\r\n\t\tTrainingPlotPulse::setPropertiesTo($this->Plot, 2, $this->Training, $this->DataPulse);\r\n\t\t$this->Plot->setLineWidth(1,2);\r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
int32 send_card_count_all = 9;
public function setSendCardCountAll($var) { GPBUtil::checkInt32($var); $this->send_card_count_all = $var; }
[ "public function sendCount();", "abstract public function getNbToSend(): int;", "public function cardCount()\n {\n return $this->msuit->count();\n }", "public function getFreeToSendPostcards(): int\n {\n return $this->freeToSendPostcards;\n }", "abstract public function getNbSendProcessing(): int;", "function net_peerCount();", "public function getSendCardCountD1()\n {\n return $this->send_card_count_d1;\n }", "function numOfChanger()\n\t{\n\t\t//hand=\".$this->curr_hand.\" and \n\t\t$query = \"select count(distinct(player)) as n from pkr_subhand WHERE game=\".$this->curr_game.\" and response = '\".CHANGE.\"'\";\n\t\t$n = $GLOBALS['mydb']->select($query);\n\t\t$n = $n[0]['n'];\n\t\treturn $n;\n\t}", "public function getSendCardCountD2()\n {\n return $this->send_card_count_d2;\n }", "public function getMessageReadCount(): int;", "public function count_list_card_front_end(){\n\n\t\t$str_select=$this->_table.'.card_id';\n\t\t$arr_where=array($this->_table.'.card_public'=>1);\n\n\t\t$this->db->select($str_select);\n\t\t$this->db->where($arr_where);\n\n\t\t$query=$this->db->get($this->_table);\n\t\treturn $query->num_rows();\n\n\t}", "function registred($mac)\n{\n require_once (\"ihm.inc.php\");\n $dhcp_link=connexion_db_dhcp();\n\t$query = mysqli_prepare($dhcp_link, \"SELECT count(*) as NB from se3_dhcp where mac=? GROUP BY mac ASC\");\n\tmysqli_stmt_bind_param($query,\"s\", $mac);\n\tmysqli_stmt_execute($query);\n\tmysqli_stmt_bind_result($query,$value);\n\tmysqli_stmt_fetch($query);\n\t$nb_total=$value+0;\n\tmysqli_stmt_close($query);\n if ($nb_total==0)\n\t{\n return FALSE;\n }\n\telse\n\t{\n return TRUE;\n }\n\tdeconnexion_db_dhcp($dhcp_link);\n}", "public function getCardCount()\n {\n return $this->card_count;\n }", "public function getCardCount(){\r\n $sql = \"SELECT COUNT(*) FROM \".Card::getDbTableName().\" WHERE owner = \".$this->getId();\r\n $req = $this->db->query($sql);\r\n $counter = $req->fetchColumn();\r\n return $counter;\r\n }", "public function countReady(): int;", "function count_num()\n {\n return 1;\n }", "public function testSendMax()\n {\n }", "public function countPaymentMobile();", "function TotalCardProgram() {\n global $mysqli, $db_table_prefix;\n $stmt = $mysqli->prepare(\"SELECT \n\t\tcard_program_id\n\t\tFROM \" . $db_table_prefix . \"card_program\");\n $stmt->execute();\n $stmt->store_result();\n $num_returns = $stmt->num_rows;\n $stmt->close();\n\n return $num_returns;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a new Collator object for locale
public function createCollator() { return new Collator($this->getLocale()); }
[ "protected static function getCollator()\n {\n if (!self::$collator) {\n self::$collator = collator_create('root');\n }\n \n return self::$collator;\n }", "public function getFacetCollatorProvider(): CollatorProviderInterface;", "public function getFacetCollatorProvider();", "public function getCollatorForKey($key);", "public function getLocaleManager();", "public function getLocale();", "public static function canonicalize($locale){}", "function ut_main()\n{\n $res_str = '';\n\n $locales = array(\n 'EN-US-ODESSA',\n 'UK_UA_ODESSA',\n 'uk-ua_CALIFORNIA@currency=;currency=GRN',\n '',\n 'root',\n 'uk@currency=EURO',\n\t'12345678911131517192123252729313335373941434547495153575961636567697173757779818385878991939597991234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799'\n );\n\n foreach( $locales as $locale )\n {\n // Create Collator with the current locale.\n $coll = ut_coll_create( $locale );\n if( !is_object($coll) )\n {\n $res_str .= \"Error creating collator with '$locale' locale: \" .\n intl_get_error_message() . \"\\n\";\n continue;\n }\n\n // Get the requested, valid and actual locales.\n $vloc = ut_coll_get_locale( $coll, Locale::VALID_LOCALE );\n $aloc = ut_coll_get_locale( $coll, Locale::ACTUAL_LOCALE );\n\n // Show them.\n $res_str .= \"Locale: '$locale'\\n\" .\n \" ULOC_REQUESTED_LOCALE = '$locale'\\n\" .\n \" ULOC_VALID_LOCALE = '$vloc'\\n\" .\n \" ULOC_ACTUAL_LOCALE = '$aloc'\\n\";\n }\n\n return $res_str;\n}", "public function getLocale() {}", "public function getCollation();", "protected function _initLocale()\n {\n \tdefined('LUMIA_CFG_LOCALE') || define('LUMIA_CFG_LOCALE', 'vi_VN');\n Zend_Registry::set('Zend_Locale', new Zend_Locale(LUMIA_CFG_LOCALE));\n }", "public function getFacetCollatorProvider()\n {\n return $this->context->getFacetCollatorProvider();\n }", "public function getLocale() {\n }", "public function getLocale()\n {\n }", "function getSystemLocale() ;", "public function getLocale($code);", "protected function initializeL10nLocales() {}", "public static function from(string $locale): static\n {\n $info = self::parse($locale);\n\n return new static(...$info);\n }", "static public function from($id)\n\t{\n\t\tif (isset(self::$locales[$id]))\n\t\t{\n\t\t\treturn self::$locales[$id];\n\t\t}\n\n\t\treturn self::$locales[$id] = new static(get_cldr(), $id);\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns basket elements delivery countries.
protected function getBasketDeliveryCountries() { $countries = []; foreach ($this->basket->getBasketElements() as $basketElement) { $product = $basketElement->getProduct(); foreach ($product->getDeliveries() as $delivery) { $code = $delivery->getCountryCode(); if (!isset($countries[$code])) { $countries[$code] = Intl::getRegionBundle()->getCountryName($code); } } } return $countries; }
[ "protected function getBasketDeliveryCountries()\n {\n $countries = [];\n\n foreach ($this->basket->getBasketElements() as $basketElement) {\n $product = $basketElement->getProduct();\n\n foreach ($product->getDeliveries() as $delivery) {\n\n $code = $delivery->getCountryCode();\n $countryCodes = explode('|', $code);\n\n foreach ($countryCodes as $_code){\n $countries[$_code] = Intl::getRegionBundle()->getCountryName($_code);\n }\n }\n }\n\n return $countries;\n }", "public function get_shipping_countries()\n {\n }", "protected function getBasketDeliveryCountries($basket)\n {\n $countries = [];\n\n foreach ($basket->getBasketElements() as $basketElement) {\n $product = $basketElement->getProduct();\n\n foreach ($product->getDeliveries() as $delivery) {\n \n $code = $delivery->getCountryCode();\n\n if (!isset($countries[$code])) {\n $countries[$code] = Intl::getRegionBundle()->getCountryName($code);\n }\n }\n }\n\n return $countries;\n }", "function get_shipping_countries() {\n\t\t\n\t\t$sql = \"SELECT DISTINCT `countries`.* FROM `countries`,`shippings_countries`,`shippings`\n\t\t\t\tWHERE `countries`.`id` = `shippings_countries`.`country_id`\n\t\t\t\tAND `shippings_countries`.`shipping_id` = `shippings`.`id`\n\t\t\t\tAND `shippings`.`actived` = 1 ORDER BY `countries`.`id`\";\n\t\t$query = $this->db->query($sql);\n\t\treturn $query->result_array();\n\t}", "private function get_country_items() {\n\t\treturn [\n\t\t\t[\n\t\t\t\t'',\n\t\t\t\t'&mdash; ' . \\__( 'No country selected', 'the-seo-framework-extension-manager' ) . ' &mdash;',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'AF',\n\t\t\t\t'Afghanistan',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'AX',\n\t\t\t\t'Åland Islands',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'AL',\n\t\t\t\t'Albania',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'DZ',\n\t\t\t\t'Algeria',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'AS',\n\t\t\t\t'American Samoa',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'AD',\n\t\t\t\t'Andorra',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'AO',\n\t\t\t\t'Angola',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'AI',\n\t\t\t\t'Anguilla',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'AQ',\n\t\t\t\t'Antarctica',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'AG',\n\t\t\t\t'Antigua and Barbuda',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'AR',\n\t\t\t\t'Argentina',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'AM',\n\t\t\t\t'Armenia',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'AW',\n\t\t\t\t'Aruba',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'AU',\n\t\t\t\t'Australia',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'AT',\n\t\t\t\t'Austria',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'AZ',\n\t\t\t\t'Azerbaijan',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'BS',\n\t\t\t\t'Bahamas',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'BH',\n\t\t\t\t'Bahrain',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'BD',\n\t\t\t\t'Bangladesh',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'BB',\n\t\t\t\t'Barbados',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'BY',\n\t\t\t\t'Belarus',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'BE',\n\t\t\t\t'Belgium',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'BZ',\n\t\t\t\t'Belize',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'BJ',\n\t\t\t\t'Benin',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'BM',\n\t\t\t\t'Bermuda',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'BT',\n\t\t\t\t'Bhutan',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'BO',\n\t\t\t\t'Bolivia (Plurinational State of)',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'BQ',\n\t\t\t\t'Bonaire, Sint Eustatius and Saba',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'BA',\n\t\t\t\t'Bosnia and Herzegovina',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'BW',\n\t\t\t\t'Botswana',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'BV',\n\t\t\t\t'Bouvet Island',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'BR',\n\t\t\t\t'Brazil',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'IO',\n\t\t\t\t'British Indian Ocean Territory',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'BN',\n\t\t\t\t'Brunei Darussalam',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'BG',\n\t\t\t\t'Bulgaria',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'BF',\n\t\t\t\t'Burkina Faso',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'BI',\n\t\t\t\t'Burundi',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'CV',\n\t\t\t\t'Cabo Verde',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'KH',\n\t\t\t\t'Cambodia',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'CM',\n\t\t\t\t'Cameroon',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'CA',\n\t\t\t\t'Canada',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'KY',\n\t\t\t\t'Cayman Islands',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'CF',\n\t\t\t\t'Central African Republic',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'TD',\n\t\t\t\t'Chad',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'CL',\n\t\t\t\t'Chile',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'CN',\n\t\t\t\t'China',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'CX',\n\t\t\t\t'Christmas Island',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'CC',\n\t\t\t\t'Cocos (Keeling) Islands',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'CO',\n\t\t\t\t'Colombia',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'KM',\n\t\t\t\t'Comoros',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'CG',\n\t\t\t\t'Congo',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'CD',\n\t\t\t\t'Congo (Democratic Republic of the)',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'CK',\n\t\t\t\t'Cook Islands',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'CR',\n\t\t\t\t'Costa Rica',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'CI',\n\t\t\t\t'Côte d\\'Ivoire',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'HR',\n\t\t\t\t'Croatia',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'CU',\n\t\t\t\t'Cuba',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'CW',\n\t\t\t\t'Curaçao',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'CY',\n\t\t\t\t'Cyprus',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'CZ',\n\t\t\t\t'Czechia',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'DK',\n\t\t\t\t'Denmark',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'DJ',\n\t\t\t\t'Djibouti',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'DM',\n\t\t\t\t'Dominica',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'DO',\n\t\t\t\t'Dominican Republic',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'EC',\n\t\t\t\t'Ecuador',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'EG',\n\t\t\t\t'Egypt',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'SV',\n\t\t\t\t'El Salvador',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'GQ',\n\t\t\t\t'Equatorial Guinea',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'ER',\n\t\t\t\t'Eritrea',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'EE',\n\t\t\t\t'Estonia',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'ET',\n\t\t\t\t'Ethiopia',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'FK',\n\t\t\t\t'Falkland Islands (Malvinas)',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'FO',\n\t\t\t\t'Faroe Islands',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'FJ',\n\t\t\t\t'Fiji',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'FI',\n\t\t\t\t'Finland',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'FR',\n\t\t\t\t'France',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'GF',\n\t\t\t\t'French Guiana',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'PF',\n\t\t\t\t'French Polynesia',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'TF',\n\t\t\t\t'French Southern Territories',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'GA',\n\t\t\t\t'Gabon',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'GM',\n\t\t\t\t'Gambia',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'GE',\n\t\t\t\t'Georgia',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'DE',\n\t\t\t\t'Germany',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'GH',\n\t\t\t\t'Ghana',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'GI',\n\t\t\t\t'Gibraltar',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'GR',\n\t\t\t\t'Greece',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'GL',\n\t\t\t\t'Greenland',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'GD',\n\t\t\t\t'Grenada',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'GP',\n\t\t\t\t'Guadeloupe',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'GU',\n\t\t\t\t'Guam',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'GT',\n\t\t\t\t'Guatemala',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'GG',\n\t\t\t\t'Guernsey',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'GN',\n\t\t\t\t'Guinea',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'GW',\n\t\t\t\t'Guinea-Bissau',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'GY',\n\t\t\t\t'Guyana',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'HT',\n\t\t\t\t'Haiti',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'HM',\n\t\t\t\t'Heard Island and McDonald Islands',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'VA',\n\t\t\t\t'Holy See',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'HN',\n\t\t\t\t'Honduras',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'HK',\n\t\t\t\t'Hong Kong',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'HU',\n\t\t\t\t'Hungary',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'IS',\n\t\t\t\t'Iceland',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'IN',\n\t\t\t\t'India',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'ID',\n\t\t\t\t'Indonesia',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'IR',\n\t\t\t\t'Iran (Islamic Republic of)',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'IQ',\n\t\t\t\t'Iraq',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'IE',\n\t\t\t\t'Ireland',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'IM',\n\t\t\t\t'Isle of Man',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'IL',\n\t\t\t\t'Israel',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'IT',\n\t\t\t\t'Italy',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'JM',\n\t\t\t\t'Jamaica',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'JP',\n\t\t\t\t'Japan',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'JE',\n\t\t\t\t'Jersey',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'JO',\n\t\t\t\t'Jordan',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'KZ',\n\t\t\t\t'Kazakhstan',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'KE',\n\t\t\t\t'Kenya',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'KI',\n\t\t\t\t'Kiribati',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'KP',\n\t\t\t\t'Korea (Democratic People\\'s Republic of)',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'KR',\n\t\t\t\t'Korea (Republic of)',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'KW',\n\t\t\t\t'Kuwait',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'KG',\n\t\t\t\t'Kyrgyzstan',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'LA',\n\t\t\t\t'Lao People\\'s Democratic Republic',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'LV',\n\t\t\t\t'Latvia',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'LB',\n\t\t\t\t'Lebanon',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'LS',\n\t\t\t\t'Lesotho',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'LR',\n\t\t\t\t'Liberia',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'LY',\n\t\t\t\t'Libya',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'LI',\n\t\t\t\t'Liechtenstein',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'LT',\n\t\t\t\t'Lithuania',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'LU',\n\t\t\t\t'Luxembourg',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'MO',\n\t\t\t\t'Macao',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'MK',\n\t\t\t\t'Macedonia (the former Yugoslav Republic of)',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'MG',\n\t\t\t\t'Madagascar',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'MW',\n\t\t\t\t'Malawi',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'MY',\n\t\t\t\t'Malaysia',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'MV',\n\t\t\t\t'Maldives',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'ML',\n\t\t\t\t'Mali',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'MT',\n\t\t\t\t'Malta',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'MH',\n\t\t\t\t'Marshall Islands',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'MQ',\n\t\t\t\t'Martinique',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'MR',\n\t\t\t\t'Mauritania',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'MU',\n\t\t\t\t'Mauritius',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'YT',\n\t\t\t\t'Mayotte',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'MX',\n\t\t\t\t'Mexico',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'FM',\n\t\t\t\t'Micronesia (Federated States of)',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'MD',\n\t\t\t\t'Moldova (Republic of)',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'MC',\n\t\t\t\t'Monaco',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'MN',\n\t\t\t\t'Mongolia',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'ME',\n\t\t\t\t'Montenegro',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'MS',\n\t\t\t\t'Montserrat',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'MA',\n\t\t\t\t'Morocco',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'MZ',\n\t\t\t\t'Mozambique',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'MM',\n\t\t\t\t'Myanmar',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'NA',\n\t\t\t\t'Namibia',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'NR',\n\t\t\t\t'Nauru',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'NP',\n\t\t\t\t'Nepal',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'NL',\n\t\t\t\t'Netherlands',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'NC',\n\t\t\t\t'New Caledonia',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'NZ',\n\t\t\t\t'New Zealand',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'NI',\n\t\t\t\t'Nicaragua',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'NE',\n\t\t\t\t'Niger',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'NG',\n\t\t\t\t'Nigeria',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'NU',\n\t\t\t\t'Niue',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'NF',\n\t\t\t\t'Norfolk Island',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'MP',\n\t\t\t\t'Northern Mariana Islands',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'NO',\n\t\t\t\t'Norway',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'OM',\n\t\t\t\t'Oman',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'PK',\n\t\t\t\t'Pakistan',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'PW',\n\t\t\t\t'Palau',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'PS',\n\t\t\t\t'Palestine, State of',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'PA',\n\t\t\t\t'Panama',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'PG',\n\t\t\t\t'Papua New Guinea',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'PY',\n\t\t\t\t'Paraguay',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'PE',\n\t\t\t\t'Peru',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'PH',\n\t\t\t\t'Philippines',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'PN',\n\t\t\t\t'Pitcairn',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'PL',\n\t\t\t\t'Poland',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'PT',\n\t\t\t\t'Portugal',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'PR',\n\t\t\t\t'Puerto Rico',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'QA',\n\t\t\t\t'Qatar',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'RE',\n\t\t\t\t'Réunion',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'RO',\n\t\t\t\t'Romania',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'RU',\n\t\t\t\t'Russian Federation',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'RW',\n\t\t\t\t'Rwanda',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'BL',\n\t\t\t\t'Saint Barthélemy',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'SH',\n\t\t\t\t'Saint Helena, Ascension and Tristan da Cunha',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'KN',\n\t\t\t\t'Saint Kitts and Nevis',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'LC',\n\t\t\t\t'Saint Lucia',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'MF',\n\t\t\t\t'Saint Martin (French part)',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'PM',\n\t\t\t\t'Saint Pierre and Miquelon',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'VC',\n\t\t\t\t'Saint Vincent and the Grenadines',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'WS',\n\t\t\t\t'Samoa',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'SM',\n\t\t\t\t'San Marino',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'ST',\n\t\t\t\t'Sao Tome and Principe',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'SA',\n\t\t\t\t'Saudi Arabia',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'SN',\n\t\t\t\t'Senegal',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'RS',\n\t\t\t\t'Serbia',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'SC',\n\t\t\t\t'Seychelles',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'SL',\n\t\t\t\t'Sierra Leone',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'SG',\n\t\t\t\t'Singapore',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'SX',\n\t\t\t\t'Sint Maarten (Dutch part)',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'SK',\n\t\t\t\t'Slovakia',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'SI',\n\t\t\t\t'Slovenia',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'SB',\n\t\t\t\t'Solomon Islands',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'SO',\n\t\t\t\t'Somalia',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'ZA',\n\t\t\t\t'South Africa',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'GS',\n\t\t\t\t'South Georgia and the South Sandwich Islands',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'SS',\n\t\t\t\t'South Sudan',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'ES',\n\t\t\t\t'Spain',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'LK',\n\t\t\t\t'Sri Lanka',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'SD',\n\t\t\t\t'Sudan',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'SR',\n\t\t\t\t'Suriname',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'SJ',\n\t\t\t\t'Svalbard and Jan Mayen',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'SZ',\n\t\t\t\t'Swaziland',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'SE',\n\t\t\t\t'Sweden',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'CH',\n\t\t\t\t'Switzerland',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'SY',\n\t\t\t\t'Syrian Arab Republic',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'TW',\n\t\t\t\t'Taiwan (Province of China)',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'TJ',\n\t\t\t\t'Tajikistan',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'TZ',\n\t\t\t\t'Tanzania, United Republic of',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'TH',\n\t\t\t\t'Thailand',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'TL',\n\t\t\t\t'Timor-Leste',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'TG',\n\t\t\t\t'Togo',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'TK',\n\t\t\t\t'Tokelau',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'TO',\n\t\t\t\t'Tonga',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'TT',\n\t\t\t\t'Trinidad and Tobago',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'TN',\n\t\t\t\t'Tunisia',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'TR',\n\t\t\t\t'Turkey',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'TM',\n\t\t\t\t'Turkmenistan',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'TC',\n\t\t\t\t'Turks and Caicos Islands',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'TV',\n\t\t\t\t'Tuvalu',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'UG',\n\t\t\t\t'Uganda',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'UA',\n\t\t\t\t'Ukraine',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'AE',\n\t\t\t\t'United Arab Emirates',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'GB',\n\t\t\t\t'United Kingdom of Great Britain and Northern Ireland',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'US',\n\t\t\t\t'United States of America',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'UM',\n\t\t\t\t'United States Minor Outlying Islands',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'UY',\n\t\t\t\t'Uruguay',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'UZ',\n\t\t\t\t'Uzbekistan',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'VU',\n\t\t\t\t'Vanuatu',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'VE',\n\t\t\t\t'Venezuela (Bolivarian Republic of)',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'VN',\n\t\t\t\t'Viet Nam',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'VG',\n\t\t\t\t'Virgin Islands (British)',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'VI',\n\t\t\t\t'Virgin Islands (U.S.)',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'WF',\n\t\t\t\t'Wallis and Futuna',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'EH',\n\t\t\t\t'Western Sahara',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'YE',\n\t\t\t\t'Yemen',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'ZM',\n\t\t\t\t'Zambia',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'ZW',\n\t\t\t\t'Zimbabwe',\n\t\t\t],\n\t\t];\n\t}", "function _commerce_collector_get_countries() {\n // Load locale.\n include_once DRUPAL_ROOT . '/includes/locale.inc';\n $available = array('NO', 'SE', 'DK', 'FI', 'DE', 'AT', 'NL');\n return array_intersect_key(country_get_list(), array_flip($available));\n}", "public function getDeliveryCountry()\n {\n return $this->getData(self::DELIVERY_COUNTRY);\n }", "public function getCountries();", "public function getCountries()\n {\n return $this->data['fields']['countries'];\n }", "public function getCountries() {\r\n\t\r\n\t\t$url = $this->_buildURL('countries');\r\n\t\treturn $this->_call($url);\r\n\t}", "public function getStoreCountries()\n {\n return $this->storeCountries;\n }", "public function get_shipping_country_states()\n {\n }", "public function get_country_list() {\n\t\t$s = \"SELECT \" . self::COL_NAME . \" FROM \" . self::TBL_COUNTRY;\n\t\treturn $this->run($s, self::COL_NAME);\n\t}", "public function getCountriesForSelect();", "public function getAllCountries()\n {\n //$countries = array();\n $countries = $this->_countryHelper->toOptionArray();\n //foreach ($countryCollection as $country) {\n// foreach ( $countries as $countryKey => $country ) {\n// /* @var $country Mage_Directory_Model_Country */\n// $countries[$country['value']] = $country->getName();\n// }\n// }\n return $countries;\n }", "public function getCountryList()\n {\n return $this->getAllExternal('res.country', array('code'));\n }", "public function countries(): array\n {\n return $this->client->get(\"country\");\n }", "public function getCountry() {}", "public static function get_countries()\n {\n $g = new Geoip3();\n $ge = new GeoIP();\n\n $countries_codes = $ge->GEOIP_COUNTRY_CODES;\n $countries_names = $ge->GEOIP_COUNTRY_NAMES;\n\n $countries = array();\n\n foreach ($countries_codes as $id=>$cc) \n {\n if ($cc!='' AND $cc!='AP' AND $cc!='EU' )\n $countries[$id] = array('code'=>$cc,\n 'name'=>$countries_names[$id]);\n }\n return $countries;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generated from protobuf field string payeeMobile = 7;
public function setPayeeMobile($var) { GPBUtil::checkString($var, True); $this->payeeMobile = $var; return $this; }
[ "public function getPayerMobile()\n {\n return $this->payerMobile;\n }", "public function getUserPaymorrowMobilePhone()\n {\n return $this->oxuser__oxmobfon->value;\n }", "public function setMobile($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING);\n $this->mobile = $arr;\n\n return $this;\n }", "public function getMobilePhone() {\n return $this->getCommunicationFieldText(\n $this->get('mobile_phone')->getString(),\n 'communication_mobile'\n );\n }", "public function setMobile(string $mobile): self;", "public function mobile()\n {\n $prefix = $this->getRandomKey('mobile');\n $phone = string('+98' . $prefix . randomNumber(7));\n return $phone;\n //return (strlen($phone) !== 13 ? $phone . rand(1, 10) : $phone);\n\n }", "public function phone(){\n\t\tif(trim($this->mobile) != ''){\n\t\t\treturn $this->mobile;\n\t\t}else{\n\t\t\treturn $this->phone_areacode . $this->phone;\n\t\t}\n\t}", "public function getBrokercontactpersonmobile()\n\t{\n\t\treturn $this->brokercontactpersonmobile;\n\t}", "public function getMobileForVerification()\n {\n return $this->mobile;\n }", "public function getReqMobilePhone()\n\t{\n\t\treturn $this->req_mobile_phone;\n\t}", "static public function mobile($mobile)\n\t{\n\t if (NStrings::startsWith($mobile, '+')) {\n\t return self::format($mobile, array(4, 3, 3, 3,));\n\t }\n\t elseif (NStrings::startsWith($mobile, '00')) {\n\t return self::format($mobile, array(5, 3, 3, 3,));\n\t }\n\t else {\n\t return self::format($mobile, array(4, 3, 3,));\n\t }\n\t}", "private function getMobileField(): string\n {\n return config('mobile_verifier.mobile_column', 'mobile');\n }", "public function getReqmobilephone()\n\t{\n\t\treturn $this->reqmobilephone;\n\t}", "public static function mobileCode()\n {\n return static::randomElement(static::$mobileCodes);\n }", "public function getUserMobileNumber()\n\t\t\t\t{\n\t\t\t\t\t\t\t\tif(isset($this->userMobileNumber))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\treturn $this->userMobileNumber;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t}", "public function telephone()\n {\n $prefix = $this->getRandomKey('tellphone');\n return string('+98' . $prefix . randomNumber(7));\n }", "public function mobile()\n {\n $prefix = $this->getRandomKey('mobile');\n $phone = string('0' . $prefix . randomNumber(7));\n return (strlen($phone) !== 11 ? $phone . rand(1, 10) : $phone);\n\n }", "public function testPromotionalSmsMandatoryFieldsMissingMessageStringMobile()\n {\n $sendArray = [\n 'sender' => 'UTOOWE',\n ];\n $verifyResponse = $this->PromotionalSms->sendPromotional(\"919514028541,919791466728\", $sendArray);\n }", "public function getMobilePhone()\n\t{\n\t\treturn $this->mobile_phone;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check to see if ShippingServiceId is set.
public function isSetShippingServiceId() { return !is_null($this->_fields['ShippingServiceId']['FieldValue']); }
[ "public function setService($id)\n {\n if (is_string($id)) {\n $this->options['ShippingServiceId'] = $id;\n } else {\n $this->log('Tried to set ShippingServiceId to invalid value', 'Warning');\n\n return false;\n }\n }", "public function setShippingServiceId($value) {\n\t\t$this->shipping_service_id = $value;\n\t}", "public function isSetShippingServiceName()\n {\n return !is_null($this->_fields['ShippingServiceName']['FieldValue']);\n }", "public function getShippingServiceID()\n {\n return $this->shippingServiceID;\n }", "public function isSetShipmentId()\n {\n return !is_null($this->_fields['ShipmentId']['FieldValue']);\n }", "public function isSetShipmentId()\n {\n return !is_null($this->_fields['ShipmentId']['FieldValue']);\n }", "public function getShippingServiceId() {\n\t\treturn $this->shipping_service_id;\n\t}", "public function hasServiceUuid()\n {\n return $this->serviceUuid !== null;\n }", "public function isSetShippingServiceOptions()\n {\n return !is_null($this->_fields['ShippingServiceOptions']['FieldValue']);\n }", "public function isSetAmazonShipmentId()\n {\n return !is_null($this->_fields['AmazonShipmentId']['FieldValue']);\n }", "protected function requireServiceNumber()\n {\n return isset($this->serviceName) && isset($this->serviceNumber) && isset($this->repoToken);\n }", "protected function _hasShipping()\n {\n return true;\n }", "public function hasDepotId()\n {\n return $this->depot_id !== null;\n }", "public function issetIntlShippingPolicyInfoService($index)\n {\n return isset($this->intlShippingPolicyInfoService[$index]);\n }", "private function has(string $serviceId)\n {\n return isset($this->container[$serviceId]);\n }", "private function isShippingAddressDefined()\n {\n return $this->quote->getShippingAddress()\n && $this->quote->getShippingAddress()->getPostcode();\n }", "public function hasPaymentGatewayId()\n {\n return !is_null($this->stripe_id);\n }", "function shipmentExists($shipment_id){\r\n $mapper = new \\gb\\mapper\\ShipmentMapper();\r\n $result = $mapper->find($shipment_id);\r\n return ($result != \"\");\r\n }", "public function hasServiceName()\n {\n return $this->serviceName !== null;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tests the consume() message and the message misses the message.
public function testConsume_MissingMessage() { $consumer = new CallbackConsumer(); $consumer->consume('{\"type\":\"default\"}'); }
[ "public function testConsumeShouldNotFailBeforeTimeout()\n {\n $rate = new Rate(10, Rate::SECOND);\n $bucket = new TokenBucket(10, $rate, new SingleProcessStorage());\n $bucket->bootstrap(0);\n $consumer = new BlockingConsumer($bucket, 1);\n \n $consumer->consume(10);\n $this->addToAssertionCount(1);\n }", "public function testConsumeFailToken()\n {\n $this->tokenService->consume(\n 'inexistent_hash',\n 'inexistent_scope',\n 'inexistent_owner_type',\n 0\n );\n }", "public function testRejectDropStopWithError() {\n $count = 5;\n $this->produceMessages($count, \"test.ten\", \"Message is here!\");\n $output = $this->consumeMessages(\"test_ten\", $count);\n $this->assertTrue($this->has($output, \"Message is here!\"), $this->debug($output));\n\n $output = $this->consumeMessages(\"test_dlx\", $count);\n $this->assertNotFalse(strpos($output, \"Somethings wrong! Consuming has stopped! Here is why!?\"));\n $this->assertEquals(1, substr_count($output, \"Somethings wrong! Consuming has stopped! Here is why!?\"));\n }", "public function test_consumeMessage()\n {\n $name = 'Hello from consumeMessage';\n $this->m->addQueue($name);\n $message = array('param1' =>'Hello from consumeMessage 1', 'param2' => 3000, 'param3' => 0, 'param4' => 1); \n $message_json = json_encode($message);\n $this->m->addMessage($name, $message);\n $message_consume = $this->m->consumeMessage( $name );\n $this->assertEquals($message_json, $message_consume['m_msg'] );\n \n $message_consume2 = $this->m->consumeMessage( $name );\n $this->assertFalse($message_consume2);\n }", "public function testConsumeWithoutTimeoutShouldNeverFail()\n {\n $rate = new Rate(0.1, Rate::YEAR);\n $bucket = new TokenBucket(1, $rate, new SingleProcessStorage());\n $bucket->bootstrap(0);\n $consumer = new BlockingConsumer($bucket);\n\n $consumer->consume(1);\n $this->addToAssertionCount(1);\n }", "public function testConsumeFailInactive()\n {\n $scope = uniqid('scope_');\n $ownerType = uniqid('owner_');\n $ownerId = rand(1, 10000);\n\n $token = $this->tokenService->generate(\n $scope,\n $ownerType,\n $ownerId\n );\n\n $this->tokenService->invalidateToken($token);\n\n $this->tokenService->consume(\n $token->getHash(),\n $token->getScope(),\n $token->getOwnerType(),\n $token->getOwnerId()\n );\n }", "public function testConsumingMessages(): void\n {\n $this->queue->expects($this->exactly(4))\n ->method('get')\n ->willReturnOnConsecutiveCalls('foo', 'bar', 'baz', false);\n\n $consumer = new Consumer($this->queue, $this->loop, 1.0);\n $consumer->on('consume', $this);\n $consumer();\n\n $this->assertSame(3, $this->counter);\n }", "public function testConsume_MissingType()\n {\n $consumer = new ServiceConsumer();\n\n $consumer->consume('{\\\"message\\\":\\\"foobar\\\"}');\n }", "public function testDiscard()\n {\n $data[] = \"1234567890\";\n $data[] = GenericMessageBroker::DISC_REQUEUE;\n\n $provider = $this->getProviderMock();\n $handler = $this->getHandlerMock();\n $callback = $this->getCallback($data);\n\n $provider\n ->expects($this->once())\n ->method(\"discard\")\n ->will($this->returnCallback($callback));\n\n $broker = new GenericMessageBroker($provider, $handler);\n $broker->discard($data[0], $data[1]);\n }", "public function testReceiveBadInput()\n {\n $this->expectException(Error::class);\n\n Event::receive('bad input');\n }", "public function testReceiveWithInvalidCallback()\n {\n $callback = 'invalid';\n $eventName = 'foo-bar';\n\n $this->adapter->expects($this->never())->method('receive');\n\n $this->eventReceiver->receive($eventName, $callback);\n }", "public function testReceiveNoInput()\n {\n $this->expectException(Error::class);\n\n Event::receive();\n }", "public function testConsumeCancel()\n {\n $channel = $this->_getCommonChannelMock();\n\n $queue = new Rabbit_Queue(\n $channel, self::QUEUE_NAME, $this->_getCommonFlagsMock()\n );\n\n /**\n * This could be improved, since the null value comes from an private\n * variable that is initialized when consume() is called, its value\n * should change. But testing that would require more effort than the\n * what I'm willing to put in this. This is okay for now.\n **/\n $channel->shouldReceive('basic_cancel')->with(null)->once();\n\n $queue->consume_cancel();\n }", "abstract public function shouldReceiveOwnMessages();", "public function testConsumeInsufficientDontRemoveTokens()\n {\n $rate = new Rate(1, Rate::SECOND);\n $bucket = new TokenBucket(10, $rate, new SingleProcessStorage());\n $bucket->bootstrap(1);\n\n $this->assertFalse($bucket->consume(2, $seconds));\n $this->assertEquals(1, $seconds);\n\n $this->assertFalse($bucket->consume(2, $seconds));\n $this->assertEquals(1, $seconds);\n\n $this->assertTrue($bucket->consume(1));\n }", "public function testWriteWithInvalidEvent()\n {\n $parsed = array(\n 'invalid' => \":invalid:message\\r\\n\",\n );\n\n $parser = $this->getMockParser();\n Phake::when($parser)\n ->consumeAll($parsed['invalid'])\n ->thenReturn(array($parsed));\n\n $read = $this->getMockReadStream();\n $read->setParser($parser);\n $read->write($parsed['invalid']);\n\n Phake::verify($read)->emit('invalid', array($parsed['invalid']));\n Phake::verify($read, Phake::never())->emit(\n $this->logicalOr($this->equalTo('data'), $this->equalTo('irc.received')),\n $this->anything()\n );\n }", "public function shouldHandleWhenNoMessagesPoppedFromSqsQueue()\n {\n $fakeReceiveMessageResponseModel = ['Messages' => []];\n\n $mockedSqsClient = \\Mockery::mock(SqsClient::class);\n $mockedSqsClient\n ->shouldReceive('receiveMessage')\n ->once()\n ->with(\n [\n 'QueueUrl' => $this->queueUrl,\n 'AttributeNames' => ['ApproximateReceiveCount'],\n ]\n )\n ->andReturn($fakeReceiveMessageResponseModel);\n $sqsQueue = new CustomSqsQueue($mockedSqsClient, $this->queueName);\n\n $result = $sqsQueue->pop($this->queueUrl);\n\n $this->assertEquals(null, $result);\n }", "public function testMessageIsConfirmedAfterProcessing()\n {\n $message = new QueueMessage();\n $consumer = $this->getConsumer($message, 1);\n\n $consumer->expects($this->once())\n ->method('confirmMessage')\n ->with(\n $this->anything(),\n $this->equalTo($message));\n\n $consumer->consume($this->createMock(EndpointInterface::class));\n }", "public function test_peekMessage() {\n\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
generates a Section select list for the passed content element
function SelectSection($content_element, $field_name, $active = null, $javascript){ if(empty($content_element->sec_table)) return false; $id_field = $content_element->sec_table_id; $name_field = $content_element->sec_table_title; $database = JFactory::getDBO(); $query = "SELECT * " . " FROM #__" . $content_element->sec_table . " ORDER BY ". $name_field ; $database->setQuery($query); $values = $database->loadObjectList(); $sections[] = JHTML::_('select.option','',"- Section -"); foreach($values as $value){ $sections[] = JHTML::_('select.option', htmlspecialchars($value->$id_field), htmlspecialchars($value->$name_field)); } return JHTML::_('select.genericlist', $sections, $field_name, $javascript.' class="inputbox" size="1"', 'value', 'text', $active ); }
[ "function SelectCategory($content_element, $field_name, $section=null, $active = null, $javascript){\r\n\tif(empty($content_element->cat_table)) return false;\r\n\r\n\t$database = JFactory::getDBO();\r\n\r\n\t$id_field \t= $content_element->cat_table_id;\r\n\t$name_field = $content_element->cat_table_title;\r\n\r\n\t$query = \"SELECT * \" .\r\n\t\t\t\" FROM #__\" . $content_element->cat_table .\r\n\t\t\t\" WHERE 1 \";\r\n\tif($content_element->cat_parent_section_table && $section){\r\n\t\t$query .= \" AND \" . $content_element->cat_parent_section_field . \"= '$section' \";\r\n\t}\r\n\telseif($content_element->cat_section_filter){\r\n\t\t$query .= \" AND \" . $content_element->cat_parent_section_field . \"= '\".$content_element->cat_section_filter.\"' \";\r\n\t}\r\n\t$query .= \" ORDER BY \". $name_field ;\r\n\r\n\t$database->setQuery($query);\r\n\t$values = $database->loadObjectList();\r\n\r\n\t$categories[] = JHTML::_('select.option','',\"- Category -\");\r\n\tforeach($values as $value){\r\n\t\t$categories[]\t= JHTML::_('select.option', htmlspecialchars($value->$id_field), htmlspecialchars($value->$name_field));\r\n\t}\r\n\treturn\tJHTML::_('select.genericlist', $categories, $field_name, $javascript.' class=\"inputbox\" size=\"1\"', 'value', 'text', $active );\r\n}", "public function action_ajax_sections_select()\n { \n if ($this->request->param('cat_section_ids') != '')\n {\n $action = ((int)$this->request->param('id') == 0) ? 'create' : 'update';\n\n $product = $this->_model($action, 'Model_Product');\n\n $form = $this->_form($action, $product);\n\n $component = $form->find_component('additional_sections[' . (int) $this->request->param('cat_sectiongroup_id') . ']');\n if ($component)\n {\n $this->request->response = $component->render();\n }\n }\n }", "function on_cap_load_sections ()\n{\n $html[] = array ();\n foreach (get_sections ($_REQUEST['bk']) as $section) {\n $section = esc_attr ($section);\n $html[] = \"<option value='$section'>$section</option>\";\n }\n send_json (true, '', $html);\n}", "private function prepareContentSelectBox() {\r\n\t\t$content = array();\r\n\t\tforeach ($this->typesOfContent as $type) {\r\n\t\t\t$data = $this->db->table($type[\"table\"])->fetchPairs(\"id\", \"title\");\r\n\t\t\tforeach ($data as $key => $value) {\r\n\t\t\t\tif ($value == \"ROOT\") {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t$content[\"$type[table]:$key\"] = \"$type[title] - $value\";\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $content;\r\n\t}", "function SelectSection( $name, $active=NULL, $javascript=NULL, $order='ordering' ) {\r\n\t\tglobal $database;\r\n\r\n\t\t$categories[] = mosHTML::makeOption( '0', _SEL_SECTION );\r\n\t\t$query = \"SELECT id AS value, title AS text\"\r\n\t\t. \"\\n FROM #__sections\"\r\n\t\t. \"\\n WHERE published = 1\"\r\n\t\t. \"\\n ORDER BY $order\"\r\n\t\t;\r\n\t\t$database->setQuery( $query );\r\n\t\t$sections = array_merge( $categories, $database->loadObjectList() );\r\n\r\n\t\t$category = mosHTML::selectList( $sections, $name, 'class=\"inputbox\" size=\"1\" '. $javascript, 'value', 'text', $active );\r\n\r\n\t\treturn $category;\r\n\t}", "function _parse_multiple_input( $content )\n\t{\n\t\t// No options? Nothing to see here\n\t\tif( ! $content ):\n\t\t\t\n\t\t\treturn;\n\t\t\n\t\tendif;\n\n\t\t// We are hijacking the trigger for a sec\n\t\t$this->mm->simpletags->set_trigger('option');\n\t\n\t\t$parsed = $this->mm->simpletags->parse( $content, array(), array($this, 'parse_options') );\n\n\t\t// Back to normal\n\t\t$this->mm->simpletags->set_trigger('input:');\n\t\t\n\t\t// Wrap <select> stuff\n\t\tif( $this->type == 'dropdown' ):\n\t\t\n\t\t\t$parsed['content'] = '<select name=\"'.$this->name.'\">'.$parsed['content'].'</select>';\n\t\t\n\t\tendif;\n\n\t\treturn $parsed['content'];\n\t}", "private function _setupContentidFiltering( )\n\t{\n\t\t$app = JFactory::getApplication();\n\t\t$option = JRequest::getCmd('option');\n\n\t\t// print \"Hello from _setupContentidFiltering<br />\\n\";\n\t\t//\n\t\t// add the first select option then append the contentids from the DB\n\t\t// build the form control (select list)\n\t\t//\n\t\t$options = array();\n\t\t$filter_contentid = $app->getUserStateFromRequest( $option.'filter_contentid', 'filter_contentid' );\n\t\t$js = \"onchange=\\\"if (this.options[selectedIndex].value!=''){document.adminForm.submit();}\\\"\";\n\t\t$options[] = JHTML::_('select.option', '0', '- '.JText::_('Select Article Title').' -' );\n\t\t$options = array_merge( $options, $this->_contentids );\n\t\t$this->_lists['contentid'] = JHTML::_('select.genericlist',\n\t\t $options,\n\t\t 'filter_contentid',\n\t\t 'class=\"inputbox\" size=\"1\" '.$js,\n\t\t 'value', 'text', $filter_contentid);\n\t\treturn $this->_lists;\n\t}", "public function makeSelect(){\n echo \"<select name=\\\"\" .$this->getName(). \"\\\">\\n\";\n //Create options.\n $this->makeOptions($this->getValue());\n echo \"</select>\" ;\n }", "public function makeSelect(){\n echo \"<select name=\\\"\" .$this->getName(). \"\\\"><br>\";\n $this->makeOptions($this->getValue());\n echo \"</select>\" ;\n }", "function syt_show_dropdown_options_func( $atts, $content = null ) {\n\n\tif(!empty($_SESSION['SYT_DEMO_USER']) && $_SESSION['SYT_DEMO_USER'])\n\t{\n\t\t\n\t\t$str = \t'<option value=\"#\">Select a section...</option>\n\t\t<option disabled=\"disabled\">Amendment Register</option>\n\t\t<option disabled=\"disabled\">General Requirements</option>\n\t<option value=\"?p=2289\">DEMO: HS&amp;W Policy Statement</option>\n\t<optgroup label = \"Planning\">\n\t\t<option disabled=\"disabled\">Contents</option>\n\t\t<option disabled=\"disabled\">Hazard id, R.A.s + controls</option>\n\t\t<option disabled=\"disabled\">Legal + Other requirements</option>\n\t\t<option disabled=\"disabled\">Objectives + Programmes</option>\n\t</optgroup>\n\t<optgroup label = \"Implementation + Operations\">\n\t\t<option disabled=\"disabled\">Contents</option>\n\t\t<option disabled=\"disabled\">Resources + responsibilities</option>\n\t\t<option value=\"?p=3160\">DEMO: Management \\ Board</option>\n\t\t<option value=\"?p=3162\">DEMO: Chief Exec.</option>\n\t\t<option disabled=\"disabled\">-- Senior HSW Manager</option>\n\t\t<option disabled=\"disabled\">-- Heads of Depts.</option>\n\t\t<option disabled=\"disabled\">-- Employees \\ Comitteee</option>\n\t\t<option disabled=\"disabled\">-- HS Administrator</option>\n\t\t<option disabled=\"disabled\">-- HS+W Champions</option>\n\t\t<option disabled=\"disabled\">Training + Awareness</option>\n\t\t<option disabled=\"disabled\">Communication + participation</option>\n\t\t<option disabled=\"disabled\">Documentation</option>\n\t\t<option disabled=\"disabled\">Control of Docs.</option>\n\t\t<option disabled=\"disabled\">Operational control</option>\n\t\t<option disabled=\"disabled\">Emergency preparedness</option>\n\t</optgroup>\n\t<optgroup label = \"Checking\">\n\t\t<option disabled=\"disabled\">Contents</option>\n\t\t<option disabled=\"disabled\">Performance measurement</option>\n\t\t<option disabled=\"disabled\">Evaluation of compliance</option>\n\t\t<option value=\"?p=2331\">DEMO: Incident Investigation</option>\n\t\t<option disabled=\"disabled\">Control of Records</option>\n\t\t<option disabled=\"disabled\">Internal Audit</option>\n\t</optgroup>\n\t<option disabled=\"disabled\">Management Review</option>\n\t<optgroup label = \"Topic Specific Policies \">\n\t\t<option disabled=\"disabled\">Contents</option>\n\t\t<option value=\"?p=2342\">DEMO: Accidents + First-aid</option>\n\t\t<option disabled=\"disabled\">Alcohol, Drugs + Smoking</option>\n\t\t<option disabled=\"disabled\">Asbestos</option>\n\t\t<option disabled=\"disabled\">Blood, Body Fluids + Sharps</option>\n\t\t<option disabled=\"disabled\">Confined Spaces</option>\n\t\t<option disabled=\"disabled\">Contractor Management</option>\n\t\t<option disabled=\"disabled\">Display Screen Equipment</option>\n\t\t<option disabled=\"disabled\">Electricity</option>\n\t\t<option disabled=\"disabled\">EM + NI Radiation</option>\n\t\t<option value=\"?p=2365\">DEMO: Fire Safety</option>\n\t\t<option disabled=\"disabled\">Gas Safety</option>\n\t\t<option disabled=\"disabled\">Hazardous Substances</option>\n\t\t<option disabled=\"disabled\">Homeworking</option>\n\t\t<option disabled=\"disabled\">Lifts + Escalators</option>\n\t\t<option disabled=\"disabled\">Lone Working</option>\n\t\t<option disabled=\"disabled\">Manual Handling</option>\n\t\t<option disabled=\"disabled\">New + Expectant Mothers</option>\n\t\t<option disabled=\"disabled\">Noise</option>\n\t\t<option disabled=\"disabled\">Personal Protective Equipment</option>\n\t\t<option disabled=\"disabled\">Stress Management</option>\n\t\t<option disabled=\"disabled\">Terrorism Threat</option>\n\t\t<option disabled=\"disabled\">Vehicles + Occup. Driving</option>\n\t\t<option disabled=\"disabled\">Violence + Aggression</option>\n\t\t<option value=\"?p=2396\">DEMO: Water Systems – Legionella</option>\n\t\t<option disabled=\"disabled\">Wellbeing + O.H.</option>\n\t\t<option disabled=\"disabled\">Work at Height</option>\n\t\t<option disabled=\"disabled\">Workplace + Env. Conditions</option>\n\t\t<option disabled=\"disabled\">Young Persons</option>\n\t</optgroup>';\n\t}\n\telse\n\t{\n\t\t$str = '<option value=\"#\">Select a section...</option>\n\t<option value=\"?p=2270\">Full Contents</option>\n\t<option value=\"?p=2279\">Amendment Register</option>\n\t<option value=\"?p=2284\">General Requirements</option>\n\t<option value=\"?p=2289\">HS&amp;W Policy Statement</option>\n\t<optgroup label = \"Planning\">\n\t\t<option value=\"?p=2291\">Contents</option>\n\t\t<option value=\"?p=2293\">Hazard id, R.A.s + controls</option>\n\t\t<option value=\"?p=2295\">Legal + Other requirements</option>\n\t\t<option value=\"?p=2298\">Objectives + Programmes</option>\n\t</optgroup>\n\t<optgroup label = \"Implementation + Operations\">\n\t\t<option value=\"?p=2301\">Contents</option>\n\t\t<option value=\"?p=2303\">Resources + responsibilities</option>\n\t\t<option value=\"?p=3160\">-- Management \\ Board</option>\n\t\t<option value=\"?p=3162\">-- Chief Exec.</option>\n\t\t<option value=\"?p=3164\">-- Senior HSW Manager</option>\n\t\t<option value=\"?p=3166\">-- Heads of Depts.</option>\n\t\t<option value=\"?p=3168\">-- Employees \\ Comitteee</option>\n\t\t<option value=\"?p=3182\">-- HS Administrator</option>\n\t\t<option value=\"?p=3184\">-- HS+W Champions</option>\n\t\t<option value=\"?p=2306\">Training + Awareness</option>\n\t\t<option value=\"?p=2310\">Communication + participation</option>\n\t\t<option value=\"?p=2312\">Documentation</option>\n\t\t<option value=\"?p=2315\">Control of Docs.</option>\n\t\t<option value=\"?p=2317\">Operational control</option>\n\t\t<option value=\"?p=2320\">Emergency preparedness</option>\n\t</optgroup>\n\t<optgroup label = \"Checking\">\n\t\t<option value=\"?p=2322\">Contents</option>\n\t\t<option value=\"?p=2325\">Performance measurement</option>\n\t\t<option value=\"?p=2328\">Evaluation of compliance</option>\n\t\t<option value=\"?p=2331\">Incident Investigation</option>\n\t\t<option value=\"?p=2333\">Control of Records</option>\n\t\t<option value=\"?p=2335\">Internal Audit</option>\n\t</optgroup>\n\t<option value=\"?p=2337\">Management Review</option>\n\t<optgroup label = \"Topic Specific Policies \">\n\t\t<option value=\"?p=2339\">Contents</option>\n\t\t<option value=\"?p=2342\">Accidents + First-aid</option>\n\t\t<option value=\"?p=2344\">Alcohol, Drugs + Smoking</option>\n\t\t<option value=\"?p=2346\">Asbestos</option>\n\t\t<option value=\"?p=2348\">Blood, Body Fluids + Sharps</option>\n\t\t<option value=\"?p=2350\">Confined Spaces</option>\n\t\t<option value=\"?p=2353\">Contractor Management</option>\n\t\t<option value=\"?p=2355\">Display Screen Equipment</option>\n\t\t<option value=\"?p=2358\">Electricity</option>\n\t\t<option value=\"?p=2362\">EM + NI Radiation</option>\n\t\t<option value=\"?p=2365\">Fire Safety</option>\n\t\t<option value=\"?p=2367\">Gas Safety</option>\n\t\t<option value=\"?p=2369\">Hazardous Substances</option>\n\t\t<option value=\"?p=2371\">Homeworking</option>\n\t\t<option value=\"?p=2373\">Lifts + Escalators</option>\n\t\t<option value=\"?p=2375\">Lone Working</option>\n\t\t<option value=\"?p=2378\">Manual Handling</option>\n\t\t<option value=\"?p=2380\">New + Expectant Mothers</option>\n\t\t<option value=\"?p=2383\">Noise</option>\n\t\t<option value=\"?p=2385\">Personal Protective Equipment</option>\n\t\t<option value=\"?p=2388\">Stress Management</option>\n\t\t<option value=\"?p=2390\">Terrorism Threat</option>\n\t\t<option value=\"?p=2392\">Vehicles + Occup. Driving</option>\n\t\t<option value=\"?p=2394\">Violence + Aggression</option>\n\t\t<option value=\"?p=2396\">Water Systems – Legionella</option>\n\t\t<option value=\"?p=2398\">Wellbeing + O.H.</option>\n\t\t<option value=\"?p=2400\">Work at Height</option>\n\t\t<option value=\"?p=2403\">Workplace + Env. Conditions</option>\n\t\t<option value=\"?p=2405\">Young Persons</option>\n\t</optgroup>';\n\t}\n\treturn $str;\n}", "function fetch_section_list(){\n\tglobal $CFG, $COURSE, $DB;\n\t$conditions=array('course'=>$COURSE->id);\n\t$sections = $DB->get_records_menu('course_sections',$conditions,'section','section,name'); \n\t //massage the section data a little, just in case the name field is blank\n\t $usesections = array();\n\t foreach($sections as $sectionid=>$sectionname){\n\t\t$usesections[$sectionid] = $sectionid . ': ' . $sectionname;\n\t }\n return $usesections;\n }", "function html_selection_list($var, $label, $items, $value = '', $table = '') {\r\n global $ORDER, $TABLE;\r\n\r\n $html = html_label($var, $label);\r\n\r\n if(is_array($items) || db_fetch($table)) {\r\n $html .= '<select name=\"' . $var . '\">' . \"\\n\";\r\n \r\n if(is_array($items)) {\r\n foreach($items as $item) {\r\n $html .= '<option value=\"' . (is_array($item) ? $item['id'] : $item) . '\"' . (($value == (is_array($item) ? $item['id'] : $item)) ? ' selected' : '') . '>' . (is_array($item) ? $item['title'] : $item) . '</option>' . \"\\n\";\r\n }\r\n }\r\n \r\n if($items = db_fetch($table, $ORDER[strtoupper($table)])) {\r\n for($i = 1; $i <= mysql_num_rows($items); $i++) {\r\n $item = mysql_fetch_array($items);\r\n $html .= '<option value=\"' . $item['id'] . '\"' . (($value == $item['id']) ? ' selected' : '') . '>';\r\n\r\n if($table == $TABLE[COMMENTS]) {\r\n $entry = db_fetch($TABLE[ENTRIES], '', $item['entry']);\r\n $section = db_fetch($TABLE[SECTIONS], '', $entry['section']);\r\n $category = db_fetch($TABLE[CATEGORIES], '', $entry['category']);\r\n $html .= ($section['title'] ? $section['title'] : '') . ': ' . ($category['title'] ? $category['title'] : '') . ': ' . ($entry['title'] ? $entry['title'] : '') . ': ' . $item['name'] . ' (' . $item['date'] . ')';\r\n } elseif($table == $TABLE[ENTRIES]) {\r\n $section = db_fetch($TABLE[SECTIONS], '', $item['section']);\r\n $category = db_fetch($TABLE[CATEGORIES], '', $item['category']);\r\n $html .= ($section['title'] ? $section['title'] : '') . ': ' . ($category['title'] ? $category['title'] : '') . ': ' . $item['title'];\r\n } elseif($table == $TABLE[SEGMENTS]) {\r\n $entry = db_fetch($TABLE[ENTRIES], '', $item['entry']);\r\n $section = db_fetch($TABLE[SECTIONS], '', $entry['section']);\r\n $category = db_fetch($TABLE[CATEGORIES], '', $entry['category']);\r\n $html .= ($section['title'] ? $section['title'] : '') . ': ' . ($category['title'] ? $category['title'] : '') . ': ' . ($entry['title'] ? $entry['title'] : '') . ': ' . $item['title'];\r\n } elseif($table == $TABLE[TEMPLETS]) {\r\n $section = db_fetch($TABLE[SECTIONS], '', $item['section']);\r\n $category = db_fetch($TABLE[CATEGORIES], '', $item['category']);\r\n $html .= strtoupper($item['class']) . ': ' . ($item['section'] ? $section['title'] . ': ' : '') . ($item['category'] ? $category['title'] . ': ' : '') . ucwords($item['type']);\r\n } else {\r\n $html .= $item['title'];\r\n }\r\n\r\n $html .= '</option>' . \"\\n\";\r\n }\r\n }\r\n \r\n $html .= '</select>';\r\n } else {\r\n $html .= '<p>None available.</p>';\r\n }\r\n\r\n return $html . \"\\n\";\r\n}", "protected function start_section_list() {\n return html_writer::start_tag('ul', array('class' => 'accordion collapsibletopics', 'aria-multiselectable' => true));\n }", "protected function makePageList() {\n\n\t\t// create page list ... a little bit ugly...\n\t\t$pageSelect = $this->dataformat->format('cmt_pages_' . $this->pageLanguage, 'cmt_parentid', $this->newsletterPageID, 'edit');\n\t\t\n\t\t$pageSelect = preg_replace(array(\n\t\t\t'/\\<select[^>]+\\>/',\n\t\t\t'/\\<\\/select\\>/'\n\t\t), '', $pageSelect);\n\t\t\n\t\treturn $pageSelect;\n\t}", "function vital_gform_select_wrap($content, $field, $value, $lead_id, $form_id) {\n if ($field->type === 'select' || $field->type === 'address') {\n $content = str_replace('<select', '<div class=\"gform_styled_select\"><select', $content);\n $content = str_replace('</select>', '</select><span class=\"icon\"><svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 64 36.5\"><path d=\"M32 36.5c-1.1 0-2.3-.4-3.2-1.3L1.3 7.7c-1.8-1.8-1.8-4.6 0-6.3C3-.3 5.9-.3 7.6 1.4L32 25.7 56.3 1.3c1.8-1.7 4.6-1.7 6.3 0 1.8 1.7 1.8 4.6 0 6.3L35.2 35.2c-.9.8-2.1 1.3-3.2 1.3z\"/></svg></span></div>', $content);\n }\n return $content;\n}", "function generateSeoPageCategorySelect()\n{\n $args = ['name' => 'seo_section'];\n $sections = get_terms($args, 'objects');\n $currentValue = filter_input(INPUT_GET, 'seo-page-category', FILTER_VALIDATE_INT);\n $filterHtml = '<select name=\"seo-page-category\">' .\n '<option value=\"\">' . __('All SEO Sections') . '</option>';\n\n foreach ($sections as $section) {\n $selected = ((int)$section->term_id === (int)$currentValue) ? ' selected=\"selected\" ' : '';\n $filterHtml .= '<option value=\"' . $section->term_id . '\"' . $selected . '>' . $section->name . '</option>';\n }\n\n $filterHtml .= '</select>';\n\n return $filterHtml;\n}", "function genesis_extender_build_taxonomy_description_elements_menu( $selected = '' )\n{\n\t$genesis_extender_taxonomy_description_elements_array = genesis_extender_taxonomy_description_elements_array();\n\t\n\tforeach( $genesis_extender_taxonomy_description_elements_array as $element_type => $elements )\n\t{\n\t\techo '<optgroup label=\"' . $element_type . '\">';\n\t\tforeach( $elements as $element_slug => $element_data )\n\t\t{\n\t\t\t$option = '<option value=\"' . $element_data . ' {\"';\n\t\t\t\t\n\t\t\tif( $element_data == $selected )\n\t\t\t{\n\t\t\t\t$option .= ' selected=\"selected\"';\n\t\t\t}\n\n\t\t\t$option .= '>' . $element_slug . '</option>';\n\t\t\t\n\t\t\techo $option;\n\t\t}\n\t\techo '</optgroup>';\n\t}\n}", "function build_nested_select_menu($name, $elementList)\n{\n return '<select name=\"' . $name . '\">' . \"\\n\"\n . implode(\"\\n\", prepare_option_tags($elementList) )\n . '</select>' . \"\\n\"\n ;\n}", "function getVectorBasedSubSectionMarkup(&$root,$vector,$myvalues,$section_name,$bShowCustom,$aChoices,$disabled)\n {\n $sListRootName = $section_name . '_'.$vector.'_';\n //$sListboxName = $sListRootName.'id';\n $value_itemname = $sListRootName.'customtx';\n $aStatesEntry = NULL;\n $sInlineName = 'inline_'.$vector;\n $root[$section_name.'_fieldset_col1'][$sListRootName . '_inputmode'] = array(\n '#type' => 'hidden', //Needed at database update time to know what control to read!\n );\n $root[$section_name.'_fieldset_col2'][$sInlineName] = array(\n '#type' => 'fieldset',\n '#attributes' => array('class' => array('container-inline')),\n '#disabled' => $disabled,\n );\n if(!isset($myvalues[$value_itemname]))\n {\n $mydefault_value = NULL;\n } else {\n $mydefault_value = $myvalues[$value_itemname];\n }\n $element = FormHelper::createCustomSelectPanel($section_name, $sListRootName, $aChoices, $disabled\n , $aStatesEntry\n , $myvalues\n , $bShowCustom, $mydefault_value);\n $root[$section_name.'_fieldset_col2'][$sInlineName]['panel'] = $element; \n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the periode archivage.
public function getPeriodeArchivage(): ?DateTime { return $this->periodeArchivage; }
[ "public function getPeriodeArchivage() {\n return $this->periodeArchivage;\n }", "public function getARCHIVO()\n {\n return $this->ARCHIVO;\n }", "public function getArchivoPublicidad(){\n\t\treturn $this->archivo_publicidad;\n\t}", "public function getArchaeologicalData()\r\n {\r\n return $this->archaeologicalData;\r\n }", "public function setPeriodeArchivage(DateTime $periodeArchivage = null) {\n $this->periodeArchivage = $periodeArchivage;\n return $this;\n }", "public function getArchiving()\n {\n return $this->_archiving;\n }", "public function getArchive()\n {\n return $this->archive;\n }", "public function getArchive() {\n\t\treturn $this->packageArchive;\n\t}", "public function getArchivo_evidencia()\n {\n return $this->archivo_evidencia;\n }", "function get_archives_page() {\n\n\t$post_id = get_archives_page_id();\n\n\treturn get_post( $post_id );\n}", "public function getArchived()\n {\n $rtn = $this->data['archived'];\n\n return $rtn;\n }", "public function getArchType()\n {\n return $this->archType;\n }", "public function getArchive()\n {\n return $this->getField('archive');\n }", "public function getTpArchive() {\n return $this->tpArchive;\n }", "public function getArchive();", "public function getArchive() {\n return $this->zip;\n }", "public function getArchive()\n {\n return $this->_zip;\n }", "public function getArchive()\n {\n return $this->getAdapter()->getArchive();\n }", "public function getComparte_archivos(){\r\n return $this->comparte_archivos;\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Filters countries based on the search string.
public function filterCountries($query, $selected_countries) { // do nothing }
[ "public function search($filter) {\n //Don't even bother trying if filter is too short\n if(strlen($filter) < 2) return $this->set_error('\"' . $filter . '\" is too short, $filter must be at least 2 characters long');\n\n //GOGOGO!\n return $this->get_list(self::SERVICE_SEARCH, array('country' => $filter), 'countries');\n }", "function country_search()\n\t{\n\t\tif( sizeof( $_POST ) )\n\t\t{\n\t\t\t$output = '<ul id=\"countries\" selected=\"true\">';\n\t\t\tforeach( _get_countries() as $country )\n\t\t\t{\n\t\t\t\tif( preg_match( '/^' . $_POST[ 'country' ] . '/i', $country ) )\n\t\t\t\t{\n\t\t\t\t\t$output .= '<li>' . $country . '</li>';\n\t\t\t\t}\n\t\t\t}\n\t\t\t$output .= '</ul>';\n\t\t\tset( 'output', $output );\n\t\t}\n\t\treturn html( 'country_search.tpl.php' );\n\t}", "function getCountryISO($search)\n{\n // pull the countries array from a different file\n $countries = include \"../app/includes/countries_array.php\";\n\n // uppercase the first letter of the searched query\n $input = ucwords($search);\n\n // find all matching results\n $input = preg_quote($input, '~');\n $result = preg_grep(\"~$input~\", $countries);\n\n // if any results were found then return their ISOs, otherwise put search value in array\n return count($result) ? array_keys($result) : [$search];\n}", "private function filterByCountry(&$xml, $params = array())\n {\n // filter by country\n if (isset($params['country'])) {\n $countryQuery = $this->clearString((string)$xml->country);\n $getQuery \t\t= $this->clearString($params['country']);\n\n if (!stristr($countryQuery, $getQuery)) {\n return true;\n }\n } else {\n // brazil results by default\n if ((string)$xml->country != 'Brasil') {\n return true;\n }\n }\n\n return false;\n }", "function searchCountry($str){\n\n\t\tif($str==\"\"){\n\t\t\techo \"Enter something to search!\";\n\t\t}\n\n\t\telse {\n\t\t\t$q1 = \"SELECT * FROM sbl_beer INNER JOIN stock ON nr=beer_id WHERE ursprunglandnamn LIKE '%$str%'\";\n\t\t\t$result= $this -> mysqli -> query($q1) or die (\"query failed!\");\n\n\t\t\tif (mysqli_num_rows($result)==0){\n\t\t\t\techo \"No such country title $str\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$this -> makeAllBeerTable($result);\n\t\t\t}\n\t\t\t$result -> close();\n\t\t}\n\t}", "public function searchAutocompleteCountriesAction() {\n $em = $this->getDoctrine()->getManager();\n\n $countries = $em->getRepository('AppBundle:Country')->searchCountryByString($_POST['query']);\n $suggestions = array();\n\n # Countries\n foreach($countries as $country) {\n $suggestions[] = array(\n \"value\" => $country->getEn(),\n \"data\" => $country->getEn()\n );\n }\n\n return new Response(json_encode(array('suggestions' => $suggestions)));\n }", "public function countryfilterAction()\n {\n $page = $this->params()->fromQuery('page', 1);\n $filter = $this->params()->fromRoute('country', null);\n\n // Filter posts by Country\n $query = $this->entityManager->getRepository(Post::class)->findPostsByCountry($filter);\n\n $adapter = new DoctrineAdapter(new ORMPaginator($query, false));\n $paginator = new Paginator($adapter);\n $paginator->setDefaultItemCountPerPage(15);\n $paginator->setCurrentPageNumber($page);\n\n /* Change layout */\n $this->layout()->setTemplate('layout/layout-front');\n\n /* Latest 3 posts */\n $latestPosts = $this->entityManager->getRepository(Post::class)->findLatestPosts(2);\n\n /* Countries List */\n $countries = $this->entityManager->getRepository(Post::class)->getCountries();\n\n /* Cuisine Types list */\n $types = $this->entityManager->getRepository(Post::class)->getCuisineTypes();\n\n // Render the view template.\n return new ViewModel([\n 'posts' => $paginator,\n 'postManager' => $this->postManager,\n 'countries' => $countries,\n 'types' => $types,\n 'latestPosts' => $latestPosts\n ]);\n }", "public function country()\n {\n $this->builder->whereHas('address', function($query) {\n $query->where('country', request()->country);\n });\n }", "public function searchCityNames() {\n\t\tif (isset($this->request->query['q'])) {\n\t\t\t$searchStr = $this->request->query['q'];\n\t\t\t$data = $this->City->searchCityLocations($searchStr);\n\t\t\tif (!empty($data)) {\n\t\t\t\tforeach ($data as $id => $name) {\n\t\t\t\t\techo strip_tags(\"$name|$id\\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\texit();\n\t}", "public function getAllCountries();", "public function getCountriesForSelect();", "protected function getDestCountryFilter()\n {\n return $this->getTextFilter()->appendFilter(new Zend_Filter_Callback(array(\n 'callback' => array($this, 'filterDestCountry'), \n )));\n }", "public function country();", "function states_list($countries)\n\t{\n\t\tlog_message('debug', '_search/states_list');\n\t\tlog_message('debug', '_search/states_list:: [1] countries=' . $countries);\n\n\t\t$countriesArray = explode(',', $countries);\n\t\tforeach($countriesArray as $key => $country) {\n\t\t\tif (empty($country)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$countriesArray[$key] = \"'$country'\";\n\t\t}\n\n\t\t$countries = implode(',', $countriesArray);\n\n\t\t$result = $this->_query_reader->get_list('get_states_by_countries', array('code' => \"$countries\"));\n\n\t\tlog_message('debug', '_search/countries_list:: [2] result=' . json_encode($result));\n\n\t\treturn $result;\n\t}", "public function getCountries();", "function findAllCountries(){\n $ports = self::$con->executeSelectStatement($this->selectCountryStmt(),array());\n return $this->getCollectionCountry($ports); \n }", "public function filterCountry($country = 'US')\n {\n return $this->filter(\n function ($key, $value) use ($country) {\n if ($value instanceof CountryFilter && $value->getIso31661() == $country) {\n return true;\n }\n }\n );\n }", "public function localize() {\n\t\t$options = $this->get_filter_options();\n\t\twp_localize_script( 'sixtenpress-filter', 'SixTenPressFilter', $options );\n\t}", "private function get_countries_and_states()\n {\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
expand an old schedule expand an old v1 schedule hours from 24 to 96 entries
function expand_hours($hours) { $sections = strlen($hours); if ($sections<96) { $insert = 96/$sections; $newhours = ""; for($i=0; $i<$sections; $i++) { for($j=0; $j<$insert; $j++) { $newhours .= $hours[$i]; } } return $newhours; } else return $hours; }
[ "private function parse_schedule(){\n\n }", "public function schedule_plan() {\n $data = array(\n array(scheduler::DAILY, 10, 1389394800, 1389394800, 1389434400),\n array(scheduler::DAILY, 15, 1394202900, 1394202900, 1394204400),\n array(scheduler::DAILY, 15, 1394204400, 1394204400, 1394290800),\n array(scheduler::WEEKLY, 4, 1389484800, 1389484800, 1389830400),\n array(scheduler::WEEKLY, 5, 1394118600, 1394118600, 1394150400),\n array(scheduler::WEEKLY, 5, 1394205000, 1394205000, 1394150400),\n array(scheduler::WEEKLY, 5, 1394291400, 1394291400, 1394755200),\n array(scheduler::MONTHLY, 6, 1389052800, 1389052800, 1391644800),\n array(scheduler::MONTHLY, 31, 1391212800, 1391212800, 1393545600),\n array(scheduler::MONTHLY, 31, 1454284800, 1454284800, 1456704000),\n array(scheduler::MONTHLY, 29, 1394041665, 1394041665, 1396051200),\n array(scheduler::MONTHLY, 1, 1394041665, 1394041665, 1396310400),\n array(scheduler::MONTHLY, 5, 1394041665, 1394041665, 1393977600),\n array(scheduler::HOURLY, 1, 1427346000, 1427346793, 1427349600),\n array(scheduler::HOURLY, 1, 1427410800, 1427410800, 1427414400),\n array(scheduler::HOURLY, 8, 1427446800, 1427454000, 1427472000),\n array(scheduler::HOURLY, 8, 1427472000, 1427472000, 1427500800),\n array(scheduler::MINUTELY, 1, 1427559300, 1427559300, 1427559360),\n array(scheduler::MINUTELY, 1, 1427561940, 1427561940, 1427562000),\n array(scheduler::MINUTELY, 15, 1427556600, 1427556665, 1427557500),\n array(scheduler::MINUTELY, 15, 1427557500, 1427557500, 1427558400),\n );\n return $data;\n }", "function station_convert_schedule_to_24hour($sched = array()) {\r\n\tif(empty($sched)) {\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tif($sched['start_meridian'] == 'pm' && $sched['start_hour'] != 12) {\r\n\t\t$sched['start_hour'] = $sched['start_hour'] + 12;\r\n\t}\r\n\tif($sched['start_meridian'] == 'am' && $sched['start_hour'] < 10) {\r\n\t\t$sched['start_hour'] = \"0\".$sched['start_hour'];\r\n\t}\r\n\tif($sched['start_meridian'] == 'am' && $sched['start_hour'] == 12) {\r\n\t\t$sched['start_hour'] = '00';\r\n\t}\r\n\t\r\n\tif($sched['end_meridian'] == 'pm' && $sched['end_hour'] != 12) {\r\n\t\t$sched['end_hour'] = $sched['end_hour'] + 12;\r\n\t}\r\n\tif($sched['end_meridian'] == 'am' && $sched['end_hour'] < 10) {\r\n\t\t$sched['end_hour'] = \"0\".$sched['end_hour'];\r\n\t}\r\n\tif($sched['end_meridian'] == 'am' && $sched['end_hour'] == 12) {\r\n\t\t$sched['end_hour'] = '00';\r\n\t}\r\n\t\r\n\treturn $sched;\r\n}", "private function expand_activity_by_day()\n {\n// HelperFunction::output($this->activity_day_key);\n $iteraries = new Itinerary();\n $iteraries->days = [];\n\n foreach ($this->activity_day_key as $date => $activities) {\n\n $object = new Day();\n $object->day = $date;\n $object->hours = [];\n\n foreach ($activities as $activity) {\n $hour = new Hour();\n\n $hour->hour_from = intval($activity->time_start_hh);\n $hour->hour_to = intval($activity->time_end_hh);\n $hour->duration = intval($activity->duration);\n\n $hour->activity = $activity; //TODO: uncomment this\n $hour->distances_activity = 0;\n\n array_push($object->hours, $hour);\n }\n\n usort($object->hours, function ($a, $b) {\n return $a->hour_from <=> $b->hour_from;\n });\n array_push($iteraries->days, $object);\n }\n\n\n $this->activity_day_breakdown = $iteraries;\n\n }", "function crb_cron_schedules_extend( $schedules ) {\n\t$schedules['twicehourly'] = array(\n\t\t'interval' => 10 * MINUTE_IN_SECONDS,\n\t\t'display' => __( 'Twice Hourly', 'crb' ),\n\t);\n\n\t// add a 'thricedaily' schedule to the existing set\n\t$schedules['thricedaily'] = array(\n\t\t'interval' => 8 * HOUR_IN_SECONDS,\n\t\t'display' => __( 'Trice Daily', 'crb' ),\n\t);\n\n\treturn $schedules;\n}", "function update_schedule() {\r\n global $connect;\r\n date_default_timezone_set('Europe/Paris');\r\n $actual_date = substr(getSqlDate(time()), 0, 10);\r\n //Removes the hour part of the date\r\n //otherwise, it does not compares well with the sql 'date'\r\n //$update = $connect->query(\"DELETE FROM schedule WHERE '$actual_date' >= date\");\r\n $update = $connect->query(\"SELECT id, date, hour FROM schedule WHERE '$actual_date' > date\")->fetchAll();\r\n foreach ($update as $line) {\r\n unbook($line['id'], $line['date'], $line['hour']);\r\n }\r\n}", "public function CreateHoldingSchedule()\n {\n \n $existing_records = $this->Formatted_Records;\n \n $time_base = 0000;\n $row_data = '';\n for ($i=0; $i<24; $i++) {\n $time_start = $time_base + (($i)*100);\n $time_end = $time_base + (($i+1)*100);\n \n $time_start = str_pad($time_start, 4, \"0\", STR_PAD_LEFT);\n $time_end = str_pad($time_end, 4, \"0\", STR_PAD_LEFT);\n \n $divID = \"time_{$time_start}\"; \n \n $input_date_time = $time_start;\n $output_format = 'g:i a';\n $time_start_display = $this->OBJ_TIMEZONE->ConvertDateTimeBetweenTimezones($input_date_time, 'UTC', 'UTC', $output_format);\n \n $input_date_time = $time_end;\n $output_format = 'g:i a';\n $time_end_display = $this->OBJ_TIMEZONE->ConvertDateTimeBetweenTimezones($input_date_time, 'UTC', 'UTC', $output_format);\n \n \n $input_date_time = $time_start;\n $output_format = 'g A';\n $time = $this->OBJ_TIMEZONE->ConvertDateTimeBetweenTimezones($input_date_time, 'UTC', 'UTC', $output_format);\n \n if (isset($existing_records[$divID])) {\n $content = $existing_records[$divID]['data_content'];\n $delete = $existing_records[$divID]['data_delete'];\n $display = $this->CreateTimeBox($time, $content, $delete);\n \n $orig_content = '';\n $orig_time = $time;\n $classes = 'zones zone_existing_data';\n $classes .= \" {$existing_records[$divID]['class']}\";\n $status = 'existing';\n $recordID = $existing_records[$divID]['id'];\n } else {\n $content = \"OPEN TIME <img style='float:right;' src='/office/images/add.png' alt='Click to Add Session' border='0' class='add_session_btn' parentID='{$divID}' width='24' />\";\n $display = $this->CreateTimeBox($time, $content);\n \n $orig_content = htmlentities(htmlspecialchars($content, ENT_QUOTES)); // encode content for quotes and chevrons\n $orig_time = $time;\n $classes = 'zones';\n $status = '';\n $recordID = '';\n }\n \n $row_data .= \"<div id='{$divID}' class='z_zone {$classes} zones_droppable' status='{$status}' recordID='{$recordID}' timestart='{$time_start}' timeend='{$time_end}' originaltime='{$orig_time}' originalcontent='{$orig_content}'>{$display}</div><div style='clear:both;'></div>\";\n }\n \n $this->Row_Data = $row_data;\n }", "function get_lunch_schedule($schedtype,$gc_start_break,$sched_break_start,$gc_end_break,$sched_break_end,$start_break_partner,$end_break_partner,$sched_to,$actual_timeout,$employee_idno,$date_timelog){\n\t//------------------$gc_end_break - lunch start\n\t//-------------------$gc_start_break - lunch end\n\t//--baligtad\n\t$trs = get_instance();\n\t$trs->load->model('time_record/Timerecordsummary_model');\n\t\t$ded1 = 0;\n\t\t$ded2 = 0;\n\t\t$fix_lunch_break = 0;\n\t\t$lunch_deduction = 0;\n\t\t//-----------LUNCH DEDUCTION / OVERBREAK--------------------------\n\t\t//early out\n\t\tif($gc_start_break <= $sched_break_start){\n\t\t\t$x = $gc_start_break - $sched_break_start;\n\t\t\t$ded1 = $ded1 + $ded2;\n\t\t}\n\t\t//late in\n\t\tif($gc_end_break >= $sched_break_end){\n\t\t\t$y = $gc_end_break -$sched_break_end;\n\t\t\t$ded2 = $ded2 + $y;\n\t\t}\n\t\t//checks if start or end break of employee is greater than his actual time out\n\t\tif($gc_start_break > $sched_to || $gc_end_break > $sched_to){\n\t\t\t$lunch_deduction = 0;\n\t\t}else{\n\t\t\t//\n\t\t\t$lunch_deduction = $ded1 + $ded2;\n\t\t}\n\t\t// $lunch_deduction = $ded1 + $ded2;\n\n\t\t// $one = date('H:i', mktime(0,$gc_start_break));\n\t\t// $two = date('H:i', mktime(0,$start_break_partner));\n\t\t// $three = date('H:i', mktime(0,$gc_end_break));\n\t\t// $four = date('H:i', mktime(0,$end_break_partner));\n\t\t// print_r(array(\n\t\t// \t'start_break' => $one,\n\t\t// \t'start_partner' => $two,\n\t\t// \t'end_break' => $three,\n\t\t// \t'end_break_partner' => $four\n\t\t// ));\n\n\n\t\t// print_r(array('start' => $start_break_partner, 'sched' => $sched_break_start));\n\t\t//----FIX LUNCH BREAK------------------\n\t\tif(($gc_start_break > $sched_break_start) && ($start_break_partner < $sched_break_start)){\n\t\t\t$fix_lunch_break = $fix_lunch_break + ($gc_start_break - $sched_break_start);\n\t\t}\n\t\telse{\n\t\t\t$fix_lunch_break = $fix_lunch_break + 0;\n\t\t}\n\t\tif(($gc_end_break < $sched_break_end)){\n\t\t\t$fix_lunch_break = $fix_lunch_break + ($sched_break_end - $gc_end_break);\n\t\t}else{\n\t\t\t$fix_lunch_break = $fix_lunch_break + 0;\n\t\t}\n\t\t//checks if employee is half day\n\t\tif(($actual_timeout == $gc_start_break) && ($actual_timeout < $sched_break_end)){\n\t\t\t$fix_lunch_break = $fix_lunch_break\t+ ($gc_start_break - $gc_end_break);\n\t\t}\n\t\t//checks if start or end break of employee is greater than his actual time out\n\t\tif($gc_start_break > $sched_to || $gc_end_break > $sched_to){\n\t\t\t$fix_lunch_break = 0;\n\t\t}else{\n\t\t\t$fix_lunch_break = $fix_lunch_break;\n\t\t}\n\t\t//will check if time record exist in work order. if workorder exist, it will remove the overbreak of employee\n\t\t$breakout_hhmm = date('H:i', mktime(0,$gc_start_break));\n\t\t$check_workorder = $trs->Timerecordsummary_model->check_lunch_workorder($employee_idno,$date_timelog,$breakout_hhmm)->row();\n\t\tif($check_workorder != null){\n\t\t\t$et = convert_to_minutes($check_workorder->end_time);\n\t\t\tif($et > $sched_break_end){\n\t\t\t\t$overbreak_deduct = $et - $sched_break_end;\n\t\t\t\t$fix_lunch_break = $fix_lunch_break - $lunch_deduction;\n\t\t\t\t$lunch_deduction = $lunch_deduction - $overbreak_deduct;\n\n\t\t\t}\n\t\t}\n\t\t$getbreaks = array(\n\t\t\t'fix_lunch_break' => $fix_lunch_break,\n\t\t\t'lunch_deduction' => $lunch_deduction\n\t\t);\n\t\treturn $getbreaks;\n}", "function ensureMaxHours(&$theSchedule){\n global $days, $hours, $pidArray, $tutorInfo, $GRAD_HOURS, $UGRAD_HOURS,\n $hoursWorking;\n\n $numWorkingArr = array();\n $numWorkingArr = getNumWorkingArr($theSchedule);\n\n foreach($pidArray as $thePid){\n $theType = $tutorInfo[$thePid][\"type\"];\n if($theType == \"grad\" || $theType == \"ugrad\"){\n if($theType == \"grad\")\n $maxHours = $GRAD_HOURS;\n elseif($theType == \"ugrad\")\n $maxHours = $UGRAD_HOURS;\n $numWorking = $hoursWorking[$thePid];\n while($numWorking > $maxHours){\n //unschedule one hour\n $maxArr= getTutorMaxDay($theSchedule,$numWorkingArr,$thePid);\n $maxDay = $maxArr[\"day\"];\n $maxHour = $maxArr[\"hour\"];\n\n $currentTuple = $theSchedule[$maxDay][$maxHour][\"tuples\"][$thePid];\n $thePref = $currentTuple->getPref();\n\n addTuple($preferences,$maxDay,$maxHour,$thePid,$thePref,$theType);\n removeTuple($theSchedule,$maxDay,$maxHour,$thePid);\n $hoursWorking[$thePid]= $hoursWorking[$thePid] - 1;\n $hoursWorkingPerDay[$thePid][$maxDay] = $hoursWorkingPerDay[$thePid][$maxDay] - 1 ;\n $numWorking = $hoursWorking[$thePid];\n }\n }\n }\n}", "function test_scheduler_gives_correct_timeslot_in_1_hour()\n {\n\n $now = strtotime(\"26.11.2015 12:00\");\n\n // add next slot\n $next_today = \"13:00\";\n $this->slots[date(\"D\", $now)][] = $next_today;\n\n $TimeScheduler = new TimeScheduler();\n $TimeScheduler->setLastTimeslot($now);\n $TimeScheduler->setScheduleTimeSlots($this->slots);\n\n $this->assertEquals(strtotime($next_today, $now), $TimeScheduler->getNextTimeSlot());\n\n }", "private function hourAll()\n\t{\n\t\t// Check update schedules\n\t\t$this->run(\"checkQueueSchedules\");\n\t}", "public function _load_schedule() {\n\t\t$this->data['schedule'] = array();\n\n\t\t$sql = \"SELECT ssrmeet_begin_time,\n\t\t\t\t\t\t\t\t\t ssrmeet_end_time,\n\t\t\t\t\t\t\t\t\t ssrmeet_bldg_code building_code,\n\t\t\t\t\t\t\t\t\t stvbldg_desc building,\n\t\t\t\t\t\t\t\t\t ssrmeet_room_code room_number,\n\t\t\t\t\t\t\t\t\t ssrmeet_start_date,\n\t\t\t\t\t\t\t\t\t ssrmeet_end_date,\n\t\t\t\t\t\t\t\t\t ssrmeet_catagory ssrmeet_category,\n\t\t\t\t\t\t\t\t\t ssrmeet_sun_day sunday,\n\t\t\t\t\t\t\t\t\t ssrmeet_mon_day monday,\n\t\t\t\t\t\t\t\t\t ssrmeet_tue_day tuesday,\n\t\t\t\t\t\t\t\t\t ssrmeet_wed_day wednesday,\n\t\t\t\t\t\t\t\t\t ssrmeet_thu_day thursday,\n\t\t\t\t\t\t\t\t\t ssrmeet_fri_day friday,\n\t\t\t\t\t\t\t\t\t ssrmeet_sat_day saturday,\n\t\t\t\t\t\t\t\t\t ssrmeet_schd_code schedule_type_code,\n\t\t\t\t\t\t\t\t\t stvschd_desc schedule_type,\n\t\t\t\t\t\t\t\t\t ssrmeet_credit_hr_sess session_credit_hours,\n\t\t\t\t\t\t\t\t\t ssrmeet_meet_no num_meeting_times,\n\t\t\t\t\t\t\t\t\t ssrmeet_hrs_week hours_per_week\n\t\t\t\t\t\t\tFROM ssrmeet,\n stvbldg,\n stvschd\n\t\t\t\t\t WHERE ssrmeet_crn = :crn \n\t\t\t\t\t\t\t AND ssrmeet_term_code = :term_code\n AND stvbldg_code = ssrmeet_bldg_code\n\t\t\t\t\t\t\t AND stvschd_code = ssrmeet_schd_code\n ORDER BY ssrmeet_start_date, ssrmeet_end_date, ssrmeet_begin_time\";\t\t\n\n\t\t$args = array(\n\t\t\t'crn' => $this->crn,\n\t\t\t'term_code' => $this->term_code\n\t\t);\n\n\t\tif($results = \\PSU::db('banner')->Execute($sql, $args)) {\n\t\t\tforeach($results as $row) {\n\t\t\t\t$row = \\PSU::cleanKeys('ssrmeet_', '', $row);\n\t\t\t\t$row['begin_time'] = preg_replace('/([0-9]{2})([0-9]{2})/', '\\1:\\2', $row['begin_time']);\n\t\t\t\t$row['end_time'] = preg_replace('/([0-9]{2})([0-9]{2})/', '\\1:\\2', $row['end_time']);\n\t\t\t\t$row['start_date'] = strtotime($row['start_date']);\n\t\t\t\t$row['end_date'] = strtotime($row['end_date']);\n\t\t\t\t$row['days'] = $row['sunday'].$row['monday'].$row['tuesday'].$row['wednesday'].$row['thursday'].$row['friday'].$row['saturday'];\n\t\t\t\t$this->data['schedule'][] = $row;\n\t\t\t}//end foreach\n\t\t}//end if\n\t\t$this->meeting_times = $this->meeting_locations = $this->schedule;\n\t}", "function populateActSchedule(){\n global $con;\n global $pidArray;\n global $days;\n global $hours;\n global $openHours;\n global $preferences;\n global $tutorInfo;\n global $hoursWorking;\n global $hoursWorkingPerDay;\n global $sasbSchedule;\n global $glSchedule;\n\n // delete all previously existing rows\n $sql=\"delete from actSchedule\";\n if(mysqli_query($con,$sql)){\n }\n\n // initialize rows for every tutor\n foreach($pidArray as $thePid){\n // only initialize for grad and ugrad tutors\n if(($tutorInfo[$thePid][\"type\"] == \"grad\") or ($tutorInfo[$thePid][\"type\"] == \"ugrad\")){\n foreach($days as $theDay){\n $sql=\"insert into actSchedule (PID,day,h00,h01,h02,h03,h04,h05,h06,h07,h08,h09,h10,h11,h12,h13,h14,h15,h16,h17,h18,h19,h20,h21,h22,h23) \n values('$thePid','$theDay',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)\";\n if(mysqli_query($con,$sql)){\n }\n }\n }\n }\n\n // update rows based on sasbSchedule\n foreach($days as $theDay){\n foreach($hours as $theHour){\n // only bother scheduling if the writing centers are open\n if($openHours[$theDay][$theHour] == 1){\n foreach($pidArray as $thePid){\n // only look at pids who are ugrad or grad tutors, not admins\n if(($tutorInfo[$thePid][\"type\"] == \"grad\") or ($tutorInfo[$thePid][\"type\"] == \"ugrad\")){\n $tuple=$sasbSchedule[$theDay][$theHour][\"tuples\"][$thePid];\n if($tuple != NULL){ // if tuple exists, tutor is scheduled this hour\n $sql=\"update actSchedule set $theHour=1\n where PID='$thePid' and day='$theDay'\";\n if(mysqli_query($con,$sql)){\n }\n else{\n echo \"Error: \" . mysqli_error($con) . \"<br>\";\n }\n }\n }\n }\n }\n }\n }\n\n foreach($days as $theDay){\n foreach($hours as $theHour){\n // only bother scheduling if the writing centers are open\n if($openHours[$theDay][$theHour] == 1){\n foreach($pidArray as $thePid){\n // only look at pids who are ugrad or grad tutors, not admins\n if(($tutorInfo[$thePid][\"type\"] == \"grad\") or ($tutorInfo[$thePid][\"type\"] == \"ugrad\")){\n $tuple=$glSchedule[$theDay][$theHour][\"tuples\"][$thePid];\n if($tuple != NULL){ // if tuple exists, tutor is scheduled this hour\n $sql=\"update actSchedule set $theHour=2\n where PID='$thePid' and day='$theDay'\";\n if(mysqli_query($con,$sql)){\n }\n else{\n echo \"Error: \" . mysqli_error($con) . \"<br>\";\n }\n }\n }\n }\n }\n }\n }\n}", "function adrotate_reccurences($schedules) {\n\t$schedules['1day'] = array(\n\t\t'interval' => 86400,\n\t\t'display' => __('Daily', 'adrotate')\n\t);\n\t$schedules['3hour'] = array(\n\t\t'interval' => 10800,\n\t\t'display' => __('Every 3 hours', 'adrotate')\n\t);\n\treturn $schedules;\n}", "public function hoursAction()\n\t{\n\t\t// Set information for the schedule image\n\t\t$height = 350;\n\t\t$width = 562;\n\t\t//$height = .7*800; //For printing\n\t\t//$width = .7*1035;\n\n\t\tZend_Controller_Front::getInstance()->setParam('noViewRenderer', true);\n\t\trequire_once( 'schedule.inc' );\n\n\t\t$days = $this->db->getSchedule();\n\n\t\t$xml = \n\"<?xml version='1.0' encoding='ISO-8859-1' ?>\n<schedule blocks='8:25,9:25,10:25,11:25,12:25,13:25,14:25,15:25,16:25' days='Monday,Tuesday,Wednesday,Thursday,Friday'>\n <settings>\n <legend font='2' leftpadding='40' toppadding='20' rightpadding='0' bottompadding='0'/>\n <block bgcolor='#efefef' bordercolor='#0099dd' leftpadding='5' toppadding='3' alpha='40%'>\n <title align='center' color='#0' font='3'/>\n <description align='center' color='#0' font='2'/>\n </block>\n </settings>\n\";\n\n\t\tforeach( $days as $day => $hours )\n\t\t{\n\t\t\t$xml .= \" <day number='{$day}'>\\n\";\n\n\t\t\t$start = -1;\n\t\t\t$span = 1;\n\n\t\t\tforeach($hours as $hour => $users)\n\t\t\t{\n\t\t\t\t$hour = $hour - 7;\n\t\t\t\tif( $start + $span == $hour )\n\t\t\t\t{\t$span++;\n\t\t\t\t}else\n\t\t\t\t{\t$hour++;\n\t\t\t\t\tif( isset( $_GET['names'] ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$xml .= \" <block at='{$hour}' blockoffset='-{$span}' blockspan='0' bgcolor='#FFC0FF' alpha='30%' name='\";\n\t\t\t\t\t\t$names = array();\n\t\t\t\t\t\tforeach($users as $people)\n\t\t\t\t\t\t{\t$name = split( \" \", $people['name'] );\n\t\t\t\t\t\t\t$name = $name[0] . \" \" . substr(array_pop($name), 0, 1) . \".\";\n\t\t\t\t\t\t\tarray_push($names, $name);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$xml .= implode( \",\\n\", $names);\n\t\t\t\t\t\t$xml .= \"'/>\\n\";\n\t\t\t\t\t}else\n\t\t\t\t\t{\t$xml .= \" <block at='{$hour}' blockoffset='-{$span}' blockspan='0' bgcolor='#FFC0FF' alpha='30%' name=''/>\\n\";\n\t\t\t\t\t\t$span = 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$xml .= \" </day>\\n\";\n\t\t}\n\t\t$xml .= \"</schedule>\";\n\n\t\t$sch = new Schedule($xml, false);\n\t\t// change size of image\n\t\t$sch->width = isset($_GET['width']) ? $_GET['width'] : $width;\n\t\t$sch->height = isset($_GET['height']) ? $_GET['height'] : $height;\n\t\t// now draw ;)\n\t\t$sch->Draw();\n\t}", "private function populateSchedule() {\n while(count($this->schedule) <= round(self::AVERAGE_NUMBER_OF_GAMES_PER_ROUND * 1.2) ) {\n for ($i = 0; $i < 3; $i++) {\n foreach($this->matchUpsPerCombination as $matchUps) {\n $game = new Game();\n $teamRepo = $this->em->getRepository('AppBundle:Team');\n $teamA = $teamRepo->findByPlayers(array_pop($matchUps[$i]), array_pop($matchUps[$i]));\n $teamB = $teamRepo->findByPlayers(array_pop($matchUps[$i]), array_pop($matchUps[$i]));\n $game->setTeamA($teamA);\n $game->setTeamB($teamB);\n $this->schedule->add($game);\n }\n }\n }\n }", "function cron_add_wprssmi_schedule_120( $schedules ) {\n\n\t$period = 7200;\n\t$schedules['twohours'] = array(\n\t\t'interval' => $period,\n\t\t'display' => __( 'Once Every 2 Hours' )\n\t);\n\treturn $schedules;\n}", "function ensureLeFiveHoursPerDay(&$theSchedule){\n global $days;\n global $hours;\n global $openHours;\n global $pidArray;\n global $preferences;\n global $tutorInfo;\n global $hoursWorking;\n global $hoursWorkingPerDay;\n foreach($pidArray as $thePid){\n foreach($days as $theDay){\n while($hoursWorkingPerDay[$thePid][$theDay] > 5){\n $low= findLowestTuple($theSchedule,$theDay,$thePid);\n // add back to preferences since tutor can now work this hour\n addTuple($preferences,$theDay,$low[\"hour\"],$thePid,$low[\"pref\"],$low[\"type\"]);\n removeTuple($theSchedule,$theDay,$low[\"hour\"],$thePid);\n $hoursWorking[$thePid]= $hoursWorking[$thePid] - 1;\n $hoursWorkingPerDay[$thePid][$theDay] = $hoursWorkingPerDay[$thePid][$theDay] - 1 ;\n }\n }\n }\n}", "public function insertFixIntoSchedule()\n {\n $this->db->exec('INSERT INTO vendor_schedule(vendor_id, weekday, all_day, start_hour, stop_hour) \n SELECT vendor_id, (weekday(special_date)+1), all_day, start_hour, stop_hour\n FROM vendor_special_day \n WHERE vendor_special_day.event_type!=\"closed\" AND \n (vendor_special_day.special_date BETWEEN \"2015-12-21\" AND \"2015-12-27\")\n ');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
(PHP 4, PHP 5) Binarysafe file read
function fread ($handle, $length) {}
[ "public static function fileGet($bytes){}", "function _readfile($f, $b = false)\r\n\t{\r\n\t\t$fp = NULL;\r\n\t\t$d = '';\r\n\t\t!$b && $b = @filesize($f);\r\n\t\tif (!($b > 0) || !file_exists($f) || !false === ($fp = @fopen($f, 'r')) || !is_resource($fp)) return false;\r\n\t\tif ($b > 4096) while (!feof($fp) && strlen($d) < $b)$d .= @fread($fp, 4096);\r\n\t\telse $d = @fread($fp, $b);\r\n\t\t@fclose($fp);\r\n\t\treturn $d;\r\n\t}", "function read_file($filename, $base64 = false) {\n $file = fopen($filename, \"r\");\n $data = fread($file, filesize($filename));\n fclose($file); \n $data = $base64? base64_decode($data): $data;\n return ($data);\n}", "public function read() {\n $this->open();\n $fse = fseek($this->fres,0,SEEK_END);\n $oend = ftell($this->fres);\n $fsb = fseek($this->fres,0,SEEK_SET);\n return ($oend>0 ? fread($this->fres,$oend) : \"\");\n }", "function file_read ($filename) {\r\n $fd = fopen($filename, 'r') or die(\"Can't open file $filename for read!\");\r\n $theData = fread($fd, filesize($filename));\r\n fclose($fd);\r\n return $theData;\r\n }", "public function fread()\n {\n return fread($this->resource, 8192);\n }", "public static function file_get_binary($key)\n {\n global $prev;\n $hash = md5($key.$prev);\n self::$_file = basePath . self::$_dir.'/binary/'.$hash.'.bin';\n if(file_exists(self::$_file))\n {\n $stream = file_get_contents(self::$_file);\n if(!$stream) return false;\n\n if(!$stream = @gzuncompress($stream))\n return false;\n\n if(!$stream = @hextobin($stream))\n return false;\n\n return $stream;\n }\n else\n return false;\n }", "static public function read ($path, $binary = true) {\n\t\t#/home/grabli66/haxe/std/php/_std/sys/io/File.hx:48: characters 3-73\n\t\tif ($binary === null) {\n\t\t\t$binary = true;\n\t\t}\n\t\treturn new FileInput(fopen($path, ($binary ? \"rb\" : \"r\")));\n\t}", "function gzip_readFileContent($fName,$fileSize)\r\n{\r\n\t$content = null;\r\n\t$zp = gzopen($fName, \"rb9\");\r\n\tif ($zp)\r\n\t{\r\n\t\t$content = gzread($zp,$fileSize);\r\n\t\tgzclose($zp);\r\n\r\n\t}\r\n\treturn $content;\r\n}", "public function getBinary();", "public abstract function load($bytes);", "#[@test]\n public function readBinaryData() {\n $this->assertRead(\n \"GIF89a\\001\\000\\035\\000\\302\\004\\000\\356\\356\\356\\366\\362\\366\\366\\366\\366\\377\\372\".\n \"\\377\\377\\377\\377\\377\\377\\377\\377\\377\\377\\377\\377\\377!\\371\\004\\001\\n\\000\\007\\000\".\n \",\\000\\000\\000\\000\\001\\000\\035\\000\\000\\003\\013H\\272\\323-P\\200\\031\\002lK%\\000;\"\n );\n }", "function readBYTE($fp) {\n\n // return the BYTE\n return ord(@fread($fp, 1));\n}", "function bzread($bz, $length = 1024)\n{\n}", "public function getTempFileBinaryContent()\n {\n return $this->_fileExists ? file_get_contents($this->_file['tmp_name']) : null;\n }", "public abstract function readByte();", "function fastpass_stream_file(&$buffer, $filename, $escape_digits='', $offset=0)\n {\n $proceed = false;\n if($escape_digits != '' && $buffer != '')\n {\n if(!strpos(chr(255) . $escape_digits, $buffer{strlen($buffer)-1}))\n $proceed = true;\n }\n if($buffer == '' || $proceed)\n {\n $res = $this->stream_file($filename, $escape_digits, $offset);\n if($res['code'] == AGIRES_OK && $res['result'] > 0)\n $buffer .= chr($res['result']);\n return $res;\n }\n return array('code'=>AGIRES_OK, 'result'=>ord($buffer{strlen($buffer)-1}), 'endpos'=>0);\n }", "abstract public function readData($fileName);", "public function read() {\n\t\tif ($this->file) {\n\t\t\treturn $this->file->fopen('r');\n\t\t} else {\n\t\t\treturn fopen('php://temp', 'r');\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if the thread has been "viewed" yet by this session
public function is_thread_viewed($id) { if (!isset($_SESSION['thread_views'])) { $_SESSION['thread_views'] = array(); } return in_array($id, $_SESSION['thread_views']); }
[ "public function hasThreadTs(): bool\n {\n return ! empty($this->threadTS);\n }", "public function unreaded(){\n\t\treturn $this->read_at===null;\n\t}", "public function isViewed()\n {\n if (!\\Auth::user()) {\n $viewed = \\Session::get($this->get_view_key());\n if (!empty($viewed)) {\n return true;\n }\n } else {\n $user_action = $this->user_counters()\n ->where('action', 'view')\n ->where('class_name', snake_case(get_class($this)))\n ->where('object_id', $this->id)\n ->where('user_id', \\Auth::user()->id)->count();\n if ($user_action > 0) {\n return true;\n }\n }\n\n return false;\n }", "public function is_own_attempt() {\n global $USER;\n return $this->attempt->userid == $USER->id &&\n (!$this->is_preview_user() || $this->attempt->preview);\n }", "public static function inProgress()\n {\n return isset($_SESSION['in-progress']);\n }", "public function isSeen()\r\n\t{\r\n\t\treturn (Session::has('seen_listings') AND\r\n\t\t\tarray_key_exists($this->id, Session::get('seen_listings')));\r\n\t}", "public function hasRead()\n {\n return ($this->status == NOTIFICATION_VIEWED);\n }", "private static function SessionStarted()\n {\n return session_id() != null;\n }", "function isNew() {\n\t\treturn !isset($_SESSION['__UserSession_Info']) || $_SESSION['__UserSession_Info'] == UserSession_STARTED;\n\t}", "public function isThreadOwner($thread)\n {\n global $uid;\n\n $thread = (int)$thread;\n\n return $this->db->fetch_atom(\n \"SELECT count(*)\n FROM club_discussion\n WHERE ID_CLUB_DISCUSSION = $thread\n AND FK_USER = $uid\"\n );\n }", "public function isOnline()\n {\n return $this->getLastSeen() > $this->freshTimestamp()->subMinutes(5);\n }", "public function weRecordANewVisitEachTimeTheThreadIsRead()\n {\n $thread = create(Thread::class);\n\n $this->assertSame(0, $thread->visits);\n\n $this->call('GET', $thread->path());\n\n $this->assertEquals(1, $thread->fresh()->visits);\n }", "public static function isRecent()\n\t{\n\t\tif (isset($_SESSION['token_time']))\n\t\t{\n\t\t\t$stored_time = $_SESSION['token_time'];\n\t\t\treturn ($stored_time + self::$max_elapsed) >= time();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tself::destroyToken();\n\t\t\treturn false;\n\t\t}\n\t}", "public function userWantsToViewPost() : bool {\n return $this->hasQueryString($this->forumLayout->getPostLink()) && $this->getRequestPostId() !== \"\";\n }", "private static function zooStarted() : bool {\n return isset( $_SESSION['started'] ) && $_SESSION['started'];\n }", "public function aUserCanReadAllThreads()\n {\n $this->get('threads')\n ->assertSee($this->thread->title);\n }", "public function hasSession() {}", "public function hasAccess()\n {\n return $this->access !== null;\n }", "public function isSeen() : bool{\n\t\treturn $this->seen;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create request for operation 'getBundleItem'
protected function getBundleItemRequest($id) { // verify the required parameter 'id' is set if ($id === null) { throw new \InvalidArgumentException('Missing the required parameter $id when calling getBundleItem'); } $resourcePath = '/store/bundles/{id}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; // path params if ($id !== null) { $resourcePath = str_replace('{' . 'id' . '}', ObjectSerializer::toPathValue($id), $resourcePath); } if ($multipart) { $headers= $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], [] ); } // for model (json/xml) if (isset($_tempBody)) { $httpBody = $_tempBody; // $_tempBody is the method argument, if present } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { $multipartContents[] = [ 'name' => $formParamName, 'contents' => $formParamValue ]; } $httpBody = new MultipartStream($multipartContents); // for HTTP post (form) } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { $httpBody = \GuzzleHttp\Psr7\build_query($formParams); // for HTTP post (form) } } // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } $query = \GuzzleHttp\Psr7\build_query($queryParams); $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : ''); $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } $headers = array_merge( $defaultHeaders, $headerParams, $headers ); return new Request( 'GET', $url, $headers, $httpBody ); }
[ "protected function createBundleItemRequest($cascade = 'false', $bundle_item = null)\n {\n\n $resourcePath = '/store/bundles';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($cascade !== null) {\n $queryParams['cascade'] = ObjectSerializer::toQueryValue($cascade);\n }\n\n\n // body params\n $_tempBody = null;\n if (isset($bundle_item)) {\n $_tempBody = $bundle_item;\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 $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n $httpBody = new MultipartStream($multipartContents); // for HTTP post (form)\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams); // for HTTP post (form)\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 // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : '');\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 return new Request(\n 'POST',\n $url,\n $headers,\n $httpBody\n );\n }", "public function testCreateBundleItem()\n {\n }", "public function addBundleItem()\n {\n if (! Guard::verifyAjaxNonce('cuztom', 'security')) {\n return;\n }\n\n $count = self::$request->get('count');\n $index = self::$request->get('index');\n $field = self::getField();\n\n $data = (new BundleItem(Cuztom::merge(\n $field->original,\n [\n 'parent' => $field,\n 'index' => $index,\n ]\n )))->output();\n\n $response = (! $field->limit || ($field->limit > $count))\n ? new Response(true, $data)\n : new Response(false, __('Limit reached!', 'cuztom'));\n\n echo $response->toJson();\n\n // wp\n exit;\n }", "private function _convertBundleInstance($request) {\r\n \n $parameters = array();\n $parameters['Action'] = 'BundleInstance';\n if ($request->isSetInstanceId()) {\n $parameters['InstanceId'] = $request->getInstanceId();\n }\n if ($request->isSetStorage()) {\n $storage = $request->getStorage();\n if ($storage->isSetS3()) {\n $s3 = $storage->getS3();\n if ($s3->isSetBucket()) {\n $parameters['Storage' . '.' . 'S3' . '.' . 'Bucket'] = $s3->getBucket();\n }\n if ($s3->isSetPrefix()) {\n $parameters['Storage' . '.' . 'S3' . '.' . 'Prefix'] = $s3->getPrefix();\n }\n if ($s3->isSetAWSAccessKeyId()) {\n $parameters['Storage' . '.' . 'S3' . '.' . 'AWSAccessKeyId'] = $s3->getAWSAccessKeyId();\n }\n if ($s3->isSetUploadPolicy()) {\n $parameters['Storage' . '.' . 'S3' . '.' . 'UploadPolicy'] = $s3->getUploadPolicy();\n }\n if ($s3->isSetUploadPolicySignature()) {\n $parameters['Storage' . '.' . 'S3' . '.' . 'UploadPolicySignature'] = $s3->getUploadPolicySignature();\n }\n }\n }\n\r\n return $parameters;\r\n }", "public function showBundleItemsAction()\n {\n $response = false;\n $orderId = $this->getRequest()->getParam('order_id');\n $itemId = $this->getRequest()->getParam('item_id');\n\n try {\n if ($orderId && $itemId) {\n /** @var $items Enterprise_Rma_Model_Resource_Item */\n $items = Mage::getResourceModel('enterprise_rma/item')->getOrderItems($orderId, $itemId);\n if (empty($items)) {\n Mage::throwException($this->__('No items for bundle product.'));\n }\n } else {\n Mage::throwException($this->__('Wrong order id or item id requested.'));\n }\n\n Mage::register('current_rma_bundle_item', $items);\n } catch (Mage_Core_Exception $e) {\n $response = array(\n 'error' => true,\n 'message' => $e->getMessage(),\n );\n } catch (Exception $e) {\n $response = array(\n 'error' => true,\n 'message' => $this->__('Cannot display item attributes.')\n );\n }\n\n $this->loadLayout();\n $response = $this->getLayout()\n ->getBlock('enterprise_rma_bundle')\n ->toHtml()\n ;\n\n if (is_array($response)) {\n $response = Mage::helper('core')->jsonEncode($response);\n $this->getResponse()->setBody($response);\n } else {\n $this->getResponse()->setBody($response);\n }\n }", "public function testUpdateBundleItem()\n {\n }", "function bundle_item($id, $type = null, array $parameters = [])\n {\n return ItemFactory::build($id, $type, $parameters);\n }", "protected function quoteCartItemRepositoryV1GetListGet_0Request()\n {\n\n $resourcePath = '/V1/carts/mine/items';\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 []\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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function create($_params = array())\n\t{\n\t\treturn $this->transform($this->master->post('bundles', $_params), true);\n\t}", "protected function _dspaceGetBundles() {\n\t\tif( is_null( $this->_dspaceRawBundles ) ) {\n\t\t\ttry {\n\t\t\t\t$this->_dspaceRawBundles = $this->getRepository()->restCallJSON('item.bundles', array('id'=>$this->getId()));\n\t\t\t} catch (Exception $e) {\n\t\t\t\tthrow JSpaceRepositoryError::raiseError( $this, JText::sprintf('COM_JSPACE_JSPACEITEM_ERROR_CANNOT_FETCH_BUNDLE', $this->getId()) );\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $this->_dspaceRawBundles;\n\t}", "public function getItemBundles($nItemId) {\n $aBundles = array();\n \n $query = 'select * from item2bundle where item_id=' . $nItemId;\n \n try {\n $result = pg_query($this->dbconn, $query);\n while ($row= pg_fetch_assoc($result)) {\n $aBundles[] = $row;\n }\n pg_free_result($result);\n }\n catch (Exception $e) {\n $aBundles['error'] = 'could not find bundles for item ' .$nItemId;\n }\n \n return $aBundles;\n }", "public function getBundleItemWithHttpInfo($id)\n {\n $returnType = '\\KnetikCloud\\Model\\BundleItem';\n $request = $this->getBundleItemRequest($id);\n\n try {\n\n try {\n $response = $this->client->send($request);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n \"[$statusCode] Error connecting to the API ({$request->getUri()})\",\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize($e->getResponseBody(), '\\KnetikCloud\\Model\\BundleItem', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize($e->getResponseBody(), '\\KnetikCloud\\Model\\Result', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function bundleInstance($request) \n {\n require_once ('Amazon/EC2/Model/BundleInstanceResponse.php');\n return Amazon_EC2_Model_BundleInstanceResponse::fromXML($this->_invoke('BundleInstance'));\n }", "public function __construct($_idBundleItem = null,$_idMat = null,$_mNum = null,$_iOrder = null,$_itemName = null,$_itemNameL = null,$_itemDescription = null,$_itemDescriptionL = null,$_isActive = null,$_isDefault = null,$_matPrice = null,$_price = null,$_quantity = null)\n {\n parent::__construct(array('idBundleItem'=>$_idBundleItem,'idMat'=>$_idMat,'MNum'=>$_mNum,'IOrder'=>$_iOrder,'itemName'=>$_itemName,'itemNameL'=>$_itemNameL,'itemDescription'=>$_itemDescription,'itemDescriptionL'=>$_itemDescriptionL,'isActive'=>$_isActive,'isDefault'=>$_isDefault,'MatPrice'=>$_matPrice,'Price'=>$_price,'Quantity'=>$_quantity), false);\n }", "public function getBundle();", "public function getItemRequest($itemID)\n {\n // Verify the required parameter 'itemID' is set\n\n if ($itemID === null || (is_array($itemID) && count($itemID) === 0)) {\n throw new InvalidArgumentException(sprintf(\n 'Missing the required parameter $%s when calling %s',\n 'itemID',\n 'getItem'\n ));\n }\n\n $resourcePath = '/Items/{ItemID}';\n $formParams = [];\n $queryParams = [];\n $httpBody = null;\n $multipart = false;\n\n \n\n// Path parameters\n if ($itemID !== null) {\n $resourcePath = str_replace(\n '{' . 'ItemID' . '}',\n ObjectSerializer::toPathValue($itemID),\n $resourcePath\n );\n }\n\n\n // Body parameter\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n \n // For model (json/xml)\n\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present.\n\n if ($headers['Content-Type'] === 'application/json') {\n $httpBodyText = $this->jsonEncode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBodyText = $_tempBody;\n }\n\n $httpBody = $this->createStream($httpBodyText);\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\n // FIXME: how do we do multiparts with PSR-7?\n // MultipartStream() is a Guzzle tool.\n\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = $this->createStream($this->jsonEncode($formParams));\n\n } else {\n // for HTTP post (form)\n $httpBody = $this->createStream($this->buildQuery($formParams));\n }\n }\n\n\n return $this->buildHttpRequest(\n $headers,\n $queryParams,\n $httpBody,\n 'GET',\n $resourcePath\n );\n }", "function requestToItem ()\n\t{\n\t\t$visibility = $this->getFromPost ('visibility', 'private');\n\t\t$parentId = $this->getFromPost ('parentId', 0);\n\t\t$isParent = $this->getFromPost ('isParent', 0);\n\t\t$when_created = $this->getFromPost ('when_created', null);\n\t\t$when_modified = $this->getFromPost ('when_modified', null);\n\t\t$itemId = $this->getFromPost ('itemId', 0);\n\t\t$category = $this->getFromPost ('category', null);\n\t\t$isDeleted = $this->getFromPost ('isDeleted', 0);\n\t\t$name = $this->getFromPost ('name', null);\n\t\t$description = $this->getFromPost ('description', null);\n\n\t\t$referingId = $this->getFromPost ('referingId', 0);\n\t\t$referingType = $this->getFromPost ('referingType', null);\n\t\t$imageURL = $this->getFromPost ('imageURL', null);\n\t\t$informationURL = $this->getFromPost ('informationURL', null);\n\t\t$complete = $this->getFromPost ('complete', null);\n\t\t$reliability = $this->getFromPost ('reliability', null);\n\t\t$comments = $this->getFromPost ('comments', null);\n\n\t\t$item = new Information\n\t\t(\n\t\t\t$itemId,\n\t\t\t$_SESSION['brimUsername'],\n\t\t\t$parentId,\n\t\t\t$isParent,\n\t\t\t$name,\n\t\t\t$description,\n\t\t\t$visibility,\n\t\t\t$category,\n\t\t\t$isDeleted,\n\t\t\t$when_created,\n\t\t\t$when_modified,\n\t\t\t$referingId,\n\t\t\t$referingType,\n\t\t\t$reliability,\n\t\t\t$complete,\n\t\t\t$informationURL,\n\t\t\t$imageURL,\n\t\t\t$comments\n\t\t);\n\t\treturn $item;\n\t}", "private function _construct_bundle_descriptions(array $bundles, array $items){\n $bundle_str = '';\n $bundle_descriptions = array();\n\n for($i = 0; $i < count($bundles); ++$i){\n $items_row = $items[$i];\n\n $bundle_str = '';\n\n for($j = 0; $j < count($items_row); ++$j){\n $item = $items_row[$j];\n $bundle_str .= $item['item_number'].\" \".$item['item_type'] . ((count($items_row) - 1 != $j)?\" AND \":\"\");\n }\n\n $bundle_descriptions[$i] = $bundle_str;\n }\n\n return $bundle_descriptions;\n }", "protected function getItemByIdRequest($item_id)\n {\n // verify the required parameter 'item_id' is set\n if ($item_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $item_id when calling getItemById'\n );\n }\n\n $resourcePath = '/beta/item/{itemId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($item_id !== null) {\n $resourcePath = str_replace(\n '{' . 'itemId' . '}',\n ObjectSerializer::toPathValue($item_id),\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 []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the name of the deploy configuration files to look for.
public function getDeployConfigName() { return $this->config['deploy_config_name']; }
[ "public function getDeploymentNames() {\n\t\t$files = glob(FLOW_PATH_ROOT . 'Build/Surf/*.php');\n\t\treturn array_map(function($file) {\n\t\t\treturn substr($file, strlen(FLOW_PATH_ROOT . 'Build/Surf/'), -4);\n\t\t}, $files);\n\t}", "public static function getConfigFileName () {\n //return get_config_file();\n // determine host and see if we use virtual hosting\n // where one code base can be used for more virtual hosts.\n // this is set with the domain flag in ./coscli.sh\n if (defined('_COS_CLI')){\n if (isset(config::$vars['domain']) && config::$vars['domain'] != 'default'){\n $config_file = _COS_PATH . \"/config/multi/\". config::$vars['domain'] . \"/config.ini\";\n } else {\n $config_file = _COS_PATH . \"/config/config.ini\";\n }\n } else {\n $virtual_host_dir = _COS_PATH . \"/config/multi/$_SERVER[SERVER_NAME]\";\n if (file_exists($virtual_host_dir)){\n $config_file = $virtual_host_dir . \"/config.ini\";\n } else {\n $config_file = _COS_PATH . \"/config/config.ini\";\n }\n }\n return $config_file;\n }", "public function configFileName()\n\t{\n\t\tif ($this->env == 'production')\n\t\t{\n\t\t\treturn '.env.php';\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn '.env.' . $this->env . '.php';\n\t\t}\n\t}", "function getConfigPath() {\n\t\treturn $this->getName();\n\t}", "public static function getAdditionalConfigFiles()\n {\n $files = array(\n __DIR__ . '/../environment',\n __DIR__ . '/../environment.local',\n );\n\n if (getenv(\"CONFIG\")) {\n $files[] = getenv(\"CONFIG\");\n }\n return $files;\n }", "public function getDeployConfig()\n {\n return $this->getApplicationConfig()->get('deploy', new Config(array()));\n }", "public static function siteConfig()\n {\n return DirPaths::siteConfig().\n FileNames::CONFIG;\n }", "public function getDeployDir()\n {\n return $this->realpath(DirectoryKeys::DEPLOY);\n }", "public function getConfigFileName() {\n return \\Config::get('fontello::config.file');\n }", "public function get_config_path() {\r\n return $this->get_application_path() . 'configs/';\r\n }", "public function configsDirectory(): string\n {\n return $this->configsDirectory;\n }", "protected function getConfigFileDestination()\n {\n return config_path(\"{$this->package}.php\");\n }", "public function getConfigFiles()\n {\n return Finder::create()\n ->files()\n ->in(ASSELY_FRAMEWORK_DIR.'config')\n ->name('*.php');\n }", "public function getConfigCommonFilePath()\n {\n return $this->getConfigPath().'/config.yml';\n }", "protected function getConfigFilePath()\n {\n return $this->getUtilsDirectory() . CONFIG_FILE;\n }", "public static function getConfigName() {\n return self::$configName;\n }", "protected function packageConfigFilePath()\n {\n return $this->packageBasePath('config'.DIRECTORY_SEPARATOR.$this->packageConfigFilename());\n }", "public static function getConfigFilename()\n {\n // return \\CB_DOC_ROOT . 'config.ini';\n return TEST_PATH_TEMP . 'auto_install_config.ini';\n }", "protected function _getAllConfigFiles()\n {\n return array(\n ENGINEBLOCK_FOLDER_APPLICATION . self::CONFIG_FILE_DEFAULT,\n self::CONFIG_FILE_ENVIORNMENT,\n );\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return value of created_by_id field
function getCreatedById() { return $this->getFieldValue('created_by_id'); }
[ "public function getCreatedById()\n\t{\n\t\treturn $this->created_by_id;\n\t}", "public function getCreatedUserId()\n {\n return $this->created_user_id;\n }", "public function getCreatedUserId()\n {\n return $this->createdUserId;\n }", "public function getCreatedByUserId()\n {\n if (array_key_exists(\"createdByUserId\", $this->_propDict)) {\n return $this->_propDict[\"createdByUserId\"];\n } else {\n return null;\n }\n }", "public function getCreatedby()\n {\n return $this->createdby;\n }", "public function getCreatedBy()\r\n {\r\n return $this->created_by;\r\n }", "public function getCreatedBy()\n\t{\n\t\treturn $this->{static::CREATED_BY};\n\t}", "public function getCreatedBy();", "public function getCreatedBy() {\n\n return $this->s_createdby;\n\n }", "public function get_createdBy() {\n return $this->createdBy;\n }", "public function getCreatedBy() {\n return $createdBy;\n }", "public function getCreatorId();", "public function getCreatedByIdColumn()\n {\n return property_exists($this, 'CREATED_BY_ID') ? static::CREATED_BY_ID : 'created_by_id';\n }", "public function getCreatedBy()\n {\n return $this->createdBy;\n }", "function setCreatedById($value) {\n return $this->setFieldValue('created_by_id', $value);\n }", "public function getCreatorId()\n {\n return $this->creator_id;\n }", "public function getCreatorId() : int {\n return $this->creatorId;\n }", "protected function getCreatedByColumn()\n {\n return 'created_by';\n }", "public function getCreateBy()\n {\n return $this->create_by;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
generate a single unique id when generating ids using unixtime as the prefix, subtract the ID_OFFSET amount from the start time. gives us more breathing room for using serial numbers. unix_timestamp of 1000000000 == 2001/09/08 18:46:40 since the current time won't ever be that number, it is a safe point to go back to. shouldn't hit big int max for 80 years. at that point we'll rewrite our app :)
public function id(){ $prefix = bcsub( self::time(), self::ID_OFFSET ); if( $prefix < 1 ) throw new Exception('invalid serial generated', $prefix ); return $prefix . str_pad( mt_rand(0, 9999999999), 10, '0', STR_PAD_LEFT); }
[ "public function generateID()\n {\n /**\n * Current Timestamp - 41 bits\n */\n $curr_timestamp = floor(microtime(true) * 1000);\n /**\n * Subtract custom epoch from current time\n */\n $curr_timestamp -= app()->config('app.initial_epoch', $this->initialEpoch);\n /**\n * Create a initial base for ID\n */\n $base = decbin(pow(2, 40) - 1 + $curr_timestamp);\n /**\n * Get ID of database server (10 bits)\n * Up to 512 machines\n */\n $shard_id = decbin(pow(2, 9) - 1 + $this->getServerShardId());\n /**\n * Generate a random number (12 bits)\n * Up to 2048 random numbers per db server\n */\n $random_part = mt_rand(1, pow(2, 11) - 1);\n $random_part = decbin(pow(2, 11) - 1 + $random_part);\n /**\n * Concatenate the final ID\n */\n $final_id = bindec($base) . bindec($shard_id) . bindec($random_part);\n /**\n * Return unique 64bit ID\n */\n return $final_id;\n }", "public function generateID(): string\n\t{\n\t\t// Generate id based on the current microtime\n\n\t\tif (\n\t\t\tPHP_INT_MAX == 2147483647\n\t\t\t|| Configs::get_value('force_32bit_ids', '0') === '1'\n\t\t) {\n\t\t\t// For 32-bit installations, we can only afford to store the\n\t\t\t// full seconds in id. The calling code needs to be able to\n\t\t\t// handle duplicate ids. Note that this also exposes us to\n\t\t\t// the year 2038 problem.\n\t\t\t$id = sprintf('%010d', microtime(true));\n\t\t} else {\n\t\t\t// Ensure 4 digits after the decimal point, 15 characters\n\t\t\t// total (including the decimal point), 0-padded on the\n\t\t\t// left if needed (shouldn't be needed unless we move back in\n\t\t\t// time :-) )\n\t\t\t$id = sprintf('%015.4f', microtime(true));\n\t\t\t$id = str_replace('.', '', $id);\n\t\t}\n\n\t\treturn $id;\n\t}", "private function createId(): string\n {\n return '_' . time() . '_' . explode(' ', microtime())[0];\n }", "function _generateTransId($timestamp)\r\n {\r\n list($usec, $sec) = explode(\" \", microtime()); // microseconds, php4 compatible\r\n $temp = ($timestamp + $usec - strtotime('today 00:00')) * 10;\r\n $temp = sprintf('%06d', $temp);\r\n\r\n return $temp;\r\n }", "private function _generateUniqueId()\n {\n $rand = uniqid(rand(10, 99));\n $time = microtime(true);\n $micro = sprintf('%06d', ($time - floor($time)) * 1000000);\n $date = new DateTime(date('Y-m-d H:i:s.' . $micro, $time));\n return sha1($date->format('YmdHisu'));\n }", "function twentyseventeen_unique_id( $prefix = '' ) {\n\tstatic $id_counter = 0;\n\tif ( function_exists( 'wp_unique_id' ) ) {\n\t\treturn wp_unique_id( $prefix );\n\t}\n\treturn $prefix . (string) ++$id_counter;\n}", "abstract protected function generateId();", "function createUniqueRandomID()\n\t{\n\t\treturn (int)(rand(99, 999999).date('U'));\n\t}", "function COM_makesid()\n{\n $sid = date( 'YmdHis' );\n srand(( double ) microtime() * 1000000 );\n $sid .= rand( 0, 999 );\n\n return $sid;\n}", "function genId($seq, $shard = null) \n{\n $id = 0;\n $shardId = 0;\n\n if(!is_null($shard)) {\n $shardId = \\intval($shard);\n } else {\n if(defined('SHARD_ID')) {\n $shardId = \\intval(\\SHARD_ID);\n } else {\n $env = \\getenv('SHARD_ID');\n if($env) {\n $shardId = \\intval($env);\n } else {\n $shardId = \\intval(\\hash('crc32b', \\php_uname('n')));\n }\n } \n }\n\n\n $mtime = \\intval((\\microtime(TRUE) * 1000) - NEW_EPOCH);\n $id = $id | ($shardId & 0x3ff) << 53 ;\n $id = $id | (\\intval(\\hash('crc32b', $seq)) & 0xfff) << 41;\n $id = $id | (($mtime & 0x1ffffffffff) );\n\n return \\base_convert($id, 10, 36);\n}", "public function generateId( ) {\n\t\tstatic $inc = 0;\n\n\t\t$ts = pack('N', time());\n\t\t$m = substr(md5(gethostname()), 0, 3);\n\t\t$pid = pack('n', 1); //posix_getpid()\n\t\t$trail = substr(pack('N', $inc++), 1, 3);\n\n\t\t$bin = sprintf(\"%s%s%s%s\", $ts, $m, $pid, $trail);\n\t\t$id = '';\n\t\tfor ($i = 0; $i < 12; $i++) {\n\t\t\t$id .= sprintf(\"%02X\", ord($bin[$i]));\n\t\t}\n\t\treturn strtolower($id);\n\t}", "final protected function genId(){\n\t\t$this->id = 'bele' . self::$ID_INDEX++;\n\t}", "public static function getUniqId()\n\t{\n\t\t// NOTE: Casting to int will overflow on 32-bit PHP (for Windows) without giving 19-digit value\n\t\treturn sprintf('%.0f%03d', 10000000*microtime(true), mt_rand(1, 999));\n\t}", "function twentytwenty_unique_id( $prefix = '' ) {\n\tstatic $id_counter = 0;\n\tif ( function_exists( 'wp_unique_id' ) ) {\n\t\treturn wp_unique_id( $prefix );\n\t}\n\treturn $prefix . (string) ++$id_counter;\n}", "function _generateNextId()\n\t{\n\t\treturn $this->db->nextId(\"Scale\", true);\n\t}", "function generate_id() {\r\n global $root, $cache;\r\n\r\n $last_id = $root->query(\"SELECT User FROM student ORDER BY `User` DESC LIMIT 1\");\r\n\r\n $id = $last_id[0]['User'] + 1;\r\n return $id;\r\n }", "public function generateNumericId();", "function pulcherrimum_unique_id($prefix = '')\n {\n static $id_counter = 0;\n if (function_exists('wp_unique_id')) {\n return wp_unique_id($prefix);\n }\n return $prefix . (string) ++$id_counter;\n }", "function generateNewId(){\n\t\t$id = null;\n\t\t//while ( $this->getSessionData($id) !== null ){\n\t\t\t$id = rand(0,100000);\n\t\t//}\n\t\treturn $id;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the number of rows matching criteria, joining the related MemberRelatedByBackupCopilotId table
public static function doCountJoinMemberRelatedByBackupCopilotId(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN) { // we're going to modify criteria, so copy it first $criteria = clone $criteria; // We need to set the primary table name, since in the case that there are no WHERE columns // it will be impossible for the BasePeer::createSelectSql() method to determine which // tables go into the FROM clause. $criteria->setPrimaryTableName(MissionLegPeer::TABLE_NAME); if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { $criteria->setDistinct(); } if (!$criteria->hasSelectClause()) { MissionLegPeer::addSelectColumns($criteria); } $criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count // Set the correct dbName $criteria->setDbName(self::DATABASE_NAME); if ($con === null) { $con = Propel::getConnection(MissionLegPeer::DATABASE_NAME, Propel::CONNECTION_READ); } $criteria->addJoin(array(MissionLegPeer::BACKUP_COPILOT_ID,), array(MemberPeer::ID,), $join_behavior); foreach (sfMixer::getCallables('BaseMissionLegPeer:doCount:doCount') as $callable) { call_user_func($callable, 'BaseMissionLegPeer', $criteria, $con); } $stmt = BasePeer::doCount($criteria, $con); if ($row = $stmt->fetch(PDO::FETCH_NUM)) { $count = (int) $row[0]; } else { $count = 0; // no rows returned; we infer that means 0 matches. } $stmt->closeCursor(); return $count; }
[ "public function getJoinCount() {\n return $this->getCountByKey('nr','membership');\n }", "public function countJoin(): int;", "public function getBillingsCount(){\n return $this->manager->createQuery('SELECT COUNT(b) FROM App\\Entity\\Secondary\\Billing b')->getSingleScalarResult();\n }", "public function countProduit_cmp(){\n\t\t\t\t\t $this->db->setTablename($this->tablename);\n return $this->db->getRows(array(\"return_type\"=>\"count\"));\n\t\t\t\t\t }", "function count_copy_products(){\n $db = new Database();\n $db->query('SELECT COUNT(product_id) products FROM product P JOIN category C WHERE category_name=\"copy service\" AND P.category_id=C.category_id');\n $count = $db->single();\n return $count['products'];\n}", "public function getCount() {\n return $this->db->fetchColumn('SELECT COUNT(id) FROM plan');\n }", "public function getCount($join = '', $where = '') {\r\n\t\t$parts = $this->getParts();\r\n\t\treturn $this->db->query('SELECT COUNT(*) FROM '.$parts['tables'].' '.$join.' '.$where)->fetchCell();\r\n\t}", "public function getDestinationRecordCount();", "public function getRecordCount() {\n \n $connection = &$this->connection;\n if (empty($connection))\n return 0;\n\n // return Connection::getRecordCount($this->recordset);\n return $connection->getRecordCount($this->recordset);\n }", "public function getBillableMemberCount();", "public function getCheckinsCount() {\n\t\treturn Temboo_Results::getSubItemByKey($this->base, \"checkinsCount\");\n\t}", "public function getRecordCount();", "public function countMembers()\n\t{\n\t\t#init\t\t\n\t\t$stats\t\t= $this->cache->getCache('ibEco_stats');\n\t\t$ecoPoints \t= $this->settings['eco_general_pts_field'];\n\t\t$ptsDB\t\t= ( $ecoPoints == 'eco_points' ) ? 'pc' : 'm';\t\t\t\t\t\t\t\t\t\t\n\t\t\n\t\t#get count\n\t\t$max\t= $this->DB->buildAndFetch( array(\n\t\t\t\t\t\t\t\t\t\t\t\t'select'\t=> 'COUNT( m.member_id ) as memCount',\n\t\t\t\t\t\t\t\t\t\t\t\t'from'\t\t=> array( 'members' => 'm' ),\n\t\t\t\t\t\t\t\t\t\t\t\t'where' \t=> $ptsDB.'.'.$ecoPoints.' > 0 OR pc.eco_worth > 0 OR pc.eco_welfare > 0',\n\t\t\t\t\t\t\t\t\t\t\t\t'add_join'\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray( 'from'\t=> array( 'pfields_content' => 'pc' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'where'\t=> 'm.member_id=pc.member_id'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t)\t\t);\t\t\t\t\t\t\t\t\t\t\n\t\treturn $max['memCount'];\n\t}", "public function getJoinedCandidatesCount() {\n $HierarchyIdList = join(\",\",$this->hierarchy());\n\n $query = \"WITH P AS\n (\n SELECT \tCP.job_id,\n COUNT(DISTINCT CP.candidate_id) AS joined_count\n FROM \tneo_job.candidate_placement AS CP\n WHERE \tCP.date_of_join IS NOT NULL\n GROUP BY \tCP.job_id\n )\n SELECT COALESCE(SUM(P.joined_count),0) AS joined_count\n FROM neo_job.jobs AS J\n LEFT JOIN P ON P.job_id=J.id\n WHERE J.job_status_id=2\n AND J.created_by IN (\".$HierarchyIdList.\") \";\n $result = $this->db->query($query)->row()->joined_count;\n return $result;\n }", "function count_reporting_blocks($condition = null)\r\n {\r\n return $this->count_objects(ReportingBlock :: get_table_name(), $condition);\r\n }", "public function getBackupCount(): int {\n return count($this->getBackups());\n }", "public function getRrpTenantReferenceCount();", "public function count()\n {\n \treturn count($this->_criteria);\n }", "public function recordsCount();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ ===================== getx Gets a key from the cache, with state feedback. $ttl will be set to the expected remaining lifetime of the key, in seconds. $ttl will be set to `false` if the key did not exist. =====================
public function getx( $key, &$ttl ) { $key = (string) $key; $got = $this->getRaw( $key ); if (!$got) { return false; } $ttl = $got->e - microtime(true); return $got->v; }
[ "public function get($key, $ttl = 120);", "function core_cache_Get($key)\n{\n $cache = coresys_cache_Initialize();\n RETURN $cache->get($key);\n}", "abstract function getOrSet($key, $ttl, Callable $whatToCacheIfNotFound);", "function get($key, $namespace = 'default')\n{\n\treturn (new cache)->sessGet($key, $namespace);\n}", "function kv_cache_get($k)\n{\n $r = cache_get($k);\n if (NULL === $r) {\n $r = kv_get($k);\n $r and cache_set($k, $r);\n }\n return $r;\n}", "public function get($key, $ttl = 120)\n\t{\n\t\tglobal $db_show_debug;\n\n\t\tif (!$this->isEnabled())\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tif ($db_show_debug === true)\n\t\t{\n\t\t\t$cache_hit = array(\n\t\t\t\t'k' => $key,\n\t\t\t\t'd' => 'get'\n\t\t\t);\n\t\t\t$st = microtime(true);\n\t\t}\n\n\t\t$key = $this->_key($key);\n\t\t$value = $this->_cache_obj->get($key, $ttl);\n\n\t\tif ($db_show_debug === true)\n\t\t{\n\t\t\t$cache_hit['t'] = microtime(true) - $st;\n\t\t\t$cache_hit['s'] = isset($value) ? strlen($value) : 0;\n\t\t\tDebug::instance()->cache($cache_hit);\n\t\t}\n\n\t\tcall_integration_hook('cache_get_data', array($key, $ttl, $value));\n\n\t\treturn empty($value) ? null : Util::unserialize($value);\n\t}", "public function get($key)\n\t{\n\t\ttry\n\t\t{\n\t\t\t$time = cms_db()->BindTimeStamp(time());\n\t\t\t$result = cms_db()->GetOne(\"select v FROM {cache} WHERE k = ? and expiry > ?\", array($key, $time));\n\t\t\tif ($result)\n\t\t\t\treturn unserialize($result);\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\t\n\t\t}\n\t\treturn null;\n\t}", "function get($key) {\n return $this->memcached->get($key);\n }", "public function cacheKey();", "public function getItem($key): CacheItem;", "function hkm_cache(string $key = null)\n\t{\n\t\t$cache = ServicesSystem::CACHE();\n\n\t\t// No params - return cache object\n\t\tif (is_null($key)) {\n\t\t\treturn $cache;\n\t\t}\n\t\t// Still here? Retrieve the value.\n\t\treturn $cache::GET($key);\n\t}", "public function getObjFromCache($key);", "public function get($key) {\n foreach ($this->caches as $n => $cache) {\n $res = $cache->get($key);\n\n // Short-circuit if we find a value.\n if (isset($res)) return $res;\n }\n }", "function memcached_get($key){\n if($key&&$memcached=memcached_connect()){\n $result = $memcached->get($key);\n }else{\n $result = false;\n }\n return $result;\n}", "function acf_get_cache( $key = '' ) {\n\t\n\treturn acf()->cache->get_cache( $key );\n\t\n}", "function cacheFunc($key,$ttl=0,Closure $func){\n\t\t$result = $this->get($key);\n\t\tif(isset($result)) return $result;\n\t\t\n\t\t$result = $func();\n\t\t\n\t\t$this->store($key,$result,$ttl);\n\t\treturn $result;\n\t}", "public static function apc_get($cache, $key)\n {\n return apc_fetch($key);\n }", "protected function cacheGet($key)\n {\n $cachedToken = $this->client->get($key);\n return $cachedToken;\n }", "public function redis_get(string $key):mixed;" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generate an array of courses that a teacher hasn't created a category for.
public function get_not_created_course_categories ($user_id) { $tbl_main_courses = Database :: get_main_table(TABLE_MAIN_COURSE); $tbl_main_course_user = Database :: get_main_table(TABLE_MAIN_COURSE_USER); $tbl_grade_categories = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_CATEGORY); $sql = 'SELECT DISTINCT(code), title FROM '.$tbl_main_courses.' cc, '.$tbl_main_course_user.' cu' .' WHERE cc.id = cu.c_id ' .' AND cu.status = '.COURSEMANAGER; if (!api_is_platform_admin()) { $sql .= ' AND cu.user_id = '.$user_id; } $sql .= ' AND cc.code NOT IN ( SELECT course_code FROM '.$tbl_grade_categories.' WHERE parent_id = 0 AND course_code IS NOT NULL )'; $result = Database::query($sql); $cats=array(); while ($data=Database::fetch_array($result)) { $cats[] = array ($data['code'], $data['title']); } return $cats; }
[ "public function get_courses() {\n\t\tif ( ! isset( $this->courses ) ) {\n\t\t\t$course_ids = array_unique( array_merge( array_keys( $this->a->get_results() ), array_keys( $this->a->get_results() ) ) );\n\t\t\tsort( $course_ids );\n\n\t\t\t$missing = [];\n\t\t\t$this->courses = [];\n\t\t\tforeach ( $course_ids as $course_id ) {\n\t\t\t\t$course = \\get_post( $course_id );\n\t\t\t\tif ( ! $course || 'course' !== get_post_type( $course ) ) {\n\t\t\t\t\t$missing[] = $course_id;\n\t\t\t\t}\n\n\t\t\t\t$this->courses[ $course_id ] = $course;\n\t\t\t}\n\n\t\t\tif ( ! empty( $missing ) ) {\n\t\t\t\t// translators: %s placeholder is list of course IDs.\n\t\t\t\t$this->notices['missing_courses'] = sprintf( __( 'The following course IDs were included in snapshots but can no longer by found: %s', 'sensei-enrollment-comparison-tool' ), implode( ', ', $missing ) );\n\t\t\t}\n\t\t}\n\n\t\treturn $this->courses;\n\t}", "public function categories_teachers_Course()\n {\n if($this->input->server('REQUEST_METHOD') == \"GET\")\n {\n $categories = $this->Category_model->get_categories();\n $teachers = $this->Teacher_model->get_teachers();\n\n if(!$categories || !$teachers)\n {\n echo json_encode(array('status' => \"error\"));\n return;\n }\n echo json_encode(array('status' => \"success\", \"categories\" => $categories, \"teachers\" => $teachers));\n return;\n }\n }", "private function defineEmptyForumCoursesCat() {\n // reset the param\n $this->forumCoursesCat = [];\n $this->emptyForumCoursesCat = 0;\n\n // SELECT only courses with forum from forum table\n $sql = \"SELECT *\" .\n \" FROM \" . $this->getForumClass()->dbTable .\n \" WHERE course IN (\" . $this->course->getIDsString() . \")\" .\n \" AND course NOT IN (\" .\n \" SELECT DISTINCT(course) FROM \" . $this->dbTable .\n \" WHERE module != \" . $this->modules->getForumId() .\n \" AND course IN (\" . $this->course->getIDsString() . \")\" .\n \" );\";\n $q = $this->db->query($sql);\n\n if ($q->num_rows > 0) {\n $forumIdStr = '';\n $courseCount = 0;\n while ($r = $q->fetch_object()) {\n if (!isset($this->forumCoursesCat[$r->course])) {\n $this->forumCoursesCat[$r->course] = [];\n $courseCount++;\n }\n $this->forumCoursesCat[$r->course][$r->id] = $r;\n $forumIdStr .= ($forumIdStr === '') ? $r->id : ',' . $r->id;\n }\n\n $sql = \"SELECT DISTINCT(course)\" .\n \" FROM \" . $this->getForumClass()->dbPostsTable .\n \" WHERE forum IN (\" . $forumIdStr . \")\";\n $q = $this->db->query($sql);\n\n $coursePostCount = $q->num_rows;\n\n // calc the sum of empty courses by:\n // courses with only forum\n // - sum of courses with posts from courses with only forum\n $this->emptyForumCoursesCat = ($courseCount - $coursePostCount);\n }\n }", "public function getCourses()\n {\n // TODO\n return array();\n }", "public function getTeacherCourses($slug){\n $teacher = Teacher::whereSlug($slug)->firstOrFail();\n return Resource::collection($teacher->courses);\n }", "function get_teachers() {\n\n $teacher_array = array();\n $teacher_details = array();\n\n // TODO get the roles that are specified as being able to grade forums\n $teacher_roles = array(3, 4);\n\n foreach ($this->courses as $course) {\n\n // this mulidimensional array isn't currently used.\n // $teacher_array[$coure->id] = array();\n\n // get teachers in this course with this role\n $course_teachers = get_role_users($teacher_roles, $course->context);\n if ($course_teachers) {\n\n foreach($course_teachers as $course_teacher) {\n\n if (!in_array($course_teacher->id, $teacher_array)) {\n\n $teacher_array[] = $course_teacher->id;\n\n }\n }\n }\n }\n if (count($teacher_array, 1) > 0) { // some teachers were returned\n $this->teacher_array = $teacher_array;\n $this->teachers = implode(',', $teacher_array);\n } else {\n $this->teacher_array = false;\n }\n }", "public function get_not_created_links()\n\t{\n\t\treturn false;\n\t\tif (empty($this->course_code))\n\t\t\tdie('Error in get_not_created_links() : course code not set');\n\n\t\t$tbl_grade_links = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_LINK);\n\n\t\t$sql = 'SELECT id, name from '.$this->get_learnpath_table().' lp\n\t\t\t\tWHERE c_id = '.$this->course_id.' AND id NOT IN '\n\t\t\t.' (SELECT ref_id FROM '.$tbl_grade_links\n\t\t\t.' WHERE type = '.LINK_LEARNPATH\n\t\t\t.\" AND course_code = '\".$this->get_course_code().\"'\"\n\t\t\t.') AND lp.session_id='.api_get_session_id().'';\n\n\t\t$result = Database::query($sql);\n\n\t\t$cats=array();\n\t\twhile ($data=Database::fetch_array($result)) {\n\t\t\t$cats[] = array ($data['id'], $data['name']);\n\t\t}\n\n\t\treturn $cats;\n\t}", "public function getCoursesCategories()\n {\n return $this->hasMany(CoursesCategories::className(), ['course_id' => 'id']);\n }", "function getMyCourses()\n {\n $model = Classregistry::init('Course');\n\n return $model->getCourseByInstructor(self::get('id'));\n }", "public function coursesCurrentlyTaughtToStudents()\n {\n return $this->courseStudents()->get()->map(function($courseStudent) {\n return $courseStudent->course;\n })->unique('id');\n }", "function course_get_avail_templates($course) {\n global $CFG, $USER;\n\n $return = array();\n $cats = array();\n\n /// Fetch the courses that the user has direct access to.\n $fields = array('id', 'category', 'fullname', 'shortname');\n $accessinfo = isset($USER->access) ? $USER->access : get_user_access_sitewide($USER->id);\n $courses = get_user_courses_bycap($USER->id, 'moodle/course:update', $accessinfo, false,\n 'c.sortorder ASC', $fields);\n\n $cids = array();\n\n if (!empty($courses)) {\n foreach ($courses as $crs) {\n $cids[] = $crs->id;\n }\n }\n\n $sql = \"SELECT c.id, c.category, c.fullname, c.shortname, 1 as shared\n FROM {$CFG->prefix}course c\n INNER JOIN {$CFG->prefix}block_admin_share cs ON cs.courseid = c.id\n WHERE c.shortname = '{$course->shortname}'\n AND cs.userid != {$USER->id}\";\n\n if (!empty($cids)) {\n $sql .= ' AND c.id NOT IN (' . implode(', ', $cids) . ')';\n }\n\n $sql .= ' ORDER BY c.sortorder ASC';\n\n if ($shares = get_records_sql($sql)) {\n array_merge($courses, $shares);\n }\n\n if (!empty($courses)) {\n foreach ($courses as $crs) {\n if (SHARE_RESTRICT_LISTING) {\n if ($crs->shortname != $course->shortname || !course_using_template($crs->id) ||\n $course->id == $crs->id) {\n\n continue;\n }\n } else {\n if ($crs->shortname != $course->shortname || $course->id == $crs->id) {\n continue;\n }\n }\n\n if (!isset($cats[$crs->category])) {\n $cats[$crs->category] = get_field('course_categories', 'name', 'id', $crs->category);\n }\n\n $crs->catname = $cats[$crs->category];\n $crs->crn = get_crn_from_coursename($crs);\n $crs->displayname = (isset($crs->shared) ?\n '<i>' . $crs->catname . ' ' . $crs->shortname . ' ' . ' CRN ' . $crs->crn . '</i>' :\n $crs->catname . ' ' . $crs->shortname . ' ' . ' CRN ' . $crs->crn);\n\n $return[] = $crs;\n }\n }\n\n if (!empty($return)) {\n usort($return, 'sort_template_courses');\n }\n\n return $return;\n }", "function get_courses()\t{\n return $this->dbc->get_records(\"course\", array(), 'fullname ASC');\n }", "public function getCourseList()\n {\n $course_list = [];\n\n foreach($this->sections as $section)\n {\n $course_list[$section->getCourseId()] = $section->course_subject.' '.$section->course_number.' '.$section->course_name;\n }\n\n return $course_list;\n }", "public function getCourseCombination(){\n\t\t\t$result = [];\n\n\t\t\t$lectures = [];\n\t\t\t$sectionCode = [];\n\t\t\t$labs = [];\n\n\t\t\t// get Lecture\n\t\t\tforeach ($this->courseClasses as $class) {\n\t\t\t\tif ($class->isLecture()) {\n\t\t\t\t\tarray_push($lectures, $class);\n\t\t\t\t\t$sectionCode[] = $class->section;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// get Lab or classes\n\t\t\tforeach ($this->courseClasses as $key =>$class) {\n\t\t\t\tif (!$class->isLecture()) {\n\t\t\t\t\t// $sec = preg_replace('/[0-9]+/', '', $class->section);\n\t\t\t\t\t$labSection = $class->section[0];\n\t\t\t\t\t\n\t\t\t\t\tif (in_array($labSection, $sectionCode) or $labSection == 'L') {\n\t\t\t\t\t\tarray_push($labs, $class);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tunset($this->courseClasses[$key]);\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t}\n\n\t\t\tforeach ($lectures as $lecture) {\n\t\t\t\tforeach ($labs as $lab) {\n\t\t\t\t\t// $labSection = preg_replace('/[0-9]+/', '', $lab->section);\n\t\t\t\t\t$labSection = $lab->section[0];\n\t\t\t\t\tif ($labSection == 'L' or ($lecture->section) == $labSection) {\n\t\t\t\t\t\tarray_push($result, [$lecture, $lab]);\n\t\t\t\t\t\t$this->courseCombination++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (sizeof($labs) == 0) {\n\t\t\t\t$result = [];\n\t\t\t\tforeach ($lectures as $l) {\n\t\t\t\t\t$result[] = [$l];\n\t\t\t\t}\n\t\t\t\t$this->courseCombination = sizeof($lectures);\n\t\t\t}\n\n\t\t\treturn $result;\n\t\t}", "function get_courses($categoryid=\"all\", $sort=\"c.sortorder ASC\", $fields=\"c.*\") {\n\n global $USER, $CFG;\n\n $categoryselect = \"\";\n if ($categoryid != \"all\" && is_numeric($categoryid)) {\n $categoryselect = \"c.category = '$categoryid'\";\n }\n\n $teachertable = \"\";\n $visiblecourses = \"\";\n $sqland = \"\";\n if (!empty($categoryselect)) {\n $sqland = \"AND \";\n }\n if (!empty($USER->id)) { // May need to check they are a teacher\n if (!iscreator()) {\n $visiblecourses = \"$sqland ((c.visible > 0) OR t.userid = '$USER->id')\";\n $teachertable = \"LEFT JOIN {$CFG->prefix}user_teachers t ON t.course = c.id\";\n }\n } else {\n $visiblecourses = \"$sqland c.visible > 0\";\n }\n\n if ($categoryselect or $visiblecourses) {\n $selectsql = \"{$CFG->prefix}course c $teachertable WHERE $categoryselect $visiblecourses\";\n } else {\n $selectsql = \"{$CFG->prefix}course c $teachertable\";\n }\n\n $extrafield = str_replace('ASC','',$sort);\n $extrafield = str_replace('DESC','',$extrafield);\n $extrafield = trim($extrafield);\n if (!empty($extrafield)) {\n $extrafield = ','.$extrafield;\n }\n return get_records_sql(\"SELECT \".((!empty($teachertable)) ? \" DISTINCT \" : \"\").\" $fields $extrafield FROM $selectsql \".((!empty($sort)) ? \"ORDER BY $sort\" : \"\"));\n}", "public function GetCourses()\n\t\t{\n $course_students = CourseStudent::GetAll(['student_id' => $this->GetAttribute(static::$primary_key)]);\n $courses = array();\n\n foreach ($course_students as $course_student) {\n $courses[] = Course::GetFromPrimaryKey($course_student->GetAttribute('course_id'));\n }\n\n return $courses;\n\t\t}", "public function getAlsoStudied() {\r\n $retval = array();\r\n // first pass - get user ids of other people on this course\r\n $sql = \"SELECT internal_uid FROM user_course WHERE course_code = ?\";\r\n $params = array($this->course_code);\r\n $user_ids = array_keys($this->doSQL($sql, $params, 'internal_uid'));\r\n if ( ! empty($user_ids) ) {\r\n // second pass get course codes for these users\r\n $sql = sprintf(\"SELECT course_code, count(internal_uid) AS number \".\r\n \"FROM user_course \".\r\n \"WHERE internal_uid IN (%s) \".\r\n \" AND course_code != ? \".\r\n \"GROUP BY course_code \".\r\n \"ORDER BY number DESC \".\r\n \"LIMIT 0,5\" , implode(',', $user_ids) ); \r\n $results = $this->doSQL($sql, array($this->course_code));\r\n \r\n foreach ($results as $row) {\r\n $course = new Course($row['course_code']);\r\n $course->load();\r\n $retval[] = $course;\t\r\n }\r\n }\r\n return $retval;\r\n }", "public function get_courses() {\n }", "function get_user_categories ($userid, $notintensives = true) {\n global $DB;\n\n if ($notintensives) {\n $condition = \"AND cc.id IN (SELECT DISTINCT c.category\n FROM {course} c\n WHERE c.shortname LIKE '%.M.%')\";\n } else {\n $condition = '';\n }\n\n $sql = \"SELECT distinct (cc.name), cc.id\n FROM {role_assignments} ra\n JOIN {role} r ON r.id = ra.roleid\n JOIN {context} c ON c.id = ra.contextid\n JOIN {course} co ON co.id = c.instanceid\n JOIN {course_categories} cc ON cc.id = co.category\n WHERE userid = :userid\n AND c.contextlevel = :context\n $condition\";\n $records = $DB->get_records_sql($sql, array(\n 'userid' => $userid,\n 'context' => CONTEXT_COURSE\n ));\n\n $categories = array();\n\n foreach ($records as $record) {\n $categories[$record->name] = $record->id;\n }\n\n $managercategories = get_name_categories_by_role($userid, 'manager');\n foreach ($managercategories as $key => $value) {\n $categories[$key] = $value;\n }\n\n return $categories;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get free bib on this month of current freelancer.
function fre_get_free_bid_current_month(){ global $user_ID; $user_meta = 'bidded_on_'.date('m').date('Y'); $bidded_this_month = (int) get_user_meta($user_ID, $user_meta, true); return (int) ae_get_option( 'fre_free_bid', 10 ) - $bidded_this_month; }
[ "public function get_bib_number() {\n if ($this->_show == 'all') {\n return null;\n } else {\n return $this->_show;\n }\n }", "private function retrieve_currentmonth()\n {\n }", "function sp_get_this_month_link() {\n\t\tglobal $sp_ecp;\n\t\tif ( $sp_ecp->displaying == 'month' ) {\n\t\t\treturn esc_html($sp_ecp->getLink( 'month', $sp_ecp->date ));\n\t\t}\n\t\treturn false;\n\t}", "function _groom_get_reference_date()\n{\n $date = new DateTime();\n $get_params = drupal_get_query_parameters();\n\n if (!empty($get_params['month-display']) && preg_match('/^[0-9]{4}-[0-9]{2}$/', $get_params['month-display'])) {\n $date = new DateTime($get_params['month-display']);\n }\n\n return $date;\n}", "public function getDocumentFeeCollectionMonth(): int\n {\n return $this->documentFeeCollectionMonth;\n }", "function sp_get_current_month_text( ){\n\t\tglobal $sp_ecp; \n\t\treturn date( 'F', strtotime( $sp_ecp->date ) );\n\t}", "public static function getMonthlyProcurementOfCurrentYear(){\n\n\t\t\t$eh = DB::table('PurchaseDeliveryItems')\n\t\t\t\t\t->select(DB::raw(\"MONTHNAME(DateDelivered) AS Month, SUM((Quantity - RejectedQuantity)*PurchasedUnitPrice) AS PurchaseAmount\"))\n\t\t\t\t\t->join('PurchaseDeliveryReceipts', 'PurchaseDeliveryItems.PurchaseDeliveryReceiptID' ,'=','PurchaseDeliveryReceipts.PurchaseDeliveryReceiptID')\n\t\t\t\t\t->groupBy(DB::raw(1));\n\t\t\treturn $eh->get();\n }", "public static function thisMonth()\n {\n return auth()->user()->purchases()\n ->whereMonth('created_at', '=', now()->month)\n ->orderBy('created_at', 'desc')\n ->get();\n }", "private function getBillingMonth() {\n $this->billingMonth = $this->billingMonthRepository->findOneByDate($this->monthDate);\n }", "function getCurrentMonth() {\n\tglobal $c,$default_GMTtimezone,$default_country;\n\t//return gmdate(\"m\");\n\treturn getFormattedDateMonth(getDualInfoWithAlias(\"now()\",\"datetime\"));\n}", "public function getMonthCard()\n {\n return $this->get(self::_MONTH_CARD);\n }", "function curmonth() {\r\n $currentmonth = date(\"Y-m\");\r\n return($currentmonth);\r\n}", "function getMonth () {\r\n\t\t\treturn $this->_dateNow(\"%m\");\r\n\t\t}", "public function getPubFarebasis()\n {\n return isset($this->PubFarebasis) ? $this->PubFarebasis : null;\n }", "public function calByYearMonth($year=null, $month=null)\n {\n return DB::table($this->table)->select('calendar_id','calendar_date','calendar_free1', DB::raw('calendar_date IS NULL AS sortOrderNull'))\n ->where('last_kind', '<>', DELETE)\n ->where('calendar_year', '=', $year)\n ->where('calendar_free1', '=', $month)\n ->orderBy('sortOrderNull', 'asc')\n ->orderBy('calendar_date', 'asc')\n ->limit(16)\n ->get();\n }", "public function getPublicationMonth(): int {\n return $this->publicationMonth;\n }", "public function getMonthInfo()\n {\n return $this->currentMonth;\n }", "public function getISBN();", "public function getz47Ca12Libelle() {\n return $this->z47Ca12Libelle;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Converts a string to "camelCase"
public static function camelCase($str) {}
[ "public function testTo_camelCase()\n\t\t{\n\t\t// test with no capitalise first character and without special character\n\t\t$this->assertEquals(\"itIsGood\", $this->textClass->to_camelCase(\"It is good\"));\n\n\t\t// test with capitalise first character and without special character\n\t\t$this->assertEquals(\"ItIsGood\", $this->textClass->to_camelCase(\"it is good\", true));\n\n\t\t// test with no capitalise first character and with special character\n\t\t$this->assertEquals(\"itSGoodVeryNiceNice\", $this->textClass->to_camelCase(\" It's good, very nice_nice !!\"));\n\n\t\t// test with capitalise first character and with special character\n\t\t$this->assertEquals(\"ItSGoodVeryNiceNice\", $this->textClass->to_camelCase(\" It's good, very nice_nice !!\", true));\n\n\t\t// test with more special character\n\t\t$this->assertEquals(\"NiceNice\", $this->textClass->to_camelCase(\" nice @ & | ' ( § ! { } ) - _ = + % \\ >< nice\", true));\n\t\t}", "public static function camelCase($str)\n {\n return preg_replace_callback(\n '/_([a-z])/',\n function ($match) {\n return strtoupper($match[1]);\n },\n $str\n );\n }", "public static function camelCase($str)\n {\n $str = self::convertToLowercase($str);\n return preg_replace_callback(\n '/_([a-z])/',\n function ($match) {\n return strtoupper($match[1]);\n },\n $str\n );\n }", "function dashes_to_camel_case($str) {\n $camel_cased_str = str_replace(' ', '', ucwords(str_replace('-', ' ', $str)));\n $camel_cased_str[0] = strtolower($camel_cased_str[0]);\n\n return $camel_cased_str;\n}", "static function toCamel($str) {\n\t\tif (false === function_exists('lcfirst')) {\n\t\t\t/**\n\t\t * Make a string's first character lowercase\n\t\t *\n\t\t * @param string $str\n\t\t * @return string the resulting string.\n\t\t */\n\t\t function lcfirst($s) {\n\t\t $s[0] = strtolower($s[0]);\n\t\t return ( string ) $s;\n\t\t }\n\t\t}\n\t\t\n\t\t$str = str_replace(array('-', ' '), array('', ''), $str);\n\t\t\n\t\tif (strpos($str, '_') !== false) {\n\t\t\t$a = explode('_', $str);\n\t\t\t$i = 0; $b = array();\n\t\t\tforeach ($a as $v) {\n\t\t\t\tif ($i == 0) $b[] = lcfirst($v);\n\t\t\t\telse $b[] = ucwords($v);\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t\n\t\t\treturn implode('', $b);\n\t\t} else {\n\t\t\treturn lcfirst($str);\n\t\t}\n\t}", "public static function camelCase($str)\n {\n return lcfirst(static::StudlyCase($str));\n }", "function dashedtoCamel($str) {\r\n\t$str = str_replace(' ', '', ucwords(str_replace('-', ' ', $str)));\r\n $str[0] = strtolower($str[0]);\r\n return $str;\r\n}", "function str_camel(string $string, $language = '') : string\n{\n return Str::camel($string, $language);\n}", "function acf_str_camel_case($string = '') {}", "function underscoreToCamelCase($string)\n\t{\n\t return preg_replace('/_(.?)/e',\"strtoupper('$1')\",$string);\n\t}", "public function camelString($string)\n {\n $string = preg_replace('/[^a-zA-Z0-9\\s]/', '', $string);\n return str_replace(' ', '', lcfirst(ucwords(strtolower(strtr($string, '_-', ' ')))));\n }", "public function camelCase($camelCase = true);", "function underscoreToCamelCase($str) {\n $parts = explode('_', $this->real_field);\n foreach ($parts as &$part) {\n $part = ucfirst($part);\n }\n return lcfirst(join(\"\", $parts));\n }", "public static function camel($value){}", "private function _camelCaseToTitle($camelStr)\r\n\t{\r\n\t\t$intermediate = preg_replace('/(?!^)([[:upper:]][[:lower:]]+)/', ' $0', $camelStr);\r\n\t\t$titleStr = preg_replace('/(?!^)([[:lower:]])([[:upper:]])/', '$1 $2', $intermediate);\r\n\r\n\t\treturn ucwords($titleStr);\r\n\t}", "public function dashedToCamelCase($string)\n\t{\n\t\treturn camel_case(str_replace('-', '_', $string));\n\t}", "function decamelize($string) {\n return strtolower(preg_replace(\"/([a-z])([A-Z])/\", \"\\\\1_\\\\2\", $string));\n }", "function underscore2Camelcase($str) {\n\t$words = explode('_', strtolower($str));\n\n\t$return = '';\n\tforeach ($words as $word) {\n\t\t$return .= ucfirst(trim($word));\n\t}\n\t$return = lcfirst($return);\n\treturn $return;\n}", "function snakeCaseToCamelCase(string $input)\n{\n $string = ucwords($input, \"_\");\n $string = str_replace('_', '', $string);\n $string = lcfirst($string);\n\n return $string;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This object is constructed with an IP address AS AN INTEGER Please note that 99% of the time this constructor will not be used in application code. What should be used is one of the create factory methods.
public function __construct($ipAddressInt, $originalHost = null) { if (!is_int($ipAddressInt)) { throw new Exception('IPv4Address must be constructed with an integer.'); } $this->address = $ipAddressInt; if (!is_null($originalHost)) { $this->originalHost = $originalHost; } else { $this->originalHost = $this->asString(); } }
[ "public function __construct($ip)\n {\n if ($ip instanceof \\GMP) {\n $this->ip = $ip;\n } elseif (is_int($ip)) {\n $this->ip = static::initGmpFromInt($ip);\n } elseif (is_float($ip) && $ip == floor($ip)) {\n $this->ip = static::initGmpfromFloat($ip);\n } elseif (is_string($ip)) {\n if (static::NB_BYTES === strlen($ip) && static::IP_VERSION === 4) {\n // auto-detection of binary strings is only supported for ipv4\n // see https://github.com/rlanvin/php-ip/issues/57 for more details\n $this->ip = static::initGmpFromBinaryString($ip);\n } elseif (ctype_digit($ip)) {\n $this->ip = static::initGmpFromNumericString($ip);\n } else {\n $this->ip = static::initGmpfromString($ip);\n }\n } else {\n throw new \\InvalidArgumentException(sprintf('Unsupported argument type: \"%s\".', gettype($ip)));\n }\n\n if (!static::isValid($this->ip)) {\n throw new \\InvalidArgumentException(sprintf('The provided argument \"%s\" is not a valid IPv%d address.', (string) $ip, static::IP_VERSION));\n }\n }", "public function __construct($ip)\n\t{\n\t\tif ( is_int($ip) ) {\n\t\t\t// always a valid IP, since even in 64bits plateform, it's less than max value\n\t\t\t$this->ip = gmp_init(sprintf('%u',$ip),10);\n\t\t}\n\t\telseif ( is_float($ip) && floor($ip) == $ip ) {\n\t\t\t// float (or double) with an integer value\n\t\t\t$ip = gmp_init(sprintf('%s',$ip), 10);\n\t\t\tif ( gmp_cmp($ip, 0) < 0 || gmp_cmp($ip, self::MAX_INT) > 0 ) {\n\t\t\t\tthrow new InvalidArgumentException(sprintf('The double %s is not a valid IPv6 address', gmp_strval($ip)));\n\t\t\t}\n\t\t\t$this->ip = $ip;\n\t\t}\n\t\telseif ( is_string($ip) ) {\n\t\t\t// binary string\n\t\t\tif ( ! ctype_print($ip) ) {\n\t\t\t\t// probably the result of inet_pton\n\t\t\t\t// must be 16 bytes exactly to be valid\n\t\t\t\tif ( strlen($ip) != 16 ) {\n\t\t\t\t\tthrow new InvalidArgumentException(\"The binary string is not a valid IPv6 address\");\n\t\t\t\t}\n\t\t\t\t$hex = unpack('H*',$ip);\n\t\t\t\t$this->ip = gmp_init($hex[1],16);\n\t\t\t}\n\t\t\t// valid human readable representation\n\t\t\telseif ( filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) ) {\n\t\t\t\t$ip = inet_pton($ip);\n\t\t\t\t$hex = unpack('H*',$ip);\n\t\t\t\t$this->ip = gmp_init($hex[1],16);\n\t\t\t}\n\t\t\t// numeric string (decimal)\n\t\t\telseif ( ctype_digit($ip) ) {\n\t\t\t\t$ip = gmp_init($ip, 10);\n\t\t\t\tif ( gmp_cmp($ip, '340282366920938463463374607431768211455') > 0 ) {\n\t\t\t\t\tthrow new InvalidArgumentException(sprintf(\"%s is not a valid decimal IPv6 address\", gmp_strval($ip)));\n\t\t\t\t}\n\t\t\t\t$this->ip = $ip;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthrow new InvalidArgumentException(\"$ip is not a valid IPv6 address\");\n\t\t\t}\n\t\t}\n\t\telseif ( (is_resource($ip) && get_resource_type($ip) == 'GMP integer') || $ip instanceof GMP ) {\n\t\t\tif ( gmp_cmp($ip, 0) < 0 || gmp_cmp($ip, self::MAX_INT) > 0 ) {\n\t\t\t\tthrow new InvalidArgumentException(sprintf(\"%s is not a valid decimal IPv6 address\", gmp_strval($ip)));\n\t\t\t}\n\t\t\t$this->ip = $ip;\n\t\t}\n\t\telse {\n\t\t\tthrow new InvalidArgumentException(\"Unsupported argument type: \".gettype($ip));\n\t\t}\n\t}", "public static function fromString($IP);", "public function __construct()\n {\n $this->_counterId = __CLASS__ . '\\\\IP';\n $this->_counterNoIPId = __CLASS__ . '\\\\NOIP';\n }", "function _NumberToIpAddress($number = null){ return long2ip($number); }", "public function __construct(){\r\n\t\t//Determine clients IP with get method\r\n\t\t$this->ip = $this->get();\r\n\t}", "function _ipAddressToNumber($IPaddress = null){ return ip2long($IPaddress);}", "public function parseIp(): void\n {\n $this->type = self::TYPE_STRING;\n $this->example = $this->faker->ipv4;\n }", "public function __construct($ip = null, $timeout = null)\n {\n if(!extension_loaded('snmp')) {\n require_once 'Exception.php';\n throw new Kohut_SNMP_Exception('SNMP extension is not loaded');\n }\n\n if ($ip !== null) {\n $this->setIPAddress($ip);\n }\n\n if ($timeout !== null) {\n $this->setMaxTimeout($timeout);\n }\n }", "public function __construct($ip, $network_size)\n {\n $this->validateInputs($ip, $network_size);\n\n $this->ip = $ip;\n $this->network_size = $network_size;\n $this->quads = explode('.', $ip);\n $this->subnet_mask = 0xFFFFFFFF << (32 - $this->network_size);\n }", "function _ipAddressToNumber($IPaddress = null){\n return ip2long($IPaddress);\n }", "public function ip($ip)\n {\n $this->params[\"ip\"] = urlencode($ip);\n \n return($this);\n }", "final public static function inet() {}", "public function txtIp_Create($strControlId = null) {\n\t\t\t$this->txtIp = new \\QCubed\\Control\\IntegerTextBox($this->objParentObject, $strControlId);\n\t\t\t$this->txtIp->Name = t('Ip');\n\t\t\t$this->txtIp->PreferredRenderMethod = 'RenderWithName';\n $this->txtIp->LinkedNode = QQN::Log()->Ip;\n\t\t\t$this->txtIp->Text = $this->objLog->Ip;\n\t\t\treturn $this->txtIp;\n\t\t}", "function NUM2IP($ip_number){\n\treturn $dotted_ip_address = long2ip($ip_number);\n\t}", "private function generateIP()\n \t{\n \t \t// REMOTE_ADDR header should always be set when we are looking for the ip address. Apache sets it by default.\n \t \t// the customHeader was added in order to specify your own header to grab the IP from\n \t\tif($this->validIP($_SERVER[\"REMOTE_ADDR\"]))\n \t\t{\n \t\t\t$this->ipAddress = $_SERVER[\"REMOTE_ADDR\"];\n \t\t}\n \t\telse if(!empty($_SERVER[\"X_REMOTE_IP\"]) && $this->validIP($_SERVER[\"X_REMOTE_IP\"]))\n \t\t{\n \t\t\t$this->ipAddress = $_SERVER[\"X_REMOTE_IP\"];\n \t\t}\n \t\telse if(!empty($_SERVER[\"X_FORWARDED_FOR\"]) && $this->validIP($_SERVER[\"X_FORWARDED_FOR\"]))\n \t\t{\n \t\t\t$this->ipAddress = $_SERVER[\"X_FORWARDED_FOR\"];\n \t\t}\n \t\telse\n \t\t{\n \t\t\t$this->ipAddress = null;\n \t\t}\n \t}", "static function ip($str) {\n $ip = ip2long($str);\n return is_int($ip) ? long2ip($ip) : null;\n }", "public static final function inet() { }", "public function setIp($intIp)\n {\n\t\t$intIp = Type::Cast($intIp, QCubed\\Type::INTEGER);\n\n\t\tif ($this->intIp !== $intIp) {\n\t\t\t$this->intIp = $intIp;\n\t\t\t$this->__blnDirty[self::IP_FIELD] = true;\n\t\t}\n\t\t$this->__blnValid[self::IP_FIELD] = true;\n\t\treturn $this; // allows chaining\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the no results text
public function noResultsText($text) { $this->noResultsText = $text; return $this; }
[ "public function setNoResults(string $text): self\n {\n $this->_noResults = $text;\n\n return $this;\n }", "public function showResultsForEmptySearch()\n {\n $this->showResultsForEmptySearch = true;\n }", "function showNoResults(){\r\n\t\t\t$i=count($this->thecolumns);?>\r\n\t\t\t<tr class=\"norecords\"><td colspan=\"<?php echo $i?>\">\r\n\t\t\t\t<?php if(!$this->sqlerror) {?>\r\n\t\t\t\t\tNo Results Found\r\n\t\t\t\t<?php } else {?>\r\n\t\t\t\t\tInvalid Search\r\n\t\t\t\t<?php } ?>\r\n\t\t\t</td></tr>\r\n\t\t\t<?php\r\n\t\t}", "public function getNoResultsTpl(){\n return $this->templates['no_results'];\n }", "function setNoText($no_text) {\n $this->no_text = $no_text;\n }", "public function output_no_results() {\n\t\tget_job_manager_template( 'content-no-jobs-found.php' );\n\t}", "public function output_no_results() {\n\t\tget_job_manager_template( 'content-no-resumes-found.php', array(), 'wp-job-manager-resumes', RESUME_MANAGER_PLUGIN_DIR . '/templates/' );\n\t}", "public function getNoResultsMessage()\n {\n return $this->noResultsMessage;\n }", "function setNoEntriesText($a_text)\n\t{\n\t\t$this->noentriestext = $a_text;\n\t}", "public function getNoResultText()\n {\n if ($this->helperData->getEscapedQueryText() && $this->helperData->isMinQueryLength()) {\n return __('Minimum Search query length is %1', Config::QUERY_LENGTH);\n }\n\n return $this->_getData('no_result_text');\n }", "private function _replace_no_results_tag($m)\n\t{\n\t\t$this->EE->TMPL->no_results_block = $m[0];\n\t\t$this->EE->TMPL->no_results = $m[1];\n\n\t\treturn '';\n\t}", "function no_results()\n {\n\t\tglobal $TMPL;\n\t\t\n\t\tif ( preg_match( \"/\".LD.\"if \".preg_quote($this->lower_name).\"_no_results\".RD.\"(.*?)\".LD.SLASH.\"if\".RD.\"/s\", $TMPL->tagdata, $match ) )\n\t\t{\n\t\t\treturn $match[1];\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $TMPL->no_results();\n\t\t}\n }", "function actionSearchEmptyResults()\n\t{\n\t\t$result = \"No experiments were found that contain your search words.\";\n\t\t$this->render('search1',array('result'=>$result));\t\n }", "public function renderEmptyText()\n\t{\n\t\t$emptyText=$this->emptyText===null ? Yii::t('zii','No results found.') : $this->emptyText;\n\t\techo CHtml::tag($this->emptyTagName, array('class'=>$this->emptyCssClass), $emptyText);\n\t}", "protected function clearResults() {\n\t\t$this->error = '';\n\t\t$this->status_org = false;\n\t\t$this->status_new = false;\n\t}", "public function renderEmptyText()\n\t{\n\t\t$emptyText=$this->emptyText===null ? 'No results found.' : $this->emptyText;\n\t\techo \\Core\\Html::tag($this->emptyTagName, array('class'=>'empty'), $emptyText);\n\t}", "function shprinkone_get_no_result() {\n\t$span = shprinkone_get_contentspan();\n\t$html = '<section class=\"no-result ' . $span . '\">';\n\t$html .= '<p>' . __( 'Sorry, no posts matched your criteria.', 'shprinkone' ) . '</p>';\n\t$html .= '</section>';\n\treturn $html;\n}", "function inline_search_no_results() {\n\n\techo '<div class=\"retry\">';\n\t\techo '<p>';\n\t\t\techo apply_filters( 'inline_query_no_results_text', __( 'We are sorry, but it seems that your search has returned no results. Please try again using the search form below.', 'inline' ) );\n\t\techo '</p>';\n\t\t\n\t\tget_search_form();\n\t\t\n\techo '</div><!--end .retry-->';\n\n}", "function getNoEntriesText()\n\t{\n\t\treturn $this->noentriestext;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
fonction to draw the graph
function drawGraph($title_graph,$color_background,$color_axes,$title_axe_x,$title_axe_y,$color_graph,$type_graph,$color_text,$array){ if($type_graph == "line" || $type_graph == "bar"){ // the svg tag allows us to create graphic formats echo ' <svg viewbox="0 2 500 370" style="background-color:'. $color_background .' ; font-size:12px ; width:53%;"> <rect x="30" y="-10" width="490" height="280" style="fill:transparent ; stroke:'. $color_axes .' ; stoke-width:1 ;"/> <text x="0" y="15" fill="'.$color_text.'">'. $title_axe_y .'</text> <text x="470" y="290" fill="'.$color_text.'">'. $title_axe_x .'</text> <g class="graph-x">'; // determine the type of keys foreach ($array as $key => $value){ $type=gettype($key);} // if the type is an integer the array will be sorted if($type == "integer"){ //sort of data ksort($array); } //sinon c-a-d si le type est String // Calculations for obtaining the coordinates of points to draw the graph $nb = max($array); if ($nb <= 50){ $mdata = 10 ; }else { $mdata = 20 ; } $max_data=max($array) + $mdata; $max_width =500; $max_height =270; $xgap = $max_width / (count($array) + 1); $ygap = $max_height / (count($array) + 1); $plz= $xgap; $plz2= $ygap; $one_unit =$max_height / $max_data ; foreach ($array as $key => $value){ // diplay the keys of axis X echo ' <text x='. $plz .' y="295" fill="'.$color_text.'" >'. $key.'</text>'; $plz +=$xgap; } //l'axe des ordonnees echo' </g> <g class="graph-y">'; foreach ($array as $key => $value){ $ye = $max_height - ($value * $one_unit ); $xe = $ye ; // diplay the values of axis Y echo' <text x="0" y='. $xe .' fill="'.$color_text.'" >'. $value .'</text>'; $xe += $one_unit ; } echo '</g>'; $num = $xgap; $num2 = $ygap; $points=""; $elements= ""; foreach ($array as $key => $value){ $y = $max_height - ($value * $one_unit ); $y = $y ; $elements .= "<polyline points='$num,0 $num,$max_height' style='stroke:#ffffff22;' />"; $elements .= "<polyline points='0,$y $max_width,$y' style='stroke:#ffffff22;' />"; // $elements .= "<text x='$num' y='12' style='fill:white;' >$key</text>"; $elements .= "<text x='$num' y='".($y - 10)."' style='fill:$color_text;' >$value</text>"; $points .= " $num,$y "; if($type_graph=="line"){ // To draw a line-chart echo "<polyline points='$points' style='stroke:$color_graph;' />"; $elements .= "<circle r='5' cx='$num' cy='$y' style='stroke:white;fill:black ;' />"; }elseif($type_graph=="bar"){ // To draw a bar-chart $height = $max_height - $y; // calculate the height of the bars echo "<rect x='$num' y='$y' width='50' height='$height' style='fill:$color_graph;;stroke-width:5;' />"; } $points = " $num,$y "; $num +=$xgap; $num2 +=$ygap; } // dispay of the graph echo $elements; }elseif($type_graph=="pie"){//pour tracer Pie-Chart //Title of the graph echo '<p class="title">'. $title_graph .'</p>'; // array contains the sum of values $sumValues = array(); // array contains values $values = array(); $sum = 0; $sumValues[0] = 0; //filling of arrays foreach ($array as $key => $value) { $values[] = $value; $sum += $value; $sumValues[] = $sum; } if($sum == 100){ echo' <svg viewBox="0 0 64 64" class="pie"> '; // array to fill colors used $tabColor = array(); for($i = 0; $i < count($values); $i++) { // generate random colors for the pie $rand1=rand(0,250); $rand2=rand(0,250); $rand3=rand(0,250); $color="rgb($rand1,$rand2,$rand3)"; // draw the pie echo '<circle r="25%" cx="50%" cy="50%" style="stroke-dasharray: '.($values[$i]+10).' 100; stroke: '.$color.'; stroke-dashoffset: -'.$sumValues[$i].';animation-delay: 0.25s"> </circle> '; $tabColor[] = $color; } // style of the pie echo' <style> .pie { width: 300px; border-radius: 50%; } .pie circle { fill: none; stroke: gold; stroke-width: 32; animation: rotate 1.5s ease-in; } @keyframes rotate { to { x } } </style>'; // this part is for generate the legend of the pie for($i = 0; $i < count($values); $i++) { echo ' <div class="canvas"> <div class="legend"> <ul class="caption-list"> <li style="background-color: '.$tabColor[$i].';" class="caption-item"> '.array_search($values[$i],$array).'=>'.$values[$i].'</li> </ul> </div> </div> <style> @keyframes render { 0% { stroke-dasharray: 0 100; } } .canvas { display: inline; justify-content: space-between; align-items: center; max-width: 800px; } .legend { max-width: 10px; margin-left: 30px; } .title { font-family: "Verdana", sans-serif; font-size: 18px; line-height: 21px; color: #591d48; margin: 20px; } .caption-list { margin: 0; padding: 0; list-style: none; } .caption-item { position: relative; margin: 20px 0; padding-left: 20px; border-radius: 5px; font-family: "Verdana", sans-serif; font-size: 16px; line-height: 18px; color: #591d48; cursor: pointer; } .caption-item:hover { opacity: 0.8; } </style> '; } }else{ echo 'Impossible! the sum of values must equal to 100'; } } }
[ "private function drawPoints(){\n\t\t$this->graph->drawPlotGraph(\n\t\t\t$this->DataSet->GetData(),\n\t\t\t$this->DataSet->GetDataDescription(),3,2,\n\t\t\t$this->skin['PlotGraph']['R'],\n\t\t\t$this->skin['PlotGraph']['G'],\n\t\t\t$this->skin['PlotGraph']['B']\n\t\t);\n\t}", "public function draw()\n\t{\n\t\t$this->diagram->draw();\n\t}", "public function draw()\n {\n\n $this->drawYaxis();\n\n if ($this->connect_points == 1) {\n $this->connectPoints();\n }\n\n foreach ($this->points as $point) {\n\n if ($this->y_axis_hints == 1) {\n imagedashedline($this->im, $point->x, $this->height, $point->x,\n 0, $this->ink['axis']);\n } else {\n\n //add axis line\n imageline($this->im, $point->x, $this->graph_height, $point->x,\n $this->graph_height + 10, $this->ink['axis']);\n }\n\n //add axis label\n imagestring($this->im, 1, $point->x + 5, $this->graph_height + 10,\n $point->label, $this->ink['text']);\n\n //don't plot actual point if it is null\n if (is_null($point->value)) {\n continue;\n }\n\n //plot point\n imagefilledellipse($this->im, $point->x, $point->y, 7, 7,\n $this->ink['point']);\n\n //add point label\n if ($point->y <= 5) {\n $posy = $point->y + 5;\n } elseif ($point->y >= $this->graph_height - 5) {\n $posy = $point->y - 20;\n } else {\n $posy = $point->y - 15;\n }\n\n imagestring($this->im, 3, $point->x + 10, $posy, $point->value,\n $this->ink['point']);\n }\n }", "function LineGraph($w, $h, $data, $options='', $colors=null, $maxVal=0, $nbDiv=4){\n$this->SetDrawColor(0,0,0);\n$this->SetLineWidth(0);\n$keys = array_keys($data);\n$ordinateWidth = 10;\n$w -= $ordinateWidth;\n$valX = $this->getX()+$ordinateWidth;\n$valY = $this->getY();\n$margin = 1;\n$titleH = 8;\n$titleW = $w;\n$lineh = 5;\n$keyH = count($data)*$lineh;\n$keyW = $w/5;\n$graphValH = 5;\n$graphValW = $w-$keyW-3*$margin;\n$graphH = $h-(3*$margin)-$graphValH;\n$graphW = $w-(2*$margin)-($keyW+$margin);\n$graphX = $valX+$margin;\n$graphY = $valY+$margin;\n$graphValX = $valX+$margin;\n$graphValY = $valY+2*$margin+$graphH;\n$keyX = $valX+(2*$margin)+$graphW;\n$keyY = $valY+$margin+.5*($h-(2*$margin))-.5*($keyH);\n//draw graph frame border\nif(strstr($options,'gB')){\n$this->Rect($valX,$valY,$w,$h);\n}\n//draw graph diagram border\nif(strstr($options,'dB')){\n$this->Rect($valX+$margin,$valY+$margin,$graphW,$graphH);\n}\n//draw key legend border\nif(strstr($options,'kB')){\n$this->Rect($keyX,$keyY,$keyW,$keyH);\n}\n//draw graph value box\nif(strstr($options,'vB')){\n$this->Rect($graphValX,$graphValY,$graphValW,$graphValH);\n}\n//define colors\nif($colors===null){\n$safeColors = array(0,51,102,153,204,225);\nfor($i=0;$i<count($data);$i++){\n$colors[$keys[$i]] = array($safeColors[array_rand($safeColors)],$safeColors[array_rand($safeColors)],$safeColors[array_rand($safeColors)]);\n}\n}\n//form an array with all data values from the multi-demensional $data array\n$ValArray = array();\nforeach($data as $key => $value){\nforeach($data[$key] as $val){\n$ValArray[]=$val;\n}\n}\n//define max value\nif($maxVal<ceil(max($ValArray))){\n$maxVal = ceil(max($ValArray));\n}\n//draw horizontal lines\n$vertDivH = $graphH/$nbDiv;\nif(strstr($options,'H')){\nfor($i=0;$i<=$nbDiv;$i++){\nif($i<$nbDiv){\n // $this->Line($graphX,$graphY+$i*$vertDivH,$graphX+$graphW,$graphY+$i*$vertDivH);\n} else{\n//$this->Line($graphX,$graphY+$graphH,$graphX+$graphW,$graphY+$graphH);\n}\n}\n}\n//draw vertical lines\n$horiDivW = floor($graphW/(count($data[$keys[0]])-1));\nif(strstr($options,'V')){\nfor($i=0;$i<=(count($data[$keys[0]])-1);$i++){\nif($i<(count($data[$keys[0]])-1)){\n // $this->Line($graphX+$i*$horiDivW,$graphY,$graphX+$i*$horiDivW,$graphY+$graphH);\n} else {\n//$this->Line($graphX+$graphW,$graphY,$graphX+$graphW,$graphY+$graphH);\n}\n}\n}\n//draw graph lines\nforeach($data as $key => $value){\n$this->setDrawColor($colors[$key][0],$colors[$key][1],$colors[$key][2]);\n$this->SetLineWidth(0.7);\n$valueKeys = array_keys($value);\nfor($i=0;$i<count($value);$i++){\nif($i==count($value)-2){\n$this->Line(\n$graphX+($i*$horiDivW),\n$graphY+$graphH-($value[$valueKeys[$i]]/$maxVal*$graphH),\n$graphX+$graphW,\n$graphY+$graphH-($value[$valueKeys[$i+1]]/$maxVal*$graphH)\n);\n} else if($i<(count($value)-1)) {\n$this->Line(\n$graphX+($i*$horiDivW),\n$graphY+$graphH-($value[$valueKeys[$i]]/$maxVal*$graphH),\n$graphX+($i+1)*$horiDivW,\n$graphY+$graphH-($value[$valueKeys[$i+1]]/$maxVal*$graphH)\n);\n}\n}\n//Set the Key (legend)\n$this->SetFont('Courier','',9);\nif(!isset($n))$n=0;\n$this->Line($keyX+1,$keyY+$lineh/2+$n*$lineh,$keyX+2,$keyY+$lineh/2+$n*$lineh);\n$this->SetXY($keyX+2,$keyY+$n*$lineh);\n$this->Cell($keyW,$lineh,$key,0,1,'L');\n$n++;\n}\n//print the abscissa values\nforeach($valueKeys as $key => $value){\nif($key==0){\n$this->SetXY($graphValX,$graphValY);\n$this->Cell(30,$lineh,$value,0,0,'L');\n} else if($key==count($valueKeys)-1){\n$this->SetXY($graphValX+$graphValW-30,$graphValY);\n$this->Cell(30,$lineh,$value,0,0,'R');\n} else {\n$this->SetXY($graphValX+$key*$horiDivW-15,$graphValY);\n$this->Cell(30,$lineh,$value,0,0,'C');\n}\n}\n//print the ordinate values\nfor($i=0;$i<=$nbDiv;$i++){\n$this->SetXY($graphValX-10,$graphY+($nbDiv-$i)*$vertDivH-3);\n$this->Cell(8,6,sprintf('%.1f',$maxVal/$nbDiv*$i),0,0,'L');\n}\n// $this->SetDrawColor(0,0,0);\n// $this->SetLineWidth(0.2);\n}", "public function draw() {\n\t\techo $this->get_svg();\n\t}", "function drawGraph($canvas)\n\t{\n\t\t$this->drawCell($canvas, $this->model->getRoot());\n\t}", "public function showGraph()\n {\n $this->renderGraph();\n }", "function DrawDotSeries() \n {\n $this->DrawDots();\n }", "protected function drawChart()\n {\n parent::drawChart();\n\n // draw pie chart in the middle of graph area\n $middleX = ($this->chart->GArea_X1 + $this->chart->GArea_X2) / 2;\n $middleY = ($this->chart->GArea_Y1 + $this->chart->GArea_Y2) / 2;\n\n $this->chart->drawPieGraph(\n $this->dataSet->GetData(),\n $this->dataSet->GetDataDescription(),\n $middleX,\n // pie graph is skewed. Upper part is shorter than the\n // lower part. This is why we set an offset to the\n // Y middle coordiantes.\n $middleY - 15,\n 120, PIE_PERCENTAGE, FALSE, 60, 30, 10, 1);\n }", "abstract public function draw();", "protected function drawChart()\n {\n // Draw the bar chart\n // use stacked bar graph function, because it gives bars with alpha\n $this->chart->drawStackedBarGraph($this->dataSet->GetData(), $this->dataSet->GetDataDescription(), 70);\n }", "private function showgraph() {\n\t\t// expected presence as a blue band, real presence as a green band on top (with opacity set to 50%)\n\t\t// data shown is for the last 14 days\n\t\t$sql =\"SELECT a.att_date, time_to_sec(min(a.start_time)) AS start_time, time_to_sec(max(a.end_time)) AS end_time,\n\t\t\t\t time_to_sec(if(s.start_time is null, ds.start_time, s.start_time)) AS required_start,\n\t\t\t\t time_to_sec(if(s.end_time is null, ds.end_time, s.end_time)) AS required_end\n\t\t\t\t FROM presence a INNER JOIN employees e ON a.emp_id = e.emp_id \n\t\t\t\t LEFT JOIN emp_shifts es ON e.emp_id = es.emp_id AND es.shift_date = a.att_date LEFT JOIN shifts s ON es.shift_id = s.shift_id\n\t\t\t\t inner join companies c ON e.company_id = c.company_id INNER JOIN shifts ds ON c.default_shift = ds.shift_id\n\t\t\t\t WHERE e.emp_id = \".$this->userid.\" AND a.att_date BETWEEN date_sub(curdate(), interval 15 day) AND curdate()\n\t\t\t\t GROUP BY att_date;\";\n\t\t$data = $this->dbc->query($sql);\n\t\t$Graph =& Image_Graph::factory('graph', array(1000, 700));\n\t\t$Graph->add(\n\t\t Image_Graph::vertical(\n\t\t Image_Graph::factory('title', array('Presence vs. Shift', 36)),\n\t\t Image_Graph::vertical(\n\t\t $Plotarea = Image_Graph::factory('plotarea'),\n\t\t $Legend = Image_Graph::factory('legend'),\n\t\t 90\n\t\t ),\n\t\t 5\n\t\t )\n\t\t); \n\t\t \n\t\t// make the legend use the plotarea (or implicitly it's plots)\n\t\t$Legend->setPlotarea($Plotarea); \n\t\t \n\t\t// create a grid and assign it to the secondary Y axis\n\t\t$GridY2 =& $Plotarea->addNew('bar_grid', IMAGE_GRAPH_AXIS_Y_SECONDARY); \n\t\t$GridY2->setFillStyle(Image_Graph::factory('gradient', \n \t\t\t\t\t\t\t\t array('IMAGE_GRAPH_VERTICAL', 'white', 'white'))); \n\t\t// create a line plot using a random dataset\n\t\t$Expected_start =& Image_Graph::factory('dataset');\n\t\t$Expected_end =& Image_Graph::factory('dataset');\n\t\t$Real_start =& Image_Graph::factory('dataset');\n\t\t$Real_end =& Image_Graph::factory('dataset');\n\t\tif ($data == NULL) return -1;\n\t\tforeach ($data as $row) {\n\t\t\t$Expected_start->addPoint(substr($row['att_date'],5), $row['required_start']/3600);\n\t\t\t$Expected_end->addPoint(substr($row['att_date'],5), ($row['required_end']-$row['required_start'])/3600);\n\t\t\t$Real_start->addPoint(substr($row['att_date'],5), $row['start_time']/3600);\n\t\t\t$Real_end->addPoint(substr($row['att_date'],5), ($row['end_time']-$row['start_time'])/3600);\n\t\t}\n\t\t$Expected = array('ES' => $Expected_start, 'EE' => $Expected_end);\n\t\t$Real = array('RS' => $Real_start, 'RE' => $Real_end);\n\t\n\t\t$fillE =& Image_Graph::factory('Image_Graph_Fill_Array'); \n\t\t$fillE->addColor('white', 'ES'); \n\t\t$fillE->addColor('blue@0.2', 'EE'); \n\t\t$fillR =& Image_Graph::factory('Image_Graph_Fill_Array'); \n\t\t$fillR->addColor('white@0.0', 'RS'); \n\t\t$fillR->addColor('green@0.2', 'RE'); \n\n\t\t$lineE =& Image_Graph::factory('Image_Graph_Line_Array'); \n\t\t$lineE->addColor('white@0.0', 'ES'); \n\t\t$lineE->addColor('blue@0.6', 'EE'); \n\t\t$lineR =& Image_Graph::factory('Image_Graph_Line_Array'); \n\t\t$lineR->addColor('white@0.0', 'RS'); \n\t\t$lineR->addColor('green@0.6', 'RE'); \n\n\t\t$Plot1 =& Image_Graph::factory('bar',array($Expected,'Stacked','Expected'));\n\t\t$Plot1->setFillStyle($fillE);\n\t\t$Plot1->setLineStyle($lineE);\n\t\t$Plotarea->add($Plot1);\n\t\t$Plot2 =& Image_Graph::factory('bar',array($Real,'Stacked','Real'));\n\t\t$Plot2->setFillStyle($fillR);\n\t\t$Plot2->setLineStyle($lineR);\n\t\t$Plotarea->add($Plot2);\n\t\t \n\t\t$Plot1->setTitle('Required');\n\t\t$Plot2->setTitle('Real');\n\n\t\t$AxisX =& $Plotarea->getAxis(IMAGE_GRAPH_AXIS_X);\n\t\t$AxisX->setTitle('Workdays');\n\t\t$AxisX->setFontSize('24');\n\t\t$AxisY =& $Plotarea->getAxis(IMAGE_GRAPH_AXIS_Y);\n\t\t$AxisY->setTitle('Presence', 'vertical'); \n\t\t$AxisY->setFontSize('24');\n\t\t$AxisX->setAxisIntersection(0,'ysec'); \n\t\t// output the Graph\n\t\t$Graph->done(array('filename' => $this->image));\n\t}", "public function draw() {\r\n $g = $this->chart->getGraphics3D();\r\n $e = $g->getGraphics();\r\n\r\n $r = new Rectangle($this->x0,$this->y0,$this->x1-$this->x0,$this->y1-$this->y0);\r\n\r\n if($this->chart->getParent()!=null) {\r\n if ($this->bBrush != null && $this->bBrush->getVisible()) {\r\n $brushXOR = -1 ^ $this->bBrush->getColor()->getRGB();\r\n $e->setXORMode($this->Color->fromArgb($brushXOR));\r\n $e->fillRect($this->x0, $this->y0, $this->x1 - $this->x0, $this->y1 - $this->y0);\r\n\r\n if ($this->pen!= null && $this->pen->getVisible()) {\r\n $penXOR = -1 ^ $this->pen->getColor()->getRGB();\r\n $e->setXORMode($this->Color->fromArgb($penXOR));\r\n $e->drawRect($this->x0-1,$this->y0-1,$this->x1+1-$this->x0,$this->y1+1-$this->y0);\r\n }\r\n }\r\n else if($this->pen!= null && $this->pen->getVisible()) {\r\n $this->chart->invalidate();\r\n $g->setPen($this->getPen());\r\n $g->getBrush()->setVisible(false);\r\n $g->rectangle($r);\r\n $g->getBrush()->setVisible(true);\r\n }\r\n else {\r\n $this->chart->invalidate();\r\n $tmpColor = new Color();\r\n $tmpLineCap = new LineCap();\r\n $tmpDashStyle = new DashStyle();\r\n $g->setPen(new ChartPen($this->chart, $tmpColor->BLACK, true, 1, $tmpLineCap->BEVEL, $tmpDashStyle->DASH));\r\n $g->getBrush()->setVisible(false);\r\n $g->rectangle($r);\r\n $g->getBrush()->setVisible(true);\r\n }\r\n }\r\n }", "function render() {\n jincimport(\"graphics.gchart\");\n jincimport(\"graphics.gimage\");\n $chart = new GChart($this->get('legend'), 700, 200);\n $chart->addLine($this->get('values'));\n $chart->setXMargin(25);\n $chart->setYMargin(25);\n $chart->setGridColor(192, 192, 192);\n\n $c = new GImage(750, 250);\n $c->display($chart);\n $c->close();\n }", "function planViewGraph(){\n \n // Get Patient Id.\n $patient_id = $this->value('patient_id');\n $data = $this->getPlanViewData($patient_id);\n $graphdate = $this->getPlanViewData($patient_id,true); \n \n /*$data = array( \n '1' => 5,\n '2' => 15,\n '3' => 9,\n '4' => 20,\n '5' => 8,\n '6' => 3 ,\n '7' => 7,\n '8' => 2,\n );*/\n \n // creates graph object\n $graph = new DashboardGraph(190,260);\n \n // set titles\n $graph->setGraphTitles('Video & Article Views', 'Week of', 'Frequency');\n\n // set format of number on Y axe\n $graph->setYNumberFormat('integer');\n\n // set number of ticks on Y axe\n $graph->setYTicks(10);\n\n // set data\n $graph->setData($data);\n\n $graph->setBackgroundColor(array(255, 255, 255));\n $graph->setBarsColor(array(45, 101, 142));\n\n $graph->setTextColor(array(0, 0, 0));\n\n // set orientation of text on X axe\n $graph->setXTextOrientation('horizontal');\n\n // prepare image\n $graph->drawImage();\n\n // Map data\n if( $this->value('map') == '1' ){\n \n $mapstr = '<map name=\"planViewMap\">';\n foreach( $graph->barValue as $key => $value ){\n if( empty($value['value']) || $value['value'] == '' ){\n $value['value'] = '0';\n }\n if( !empty($graphdate[$key]) ){\n if( $value['value'] == '0' ){\n $value['x1'] = $value['x1'] + 3;\n $value['y1'] = $value['y1'] + 3;\n } \n $mapstr .= \"<area shape='rect' coords='{$value['x1']},{$value['y1']},{$value['x2']},{$value['y2']}' alt='{$value['value']} : {$graphdate[$key]}' title='{$value['value']} : {$graphdate[$key]}' href='#' />\";\n }\n \n }\n $mapstr .= '</map>';\n echo $mapstr;\n return $mapstr; \n }\n \n // print image to the screem\n $graph->printImage();\n }", "function function_displayWindDirectionGraph(){\n\t// Dataset definition\n\t$DataSet = new pData;\n\t$DataSet->ImportFromCSV(\"./recordings324.csv\",\",\",array(4),FALSE,0);\n\t$DataSet->AddAllSeries();\n\t$DataSet->SetAbsciseLabelSerie();\n\t$DataSet->SetSerieName(\"Wind Direction\",\"Serie4\");\n\t$DataSet->SetYAxisName(\"Wind Direction\");\n\t$DataSet->SetYAxisUnit(\"deg\");\n\t$DataSet->SetXAxisName(\"Date Time\");\n\n\t// Initialise the graph\n\t$Test = new pChart(850,390);\n\t$Test->setFontProperties(\"../tahoma.ttf\",8);\n\t$Test->setGraphArea(60,30,750,300);\n\t$Test->drawFilledRoundedRectangle(7,7,830,350,5,240,240,240);\n\t$Test->drawRoundedRectangle(5,5,830,350,5,230,230,230);\n\t$Test->drawGraphArea(255,255,255,TRUE);\n\t$Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,150,150,150,TRUE,0,2);\n\t$Test->drawGrid(4,TRUE,230,230,230,50);\n\n\t// Draw the 0 line\n\t$Test->setFontProperties(\"../tahoma.ttf\",6);\n\t$Test->drawTreshold(0,143,55,72,TRUE,TRUE);\n\n\t// Draw the line graph\n\t$Test->drawLineGraph($DataSet->GetData(),$DataSet->GetDataDescription());\n\t$Test->drawPlotGraph($DataSet->GetData(),$DataSet->GetDataDescription(),3,2,255,255,255);\n\n\t// Finish the graph\n\t$Test->setFontProperties(\"../tahoma.ttf\",8);\n\t$Test->drawLegend(760,20,$DataSet->GetDataDescription(),255,255,255);\n\t$Test->setFontProperties(\"../tahoma.ttf\",10);\n\t$Test->drawTitle(60,22,\"BENTO box last 24 Measurements of WIND DIRECTION\",50,50,50,585);\n\t$Test->Render(\"bentoWindDirectionGraph.png\");\n\treturn;\n}", "protected function generateGraphic() {}", "function outcomeLineGraph(){\n \n // Get Patient Id.\n\t\t\t\t$patient_id = $this->value('patient_id');\n\t\t\t\t$type = $this->value('type');\n\t\t\t\t$data = $this->getDataNew($patient_id, $type);\n\t\t\t\t$graphdate = $this->getDataNew($patient_id, $type, true);\n\t\t\t\t// Get OSW Score\n\t\t\t\t$scoreOSW = $this->getLineGraphScore(1,$patient_id);\n\t\t\t\t// Get pain scale Score\n\t\t\t\t$scorePS = $this->getLineGraphScore(7,$patient_id);\n\t\t\t\t// Get FABQ1 & FABQ2 Score\n\t\t\t\t$scoreFABQ = $this->getLineGraphScore(4,$patient_id);\n\t\t\t\tforeach($scoreFABQ as $value){\n\t\t\t\t\t\tif( is_null($value['score']) ){\n\t\t\t\t\t\t\t$scoreFABQA[] = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tif( is_numeric($value['score']) ){\n\t\t\t\t\t\t\t\t$scoreFABQA[] = $value['score'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t$scoreFABQA[] = -1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif( is_null($value['score2']) ){\n\t\t\t\t\t\t\t$scoreFABQW[] = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tif( is_numeric($value['score2']) ){\n\t\t\t\t\t\t\t\t$scoreFABQW[] = $value['score2'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t$scoreFABQW[] = -1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t$scoreFABQDate[] = $value['submited_on'];\n\t\t\t\t}\t\t\t\t\n\t\t\t\t// creates graph object\n\t\t\t\t$chart = new graph(290,235); \n\t\t\t\t$chart->parameter['path_to_fonts'] = 'font/'; \t\t\t\t\t// path to where fonts are stored\n\t\t\t\t$chart->parameter['title'] = '';\n\t\t\t\t$chart->parameter['x_label'] = '# of Assessments Taken';\t\t// X-Axis Lavel\n\t\t\t\t$chart->parameter['y_label_left'] = 'Functional Score';\t\t\t// Y-Axis Lavel\n\t\t\t\t$chart->parameter['inner_border_type'] = 'axis';\t\t\t\t// Border X,Y-Axis\n\t\t\t\t$chart->parameter['y_ticks_colour'] = '';\t\t\t\t\t\t// Y-Axis ticks\n\t\t\t\t$chart->parameter['x_ticks_colour'] = '';\t\t\t\t\t\t// X-Axis ticks\n\t\t\t\t$chart->parameter['label_colour'] = 'green';\t\t\t\t\t// X and Y-Axis color\n\t\t\t\t$chart->parameter['y_grid'] = '';\t\t\t\t\t\t\t\t// Y- Axis Grid line\n\t\t\t\t$chart->parameter['axis_colour'] = 'black';\t\t\t\t\t\t// colour of axis text\n\t\t\t\t$chart->parameter['y_min_left'] = 0; \t\t\t\t\t\t\t// start at 0\n\t\t\t\t$chart->parameter['y_max_left'] = 100; \t\t\t\t\t\t\t// and go to 50\n\t\t\t\t$chart->parameter['y_decimal_left'] = 0; \t\t\t\t\t\t// 0 decimal places for y axis.\n\t\t\t\t//$chart->parameter['y_axis_gridlines'] = 11;\n\t\t\t\t$chart->parameter['point_size'] = 4;\n\t\t\t\t$chart->parameter['y_resolution_left']= 1;\n\t\t\t\t$chart->parameter['y_decimal_left']= 0;\n\t\t\t\t$chart->parameter['axis_size'] = '9.6';\n\t\t\t\t$chart->parameter['axis_font'] = 'consolab.ttf';\n\t\t\t\t\n\t\t\t\t$chart->x_data = array(1,2,3,4,5,6,7,8,9,10);\t// X-Axis parameters\n\t\t\t\t\n\t\t\t\t$arrayLines=array('fabqa','fabqw');\n\t\t\t\t\n\t\t\t\t$arr = array($scoreFABQA,$scoreFABQW);\n\t\t\t\t\n\t\t\t\t$arrDate = array($scoreFABQDate,$scoreFABQDate);\n\t\t\t\t\n\t\t\t\t$counter=0;\n\t\t\t\tforeach ($arrayLines as $value) {\n\t\t\t\t\t\n\t\t\t\t\t$chart->y_data[$value] = array($arr[$counter][0], $arr[$counter][1], $arr[$counter][2], $arr[$counter][3], $arr[$counter][4], $arr[$counter][5], $arr[$counter][6], $arr[$counter][7], $arr[$counter][8], $arr[$counter][9], $arr[$counter][10]);\n\t\t\t\t\t\n\t\t\t\t\t$chart->y_scoreDate[$value] = array($arrDate[$counter][0], $arrDate[$counter][1], $arrDate[$counter][2], $arrDate[$counter][3], $arrDate[$counter][4], $arrDate[$counter][5], $arrDate[$counter][6], $arrDate[$counter][7], $arrDate[$counter][8], $arrDate[$counter][9], $arrDate[$counter][10]);\n\t\t\t\t\t$counter++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$chart->y_format['fabqa'] =\n\t\t\t\t array('colour' => 'green', 'line' => 'line', 'point' => 'square');\n\t\t\t\t\n\t\t\t\t$chart->y_format['fabqw'] =\n\t\t\t\t array('colour' => 'black', 'line' => 'line', 'point' => 'square');\n\t\t\t\t \n\t\t\t\t// order in which to draw data sets.\n\t\t\t\t$chart->y_order =$arrayLines;\n\t\t\t\t\n\t\t\t\t// Map Type\n\t\t\t\tif( $this->value('map') == '4' ){\n\t\t\t\t// Show map\n\t\t\t\t$chart->drawAreaTag();\n\t\t\t\t$chart->getxy();\n\t\t\t\t\tforeach( $chart->valuesAll as $key => $value ){ \n\t\t\t\t if( $value[4] == -1){\n\t\t\t\t\tcontinue;\n\t\t\t\t }\n\t\t\t\t\t$mapstr .= \"<area shape='rect' coords='{$value[0]},{$value[1]},{$value[2]},{$value[3]}' alt='Score $value[4] : {$value[5]}' title='Score $value[4] : {$value[5]}' href='#' />\";\n\t\t\t\t}\n\t\t\t\t\techo $mapstr;\n\t\t\t\t\treturn $mapstr; \n\t\t\t\t}\n\t\t\t\t// print image to the screem\n\t\t\t\t$chart->draw();\t\t\t\n }", "public function draw()\n {\n $this->drawingAPI->draw($this->x,$this->y,$this->radius);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Get all itemused count
function get_all_itemused_count() { $this->db->from('items'); return $this->db->count_all_results(); }
[ "public function getItemsCount();", "public function get_num_items();", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "public function itemCount()\n {\n $response = $this->getServiceLocator()->get('Omeka\\ApiManager')\n ->search('items', [\n 'owner_id' => $this->id(),\n 'limit' => 0,\n ]);\n return $response->getTotalResults();\n }", "public function item_count(){\n\t\t$count = 0;\n\t\tforeach ($this->items as $v) $count += $v['quantity'];\n\t\treturn $count;\n\t}", "public function totalUniqueItems()\n {\n return $this->totalItems(true);\n }", "public function countItems() {\n return $this->client->zCount(Utils::getConfig('storage_key_leaderboard'), 0, PHP_INT_MAX);\n }", "public function getStItemsCount()\n {\n return $this->count(self::STITEMS);\n }", "public function getItemIdsCount()\n {\n return $this->count(self::_ITEM_IDS);\n }", "public function totalItems()\n {\n // This will query the ItemTable for a count of all items associated with\n // the item type\n return $this->getDb()->getTable('Item')->count(array('type' => $this->id));\n }", "public function getItemCount()\n {\n return $this->get(self::_ITEM_COUNT);\n }", "public function getItemInfoCount()\n {\n return $this->count(self::_ITEM_INFO);\n }", "public function countAllInUse();", "public function getTotalItems(): int\n {\n return $this->dataReader->count();\n }", "public function totalUniqueItems()\n {\n return count($this->items);\n }", "public function getItemNumCount()\n {\n return $this->count(self::ITEM_NUM);\n }", "public function getStShopItemsCount()\n {\n return $this->count(self::STSHOPITEMS);\n }", "public function getTotalOfItemsAdmin()\n {\n $sql = 'SELECT COUNT(id) AS counter FROM extended_cards\n WHERE bin != \"yes\"\n ';\n $this->items_count = $this->dbConnect($sql);\n $items = $this->items_count->fetch(\\PDO::FETCH_ASSOC);\n $number_of_items = $items['counter'];\n return $number_of_items;\n }", "public function getTotalCount() {\n\t\t$count = 0;\n\t\tforeach ($this->items as $item){\n\t\t\t$count += $item->getQuantity();\n\t\t}\n\t\treturn $count;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test if mux files are properly converted to .ogg files
public function testDecodeSimple() { $src = file_get_contents('test_samples/whoosh-3.mux'); $MuxConverter = new askuri\MuxConvert\MuxConvert($src); $decoded = $MuxConverter->mux2ogg(); // file_put_contents('converted.ogg', $decoded); $this->assertEquals(md5($decoded), '4af235e0f627d967a8110d4162294384'); }
[ "private function _isOggVorbis($fileName, $mime)\n {\n if ($mime == self::MIME_CONTENT_TYPE_OGG \n && strpos($this->_getFileType($fileName), 'Vorbis audio') !== false)\n {\n $this->_detectedMime = \"application/ogg\";\n return true;\n }\n }", "public function testCodecTypeMustBeAudioOrVideo()\n {\n $result = $this->sonus->codec('test', 'test');\n $expected = false;\n $this->assertTrue($result == $expected);\n }", "public function test_type_and_formats_from_upload_path_and_uploaded_file_for_ogv() {\n list($format_type, $formats) = $this->_cut->type_and_formats_from_upload_path_and_uploaded_file(\n __DIR__ . '/video/',\n 'Chrome_ImF.ogv'\n );\n $this->assertSame('video', $format_type);\n $this->assertSame('m4v,ogv,webmv', $formats);\n }", "function is_movie($filename){\n\n\t$ext=strtolower(substr($filename, strrpos($filename, \".\") +1));\n\tif( $ext == 'mp4'\n\t\t|| $ext == 'ogg' \n\t\t|| $ext == 'webm'){\n\n\t\treturn true;\n\t\texit();\n\t}else{\n\t\treturn false;\n\t\texit();\n\t}\n\n\treturn false;\n\texit();\n}", "public function testMedia()\n {\n $file3Media = getMaxFilesInDir($this->package3, 'ppt/media');\n $mergedMedia = getMaxFilesInDir($this->package, 'ppt/media');\n $this->assertEqual(\n $file3Media, $mergedMedia,\n 'Media in two files did not get merged properly'\n );\n }", "public function isAudioFile() {\n return ($this->mime_type == 'audio/mpeg') || ($this->mime_type == 'audio/ogg') || ($this->mime_type == 'audio/wav');\n }", "public function testBitrateTypeMustBeAudioOrVideo()\n {\n $result = $this->sonus->codec('128', 'sound');\n $expected = false;\n $this->assertTrue($result == $expected);\n }", "function enclosureIsMP3($mime){\n\t$audio = array('audio/mp3','audio/mp4','audio/mpeg','audio/mpeg3','audio/mpegaudio','audio/mpg','audio/x-mp3','audio/x-mp4','audio/x-mpeg','audio/x-mpeg3','audio/x-mpegaudio','audio/x-mpg','audio/x-mp3','audio/x-mp4','audio/x-mpeg','audio/x-mpeg3','audio/x-mpegaudio','audio/x-mpg');\n\t$test = in_array($mime,$audio);\n\treturn $test;\n}", "public function testWavManipulatorCanConvertToMp3()\n {\n $this->assertIsArray(\n $this->wavManipulator->converter->toMp3(\n $this->wavManipulator->getFile(),\n $this->tmpDir.'foo.mp3'\n )\n );\n }", "public function testWavManipulatorCanConvertToFlac()\n {\n $this->assertIsArray(\n $this->wavManipulator->converter->toFlac(\n $this->wavManipulator->getFile(),\n $this->tmpDir.'foo.flac'\n )\n );\n }", "function tryphon_source_ogg($src){\n\t$url_mp3 = tryphon_url_detokenize($src);\n\tif (preg_match(\",https?://audiobank.tryphon.(?:org|eu)/casts/.*([.]mp3)?$,Uims\",$url_mp3,$m)){\n\t\t$url_ogg = substr($url_mp3,0,-4).\".ogg\";\n\t\tif ($url_mp3==$src)\n\t\t\treturn $url_ogg;\n\t\telse\n\t\t\treturn tryphon_url_tokenize($url_ogg);\n\t}\n\n\treturn \"\";\n}", "function VerifyImg($files) {\n $valid = FALSE;\n $extensions = array(\"jpeg\", \"jpg\", \"gif\", \"png\", \"mp4\", \"mp3\");\n $elementsChemin = pathinfo($files['upload']['name']);\n $extensionFichier = $elementsChemin['extension'];\n if ((in_array($extensionFichier, $extensions))) {\n $valid = TRUE;\n }\n return $valid;\n}", "protected function inMediaLibrary()\n {\n return 'upload' == basename( $_SERVER[\"SCRIPT_FILENAME\"], '.php' );\n }", "public function testKnowsFormats()\n {\n $this->assertTrue(FileFormat::isKnownFormat(FileFormat::TEX));\n $this->assertTrue(FileFormat::isKnownFormat(FileFormat::PDF));\n $this->assertTrue(FileFormat::isKnownFormat(FileFormat::AUXILIARY));\n $this->assertFalse(FileFormat::isKnownFormat('!!!'));\n $this->assertFalse(FileFormat::isKnownFormat('^$'));\n $this->assertFalse(FileFormat::isKnownFormat('.tex'));\n $this->assertFalse(FileFormat::isKnownFormat('...'));\n }", "public function transcodeOgg($path, $albumId, $mp3File) {\n if (strrpos(strtolower($mp3File), '.mp3') == strlen($mp3File)-4) {\n if ($albumId != null) {\n $path = $this->_appendAlbumIdToPath($path, $albumId);\n }\n \n\t if (!$this->_isSoXAvailable()) {\n\t throw new Mage_Core_Exception(\"Mytunes Exception: Sox command line tool is not available.\");\n\t }\n\n $oggFile = substr($mp3File, 0, -4) . '.ogg';\n // build sox command\n // @see http://sox.sourceforge.net/sox.html\n $command = Mage::getStoreConfig('mytunes_settings/sox/binary');\n // override existing output file without asking\n $command .= \" --clobber\";\n // sox verbosity V1 > show errors | V0 > show nothing\n $command .= \" -V0\";\n // input mp3 file\n $command .= \" \" . $this->getFilePath($path, $mp3File);\n // output mp3 sample file\n $command .= \" \" . $this->getFilePath($path, $oggFile);\n \n $output = array(); $returnStatus = -1;\n exec($command, $output, $returnStatus);\n\n return $returnStatus == 0;\n }\n return false;\n }", "public function test_post_wrong_file_types(){\n global $DB;\n\n // create a user\n $user = $this->getDataGenerator()->create_user();\n\n // create a course\n $course = $this->getDataGenerator()->create_course();\n\n // create a course module\n $videoquanda = $this->getDataGenerator()->create_module('videoquanda', array(\n 'course' => $course->id\n ));\n\n // enrol the user on the course\n $this->getDataGenerator()->enrol_user($user->id, $course->id, $DB->get_field('role', 'id', array(\n 'shortname' => 'student',\n )));\n\n // login the user\n $this->setUser($user);\n\n $client = new Client($this->_app);\n $client->request('GET', \"/manage/\" . $videoquanda->cmid);\n\n // Todo: Mock videofile?\n }", "function checkMedia( &$file )\r\n {\r\n if ( is_a( $file, \"eZMediaFile\" ) )\r\n {\r\n $name = $file->tmpName();\r\n return true;\r\n }\r\n return false;\r\n }", "function checkFFMPEG()\n{\n @exec('ffmpeg -version 2>&1', $output, $returnvalue);\n if ($returnvalue === 0) {\n return 'ffmpeg';\n }\n @exec('avconv -version 2>&1', $output, $returnvalue);\n if ($returnvalue === 0) {\n return 'avconv';\n }\n\n return false;\n}", "function SERVICE_IS_RESAMPLABLE($file){\n\t\t\n\t\t// Ok, let's check the file extension and see if we can resample it\n\t\t//Now let's figure out the file type\n\t\t$extArr = explode(\".\",$file);\n\t\t$ext = $extArr[count($extArr)-1];\n\t\t\n\t\tswitch ($ext){\n\t\t\tcase \"mp3\":\n\t\t\tcase \"flac\":\n\t\t\tcase \"mpc\":\n\t\t\tcase \"wv\":\n\t\t\tcase \"ogg\":\n\t\t\tcase \"wav\":\n\t\t\tcase \"wma\":\n\t\t\tcase \"ra\":\n\t\t\tcase \"ram\":\n\t\t\tcase \"rm\":\n\t\t\tcase \"m4a\":\n\t\t\t return true;\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t return false;\n\t\t\tbreak;\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get Source Items Data without Default Source by SKU
protected function getSourceItems($sku) { $searchCriteriaBuilder = $this->searchCriteriaBuilderFactory->create(); $searchCriteriaBuilder->addFilter(SourceItemInterface::SKU, $sku); $searchCriteria = $searchCriteriaBuilder->create(); $this->sourceItemRepository = $this->objectManager->create( SourceItemRepositoryInterface::class ); $sourceItems = $this->sourceItemRepository->getList($searchCriteria)->getItems(); $sourceItemData = []; if ($sourceItems) { foreach ($sourceItems as $sourceItem) { $sourceItemData[] = [ SourceItemInterface::SKU => $sourceItem->getSku(), SourceItemInterface::SOURCE_CODE => $sourceItem->getSourceCode(), SourceItemInterface::QUANTITY => $sourceItem->getQuantity(), SourceItemInterface::STATUS => $sourceItem->getStatus() ]; } } return $sourceItemData; }
[ "private function getSourceItemList()\n {\n /** @var SearchCriteriaBuilder $searchCriteria */\n $searchCriteriaBuilder = $this->searchCriteriaBuilderFactory->create();\n\n $searchCriteriaBuilder->addFilter(\n SourceItemInterface::SKU,\n 'example_simple_for_source_item'\n );\n\n $searchCriteriaBuilder->addFilter(\n SourceItemInterface::SOURCE_CODE,\n $this->defaultSourceProvider->getCode()\n );\n\n /** @var SearchCriteria $searchCriteria */\n $searchCriteria = $searchCriteriaBuilder->create();\n\n return $this->sourceItemRepository->getList($searchCriteria);\n }", "public function getItemName() {\n $items = \\common\\models\\ItemMaster::find()->where(['status' => 1])->all();\n $source;\n foreach ($items as $value) {\n $source[] = $value->SKU;\n }\n return $source;\n }", "function getSupplierItems();", "public function getAssignedSources(): array\n {\n $skus = $this->bulkSessionProductsStorage->getProductsSkus();\n $sourceCodes = $this->getSourceCodesBySkus->execute($skus);\n\n $searchCriteria = $this->searchCriteriaBuilder\n ->addFilter(\n SourceItemInterface::SOURCE_CODE,\n $sourceCodes,\n 'in'\n )\n ->create();\n\n return $this->sourceRepository->getList($searchCriteria)->getItems();\n }", "public function getPurchasedItems();", "abstract protected function getExportedProductsSkus();", "function getProductDetails($SKU) {\n}", "function getUniqueSources(){\n\n\t\t$sqlUniqueSource=\"SELECT DISTINCT(s.source), s.url FROM ex_source s, daily_feed d where s.item_type='18' and d.is_live='1' and d.is_approved='1' and d.id=s.item_id AND s.source!='' ORDER BY source ASC \";\n \t\t$resUniqueSource=exec_query($sqlUniqueSource);\n \t\treturn $resUniqueSource;\n \t}", "public function getSourceItem() {\n return get_record_by_id('Item', $this->source_item_id);\n }", "public function getItemSkus()\n {\n $items = $this->getAllItems();\n $skus = array();\n foreach($items as $item) {\n $skus[] = $item->getSku();\n }\n if(count($skus) <= 1) {\n $skus = $skus[0];\n }\n return $skus;\n }", "function getinventoryHostbillitems(){\r\n \r\n $sql=\"Select ItemID,Sku,description,product_source, ref_id,sell_price FROM inv_items where product_source='hostbill'\";\r\n\treturn $res = $this->query($sql, 1);\r\n }", "public function getBySku($sku);", "public function fetchDataTableSource()\n { \n $dataTableConfig = [\n 'searchable' => [\n 'title' \n ]\n ];\n\n return SpecificationPreset::with([\n 'presetItem' => function($query) {\n $query->with('specification');\n }\n ])->dataTables($dataTableConfig)->toArray();\n }", "function load_by_sku ($sku) {\n\t\tif (!empty($sku)) {\n\t\t\treturn $this->load_query(LOAD_ITEM_BY_SKU,array($sku));\n\t\t} else\n\t\t\treturn false;\n\t}", "public static function getCacheSkusProduct()\n {\n $skus = Cache::get('SkuProduct');\n\n //disabled because should be generated in Saga daemons\n if (\\App::environment() == 'development') {\n if (!$skus) {\n $products = OdinProduct::all();\n\n $skus = [];\n foreach ($products as $product) {\n foreach($product->skus as $sku) {\n $skus[$sku['code']]['name'] = $sku['name'];\n $skus[$sku['code']]['product_id'] = $product->id;\n $skus[$sku['code']]['product_name'] = $product->product_name;\n $skus[$sku['code']]['unit_qty'] = $product->unit_qty ?? 1;\n }\n }\n\n Cache::put('SkuProduct', $skus, 600);\n }\n }\n return $skus;\n }", "protected function fetchSources() {\n\t\t$sources = array();\n\t\tif (!empty($this->settings['sources'])) {\n\t\t\tforeach ($this->settings['sources'] as $sourceKey => $sourceSetup) {\n\t\t\t\t$sourceSetup->sourceKey = $sourceKey;\n\t\t\t\tif ($sourceSetup['type'] === 'sql' && $this->sqlSourceExists($sourceSetup)) {\n\t\t\t\t\t$sources[] = $this->componentManager->getComponent('F3_Contentparser_Repository_Source_SQL', $sourceSetup);\n\t\t\t\t} elseif ($sourceSetup['type'] === 'soap') {\n\t\t\t\t\t$sources[] = $this->componentManager->getComponent('F3_Contentparser_Repository_Source_SOAP', $sourceSetup);\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t}\n\t\treturn $sources;\n\t}", "public function getFullFundingSources(){\n\t\t$connection=Database::getConnection();\n\t\t$query=\"SELECT * FROM fundingsource\";\n\t\t$items=\"\";\n\t\t$result_obj=$connection->query($query);\n\t\ttry{\n\t\t\twhile($result = $result_obj->fetch_array(MYSQLI_ASSOC)){\n\t\t\t\t$items[]=$result;\n\t\t\t}\n\t\t\treturn($items);\n\t\t}\n\t\tcatch(Exception $e){\n\t\t\treturn false;\n\t\t}\n\t}", "function getDataSources();", "protected function _getSources() {\n\t\treturn ConnectionManager::sourceList();\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create request for operation 'auEmployingEntityGetEmployingEntities'
public function auEmployingEntityGetEmployingEntitiesRequest($business_id, $query = null, $filter = null, $orderby = null, $top = null, $skip = null, string $contentType = self::contentTypes['auEmployingEntityGetEmployingEntities'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $business_id when calling auEmployingEntityGetEmployingEntities' ); } $resourcePath = '/api/v2/business/{businessId}/employingentity'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $filter, '$filter', // param base name 'string', // openApiType '', // style false, // explode false // required ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $orderby, '$orderby', // param base name 'string', // openApiType '', // style false, // explode false // required ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $top, '$top', // param base name 'integer', // openApiType '', // style false, // explode false // required ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $skip, '$skip', // param base name 'integer', // openApiType '', // style false, // explode false // required ) ?? []); // header params if ($query !== null) { $headerParams['query'] = ObjectSerializer::toHeaderValue($query); } // path params if ($business_id !== null) { $resourcePath = str_replace( '{' . 'businessId' . '}', ObjectSerializer::toPathValue($business_id), $resourcePath ); } $headers = $this->headerSelector->selectHeaders( ['application/json', 'text/json', 'application/xml', 'text/xml', ], $contentType, $multipart ); // for model (json/xml) if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, 'contents' => $formParamValueItem ]; } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires API key authentication $apiKey = $this->config->getApiKeyWithPrefix('apiKey'); if ($apiKey !== null) { $headers['apiKey'] = $apiKey; } $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } $headers = array_merge( $defaultHeaders, $headerParams, $headers ); $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); }
[ "public function fetchOptInListSourcesCreatedByEmployeeRequest()\n {\n\n $resourcePath = '/v2/employee/optInListSources/all';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "function listRequestByOwner($employeId)\n\t{\n\t\t\n\t}", "public function auEmployingEntityGetRequest($id, $business_id, string $contentType = self::contentTypes['auEmployingEntityGet'][0])\n {\n\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling auEmployingEntityGet'\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 auEmployingEntityGet'\n );\n }\n\n\n $resourcePath = '/api/v2/business/{businessId}/employingentity/{id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n // 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 (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {\n # if Content-Type contains \"application/json\", json_encode the form parameters\n $httpBody = \\GuzzleHttp\\Utils::jsonEncode($formParams);\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('apiKey');\n if ($apiKey !== null) {\n $headers['apiKey'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $operationHost = $this->config->getHost();\n $query = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'GET',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function getEntities()\n {\n return [\n 'method' => 'GET',\n 'path' => 'entities',\n 'params' => [],\n ];\n }", "protected function getConversationEngagementsRequest()\n {\n\n $resourcePath = '/conversation/engagements';\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 // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('x-ultracart-simple-key');\n if ($apiKey !== null) {\n $headers['x-ultracart-simple-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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function getEntities()\n {\n return $this->makeRequest('GET', 'entities');\n }", "public function createEmployeeArray($request){\n return array(\n 'first_name' => $request->first_name,\n 'last_name' => $request->last_name,\n 'email'\t\t\t => $request->email,\n 'phone'\t\t\t => $request->phone,\n 'company_id' => $request->company_id\n );\n }", "public function gETAuthorizationsRequest()\n {\n\n $resourcePath = '/authorizations';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function auEmployingEntityPostRequest($business_id, $employing_entity, string $contentType = self::contentTypes['auEmployingEntityPost'][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 auEmployingEntityPost'\n );\n }\n\n // verify the required parameter 'employing_entity' is set\n if ($employing_entity === null || (is_array($employing_entity) && count($employing_entity) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $employing_entity when calling auEmployingEntityPost'\n );\n }\n\n\n $resourcePath = '/api/v2/business/{businessId}/employingentity';\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\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($employing_entity)) {\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($employing_entity));\n } else {\n $httpBody = $employing_entity;\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 getEmployees() {\n\n /* Fetch all included employee IDs */\n $employeeIDs = $this->getIncludedEmployeeIDs();\n\n\n /* Set orWhereIn variables */\n array_push($this->whereIn, [\n 'column' => 'employee_id',\n 'array' => $employeeIDs\n ]);\n }", "public function getAllEmployees();", "public function createExemption() {\n\t\t\t\t//Build create exemption json.\n $jsonString = '{\n\t\t\t\t \"Exemption\": {\n\t\t\t\t\t\"CustomerReference\": \"Sample Customer 45\",\n\t\t\t\t\t\"ExemptionReference\": \"Sample Exemption 45\",\n\t\t\t\t\t\"StartDate\": \"2014-01-13T00:00:00\",\n\t\t\t\t\t\"EndDate\": \"2015-01-13T00:00:00\",\n\t\t\t\t\t\"ExemptedStateCodes\": {\n\t\t\t\t\t \"StateCode\": [\n\t\t\t\t\t\t\"CA\",\n\t\t\t\t\t\t\"CO\"\n\t\t\t\t\t ]\n\t\t\t\t\t},\n\t\t\t\t\t\"ExemptionRate\": \"0.5\",\n\t\t\t\t\t\"SKUCode\": \"genMerch\",\n\t\t\t\t\t\"BusinessType\": \"Construction\",\n\t\t\t\t\t\"ExemptionReason\": \"other\"\n\t\t\t\t }\n\t\t\t\t}';\n \n\t\t\t\t//Replace ENTITY_ID placeholder with your actual entity id below. \n $curl = curl_init($this->URL.'entity/STX-02199-00/exemption/create');\n \n\t\t\t\t//Set other options for the call.\n curl_setopt($curl, CURLOPT_HTTPHEADER, $this->multiHeaders);\n curl_setopt($curl, CURLOPT_POST, 1);\n curl_setopt($curl, CURLOPT_POSTFIELDS, $jsonString);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n \n\t\t\t\t//Make the call and then close the connection\n $response = curl_exec($curl);\n\t\t\t\tprint \"\\n\\nCreate Exemption Response::\\n\".$response;\n curl_close($curl);\n }", "public function employeeDetailsGetEmployeesRequest($business_id, $query = null, $filter = null, $orderby = null, $top = null, $skip = null, string $contentType = self::contentTypes['employeeDetailsGetEmployees'][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 employeeDetailsGetEmployees'\n );\n }\n\n\n\n\n\n\n\n $resourcePath = '/api/v2/business/{businessId}/employee/details';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(\n $filter,\n '$filter', // param base name\n 'string', // openApiType\n '', // style\n false, // explode\n false // required\n ) ?? []);\n // query params\n $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(\n $orderby,\n '$orderby', // param base name\n 'string', // openApiType\n '', // style\n false, // explode\n false // required\n ) ?? []);\n // query params\n $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(\n $top,\n '$top', // param base name\n 'integer', // openApiType\n '', // style\n false, // explode\n false // required\n ) ?? []);\n // query params\n $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(\n $skip,\n '$skip', // param base name\n 'integer', // openApiType\n '', // style\n false, // explode\n false // required\n ) ?? []);\n\n // header params\n if ($query !== null) {\n $headerParams['query'] = ObjectSerializer::toHeaderValue($query);\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 (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {\n # if Content-Type contains \"application/json\", json_encode the form parameters\n $httpBody = \\GuzzleHttp\\Utils::jsonEncode($formParams);\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('apiKey');\n if ($apiKey !== null) {\n $headers['apiKey'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $operationHost = $this->config->getHost();\n $query = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'GET',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function editEntity() {\n header(\"Content-Type: application/json\");\n if ($this->auth->isAllowed('list_employees') == FALSE) {\n $this->output->set_header(\"HTTP/1.1 403 Forbidden\");\n } else {\n $entityId = $this->input->post('entity', TRUE);\n $employees = $this->input->post('employees', TRUE);\n $objectEmployees = json_decode($employees);\n $this->load->model('users_model');\n $result = $this->users_model->updateEntityForUserList($entityId, $objectEmployees);\n echo $result;\n }\n }", "public function getEnterprise();", "public function editEntitlements() {\n if ($this->auth->isAllowed('entitleddays_user') == FALSE) {\n $this->output->set_header(\"HTTP/1.1 403 Forbidden\");\n } else {\n $employees = $this->input->post('employees', TRUE);\n $startdate = $this->input->post('startdate', TRUE);\n $enddate = $this->input->post('enddate', TRUE);\n $days = $this->input->post('days', TRUE);\n $type = $this->input->post('type', TRUE);\n $description = sanitize($this->input->post('description', TRUE));\n if (isset($startdate) && isset($enddate) && isset($days) && isset($type) && isset($employees)) {\n $this->load->model('entitleddays_model');\n $objectEmployees = json_decode($employees);\n foreach ($objectEmployees->employeeIds as $user_id) {\n $id = $this->entitleddays_model->addEntitledDaysToEmployee((int) $user_id, $startdate, $enddate, $days, $type, $description);\n echo $id . ',';\n }\n } else {\n $this->output->set_header(\"HTTP/1.1 422 Unprocessable entity\");\n }\n }\n }", "public function auEssEmployeeFeaturesRequest($employee_id, string $contentType = self::contentTypes['auEssEmployeeFeatures'][0])\n {\n\n // verify the required parameter 'employee_id' is set\n if ($employee_id === null || (is_array($employee_id) && count($employee_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $employee_id when calling auEssEmployeeFeatures'\n );\n }\n\n\n $resourcePath = '/api/v2/ess/{employeeId}/security/features';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($employee_id !== null) {\n $resourcePath = str_replace(\n '{' . 'employeeId' . '}',\n ObjectSerializer::toPathValue($employee_id),\n $resourcePath\n );\n }\n\n\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml', ],\n $contentType,\n $multipart\n );\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {\n # if Content-Type contains \"application/json\", json_encode the form parameters\n $httpBody = \\GuzzleHttp\\Utils::jsonEncode($formParams);\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('apiKey');\n if ($apiKey !== null) {\n $headers['apiKey'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $operationHost = $this->config->getHost();\n $query = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'GET',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function getAllEmployersByFilter(Request $request, $entityManager, $post = true)\n {\n $employersRepository = $entityManager->getRepository('WorkBundle:Employer');\n if($post == true) {\n $filterData = $request->request->all();\n } else {\n $filterData = $request->query->all();\n }\n if ($filterData) {\n if (!empty($filterData['city']) || !empty($filterData['ageFrom']) || !empty($filterData['ageTo'])\n || !empty($filterData['priceFrom']) || !empty($filterData['priceTo'])\n || !empty($filterData['termFrom']) || !empty($filterData['termTo'])\n || (!empty($filterData['gender']) && $filterData['gender'][0] != 'all')\n || (!empty($filterData['categories']) && $filterData['categories'][0] != 'all')\n ) {\n $whereCondition = '';\n $employerModels = $employersRepository->createQueryBuilder('p');\n if ($filterData['city']) {\n $employerModels->setParameter('city', $filterData['city']);\n $whereCondition .= 'p.city = :city AND ';\n }\n if (!empty($filterData['ageFrom'])) {\n $employerModels->setParameter('ageFrom', $filterData['ageFrom']);\n $whereCondition .= 'p.ageFrom >= :ageFrom AND ';\n }\n if (!empty($filterData['ageTo'])) {\n $employerModels->setParameter('ageTo', $filterData['ageTo']);\n $whereCondition .= 'p.ageTo <= :ageTo AND ';\n }\n if (!empty($filterData['priceFrom'])) {\n $employerModels->setParameter('priceFrom', $filterData['priceFrom']);\n $whereCondition .= 'p.priceFrom >= :priceFrom AND ';\n }\n if (!empty($filterData['priceTo'])) {\n $employerModels->setParameter('priceTo', $filterData['priceTo']);\n $whereCondition .= 'p.priceTo <= :priceTo AND ';\n }\n if (!empty($filterData['gender']) && $filterData['gender'][0] != 'all') {\n $employerModels->setParameter('gender', $filterData['gender'][0]);\n $whereCondition .= 'p.gender = :gender AND ';\n }\n if (!empty($filterData['termFrom'])&&$filterData['termFrom'] != '') {\n $employerModels->setParameter('termFrom', $filterData['termFrom']);\n $whereCondition .= 'p.termFrom <= :termFrom AND ';\n }\n if (!empty($filterData['termFrom'])&&$filterData['termTo'] != '') {\n $employerModels->setParameter('termTo', $filterData['termFrom']);\n $whereCondition .= 'p.termTo >= :termTo AND ';\n }\n if ($whereCondition == '') {\n $employers = $employersRepository->findBy(array(), array('postDate' => 'DESC'));\n } else {\n $employerModels->where(substr($whereCondition, 0, -5))->orderBy('p.postDate', 'DESC');\n $employers = $employerModels->getQuery()->getResult();\n }\n if (isset($filterData['categories']) && $filterData['categories'][0] != 'all') {\n $categoryModel = new Category();\n /** @var \\WorkBundle\\Entity\\Employer $employer */\n foreach ($employers as $key => $employer) {\n foreach($filterData['categories'] as $category) {\n $curCategories = $employer->getCategories()->getValues();\n if(!in_array($categoryModel->find($category, $entityManager), $curCategories)){\n unset($employers[$key]);\n }\n }\n }\n }\n return $employers;\n } else {\n $employerModels = $employersRepository->findBy(array(), array('postDate' => 'DESC'));\n }\n } else {\n $employerModels = $employersRepository->findBy(array(), array('postDate' => 'DESC'));\n }\n return $employerModels;\n }", "protected function defKpiMainentitytypesGetRequest()\n {\n\n $resourcePath = '/def/kpi/mainentitytypes';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires 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 }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns data to be serialized on top of the QTI format. Made of the question's object minus fields that don't have a meaning in another system. Remove question's fields which don't have a meaning in another system. For example question id, user id, etc
protected function get_question_data($question){ //does not have a meaning in another system - ids, user ids, etc unset($question->id); unset($question->category); unset($question->parent); unset($question->createdby); unset($question->modifiedby); unset($question->stamp); unset($question->version); if(isset($question->options)){ unset($question->options->question); if(isset($question->options->subquestions)){ foreach($question->options->subquestions as $q){ unset($q->question); } } } /** * note: @@PLUGINFILE@@ have to be replaced ->before<- the object is serialized. * Doing it after - i.e. after the xml file has been generated - will fail because it changes the length of string */ $question->questiontext = str_replace('@@PLUGINFILE@@', 'resources', $question->questiontext); if(isset($question->generalfeedback)){ $question->generalfeedback = str_replace('@@PLUGINFILE@@', 'resources', $question->generalfeedback); } if(isset($question->options)){ if(isset($question->options->correctfeedback)){ $question->correctfeedback = str_replace('@@PLUGINFILE@@', 'resources', $question->options->correctfeedback); } if(isset($question->options->partiallycorrectfeedback)){ $question->partiallycorrectfeedback = str_replace('@@PLUGINFILE@@', 'resources', $question->options->partiallycorrectfeedback); } if(isset($question->options->incorrectfeedback)){ $question->incorrectfeedback = str_replace('@@PLUGINFILE@@', 'resources', $question->options->incorrectfeedback); } } return $question; }
[ "public function getQuestionInformation()\n {\n $map = $this->_getMap();\n $oldfld = null;\n $result = array();\n\n foreach ($map as $name => $field) {\n if ($field['type'] == self::INTERNAL) {\n continue;\n }\n\n // \\MUtil_Echo::track($field);\n $tmpres = array();\n $tmpres['alwaysHidden'] = $field['hidden'];\n $tmpres['class'] = \\Gems_Tracker_SurveyModel::CLASS_MAIN_QUESTION;\n $tmpres['group'] = $field['gid'];\n $tmpres['groupName'] = $this->removeMarkup($field['group_name']);\n $tmpres['hasConditon'] = $field['hasConditon'];\n $tmpres['type'] = $field['type'];\n $tmpres['title'] = $field['title'];\n if (array_key_exists('equation', $field)) {\n $tmpres['equation'] = $field['equation'];\n }\n\n $oldQid = isset($oldfld['qid']) ? $oldfld['qid'] : 0;\n if ($oldQid !== $field['qid']) {\n $tmpres['question'] = $this->removeMarkup($field['question']);\n }\n\n // Juggle the labels for sub-questions etc..\n if (isset($field['sq_question'])) {\n if (isset($field['sq_question1'])) {\n $field['sq_question'] = sprintf($this->translate->_('%s: %s'), $field['sq_question'], $field['sq_question1']);\n }\n if (! isset($tmpres['question'])) {\n $tmpres['question'] = $this->removeMarkup($field['sq_question']);\n } else {\n $tmpres['answers'] = array(''); // Empty array prevents \"n/a\" display\n\n // Add non answered question for grouping\n $result[$field['title']] = $tmpres;\n\n // \"Next\" question\n $tmpres['question'] = $this->removeMarkup($field['sq_question']);\n }\n $tmpres['class'] = \\Gems_Tracker_SurveyModel::CLASS_SUB_QUESTION;\n }\n $tmpres['answers'] = $this->_getPossibleAnswers($field);\n\n // Title does not have to be unique. So if a title is used\n // twice we only use it for the first result.\n if (isset($field['code']) && (! isset($result[$field['code']]))) {\n $name = $field['code'];\n }\n $result[$name] = $tmpres;\n\n if (isset($field['sgq'])) {\n $result[$name]['id'] = $field['sgq'];\n }\n\n $oldfld = $field;\n }\n // \\MUtil_Echo::track($result);\n\n return $result;\n }", "public static function exportQuizFields(){\n\t\treturn [ \n\t\t\t\"id\", \n\t\t\t\"user_id\", \n\t\t\t\"points\", \n\t\t\t\"date\", \n\t\t\t\"username\" \n\t\t];\n\t}", "public function get_lti_question_form_data_plain() {\n $q = new stdClass();\n $q->name = 'lti-question';\n $q->status = \\core_question\\local\\bank\\question_version_status::QUESTION_STATUS_READY;\n $q->questiontext = array(\n \"text\" => 'Questiontext for Question 1',\n 'format' => FORMAT_HTML,\n 'itemid' => 1\n );\n $q->generalfeedback = array(\n \"text\" => 'I hope your code had a beginning, a middle and an end.',\n 'format' => FORMAT_HTML,\n 'itemid' => 2\n );\n $q->defaultmark = 1;\n $q->penalty = 0.3333333;\n $q->qtype = 'lti';\n $q->length = '1';\n $q->hidden = '0';\n $q->createdby = '2';\n $q->modifiedby = '2';\n $q->questionid = 1;\n $q->unittest = 1;\n $q->course = 1;\n $q->typeid = null;\n $q->toolurl = 'https://tool.org';\n $q->securetoolurl = 'https://tool.org';\n $q->instructorchoicesendname = 1;\n $q->instructorchoicesendemailaddr = 1;\n $q->instructorchoiceallowroster = 1;\n $q->instructorchoiceallowsetting = 1;\n $q->instructorcustomparameters = 1;\n $q->instructorchoiceacceptgrades = 1;\n $q->grade = 1;\n $q->launchcontainer = 1;\n $q->resourcekey = 'key';\n $q->password = 'secret';\n $q->debuglaunch = 0;\n $q->showtitlelaunch = 0;\n $q->showdescriptionlaunch = 0;\n $q->servicesalt = 'salt';\n $q->instancecode = 'somerandominstancecode';\n $q->originalinstancecode = null;\n $q->icon = '';\n $q->secureicon = '';\n\n return $q;\n }", "public function extra_question_fields() {\r\n // Retrieve parent extra fields from shortanswer, like case sensivity and other fields from shortanswer.\r\n //$result = array_diff(parent::extra_question_fields(), array('answers'));// We unset answers fields, because we do not need them\r\n $result = parent::extra_question_fields();\r\n // Replace shortanswer table with our table\r\n $result[0]= 'qtype_correctwriting';\r\n // Language, which will be used for analysis\r\n $result[] = 'langid';\r\n // Penalty for absent lexeme mistake\r\n foreach($this->analyzers() as $value) {\r\n $classname = 'qtype_correctwriting_' . $value;\r\n /** @var qtype_correctwriting_abstract_analyzer $analyzer */\r\n $analyzer = new $classname();\r\n $fields = $analyzer->extra_question_fields();\r\n if (count($fields)) {\r\n foreach($fields as $field) {\r\n $result[] = $field;\r\n }\r\n }\r\n }\r\n // Minimal grade for answer to be approximately matched with student response\r\n $result[] = 'hintgradeborder';\r\n // Maximum fraction of mistakes to length of teacher answer in lexemes\r\n $result[] = 'maxmistakepercentage';\r\n //Penalty for \"what is\" hint.\r\n $result[] = 'whatishintpenalty';\r\n //Penalty for \"where\" text hint.\r\n $result[] = 'wheretxthintpenalty';\r\n //Absent token hints penalty factor\r\n $result[] = 'absenthintpenaltyfactor';\r\n //Penalty for \"where\" picture hint.\r\n $result[] = 'wherepichintpenalty';\r\n\r\n //Is enabled fields\r\n $result[] = 'islexicalanalyzerenabled';\r\n $result[] = 'isenumanalyzerenabled';\r\n $result[] = 'issequenceanalyzerenabled';\r\n $result[] = 'issyntaxanalyzerenabled';\r\n\r\n //Penalty for \"how to fix pic\" picture hint.\r\n $result[] = 'howtofixpichintpenalty';\r\n\r\n\r\n return $result;\r\n }", "function convertQuestionnaireData()\t{\t\t\r\n\t $questionsTmp = t3lib_div::xml2array( $this->questionnaire[\"questions\"] );\r\n\t $this->questionnaire[\"questions\"] = array();\r\n\t if( is_array($questionsTmp) ) {\r\n\t\t foreach( $questionsTmp as $key => $val ) {\r\n\t\t\t$this->questionnaire[\"questions\"][$val[\"uid\"]] = $val ;\r\n\t\t\t if( $val[\"type\"] == \"single\" || $val[\"type\"] == \"multi\" || $val[\"type\"] == \"multi_multi\" ) {\r\n\t\t\t\t $choices = explode( chr(10), $val[\"choices\"]) ;\r\n\t\t\t\t if( ! is_array ($choices) ) {\r\n\t\t\t\t \t$choices = array();\r\n\t\t\t\t }\r\n\t\t\t\t $this->questionnaire[\"questions\"][$val[\"uid\"]][\"choices\"] = $choices ;\r\n\t\t\t }\r\n\t\t }\r\n\t }\r\n\t}", "public function getSerialisedData()\n {\n /* @var $instance DModel */\n $instance = $this->getDecorated();\n $serialisedData = array();\n foreach ($instance->definition->getFields() as $field) {\n /* @var $field DField */\n $this->getSerialisedDataForField($field, $serialisedData);\n }\n // Add additional fields required by sql query.\n $qualifiedName = get_class($instance);\n $serialisedData['id'] = $instance->getId();\n $serialisedData[ DModel::FIELD_QUALIFIED_NAME ] = $qualifiedName;\n $serialisedData['tableName'] = DDatabaseMapper::getTableNameFor($qualifiedName);\n\n return $serialisedData;\n }", "function set_data($question) {\n // You may not need this method at all, in which case you can delete it.\n\n // For example:\n // if (!empty($question->options)) {\n // $question->customfield = $question->options->customfield;\n // }\n parent::set_data($question);\n }", "public static function quizFields(){\n\t\treturn [ \n\t\t\t\"id\", \n\t\t\t\"user_id\", \n\t\t\t\"points\", \n\t\t\t\"date\", \n\t\t\t\"username\" \n\t\t];\n\t}", "public function getSurveyQuestions(){\n $tmp_question=new Question();\n\n $question_heritage_list=$tmp_question->getQuestionByForm(3);\n $question_heritage=$question_heritage_list[0];\n\n $question_relax_list=$tmp_question->getQuestionByForm(4);\n $question_relax=$question_relax_list[0];\n\n $question_sightseeing_list=$tmp_question->getQuestionByForm(5);\n $question_sightseeing=$question_sightseeing_list[0];\n\n $question_weather_list=$tmp_question->getQuestionByForm(6);\n $question_weather=$question_weather_list[0];\n\n $question_populated_list=$tmp_question->getQuestionByForm(7);\n $question_populated=$question_populated_list[0];\n\n $data=['heritage'=>$question_heritage->text,\n 'relax'=>$question_relax->text,\n 'sightseeing'=>$question_sightseeing->text,\n 'populated'=>$question_populated->text,\n 'weather'=>$question_weather->text\n ];\n echo json_encode($data);\n\n\n }", "public function extra_question_fields() {\n return array();\n }", "public static function get_kprime_question_data_question_one() {\n global $USER;\n $qdata = new stdClass();\n $qdata->category = 1;\n $qdata->contextid = 1;\n $qdata->parent = 0;\n $qdata->status = \\core_question\\local\\bank\\question_version_status::QUESTION_STATUS_READY;\n $qdata->name = \"KPrim-Question-1\";\n $qdata->qtype = 'kprime';\n $qdata->questiontext = array(\"text\" => 'Questiontext for Question 1');\n $qdata->questiontextformat = FORMAT_HTML;\n $qdata->generalfeedback = array(\"text\" => 'This feedback is general');\n $qdata->generalfeedbackformat = FORMAT_HTML;\n $qdata->defaultmark = 1;\n $qdata->length = 1;\n $qdata->penalty = 0.3333333;\n $qdata->stamp = \"127.0.0.1+1552376610+76EZEc\";\n $qdata->version = \"127.0.0.1+155237661076EZEc\";\n $qdata->timecreated = \"1552376610\";\n $qdata->timemodified = \"1552376610\";\n $qdata->createdby = 0;\n $qdata->modifiedby = 0;\n $qdata->options = new stdClass();\n $qdata->options->scoringmethod = \"subpoints\";\n $qdata->options->shuffleanswers = 0;\n $qdata->options->numberofrows = 4;\n $qdata->options->numberofcolumns = 2;\n $qdata->options->rows = array(\n 1 => (object) array(\n \"id\" => 1,\n \"questionid\" => 1,\n \"number\" => 1,\n \"optiontext\" => \"option text 1\",\n \"optiontextformat\" => 1,\n \"optionfeedback\" => \"feedback to option 1\",\n \"optionfeedbackformat\" => 1\n ),\n 2 => (object) array(\n \"id\" => 2,\n \"questionid\" => 1,\n \"number\" => 2,\n \"optiontext\" => \"option text 2\",\n \"optiontextformat\" => 1,\n \"optionfeedback\" => \"feedback to option 2\",\n \"optionfeedbackformat\" => 1\n ),\n 3 => (object) array(\n \"id\" => 3,\n \"questionid\" => 1,\n \"number\" => 3,\n \"optiontext\" => \"option text 3\",\n \"optiontextformat\" => 1,\n \"optionfeedback\" => \"feedback to option 3\",\n \"optionfeedbackformat\" => 1\n ),\n 4 => (object) array(\n \"id\" => 4,\n \"questionid\" => 1,\n \"number\" => 4,\n \"optiontext\" => \"option text 4\",\n \"optiontextformat\" => 1,\n \"optionfeedback\" => \"feedback to option 4\",\n \"optionfeedbackformat\" => 1\n )\n );\n $qdata->options->columns = array(\n 1 => (object) array(\"id\" => 1, \"questionid\" => 1, \"number\" => 1, \"responsetext\" => \"True\", \"responsetextformat\" => 0),\n 2 => (object) array(\"id\" => 2, \"questionid\" => 1, \"number\" => 2, \"responsetext\" => \"False\", \"responsetextformat\" => 0)\n );\n $qdata->options->weights = array(\n 1 => array(\n 1 => (object) array (\"id\" => 1, \"questionid\" => 1, \"rownumber\" => 1, \"columnnumber\" => 1, \"weight\" => 1.000),\n 2 => (object) array (\"id\" => 2, \"questionid\" => 1, \"rownumber\" => 1, \"columnnumber\" => 2, \"weight\" => 0.000)\n ),\n 2 => array(\n 1 => (object) array (\"id\" => 3, \"questionid\" => 1, \"rownumber\" => 2, \"columnnumber\" => 1, \"weight\" => 1.000),\n 2 => (object) array (\"id\" => 4, \"questionid\" => 1, \"rownumber\" => 2, \"columnnumber\" => 2, \"weight\" => 0.000)\n ),\n 3 => array(\n 1 => (object) array (\"id\" => 5, \"questionid\" => 1, \"rownumber\" => 3, \"columnnumber\" => 1, \"weight\" => 0.000),\n 2 => (object) array (\"id\" => 6, \"questionid\" => 1, \"rownumber\" => 3, \"columnnumber\" => 2, \"weight\" => 1.000)\n ),\n 4 => array(\n 1 => (object) array (\"id\" => 7, \"questionid\" => 1, \"rownumber\" => 4, \"columnnumber\" => 1, \"weight\" => 0.000),\n 2 => (object) array (\"id\" => 8, \"questionid\" => 1, \"rownumber\" => 4, \"columnnumber\" => 2, \"weight\" => 1.000)\n )\n );\n $qdata->hints = (object) array (\n 24 => (object) array (\n \"id\" => 24,\n \"questionid\" => 1,\n \"hint\" => \"This is the 1st hint\",\n \"hintformat\" => 1,\n \"shownumcorrect\" => 0,\n \"clearwrong\" => 0,\n \"options\" => 0\n ),\n 25 => (object) array (\n \"id\" => 25,\n \"questionid\" => 1,\n \"hint\" => \"This is the 2nd hint\",\n \"hintformat\" => 1,\n \"shownumcorrect\" => 0,\n \"clearwrong\" => 0,\n \"options\" => 0\n )\n );\n return $qdata;\n }", "public function get_combined_question_form_data_allsubparts(): stdClass {\n $fromform = new stdClass();\n\n $fromform->name = 'New combined question';\n $fromform->questiontext = ['text' => 'What is the pH of a 0.1M solution? [[1:numeric:__10__]]<br/>' .\n 'What is the IUPAC name of the molecule? [[2:pmatch:__20__]]<br/>' .\n 'Which elements are shown? [[3:multiresponse]]<br/>' .\n 'Which element is shown as white? [[6:singlechoice]]<br/>' .\n 'When a solution is combined with oil the result is a [[4:selectmenu:2]]<br/>' .\n 'Showworking [[5:showworking:__80x5__]]', 'format' => FORMAT_HTML];\n $fromform->defaultmark = 1.0;\n if (class_exists('\\core_question\\local\\bank\\question_version_status')) {\n $fromform->status = \\core_question\\local\\bank\\question_version_status::QUESTION_STATUS_READY;\n }\n $fromform->generalfeedback = ['text' => 'The molecule is ethanoic acid which is more commonly known' .\n ' as acetic acid or in dilute solution as vinegar. The constituent elements are carbon (grey),' .\n ' hydrogen (white) and oxygen (red). A 0.1M solution has a pH of 2.88 and when a solution ' .\n 'is combined with oil the result is a vinaigrette.', 'format' => FORMAT_HTML];\n\n $fromform->subqfragment_id = [\n 'numeric_1' => '1',\n 'pmatch_2' => '2',\n 'multiresponse_3' => '3',\n 'singlechoice_6' => '6',\n 'selectmenu_4' => '4',\n 'showworking_5' => '5',\n ];\n $fromform->subqfragment_type = [\n 'numeric_1' => 'numeric',\n 'pmatch_2' => 'pmatch',\n 'multiresponse_3' => 'multiresponse',\n 'singlechoice_6' => 'singlechoice',\n 'selectmenu_4' => 'selectmenu',\n 'showworking_5' => 'showworking',\n ];\n\n $fromform->{'subq:numeric:1:defaultmark'} = '0.2';\n $fromform->{'subq:numeric:1:answer'} = ['2.88'];\n $fromform->{'subq:numeric:1:error'} = [''];\n $fromform->{'subq:numeric:1:requirescinotation'} = '0';\n $fromform->{'subq:numeric:1:generalfeedback'} = ['text' => 'You have the incorrect value for the pH',\n 'format' => FORMAT_HTML];\n\n $fromform->{'subq:pmatch:2:defaultmark'} = '0.2';\n $fromform->{'subq:pmatch:2:allowsubscript'} = '0';\n $fromform->{'subq:pmatch:2:allowsuperscript'} = '0';\n $fromform->{'subq:pmatch:2:usecase'} = '0';\n $fromform->{'subq:pmatch:2:applydictionarycheck'} = '-';\n $fromform->{'subq:pmatch:2:extenddictionary'} = '';\n $fromform->{'subq:pmatch:2:sentencedividers'} = '.?!';\n $fromform->{'subq:pmatch:2:converttospace'} = ',;:';\n $fromform->{'subq:pmatch:2:modelanswer'} = 'ethanoic acid';\n $fromform->{'nosynonymssubq:pmatch:2:synonymsdata'} = 1;\n $fromform->{'subq:pmatch:2:synonymsdata'} = [['word' => '', 'synonyms' => '']];\n $fromform->{'subq:pmatch:2:answer'} = ['match_mw (ethanoic acid)'];\n $fromform->{'subq:pmatch:2:generalfeedback'} = ['text' => 'You have the incorrect IUPAC name.',\n 'format' => FORMAT_HTML];\n\n $fromform->{'subq:multiresponse:3:defaultmark'} = '0.2';\n $fromform->{'subq:multiresponse:3:shuffleanswers'} = '1';\n $fromform->{'subq:multiresponse:3:answernumbering'} = 'none';\n $fromform->{'subq:multiresponse:3:noofchoices'} = 7;\n $fromform->{'subq:multiresponse:3:answer'} = [\n ['text' => 'C/carbon', 'format' => FORMAT_HTML],\n ['text' => 'H/hydrogen', 'format' => FORMAT_HTML],\n ['text' => 'O/oxygen', 'format' => FORMAT_HTML],\n ['text' => 'N/nitrogen', 'format' => FORMAT_HTML],\n ['text' => 'F/fluorine', 'format' => FORMAT_HTML],\n ['text' => 'Cl/chlorine', 'format' => FORMAT_HTML],\n ['text' => '<b>Br/bromine</b>', 'format' => FORMAT_HTML],\n ];\n $fromform->{'subq:multiresponse:3:correctanswer'} = [\n '1',\n '1',\n '1',\n '0',\n '0',\n '0',\n '0',\n ];\n $fromform->{'subq:multiresponse:3:generalfeedback'} = [\n 'text' => 'Your choice of elements is not entirely correct.', 'format' => FORMAT_HTML];\n\n $fromform->{'subq:singlechoice:6:defaultmark'} = '0.2';\n $fromform->{'subq:singlechoice:6:shuffleanswers'} = '1';\n $fromform->{'subq:singlechoice:6:answernumbering'} = 'none';\n $fromform->{'subq:singlechoice:6:noofchoices'} = 3;\n $fromform->{'subq:singlechoice:6:answer'} = [\n ['text' => 'C carbon', 'format' => FORMAT_HTML],\n ['text' => 'H hydrogen', 'format' => FORMAT_HTML],\n ['text' => '<b>O oxygen</b>', 'format' => FORMAT_HTML],\n ];\n $fromform->{'subq:singlechoice:6:fraction'} = [\n '0.0',\n '1.0',\n '0.0',\n ];\n $fromform->{'subq:singlechoice:6:feedback'} = [\n ['text' => 'Carbon is conventionally black', 'format' => FORMAT_HTML],\n ['text' => 'That is correct', 'format' => FORMAT_HTML],\n ['text' => 'Oxygen is conventionally red', 'format' => FORMAT_HTML],\n ];\n $fromform->{'subq:singlechoice:6:generalfeedback'} = [\n 'text' => 'Your name for the white atoms is incorrect.', 'format' => FORMAT_HTML];\n\n $fromform->{'subq:selectmenu:4:defaultmark'} = '0.2';\n $fromform->{'subq:selectmenu:4:shuffleanswers'} = '0';\n $fromform->{'subq:selectmenu:4:noofchoices'} = 7;\n $fromform->{'subq:selectmenu:4:answer'} = [\n 'Wine',\n 'Vinagrette',\n 'Paint Thinner',\n 'Mayonnaise',\n ];\n $fromform->{'subq:selectmenu:4:generalfeedback'} = [\n 'text' => 'Your name for the mixture is incorrect.', 'format' => FORMAT_HTML];\n\n test_question_maker::set_standard_combined_feedback_form_data($fromform);\n $fromform->shownumcorrect = 0;\n $fromform->penalty = '0.3333333';\n $fromform->numhints = 2;\n $fromform->hint = [\n ['text' => 'First hint', 'format' => FORMAT_HTML],\n ['text' => 'Second hint', 'format' => FORMAT_HTML],\n ];\n $fromform->hintclearwrong = [1, 1];\n $fromform->hintshownumcorrect = [0, 0];\n\n return $fromform;\n }", "public static function exportViewFields(){\n\t\treturn [ \n\t\t\t\"questions.id AS id\", \n\t\t\t\"questions.user_id AS user_id\", \n\t\t\t\"Users.username AS users_username\", \n\t\t\t\"questions.points AS points\", \n\t\t\t\"questions.date AS date\", \n\t\t\t\"questions.username AS username\" \n\t\t];\n\t}", "public function getQuestionData()\n {\n $question = $this->registry->registry('question');\n\n return $question;\n }", "protected function getSerializedData()\n {\n $data = $this->getAttributes();\n\n if (count($this->with) > 0) {\n foreach ($this->with as $relation) {\n $attach = [];\n foreach ($this->{$relation} as $item) {\n $attach[] = $item->getAttributes();\n }\n $data[$relation] = $attach;\n }\n }\n\n return serialize($data);\n }", "function process_question_postdata($fromform) {\n\n //Get a list of question ids\n if (isset($fromform->questionid_x)) {\n $question_ids = $fromform->questionid_x;\n } else {\n $question_ids = array();\n }\n\n //Get a list of all question text.\n if (!isset($fromform->question_x)) {\n $question_text = array();\n } else {\n $question_text = $fromform->question_x;\n }\n\n\n //Put questions into a question array.\n $questions = array();\n foreach ($question_ids as $order => $question_id) {\n\n //Make sure that any newly added questions aren't empty.\n if (trim($question_text[$order]) == '' && $question_id == 0)\n continue;\n\n //Create the question object.\n $questions[$order] = (object) array(\n 'id' => $fromform->questionid_x[$order],\n 'question' => $question_text[$order],\n 'type' => $fromform->question_type_id[$order],\n 'question_order' => $order,\n 'isstd' => $fromform->question_std[$order]\n );\n }\n\n return $questions;\n}", "public function getQqData()\n {\n return $this->qqData;\n }", "public function getCustomQuestionFields()\n {\n return $this->custom_question_fields;\n }", "public static function get_linkerdesc_question_data_info() {\n global $USER;\n\n $qdata = new stdClass();\n $qdata->id = 0;\n $qdata->contextid = 0;\n $qdata->category = 0;\n $qdata->parent = 0;\n $qdata->stamp = make_unique_id_code();\n $qdata->version = make_unique_id_code();\n $qdata->timecreated = time();\n $qdata->timemodified = time();\n $qdata->createdby = $USER->id;\n $qdata->modifiedby = $USER->id;\n $qdata->qtype = 'linkerdesc';\n $qdata->name = 'Description';\n $qdata->questiontext = 'Here is some information about the questions you are about to attempt.';\n $qdata->questiontextformat = FORMAT_HTML;\n $qdata->generalfeedback = 'And here is some more text shown only on the review page.';\n $qdata->generalfeedbackformat = FORMAT_HTML;\n $qdata->defaultmark = 0;\n $qdata->length = 0;\n $qdata->penalty = 0;\n $qdata->hidden = 0;\n $qdata->hints = array();\n $qdata->options = new stdClass();\n $qdata->options->answers = array();\n\n return $qdata;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function connects to database and retrives the ranked labels of the current labeling process
function getRankedLabels($mysqli){ $rankedLabels = array(); $query = " SELECT rLabel_label FROM tbl_ranked_label WHERE rLabel_document = ? ORDER BY rLabel_accuracy DESC"; //Labels ordered by rank $stmt = $mysqli->prepare($query); $stmt->bind_param('i',$_SESSION['curDocID'] ); if($stmt->execute()){ $result = $stmt->get_result(); while($data = mysqli_fetch_row($result)){ $data[0] =($data[0]); array_push($rankedLabels, $data[0]); } }else{ setAlert("Error retrieving information"); } $stmt->close(); return $rankedLabels; }
[ "public function getAllLabels(){\n $query = \"SELECT * FROM labels ORDER BY name\";\n $result = $this->connection->query($query);\n $result = $result->fetchAll(PDO::FETCH_ASSOC);\n $labels = [];\n foreach($result as $data){\n $labels[] = new Label($data);\n }\n return $labels;\n }", "function get_trello_labels() {\n global $verbose, $local;\n\n if ($local) return file_get_contents(\"labels.json\");\n\n $url = \"https://api.trello.com/1/boards/\" . getenv(\"trello-board\") . \"/labels?limit=1000\";\n\n return file_get_contents(get_trello_url($url));\n}", "function get_labels($t_conn_res){\n\n // array that will be returned by this function\n $action_res = array(\"errors\" => array(), \"data\" => array());\n \n // query string\n $query = \"SELECT \n t_planlabels.id, -- 0, 1, 2, ...\n t_planlabels.eltype, -- reading, text, area\n t_planlabels.nodeid, -- 1, 2, 3, 4\n t_planlabels.nodedata, -- hum, temp, ...\n t_planlabels.id_user, -- customizable id\n t_planlabels.fromtop, -- move fromtop% from top\n t_planlabels.fromleft, -- move fromleft% from left\n t_planlabels.width, -- width of the element (%)\n t_planlabels.height, -- height of the element (%)\n t_planlabels.textcontent -- text inside the element\n FROM t_planlabels\"; // table of the labels\n \n // execute query\n $labels_arr = queryToArray($t_conn_res[\"connect_obj\"], $query);\n\n // be sure that there were no errors\n if (count($labels_arr[\"errors\"]) == 0){ \n // add rssi to the \"data\" array of $action_res\n $action_res[\"data\"] = array_merge($action_res[\"data\"], $labels_arr[\"query_data\"]);\n }\n else {\n // An error occured during query execution\n array_push($action_res[\"errors\"], array(\"id\" => 1120,\n \"htmlcode\" => 500,\n \"message\" => \"Error during query execution\"));\n // unset \"data\" array\n unset($action_res[\"data\"]);\n }\n\n return $action_res;\n}", "private function getLabels() : void\n {\n if ($this->label) {\n \t$labels = explode(',', $this->label);\n $labels = $this->videoLabel->whereIn('label', $labels)->pluck('id');\n\t foreach ($labels as $label) {\n\t\t $this->query = $this->post->whereHasEntity('videoLabels', $label);\n\t\t $this->labelFilter = $this->videoLabel->find($label);\n\t }\n }\n }", "function get_topics_labels()\n\t{\n\t\tglobal $db, $cache, $config;\n\t\t$sql = \"SELECT * FROM \" . TOPICS_LABELS_TABLE . \" ORDER BY label_name ASC\";\n\t\t$result = $db->sql_query($sql, 0, 'topics_labels_', TOPICS_CACHE_FOLDER);\n\t\t$topic_labels = array();\n\t\twhile ($row = $db->sql_fetchrow($result))\n\t\t{\n\t\t\t$topic_labels[$row['id']] = $row;\n\t\t}\n\t\t$db->sql_freeresult($result);\n\t\treturn $topic_labels;\n\t}", "function dataLabel($db='', $kondisi=''){\n\t\t\t\t\t\t\t\t$Si_Tot = array();\n\t\t\t\t\t\t\t\t$query_Si_Tot = \"SELECT label, COUNT(label) jml FROM `tbl_kasus` $kondisi GROUP BY label\";\n\t\t\t\t\t\t\t\t$sql_Si_Tot = $db->query($query_Si_Tot);\n\t\t\t\t\t\t\t\twhile ($row = $db->fetch_assoc($sql_Si_Tot)) {\n\t\t\t\t\t\t\t\t\t$Si_Tot[] = array(\n\t\t\t\t\t\t\t\t\t\t'label'=>$row['label'],\n\t\t\t\t\t\t\t\t\t\t'jml' => (int)$row['jml']\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\treturn $Si_Tot;\n\t\t\t\t\t\t\t\t// var_dump($Si_Tot[0]['label']);\n\t\t\t\t\t\t\t}", "abstract protected function getRankingName();", "public function select_data_from_db_for_labels( $db_info = '', $label_column = '', $table = '', $where = '', $order_by = '' ) {\n global $wpdb;\n $query = \"SELECT `\" . $label_column . \"` FROM \" . $table . $where . \" ORDER BY \" . $order_by;\n $db_info = trim($db_info, '[]');\n if ( $db_info ) {\n $temp = explode( '@@@wdfhostwdf@@@', $db_info );\n $host = $temp[ 0 ];\n $temp = explode( '@@@wdfportwdf@@@', $temp[1] );\n $port = $temp[ 0 ];\n if ($port) {\n $host .= ':' . $port;\n }\n $temp = explode( '@@@wdfusernamewdf@@@', $temp[ 1 ] );\n $username = $temp[ 0 ];\n $temp = explode( '@@@wdfpasswordwdf@@@', $temp[ 1 ] );\n $password = $temp[ 0 ];\n $temp = explode( '@@@wdfdatabasewdf@@@', $temp[ 1 ] );\n $database = $temp[ 0 ];\n $wpdb_temp = new wpdb( $username, $password, $database, $host );\n $choices_labels = $wpdb_temp->get_results( $query, ARRAY_N );\n } else {\n $choices_labels = $wpdb->get_results( $query, ARRAY_N );\n }\n\n return $choices_labels;\n }", "public function classification_list(){\n/* \t\tglobal $conn;\n\t\t$query = $conn->query(\"SELECT classification FROM bid_information GROUP BY classification\");\n\t\treturn $query->fetchAll();\n\t\t */\n\t\tglobal $url_data;\n\t\tglobal $bid_information;\n\t\t\n\t\t$sql = urlencode('SELECT classification FROM '.$bid_information.' GROUP BY classification ');\n\t\t$query = file_get_contents(''.$url_data.'/api/action/datastore_search_sql?sql='.$sql.'');\n\t\t$query = json_decode($query, true);\n\t\treturn $query['result']['records']; \n\t\t\n\t}", "function queryLabels($options = null)\n {\n return $this->_api->newApiCursor('Telerivet_Label', \"{$this->getBaseApiPath()}/labels\", $options);\n }", "public function getLabels() {\n if ($response = $this->podio->get('/task/label/')) {\n return json_decode($response->getBody(), TRUE);\n }\n }", "public function fetchLabels()\n {\n if (!array_key_exists('ShipmentId', $this->options)) {\n $this->log(\"ShipmentId must be set in order to make a package labels\", 'Warning');\n return false;\n }\n if (!array_key_exists('PageType', $this->options)) {\n $this->log(\"PageType must be set in order to make a package labels\", 'Warning');\n return false;\n }\n\n $url = $this->urlbase . $this->urlbranch;\n\n $query = $this->genQuery();\n\n $path = $this->options['Action'] . 'Result';\n if ($this->mockMode) {\n $xml = $this->fetchMockFile()->$path->InboundShipmentPlans;\n } else {\n $response = $this->sendRequest($url, array('Post' => $query));\n\n if (!$this->checkResponse($response)) {\n return false;\n }\n $xml = simplexml_load_string($response['body'])->$path->TransportDocument;\n $this->pdfDocument = $xml->PdfDocument;\n $this->checksum = $xml->CheckSum;\n }\n }", "public function getRanking()\n {\n }", "function getvocabname($string) {\n preg_match_all('/\\/[0-9]*>/',$string,$matches);\n $strip1 = preg_replace('/\\//','',$matches[0]);\n $strip2 = preg_replace('/>/','',$strip1[0]);\n $strip2;\n\n// Access control to the database\n$user = 'your_username';\n$pass = 'your_password';\n\n try {\n $dbh = new PDO('mysql:host=localhost;dbname=drupal-7.42', $user, $pass);\n foreach($dbh->query(\"SELECT `taxonomy_vocabulary`.`name`, `taxonomy_vocabulary`.`description` ,\n`taxonomy_term_data`.`vid` FROM `taxonomy_term_data`\nJOIN `taxonomy_vocabulary` ON `taxonomy_term_data`.`vid` = `taxonomy_vocabulary`.`vid`\nWHERE `taxonomy_term_data`.`tid` = 24\") as $row) {\n // foreach($dbh->query('SELECT * from `pan_node` LIMIT 10') as $row) {\n// print_r($row);\n if($row['name'] !== NULL) {\n echo($row['name']);\n $label = $row['name'];\n // array_push($nid_array_for_text_field, $row['nid']);\n }\n if($row['description'] !== NULL) {\n echo($row['description']);\n // $comment = $row['description'];\n // array_push($content_type_array, $row['type']);\n }\n if($row['vid'] !== NULL) {\n echo($row['vid']);\n // array_push($field_text_field_name_value_array_all, $row[$table_text_field_name_value]);\n }\n }\n $dbh = null;\n } catch (PDOException $e) {\n print \"Error!: \" . $e->getMessage() . \"<br/>\";\n die();\n }\n\necho $label;\nreturn $label;\n}", "function showLabels($mysqli) {\n\tif($_SESSION['cur_lpAlgorithm'] == 'random')\t\t\tshowRandomSuggestion($mysqli);\n\telse if($_SESSION['cur_lpAlgorithm'] == 'mostVoted')\tshowMostVotedSuggestion($mysqli);\n\telse if($_SESSION['cur_lpAlgorithm'] == 'transductive')\tshowTransductiveSuggestion($mysqli);\n\telse if($_SESSION['cur_lpAlgorithm'] == 'testMode')\t\ttestModeSuggestion($mysqli);\n}", "public function getLabels();", "function get_singleplayer_rank(){\n \tglobal $bombermanDb;\n \n $queryText = 'SELECT * FROM scores ORDER BY score DESC LIMIT 10;';\n\n \t$result = $bombermanDb->performQuery($queryText);\n \t$bombermanDb->closeConnection();\n\t\treturn $result;\n }", "public function getRanks()\n {\n $request = \"SELECT * FROM rank\";\n $request = $this->connexion->query($request);\n $ranks = $request->fetchAll(PDO::FETCH_ASSOC);\n return $ranks;\n }", "public function load_all_rank() {\n\t\t#$this->autoRender = false;\n\t\t$message = array();\n\t\t#Configure::write('debug', 0);\n\t\tset_time_limit(0);\n\t\t$this -> Keyword -> recursive = -1;\n\n\t\t// Filter keyword\n\t\t$conds = array();\n\t\t$conds['Keyword.Enabled'] = 1;\n\t\t$conds['Keyword.nocontract'] = 0;\n\t\t$conds['Keyword.rankend'] = 0;\n\n\t\t$keywords = $this -> Keyword -> find('all', array('conditions' => $conds));\n\n\t\tforeach ($keywords as $keyword) {\n\t\t\tsleep(4);\n\t\t\tif ($keyword != false) {\n\t\t\t\tif ($keyword['Keyword']['Strict'] == 1) {\n\t\t\t\t\t$domain = $this -> Rank -> remainUrl($keyword['Keyword']['Url']);\n\t\t\t\t} else {\n\t\t\t\t\t$domain = $this -> Rank -> remainDomain($keyword['Keyword']['Url']);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$engine = $keyword['Keyword']['Engine'];\n\n\t\t\tif ($engine == 3) {\n\t\t\t\t$rank = $this -> Rank -> keyWordRank('google_jp', $domain, $keyword['Keyword']['Keyword']) . '/' . $this -> Rank -> keyWordRank('yahoo_jp', $domain, $keyword['Keyword']['Keyword']);\n\t\t\t} elseif ($engine == 6) {\n\t\t\t\t$rank = $this -> Rank -> keyWordRank('google_en', $domain, $keyword['Keyword']['Keyword']) . '/' . $this -> Rank -> keyWordRank('yahoo_en', $domain, $keyword['Keyword']['Keyword']);\n\t\t\t} elseif ($engine == 7) { // mobile search engine\n\t\t\t\t$rank = $this -> RankMobile -> keywordRankYahooMobile($domain, $keyword['Keyword']['Keyword']);\n\t\t\t} elseif ($engine == 8) {\n\t\t\t\t$rank = $this -> RankMobile -> keywordRankGoogleMobile($domain, $keyword['Keyword']['Keyword']);\n\t\t\t} else { // end\n\t\t\t\t$engine_list = $this -> Rank -> getEngineList();\n\t\t\t\t$rank = $this -> Rank -> keyWordRank($engine_list[$engine]['Name'], $domain, $keyword['Keyword']['Keyword']);\n\t\t\t}\n\n\t\t\t// delete Rankhistory current date\n\t\t\t$this -> Keyword -> Rankhistory -> deleteAll(array('Rankhistory.KeyID' => $keyword['Keyword']['ID'], 'Rankhistory.RankDate' => date('Ymd')));\n\t\t\t\n\t\t\t// insert Rankhistory current date\n\t\t\t$rankhistory['Rankhistory']['KeyID'] = $keyword['Keyword']['ID'];\n\t\t\t$rankhistory['Rankhistory']['Url'] = $domain;\n\t\t\t$rankhistory['Rankhistory']['Rank'] = $rank;\n\t\t\t$rankhistory['Rankhistory']['RankDate'] = date('Ymd');\n\t\t\t\n\t\t\t// check color and arrow\n\t\t\t$check_params = array();\n\t\t\t$rankDate = date('Ymd', strtotime(date('Y-m-d') . '-1 day'));\n\t\t\t$data_rankhistory = Cache::read($keyword['Keyword']['ID'] . '_' . $rankDate, 'Rankhistory');\n\t\t\t\n\t\t\t// no cache\n\t\t\tif (!$data_rankhistory) {\n\t\t\t\t$data_rankhistory = $this -> Keyword -> Rankhistory -> find('first', array('fields' => array('Rankhistory.Rank'), 'conditions' => array('Rankhistory.KeyID' => $keyword['Keyword']['ID'], 'Rankhistory.RankDate' => $rankDate)));\n\t\t\t\tCache::write($keyword['Keyword']['ID'] . '_' . $rankDate, $rankhistory, 'Rankhistory');\n\t\t\t}\n\t\t\t\n\t\t\t// already cache\n\t\t\tif (isset($data_rankhistory['Rankhistory']['Rank']) && strpos($data_rankhistory['Rankhistory']['Rank'], '/')) {\n\t\t\t\t$rank_old = explode('/', $data_rankhistory['Rankhistory']['Rank']);\n\t\t\t} else {\n\t\t\t\t$rank_old[0] = 0;\n\t\t\t\t$rank_old[1] = 0;\n\t\t\t}\n\t\t\t// check rank is not empty and has a slash\n\t\t\tif (!empty($rank) && strpos($rank, '/')) {\n\t\t\t\t$rank_new = explode('/', $rank);\n\t\t\t} else {\n\t\t\t\t$rank_new[0] = 0;\n\t\t\t\t$rank_new[1] = 0;\n\t\t\t}\n\n\t\t\t// color\n\t\t\tif ($rank_new[0] >= 1 && $rank_new[0] <= 10 || $rank_new[1] >= 1 && $rank_new[1] <= 10) {\n\t\t\t\t$check_params['color'] = '#E4EDF9';\n\t\t\t} else if ($rank_new[0] >= 11 && $rank_new[0] <= 20 || $rank_new[1] >= 11 && $rank_new[1] <= 20) {\n\t\t\t\t$check_params['color'] = '#FAFAD2';\n\t\t\t} else if ($rank_old[0] >= 1 && $rank_old[0] <= 10 && $rank_new[0] > 10 || $rank_old[1] >= 1 && $rank_old[1] <= 10 && $rank_new[1] > 10) {\n\t\t\t\t$check_params['color'] = '#FFBFBF';\n\t\t\t} else {\n\t\t\t\t$check_params['color'] = '';\n\t\t\t}\n\n\t\t\t// arrow\n\t\t\tif ($rank_new[0] > $rank_old[0] || $rank_new[1] > $rank_old[1]) {\n\t\t\t\t$check_params['arrow'] = '<span class=\"red-arrow\">↓</span>';\n\t\t\t} else if ($rank_new[0] < $rank_old[0] || $rank_new[1] < $rank_old[1]) {\n\t\t\t\t$check_params['arrow'] = '<span class=\"blue-arrow\">↑</span>';\n\t\t\t} else {\n\t\t\t\t$check_params['arrow'] = '';\n\t\t\t}\n\n\t\t\t$rankhistory['Rankhistory']['params'] = json_encode($check_params);\n\t\t\t$this -> Keyword -> Rankhistory -> create();\n\t\t\t$this -> Keyword -> Rankhistory -> save($rankhistory);\n\t\t\t// Old code rewrite\n\t\t\t$duration = $this -> Keyword -> Duration -> find('first', array('fields' => array('Duration.StartDate'), 'conditions' => array('Duration.KeyID' => $keyword['Keyword']['ID'], 'Duration.Flag' => 2), 'order' => 'Duration.ID'));\n\t\t\t//\n\t\t\tif ($duration == false) {\n\t\t\t\tif (strpos($rank, '/') !== false) {\n\t\t\t\t\t$ranks = explode('/', $rank);\n\t\t\t\t\t$google_rank = $ranks[0];\n\t\t\t\t\t$yahoo_rank = $ranks[1];\n\t\t\t\t}\n\n\t\t\t\tif (($google_rank > 0 && $google_rank <= 10) || ($yahoo_rank > 0 && $yahoo_rank <= 10) || ($rank > 0 && $rank <= 10)) {\n\t\t\t\t\t$durations['Duration']['KeyID'] = $keyword['Keyword']['ID'];\n\t\t\t\t\t$durations['Duration']['StartDate'] = date('Ymd');\n\t\t\t\t\t$durations['Duration']['EndDate'] = 0;\n\t\t\t\t\t$durations['Duration']['Flag'] = 2;\n\t\t\t\t\t$this -> Keyword -> Duration -> create();\n\t\t\t\t\t$this -> Keyword -> Duration -> save($durations);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$message[] = $keyword['Keyword']['ID'];\n\t\t}\n\t\techo implode(', ', $message);\n\t\t$this -> redirect($this -> referer());\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generated from protobuf field string role_name = 1;
public function getRoleName() { return $this->role_name; }
[ "public function getRoleName() {\n \treturn $this->role->role_name;\n }", "public function setRoleName($roleName);", "public function getRoleName()\n {\n return $this->roleName;\n }", "public function getRoleByName($role_name = '');", "public function getRoleName()\n {\n return $this->name;\n }", "public function getRoleName()\n {\n // if user has some role assigned, return it's name\n if ($this->role) {\n return $this->role->item_name;\n }\n\n // user does not have role assigned, but if he is authenticated '@'\n return '@uthenticated';\n }", "public function getRoleName()\n {\n return $this->role->item_name;\n }", "public function roleName() {\n return self::$available_roles[$this->role];\n }", "public function setRoleName($roleName)\n {\n }", "function participantRoleString( $participantRole )\n {\n return null;\n }", "public function getVerboseStrRole()\n {\n switch ($this->roles[0]) {\n case 'ROLE_USER':\n $role = 'User';\n break;\n case 'ROLE_RAID_LEADER':\n $role = 'Raid Leader';\n break;\n case 'ROLE_ADMIN':\n $role = 'Administrator';\n break;\n case 'ROLE_OWNER':\n $role = 'Owner';\n break;\n }\n\n return $role;\n }", "public function getRole($roleName);", "function getUserRoleName($role) {\n switch ($role) {\n case 'particular':\n return __(\"Particular\", \"gpdealdomain\");\n case 'professional':\n return __(\"Professional\", \"gpdealdomain\");\n case 'enterprise':\n return __('Enterprise', \"gpdealdomain\");\n default :\n return $role;\n }\n}", "function bbp_translate_user_role($name)\n{\n}", "public function getRole()\n {\n return $this->readOneof(1);\n }", "public function getRoleName()\n {\n return $this->roles()->first()->name;\n }", "public function getRoleId($roleName);", "public function getRole()\n {\n return !empty($this->payload['role']) ? $this->payload['role'] : null;\n }", "public function getRole() \n {\n return $this->_fields['Role']['FieldValue'];\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the file information from the database for a given filename
public function getFileInfoByName($file) { return $this->db->select($this->getTableName(), array('file' => $file)); }
[ "function get_file_info($file_id) {\n $lisdb = $this->load->database('lisdb',TRUE);\n $sql = \"SELECT * FROM $this->table WHERE file_id=$file_id\";\n $lisdb->where('file_id',$file_id);\n $records = $lisdb->get($this->table)->result_array();\n \n return $records[0];\n }", "function get_file_info($fileID){\n $sql = \"SELECT * FROM `assignmentfile` WHERE FileID=?\";\n $query = MySQL::getInstance()->prepare($sql);\n $query->execute(array($fileID));\n return $query->fetchALL(PDO::FETCH_ASSOC);\n}", "public function getFileInformation($id){\n $this->db->query('SELECT * FROM files WHERE User_Id = :userId && File_Id = :fileId');\n\n $this->db->bind(':userId', $_SESSION['user_id']);\n $this->db->bind(':fileId', $id);\n\n $row = $this->db->single();\n\n return $row;\n }", "protected function getDatabaseFile() : string\n\t{\n\t\t$path = \"{$this->getRoot()}/{$this->global->path->db}\";\n\t\treturn Stringify::formatPath($path, true);\n\t}", "function getFileName($id)\n\t{\n\t\treturn $this->db->querySingle(\"SELECT filename FROM list WHERE rowid = $id\");\n\t}", "public function getDatabaseFilename() {\n return $this->filename;\n }", "protected static function get_backup_info($filename)\n\t{\n\n\t\tpreg_match_all('/([\\D]+)_([0-9]{4})_([0-9]{1,2})_([0-9]{1,2})_([0-9]{2})([0-9]{2})([0-9]{2})/', $filename, $matches);\n\t\t// \\_____/ \\________/ \\__________/ \\__________/ \\________/\\________/\\________/\n\t\t// tablename year month day hour minute second\n\n\t\tlist($full_match, $table, $year, $month, $day, $hours, $minutes, $seconds) = $matches;\n\t\t\n\t\t//return mktime($hours[0], $minutes[0], $seconds[0], $month[0], $day[0], $year[0]);\t\n\t\t$timestamp = mktime($hours[0], $minutes[0], $seconds[0], $month[0], $day[0], $year[0]);\n\t\t$timestamp = date('Y-m-d H:i:s', $timestamp);\n\t\t$filesize = filesize(static::backup_path() . DS . $filename);\n\t\t\n\t\treturn array(\n\t\t\t'table' => $table[0],\n\t\t\t'filesize' => $filesize,\n\t\t\t'timestamp' => $timestamp,\n\t\t);\n\t}", "function MASS_openDBFile($fileName)\n{\n\t$file=fopen($fileName,\"r\");\n\n\treturn($file);\n}", "function getFileContents($owner, $fileName) {\n\n\t\t\t$stmt = $this->dbConnection->prepare(\"SELECT fileContents\n\t\t\t FROM files\n\t\t\t WHERE owner = ? AND fileName = ?\");\n\t\t\t$stmt->bind_param(\"ss\", $owner, $fileName);\n\t\t\t$stmt->execute();\n\t\t\t$stmt->bind_result($file);\n\t\t\t$stmt->fetch();\n\t\t\t$stmt->close();\n\t\t\treturn $file;\n\t\t}", "public function retrieveFile($fid)\n {\n $querystr = \"SELECT * FROM file_uploads WHERE fid = \".$fid;\n return db_connect::run_query($query_str);\n }", "function getFileInfo($id)\n\t{\n\t\treturn $this->db->querySingle(\"SELECT rowid,* FROM list WHERE rowid = $id\", TRUE);\n\t}", "function GetFileData($id_file) {\n $q = \"SELECT `\" . TblModCatalogPropFiles . \"`.*, `\" . TblModCatalogPropFilesTxt . \"`.`name`, `\" . TblModCatalogPropFilesTxt . \"`.`text`\n FROM `\" . TblModCatalogPropFiles . \"`\n LEFT JOIN `\" . TblModCatalogPropFilesTxt . \"` ON `\" . TblModCatalogPropFiles . \"`.`id`=`\" . TblModCatalogPropFilesTxt . \"`.`cod`\n WHERE `\" . TblModCatalogPropFiles . \"`.`id`='\" . $id_file . \"'\n \";\n $res = $this->db->db_Query($q);\n //echo '<br>q='.$q.' res='.$res.' $tmp_db->result='.$tmp_db->result;\n if (!$res OR !$this->db->result)\n return false;\n $row = $this->db->db_FetchAssoc();\n return $row;\n }", "function tqb_get_attachment_by_filename( $filename ) {\n\n\tglobal $wpdb;\n\n\t$query = \"SELECT * FROM {$wpdb->posts} WHERE guid LIKE '%s'\";\n\n\treturn $wpdb->get_row( $wpdb->prepare( $query, '%' . $filename . '%' ) );\n}", "public function getDocumentFileName() {\n\t\t//FILENAME FROM STORAGE TABLE\n $tableStorage = Engine_Api::_()->getDbtable('files', 'storage');\n $tableStorageName = $tableStorage->info('name');\n $tableDocumentName = Engine_Api::_()->getDbtable('documents', 'sitepagedocument')->info('name');\n\n $file_name = $tableStorage->select()\n ->setIntegrityCheck(false)\n ->from($tableDocumentName, array(''))\n ->join($tableStorageName, \"$tableStorageName.file_id = $this->filename_id\", array('name'))\n ->where($tableStorageName . '.parent_type = ?', 'sitepagedocument')\n\t\t\t\t\t\t\t\t\t\t->query()\n\t\t\t\t\t\t\t\t\t\t->fetchColumn();\n return $file_name;\n\t}", "function retrieveFileArray($name){\n\n $servername = \"localhost\";\n $username = \"root\";\n $password = \"\";\n $dbname = \"final\";\n\n try {\n \t$conn = new PDO(\"mysql:host=$servername;dbname=$dbname\", $username, $password);\n\t // set the PDO error mode to exception\n \t$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\n \t// prepare sql and bind parameters\n \t\t$stmt = $conn->prepare(\"SELECT * FROM data WHERE filename = :first\");\n \t$stmt->bindParam(':first', $name);\n\n \t// retrieve the data\n \t\t$stmt->execute();\n\n\t\t// store the row\n\t\t$row = $stmt->fetch();\n\n \t}\n\t\tcatch(PDOException $e) {\n\t\t echo \"Error: \" . $e->getMessage();\n \t}\n\t\t$conn = null;\n\n\t\treturn $row;\n}", "protected function getSQL($filename) {\n\t\t// search sql files in package archive\n\t\tif (($fileindex = $this->installation->getArchive()->getTar()->getIndexByFilename($filename)) === false) {\n\t\t\tthrow new SystemException(\"SQL file '\".$filename.\"' not found.\", 13016);\n\t\t}\n\n\t\t// extract sql file to string\n\t\treturn $this->installation->getArchive()->getTar()->extractToString($fileindex);\n \t}", "public function GetSQLFileContents() {\n\t\t$file = $this->GetSQLFile();\n\t\treturn file_get_contents($file);\n\t}", "function get_file_info($fn)\n{\n $info = array('full_fn' => $fn,\n 'real_fn' => substr($fn, FN_PREFIX_WIDTH),\n 'full_fn_w_path' => files_dir() . '/' . $fn);\n return $info;\n}", "private function getMediaInfoByFilename($filename) {\n $key = array_search($filename, array_column($this->media_info, 'filename'));\n return $this->media_info[$key];\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Loads the action file.
function _loadAction($action_file, $action_class) { if (!Fire_Loader::loadClass($action_class, $action_file, array(FIRE_APPLICATION_PATH, 'actions'), true)) { Fire_Error::throwError(sprintf('Request action class "%s" was not found in file "%s". Either file can\'t be found or class in not present there.', $action_class, $action_file), __FILE__, __LINE__); } }
[ "private static function LoadActionFile($_module, $_action)\n\t{\n\t\t$f = self::$MODULES.\"/\".$_module.\".module/actions/\".$_action.\".action.php\";\n\t\tif(self::Uses($f))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t //throw new Exception(\"Action Load failed for file \".$f);\n\t\t}\n\t}", "protected function loadActionClass()\n\t{\n\t\t$query = Query::getQuery();\n\t\tif(isset($query['action']))\n\t\t{\n\t\t\t$action = preg_replace('/[^a-zA-Z0-9\\s]/', '', $query['action']);\n\n\t\t\tif($action == 'Minify')\n\t\t\t\t$action = 'JsSub';\n\t\t}else{\n\t\t\t$action = 'Install';\n\t\t}\n\n\t\t$classname = 'InstallerAction' . $action;\n\t\t$config = Config::getInstance();\n\t\t$path = $config['path']['modules'] . 'Installer/actions/' . $action . '.class.php';\n\n\t\tif(!class_exists($classname, false))\n\t\t{\n\t\t\tif(!file_exists($path))\n\t\t\t\tthrow new ResourceNotFoundError('Unable to load action file: ' . $path);\n\t\t\tinclude($path);\n\t\t}\n\n\t\treturn array('className' => $classname, 'argument' => $this->ioHandler);\n\t}", "private function loadActionsFromConfig(): void\n {\n $this->loadActionsFromDirectory(Fs::getClassPath($this) . '/Actions/');\n }", "public function Action(){\n\t \n $this->SetRequestVariables(); \n $this->SetAction(); \n $this->UpdateyAction(); \n \n \n $path = $this->fileSystemPath.$this->actionFolder.self::$yAction['_LITE_']['ACTION'].\".php\";\n \n if(!file_exists ( $path )){ \n \t header( 'Location: ' . $this->applicationPath.'?action=404' );\n \t //die (\"File <b>\".$path.\" </b> <br />Not Found or File doesn't have the permission to open\"); \n }\n \n require_once($path);\n\n \t\n $LiteFrameAction = new LiteFrameAction();\n self::$yAction['_LITE_']['VARS']['Request'] = self::$yAction['_LITE_']['REQUEST'];\n $this->liteVars = &self::$yAction['_LITE_']['VARS'];\n // Double checking the Template variables from the Action file\n $this->MergeActionTemplatesWithFramework();\n $this->LoadTemplate();\t \n\n\t}", "function run_file_action($name, $params = null) {\n\n $action = '';\n $file = '';\n $is_raw_file = false;\n \n if (is_array($name)) {\n $action = $name['action']; \n $file = $name['file']; \n if (isset($name['_file'])) { $file = $name['_file']; $is_raw_file = true; } \n }\n else {\n $file = $action = $name;\n }\n\n /*\n if (!empty($name['section'])) {\n $action = $name['section'] . '/' . $action;\n }\n */\n\n $action = str_replace('/', '_', $action);\n $fname = $file; //$is_raw_file ? $file : str_replace('_', '/', $file);\n \n $file = $this->get_context()->get_root() . 'actions/' . $fname . '.php';\n \n if (!file_exists($file)) throw new controller_exception('Action file not found ' . $file);\n \n fs::req($file);\n \n $class = $action . '_action';\n $class = $this->core->modules()->ns($this->context->get_name(), $class);\n \n core::dprint(array(\"[CONTROLLER::RUN_FILE] %s from %s\", $class, $file));\n \n if (!class_exists($class, 0)) throw new router_exception('Action class not exists ' . $class);\n \n if (empty($params)) $params = $this->_params;\n \n $action = new $class($this, $params);\n\n return $action->run();\n }", "private function _loadFile() {\r\n $splitFile = explode('/', $this->_file);\r\n \r\n $splitExt = explode('.', $splitFile[(count($splitFile)-1)]);\r\n $fileExt = (count($splitExt) > 2) ? $splitExt[1].'.'.$splitExt[2] : $splitExt[1];\r\n $this->_mode = Definition::resolveFileType($fileExt);\r\n return file_get_contents(constant(strtoupper($this->_type).'_DIR').'/'.$this->_item.'/'.$this->_render['editor']['file']);\r\n }", "private function load() {\n\t\t\n\t}", "public function get_load_action() {\n\t\treturn self::AFTER_INSTALLER_READY_ACTION;\n\t}", "public function load($file);", "function on_request_file ( $file = null ) {\n \n // Do we have a specific file to try?\n if ( ( is_array ( $file ) && count ( $file ) == 0 ) || $file == null ) {\n \n // No; look for one using incoming URI\n \n // Create a list of potential action classes\n $this->create_action_class_paths ( $this->glob->request->_uri ) ;\n\n // What action class did we find?\n $file = $this->find_first_action_class () ;\n \n }\n \n $resource = null ;\n\n if ( $this->debug ) debug ( $file, 'on_request_file :: path' ) ;\n\n if ( $file !== null ) {\n\n\n // Try to include the class path most likely\n include ( \\xs\\Core::$dir_app . '/' . $file ) ;\n\n // Instantiate it, and it will register its own methods\n // to the event stack in its constructor\n try {\n\n if ( $file == 'website/403.php' || $file == 'website/404.php' ) \n \n // creating the action instance (the class in charge of output)\n $resource = new xs_action_instance_error () ;\n \n else {\n \n // creating the action instance (the class in charge of output)\n $resource = new xs_action_instance () ;\n \n // has this URI got a 'page' topic in the db?\n $this->page_db_lookup = $this->glob->data->get ( $this->resource_id ) ;\n \n if ( count ( $this->page_db_lookup ) < 1 ) {\n \n // sync page to database (for access control, at least)\n $this->_later_sync = true ;\n }\n }\n // inject its path into it\n $resource->_meta->action_path = XS_DIR_APP . '/' . $file ;\n \n // add 'page', 'widgets' and 'menus' events just after the 'XS_DISPATCH' event\n $this->_add_event ( 'XS_DISPATCHER_END', 'XS_PAGE' ) ;\n $this->_add_event ( 'XS_DISPATCHER_END', 'XS_WIDGETS' ) ;\n $this->_add_event ( 'XS_DISPATCHER_END', 'XS_MENUS' ) ;\n\n // Set the page type\n // $this->glob->page->type = XS_PAGE_DYNAMIC ;\n // $this->glob->page->source = 'file' ;\n\n // $this->glob->stack->add ( 'xs_framework', $resource->_meta ) ;\n\n\n $this->glob->log->add ( 'Controller : dispatched action class '.$this->path ) ;\n\n return array ( 'file', $resource ) ;\n\n } catch ( exception $ex ) {\n\n // Should never really go here. All classes not found should be directed to the 404.php file above\n echo \"ACTION CLASS NOT FOUND <pre>[\" ; print_r ( $this->path ) ; echo \"]</pre>\" ;\n echo \"<pre>\" ; print_r ( $this->ctrl_paths ) ; echo \"</pre>\" ;\n\n }\n\n } \n\n return array ( 'file', null ) ;\n\n }", "protected function loadFile()\n\t{\n\t\t$view = $this->getName();\n\t\t\n\t\t$file = t('view')->find($view);\n\t\t\n\t\tif ( ! $file)\n\t\t{\n\t\t\tthrow new InvalidArgumentException(\"Macro file [{$view}] does not exist.\");\n\t\t}\n\t\t\n\t\tob_start();\n\t\t\n\t\tinclude $file;\n\t\t\n\t\treturn ob_get_clean();\n\t}", "public function dispatchAction() {\n\n $actions_base = $this->getConfig('paths/actions', './actions');\n\n $action_name = $this->getRouteVar('action', 'default');\n\n if (! ($action_path = realpath(\"$actions_base/$action_name.action.php\")) ) {\n // If no action was found with the desired name, fall back to default.\n $action_path = realpath(\"$actions_base/default.action.php\");\n }\n\n $this->template = $tpl = new FeedMagick2_Template();\n $this->template->BASE_URL =\n $this->getConfig('base_url', '/');\n $this->template->setPath('template', \n $this->getConfig('path/templates', './templates'));\n $this->template->setPath('resource', \n $this->getConfig('path/templates', './templates'));\n\n include $action_path;\n\n }", "private function loadFile()\n\t{\n\t\tif( empty($this->content) ) {\n\t\t\tif( empty($this->file) ) {\n\t\t\t\tthrow new Exception('Which file should I parse, you ...!');\n\t\t\t} else {\n\t\t\t\tif( strtolower( $this->file->getExtension() ) == 'zip' ) {\n\t\t\t\t\t$this->content = $this->handleZipFile( $this->file );\n\t\t\t\t} else {\n\t\t\t\t\t$this->content = $this->file->getContents();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "protected function initActions() {}", "public static function load() {\n\n\t\tif ( ! method_exists( 'GFForms', 'include_addon_framework' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! class_exists( '\\ForGravity\\PageActions\\EDD_SL_Plugin_Updater' ) ) {\n\t\t\trequire_once( 'includes/EDD_SL_Plugin_Updater.php' );\n\t\t}\n\n\t\trequire_once( 'class-pageactions.php' );\n\n\t\tGFAddOn::register( '\\ForGravity\\PageActions\\Page_Actions' );\n\n\t}", "abstract protected function load_file($file);", "private function loadController()\n {\n $page = ROOT . DS . 'Controllers' . DS . ucfirst($this->url[0]) . 'Controller.php';\n if (file_exists($page)) {\n require $page;\n } else {\n $this->errors();\n die();\n }\n }", "protected function loadController()\r {\r }", "private function _load()\r\n {\r\n if (file_exists( $filepath = make_path(array(APPPATH, 'ln', $this->language . '.php' )) )) {\r\n require $filepath;\r\n if (isset($lang) && is_array($lang)) {\r\n $this->langfile = $lang;\r\n unset($lang);\r\n trigger_event_callbacks('lang', 'change', array($this->language));\r\n }\r\n else {\r\n show_error(\"The language file \\\"{$this->language}.php\\\" doesn't contain the variable \\\"\\$lang\\\".\");\r\n }\r\n }\r\n else {\r\n show_error(\"The language file \\\"{$this->language}.php\\\" can't be located in \\\"\".APPPATH.\"ln/\\\".\");\r\n }\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Format the events' data for frontend consumption
public function events($events) { $formatted = []; foreach ($events as $event) { $formatted[] = [ 'id' => $event->id, 'title' => $event->title, 'start' => $event->start, 'end' => $event->end, 'type' => $event->type, 'creator_id' => $event->creator_id, 'details' => $event->details ]; } return $formatted; }
[ "public function getFormatted(){\n $results = $this->results();\n\n $eventsList = array();\n foreach($results AS $eventData){\n $eventsList[] = (object) array(\n 'id' => $eventData['id'],\n 'title' => $eventData['title'],\n 'start' => $eventData['startLocalized'],\n 'end' => $eventData['endLocalized'],\n 'allDay' => (bool) $eventData['isAllDay'] ? true : false,\n 'color' => $eventData['colorHex'],\n 'textColor' => SchedulizerEventColors::textColor( $eventData['colorHex'] ),\n 'isAlias' => (int) $eventData['isAlias'],\n 'isRepeating' => (int) $eventData['isRepeating'],\n 'repeatMethod' => $eventData['repeatTypeHandle']\n );\n }\n\n return $eventsList;\n }", "protected function format_data() {}", "public function format()\n {\n $events = array();\n\n foreach ($this->query->findAll() as $task) {\n $startDate = new DateTime();\n $startDate->setTimestamp($task[$this->startColumn]);\n\n $endDate = new DateTime();\n if (! empty($task[$this->endColumn])) {\n $endDate->setTimestamp($task[$this->endColumn]);\n }\n\n $allDay = $startDate == $endDate && $endDate->format('Hi') == '0000';\n $format = $allDay ? 'Y-m-d' : 'Y-m-d\\TH:i:s';\n\n $events[] = array(\n 'timezoneParam' => $this->timezoneModel->getCurrentTimezone(),\n 'id' => $task['id'],\n 'title' => t('#%d', $task['id']).' '.$task['title'],\n 'backgroundColor' => $this->colorModel->getBackgroundColor($task['color_id']),\n 'borderColor' => $this->colorModel->getBorderColor($task['color_id']),\n 'textColor' => 'black',\n 'url' => $this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])),\n 'start' => $startDate->format($format),\n 'end' => $endDate->format($format),\n 'editable' => $allDay,\n 'allday' => $allDay,\n );\n }\n\n return $events;\n }", "function HandleEventDatas()\n {\n $this->DatasObj(TRUE);\n\n echo\n $this->EventDatasInfoTable().\n $this->DatasObj()->EventDatasForm($this->Event()).\n \"\";\n\n \n }", "protected function queryAndFormat(){\n $columnSettings = $this->eventList->getQueryColumnSettings();\n foreach($this->eventList->get() AS $row){\n $data = new \\stdClass();\n foreach($columnSettings AS $columnName => $definition){\n switch( $definition[1] ){\n case EventList::COLUMN_CAST_BOOL:\n $data->{$columnName} = (bool)$row[$columnName];\n break;\n case EventList::COLUMN_CAST_INT:\n $data->{$columnName} = (int)$row[$columnName];\n break;\n case EventList::COLUMN_CAST_TIME:\n if( $definition[2] === EventList::COLUMN_CAST_TIME_UTC ){\n $data->{$columnName} = (new DateTime($row[$columnName], $this->timezoneUTC))->format('c');\n }else{ // $definition[2] === EventList::COLUMN_CAST_TIME_LOCAL\n $data->{$columnName} = (new DateTime($row[$columnName], new DateTimeZone($row['derivedTimezone'])))->format('c');\n }\n break;\n default:\n $data->{$columnName} = $row[$columnName];\n break;\n }\n }\n array_push($this->formatted, $data);\n }\n }", "public abstract function format(LogEvent $event);", "public function render_events() {\n\t\t$output = '';\n\t\t$events = $this->group_events_by_date( $this->get_cached_events() );\n\n\t\tif ( $events ) {\n\t\t\tob_start();\n\t\t\trequire_once( __DIR__ . '/template-events.php' );\n\t\t\t$output = ob_get_clean();\n\t\t}\n\n\t\treturn $output;\n\t}", "function make_vevent($data) {\n foreach($this->required_fields as $rf) {\n if (! isset($data[$rf]) or empty($data[$rf])) {\n throw new Exception(\"Required field $rf not found\");\n }\n }\n \n $vevent = \"BEGIN:VEVENT\\n\";\n \n foreach ($data as $field => $val) {\n if (in_array($field, $this->tz_fields)) {\n $field .= \";TZID={$this->timezone}\";\n }\n \n $vevent .= \"{$field}:{$val}\\n\";\n }\n \n $vevent .= \"END:VEVENT\\n\";\n \n return($vevent);\n }", "public function events()\n {\n $events = CalendarEvent::all();\n $result = array();\n $count=0;\n foreach($events as $ev)\n {\n $result[$count]['id']=$ev->id;\n $result[$count]['title']=$ev->name;\n $result[$count]['start']=$ev->init_at;\n $result[$count]['end']=$ev->end_at;\n $result[$count]['allDay']=$ev->all_day;\n $result[$count]['forceEventDuration']=true;\n $result[$count]['backgroundColor']=$ev->backgroundcolor;\n $count++;\n }\n echo json_encode($result);\n }", "public function getFormattedMicrodata()\n {\n $timezoneDateTime = new \\UNL\\UCBCN\\TimezoneDateTime($this->eventdatetime->timezone);\n $location = $this->eventdatetime->getLocation();\n $webcast = $this->eventdatetime->getWebcast();\n $data = array();\n $type_string = '@type';\n\n $data['@context'] = 'https://schema.org';\n $data[$type_string] = 'Event';\n $data['name'] = $this->event->title;\n\n if (isset($this->event->description)) {\n $data['description'] = $this->event->description;\n }\n\n if (isset($this->event->imageurl)) {\n $data['image'] = array(\n $this->event->imageurl,\n );\n }\n\n if ($this->isAllDay()) {\n $data['startDate'] = date('m-d-Y', strtotime( $this->getStartTime()));\n } else {\n $start_date_iso1801 = $timezoneDateTime->format($this->getStartTime(), DATE_ATOM);\n $end_date_iso1801 = $timezoneDateTime->format($this->getEndTime(), DATE_ATOM);\n $data['startDate'] = $start_date_iso1801;\n if ($start_date_iso1801 != $end_date_iso1801) {\n $data['endDate'] = $end_date_iso1801;\n }\n }\n\n $data['eventStatus'] = $this->event->isCanceled($this) ?\n 'https://schema.org/EventCancelled' : 'https://schema.org/EventScheduled';\n\n if (isset($this->eventdatetime->location_id) && isset($this->eventdatetime->webcast_id)) {\n $data['eventAttendanceMode'] = 'https://schema.org/MixedEventAttendanceMode';\n } elseif (isset($this->eventdatetime->location_id) && !isset($this->eventdatetime->webcast_id)) {\n $data['eventAttendanceMode'] = 'https://schema.org/OfflineEventAttendanceMode';\n } else {\n $data['eventAttendanceMode'] = 'https://schema.org/OnlineEventAttendanceMode';\n }\n\n $data['location'] = array();\n if (isset($this->eventdatetime->location_id) && $location !== false) {\n $location_data = array();\n $location_data[$type_string] = 'Place';\n $location_data['name'] = $location->name;\n $location_data['address'] = array(\n $type_string => 'PostalAddress',\n 'streetAddress' => $location->streetaddress1 . ((isset($location->streetaddress2)) ?\n ' ' . $location->streetaddress2 : ''),\n 'postalCode' => $location->zip,\n 'addressRegion' => $location->state,\n 'addressCountry' => 'US',\n );\n\n $data['location'][] = $location_data;\n }\n\n if (isset($this->eventdatetime->webcast_id) && $webcast !== false) {\n $webcast_data = array();\n $webcast_data[$type_string] = 'VirtualLocation';\n $webcast_data['url'] = $webcast->url;\n\n $data['location'][] = $webcast_data;\n }\n\n if (isset($this->event->imagedata)) {\n $data['image'] = array();\n $data['image'][] = \\UNL\\UCBCN\\Frontend\\Controller::$url . '?image&amp;id=' . $this->event->id;\n }\n\n if (isset($this->event->listingcontacttype)) {\n $data['organizer'] = array();\n if ($this->event->listingcontacttype === 'person') {\n $data['organizer'][$type_string] = 'Person';\n } else {\n $data['organizer'][$type_string] = 'organization';\n }\n $data['organizer']['name'] = $this->event->listingcontactname;\n $data['organizer']['url'] = $this->event->listingcontacturl;\n }\n\n return $data;\n }", "function event2array($event)\n\t{\n\t\t$var['title'] = Array(\n\t\t\t'field'\t\t=> lang('Title'),\n\t\t\t'data'\t\t=> $event['title']\n\t\t);\n\n\t\t$var['description'] = Array(\n\t\t\t'field'\t=> lang('Description'),\n\t\t\t'data'\t=> $event['description']\n\t\t);\n\n\t\tforeach(explode(',',$event['category']) as $cat_id)\n\t\t{\n\t\t\tlist($cat) = $GLOBALS['egw']->categories->return_single($cat_id);\n\t\t\t$cat_string[] = stripslashes($cat['name']);\n\t\t}\n\t\t$var['category'] = Array(\n\t\t\t'field'\t=> lang('Category'),\n\t\t\t'data'\t=> implode(', ',$cat_string)\n\t\t);\n\n\t\t$var['location'] = Array(\n\t\t\t'field'\t=> lang('Location'),\n\t\t\t'data'\t=> $event['location']\n\t\t);\n\n\t\t$var['startdate'] = Array(\n\t\t\t'field'\t=> lang('Start Date/Time'),\n\t\t\t'data'\t=> $this->format_date($event['start']),\n\t\t);\n\n\t\t$var['enddate'] = Array(\n\t\t\t'field'\t=> lang('End Date/Time'),\n\t\t\t'data'\t=> $this->format_date($event['end']),\n\t\t);\n\n\t\t$pri = Array(\n\t\t\t0 => lang('None'),\n\t\t\t1\t=> lang('Low'),\n\t\t\t2\t=> lang('Normal'),\n\t\t\t3\t=> lang('High')\n\t\t);\n\t\t$var['priority'] = Array(\n\t\t\t'field'\t=> lang('Priority'),\n\t\t\t'data'\t=> $pri[$event['priority']]\n\t\t);\n\n\t\t$var['owner'] = Array(\n\t\t\t'field'\t=> lang('Owner'),\n\t\t\t'data'\t=> common::grab_owner_name($event['owner'])\n\t\t);\n\n\t\t$var['updated'] = Array(\n\t\t\t'field'\t=> lang('Updated'),\n\t\t\t'data'\t=> $this->format_date($event['modtime']).', '.common::grab_owner_name($event['modifier'])\n\t\t);\n\n\t\t$var['access'] = Array(\n\t\t\t'field'\t=> lang('Access'),\n\t\t\t'data'\t=> $event['public'] ? lang('Public') : lang('Private')\n\t\t);\n\n\t\tif (isset($event['participants']) && is_array($event['participants']) && !empty($event['participants']))\n\t\t{\n\t\t\t$participants = $this->participants($event,true);\n\t\t}\n\t\t$var['participants'] = Array(\n\t\t\t'field'\t=> lang('Participants'),\n\t\t\t'data'\t=> $participants\n\t\t);\n\n\t\t// Repeated Events\n\t\t$var['recur_type'] = Array(\n\t\t\t'field'\t=> lang('Repetition'),\n\t\t\t'data'\t=> ($event['recur_type'] != MCAL_RECUR_NONE) ? $this->recure2string($event) : '',\n\t\t);\n\t\treturn $var;\n\t}", "public function format($data);", "private function parseEvents()\n\t{\n\t\t// Fetch and compile events (we don't care if none are available)\n\t\t$objEvents = $this->Database->prepare(\"SELECT * FROM tl_timeline_event WHERE published=1 AND pid=? ORDER BY start DESC\")->execute($this->Timeline->id);\n\t\t\n\t\t$arrEvents = array();\n\t\twhile( $objEvents->next() )\n\t\t{\n\t\t\t$strEvent = sprintf('\n{\n title: \"%s\",\n durationEvent: %s,\n start: \"%s\"%s%s%s%s%s%s%s%s%s%s%s%s\n}',\n\t\t\t\tstr_replace(array('\"', \"\\n\", \"\\r\"), array('\\\"', ' ', ' '), $objEvents->title),\n\t\t\t\t($objEvents->durationEvent && $objEvents->end > 0 ? 'true' : 'false'),\n\t\t\t\t$objEvents->start,\n\t\t\t\t(($objEvents->durationEvent && strlen($objEvents->latestStart)) ? \",\\n\".' latestStart: \"' . $objEvents->latestStart . '\"' : ''),\n\t\t\t\t(strlen($objEvents->end) ? \",\\n\".' end: \"' . $objEvents->end . '\"' : ''),\n\t\t\t\t(($objEvents->durationEvent && strlen($objEvents->earliestEnd)) ? \",\\n\".' earliestEnd: \"' . $objEvents->earliestEnd . '\"' : ''),\n\t\t\t\t(strlen($objEvents->caption) ? \",\\n\".' caption: \"'.str_replace(array('\"', \"\\n\", \"\\r\"), array('\\\"', ' ', ' '), $objEvents->caption).'\"' : ''),\n\t\t\t\t(strlen($objEvents->description) ? \",\\n\".' description: \"'.str_replace(array('\"', \"\\n\", \"\\r\"), array('\\\"', ' ', ' '), $objEvents->description).'\"' : ''),\n\t\t\t\t(strlen($objEvents->icon) ? \",\\n\".' icon: \"'.$objEvents->icon.'\"' : ''),\n\t\t\t\t(strlen($objEvents->image) ? \",\\n\".' image: \"'.$objEvents->image.'\"' : ''),\n\t\t\t\t(strlen($objEvents->link) ? \",\\n\".' link: \"'.$objEvents->link.'\"' : ''),\n\t\t\t\t(strlen($objEvents->color) ? \",\\n\".' color: \"'.$objEvents->color.'\"' : ''),\n\t\t\t\t(strlen($objEvents->textColor) ? \",\\n\".' textColor: \"'.$objEvents->textColor.'\"' : ''),\n\t\t\t\t(strlen($objEvents->tapeImage) ? \",\\n\".' tapeImage: \"'.$objEvents->tapeImage.'\"' . \",\\n\".' tapeRepeat: \"'.str_replace(\"'\", \"\\'\", $objEvents->tapeRepeat).'\"' : ''),\n\t\t\t\t(strlen($objEvents->cssClass) ? \",\\n\".' classname: \"'.$objEvents->cssClass.'\"' : '')\n\t\t\t);\n\n\t\t\t$arrEvents[] = $strEvent;\n\t\t}\n\t\t\n\t\treturn $arrEvents;\n\t}", "public function eventDetails()\n {\n return [\n 'name' => 'Event',\n 'description' => 'Event description',\n 'group' => 'groupcode',\n ];\n }", "public function toArray() {\n $event = array();\n $event['id'] = $this->id;\n\n $event['title'] = $this->title;\n\n if ($this->startDatetime !== null) {\n $event['start'] = $this->startDatetime->format(\"Y-m-d\\TH:i:s\");\n// $event['start'] = $this->startDatetime->format(\"Y-m-d\\TH:i:s\\Z\");\n }\n\n if ($this->endDatetime !== null) {\n $event['end'] = $this->endDatetime->format(\"Y-m-d\\TH:i:s\");\n// $event['end'] = $this->endDatetime->format(\"Y-m-d\\TH:i:s\\Z\");\n }\n\n if ($this->url !== null) {\n $event['url'] = false;\n }\n\n if ($this->bgColor !== null) {\n $event['backgroundColor'] = $this->bgColor;\n $event['borderColor'] = $this->bgColor;\n }\n\n if ($this->fgColor !== null) {\n $event['textColor'] = $this->fgColor;\n }\n\n if ($this->cssClass !== null) {\n $event['className'] = $this->cssClass;\n }\n\n $event['allDay'] = $this->isAllDay;\n\n// foreach ($this->otherFields as $field => $value) {\n// $event[$field] = $value;\n// }\n\n return $event;\n }", "function render() {\r\n\r\n $timeSeries = null;\r\n $tempArray = array();\r\n foreach($this->constructorOptions as $key => $value) {\r\n if ($key === 'dataSource') {\r\n $tempArray['dataSource'] = '__dataSource__';\r\n } else {\r\n $tempArray[$key] = $value;\r\n }\r\n }\r\n\r\n $jsonEncodedOptions = json_encode($tempArray);\r\n\r\n if (is_object($this->constructorOptions['dataSource']))\r\n { \r\n if (get_class($this->constructorOptions['dataSource']) === 'TimeSeries'){\r\n $timeSeries = $this->constructorOptions['dataSource'];\r\n }\r\n } else {\r\n\r\n $dataFormat = $this->constructorOptions['dataFormat'];\r\n\r\n if ($dataFormat === 'json') {\r\n $jsonEncodedOptions = preg_replace('/\\\"__dataSource__\\\"/', $this->constructorOptions['dataSource'], $jsonEncodedOptions);\r\n } elseif ($dataFormat === 'xml') { \r\n $jsonEncodedOptions = preg_replace('/\\\"__dataSource__\\\"/', '\\'__dataSource__\\'', $jsonEncodedOptions);\r\n $jsonEncodedOptions = preg_replace('/__dataSource__/', $this->constructorOptions['dataSource'], $jsonEncodedOptions);\r\n } elseif ($dataFormat === 'xmlurl') {\r\n $jsonEncodedOptions = preg_replace('/__dataSource__/', $this->constructorOptions['dataSource'], $jsonEncodedOptions);\r\n } elseif ($dataFormat === 'jsonurl') {\r\n $jsonEncodedOptions = preg_replace('/__dataSource__/', $this->constructorOptions['dataSource'], $jsonEncodedOptions);\r\n } \r\n }\r\n\r\n $tempData = preg_replace('/__constructorOptions__/', $jsonEncodedOptions, $this->constructorTemplate);\r\n foreach($this->eventOptions as $key => $value) {\r\n $tempEvtTmp = preg_replace('/__chartId__/', $this->constructorOptions['id'], $this->eventTemplate);\r\n $tempEvtTmp = preg_replace('/_fceventname_/', $key, $tempEvtTmp);\r\n $tempEvtTmp = preg_replace('/_fceventbody_/', $value, $tempEvtTmp); \r\n $tempData .= $tempEvtTmp;\r\n }\r\n $tempData .= preg_replace('/__chartId__/', $this->constructorOptions['id'], $this->renderTemplate);\r\n $renderHTML = preg_replace('/__FC__/', $tempData, $this->baseTemplate); \r\n\r\n if ($timeSeries){\r\n $renderHTML = preg_replace('/__FT__/', $timeSeries->GetDataStore(), $renderHTML);\r\n $renderHTML = preg_replace('/\\\"__dataSource__\\\"/', $timeSeries->GetDataSource(), $renderHTML); \r\n }else{\r\n $renderHTML = preg_replace('/__FT__/', '', $renderHTML);\r\n }\r\n\r\n echo $renderHTML;\r\n }", "public function buildEvent()\n\t{\n\t\treturn [\n\t\t\t'title' => $this->title,\n\t\t\t'start' => $this->start,\n\t\t\t'end' => $this->end,\n\t\t\t'model' => $this->model,\n\t\t\t'foreign_key' => $this->foreignKey,\n\t\t];\n\t}", "function read_event($idevent) { \n\n\t// Query on 'idevent'\n\t$sql = \"\nSELECT title, description, image, startdatetime, enddatetime, pricerange, createdby, food, party, culture, username,streetname, number, postalcode, city, country\nFROM events E INNER JOIN users U on (E.createdby = U.idusers)\nINNER JOIN addresses A on (A.idaddresses = E.address)\nWHERE idevents = $idevent\n\";\n\t$result = mysql_query($sql) or die(\"Could not query\\n$sql\\n$result\");\n\n\t// If there are results (should onle be one row, though)\n\tif(mysql_num_rows($result)){\n\t\n\t\t// Grab first row\n\t\t$row=mysql_fetch_array($result);\n\t\n\t\t$data = array(\n\t\t'title' \t\t=> $row['title'],\n\t\t'description' \t=> $row['description'],\n\t\t'image' \t\t=> $row['image'],\n\t\t'startdatetime'\t=> $row['startdatetime'],\n\t\t'enddatetime' \t=> $row['enddatetime'],\n\t\t'pricerange' \t=> $row['pricerange'],\n\t\t'createdby' \t=> $row['createdby'],\n\t 'address' \t\t=> $row['address'],\n\t\t'food' \t\t\t=> $row['food'],\n\t\t'party' \t\t=> $row['party'],\n\t\t'culture' \t\t=> $row['culture'],\n\t\t'username' \t\t=> $row['username'],\n\t\t'address' => $row['streetname'].' '.$row['number'].', '.$row['postalcode'].' '.$row['city'].', '.$row['country'],\n\t\t'addressrule1' => $row['streetname'].' '.$row['number'],\n\t\t'addressrule2' => $row['postalcode'].' '.$row['city'],\n\t\t'addressrule3' => $row['country']\n\t\t);\n\t\t// Encode and echo the data\n\t\techo '{\"events\":';\n\t\techo json_encode($data);\n\t\techo '}';\n\t\t\n\t} else {\n\t\t// Nothing returned? Echo empty JSON\n\t\techo '{\"error\":\"No event found for given id\"}';\n\t}\n\t\n}", "public static function register_event_format() {\n\n\t\t// Define Event Format arguments\n\t\t$args = array(\n\t\t\t'labels' => array(\n\t\t\t\t'name' => __( 'Format', 'total' ),\n\t\t\t\t'singular_name' => __( 'Format', 'total' ),\n\t\t\t\t'menu_name' => __( 'Format', 'total' ),\n\t\t\t\t'search_items' => __( 'Search', 'total' ),\n\t\t\t\t'popular_items' => __( 'Popular', 'total' ),\n\t\t\t\t'all_items' => __( 'All', 'total' ),\n\t\t\t\t'parent_item' => __( 'Parent', 'total' ),\n\t\t\t\t'parent_item_colon' => __( 'Parent', 'total' ),\n\t\t\t\t'edit_item' => __( 'Edit', 'total' ),\n\t\t\t\t'update_item' => __( 'Update', 'total' ),\n\t\t\t\t'add_new_item' => __( 'Add New', 'total' ),\n\t\t\t\t'new_item_name' => __( 'New', 'total' ),\n\t\t\t\t'separate_items_with_commas' => __( 'Separate with commas', 'total' ),\n\t\t\t\t'add_or_remove_items' => __( 'Add or remove', 'total' ),\n\t\t\t\t'choose_from_most_used' => __( 'Choose from the most used', 'total' ),\n\t\t\t),\n\t\t\t'public' => false,\n\t\t\t'show_in_nav_menus' => false,\n\t\t\t'show_ui' => true,\n\t\t\t'show_in_rest' => false,\n\t\t\t'show_admin_column' => true,\n\t\t\t'show_tagcloud' => false,\n\t\t\t'hierarchical' => true,\n\t\t\t'rewrite' => false,\n\t\t\t'query_var' => false,\n\t\t);\n\n\t\tregister_taxonomy( self::get_format_slug(), array( self::get_event_slug() ), $args );\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the latest version number of WordPress core.
public static function get_latest_core_version() { $url = 'https://api.wordpress.org/core/version-check/1.7/'; $data = self::get_object( $url ); if ( false === $data ) { return $data; } if ( isset( $data->offers ) ) { return $data->offers[0]->version; } return false; }
[ "private function get_latest_major_wordpress_version()\n {\n }", "protected function get_installed_core_version() {\n\t\tglobal $wp_version;\n\n\t\treturn $wp_version;\n\t}", "public function get_latest_version_number() {\n\n\t\t// Get current ClassicPress version, if stored.\n\t\t$version = get_transient('codepotent_update_manager_cp_version');\n\n\t\t// Return version number, if now known.\n\t\tif (false !== $version) {\n\t\t\treturn $version;\n\t\t}\n\n\t\t// Make a request to the ClassicPress versions API.\n\t\t$response = wp_remote_get('https://api-v1.classicpress.net/upgrade/index.php', ['timeout'=>3]);\n\n\t\t// Problems? Bail.\n\t\tif (is_wp_error($response) || empty($response)) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Get decoded reponse.\n\t\t$versions = json_decode(wp_remote_retrieve_body($response));\n\n\t\t// Reverse iterate to find the latest version.\n\t\tfor ($i=count($versions)-1; $i>0; $i--) {\n\t\t\tif (!strpos($versions[$i], 'nightly')) {\n\t\t\t\tif (!strpos($versions[$i], 'alpha')) {\n\t\t\t\t\tif (!strpos($versions[$i], 'beta')) {\n\t\t\t\t\t\tif (!strpos($versions[$i], 'rc')) {\n\t\t\t\t\t\t\t$version = $versions[$i];\n\t\t\t\t\t\t\tbreak;\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} // At this point, $version = 1.1.1.json\n\n\t\t// Get just the version portion of the string.\n\t\tif ($version) {\n\t\t\t$version = str_replace('.json', '', $version);\n\t\t}\n\n\t\t// A transient ensures the query is not run more than every 6 hours.\n\t\tset_transient('codepotent_update_manager_cp_version', $version, HOUR_IN_SECONDS * 6);\n\t\tupdate_option('cp_latest_version', $version);\n\n\t\t// Return the version string.\n\t\treturn $version;\n\n\t}", "function _pantheon_get_latest_wordpress_version() {\n\t$core_updates = get_core_updates( array('dismissed' => false) );\n\n\tif( ! is_array($core_updates) || empty($core_updates) || ! property_exists($core_updates[0], 'current' ) ){\n\t\treturn null;\n\t}\n\n\treturn $core_updates[0]->current;\n}", "final public function get_version() {\n\t\treturn $this->get_arg_or_plugin_data( 'version', 'Version' );\n\t}", "function get_version_number() {\n\tglobal $ofy, $versionclass;\n\t$version = $ofy->query($versionclass)->filter('id', '1')->get();\n\tif ($version == null) {\n\t\t$version = new Version('1', '0');\n\t\t$ofy->put($version);\n\t}\n\treturn $version->getVersion();\n}", "private function _get_latest_version() {\n\t\t\tif ( $this->__get( 'cache' ) ) {\n\t\t\t\t$this->latest_version = $this->cache->latest_version;\n\t\t\t}\n\n\t\t\tif ( empty( $this->latest_version ) ) {\n\t\t\t\t$update_engine = SLP_AddOn_Updates::get_instance();\n\t\t\t\t$this->latest_version = $update_engine->getRemote_version( $this->slug );\n\t\t\t\t$this->cache_me_if_you_can();\n\t\t\t}\n\t\t\treturn $this->latest_version;\n\t\t}", "public static function version()\n {\n if (!isset($GLOBALS['wp_version'])) {\n require_once ABSPATH . WPINC . '/version.php';\n }\n\n return $GLOBALS['wp_version'];\n }", "function get_current_version() {\n\t\tglobal $wp_version;\n\n\t\t// Preference for the value saved as an option.\n\t\t$current_version = get_option( 'wp_parser_imported_wp_version' );\n\n\t\t// Otherwise, assume the value stored in a constant (which is set on WP.org), if defined.\n\t\tif ( empty( $current_version ) && defined( 'BP_CORE_LATEST_RELEASE' ) && BP_CORE_LATEST_RELEASE ) {\n\t\t\t$current_version = BP_CORE_LATEST_RELEASE;\n\t\t}\n\n\t\t// Otherwise, use the version of the running WP instance.\n\t\tif ( empty( $current_version ) ) {\n\t\t\t$current_version = $wp_version;\n\n\t\t\t// However, if the running WP instance appears to not be a release\n\t\t\t// version, assume a hardcoded version that is at least valid.\n\t\t\tif ( false !== strpos( $current_version, '-' ) ) {\n\t\t\t\t$current_version = '3.9.1';\n\t\t\t}\n\t\t}\n\n\t\treturn $current_version;\n\t}", "private function get_wordpress_version()\n {\n }", "public function getLatestVersion(){\r\n return $this->_aInfos['latest_version'];\r\n }", "public function get_wordpress_version()\n {\n }", "public function getVersionString() {\n\t\tif ($this->installedVersion === 'core') {\n\t\t\treturn Cgn_SystemRunner::getReleaseNumber();\n\t\t}\n\t\treturn $this->installedVersion;\n\t}", "public function getLastVersionNumber();", "public static function getLatestModuleVersion()\n {\n $value = Configuration::getGlobalValue(static::SETTINGS_LATEST_MODULE_VERSION);\n if ($value) {\n return $value;\n }\n return '0.0.0';\n }", "public function getLatestVersion();", "static public function get_last_version() {\r\n\t\t\t$options = self::get_options();\r\n\t\t \treturn $options['last_version'];\r\n\t\t}", "function getLatestVersion() {\n\t$result = '';\n\n\t$curl = curl_init(WP_API_URL);\n\tcurl_setopt($curl, CURLOPT_FAILONERROR, true); \n\tcurl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); \n\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, true); \n\t$response = curl_exec($curl);\n\n\tif (!empty($response)) {\n\t\t$response = unserialize($response);\n\t}\n\n\tif (!empty($response['offers'][0]['current'])) {\n\t\t$result = $response['offers'][0]['current'];\n\t}\n\n\treturn $result;\n}", "public function get_wp_version() {\n\t\treturn $this->wp_version;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the label HTML attributes.
public function getLabelAttributes() { return $this->labelAttributes; }
[ "public function get_label_attributes() {\n\t\treturn array(\n\t\t\t'for' => $this->args['slug'],\n\t\t\t'class' => array(\n\t\t\t\t'formation-field-label',\n\t\t\t),\n\t\t);\n\t}", "public function getLabelAttributes();", "public function attributes()\n {\n $rules_labels = User::$labels;\n return $rules_labels;\n }", "public function getMarkupAttributes();", "public function attributeLabels()\r\n\t {\r\n\t return [\r\n\t ];\r\n\t }", "protected function getLabel()\n\t{\n\t\treturn array_get(trans('attributes'), $this->name, function () {\n\t\t\treturn Str::title(str_replace('_', ' ', Str::snake($this->name)));\n\t\t});\n\t}", "protected function get_label_tag() {\n\t\treturn $this->get_tag( 'label', $this->get_label_attributes() );\n\t}", "public function getHtmlAttributes() {}", "public function getHtmlAttributes();", "public function get_html() {\n\t\n\t\t$html = '<label';\n\t\t\t\n\t\tif( isset( $this->element ) ) {\n\t\t\t$html .= ' for=\"' . $this->element . '\"';\n\t\t}\n\t\n\t\tif( !empty( $this->attributes ) ) {\n\t\t\t$html .= ' ';\n\t\t\tforeach( $this->attributes as $attribute ) {\n\t\t\t\t$html .= $attribute->name . '=\"' . $attribute->value . '\" ';\n\t\t\t}\n\t\t}\n\t\n\t\t$html .= '>' . $this->content . '</label>';\n\t\n\t\treturn $html;\n\t}", "function setLabelAttributes($labelAttributes);", "protected function attributeLabels()\n\t{\n\t\treturn array();\n\t}", "public function attributeLabels()\n {\n \n }", "public function renderAttributeLabel()\n\t{\n\t\tif($this->displayAttributeLabel===true)\n\t\t{\n\t\t\t$labels = $this->model->attributeLabels();\n\t\t\t$attribute = $this->attribute;\n\t\t\tif(isset($labels[$attribute]))\n\t\t\t{\n\t\t\t\treturn $labels[$attribute];\n\t\t\t}\n\t\t\treturn $attribute;\n\t\t}\n\t}", "public function get_option_label_html(){\n\t\t$html = \"\";\n\t\t$classes = $this->get_label_html_classes();\n\t\t$required = $this->required ? \"*\" : \"\";\n\t\t$html .= \"<label class='$classes' for='{$this->id}'>{$this->label}{$required}</label>\";\n\t\treturn $html;\n\t}", "public function getElementLabelHtml()\r\n\t{\r\n\t\treturn $this->getElement()->getLabelHtml();\r\n\t}", "public function getElementLabelHtml()\r\n {\r\n return $this->getElement()->getLabelHtml();\r\n }", "public function getLabel()\n\t{\n\t\t$this->setId();\n\t\t$label = $this->makeHtmlSafe( $this->label );\n\t\t$classes[] = ( isset( $this->attributes['required'] ) ) ? 'required' : '';\n\t\t$classes[] = ( ! empty( $this->errors ) ) ? 'attention' : '';\n\t\t$classes = implode( ' ', $classes );\n\t\t$id = ( isset( $this->attributes['id'] ) ) ? $this->attributes['id'] : '';\n\t\treturn \"<label for='{$id}' class='{$classes}'>{$label}</label>\\n\";\n\t}", "public function getLabel()\n {\n $open_html = \"<div class=\\\"control-label\\\"><span class=\\\"span-label\\\">\";\n $close_html = '</span></div>';\n $html = '';\n $label = $this->currentField->getLabelOption();\n\n if ($label) {\n $label = $this->currentField->getSetting( 'label' );\n\t $label .= $this->currentField->getSetting( 'required' ) ? '*' : '';\n $html = \"{$open_html}{$label} {$close_html}\";\n }\n\n return $html;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Animation Easing The easing function applied to the animation. The following options are available: 'linear' Constant speed. 'in' Ease in Start slow and speed up. 'out' Ease out Start fast and slow down. 'inAndOut' Ease in and out Start slow, speed up, then slow down.
public function animationEasing($easing = 'linear') { $values = array('linear', 'in', 'out', 'inAndOut'); if(in_array($easing, $values)) { $this->easing = $easing; return $this; } else { Gcharts::_set_error(get_class($this), 'Invalid animationEasing value, must be (string) '.$this->_array_string($values)); } return $this; }
[ "public function setEasing($value) {\n\t\t$this->setParamCtrl(\"easing\", $value, array (\n\t\t\t\t\"linear\",\n\t\t\t\t\"swing\",\n\t\t\t\t\"easeInQuad\",\n\t\t\t\t\"easeOutQuad\",\n\t\t\t\t\"easeInOutQuad\",\n\t\t\t\t\"easeInCubic\",\n\t\t\t\t\"easeOutCubic\",\n\t\t\t\t\"easeInOutCubic\",\n\t\t\t\t\"easeInQuart\",\n\t\t\t\t\"easeOutQuart\",\n\t\t\t\t\"easeInOutQuart\",\n\t\t\t\t\"easeInQuint\",\n\t\t\t\t\"easeOutQuint\",\n\t\t\t\t\"easeInOutQuint\",\n\t\t\t\t\"easeInExpo\",\n\t\t\t\t\"easeOutExpo\",\n\t\t\t\t\"easeInOutExpo\",\n\t\t\t\t\"easeInSine\",\n\t\t\t\t\"easeOutSine\",\n\t\t\t\t\"easeInOutSine\",\n\t\t\t\t\"easeInCirc\",\n\t\t\t\t\"easeOutCirc\",\n\t\t\t\t\"easeInOutCirc\",\n\t\t\t\t\"easeInElastic\",\n\t\t\t\t\"easeOutElastic\",\n\t\t\t\t\"easeInOutElastic\",\n\t\t\t\t\"easeInBack\",\n\t\t\t\t\"easeOutBack\",\n\t\t\t\t\"easeInOutBack\",\n\t\t\t\t\"easeInBounce\",\n\t\t\t\t\"easeOutBounce\",\n\t\t\t\t\"easeInOutBounce\" \n\t\t));\n\t}", "public function getAnimationEasingName()\n {\n switch ($this->getAttribute('animationEasing')) {\n case 'easeInQuad':\n case 'easeInCubic':\n case 'easeInQuart':\n case 'easeInQuint':\n case 'easeInSine':\n case 'easeInExpo':\n case 'easeInCirc':\n case 'easeInBack':\n case 'easeOutQuad':\n case 'easeOutCubic':\n case 'easeOutQuart':\n case 'easeOutQuint':\n case 'easeOutSine':\n case 'easeOutExpo':\n case 'easeOutCirc':\n case 'easeOutBack':\n case 'easeInBounce':\n case 'easeInOutQuad':\n case 'easeInOutCubic':\n case 'easeInOutQuart':\n case 'easeInOutQuint':\n case 'easeInOutSine':\n case 'easeInOutExpo':\n case 'easeInOutCirc':\n case 'easeInOutBack':\n case 'easeInOutBounce':\n case 'easeOutBounce':\n case 'easeOutInQuad':\n case 'easeOutInCubic':\n case 'easeOutInQuart':\n case 'easeOutInQuint':\n case 'easeOutInSine':\n case 'easeOutInExpo':\n case 'easeOutInCirc':\n case 'easeOutInBack':\n case 'easeOutInBounce':\n return $this->getAttribute('animationEasing');\n\n default:\n return 'easeOutExpo';\n }\n }", "public function setEasing($easing) {\n if ($easing != self::EASING_IN && $easing != self::EASING_IN_AND_OUT &&\n $easing != self::EASING_LINEAR && $easing != self::EASING_OUT &&\n $easing != null) {\n throw new \\InvalidArgumentException(\"Argument \\\"easing\\\" is invalid\");\n }\n $this->setOption(\"easing\", $easing);\n }", "public static function get_easing_options() : array {\n\t\treturn siw_get_data( 'animation/easings' );\n\t}", "public function setUseEasing($useEasing)\r\r\n\t{\r\r\n\t\tif(is_bool($useEasing))\r\r\n\t\t\t$this->_useEasing = $useEasing;\r\r\n\t}", "public function getArrEasing(){ //true\n\n\t\t\t$arrEasing = array(\n\t\t\t\t\"Linear.easeNone\" => \"Linear.easeNone\",\n\t\t\t\t\"Power0.easeIn\" => \"Power0.easeIn (linear)\",\n\t\t\t\t\"Power0.easeInOut\" => \"Power0.easeInOut (linear)\",\n\t\t\t\t\"Power0.easeOut\" => \"Power0.easeOut (linear)\",\n\t\t\t\t\"Power1.easeIn\" => \"Power1.easeIn\",\n\t\t\t\t\"Power1.easeInOut\" => \"Power1.easeInOut\",\n\t\t\t\t\"Power1.easeOut\" => \"Power1.easeOut\",\n\t\t\t\t\"Power2.easeIn\" => \"Power2.easeIn\",\n\t\t\t\t\"Power2.easeInOut\" => \"Power2.easeInOut\",\n\t\t\t\t\"Power2.easeOut\" => \"Power2.easeOut\",\n\t\t\t\t\"Power3.easeIn\" => \"Power3.easeIn\",\n\t\t\t\t\"Power3.easeInOut\" => \"Power3.easeInOut\",\n\t\t\t\t\"Power3.easeOut\" => \"Power3.easeOut\",\n\t\t\t\t\"Power4.easeIn\" => \"Power4.easeIn\",\n\t\t\t\t\"Power4.easeInOut\" => \"Power4.easeInOut\",\n\t\t\t\t\"Power4.easeOut\" => \"Power4.easeOut\",\n\t\t\t\t\"Quad.easeIn\" => \"Quad.easeIn (same as Power1.easeIn)\",\n\t\t\t\t\"Quad.easeInOut\" => \"Quad.easeInOut (same as Power1.easeInOut)\",\n\t\t\t\t\"Quad.easeOut\" => \"Quad.easeOut (same as Power1.easeOut)\",\n\t\t\t\t\"Cubic.easeIn\" => \"Cubic.easeIn (same as Power2.easeIn)\",\n\t\t\t\t\"Cubic.easeInOut\" => \"Cubic.easeInOut (same as Power2.easeInOut)\",\n\t\t\t\t\"Cubic.easeOut\" => \"Cubic.easeOut (same as Power2.easeOut)\",\n\t\t\t\t\"Quart.easeIn\" => \"Quart.easeIn (same as Power3.easeIn)\",\n\t\t\t\t\"Quart.easeInOut\" => \"Quart.easeInOut (same as Power3.easeInOut)\",\n\t\t\t\t\"Quart.easeOut\" => \"Quart.easeOut (same as Power3.easeOut)\",\n\t\t\t\t\"Quint.easeIn\" => \"Quint.easeIn (same as Power4.easeIn)\",\n\t\t\t\t\"Quint.easeInOut\" => \"Quint.easeInOut (same as Power4.easeInOut)\",\n\t\t\t\t\"Quint.easeOut\" => \"Quint.easeOut (same as Power4.easeOut)\",\n\t\t\t\t\"Strong.easeIn\" => \"Strong.easeIn (same as Power4.easeIn)\",\n\t\t\t\t\"Strong.easeInOut\" => \"Strong.easeInOut (same as Power4.easeInOut)\",\n\t\t\t\t\"Strong.easeOut\" => \"Strong.easeOut (same as Power4.easeOut)\",\n\t\t\t\t\"Back.easeIn\" => \"Back.easeIn\",\n\t\t\t\t\"Back.easeInOut\" => \"Back.easeInOut\",\n\t\t\t\t\"Back.easeOut\" => \"Back.easeOut\",\n\t\t\t\t\"Bounce.easeIn\" => \"Bounce.easeIn\",\n\t\t\t\t\"Bounce.easeInOut\" => \"Bounce.easeInOut\",\n\t\t\t\t\"Bounce.easeOut\" => \"Bounce.easeOut\",\n\t\t\t\t\"Circ.easeIn\" => \"Circ.easeIn\",\n\t\t\t\t\"Circ.easeInOut\" => \"Circ.easeInOut\",\n\t\t\t\t\"Circ.easeOut\" => \"Circ.easeOut\",\n\t\t\t\t\"Elastic.easeIn\" => \"Elastic.easeIn\",\n\t\t\t\t\"Elastic.easeInOut\" => \"Elastic.easeInOut\",\n\t\t\t\t\"Elastic.easeOut\" => \"Elastic.easeOut\",\n\t\t\t\t\"Expo.easeIn\" => \"Expo.easeIn\",\n\t\t\t\t\"Expo.easeInOut\" => \"Expo.easeInOut\",\n\t\t\t\t\"Expo.easeOut\" => \"Expo.easeOut\",\n\t\t\t\t\"Sine.easeIn\" => \"Sine.easeIn\",\n\t\t\t\t\"Sine.easeInOut\" => \"Sine.easeInOut\",\n\t\t\t\t\"Sine.easeOut\" => \"Sine.easeOut\",\n\t\t\t\t\"SlowMo.ease\" => \"SlowMo.ease\",\n\t\t\t\t//add old easings\n\t\t\t\t\"easeOutBack\" => \"easeOutBack\",\n\t\t\t\t\"easeInQuad\" => \"easeInQuad\",\n\t\t\t\t\"easeOutQuad\" => \"easeOutQuad\",\n\t\t\t\t\"easeInOutQuad\" => \"easeInOutQuad\",\n\t\t\t\t\"easeInCubic\" => \"easeInCubic\",\n\t\t\t\t\"easeOutCubic\" => \"easeOutCubic\",\n\t\t\t\t\"easeInOutCubic\" => \"easeInOutCubic\",\n\t\t\t\t\"easeInQuart\" => \"easeInQuart\",\n\t\t\t\t\"easeOutQuart\" => \"easeOutQuart\",\n\t\t\t\t\"easeInOutQuart\" => \"easeInOutQuart\",\n\t\t\t\t\"easeInQuint\" => \"easeInQuint\",\n\t\t\t\t\"easeOutQuint\" => \"easeOutQuint\",\n\t\t\t\t\"easeInOutQuint\" => \"easeInOutQuint\",\n\t\t\t\t\"easeInSine\" => \"easeInSine\",\n\t\t\t\t\"easeOutSine\" => \"easeOutSine\",\n\t\t\t\t\"easeInOutSine\" => \"easeInOutSine\",\n\t\t\t\t\"easeInExpo\" => \"easeInExpo\",\n\t\t\t\t\"easeOutExpo\" => \"easeOutExpo\",\n\t\t\t\t\"easeInOutExpo\" => \"easeInOutExpo\",\n\t\t\t\t\"easeInCirc\" => \"easeInCirc\",\n\t\t\t\t\"easeOutCirc\" => \"easeOutCirc\",\n\t\t\t\t\"easeInOutCirc\" => \"easeInOutCirc\",\n\t\t\t\t\"easeInElastic\" => \"easeInElastic\",\n\t\t\t\t\"easeOutElastic\" => \"easeOutElastic\",\n\t\t\t\t\"easeInOutElastic\" => \"easeInOutElastic\",\n\t\t\t\t\"easeInBack\" => \"easeInBack\",\n\t\t\t\t\"easeInOutBack\" => \"easeInOutBack\",\n\t\t\t\t\"easeInBounce\" => \"easeInBounce\",\n\t\t\t\t\"easeOutBounce\" => \"easeOutBounce\",\n\t\t\t\t\"easeInOutBounce\" => \"easeInOutBounce\"\n\t\t\t);\n\n\t\t\treturn($arrEasing);\n\t\t}", "public function get_easing_transition_effects() {\n\n $instance = Envira_Gallery_Common::get_instance();\n return $instance->get_easing_transition_effects();\n\n }", "public static function animate($properties = null, $duration = null, $easing = null, $callback= null){\n $jquery = self::getInstance();\n if($properties !== null) $jquery->properties($properties);\n if($duration !== null) $jquery->duration($duration);\n if($easing !== null) $jquery->easing($easing);\n if($callback !== null) $jquery->callback($callback);\n $jquery->setEvent(YsJQueryConstant::ANIMATE_EFFECT);\n //self::$type = $jquery->getEvent();\n return $jquery;\n }", "function wyde_get_animations(){\n return array(\n '' \t\t\t\t\t\t\t\t\t\t=> 'No Animation',\n 'bounceIn' \t\t\t \t\t\t\t=> 'Bounce In',\n 'bounceInUp' \t\t \t\t\t\t\t=> 'Bounce In Up',\n 'bounceInDown' \t \t\t\t\t\t=> 'Bounce In Down',\n 'bounceInLeft' \t \t\t\t\t\t=> 'Bounce In Left',\n 'bounceInRight' \t\t\t\t\t=> 'Bounce In Right',\n 'fadeIn' \t\t\t\t \t\t\t \t=> 'Fade In',\n 'fadeInUp' \t\t\t\t \t\t\t \t=> 'Fade In Up',\n 'fadeInDown' \t\t \t\t\t\t\t=> 'Fade In Down',\n 'fadeInLeft' \t\t \t\t\t\t\t=> 'Fade In Left',\n 'fadeInRight' \t \t\t\t\t\t=> 'Fade In Right',\n 'fadeInUpBig' \t\t\t\t\t\t=> 'Fade In Up Long',\n 'fadeInDownBig' \t\t\t\t\t\t=> 'Fade In Down Long',\n 'fadeInLeftBig' \t\t\t\t\t\t=> 'Fade In Left Long',\n 'fadeInRightBig' \t\t\t\t\t\t=> 'Fade In Right Long',\n 'lightSpeedIn' \t\t\t\t\t\t=> 'Light Speed In',\n 'pulse'\t\t\t\t\t\t \t\t=> 'Pulse',\n 'rollIn' \t\t\t\t \t\t=> 'Roll In',\n 'rotateIn' \t\t\t \t => 'Rotate In',\n 'slideInUp' \t\t \t\t => 'Slide In Up',\n 'slideInDown' \t \t\t => 'Slide In Down',\n 'slideInLeft' \t \t\t => 'Slide In Left',\n 'slideInRight' \t \t\t => 'Slide In Right',\n 'swing'\t\t\t\t\t\t \t=> 'Swing',\n 'zoomIn'\t\t\t\t\t \t\t=> 'Zoom In',\n );\n\n}", "public function addEaseInSpeed($value)\n {\n if ($this->ease_in_speed === null) {\n $this->ease_in_speed = new \\Protobuf\\ScalarCollection();\n }\n\n $this->ease_in_speed->add($value);\n }", "public function getArrEndEasing(){\r\n\t\t$arrEasing = $this->getArrEasing();\r\n\t\t$arrEasing = array_merge(array(\"nothing\" => \"No Change\"),$arrEasing);\r\n\r\n\t\treturn($arrEasing);\r\n\t}", "public function handle_animation_inputs( &$settings ) {\n\n\t\tif ( ! isset( $settings->animation ) || is_array( $settings->animation ) || ! isset( $settings->animation_delay ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$keys = array(\n\t\t\t'slide-left' => 'fade-right',\n\t\t\t'slide-right' => 'fade-left',\n\t\t\t'slide-up' => 'fade-up',\n\t\t\t'slide-down' => 'fade-down',\n\t\t);\n\n\t\tif ( isset( $keys[ $settings->animation ] ) ) {\n\t\t\t$settings->animation = $keys[ $settings->animation ];\n\t\t}\n\n\t\t$settings->animation = array(\n\t\t\t'style' => $settings->animation,\n\t\t\t'delay' => $settings->animation_delay,\n\t\t);\n\n\t\tunset( $settings->animation_delay );\n\t}", "function _animate($element = 'this', $params = array(), $speed = '', $extra = '')\n\t{\n\t\t$element = $this->_prep_element($element);\n\t\t$speed = $this->_validate_speed($speed);\n\t\t\n\t\t$animations = \"\\t\\t\\t\";\n\t\t\n\t\tforeach ($params as $param=>$value)\n\t\t{\n\t\t\t$animations .= $param.': \\''.$value.'\\', ';\n\t\t}\n\n\t\t$animations = substr($animations, 0, -2); // remove the last \", \"\n\n\t\tif ($speed != '')\n\t\t{\n\t\t\t$speed = ', '.$speed;\n\t\t}\n\t\t\n\t\tif ($extra != '')\n\t\t{\n\t\t\t$extra = ', '.$extra;\n\t\t}\n\t\t\n\t\t$str = \"$({$element}).animate({\\n$animations\\n\\t\\t}\".$speed.$extra.\");\";\n\t\t\n\t\treturn $str;\n\t}", "public static function getArrEndAnimations($all = true){\r\n\t\t$arrAnimations = array();\r\n\t\t$arrAnimations['custom'] = array('handle' => __('## Custom Animation ##', REVSLIDER_TEXTDOMAIN));\r\n\t\t$arrAnimations['auto'] = array('handle' => __('Automatic Reverse', REVSLIDER_TEXTDOMAIN));\r\n\t\t$arrAnimations['v5s'] = array('handle' => '-----------------------------------');\r\n\t\t$arrAnimations['v5'] = array('handle' => __('- VERSION 5.0 ANIMATIONS -', REVSLIDER_TEXTDOMAIN));\r\n\t\t$arrAnimations['v5e'] = array('handle' => '-----------------------------------');\r\n\r\n\t\t$arrAnimations['BounceOut'] = array('handle' => 'BounceOut','params' => '{\"movex\":\"inherit\",\"movey\":\"inherit\",\"movez\":\"inherit\",\"rotationx\":\"inherit\",\"rotationy\":\"inherit\",\"rotationz\":\"0deg\",\"scalex\":\"0.7\",\"scaley\":\"0.7\",\"skewx\":\"inherit\",\"skewy\":\"inherit\",\"captionopacity\":\"0\",\"mask\":\"true\",\"mask_x\":\"0\",\"mask_y\":\"0\",\"easing\":\"Back.easeIn\",\"speed\":\"500\",\"split\":\"none\",\"splitdelay\":\"10\"}', 'settings' => array('version' => '5.0'));\r\n\t\t$arrAnimations['Fade-Out-Long'] = array('handle' => 'Fade-Out-Long','params' => '{\"movex\":\"inherit\",\"movey\":\"inherit\",\"movez\":\"inherit\",\"rotationx\":\"inherit\",\"rotationy\":\"inherit\",\"rotationz\":\"inherit\",\"scalex\":\"inherit\",\"scaley\":\"inherit\",\"skewx\":\"inherit\",\"skewy\":\"inherit\",\"captionopacity\":\"0\",\"mask\":\"false\",\"mask_x\":\"0\",\"mask_y\":\"0\",\"easing\":\"Power2.easeIn\",\"speed\":\"1000\",\"split\":\"none\",\"splitdelay\":\"10\"}', 'settings' => array('version' => '5.0'));\r\n\t\t$arrAnimations['SlideMaskToBottom'] = array('handle' => 'SlideMaskToBottom','params' => '{\"movex\":\"inherit\",\"movey\":\"[100%]\",\"movez\":\"inherit\",\"rotationx\":\"inherit\",\"rotationy\":\"inherit\",\"rotationz\":\"inherit\",\"scalex\":\"inherit\",\"scaley\":\"inherit\",\"skewx\":\"inherit\",\"skewy\":\"inherit\",\"captionopacity\":\"inherit\",\"mask\":\"true\",\"mask_x\":\"inherit\",\"mask_y\":\"inherit\",\"easing\":\"nothing\",\"speed\":\"300\",\"split\":\"none\",\"splitdelay\":\"10\"}', 'settings' => array('version' => '5.0'));\r\n\t\t$arrAnimations['SlideMaskToLeft'] = array('handle' => 'SlideMaskToLeft','params' => '{\"movex\":\"[-100%]\",\"movey\":\"inherit\",\"movez\":\"inherit\",\"rotationx\":\"inherit\",\"rotationy\":\"inherit\",\"rotationz\":\"inherit\",\"scalex\":\"inherit\",\"scaley\":\"inherit\",\"skewx\":\"inherit\",\"skewy\":\"inherit\",\"captionopacity\":\"inherit\",\"mask\":\"true\",\"mask_x\":\"inherit\",\"mask_y\":\"inherit\",\"easing\":\"Power3.easeInOut\",\"speed\":\"1000\",\"split\":\"none\",\"splitdelay\":\"10\"}', 'settings' => array('version' => '5.0'));\r\n\t\t$arrAnimations['SlideMaskToRight'] = array('handle' => 'SlideMaskToRight','params' => '{\"movex\":\"[100%]\",\"movey\":\"inherit\",\"movez\":\"inherit\",\"rotationx\":\"inherit\",\"rotationy\":\"inherit\",\"rotationz\":\"inherit\",\"scalex\":\"inherit\",\"scaley\":\"inherit\",\"skewx\":\"inherit\",\"skewy\":\"inherit\",\"captionopacity\":\"inherit\",\"mask\":\"true\",\"mask_x\":\"inherit\",\"mask_y\":\"inherit\",\"easing\":\"Power3.easeInOut\",\"speed\":\"1000\",\"split\":\"none\",\"splitdelay\":\"10\"}', 'settings' => array('version' => '5.0'));\r\n\t\t$arrAnimations['SlideMaskToTop'] = array('handle' => 'SlideMaskToTop','params' => '{\"movex\":\"inherit\",\"movey\":\"[-100%]\",\"movez\":\"inherit\",\"rotationx\":\"inherit\",\"rotationy\":\"inherit\",\"rotationz\":\"inherit\",\"scalex\":\"inherit\",\"scaley\":\"inherit\",\"skewx\":\"inherit\",\"skewy\":\"inherit\",\"captionopacity\":\"inherit\",\"mask\":\"true\",\"mask_x\":\"inherit\",\"mask_y\":\"inherit\",\"easing\":\"nothing\",\"speed\":\"300\",\"split\":\"none\",\"splitdelay\":\"10\"}', 'settings' => array('version' => '5.0'));\r\n\t\t$arrAnimations['SlurpOut'] = array('handle' => 'SlurpOut','params' => '{\"movex\":\"inherit\",\"movey\":\"[100%]\",\"movez\":\"inherit\",\"rotationx\":\"inherit\",\"rotationy\":\"inherit\",\"rotationz\":\"0deg\",\"scalex\":\"0.7\",\"scaley\":\"0.7\",\"skewx\":\"inherit\",\"skewy\":\"inherit\",\"captionopacity\":\"inherit\",\"mask\":\"true\",\"mask_x\":\"0\",\"mask_y\":\"0\",\"easing\":\"Power3.easeInOut\",\"speed\":\"1000\",\"split\":\"none\",\"splitdelay\":\"10\"}', 'settings' => array('version' => '5.0'));\r\n\t\t$arrAnimations['SmoothCropToBottom'] = array('handle' => 'SmoothCropToBottom','params' => '{\"movex\":\"inherit\",\"movey\":\"[175%]\",\"movez\":\"inherit\",\"rotationx\":\"inherit\",\"rotationy\":\"inherit\",\"rotationz\":\"inherit\",\"scalex\":\"inherit\",\"scaley\":\"inherit\",\"skewx\":\"inherit\",\"skewy\":\"inherit\",\"captionopacity\":\"inherit\",\"mask\":\"true\",\"mask_x\":\"inherit\",\"mask_y\":\"inherit\",\"easing\":\"Power2.easeInOut\",\"speed\":\"1000\",\"split\":\"none\",\"splitdelay\":\"10\"}', 'settings' => array('version' => '5.0'));\r\n \r\n\t\t$arrAnimations['v4s'] = array('handle' => '-----------------------------------');\r\n\t\t$arrAnimations['v4'] = array('handle' => __('- VERSION 4.0 ANIMATIONS -', REVSLIDER_TEXTDOMAIN));\r\n\t\t$arrAnimations['v4e'] = array('handle' => '-----------------------------------');\r\n\t\t$arrAnimations['noanimout'] = array('handle' => 'No-Out-Animation','params' => '{\"movex\":\"inherit\",\"movey\":\"inherit\",\"movez\":\"inherit\",\"rotationx\":\"inherit\",\"rotationy\":\"inherit\",\"rotationz\":\"inherit\",\"scalex\":\"inherit\",\"scaley\":\"inherit\",\"skewx\":\"inherit\",\"skewy\":\"inherit\",\"captionopacity\":\"inherit\",\"mask\":\"false\",\"mask_x\":\"0\",\"mask_y\":\"0\",\"mask_speed\":\"500\"}', 'settings' => array('version' => '5.0'));\r\n\t\t$arrAnimations['fadeout'] = array('handle' => 'Fade-Out','params' => '{\"movex\":\"inherit\",\"movey\":\"inherit\",\"movez\":\"inherit\",\"rotationx\":\"inherit\",\"rotationy\":\"inherit\",\"rotationz\":\"inherit\",\"scalex\":\"inherit\",\"scaley\":\"inherit\",\"skewx\":\"inherit\",\"skewy\":\"inherit\",\"captionopacity\":\"0\",\"mask\":\"false\",\"mask_x\":\"0\",\"mask_y\":\"0\",\"mask_speed\":\"0\"}', 'settings' => array('version' => '5.0'));\r\n\t\t$arrAnimations['stt'] = array('handle' => 'Short-To-Top','params' => '{\"movex\":\"inherit\",\"movey\":\"-50px\",\"movez\":\"inherit\",\"rotationx\":\"inherit\",\"rotationy\":\"inherit\",\"rotationz\":\"inherit\",\"scalex\":\"inherit\",\"scaley\":\"inherit\",\"skewx\":\"inherit\",\"skewy\":\"inherit\",\"captionopacity\":\"0\",\"mask\":\"false\",\"mask_x\":\"0\",\"mask_y\":\"0\",\"mask_speed\":\"500\"}', 'settings' => array('version' => '5.0'));\r\n\t\t$arrAnimations['stb'] = array('handle' => 'Short-To-Bottom','params' => '{\"movex\":\"inherit\",\"movey\":\"50px\",\"movez\":\"inherit\",\"rotationx\":\"inherit\",\"rotationy\":\"inherit\",\"rotationz\":\"inherit\",\"scalex\":\"inherit\",\"scaley\":\"inherit\",\"skewx\":\"inherit\",\"skewy\":\"inherit\",\"captionopacity\":\"0\",\"mask\":\"false\",\"mask_x\":\"0\",\"mask_y\":\"0\",\"mask_speed\":\"500\"}', 'settings' => array('version' => '5.0'));\r\n\t\t$arrAnimations['stl'] = array('handle' => 'Short-To-Left','params' => '{\"movex\":\"-50px\",\"movey\":\"inherit\",\"movez\":\"inherit\",\"rotationx\":\"inherit\",\"rotationy\":\"inherit\",\"rotationz\":\"inherit\",\"scalex\":\"inherit\",\"scaley\":\"inherit\",\"skewx\":\"inherit\",\"skewy\":\"inherit\",\"captionopacity\":\"0\",\"mask\":\"false\",\"mask_x\":\"0\",\"mask_y\":\"0\",\"mask_speed\":\"500\"}', 'settings' => array('version' => '5.0'));\r\n\t\t$arrAnimations['str'] = array('handle' => 'Short-To-Right','params' => '{\"movex\":\"50px\",\"movey\":\"inherit\",\"movez\":\"inherit\",\"rotationx\":\"inherit\",\"rotationy\":\"inherit\",\"rotationz\":\"inherit\",\"scalex\":\"inherit\",\"scaley\":\"inherit\",\"skewx\":\"inherit\",\"skewy\":\"inherit\",\"captionopacity\":\"0\",\"mask\":\"false\",\"mask_x\":\"0\",\"mask_y\":\"0\",\"mask_speed\":\"500\"}', 'settings' => array('version' => '5.0'));\r\n\t\t$arrAnimations['ltr'] = array('handle' => 'Long-To-Right','params' => '{\"movex\":\"right\",\"movey\":\"inherit\",\"movez\":\"inherit\",\"rotationx\":\"inherit\",\"rotationy\":\"inherit\",\"rotationz\":\"inherit\",\"scalex\":\"inherit\",\"scaley\":\"inherit\",\"skewx\":\"inherit\",\"skewy\":\"inherit\",\"captionopacity\":\"inherit\",\"mask\":\"false\",\"mask_x\":\"0\",\"mask_y\":\"0\",\"mask_speed\":\"500\"}', 'settings' => array('version' => '5.0'));\r\n\t\t$arrAnimations['ltl'] = array('handle' => 'Long-To-Left','params' => '{\"movex\":\"left\",\"movey\":\"inherit\",\"movez\":\"inherit\",\"rotationx\":\"inherit\",\"rotationy\":\"inherit\",\"rotationz\":\"inherit\",\"scalex\":\"inherit\",\"scaley\":\"inherit\",\"skewx\":\"inherit\",\"skewy\":\"inherit\",\"captionopacity\":\"inherit\",\"mask\":\"false\",\"mask_x\":\"0\",\"mask_y\":\"0\",\"mask_speed\":\"500\"}', 'settings' => array('version' => '5.0'));\r\n\t\t$arrAnimations['ltt'] = array('handle' => 'Long-To-Top','params' => '{\"movex\":\"inherit\",\"movey\":\"top\",\"movez\":\"inherit\",\"rotationx\":\"inherit\",\"rotationy\":\"inherit\",\"rotationz\":\"inherit\",\"scalex\":\"inherit\",\"scaley\":\"inherit\",\"skewx\":\"inherit\",\"skewy\":\"inherit\",\"captionopacity\":\"inherit\",\"mask\":\"false\",\"mask_x\":\"0\",\"mask_y\":\"0\",\"mask_speed\":\"500\"}', 'settings' => array('version' => '5.0'));\r\n\t\t$arrAnimations['ltb'] = array('handle' => 'Long-To-Bottom','params' => '{\"movex\":\"inherit\",\"movey\":\"bottom\",\"movez\":\"inherit\",\"rotationx\":\"inherit\",\"rotationy\":\"inherit\",\"rotationz\":\"inherit\",\"scalex\":\"inherit\",\"scaley\":\"inherit\",\"skewx\":\"inherit\",\"skewy\":\"inherit\",\"captionopacity\":\"inherit\",\"mask\":\"false\",\"mask_x\":\"0\",\"mask_y\":\"0\",\"mask_speed\":\"500\"}', 'settings' => array('version' => '5.0'));\r\n\t\t$arrAnimations['skewtoleft'] = array('handle' => 'Skew-To-Long-Left','params' => '{\"movex\":\"left\",\"movey\":\"inherit\",\"movez\":\"inherit\",\"rotationx\":\"inherit\",\"rotationy\":\"inherit\",\"rotationz\":\"inherit\",\"scalex\":\"inherit\",\"scaley\":\"inherit\",\"skewx\":\"45px\",\"skewy\":\"inherit\",\"captionopacity\":\"inherit\",\"mask\":\"false\",\"mask_x\":\"0\",\"mask_y\":\"0\",\"mask_speed\":\"500\"}', 'settings' => array('version' => '5.0'));\r\n\t\t$arrAnimations['skewtoright'] = array('handle' => 'Skew-To-Long-Right','params' => '{\"movex\":\"right\",\"movey\":\"inherit\",\"movez\":\"inherit\",\"rotationx\":\"inherit\",\"rotationy\":\"inherit\",\"rotationz\":\"inherit\",\"scalex\":\"inherit\",\"scaley\":\"inherit\",\"skewx\":\"-85px\",\"skewy\":\"inherit\",\"captionopacity\":\"inherit\",\"mask\":\"false\",\"mask_x\":\"0\",\"mask_y\":\"0\",\"mask_speed\":\"500\"}', 'settings' => array('version' => '5.0'));\r\n\t\t$arrAnimations['skewtorightshort'] = array('handle' => 'Skew-To-Short-Right','params' => '{\"movex\":\"200px\",\"movey\":\"inherit\",\"movez\":\"inherit\",\"rotationx\":\"inherit\",\"rotationy\":\"inherit\",\"rotationz\":\"inherit\",\"scalex\":\"inherit\",\"scaley\":\"inherit\",\"skewx\":\"-85px\",\"skewy\":\"inherit\",\"captionopacity\":\"0\",\"mask\":\"false\",\"mask_x\":\"0\",\"mask_y\":\"0\",\"mask_speed\":\"500\"}', 'settings' => array('version' => '5.0'));\r\n\t\t$arrAnimations['skewtoleftshort'] = array('handle' => 'Skew-To-Short-Left','params' => '{\"movex\":\"-200px\",\"movey\":\"inherit\",\"movez\":\"inherit\",\"rotationx\":\"inherit\",\"rotationy\":\"inherit\",\"rotationz\":\"inherit\",\"scalex\":\"inherit\",\"scaley\":\"inherit\",\"skewx\":\"85px\",\"skewy\":\"inherit\",\"captionopacity\":\"0\",\"mask\":\"false\",\"mask_x\":\"0\",\"mask_y\":\"0\",\"mask_speed\":\"500\"}', 'settings' => array('version' => '5.0'));\r\n\t\t$arrAnimations['randomrotateout'] = array('handle' => 'Random-Rotate-Out','params' => '{\"movex\":\"{-250,250}\",\"movey\":\"{-150,150}\",\"movez\":\"inherit\",\"rotationx\":\"{-90,90}\",\"rotationy\":\"{-90,90}\",\"rotationz\":\"{-360,360}\",\"scalex\":\"{0,1}\",\"scaley\":\"{0,1}\",\"skewx\":\"inherit\",\"skewy\":\"inherit\",\"captionopacity\":\"0\",\"mask\":\"false\",\"mask_x\":\"0\",\"mask_y\":\"0\",\"mask_speed\":\"500\"}', 'settings' => array('version' => '5.0'));\r\n\r\n\t\tif($all){\r\n\t\t\t$arrAnimations['vss'] = array('handle' => '--------------------------------------');\r\n\t\t\t$arrAnimations['vs'] = array('handle' => __('- SAVED CUSTOM ANIMATIONS -', REVSLIDER_TEXTDOMAIN));\r\n\t\t\t$arrAnimations['vse'] = array('handle' => '--------------------------------------');\r\n\t\t\t//$custom = RevSliderOperations::getCustomAnimations('customout');\r\n\t\t\t$custom = RevSliderOperations::getCustomAnimationsFullPre('customout');\r\n\r\n\t\t\t$arrAnimations = array_merge($arrAnimations, $custom);\r\n\t\t}\r\n\t\t\r\n\t\tforeach($arrAnimations as $key => $value){\r\n\t\t\tif(!isset($value['params'])) continue;\r\n\t\t\t\r\n\t\t\t$t = json_decode(str_replace(\"'\", '\"', $value['params']), true);\r\n\t\t\tif(!empty($t))\r\n\t\t\t\t$arrAnimations[$key]['params'] = $t;\r\n\t\t}\r\n\t\treturn($arrAnimations);\r\n\t}", "public function setAnimation($value);", "public function get_end_animations(){\r\n\t\treturn $this->get_custom_animations_full_pre('out');\r\n\t}", "public function seekAnimations(ContextInterface $ctx, SeekAnimationsRequest $request): void;", "public function getAnimationTypeOptions()\n {\n return [\n self::ANIM_SCROLL_LEFT => _t(__CLASS__ . '.SCROLLLEFT', 'Scroll Left'),\n self::ANIM_SCROLL_RIGHT => _t(__CLASS__ . '.SCROLLRIGHT', 'Scroll Right')\n ];\n }", "function yp_get_custom_animations(){\n\n\t$all_options = wp_load_alloptions();\n\tforeach($all_options as $name => $value){\n\t\tif(stristr($name, 'yp_anim')){\n\n\t\t\t// Get animations\n\t\t\t$value = stripslashes(yp_css_prefix($value));\n \t\t$value = preg_replace('/\\s+|\\t/',' ',$value);\n\n\t\t\techo \"\\n\".'<style id=\"yp-animate-'.strtolower(str_replace(\"yp_anim_\",\"\",$name)).'\">'.\"\\n\".''.$value.\"\\n\".str_replace(\"keyframes\", \"-webkit-keyframes\", $value).''.\"\\n\".'</style>';\n\n\t\t}\n\t}\n\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This class uses the delegation pattern if it is not passed a string of the complete statement via the constructor. See See also the behaviours classes in this folder. This is all cut and pasted from the delegate row class. So much for design patterns removing the need for that sort of thing! abstract protected function set_behaviours();
protected function set_behaviours() { /* * Don't do anything by default. * * If you want to delegate, override this method. */ }
[ "protected function initInsertModeBehaviour() {\n $insertModeBehaviour = DeclarativeFactory::factory([\n [\n $this->insertMode === self::INSERT_MODE_PREPEND,\n Fun::fnReturnNew(PrependInsertModeBehaviour::class),\n ],\n Fun::fnReturnNew(AppendInsertModeBehaviour::class),\n ]);\n $this->insertModeBehaviour = $insertModeBehaviour;\n }", "public function when(string ...$abstracts) : ContextualBindingBuilder;", "abstract protected function setMethod();", "abstract public function overrideMe();", "protected function set__recipe() {\n throw new LogicException(\n 'Die recipe is derived automatically.'\n );\n }", "protected function __construct()\n\t{\n\t\t$this->attachBehavior('excelReaderBehavior', new MTDExcelReaderBehavior());\n\t}", "public function setRow($Row) \n \t{\n \t\tparent::setRow($Row);\n \t}", "function generateSQL($row) { /* abstract */ }", "function mysqlnd_uh_set_statement_proxy(&$statement_proxy)\n{\n}", "public function implementMe();", "public function setRow($Row) \n \t{\n \t\treturn false;\n \t\t//parent::setRow($Row);\n \t}", "protected abstract function getMutator();", "function __construct($dbase=null, $tname=null) {\n //\n //Use the given arguments or read them from the last posted page\n //\n //Create a mutall object to access shared functions\n $mutall = new mutall();\n //\n //Get teh last posted page\n $page_ = $mutall->get_posted_data();\n //\n $this->dbase = is_null($dbase) ? $mutall->get_dbase(): $dbase;\n $this->tname = is_null($tname) ? $page_->tname: $tname;\n //\n //The select statement of a table is simply\n $stmt = \"select * from `\".$this->tname.\"`\";\n //\n //Initialize the root table; this process will evoke the initializetion \n //of the fields\n parent::__construct($this->dbase, $stmt);\n //\n //Set the identification indices of this table using its fields\n $this->indices = $this->get_indices();\n //\n //Set the criteria columns\n $this->hint_cols = $this->get_hint_cols();\n }", "function __construct($dbrow,\n $table)\n {\n // invoke constructor of base class Record\n parent::__construct($dbrow,\n $table);\n }", "public function addStdBehaviors()\r\n\t{\r\n\t\t//MK - These are the behaviors we support for php-function to return\r\n\t\t$this->addBehavior( new TabAlert());\r\n\t\t$this->addBehavior( new TabSetValue());\r\n\t\t$this->addBehavior( new TabInnerHtml());\r\n\t\t$this->addBehavior( new TabInnerHtmlAppend());\r\n\t\t$this->addBehavior( new TabInnerHtmlPrepend());\r\n\t\t$this->addBehavior( new TabAddOption());\r\n\t\t$this->addBehavior( new TabClearOptions());\r\n\t\t$this->addBehavior( new TabRemoveSelectedOption());\r\n\t\t$this->addBehavior( new TabRedirect());\r\n\t}", "public function getAbstractNote();", "public function build()\n\t{\n\t\tif (is_null($this->name)) {\n\t\t\t$this->name = \"\";\n\t\t}\n\t\tif (!is_string($this->name)) {\n\t\t\tthrow new Exception(\"name must be a string\");\n\t\t}\n\n\t\tif (is_null($this->text)) {\n\t\t\t$this->text = \"\";\n\t\t}\n\t\tif (!is_string($this->text)) {\n\t\t\t$this->text = (string)$this->text;\n\t\t}\n\n\t\tif ($this->form_action && !is_string($this->form_action)) {\n\t\t\tthrow new Exception(\"form_action must be a string\");\n\t\t}\n\t\tif ($this->behavior && !($this->behavior instanceof IDataTableBehavior)) {\n\t\t\tthrow new Exception(\"change_behavior must be instance of IDataTableBehavior\");\n\t\t}\n\t\tif (is_null($this->placement)) {\n\t\t\t$this->placement = IDataTableWidget::placement_top;\n\t\t}\n\t\tif ($this->placement != IDataTableWidget::placement_top && $this->placement != IDataTableWidget::placement_bottom) {\n\t\t\tthrow new Exception(\"placement must be 'top' or 'bottom'\");\n\t\t}\n\n\t\tif (!is_null($this->label) && !is_string($this->label)) {\n\t\t\tthrow new Exception(\"label must be a string or null\");\n\t\t}\n\n\t\treturn new DataTableTextarea($this);\n\t}", "public function __construct($row) {\n $this->interaction_id = $row['interaction_id'];\n $this->date = $row['date'];\n $this->desc = $row['description'];\n }", "function getString() { return $this->behavior; }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns whether this site supports the default user picture feature.
protected function userPictureEnabled() { $field_definitions = $this->entityFieldManager->getFieldDefinitions('user', 'user'); return isset($field_definitions['user_picture']); }
[ "function supportDefaultAvatar()\n {\n\n // Check if a default avatar is defined\n $default = $this->getDefaultImageConfiguration();\n if (empty($default['defaultavatar'])) {\n return false;\n }\n\n // check if default avatar method is configured as one of the avatar methods.\n for($methodnr = 1; $methodnr <= PLUGIN_EVENT_GRAVATAR_METHOD_MAX; $methodnr++){\n $method = $this->get_config(\"method_\" . $methodnr);\n\n // if none is configured, ignore later methods!\n if ($method == 'none'){\n return false;\n }\n\n // return true if default avatar method is found\n if ($method == 'default'){\n return true;\n }\n }\n return false;\n }", "public function isPicture(): bool\n {\n return $this->picture;\n }", "function isDefault() {\n\t\treturn strpos( $this->getAvatarImage(), 'default_' ) !== false;\n\t}", "public function hasProfilePicture()\n {\n return !is_null($this->profilePicture);\n }", "public function getPicture() {\n $path = FILES_LOCATION . DS .'users'. DS . $this->getId() . DS . $this->getId() .'.'. IMAGE_TYPE;\n if(file_exists($path)) {\n $result = $path;\n } else {\n $result = FALSE;\n }\n\n return $result;\n }", "function checkMyUserPhoto()\n {\n $imagePath = 'images/';\n if (Auth::user()->pic) {\n return $imagePath.Auth::user()->pic;\n } else {\n return $imagePath.'default-user.png';\n }\n }", "protected function isDefaultImg()\n {\n return empty($this->img_url) || $this->img_url === $this->getFieldDefaultValue('img_url');\n }", "function getHasPicture()\n {\n return (bool) $this->_bHasPicture;\n }", "public function isPhoto() {\n return false;\n }", "public function getHasImage();", "public function canShowImage() : bool\n {\n return (bool)$this->getData('show_image');\n }", "function emi_user_has_avatar( $user_id=false ) {\n\tif( !$user_id ){\n\t\t$user_id = bp_loggedin_user_id();\n\t}\n\n\tif ( bp_core_fetch_avatar( array( 'item_id' => $user_id, 'no_grav' => true,'html'=> false ) ) != bp_core_avatar_default( 'local' ) )\n\t\treturn true;\n\treturn false;\n}", "public function hasPhoto()\n {\n return $this->photo !== \"user.png\";\n }", "public function hasImage() {\n\t\treturn $this->user->icontime !== null;\n\n\t}", "public function isAvatarsEnabled();", "public function is_photo() {\n return false;\n }", "public static function user_can_upload() {\n\t\trequire_once ABSPATH . '/wp-admin/includes/plugin.php';\n\n\t\t// Check killswitch setting that completely disables uploads.\n\t\tif ( Settings::is_killswitch_enabled() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$user = wp_get_current_user();\n\t\t$can = true;\n\n\t\t// Check if user is blocked.\n\t\tif ( $can && $user && $user->ID ) {\n\t\t\t$can = empty( $user->allcaps['bbp_blocked'] );\n\t\t}\n\n\t\t// The Frontend Uploader plugin must be active.\n\t\t$fu_plugin = 'frontend-uploader/frontend-uploader.php';\n\t\tif ( $can && ! is_plugin_active( $fu_plugin ) && ! is_plugin_active_for_network( $fu_plugin ) ) {\n\t\t\t$can = false;\n\t\t}\n\n\t\t// Google Cloud API must be configured.\n\t\tif ( $can ) {\n\t\t\t$can = VisionAPI::is_google_cloud_configured();\n\t\t}\n\n\t\t/**\n\t\t * Filters if the user can specifically upload a file.\n\t\t *\n\t\t * @param bool $can Can the user upload files?\n\t\t * @param WP_User $user The user.\n\t\t */\n\t\treturn (bool) apply_filters( 'wporg_photos_user_can_upload', $can, $user );\n\t}", "public function userImageUriIsDefault($image_uri){\n return ($image_uri === 'default/img/default_img_male.jpg' || $image_uri === 'default/img/default_img_female.jpg');\n }", "public function isShowImage()\n\t{\n\t\treturn $this->_configScopeConfigInterface->getValue('brands/general/show_image');\n\t\t//return $this->getCfg('general/show_image');\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
test list all posts of user true
public function test_get_list_posts_for_user_ok() { $user_id = 18; $posts = $this->_model->get_list_posts_for_user($user_id); $this->assertNotEmpty($posts); }
[ "public function testListUserPosts()\n {\n Sanctum::actingAs(InternalUser::factory()->create(), ['*']);\n\n // Cache users first bc of foreign keys\n $response = $this->get('api/user');\n\n $id = 3;\n\n $response = $this->get(\"api/user/{$id}/posts\");\n\n $response->assertStatus(200)\n ->assertJsonFragment(['title' => 'asperiores ea ipsam voluptatibus modi minima quia sint']);\n }", "public function testCheckUserPosts()\n {\n $this->json('GET', 'api/users/1/posts', [])->assertSuccessful();\n }", "public function test_get_list_posts_ok() {\n $posts = $this->_model->get_list_all_posts();\n\n $this->assertNotEmpty($posts);\n }", "public function testListPost() {\n $response = $this->actingAs($this->user)->get($this->adminPrefix.'/posts');\n $response->assertStatus(200);\n }", "function get_all_user_posts() {\n return query(\"SELECT * FROM posts WHERE user_id= \" .loggedInUserId().\"\");\n}", "public function testGetPosts()\n {\n $posts = $this->_delicious->getPosts('zfSite', new Zend_Date(), 'help');\n $this->assertTrue($posts instanceof Zend_Service_Delicious_PostList);\n $this->assertTrue(count($posts) <= 10);\n\n foreach ($posts as $post) {\n $this->assertStringContainsString('zfSite', $post->getTags());\n }\n }", "function yz_is_user_have_posts() {\n\n // Get User Post Count.\n $user_post_count = yz_get_user_posts_nbr();\n\n if ( 0 == $user_post_count ) {\n return false;\n }\n\n return true;\n}", "public function testCanViewAllBlogPosts()\n {\n // arrange\n $post1 = factory(Post::class)->create();\n $post2 = factory(Post::class)->create();\n\n // act\n $res = $this->get('posts');\n\n // assert\n $res->assertStatus(200);\n\n $res->assertSee($post1->title);\n $res->assertSee($post1->body);\n\n $res->assertSee($post2->title);\n $res->assertSee($post2->body);\n \n }", "public function cms_get_user_posts()\n\t{\n\t\treturn $this->posts->find_all();\n\t}", "function get_all_posts($user_id) {\n if ($user_id == null) {\n $sql = \"SELECT id, pet_name, species, breed, pet_from,\"\n . \" age, spayed, gender FROM animal_posts\";\n $query = $this->db->prepare($sql);\n $query->execute();\n $result = $query->fetchAll();\n return $result;\n } else {\n $sql = \"SELECT id, pet_name, species, breed, pet_from,\"\n . \" age, spayed, gender FROM animal_posts WHERE user_id={$user_id}\";\n $query = $this->db->prepare($sql);\n $query->execute();\n $result = $query->fetchAll();\n return $result;\n }\n \n }", "public function testVisitPostsAsLoggedInUser()\n {\n $user = factory(User::class)->create();\n\n $this->actingAs($user, Response::API)\n ->get('/api/v1/posts')\n ->assertJson([\n 'status' => Response::SUCCESS,\n 'code' => Response::HTTP_OK,\n ]);\n }", "public function testPostsListInDashboardPage()\n {\n $user = factory(User::class)->create();\n $user_2 = factory(User::class)->create();\n\n $other_user_posts = factory(Post::class, 50)->create(['user_id' => $user_2->id]);\n\n $posts = factory(Post::class, 33)->create(['user_id' => $user->id]);\n\n $this->browse(function (Browser $browser) use ($user, $posts, $other_user_posts) {\n $browser->loginAs($user)\n ->visit(new DashboardPage())\n ->waitFor('@posts')\n ->assertSeePosts($posts, $of = $user, $except = $other_user_posts)\n ->screenshot('dashboard-ok');\n });\n }", "public function testBoolean()\n {\n\t\t$user = $this->getUserLogin();\n $this->post('/api/posts', [\n 'token' => $user->remember_token,\n 'title' => 'Lorem ipsum dolor sit amet',\n 'content' => 'This is post content',\n 'status' => 5\n ])\n ->seeJson([\n 'data' => null,\n 'meta' => array(\n 'code' => trans('api.CODE_INPUT_FAILED'),\n 'description' => trans('api.DESCRIPTION_INPUT_FAILED'),\n \"messages\" => array(\n array(\"message\" => trans('validation.boolean',['attribute' => 'status'])),\n )\n )\n ]);\n }", "public function viewAny(User $user)\n {\n return $user->hasPerm('posts');\n }", "public function displayPosts()\r\n {\r\n return (bool) $this->_scopeConfig->getValue(\r\n 'zozoblog/post_view/related_posts/enabled',\r\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\r\n );\r\n }", "public function posts() {\n\t\tif (!$this->user->loggedIn) {\n\t\t\tself::redirect_to('user#login');\n\t\t}\n\n\t\t$status = isset($this->params[0]) ? $this->params[0] : false;\n\n\t\t$posts = Post::find_all_by('author', $this->user->get('id'), 'DESC');\n\n\t\t$view = new View('user#posts', 'My Posts');\n\t\t$view->set('user', $this->user);\n\t\t$view->set('status', $status);\n\t\t$view->set('posts', $posts);\n\t\t$view->render();\n\t}", "public function access($user)\n {\n return User::findOrFail($user->id)->hasPermission('laralum::blog.posts.access');\n }", "public function test_get_all_posts() {\n\t\t$method = 'GET';\n\t\t$link = 'http://localhost/miniblog/miniblog-lam.vy/src/v1/posts';\n\t\n\t\t$rs = $this->init_curl(null, $method, $link);\n\t\t//compare\n\t\t$this->assertEquals(200, $rs['meta']['code']);\n\t\t$this->assertGreaterThan(0, $rs['meta']['result']);\n\t}", "public function test_get_users_in_context_forumng_read_posts() {\n list($users, ,$forums ,$dis,$lastposts) = $this->create_basic_test_data();\n $cm = get_coursemodule_from_instance('forumng', $forums[1]->get_id());\n $context = \\context_module::instance($cm->id);\n\n $lastposts[1]->mark_read(1420070400, $users[2]->id);\n $lastposts[1]->mark_read(1420070400, $users[3]->id);\n $dis[1]->create_reply($lastposts[1], 'Welcome/to the Developing as a Researcher seminar', 'reply',\n FORMAT_HTML, false, false, false, $users[1]->id);\n\n $userlist = new \\core_privacy\\local\\request\\userlist($context, 'mod_forumng');\n provider::get_users_in_context($userlist);\n $userids = $userlist->get_userids();\n\n $this->assertCount(3, $userids);\n $this->assertContains((int)$users[1]->id, $userids);\n $this->assertContains((int)$users[2]->id, $userids);\n $this->assertContains((int)$users[3]->id, $userids);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create EoneoPay api manager instance.
public function create(string $baseUri, ?array $headers = null): EoneoPayApiManagerInterface;
[ "public function testCreate(): void\n {\n self::assertInstanceOf(\n EoneoPayApiManager::class,\n (new EoneoPayApiManagerFactory())->create('http://localhost')\n );\n }", "private function getManager(?EntityInterface $entity = null): EoneoPayApiManagerInterface\n {\n return new EoneoPayApiManager(new SdkManagerStub($entity), new ExceptionFactory());\n }", "abstract protected function createInstanceManager();", "public function getApiInstance()\n {\n $params = func_num_args();\n if ($params > 2 || $params < 1) {\n throw new \\Magento\\Framework\\Exception\\LocalizedException(\"Invalid arguments. Use CLIENT_ID and CLIENT SECRET, or ACCESS_TOKEN\");\n }\n if ($params == 1) {\n $api = new \\MercadoPago_Core_Lib_Api(func_get_arg(0));\n $api->set_platform(self::PLATFORM_OPENPLATFORM);\n } else {\n $api = new \\MercadoPago_Core_Lib_Api(func_get_arg(0), func_get_arg(1));\n $api->set_platform(self::PLATFORM_STD);\n }\n if ($this->scopeConfig->getValue('payment/mercadopago_standard/sandbox_mode')) {\n $api->sandbox_mode(true);\n }\n\n $api->set_type(self::TYPE);\n\n //$api->set_so((string)$this->_moduleContext->getVersion()); //TODO tracking\n\n return $api;\n\n }", "protected function _getAPI()\n {\n return Services_AMEE_API::singleton();\n }", "protected function createApiInstance()\n\t{\n\t\t$configToken = $this->getConfig('token');\n\n\t\tif ($configToken === null)\n\t\t{\n\t\t\tthrow new InvalidArgumentException('API token has not been set in the config.');\n\t\t}\n\n\t\t$token = new Token($configToken);\n\t\t$this->api = new Api();\n\t\t$this->api->setToken($token);\n\t}", "private function createManager()\n {\n $config = $this->generateConfig();\n\n $algoliaManager = $this->algoliaFactory->make($config);\n $algoliaManager->setEnv($this->env);\n\n return $algoliaManager;\n }", "public function manager()\n {\n }", "protected function createInstanceManager()\n {\n $this->instance_manager = new AwsInstanceManager($this);\n }", "public function create()\n\t{\n\t\t// Create restfull api object.\n\t\treturn new RestFullApi($this->request);\n\t}", "private function createDictionaryManager() {\n $this->dictionaryManager = new DictionaryManager($this->key, SERVICE_URL_MANAGE);\n }", "protected function createInstanceManager()\n {\n // TODO: Implement createInstanceManager() method.\n }", "public function __construct() {\n $this->authApi = new ApiAuth();\n $this->accountApi=new ApiAccount();\n }", "static function managementApiAuth(){\n $token = EditpressPaywall::generateAuth0Token();\n return new Management( $token, getenv('AUTH0_DOMAIN') );\n }", "protected function getOroEmail_Manager_Email_ApiService()\n {\n return $this->services['oro_email.manager.email.api'] = new \\Oro\\Bundle\\EmailBundle\\Entity\\Manager\\EmailApiEntityManager('Oro\\\\Bundle\\\\EmailBundle\\\\Entity\\\\Email', $this->get('doctrine.orm.default_entity_manager'));\n }", "public function __construct(){\n $this->api = new Api\\Api();\n }", "abstract protected function getMibewAPIInstance();", "public function create()\n {\n // require __DIR__.'/../bootstrap.php';\n // Replace these values by entering your own ClientId and Secret by visiting https://developer.paypal.com/developer/applications/\n $clientId = 'AQd3X2Y2LadGNIGSqHQLtY5usuDctqrHvMiLZC9B-AvFe_3hF7xHY32ah2J3FoKowTAQQClv4SaKB_dt';\n $clientSecret = 'EOZBGcv62-HA2EXuRrLyxlhu0Qsc8Xs72XhJzc10QWGsfVHRXUf-fhdkCZE-MDATcX-MuviBWlfnRuOQ';\n $user_secret_code = 'test'; // from config -> from database.\n\n $apiContext = $this->getApiContext($clientId, $clientSecret);\n\n $invoice = new Invoice();\n\n $invoice\n ->setMerchantInfo(new MerchantInfo())\n ->setBillingInfo(array(new BillingInfo()))\n ->setNote('Medical Invoice 16 Jul, 2013 PST')\n ->setPaymentTerm(new PaymentTerm())\n ->setShippingInfo(new ShippingInfo());\n\n $invoice->getMerchantInfo()\n ->setEmail('jaypatel512-facilitator@hotmail.com')\n ->setFirstName('Dennis')\n ->setLastName('Doctor')\n ->setbusinessName('Medical Professionals, LLC')\n ->setPhone(new Phone())\n ->setAddress(new Address());\n\n $invoice->getMerchantInfo()->getPhone()\n ->setCountryCode('001')\n ->setNationalNumber('5032141716');\n\n $invoice->getMerchantInfo()->getAddress()\n ->setLine1('1234 Main St.')\n ->setCity('Portland')\n ->setState('OR')\n ->setPostalCode('97217')\n ->setCountryCode('US');\n\n $billing = $invoice->getBillingInfo();\n $billing[0]->setEmail('example@example.com');\n\n $billing[0]->setBusinessName('Jay Inc')\n ->setAdditionalInfo('This is the billing Info')\n ->setAddress(new InvoiceAddress());\n\n $billing[0]->getAddress()\n ->setLine1('1234 Main St.')\n ->setCity('Portland')\n ->setState('OR')\n ->setPostalCode('97217')\n ->setCountryCode('US');\n\n $items = array();\n $items[0] = new InvoiceItem();\n $items[0]\n ->setName('Sutures')\n ->setQuantity(100)\n ->setUnitPrice(new Currency());\n\n $items[0]->getUnitPrice()\n ->setCurrency('USD')\n ->setValue(5);\n\n $tax = new \\PayPal\\Api\\Tax();\n $tax->setPercent(1)->setName('Local Tax on Sutures');\n $items[0]->setTax($tax);\n\n $items[1] = new InvoiceItem();\n\n $item1discount = new Cost();\n $item1discount->setPercent('3');\n $items[1]\n ->setName('Injection')\n ->setQuantity(5)\n ->setDiscount($item1discount)\n ->setUnitPrice(new Currency());\n\n $items[1]->getUnitPrice()\n ->setCurrency('USD')\n ->setValue(5);\n\n $tax2 = new \\PayPal\\Api\\Tax();\n $tax2->setPercent(3)->setName('Local Tax on Injection');\n $items[1]->setTax($tax2);\n\n $invoice->setItems($items);\n\n $cost = new Cost();\n $cost->setPercent('2');\n $invoice->setDiscount($cost);\n\n $invoice->getPaymentTerm()\n ->setTermType('NET_45');\n\n $invoice->getShippingInfo()\n ->setFirstName('Sally')\n ->setLastName('Patient')\n ->setBusinessName('Not applicable')\n ->setPhone(new Phone())\n ->setAddress(new InvoiceAddress());\n\n $invoice->getShippingInfo()->getPhone()\n ->setCountryCode('001')\n ->setNationalNumber('5039871234');\n\n $invoice->getShippingInfo()->getAddress()\n ->setLine1('1234 Main St.')\n ->setCity('Portland')\n ->setState('OR')\n ->setPostalCode('97217')\n ->setCountryCode('US');\n\n $invoice->setLogoUrl('https://www.paypalobjects.com/webstatic/i/logo/rebrand/ppcom.svg');\n\n $request = clone $invoice;\n\n try {\n $invoice->create($apiContext);\n } catch (Exception $ex) {\n dd($ex->getMessage());\n // ResultPrinter::printError('Create Invoice', 'Invoice', null, $request, $ex);\n exit(1);\n }\n // ResultPrinter::printResult('Create Invoice', 'Invoice', $invoice->getId(), $request, $invoice);\n\n return $invoice;\n }", "protected function getOroOrganization_Organization_Manager_ApiService()\n {\n return $this->services['oro_organization.organization.manager.api'] = new \\Oro\\Bundle\\SoapBundle\\Entity\\Manager\\ApiEntityManager('Oro\\\\Bundle\\\\OrganizationBundle\\\\Entity\\\\Organization', $this->get('doctrine.orm.default_entity_manager'));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
List of valid URLs that should not be changed when sanitized
function list_of_valid_URLs() { return array( array( 'http://example.com' ), array( 'http://example.com/' ), array( 'http://ozh@example.com/' ), array( 'http://example.com/?@OMG' ), // #1890 array( 'http://ozh@example.com#BLAH' ), array( 'http://Ozh:Password@example.com/' ), array( 'http://Ozh:Password@example.com#OMG' ), array( 'http://Ozh:Password@example.com:1337/' ), array( 'http://Ozh:Password@example.com:1337#OMG' ), array( 'http://Ozh:Password@example.com/hey@ho' ), array( 'http://username:password@example.com:8042/over/there/index.dtb?type=animal&name=narwhal#nose:@:@' ), array( 'mailto:ozh@ozh.org' ), array( 'http://example.com/?watchtheallowedcharacters-~+_.#=&;,/:%!*stay' ), array( 'http://example.com/search.php?search=(amistillhere)' ), array( 'http://example.com/?test=%2812345%29abcdef[gh]' ), array( 'http://example.com/?test=(12345)abcdef[gh]' ), array( 'http://[0:0:0:0:0:0:0:1]/' ), array( 'http://[2001:db8:1f70::999:de8:7648:6e8]:100/' ), array( 'http://example.com/?req=http;//blah' ), // array( 'relative' ), array( 'Relative/path/' ), array( 'relative/Path/#yes' ), array( '/absolute' ), array( '/Absolute/Path/' ), array( '/absolute/path/?omg#also' ), array( 'http://académie-française.fr' ), array( 'http://www.طارق.net/طارق?hello=%2B' ), array( 'http://%d8%b7%d8%a7%d8%b1%d9%82.net/' ), // this is طارق.net, encoded. I _think_ it qualifies as valid ); }
[ "public function invalidUrlProvider()\n {\n return [\n ['http://exa_mple.com'],\n ['archive.example.net'],\n ['irc://:@:/path'],\n ['http://..com'],\n ['/'],\n [null],\n [true],\n [false],\n [''],\n [[]],\n [-1],\n [0],\n [1],\n [2e-2],\n ];\n }", "public function sanitizeLocalUrlValidUrlsDataProvider() {}", "protected function disallowedUrls()\n {\n if (!$this->isLive()) {\n return ['/'];\n }\n $urls = (array) $this->config()->get('disallowed_urls');\n $this->extend('updateDisallowedUrls', $urls);\n return array_unique($urls);\n }", "public function getInvalidUrls()\n {\n return $this->invalidUrls;\n }", "public static function url_filter() {\n\t\treturn array_filter( Url::url_array() );\n\t}", "public function findExcludedUrls();", "public function getValidURLs()\n\t{\n\t\t$urls = array();\n\t\tforeach($this->feedsList as $feed)\n\t\t{\n\t\t\tif($feed->checked && $feed->valid)\n\t\t\t{\n\t\t\t\t$urls[$feed->url] = $feed->user;\n\t\t\t}\n\t\t}\n\t\treturn $urls;\n\t}", "public function get_allowed_urls()\n {\n }", "public function badUrlProvider() {\n\n $badRedirects[\"ip: 127.0.0.1\"] = array(\"http://127.0.0.1\", false);\n\n // Anything that resolves to zero needs to be tested carefully due to falsiness\n $badRedirects[\"ip: 0\"] = array(\"http://0/data.json\", false);\n\n // Hex is bad\n $badRedirects[\"ip: hex\"] = array(\"http://0x7f000001/data.json\", false);\n\n // So is octal\n $badRedirects[\"ip: octal\"] = array(\"http://0123/data.json\", false);\n\n // We don't like mixed hex and octal either\n $badRedirects[\"ip: mixed hex/octal/decimal\"] = array(\"http://0x7f.0x0.0.0/data.json\", false);\n\n // We don't even like dotted-quads\n $badRedirects[\"ip: dotted-quad\"] = array(\"http://111.22.34.56/data.json\", false);\n\n // Don't you come around here with any of that IPv6 crap\n $badRedirects[\"ipv6: localhost\"] = array(\"http://[::1]\", false);\n\n // Domains that resolve to IPv4 localhost? NFW.\n $badRedirects[\"localhost.ip4\"] = array(\"https://localhost.ip4/\", [['type' => 'A', 'ip' => '127.0.0.1']]);\n\n // Domains that resolve to IPv6 localhost? Get out!\n $badRedirects[\"localhost.ip6\"] = array(\"https://localhost.ip6:443\", [['type' => 'AAAA', 'ipv6' => '::1']]);\n\n // Domains that resolve to IPv6 addresses that represent IPv4 private ranges? Not on our watch!\n $badRedirects[\"localhost2.ip6\"] = array(\"http://localhost2.ip6:80\", [['type' => 'AAAA', 'ipv6' => '::ffff:127.0.0.1']]);\n $badRedirects[\"private1.ip6\"] = array(\"https://private1.ip6:80\", [['type' => 'AAAA', 'ipv6' => '::ffff:192.168.1.18']]);\n $badRedirects[\"private2.ip6\"] = array(\"https://private2.ip6:80\", [['type' => 'AAAA', 'ipv6' => '::ffff:10.0.0.1']]);\n $badRedirects[\"private3.ip6\"] = array(\"http://private3.ip6:80\", [['type' => 'AAAA', 'ipv6' => '::ffff:127.0.0.2']]);\n\n // Domains that resolve to IPv6 link-local adddresses? Hell no!\n $badRedirects[\"linklocal.ip6\"] = array(\"https://linklocal.ip6/\", [['type' => 'AAAA', 'ipv6' => 'fe80::']]);\n\n return $badRedirects;\n }", "public function badUrlProvider() {\n\n $badRedirects[\"ip: 127.0.0.1\"] = array(\"http://127.0.0.1\", false);\n\n // Anything that resolves to zero needs to be tested carefully due to falsiness\n $badRedirects[\"ip: 0\"] = array(\"http://0/data.json\", false);\n\n // No dotted-quad decimals\n $badRedirects[\"ip: decimal\"] = array(\"http://169.254.169.254/latest/meta-data/hostname\", false);\n\n // Hex is bad\n $badRedirects[\"ip: hex\"] = array(\"http://0x7f000001/data.json\", false);\n\n // So is octal\n $badRedirects[\"ip: octal\"] = array(\"http://0123/data.json\", false);\n\n // We don't like mixed hex and octal either\n $badRedirects[\"ip: mixed hex/octal/decimal\"] = array(\"http://0x7f.0x0.0.0/data.json\", false);\n\n // We don't even like dotted-quads\n $badRedirects[\"ip: dotted-quad\"] = array(\"http://111.22.34.56/data.json\", false);\n\n // Don't you come around here with any of that IPv6 crap\n $badRedirects[\"ipv6: localhost\"] = array(\"http://[::1]\", false);\n\n // Domains that resolve to IPv4 localhost? NFW.\n $badRedirects[\"localhost.ip4\"] = array(\"https://localhost.ip4/\", [['type' => 'A', 'ip' => '127.0.0.1']]);\n\n // Domains that resolve to IPv6 localhost? Get out!\n $badRedirects[\"localhost.ip6\"] = array(\"https://localhost.ip6:443\", [['type' => 'AAAA', 'ipv6' => '::1']]);\n\n // Domains that resolve to IPv6 addresses that represent IPv4 private ranges? Not on our watch!\n $badRedirects[\"localhost2.ip6\"] = array(\"http://localhost2.ip6:80\", [['type' => 'AAAA', 'ipv6' => '::ffff:127.0.0.1']]);\n $badRedirects[\"private1.ip6\"] = array(\"https://private1.ip6:80\", [['type' => 'AAAA', 'ipv6' => '::ffff:192.168.1.18']]);\n $badRedirects[\"private2.ip6\"] = array(\"https://private2.ip6:80\", [['type' => 'AAAA', 'ipv6' => '::ffff:10.0.0.1']]);\n $badRedirects[\"private3.ip6\"] = array(\"http://private3.ip6:80\", [['type' => 'AAAA', 'ipv6' => '::ffff:127.0.0.2']]);\n\n // Domains that resolve to IPv6 link-local adddresses? Hell no!\n $badRedirects[\"linklocal.ip6\"] = array(\"https://linklocal.ip6/\", [['type' => 'AAAA', 'ipv6' => 'fe80::']]);\n\n return $badRedirects;\n }", "public function getValidCallbackUrls();", "public function sanitizeLocalUrlInvalidDataProvider() {}", "public function getAllowedServerURLs() {\n\t\t$result = array();\n\t\tif ($this->data['method'] != DISALLOW && $this->data['method'] != SKIP) {\n\t\t\t$regExp = ($this->data['cmptype'] == 1);\n\t\t\tif (!$regExp) {\n\t\t\t\t$result[] = $this->data['url'];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$result[] = '/' . str_replace('/', '\\/', $this->data['url']) . '/';\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "public function purgeInvalidUrls();", "public function isUrlDataProvider() \n\t{\n\t\treturn array(\n\t\t\t'google' => array('http://www.google.com', TRUE),\n\t\t\t'cumula' => array('http://www.cumula.org', TRUE),\n\t\t\t'unidiq' => array(uniqid('badurl_'), FALSE),\n\t\t\t'badhost' => array(uniqid('http://www.') .'~.com', FALSE),\n\t\t\t'baduser' => array('http://user~@localhost', FALSE),\n\t\t\t'badpass' => array('http://user:pass~@localhost', FALSE),\n\t\t\t'badpath' => array('http://localhost/%', FALSE),\n\t\t\t'badquery' => array('http://localhost/?;='. uniqid(), FALSE),\n\t\t);\n\t}", "function find_valid_urls( $content ) {\n\t\t$all_urls = array();\n\t\t$result = preg_match_all( '/\\b(?:(?:https?|ftp):\\/\\/|www\\.)[-a-z0-9+&@#\\/%?=~_|!:,.;]*[-a-z0-9+&@#\\/%=~_|]/i', $content, $all_urls );\n\t\t$remote_urls = array();\n\n\t\tif ( $result ) {\n\t\t\tforeach ( $all_urls[0] as $i => $url ) {\n\t\t\t\t// clean the url before we start doing anything\n\t\t\t\t$url = esc_url_raw( trim( $url ) );\n\n\t\t\t\t// ensure the url is remote and not blacklisted\n\t\t\t\tif ( ! empty( $url ) && $this->is_remote_url( $url ) && ! $this->is_blacklisted( $url ) ) {\n\t\t\t\t\t$remote_urls[] = $url;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! empty( $remote_urls ) ) {\n\t\t\t\treturn $remote_urls;\n\t\t\t} else {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function getAllowedURLs() {\n\t\treturn $this->configurationGenerator->getAllowedURLs();\n\t}", "public function test_valid_http_url() {\n $url1 = \"http://www.google.com\";\n $url2 = \"http://www.google.com/\";\n $url3 = \"http://www.google.com/foo/bar\";\n $url4 = \"http://www.google.com/?foo=bar\";\n\n $this->assertEquals(\n $url1,\n sanitize_url($url1)\n );\n\n $this->assertEquals(\n $url2,\n sanitize_url($url2)\n );\n\n $this->assertEquals(\n $url3,\n sanitize_url($url3)\n );\n\n $this->assertEquals(\n $url4,\n sanitize_url($url4)\n );\n }", "public function isValidUrlInvalidRessourceDataProvider() {}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation apiUsersNotifyPendingPostAsyncWithHttpInfo Sends a reminder email to the emails provided on request. Should be used after creating a batch of documents.
public function apiUsersNotifyPendingPostAsyncWithHttpInfo($body = null) { $returnType = ''; $request = $this->apiUsersNotifyPendingPostRequest($body); 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(), $response->getBody() ); } ); }
[ "public function apiUsersNotifyPendingPost($body = null)\n {\n $this->apiUsersNotifyPendingPostWithHttpInfo($body);\n }", "public function notificationsTestPostAsyncWithHttpInfo()\n {\n $returnType = '';\n $request = $this->notificationsTestPostRequest();\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 notificationsTestPostWithHttpInfo()\n {\n $returnType = '';\n $request = $this->notificationsTestPostRequest();\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }", "public function getTrackingReminderNotificationsAsyncWithHttpInfo($sort = null, $user_id = null, $created_at = null, $updated_at = null, $limit = '100', $offset = null, $variable_category_name = null, $reminder_time = null, $client_id = null, $only_past = null, $include_deleted = null, $platform = null)\n {\n $returnType = '\\CureDAO\\Client\\Models\\GetTrackingReminderNotificationsResponse';\n $request = $this->getTrackingReminderNotificationsRequest($sort, $user_id, $created_at, $updated_at, $limit, $offset, $variable_category_name, $reminder_time, $client_id, $only_past, $include_deleted, $platform);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function createNotificationUsingPostAsyncWithHttpInfo($notification)\n {\n $returnType = '\\com\\hydrogen\\nucleus\\Model\\Notification';\n $request = $this->createNotificationUsingPostRequest($notification);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function teamMembersIdNotificationsPostWithHttpInfo($id, $data = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling teamMembersIdNotificationsPost');\n }\n // parse inputs\n $resourcePath = \"/TeamMembers/{id}/notifications\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($id),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n // body params\n $_tempBody = null;\n if (isset($data)) {\n $_tempBody = $data;\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('access_token');\n if (strlen($apiKey) !== 0) {\n $queryParams['access_token'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'POST',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\Swagger\\Client\\Model\\Notification',\n '/TeamMembers/{id}/notifications'\n );\n\n return array($this->apiClient->getSerializer()->deserialize($response, '\\Swagger\\Client\\Model\\Notification', $httpHeader), $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Swagger\\Client\\Model\\Notification', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }", "public function notificationsTestPost()\n {\n $this->notificationsTestPostWithHttpInfo();\n }", "public function createNotificationEndpointAsyncWithHttpInfo($post_notification_endpoint)\n {\n $returnType = '\\InfluxDB2\\Model\\NotificationEndpoint';\n $request = $this->createNotificationEndpointRequest($post_notification_endpoint);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function postUserInviteAsyncWithHttpInfo($userId, $force = 'false')\n {\n $returnType = '';\n $request = $this->postUserInviteRequest($userId, $force);\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 usersPostAsyncWithHttpInfo($body)\n {\n $returnType = '\\PersonaClient\\Model\\LoginResponse';\n $request = $this->usersPostRequest($body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function usersTemporaryPostAsyncWithHttpInfo($body)\n {\n $returnType = '\\PersonaClient\\Model\\LoginResponse';\n $request = $this->usersTemporaryPostRequest($body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function allCheckNotificationsAsyncWithHttpInfo()\n {\n $returnType = '\\LivewatchApi\\Model\\CheckNotification';\n $request = $this->allCheckNotificationsRequest();\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 apiUsersPostAsyncWithHttpInfo($body)\n {\n $returnType = '\\Fiteco\\KimaiClient\\Model\\UserEntity';\n $request = $this->apiUsersPostRequest($body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ('\\SplFileObject' === $returnType) {\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\n throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri()), $statusCode, $response->getHeaders(), (string) $response->getBody());\n }\n );\n }", "public function addNotificationAsyncWithHttpInfo($evApiKey, $evAccessToken, $body = null)\n {\n $returnType = '\\ExaVault\\Model\\NotificationResponse';\n $request = $this->addNotificationRequest($evApiKey, $evAccessToken, $body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "protected function apiUsersNotifyPendingPostRequest($body = null)\n {\n\n $resourcePath = '/api/users/notify-pending';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json-patch+json', 'application/json', 'text/json', 'application/_*+json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('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 createPasswordRecoveryEmailAsyncWithHttpInfo($body)\n {\n $returnType = '\\TalonOne\\Client\\Model\\NewPasswordEmail';\n $request = $this->createPasswordRecoveryEmailRequest($body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function postUsersAsyncWithHttpInfo($body)\n {\n $returnType = '\\PureCloudPlatform\\Client\\V2\\Model\\User';\n $request = $this->postUsersRequest($body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function addMailUserAsyncWithHttpInfo($email, $password, $privileges)\n {\n $returnType = 'string';\n $request = $this->addMailUserRequest($email, $password, $privileges);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize(\n $content,\n $returnType,\n []\n ),\n $response->getStatusCode(),\n $response->getHeaders(),\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function restPluginsMailPostAsyncWithHttpInfo()\n {\n $returnType = 'object[]';\n $request = $this->restPluginsMailPostRequest();\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create request for operation 'updateWalletBalance'
protected function updateWalletBalanceRequest($user_id, $currency_code, $request = null) { // verify the required parameter 'user_id' is set if ($user_id === null) { throw new \InvalidArgumentException('Missing the required parameter $user_id when calling updateWalletBalance'); } // verify the required parameter 'currency_code' is set if ($currency_code === null) { throw new \InvalidArgumentException('Missing the required parameter $currency_code when calling updateWalletBalance'); } $resourcePath = '/users/{user_id}/wallets/{currency_code}/balance'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; // path params if ($user_id !== null) { $resourcePath = str_replace('{' . 'user_id' . '}', ObjectSerializer::toPathValue($user_id), $resourcePath); } // path params if ($currency_code !== null) { $resourcePath = str_replace('{' . 'currency_code' . '}', ObjectSerializer::toPathValue($currency_code), $resourcePath); } // body params $_tempBody = null; if (isset($request)) { $_tempBody = $request; } if ($multipart) { $headers= $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], ['application/json'] ); } // for model (json/xml) if (isset($_tempBody)) { $httpBody = $_tempBody; // $_tempBody is the method argument, if present } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { $multipartContents[] = [ 'name' => $formParamName, 'contents' => $formParamValue ]; } $httpBody = new MultipartStream($multipartContents); // for HTTP post (form) } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { $httpBody = \GuzzleHttp\Psr7\build_query($formParams); // for HTTP post (form) } } // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } $query = \GuzzleHttp\Psr7\build_query($queryParams); $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : ''); $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } $headers = array_merge( $defaultHeaders, $headerParams, $headers ); return new Request( 'PUT', $url, $headers, $httpBody ); }
[ "public function testSendWithRequestWalletBalance()\n {\n $service = $this->getStubForTest(file_get_contents(__DIR__ . '/TestAsset/Response/wallet_balance.txt'));\n\n $request = new Request\\WalletBalance();\n\n /* @var $response Response\\WalletBalance */\n $response = $service->send($request);\n\n $this->assertEquals(0, $response->getBalance());\n\n $this->assertEquals(\n $this->getLastRawRequestExpected(__DIR__ . '/TestAsset/Request/wallet_balance.txt'),\n $this->getLastRawRequest($service),\n 'Requests does not match'\n );\n }", "protected function getWalletBalancesRequest()\n {\n\n $resourcePath = '/wallets/totals';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\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 (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n $httpBody = new MultipartStream($multipartContents); // for HTTP post (form)\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams); // for HTTP post (form)\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 // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : '');\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 return new Request(\n 'GET',\n $url,\n $headers,\n $httpBody\n );\n }", "public static function newAccountBalanceRequest(): AccountBalanceRequest {\n return new AccountBalanceRequest();\n }", "function updateBalance(): void {\n\t}", "public function updateWallet(){\n //'pending','preparing','ready','enroute','delivered','failed','cancelled'\n if( in_array($this->status, ['failed', 'cancelled'] ) && $this->payment_method->slug != \"cash\" ){\n\n //update user wallet\n $wallet = Wallet::firstOrCreate(\n ['user_id' => $this->user_id],\n ['balance' => 0]\n );\n\n //\n $wallet->balance += $this->total;\n $wallet->save();\n\n }\n }", "public function updateByAddressAndCoin(string $address, string $coin, string $value): Balance;", "private function _updateBalance()\n\t{\n\t\t$id = $this->_data['id'];\n\n\t\t$sql = 'update workorder set ';\n\t\t$sql.= 'bill_amount = (';\n\t\t\t$sql.= \"select sum(a_quantity * a_rate) from workorder_item \";\n\t\t\t$sql.= \" where workorder_id=$id and status = 'Billed' ) \";\n\t\t$sql.= ',';\n\t\t$sql.= 'open_amount = (';\n\t\t\t$sql.= 'select sum(a_quantity * a_rate) from workorder_item ';\n\t\t\t$sql.= \" where workorder_id = $id and status in ('Active','Complete') \";\n\t\t$sql.= \") where id=$id\";\n\t\tSQL::query($sql);\n\n\t\t$this->bill_amount = SQL::fetch_one(\"SELECT bill_amount FROM workorder WHERE id = $id\");\n\t\t$this->open_amount = SQL::fetch_one(\"SELECT open_amount FROM workorder WHERE id = $id\");\n\t}", "public function updateAccountBalance($newBalance){\n $expectedExceptions = array();\n $expectedExceptions[\"\\\\Kinikit\\\\MVC\\\\Exception\\\\RateLimitExceededException\"] = \"\\Netistrar\\ClientAPI\\Exception\\RateLimitExceededException\";\n parent::callMethod(\"updateBalance/$newBalance\", \"GET\", array(),null,null,$expectedExceptions);\n }", "public function updateBalance(Request $request, User $user)\n {\n $this->validate($request, [\n 'amount' => 'required|numeric',\n 'currency' => 'required|in:' . implode(',', TransactionCurrency::enum())\n ]);\n\n $user->transactions()->create([\n 'amount' => $request->input('amount'),\n 'currency' => $request->input('currency'),\n 'reason' => TransactionReason::ADMIN_EDIT,\n 'note' => $request->input('note')\n ]);\n\n return redirect()\n ->back()\n ->with('success', 'Successfully created transaction');\n }", "public function validateBalanceParams()\n {\n\t\t$bean \t= \t$this->bean;\n\t \t$rules \t= \t[\n\t\t\t\t\t\t'required' => [\n\t\t\t\t\t\t\t ['WalletId']\n\t\t\t\t\t\t]\n\t\t\t\t\t];\n\t\t\n $v \t\t= \tnew Validator($this->bean);\n $v->rules($rules);\n if (!$v->validate()) {\n $errors = $v->errors();\n\t\t\t// check UsersId and PaymentAmount field\n throw new ApiException(\"Please check WalletId.\" , ErrorCodeType::SomeFieldsRequired, $errors);\n }\n\t}", "protected function walletWithdrawRequest($start_date = null, $end_date = null, $coin = null, $status = null, $page = null, $limit = null)\n {\n\n $resourcePath = '/open-api/wallet/withdraw/list';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($start_date !== null) {\n $queryParams['start_date'] = ObjectSerializer::toQueryValue($start_date);\n }\n // query params\n if ($end_date !== null) {\n $queryParams['end_date'] = ObjectSerializer::toQueryValue($end_date);\n }\n // query params\n if ($coin !== null) {\n $queryParams['coin'] = ObjectSerializer::toQueryValue($coin);\n }\n // query params\n if ($status !== null) {\n $queryParams['status'] = ObjectSerializer::toQueryValue($status);\n }\n // query params\n if ($page !== null) {\n $queryParams['page'] = ObjectSerializer::toQueryValue($page);\n }\n // query params\n if ($limit !== null) {\n $queryParams['limit'] = ObjectSerializer::toQueryValue($limit);\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', 'application/x-www-form-urlencoded']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('api_key');\n if ($apiKey !== null) {\n $queryParams['api_key'] = $apiKey;\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('sign');\n if ($apiKey !== null) {\n $queryParams['sign'] = $apiKey;\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('timestamp');\n if ($apiKey !== null) {\n $queryParams['timestamp'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "function setBalance($username, $id);", "function getUserWalletBalance()\n {\n $token = refreshAuthToken();\n \n global $I_A_N;\n global $endpoint;\n global $u_id;\n global $wallet_currency;\n \n $curl = curl_init();\n\n $request_fields = [\n \"GetUserWalletBalance\"=>[ \n \"request\"=>[ \n \"IssuerAccountNumber\"=>$I_A_N,\n \"BeneficiaryAccountNumber\"=>$u_id,\n \"Currency\"=>$wallet_currency\n ]\n ]\n ];\n\n $json_typed = json_encode($request_fields);\n \n curl_setopt_array($curl, array(\n CURLOPT_URL => $endpoint.'/API/v4/Wallet/GetUserWalletBalance',\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => '',\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 0,\n CURLOPT_FOLLOWLOCATION => true,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => 'POST',\n CURLOPT_POSTFIELDS => $json_typed,\n CURLOPT_HTTPHEADER => array(\n \"Content-Type: application/json\",\n \"Authorization: Bearer \".$token\n )\n ));\n \n $response = curl_exec($curl);\n $err = curl_error($curl);\n\n curl_close($curl);\n\n $resp = json_decode($response, true);\n\n //global $go_home;\n\n if ($err) {\n echo \"cURL Error #:\" . $err;\n } else {\n echo \"<h1>User Wallet Balance</h1>\";\n //echo \"<p><a href='\".$go_home.\"'>Return to API calls test page</a></p>\";\n foreach($resp as $resps){\n foreach($resps as $resp){\n foreach($resp as $result){\n foreach($result as $detail=>$part){\n echo $detail.\" = \".$part.\"<br>\";\n }\n echo \"<br>\";\n }\n }\n }\n }\n }", "public function addWithdrawMoneyRequestFromUserBalance(Request $request)\n {\n try {\n $rule = [\n 'mobile_number' => 'required',\n 'amount' => 'required|numeric|regex:/^\\s*(?=.*[1-9])\\d*(?:\\.\\d{1,2})?\\s*$/',\n 'action' => ['required', Rule::in([Config::get('constant.ADD_MONEY_ACTION'), Config::get('constant.WITHDRAW_MONEY_ACTION')])],\n ];\n\n $validator = Validator::make($request->all(), $rule);\n\n if ($validator->fails()) {\n return response()->json([\n 'status' => 0,\n 'message' => $validator->messages()->all()[0],\n ], 200);\n }\n\n // Validate mobile numbers\n $validateMobileNumber = Helpers::validateMobileNumber($request->mobile_number, $request->user()->mobile_number);\n\n if (isset($validateMobileNumber['status']) && $validateMobileNumber['status'] == 0) {\n return response()->json([\n 'status' => 0,\n 'message' => $validateMobileNumber['message'],\n ], 200);\n }\n\n DB::beginTransaction();\n\n // Check sender balance\n if ($request->action == Config::get('constant.ADD_MONEY_ACTION')) {\n // Here current logined admin is as a sender\n $senderUser = $request->user();\n $senderDetail = $request->user()->userDetail()->lockForUpdate()->first();\n\n $user = $receiverUser = User::where('mobile_number', $request->mobile_number)->first();\n $receiverDetail = $receiverUser->userDetail()->lockForUpdate()->first();\n $insufficientBalanceErrorMsg = trans('apimessages.insufficient_balance_msg');\n $otp_o_type = Config::get('constant.OTP_O_ADD_MONEY_VERIFICATION');\n } else {\n // Here current logined admin is as a receiver\n $receiverUser = $request->user();\n $receiverDetail = $request->user()->userDetail()->lockForUpdate()->first();\n\n $user = $senderUser = User::where('mobile_number', $request->mobile_number)->first();\n $senderDetail = $senderUser->userDetail()->lockForUpdate()->first();\n $insufficientBalanceErrorMsg = $senderUser->full_name . trans('apimessages.insufficient_balance');\n $otp_o_type = Config::get('constant.OTP_O_WITHDRAW_MONEY_VERIFICATION');\n }\n if ($senderDetail->balance_amount < $request->amount) {\n DB::rollback();\n Log::channel('transaction')->error(strtr(trans('log_messages.insufficient_balance'),[\n '<Mobile Number>' => $senderUser->mobile_number\n ]));\n return response()->json([\n 'status' => 0,\n 'message' => $insufficientBalanceErrorMsg,\n ], 200);\n }\n // Save transaction history with not verified status\n $otp = mt_rand(100000, 999999);\n $addOrWithdrawMoneyRequest = new AgentAddOrWithdrawMoneyRequest([\n 'otp_sent_to' => $request->user()->mobile_number,\n 'amount' => $request->amount,\n 'description' => (isset($request->description)) ? $request->description : null,\n 'action' => $request->action,\n 'otp' => $otp,\n 'otp_created_at' => Carbon::now(),\n ]);\n $user->addMoneyRequest()->save($addOrWithdrawMoneyRequest);\n\n // $mobileNumber = ($request->action == Config::get('constant.ADD_MONEY_ACTION')) ? $request->user()->mobile_number : $request->mobile_number;\n // Send OTP to agent\n \n $sendOtp = Helpers::sendMessage($request->user()->mobile_number, strtr(trans('apimessages.ADD_WITHDRAW_MONEY_OTP_MESSAGE'),[\n '<Action>' => $request->action,\n '<OTP>' => $otp\n ]));\n\n if (!$sendOtp) {\n Log::channel('otp')->error(strtr(trans('log_messages.otp_error_action'),[\n '<Mobile Number>' => $request->user()->mobile_number,\n '<Action>' => $request->action\n ]));\n DB::rollback();\n return response()->json([\n 'status' => '0',\n 'message' => trans('apimessages.something_went_wrong'),\n ], 200);\n }\n\n Log::channel('otp')->info(strtr(trans('log_messages.otp_success_action'),[\n '<Mobile Number>' => $request->user()->mobile_number,\n '<Action>' => $request->action\n ]));\n\n $om = new OTPManagement();\n $om->otp = $otp;\n $om->from_user = $request->action == Config::get('constant.WITHDRAW_MONEY_ACTION') ? $senderUser->id : null;\n $om->to_user = $request->action == Config::get('constant.ADD_MONEY_ACTION') ? $receiverUser->id : null;\n $om->otp_sent_to = $request->user()->mobile_number;\n $om->amount = $request->amount;\n $om->operation = $otp_o_type;\n $om->created_by = $request->user()->id;\n $om->message = strtr(trans('apimessages.ADD_WITHDRAW_MONEY_OTP_MESSAGE'),[\n '<Action>' => $request->action,\n '<OTP>' => $otp\n ]);\n $om->save();\n \n // Manage response message - Start\n if (Config::get('constant.DISPLAY_OTP') == 1) {\n $responseMessage = strtr(trans('apimessages.OTP_SENT_SUCCESS_MESSAGE_FOR_DEV'),[\n '<Mobile Number>' => $request->user()->mobile_number,\n '<OTP>' => $otp\n ]);\n } else {\n $responseMessage = strtr(trans('apimessages.OTP_SENT_SUCCESS_MESSAGE_FOR_PROD'),[\n '<Mobile Number>' => $request->user()->mobile_number,\n ]);\n }\n // Manage response message - Ends\n\n DB::commit();\n // All good so return the response\n return response()->json([\n 'status' => '1',\n 'message' => $responseMessage,\n 'data' => [\n 'otp_sent_to' => $request->user()->mobile_number, //$mobileNumber,\n 'mobile_number' => $request->mobile_number,\n 'action' => $request->action,\n 'request_id' => $addOrWithdrawMoneyRequest->id,\n ],\n ], 200);\n } catch (\\Exception $e) {\n DB::rollback();\n Log::error(strtr(trans('log_messages.default_error_msg'),[\n '<Message>' => $e->getMessage()\n ]));\n return response()->json([\n 'status' => 0,\n 'message' => trans('apimessages.default_error_msg'),\n ], 500);\n }\n }", "function update($wallet = \"\", $name = null, $email = null, $countryCode = null, $phone = null, $avatar = null, $isPublic = false, $blocked = false)\n {\n return LedgefarmCore::put(\n array(\n 'wallet' => $wallet,\n 'name' => $name,\n 'email' => $email,\n 'countryCode' => $countryCode,\n 'phone' => $phone,\n 'avatar' => $avatar,\n 'isPublic' => $isPublic,\n 'blocked' => $blocked\n ),\n \"/wallet\"\n );\n }", "public function testSendWithRequestAddressBalance()\n {\n $service = $this->getStubForTest(file_get_contents(__DIR__ . '/TestAsset/Response/address_balance.txt'));\n\n $request = new Request\\AddressBalance();\n $request->setAddress('efjsdkfjkwefkwejfkesf');\n\n /* @var $response Response\\AddressBalance */\n $response = $service->send($request);\n\n $this->assertEquals(0, $response->getBalance());\n\n $this->assertEquals(\n $this->getLastRawRequestExpected(__DIR__ . '/TestAsset/Request/address_balance.txt'),\n $this->getLastRawRequest($service),\n 'Requests does not match'\n );\n }", "private function _updateBalance()\n\t{\n\t\t$id = intval($this->_data['id']);\n\t\t\n\t\t$sql = 'UPDATE invoice SET';\n\t\t$sql.= ' sub_total = ( SELECT SUM ( quantity * rate * (1 + tax_rate)) FROM invoice_item WHERE invoice_id = ?)';;\n\t\t$sql.= ', tax_total = ( SELECT SUM ( quantity * rate * tax_rate) FROM invoice_item WHERE invoice_id = ?)';\n\t\t$sql.= ', bill_amount = ( SELECT SUM ( quantity * rate * (1 + tax_rate)) FROM invoice_item WHERE invoice_id = ?) ';\n\t\t// $sql.= ', paid_amount =\n\t\t$sql.= ' WHERE id = ? ';\n\t\tSQL::query($sql, array($id, $id, $id, $id));\n\t\t// die(SQL::lastError());\n\n\t\t// $r = array();\n\t\t// $r['sub_total'] = floatval($d->fetchOne(\"select sum( quantity * rate ) as sub_total from invoice_item where invoice_id={$id}\"));\n\t\t// $r['tax_total'] = floatval($d->fetchOne(\"select sum( quantity * rate * tax_rate) as tax_total from invoice_item where invoice_id={$id}\"));\n\t\t// $sql.= ' sub_total = ?, ';\n\t\t// $arg[] = floatval(SQL::fetch_one(\"select sum( quantity * rate * tax_rate) as tax_total from invoice_item where invoice_id={$id}\"));\n\t\t// // $r['bill_amount'] = $r['sub_total'] + $r['tax_total'];\n\t\t// $sql.= ' bill_amount = ?, ';\n\t\t// $arg[] = $r['sub_total'] + $r['tax_total'];\n\t\t// // $r['paid_amount'] = $this->getTransactionSum();\n\t\t// $sql.= ' paid_amount = ? ';\n\t\t// $arg[] = $this->getTransactionSum();\n\n\t\t// @todo Force Marking as Paid Amount Full?\n\t\t// if ($this->status == 'Paid') {\n\t\t//\t $r['paid_amount'] = $r['bill_amount'];\n\t\t// }\n\t\t// $w = array('id = ?'=>$this->id);\n\t\t// $t = new Zend_Db_Table(array('name'=>'invoice'));\n\t\t// $t->update($r,$w);\n\n\t\t// @todo Save to Object Data?\n\t\t// $this->bill_amount = $r['bill_amount'];\n\t\t// $this->paid_amount = $r['paid_amount'];\n\t\t// $this->sub_total = $r['sub_total'];\n\t\t// $this->tax_total = $r['tax_total'];\n\n\t}", "public function debit_put()\n {\n $id=$this->get('id');\n $update_data=array(\n 'd_balance'=>$this->put('d_balance')\n );\n $result=$this->Debit_model->update_debit($id, $update_data);\n\n if($result)\n {\n $message = [\n 'da_id'=>$id,\n 'd_balance'=>$this->put('d_balance'),\n 'message' => 'Updated a resource'\n ];\n\n $this->set_response($message, REST_Controller::HTTP_CREATED); // CREATED (201) being the HTTP response code\n }\n else \n {\n // Set the response and exit\n $this->response([\n 'status' => FALSE,\n 'message' => 'Can not update data',\n 'id' => $id,\n 'd_balance' => $this->put('d_balance')\n ], REST_Controller::HTTP_CONFLICT); // CAN NOT CREATE (409) being the HTTP response code\n }\n }", "protected function createWalletRequest($wallet_request)\n {\n // verify the required parameter 'wallet_request' is set\n if ($wallet_request === null || (is_array($wallet_request) && count($wallet_request) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $wallet_request when calling createWallet'\n );\n }\n\n $resourcePath = '/wallet/create';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n // body params\n $_tempBody = null;\n if (isset($wallet_request)) {\n $_tempBody = $wallet_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 if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $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 Bearer authentication (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 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ action get video advertise
public function getVideoAds(){ $getads= VideoAdsModel::get(); return view('admincp.ads.video_ads_list')->with('videoAds',$getads); }
[ "public static function getsearchvideo()\n\t{\n\t}", "public function video()\r\n {\r\n // Get parameters\r\n $parameters = $this->getParameters();\r\n\r\n // Vendor?\r\n if (!isset($parameters['vendor'])) {\r\n $parameters['vendor'] = self::getVendorFromUrl($parameters);\r\n }\r\n\r\n // Get the ID\r\n $parameters['id'] = self::getId($parameters);\r\n\r\n // Check cache\r\n if (!$return = ci()->cache->get('video:' . $parameters['url'])) {\r\n\r\n // Build the return\r\n $return = array();\r\n\r\n // Link\r\n $return['link'] = self::getLink($parameters);\r\n\r\n // Embed\r\n $return['embed'] = self::getEmbed($parameters);\r\n\r\n // Thumbnails\r\n $return['thumbnails'] = self::getThumbnails($parameters);\r\n\r\n // Information\r\n $return['information'] = self::getInformation($parameters);\r\n\r\n // Prep some information\r\n $return['information']['entry']['title'] = $return['information']['entry']['title']['$t'];\r\n\r\n // Cache\r\n ci()->cache->put('video:' . $parameters['url'], $return, 86400); // Cache for a day\r\n }\r\n\r\n return array($return);\r\n }", "public function GetVideoInfo()\n {\n }", "public function obtainVideos()\n {\n return $this->performRequest('GET','/videos');\n }", "public function getAllCpackVideo()\n {\n }", "public function videoDetail()\n {\n $id = intval($_GET['id']);\n $table = (isset($_GET['from']) && $_GET['from']=='daily') ? 'daily_video' : 'video';\n $video = M($table)->where(array('id'=>$id))->find();\n //$videoInfo = D('Article')->getVideoInfoByLink($video['link']);\n //print_r($video);\n //$this->assign('videoInfo', $videoInfo);\n $this->assign('video', $video);\n $this->assign('cssFile', 'v');\n $this->display('video');\n }", "function show_advertise_video_public($ad_id,$width,$height,$skin_media='default.zip'){\n\n\t\t$str_select=\"*\";\n\t\t$arr_where=array($this->_table.'.ad_id'=>$ad_id,'category_sub.cate_public'=>1);\n\n\t\t$this->db->select($str_select);\n\t\t$this->db->join('category_sub',$this->_table.'.cate_id=category_sub.cate_id');\n\t\t$this->db->where($arr_where);\n\n\t\t$query=$this->db->get($this->_table);\n\t\t$arr_advertise=$query->row_array();\n\t\t$string_advertise='';\n\n\t\tif(is_array($arr_advertise) && !empty($arr_advertise)){\n\n\t\t\t$str_height=($height == 0) ? \"\" : \"height='\".$height.\"px' \";\n\n\t\t\t$string_flashvars=\"netstreambasepath=\".base_url();\n\t\t\t$string_flashvars.= \"&amp;playlist.position=none\";\n\t\t\t$string_flashvars.= \"&amp;playlist.size=0\";\n\t\t\t$string_flashvars.= \"&amp;skin=\".base_url().DIR_PUBLIC.\"mediaplayer/skin/\".$skin_media;\n\t\t\t$string_flashvars.= \"&amp;config=\".base_url().DIR_PUBLIC.\"mediaplayer/config/config.xml\";\n\t\t\t$string_flashvars.= \"&amp;title=\".element('ad_name',$arr_advertise,'');\n\t\t\t$string_flashvars.= \"&amp;file=\".base_src_video(element('ad_img',$arr_advertise,''));\n\n\t\t\t$string_advertise.= \"<object width='\".$width.\"' \".$str_height;\n\t\t\t$string_advertise.= \"classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' \";\n\t\t\t$string_advertise.= \"codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' \";\n\t\t\t$string_advertise.= \"align='center' style='overflow:hidden'>\";\n\n\t\t\t$string_advertise.= \"<param name='movie' value='\".base_url().DIR_PUBLIC.\"mediaplayer/player.swf' />\";\n\t\t\t$string_advertise.= \"<param name='quality' value='high' />\";\n\t\t\t$string_advertise.= \"<param name='allowscriptaccess' value='always' />\";\n\t\t\t$string_advertise.= \"<param name='wmode' value='transparent' />\";\n\t\t\t$string_advertise.= \"<param name='allowfullscreen' value='true' />\";\n\t\t\t$string_advertise.= \"<param name='flashvars' value='\".$string_flashvars.\"' />\";\n\t\t\t$string_advertise.= \"<embed width='\".$width.\"' \".$str_height;\n\t\t\t$string_advertise.= \"type='application/x-shockwave-flash' \";\n\t\t\t$string_advertise.= \"pluginspage='http://www.macromedia.com/go/getflashplayer' \";\n\t\t\t$string_advertise.= \"align='center' style='overflow:hidden' \";\n\n\t\t\t$string_advertise.= \"src='\".base_url().DIR_PUBLIC.\"mediaplayer/player.swf' \";\n\t\t\t$string_advertise.= \"quality='high' \";\n\t\t\t$string_advertise.= \"allowscriptaccess='always' \";\n\t\t\t$string_advertise.= \"wmode='transparent' \";\n\t\t\t$string_advertise.= \"allowfullscreen='true' \";\n\t\t\t$string_advertise.= \"flashvars='\".$string_flashvars.\"' />\";\n\t\t\t$string_advertise.= \"</object>\";\n\t\t}\n\t\treturn $string_advertise;\n\n\t}", "public function get_video_from_url()\n {\n $url = $this->input->post('url', true);\n\n $this->load->library('video_url_parser');\n echo $this->video_url_parser->get_url_embed($url);\n\n }", "static function getLinkNCTVideo($link)\n {\n $content = self::curl($link); // đọc nội dung trang\n $return = array();\n preg_match(\"/play_key\\=\\\"(.*)\\\"/\",$content,$arr_preg); // tìm key\n if($arr_preg){\n $arrKeyXML = explode('\"', $arr_preg[1]); // tách key trong chuỗi vừa tìm được\n $linkXML = 'http://v.nhaccuatui.com/flash/xml?key='.$arrKeyXML[0]; // ghép key vào link xml\n $xml_data = self::curl($linkXML); // đọc nội dung trang xml\n $xml_string = str_replace(\"<![CDATA[\",\"\",$xml_data); // loại bỏ <![CDATA[\n $xml_string = str_replace(\"]]>\",\"\",$xml_string); // loại bỏ ]]>\n //print_r($xml_string);exit();\n $xml_string=preg_replace('/&(?!#?[a-z0-9]+;)/', '&amp;', $xml_string);\n $xml_arr = json_decode(json_encode((array) simplexml_load_string($xml_string)), 1); // chuyển đổi thành mảng\n if($xml_arr['track']['item']){\n $arrItem = $xml_arr['track']['item'];\n foreach ($arrItem as $key => $item) {\n $return[$key]['link480'] = self::trimData($item['location']); // link video 480p\n $return[$key]['link360'] = self::trimData($item['lowquality']); // link video 480p\n $return[$key]['link720'] = self::trimData($item['highquality']); // link video 480p\n $return[$key]['title'] = self::trimData($item['title']); // title\n $return[$key]['image'] = self::trimData($item['image']); // link image\n $return[$key]['time'] = self::trimData($item['time']); // time\n $return[$key]['view'] = self::trimData($item['view']); // lượt view\n }\n }\n }\n return $return;\n }", "function view_video()\n\n\t{\n\n\t\t# Get the passed details into the url data array if any\n\n\t\t$urldata = $this->uri->uri_to_assoc(3, array('m', 's'));\n\n\t\t# Pick all assigned data\n\n\t\t$data = assign_to_data($urldata);\n\n\t\t\n\n\t\t\n\n\t\t$data['area'] = \"view_video\";\n\n\t\t$data = add_msg_if_any($this, $data);\n\n\t\t$this->load->view('incl/addons', $data);\n\n\t}", "function video_go($url) {\n //! To do: Send URL to Viddler API.\n $response = $this->video_detailsbyurl($url);\n \n if (isset($response['error'])) {\n return false;\n } else {\n return 'http://go.viddler.com/'.$response['video']['id'].'/';\n }\n }", "function getOGVideoActors();", "abstract protected function videoApiInformation();", "public function selVideo()\n { \n $where['recycle'] = 1;\n $order = \"v_id desc\";\n $field = \"v_id,v_cid,v_title,v_describe,v_type,v_data1,v_data2,v_firstimgurl,v_secondimgurl,limit,from_unixtime(v_addtime,'%Y-%m-%d %H:%i:%s')v_addtime,v_status,v_publisherid,playnum,recycle\";\n $videolist = $this->AdminModelObj\n ->searchPage($this->VideoObj,$where,$field,$order,$limit,$join,3);\n $videolist = $this->matcheLable($videolist);\n $videolist = $this->matcheClass($videolist);\n return $videolist;\n }", "public function videosAction() {\r\n\r\n try {\r\n \r\n // Get video press reviews using cache\r\n $pressReviews = $this->getPressReviews(PressReviewTypes::VIDEO, null, null, true);\r\n \r\n // Add common items to model view\r\n $this->addCommonListItemsToModelView(null, null, null, $pressReviews, PressReviewTypes::VIDEO);\r\n } catch (\\Exception $e) {\r\n Trace::addItem(sprintf(\"Une erreur s'est produite dans \\\"%s->%s\\\", TRACE : %s\\\"\", get_class(), __FUNCTION__, $e->getTraceAsString()));\r\n $this->forward(\"error\", \"error\", \"default\");\r\n }\r\n }", "function video_search()\r\n\t{\r\n\t\t$SERVICE_URL = \"http://www.searchmash.com/results/video:\";\r\n\t\t\r\n\t\t//elaborar el url adecuado para este servicio\r\n\t\t\r\n\t\t$peticion_url = $this->elaborar_url($SERVICE_URL);\r\n\t\t\r\n\t\t//conectarse y obtener la respuesta en formato nativo\r\n\t\t\r\n\t\t$this->respuesta_raw = $this->buscar($peticion_url);\t\t//TODO: validar una respuesta exitosa\r\n\t\t\r\n\t\t//transformar la respuesta raw a finjira\r\n\t\t\r\n\t\t$this->respuesta_findjira = $this->video_parse();\t\t\t\t//web_parse utiliza respuesta_raw para transformarla\r\n\t\t\r\n\t}", "public function video()\n {\n $data = array(\n 'judul_halaman' => 'Sibejoo - Video',\n 'judul_header' => 'Layanan Video',\n );\n\n $konten = 'modules/layanan/views/r-layanan-video.php';\n\n $data['files'] = array(\n APPPATH . 'modules/homepage/views/r-header-detail.php',\n APPPATH . $konten,\n APPPATH . 'modules/homepage/views/r-footer.php',\n );\n\n $this->parser->parse('r-index-layanan', $data);\n }", "function video_featured_video_shortcode($attr=array()){\n \tglobal $frontControllerPath, $frontModelPath, $frontViewPath, $wp_query;\n \tinclude_once ($frontControllerPath . 'videomoreController.php');\n \t$videoOBJ = new ContusMoreView(); // create object for video more view class\n \t$more = 'featured';\n \t$contentvideoPlayer = $videoOBJ->video_more_pages($more);\n \treturn $contentvideoPlayer;\n }", "function wp_embed_handler_googlevideo($matches, $attr, $url, $rawattr)\n {\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Short description for 'writeNotesArea' Long description (if any) ...
public static function writeNotesArea($notes, $option, $type='', $edititem = 0, $addnew = 1) { $out =''; $i = 0; if (count($notes) > 0) { $out .= '<ul class="features">'."\n"; for ($i=0, $n=count($notes); $i < $n; $i++) { $note = $notes[$i]; $out .= ' <li>'."\n"; $out .= ' <span><span>'.Lang::txt('COM_TOOLS_EDIT').'</span></span>'."\n"; $out .= $note->note; $out .= ' </li>'."\n"; } $out .= '</ul>'."\n"; } if ($addnew) { $out .= self::addNoteArea($i, $option, $type); } return $out; }
[ "function showNotes() {\n\t\t$this->getRequest()->getApplication()->getResponse()\n\t\t\t->addResponse(\"\\nNotes:\")\n\t\t\t->addResponse(cliConsoleTools::drawSeparator())\n\t\t\t->addResponse(\n\t\t\t\twordwrap(\n\t\t\t\t\t'The order of commands is important. They are processed in the order they appear. Ensure '.\n\t\t\t\t\t'all switch commands are placed before actual commands. Aliases (switches) are always '.\n\t\t\t\t\t'processed before commands',\n\t\t\t\t\tcliConstants::CONSOLE_WIDTH\n\t\t\t\t)\n\t\t\t);\n\t}", "public function afficheNotes()\n {\n }", "private function writeNotes()\n {\n /** @var \\PhpOffice\\PhpWord\\Writer\\HTML $parentWriter Type hint */\n $parentWriter = $this->getParentWriter();\n $phpWord = $parentWriter->getPhpWord();\n $notes = $parentWriter->getNotes();\n\n $content = '';\n\n if (!empty($notes)) {\n $content .= \"<hr />\" . PHP_EOL;\n foreach ($notes as $noteId => $noteMark) {\n list($noteType, $noteTypeId) = explode('-', $noteMark);\n $method = 'get' . ($noteType == 'endnote' ? 'Endnotes' : 'Footnotes');\n $collection = $phpWord->$method()->getItems();\n\n if (isset($collection[$noteTypeId])) {\n $element = $collection[$noteTypeId];\n $noteAnchor = \"<a name=\\\"note-{$noteId}\\\" />\";\n $noteAnchor .= \"<a href=\\\"#{$noteMark}\\\" class=\\\"NoteRef\\\"><sup>{$noteId}</sup></a>\";\n\n $writer = new TextRunWriter($this->getParentWriter(), $element);\n $writer->setOpeningText($noteAnchor);\n $content .= $writer->write();\n }\n }\n }\n\n return $content;\n }", "public static function productNotesCustomField() {\n echo '<div class=\"options_group show_if_simple show_if_variable show_if_external\">';\n woocommerce_wp_textarea_input([\n 'id' => '_' . Plugin::PREFIX . '_product_notes',\n 'label' => __('Internal product notes', Plugin::L10N),\n 'style' => 'min-height: 120px;',\n ]);\n echo '</div>';\n }", "public function testAreaField($args)\r\n {\r\n $name = $args['labels_for'];\r\n\r\n $option_name = $args['option_name'];\r\n\r\n $title = $args['title'];\r\n\r\n echo '<textarea name=\"' . $name . '\" id=\"' . $name . '\" placeholder=\"' . $title . '\" rows=\"4\" cols=\"18\"> </textarea>';\r\n }", "function render_notes_meta() {\n\t\tglobal $post;\n\t\t$details = get_post_meta( $post->ID, 'country_details', true );\n\t\t?>\n\t\t<textarea cols=\"50\" rows=\"5\" name=\"country_details\"><?php echo $details; ?></textarea>\n\t\t<?php\n\t}", "public function setNotes($var)\n {\n GPBUtil::checkString($var, True);\n $this->notes = $var;\n }", "function pyis_dpd_helpscout_do_field_textarea( $args = array() ) {\n\tpyis_dpd_helpscout_fieldhelpers()->fields->do_field_textarea( $args['name'], $args );\n}", "static function add_notes(): void {\r\n\t\tself::add_acf_inner_field(self::divisions, self::notes, [\r\n\t\t\t'label' => 'Notes',\r\n\t\t\t'type' => 'text',\r\n\t\t\t'instructions' => 'Any notes pertinent to the division.',\r\n\t\t\t'required' => 0,\r\n\t\t\t'conditional_logic' => 0,\r\n\t\t\t'wrapper' => [\r\n\t\t\t\t'width' => '40',\r\n\t\t\t\t'class' => '',\r\n\t\t\t\t'id' => '',\r\n\t\t\t]\r\n\t\t]);\r\n\t}", "public function getAreaShortName()\n {\n return $this->area_short_name;\n }", "function show_text_area()\n\t{\n\t\tif($this->edit)\n\t\t{\n\t\t\tif($this->required)\n\t\t\t\t$style = \"width:98%;border-color:red;border-style:solid\";\n\t\t\telse\n\t\t\t\t$style = \"width:98%;\";\n\n\t\t\techo \"\\n <textarea style=\\\"\" . $style . \"\\\" name=\\\"ldap_attribute_\"\n\t\t\t\t. $this->attribute . \"\\\" title=\\\"\" . $this->display_name\n\t\t\t\t. \"\\\" placeholder=\\\"\" . $this->display_name . \"\\\">\"\n\t\t\t\t. htmlentities($this->value,ENT_COMPAT,\"UTF-8\")\n\t\t\t\t. \"</textarea>\";\n\t\t}\n\t\telse\n\t\t\tif($this->show_embedded_links)\n\t\t\t\techo nl2br(urls_to_links(htmlentities($this->value,ENT_COMPAT,\"UTF-8\")),false);\n\t\t\telse\n\t\t\t\techo nl2br(htmlentities($this->value,ENT_COMPAT,\"UTF-8\"),false);\n\t}", "public function setNotes($notes);", "public function do_section_notes() {\n\t\techo esc_html__( 'Notes on other specific page types.', 'add-meta-tags' );\n\t}", "public function setDmAreaText($areaText);", "private function _save_notes(){\n\t\t\n\t\t\n\t\t\n\t}", "function annotorious_notes() {\n\tif ( !current_user_can( 'manage_options' ) ) {\n\t\twp_die( __( 'You do not have sufficient permissions to access this page.' ) );\n\t}\n?>\n\t<div class=\"wrap\">\n\t\t<h2>Image Annotation Notes</h2>\n\t\t<form method=\"post\" action=\"\">\n\t\t\t<?php annotorious_show_notes(); ?>\n\t\t\t<?php annotorious_delete_note(); ?>\n\t\t</form>\n\t</div>\n<?php\n}", "public function form_process_note($atts= array ()){\n global $mb_plugin_options;\n extract($atts);\n \n $output = '';\n if ($desc) {\n $output .= '<div class=\"mb-notes\">';\n $output .= '<p>' . $desc . '</p>';\n $output .= '</div>';\n }\n \n echo force_balance_tags ( $output );\n }", "function ots_textarea( $args ) {\t\t\n\t\t\t$name = esc_attr( $args['name'] );\n\t\t\t$title = esc_attr( $args['title']);\n\t\t\t$value = $args['value'];\n\t\t\t$help = $args['help'];\n\t\t\tif ($args['rows']) {\n\t\t\t\t$rows = $args['rows'];\n\t\t\t} else {\n\t\t\t\t$rows = 8;\n\t\t\t}\n\t\t\tif ($args['cols']) {\n\t\t\t\t$cols = $args['cols'];\n\t\t\t} else {\n\t\t\t\t$cols = 50;\n\t\t\t}\n\t\t\techo '<textarea name=\"'.$name.'\" rows=\"'.$rows.'\" cols=\"'.$cols.'\">'.$value.'</textarea>';\n\t\t\techo '<br />'.$help;\n\t\t}", "public function meta_textarea( )\n\t{\n\t\t$comments = get_meta_value('comments');\n\n\t\t?>\n\n\t\t<label for=\"comments\">Comments</label><!-- the label is optional -->\n\t\t<textarea name=\"comments\" id=\"cpt_comments\" cols=\"50\" rows=\"5\"><?php echo $comments; ?></textarea>\n\n\t\t<?php\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Get nota_dina by nds_no
function get_nota_dinas($nds_id) { return $this->db->get_where('tb_nds',array('nds_id'=>$nds_id))->row_array(); }
[ "function pegar_npdid( $ndpcod )\n\t{\n\t\tglobal $db;\n\t\t$sql = \"select ndpid from naturezadespesa where ndpcod = '\" . $ndpcod . \"'\";\n\t\treturn (integer) $db->pegaUm( $sql );\n\t}", "function pegar_npdid( $ndpcod )\n\t\t{\n\t\t\tglobal $db;\n\t\t\t$sql = \"select ndpid from naturezadespesa where ndpcod = '\" . $ndpcod . \"'\";\n\t\t\treturn (integer) $db->pegaUm( $sql );\n\t\t}", "public function getPordni($dni){\n return Persona::where('dni',$dni)->first();\n }", "public function getDni()\r\n {\r\n return $this->dni;\r\n }", "public function getDni()\r\n {\r\n return $this->dni;\r\n }", "static function getDoctorByNid($nid)\r\n\t{\r\n\t\t$db = JFactory::getDBO();\r\n\r\n\t\t$sql = \"SELECT * FROM #__doctors_rating\r\n\t\tWHERE nid = {$nid}\";\r\n\r\n\t\t$db->setQuery($sql);\r\n\t\t$ret = $db->loadObject();\r\n\t\t$out = isset($ret->nid) ? $ret : false;\r\n\t\treturn $out;\r\n\t}", "public function getDni()\r\n {\r\n return $this->dni;\r\n }", "public function getDni()\n {\n return $this->dni;\n }", "public function set_dni($dni){\n\t\t\t$this->dni = $dni;\n\t\t}", "public function getDni()\n {\n return $this->_dni;\n }", "function DNIProfesor(){\n\t\t//query sql\n\t\t$sql = \"SELECT DNI\n\t\t\t\tFROM PROFESOR\";\n\t\tif (!$resultado = $this->mysqli->query($sql)) //error base de datos\n\t\t{\n\t\t\treturn 'Error de gestor de base de datos';\n\t\t}\n\t\telse //query ok, \n\t\t{\n\t\t\t$toret = array(); //array de codedificio a devolver\n\t\t\twhile ($row=$resultado->fetch_array()) { //recorro todas las filas que ha devuelto fetcharray\n\t\t\t\tarray_push($toret,$row[0]);\n\t\t\t}\n\t\t}\n\t\treturn $toret;\n\t}", "public function nutrition($ndbno)\n {\n // Create a client with a base URI\n $client = new Client(['base_uri' => 'http://api.nal.usda.gov/ndb/']);\n\n // Request to http://api.nal.usda.gov/ndb/reports/?ndbno=01009&type=f&format=json&api_key=7nEAe6LI7yfT7R4IxPjZSafCpqNUZGz2FU27MugY\n try {\n $response = $client->get('http://api.nal.usda.gov/ndb/reports', [\n 'query' => [\n 'ndbno' => $ndbno,\n 'type' => 'f',\n 'format' => 'json',\n 'api_key' => self::NDBKEY\n ]\n ]);\n\n $body = json_decode($response->getBody());\n $selectedfood = $body->report->food->name;\n\n // get first 10 elements of the array, the rest are vitamins and microelements\n $nutrients = array_slice($body->report->food->nutrients , 0, 9);\n \n return view('products_admin.nutrition', compact('selectedfood','nutrients'));\n } catch (ClientException $e) {\n \n return \"No nutrition info available at the moment\";\n\n }\n }", "function getNSU_Bd() {\r\n\r\n\tglobal $db_nfe;\r\n\t$max = $db_nfe->lookup(\"select count(id_nfesyslog_entrada_lista) from t_nfesyslog_entrada_lista where nsu is not null\");\r\n\t\r\n\tif ($max[0][0]==0) {\r\n\t\t$nsu = \"0\";\r\n\t} else {\r\n\t\t$dtnsu = $db_nfe->lookup(\"select nsu from t_nfesyslog_entrada_lista order by data_autorizacao desc limit 0,1\");\r\n\t\t$nsu = $dtnsu[0][0];\r\n\t}\r\n\treturn $nsu;\r\n}", "function getDNISfromID()\n{\n\n\t$sql = \"SELECT prod1.VENDEDOR_DNI as DNI1,\n\t\t\t\tprod2.VENDEDOR_DNI as DNI2\n\t\t\t\tFROM MENSAJES\n\t\t\t\tINNER JOIN INTERCAMBIO ON INTERCAMBIO.ID = MENSAJES.ID_INTERCAMBIO\n\t\t\t\tINNER JOIN PRODUCTOS prod1 ON prod1.ID = INTERCAMBIO.ID_PRODUCTO1\n\t\t\t\tINNER JOIN PRODUCTOS prod2 ON prod2.ID = INTERCAMBIO.ID_PRODUCTO2\n\t\t\t\tWHERE (MENSAJES.ID = '$this->id')\";\n\n//se comprueba que el dni o el email no estan repetidos en otros usuarios\n\t$response = $this->mysqli->query($sql);\n\treturn $response->fetch_array();\n}", "function getAllNational($national_CODE)\n\t{\n\t\t$sql = \"SELECT * FROM national \";\n\t\t$sql .= \"ORDER BY national_NAME\";\n\t\t$query = mysql_query($sql) or die(\"SQL : \".$sql.\"<br>ERROR : \". mysql_error()); \n\t\t$i = 0;\n\t\twhile ($row = mysql_fetch_array($query)) {\n\t\t\t$result[$i][\"ROWIDS\"]\t\t\t= $row[\"ROWIDS\"];\n\t\t\t$result[$i][\"national_CODE\"]\t\t= $row[\"national_CODE\"];\n\t\t\t$result[$i][\"national_NAME\"]\t\t= $row[\"national_NAME\"];\t\n\t\t\t$result[$i][\"ZONECODE\"]\t\t\t= $row[\"ZONECODE\"];\n\t\t\t$i++;\t\n\t\t}\n\t\treturn $result;\n\t\t}", "public function retornarDirectorsConcret($dni) {\n $query = \"SELECT * FROM director WHERE nif ='\" . $dni . \"'\";\n $con = new db();\n $director = $con->consultarDirector($query);\n $con->close();\n return $director;\n }", "public function findByDni($dni)\n {\n $dc = substr($dni, -1);\n $numDocumento = substr($dni, 0, -1);\n $em = $this->em;\n $person = $em->getRepository(Person::class)->findOneBy([\n 'numDocumento' => $this->__fixDniNumber($numDocumento),\n 'digitoControl' => $dc,\n ]);\n\n return $person;\n }", "public function findByDni($dni)\n {\n $dc = substr($dni, -1);\n $numDocumento = substr($dni, 0, -1);\n $em = $this->em;\n $person = $em->getRepository(Person::class)->findOneBy([\n 'numDocumento' => $this->__fixDniNumber($numDocumento),\n 'digitoControl' => $dc,\n ]);\n return $person;\n }", "function getAllByNis($nis) {\n $s = \"select a.*, b.kelas from t004_siswa a left join t003_kelas b on a.idkelas = b.idkelas where nis = '\".$nis.\"'\";\n return $this->db->query($s)->result();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Action returning a "201 Created" action result.
public function createdAction(): CreatedResult { return new CreatedResult('https://example.com/created'); }
[ "protected function createResponse201() {\n return $this->generateResponse('Created', Response::HTTP_CREATED);\n }", "protected function returnCreated() {\n \t$this->log->debug(\"returnCreated\");\n \theader('HTTP/1.0 201 Created');\n }", "public function assertSuccessCreate()\n {\n return $this->assertStatus(HttpFoundationResponse::HTTP_CREATED);\n }", "function success201($app, $data = '')\n{\n http_response($app, 201, (empty($data) ? array('message' => 'resource created') : $data));\n}", "public function createSuccess();", "public function respondCreated($data = [])\n {\n return $this->setStatusCode(201)->response($data);\n }", "function created($url = FALSE) {\n header('HTTP/1.0 201 Created');\n if ($url) {\n header('Location: '.$url); \n }\n}", "public function postAction()\n {\n $this->view->params = $this->_request->getParams();\n\n /** XXX **/\n\n $this->view->message = 'Resource Created';\n $this->_response->created();\n }", "public function created()\n {\n return $this->status() === 201;\n }", "function created($url = FALSE) {\n\t\theader('HTTP/1.0 201 Created');\n\t\tif ($url) {\n\t\t\theader('Location: '.$url); \n\t\t}\n\t}", "public function createAction()\n {\n $configuration = $this->getConfiguration();\n\n // create a fresh entity\n $data = $this->createEntity();\n\n // create the form\n $form = $this->createCrudForm($data, ['id' => 0]);\n\n // return the response\n return $this->renderForm($form, $data);\n }", "public function testCreatedStudentGenerateCreatedResponse()\n {\n $mock = $this->injectMockIntoClient(StudentRepository::class);\n $expectedStudent = $this->expectsThisMockWillReturnStudent($mock);\n $mock->expects($this->exactly(1))->method('save')->with($expectedStudent);\n\n $client = $this->postStudent();\n\n $response = $client->getResponse();\n $this->assertStringContainsString('application/json', $response->headers->get('Content-type'));\n $this->assertSame(Response::HTTP_CREATED, $response->getStatusCode());\n\n $decodedResponse = $this->decodeResponse();\n $this->assertSame($expectedStudent->getId(), $decodedResponse['id']);\n }", "public function post_create() {\n\t\t$ext = 'json';\n\t\t$header = 'application/json';\n\n\t\tif (Request::accepts('text/xml')) {\n\t\t\t$ext = 'xml';\n\t\t\t$header = 'text/xml';\n\t\t}\n\n\t\t$todo = new Todo;\n\t\t$todo->title = Input::get('title');\n\t\t$todo->task = Input::get('task');\n\t\t$todo->due_date = Input::get('due_date');\n\t\t$todo->done = Input::get('done');\n\t\t$todo->save();\n\n\t\treturn Response::make('', '201',\n\t\t\t\tarray('Content-Type' => $header, 'Location' => 'todos/'\n\t\t\t\t\t\t. $todo->id));\n\t}", "public function testPostResultAction201Created(): array\n {\n // Hay que crear un usuario para asignarle un nuevo resultado\n $user = [\n User::EMAIL_ATTR => self::$faker->email,\n User::PASSWD_ATTR => self::$faker->password,\n User::ROLES_ATTR => [self::$faker->word],\n ];\n\n // Se crea el usuario\n $headers = $this->getTokenHeaders();\n self::$client->request(\n Request::METHOD_POST,\n self::RUTA_API_U,\n [],\n [],\n $headers,\n json_encode($user)\n );\n\n // Se crea el nuevo resultado\n $p_data = [\n Result::RESULT_ATTR => self::$faker->randomDigitNotNull,\n User::EMAIL_ATTR => $user['email'],\n Result::TIME_ATTR => null\n ];\n\n // 201\n self::$client->request(\n Request::METHOD_POST,\n self::RUTA_API,\n [],\n [],\n $headers,\n json_encode($p_data)\n );\n\n $response = self::$client->getResponse();\n self::assertSame(Response::HTTP_CREATED, $response->getStatusCode());\n self::assertTrue($response->isSuccessful());\n self::assertNotNull($response->headers->get('Location'));\n self::assertJson($response->getContent());\n $resultEnt = json_decode($response->getContent(), true);\n self::assertNotEmpty($resultEnt['resultEnt']['id']);\n self::assertSame($p_data[User::EMAIL_ATTR], $user[User::EMAIL_ATTR]);\n self::assertSame($p_data[Result::RESULT_ATTR], $resultEnt['resultEnt'][Result::RESULT_ATTR]);\n\n return $resultEnt['resultEnt'];\n }", "public function create()\n\t\t{\n\t\t\tglobal $faCurrentUser;\n\t\t\t\n\t\t\t$this->verified = 0;\n\t\t\t$this->discarded = 0;\n\t\t\t$this->assetTag = getNextAssetTag();\n\t\t\t$this->createDate = date('Y-m-d');\n\t\t\t$this->lastModifyDate = date('Y-m-d');\n\t\t\t$this->lastModifyUser = $faCurrentUser->getId();\n\t\t\t\n\t\t\treturn $this->post();\n\t\t}", "public function createAction()\n {\n }", "public function testCreatedResponse()\n { \n $data = [\n 'title'=>'How to become a ShoppinPal Dev',\n 'author'=>'Akunne Obinna',\n 'isbn'=>1244333,\n 'release_date'=>'2020-01-01'\n ];\n\n $res = $this->request->post('api/books', ['json'=> $data]);\n\n $body = json_decode($res->getBody(), true);\n \n $this->assertArrayHasKey('message', $body);\n $this->assertArrayHasKey('status', $body);\n $this->assertSame(201, $body['status']);\n $this->assertSame('Created book resource successfully', $body['message']);\n $this->assertSame(201, $res->getStatusCode());\n }", "public function createActionPost() : object\n {\n $data = [\n \"title\" => $this->app->request->getPost(\"title\"),\n \"year\" => $this->app->request->getPost(\"year\"),\n \"image\" => $this->app->request->getPost(\"image\"),\n ];\n\n $this->createMovie($data);\n\n $url = $this->app->request->getBaseUrl();\n return $this->app->response->redirect(\"$url/movie\");\n }", "public function postAction()\n {\n\n $this->setHeader();\n\n $request = $this->getRestRequest();\n\n $dataSet = $request->getParams(true);\n\n if (!is_array($dataSet)) {\n $dataSet = array($dataSet);\n }\n\n foreach ($dataSet as $data) {\n $model = $this->getDefaultModel();\n\n $model->assign((array)$data);\n\n $result = new RestResponseResult($this->getRestRequest()->getMethod());\n $result->setModel($this->getDefaultModel(true));\n\n\n if ($model->create()) {\n $result->setCode(\"201\");\n $result->setStatus('created');\n $result->setResult($model->dump());\n } else {\n $result->setCode(\"400\");\n $result->setStatus('bad post request');\n $result->setResult($model->getMessages());\n }\n $this->getRestResponse()->addResult($result);\n }\n\n echo $this->getRestResponse();\n// die();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }