query
stringlengths 10
8.11k
| document
stringlengths 17
398k
| negatives
sequencelengths 19
20
| metadata
dict |
---|---|---|---|
Check if $short_link is a Manufacturer Link | public static function isManufacturerLink($short_link)
{
// check if any keyword
$explode_manufacturer_link = explode("/", $short_link);
$count = count($explode_manufacturer_link);
$name_manufacturer = str_replace('-', '%', $explode_manufacturer_link[$count-1]);
$sql = 'SELECT m.`id_manufacturer`
FROM `'._DB_PREFIX_.'manufacturer` m
LEFT JOIN `'._DB_PREFIX_.'manufacturer_shop` s ON (m.`id_manufacturer` = s.`id_manufacturer`)
WHERE m.`name` LIKE \''.$name_manufacturer.'\'';
if (Shop::isFeatureActive() && Shop::getContext() == Shop::CONTEXT_SHOP)
{
$sql .= ' AND s.`id_shop` = '.(int)Shop::getContextShopID();
}
$id_manufacturer = (int)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql);
return ($id_manufacturer > 0) ? true : false;
} | [
"public static function isSupplierLink($short_link)\n\t{\n\t\t// check if any keyword\n\t\t$explode_supplier_link = explode(\"/\", $short_link);\n\t\t$count = count($explode_supplier_link);\n\t\t\n\t\t$name_supplier = str_replace('-', '%', $explode_supplier_link[$count-1]);\n\n\t\t$sql = 'SELECT sp.`id_supplier`\n\t\t\tFROM `'._DB_PREFIX_.'supplier` sp\n\t\t\tLEFT JOIN `'._DB_PREFIX_.'supplier_shop` s ON (sp.`id_supplier` = s.`id_supplier`)\n\t\t\tWHERE sp.`name` LIKE \\''.$name_supplier.'\\'';\n\n\t\tif (Shop::isFeatureActive() && Shop::getContext() == Shop::CONTEXT_SHOP)\n\t\t{\n\t\t\t$sql .= ' AND s.`id_shop` = '.(int)Shop::getContextShopID();\n\t\t}\n\n\t\t$id_supplier = (int)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql);\n\t\t\t\t\t\n\t\treturn ($id_supplier > 0) ? true : false;\n\t}",
"public static function isProductLink($short_link)\n\t{\n\t\t// check if any keyword\n\t\t$explode_product_link = explode(\"/\", $short_link);\n\t\t$count = count($explode_product_link);\n\t\t\n\t\t$sql = 'SELECT `id_product`\n\t\t\tFROM `'._DB_PREFIX_.'product_lang`\n\t\t\tWHERE `link_rewrite` = \\''.$explode_product_link[$count-1].'\\' AND `id_lang` = '. Context::getContext()->language->id;\n\n\t\tif (Shop::isFeatureActive() && Shop::getContext() == Shop::CONTEXT_SHOP)\n\t\t{\n\t\t\t$sql .= ' AND `id_shop` = '.(int)Shop::getContextShopID();\n\t\t}\n\n\t\t$id_product = (int)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql);\n\t\t\t\n\t\treturn ($id_product > 0) ? true : false;\n\t}",
"public function shortlink_meta() {\n\n\t\t// no shortlinks exist on non-singular items, so bail\n\t\tif ( ! is_singular() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// check options to see if it's enabled\n\t\tif ( false === RAFCOCreator_Helper::get_rafco_option( 'sht' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// call the global post object\n\t\tglobal $post;\n\n\t\t// bail without a post object\n\t\tif ( empty( $post ) || ! is_object( $post ) || empty( $post->ID ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// check existing postmeta for RAFCO link\n\t\tif ( false === $link = RAFCOCreator_Helper::get_rafco_meta( $post->ID ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// got a RAFCO? well then add it\n\t\techo '<link href=\"' . esc_url( $link ) . '\" rel=\"shortlink\">' . \"\\n\";\n\t}",
"function yourls_is_shorturl( $shorturl ) {\n\t// TODO: make sure this function evolves with the feature set.\n\t\n\t$is_short = false;\n\t\n\t// Is $shorturl a URL (http://sho.rt/abc) or a keyword (abc) ?\n\tif( yourls_get_protocol( $shorturl ) ) {\n\t\t$keyword = yourls_get_relative_url( $shorturl );\n\t} else {\n\t\t$keyword = $shorturl;\n\t}\n\t\n\t// Check if it's a valid && used keyword\n\tif( $keyword && $keyword == yourls_sanitize_string( $keyword ) && yourls_keyword_is_taken( $keyword ) ) {\n\t\t$is_short = true;\n\t}\n\t\n\treturn yourls_apply_filter( 'is_shorturl', $is_short, $shorturl );\n}",
"public function isLink();",
"public function checkLink($link);",
"function is_viewing_ua_webtide_link( $link, $starts_with = false ) {\n\t\n\t// Build the current URL\n\t$current_url = ! ( isset( $_SERVER[ 'HTTPS' ] ) && $_SERVER[ 'HTTPS' ] == 'on' ) ? ( 'http://' . $_SERVER[ 'SERVER_NAME' ] ) : ( 'https://' . $_SERVER[ 'SERVER_NAME' ] );\n\n\t// Add on the request path\n\t$current_url .= isset( $_SERVER[ 'REQUEST_URI' ] ) ? $_SERVER[ 'REQUEST_URI' ] : NULL;\n\t\n\t// If true, this means to test the start of the URL, is helping for testing parent permalinks\n\tif ( $starts_with ) {\n\t\t\n\t\t// Do the URLs match?\n\t\treturn preg_match( '/^' . preg_replace( '/([^a-z])/i', '\\\\\\\\\\1', $link ) . '/i', $current_url );\n\t\t\n\t}\n\t\n\t// Do the URLs match?\n\treturn preg_match( '/^' . preg_replace( '/([^a-z])/i', '\\\\\\\\\\1', $link ) . '$/i', $current_url );\n\t\n}",
"public function test_display_shortlink_if_link_exists()\n {\n $formData = [\n 'link' => 'http://testdomain.com',\n ];\n\n $this->post(route('shortlink.create'), $formData)->assertStatus(200);\n }",
"function s2t_is_link_note($link)\n{\n return strpos($link['url'], $link['shorturl']) !== false;\n}",
"private function should_show_link() {\n\t\t// Jetpack Scan/Backup is currently not supported on multisite.\n\t\tif ( is_multisite() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check if VaultPress is active, the assumption there is that VaultPress is working.\n\t\t// It has its link the adminbar.\n\t\tif ( class_exists( 'VaultPress' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $this->has_backup() || $this->has_scan();\n\t}",
"public function hasLink()\n {\n return !starts_with($this->attributes['link'], LARACRUMB_NOLINK_PREFIX);\n }",
"public function isShortUrl($sh) {\n\t return $this->where('shortUrl', $sh)->first();\n\t }",
"public function testShouldGetShortLink()\n\t {\n\t\t$this->instanceid = \"longurl\";\n\n\t\t$html = $this->_execute($this->script, array(), \"GET\");\n\t\t$requestData = array(\"LongURL[1]/URL[1]\" => \"http://irkagenta.net/advert.php?ad=802817\");\n\n\t\t$post = $this->getFormData($html, $requestData);\n\t\t$post[\"transition\"] = \"geturl\";\n\t\t$html = $this->_execute($this->script, $post, \"POST\");\n\t\t$this->assertTrue(XHTMLvalidator::validate($html, true));\n\t\t$this->assertRegExp(\"|http://shorty\\.ru/[A-Za-z]+|\", $html);\n\t }",
"private static function isCmsCategoryLink($short_link, $route)\n {\n $short_link = preg_replace('#\\.html?$#', '', '/'.$short_link);\n $regexp = preg_replace('!\\\\\\.html?\\\\$#!', '$#', $route['regexp']);\n\n preg_match($regexp, $short_link, $kw);\n if (empty($kw['cms_category_rewrite'])) {\n if (0 === strpos('/'.$route['rule'], $short_link)) {\n //no link_rewrite, but uri starts with the link -> cms categories' list\n return true;\n }\n\n return false;\n }\n\n $sql = 'SELECT l.`id_cms_category`\n FROM `'._DB_PREFIX_.'cms_category_lang` l\n LEFT JOIN `'._DB_PREFIX_.'cms_category_shop` s ON (l.`id_cms_category` = s.`id_cms_category`)\n WHERE l.`link_rewrite` = \\''.$kw['cms_category_rewrite'].'\\'';\n if (Shop::isFeatureActive() && Shop::getContext() == Shop::CONTEXT_SHOP) {\n $sql .= ' AND s.`id_shop` = '.(int) Shop::getContextShopID();\n }\n\n $id_cms_cat = (int) Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql);\n\n return $id_cms_cat > 0;\n }",
"function link_brand($atts, $content = '') {\r\n extract($this->shortcodes->shortcode_atts(array(\r\n 'brand' => 0,\r\n 'ssl' => 0,\r\n 'title' => ''\r\n ), $atts));\r\n \r\n $ssl = ($ssl) ? \"'SSL'\" : \"\";\r\n $title = ($title) ? 'title=\"' . $title . '\"' : \"\";\r\n\r\n if ($brand) {\r\n $this->load->model('catalog/manufacturer');\r\n $manufacturer = $this->model_catalog_manufacturer->getManufacturer($brand);\r\n\r\n if ($manufacturer) {\r\n if (!$content) {\r\n return '<a href=\"' . $this->url->link('product/manufacturer/info', 'manufacturer_id=' . $brand, $ssl) . '\" ' . $title . '>' . $manufacturer['name'] . '</a>';\r\n } else {\r\n return '<a href=\"' . $this->url->link('product/manufacturer/info', 'manufacturer_id=' . $brand, $ssl) . '\" ' . $title . '>' . $content . '</a>';\r\n }\r\n } elseif (!$manufacturer && $content) {\r\n return $content;\r\n }\r\n } else {\r\n if (!$content) {\r\n $this->load->language('product/manufacturer');\r\n\r\n return '<a href=\"' . $this->url->link('product/manufacturer', '', $ssl) . '\" ' . $title . '>' . $this->language->get('text_brand') . '</a>';\r\n } else {\r\n return '<a href=\"' . $this->url->link('product/manufacturer', '', $ssl) . '\" ' . $title . '>' . $content . '</a>';\r\n }\r\n }\r\n }",
"public function testSEOsetManufacturerData()\n {\n $oManufacturerlist = $this->getProxyClass(\"oxManufacturerlist\");\n $oManufacturerlist->loadManufacturerList();\n\n $oManufacturerlist->UNITSeosetManufacturerData();\n\n //check if SEO link was added for each Manufacturer item\n foreach ($oManufacturerlist as $sVndId => $value) {\n $sManufacturerLink = $oManufacturerlist[$sVndId]->link;\n if (!$sManufacturerLink || strstr($sManufacturerLink, 'index.php') !== false) {\n $this->fail(\"SEO link was not added to Manufacturer object ({$sManufacturerLink})\");\n }\n }\n\n }",
"static public function linkExists($link_ending) {\n\n $link = Link::where('short_url', $link_ending)\n ->first();\n\n if ($link != null) {\n return $link;\n }\n else {\n return false;\n }\n }",
"function validate_special_link() {}",
"public function checkLink($link)\n {\n\t if(!array_key_exists($link, $this->_link_detail))\n\t {\n\t\t $html_ns = NS_HTML.'\\\\htmlpage';\n\t \t$htmlpage = new $html_ns(404);\n\t\t\texit();\n\t }\n\t \t \n\t return true;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get XML for AVAYA>login request. | function amae_avaya_convert_login_to_avaya_xml($username, $password) {
// Generate XML for Lead if not given.
$xml_obj = new AMAE_AVAYAServiceXMLLogin($username, $password);
$xml_data = $xml_obj->getXmlString();
if (empty($xml_data)) {
return FALSE;
}
// Just XML build.
return $xml_data;
} | [
"private function add_auth_xml() {\n\n\t\t// <merchantAuthentication>\n\t\t$this->startElement( 'merchantAuthentication' );\n\n\t\t// <name>{api_login_id}</name>\n\t\t$this->writeElement( 'name', $this->api_login_id );\n\n\t\t// <transactionKey>{api_transaction_key}</transactionKey>\n\t\t$this->writeElement( 'transactionKey', $this->api_transaction_key );\n\n\t\t// </merchantAuthentication>\n\t\t$this->endElement();\n\t}",
"public function loginUser()\n {\n $xmlAPI = ilXMLApiFactory::getApiByAuthMode();\n\t\t$session = $xmlAPI->getBreezeSession();\n return $xmlAPI->externalLogin($this->getXAVCLogin(), null, $session);\n }",
"private function xmlRequest() {\n $xml = new \\SimpleXMLElement('<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:lgn=\"http://www.lagan.com/wsdl/FLTypes\" xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/>');\n\n $header = $xml->addChild('Header');\n $security = $header->addChild('wsse:Security', '', 'wsse');\n $userToken = $security->addChild('wsse:UsernameToken');\n\n $userToken->addChild('wsse:Username', env('LAGAN_USER', ''));\n $userToken->addChild('wsse:Password', env('LAGAN_PASSWORD', ''));\n\n return $xml;\n }",
"public function getLoginResponse()\n {\n return $this->loginResponse;\n }",
"public function loadLogin(){\n\t\techo \"<h1>Login</h1>\";\n\t\techo \"<form method='get' action='index.php'>\";\n\t\techo \"<p>Login: <input type='text' name='login' /></p>\";\n\t\techo \"<p>Password: <input type='password' name='pwd'></p>\";\n\t\techo \"<input type='reset' value='Clear' />\";\n\t\techo \"<input type='submit' value='Submit' />\";\n\t\techo \"<input type='hidden' value='userAccount' name='userRequest' />\";\n\t\techo \"</form>\";\n\t\techo \"<p><a href='index.php?userRequest=userRegister'>Register for a new Account!</a></p>\";\n\t}",
"private function login()\n {\n return $this->post('login', [\n 'username' => 'username',\n 'password' => 'secret'\n ]);\n }",
"private function _auth()\n\t{\n\t\t// prepair auth username & password\n\t\t$data['username'] = $this->username;\n\t\t$data['password'] = sha1($this->password);\n\n\t\t// fetch auth session data\n\t\t$content = $this->_fetch_process($this->openapi_url_login, $data);\n\n\t\t// convert xml data to array object\n\t\t$object = @simplexml_load_string($content);\n\n\t\tif ($object->attributes()->status !== 'ok')\n {\n if (isset($object->err))\n $this->error[] = ['status' => 'failed', 'message' => (string) $object->err->attributes()->desc];\n }\n\n\n\t\t// return auth data\n\t\treturn (is_object($object) && isset($object->sessionid)) ? (string) $object->sessionid : null;\n\t}",
"function _commerce_ups_xml_access_request() {\n $access = variable_get('commerce_ups_access_key', '');\n $user = variable_get('commerce_ups_user_id', '');\n $password = variable_get('commerce_ups_password', '');\n return \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\n<AccessRequest xml:lang=\\\"en-US\\\">\n <AccessLicenseNumber>$access</AccessLicenseNumber>\n <UserId>$user</UserId>\n <Password>$password</Password>\n</AccessRequest>\n\";\n}",
"public function actionLogin() {\n try {\n $result = ApiModule::$defaultFailedResponse;\n // Check format of request\n $this->checkRequest();\n // Parse json\n $root = json_decode(filter_input(INPUT_POST, DomainConst::KEY_ROOT_REQUEST));\n // Check required parameters\n $this->checkRequiredParam($root, array(\n DomainConst::KEY_USERNAME,\n DomainConst::KEY_PASSWORD\n ));\n // Get user login\n $mUser = $this->getUserModel($root->username);\n ApiUserTokens::validateLogin($this, $mUser, $result, $root);\n \n $mUserToken = ApiUserTokens::makeNewToken($mUser, $root);\n CreateResponse::loginResponse($mUserToken->token, $mUser, $this);\n } catch (Exception $exc) {\n ApiModule::catchError($exc, $this);\n }\n }",
"private function getAccessRequest()\n {\n return '<?xml version=\"1.0\"?>'\n . fn_array_to_xml(array(\n 'AccessRequest@xml:lang=en-US' => array(\n 'AccessLicenseNumber' => empty($this->settings['access_key']) ? '' : $this->settings['access_key'],\n 'UserId' => empty($this->settings['username']) ? '' : $this->settings['username'],\n 'Password' => empty($this->settings['password']) ? '': $this->settings['password'],\n )\n ));\n }",
"public function merchant_authentication_block()\n {\n return\n \"<merchantAuthentication>\".\n \"<name>\" . $this->authnet_login . \"</name>\".\n \"<transactionKey>\" . $this->authnet_transaction_key . \"</transactionKey>\".\n \"</merchantAuthentication>\";\n }",
"public function getLoginFormFields() {\n \n $params = array(\n 'service' => 'alipay.auth.authorize',\n 'partner' => $this->clientId,\n '_input_charset' => 'utf-8',\n 'sign_type' => 'MD5',\n 'return_url' => Mage::getModel('core/url')->sessionUrlVar(Mage::getUrl(self::REDIRECT_URI_ROUTE, array('state' => Mage::getSingleton('core/session')->getAlipayCsrf()))),\n 'target_service' => 'user.auth.quick.login'\n );\n \n if ($this->getConfigData('antiphishing_ip_check')) {\n $params['exter_invoke_ip'] = $this->getConfigData('client_ip');\n } \n\n if ($this->getConfigData('antiphishing_timestamp_verify')) {\n $params['anti_phishing_key'] = Mage::helper('alipay')->queryTimestamp($this->clientId);\n } \n \n return Mage::helper('alipay')->buildRequestParams($params, $this->clientSecret);\n }",
"public function processLoginRequest();",
"public function getReqForAuth($data = array()) {\n $crXml = $this->app[\"my\"]->get('xml');\n $config = $this->app[\"my\"]->get('config');\n $strBox = $this->app['my']->get('string');\n $debug = $this->app['debug'];\n //----------------------------\n // Get login/passport\n $env = $data['env'];\n if ($env == 'production') {\n if ($debug) {\n $login = $this->app['config']['parameters']['ubki_test_login'];\n $pass = $this->app['config']['parameters']['ubki_test_pass'];\n } else {\n $login = $this->app['config']['parameters']['ubki_login'];\n $pass = $this->app['config']['parameters']['ubki_pass'];\n }\n } else {\n $login = $this->app['config']['parameters']['ubki_test_login'];\n $pass = $this->app['config']['parameters']['ubki_test_pass'];\n }\n\n\n $file = $config->getProjectPath('views') . '/ubki/lib/auth/reqAuth.xml';\n $xmlStr = file_get_contents($file);\n\n // Valid this XML\n if (!$crXml->isValidXml($xmlStr)) {\n $this->app->abort(406, \"Invalid format XML - '{$file}'\");\n }\n // Load this XML\n $crXml->loadXML($xmlStr);\n\n // Set login\n $crXml->doc->auth['login'] = $login;\n // Set password\n $crXml->doc->auth['pass'] = $pass;\n\n $xmlAuth = $crXml->xml();\n\n // Encode string\n $xmlAuth = $strBox->set($xmlAuth)->base64Encode()->get();\n\n return $xmlAuth;\n }",
"public function actionSignin() {\n\n $username = TWXParam::any('username');\n $password = TWXParam::any('password');\n\n $deviceUdid = TWXParam::any('udid');\n $appId = TWXParam::any('app_id');\n $appVersion = TWXParam::any('app_version');\n\n try {\n $token = $this->checkLogin($username, $password);\n $this->outputToken($token);\n } catch (Exception $e) {\n $this->outputJsonError($e->getMessage());\n }\n\n }",
"private function authenticate()\n {\n $HttpSocket = new HttpSocket();\n\n $data = array(\n 'email'=>'marketing@payscape.com',\n 'password'=>'0ow337!D0g',\n 'user_key'=>self::user_key\n );\n\n $response = $HttpSocket->post(self::pardot_url . 'login/version/3', $data);\n $response_array = Xml::toArray(Xml::build($response->body));\n if(!$response->isOk())\n {\n //Todo send email to dev\n error_log(json_encode($response_array));\n }\n\n return $response_array['rsp']['api_key'];\n }",
"public function getWebServiceLogin()\n {\n return $this->parameters['hipay.wsLogin'];\n }",
"public function login() {\n\t\tif($this->request->query) {\n\t\t\t$apiUser = $this->ApiUser->login($this->request->query);\n\t\t\t$this->set(compact('apiUser'));\n\t\t} else {\n\t\t\t$this->api_response(\"500\", \"Unauthorised\");\n\t\t}\n\t}",
"public function vancoLoginRequest()\n {\n $requestid = $this->generateRequestID();\n $postdata = \"nvpvar=requesttype=login&requestid=$requestid&userid=\".$this->userid.'&password='.$this->password;\n $response = $this->post($postdata);\n $data = explode('&', $response);\n $sessionid = '';\n foreach ($data as $item) {\n if (mb_substr($item, 0, 9) === 'sessionid') {\n $sessionid = mb_substr(\"$item\", 10);\n }\n }\n\n return $sessionid;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
findPetsByStatus Finds Pets by status | public function findPetsByStatus($status) {
// parse inputs
$resourcePath = "/pet/findByStatus";
$resourcePath = str_replace("{format}", "json", $resourcePath);
$method = "GET";
$queryParams = array();
$headerParams = array();
$formParams = array();
$_header_accept = 'application/json, application/xml';
if ($_header_accept !== '') {
$headerParams['Accept'] = $_header_accept;
}
$_header_content_type = array();
$headerParams['Content-Type'] = count($_header_content_type) > 0 ? $_header_content_type[0] : 'application/json';
// query params
if($status !== null) {
$queryParams['status'] = $this->apiClient->toQueryValue($status);
}
// for HTTP post (form)
$body = $body ?: $formParams;
if (strpos($headerParams['Content-Type'], "application/x-www-form-urlencoded") > -1) {
$body = http_build_query($body);
}
// make the API Call
$response = $this->apiClient->callAPI($resourcePath, $method,
$queryParams, $body,
$headerParams);
if(! $response) {
return null;
}
$responseObject = $this->apiClient->deserialize($response,
'array[Pet]');
return $responseObject;
} | [
"public function findPetsByStatus() {\n $status = $this->request->get(\"status\");\n $this->validator->validate([\n [\n 'name' => 'status',\n 'value' => &$status,\n 'default' => 'available',\n 'type' => 'array'\n ]\n ]);\n $this->petService->findPetsByStatus($status);\n }",
"public function findPetsByStatus(string[] $status);",
"public function testFindPetsByStatus()\n {\n $this->markTestIncomplete(\n 'Test of \"findPetsByStatus\" method has not been implemented yet.'\n );\n }",
"public function findPetsByStatus($status) {\n\n \t\t//parse inputs\n \t\t$resourcePath = \"/pet.{format}/findByStatus\";\n \t\t$resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n \t\t$method = \"GET\";\n $queryParams = array();\n $headerParams = array();\n\n if($status != null) {\n \t\t $queryParams['status'] = $this->apiClient->toPathValue($status);\n \t\t}\n \t\t//make the API Call\n if (! isset($body)) {\n $body = null;\n }\n \t\t$response = $this->apiClient->callAPI($resourcePath, $method,\n \t\t $queryParams, $body,\n \t\t $headerParams);\n\n\n if(! $response){\n return null;\n }\n\n \t\t$responseObject = $this->apiClient->deserialize($response,\n \t\t 'array[Pet]');\n \t\treturn $responseObject;\n\n }",
"public function testFindPetByStatus()\n {\n // initialize the API client\n $api_client = new SwaggerClient\\ApiClient('http://petstore.swagger.io/v2');\n $pet_api = new SwaggerClient\\PetAPI($api_client);\n // return Pet (model)\n $response = $pet_api->findPetsByStatus(\"available\");\n $this->assertGreaterThan(0, count($response)); // at least one object returned\n $this->assertSame(get_class($response[0]), \"SwaggerClient\\models\\Pet\"); // verify the object is Pet\n // loop through result to ensure status is \"available\" \n foreach ($response as $_pet) {\n $this->assertSame($_pet['status'], \"available\");\n }\n // test invalid status \n $response = $pet_api->findPetsByStatus(\"unknown_and_incorrect_status\");\n $this->assertSame(count($response), 0); // confirm no object returned\n }",
"public function findPetsByStatus($status)\n {\n list($response) = $this->findPetsByStatusWithHttpInfo($status);\n return $response;\n }",
"public function testFindPetsByTags()\n {\n // initialize the API client\n $config = (new Configuration())->setHost('http://petstore.swagger.io/v2');\n $api_client = new ApiClient($config);\n $pet_api = new Api\\PetApi($api_client);\n // return Pet (model)\n $response = $pet_api->findPetsByTags(\"test php tag\");\n $this->assertGreaterThan(0, count($response)); // at least one object returned\n $this->assertSame(get_class($response[0]), \"Swagger\\\\Client\\\\Model\\\\Pet\"); // verify the object is Pet\n // loop through result to ensure status is \"available\"\n foreach ($response as $_pet) {\n $this->assertSame($_pet['tags'][0]['name'], \"test php tag\");\n }\n // test invalid status\n $response = $pet_api->findPetsByTags(\"unknown_and_incorrect_tag\");\n $this->assertSame(count($response), 0); // confirm no object returned\n }",
"public function findPetsByTags() {\n $tags = $this->request->get(\"tags\");\n $this->validator->validate([\n [\n 'name' => 'tags',\n 'value' => $tags,\n 'type' => 'array'\n ]\n ]);\n $this->petService->findPetsByTags($tags);\n }",
"public function getPetServices($pet_id, $status = null) {\n \t$result = array();\n \tforeach ($this->getMapper()->getDbTable()->getPetServices($pet_id, $status) as $line) {\n\t\t\t$service = new Petolio_Model_PoServices();\n\t\t\t$service->setId($line['service_id'])\n\t\t\t\t->setUserId($line['service_user_id'])\n\t\t\t\t->setAttributeSetId($line['service_attribute_set_id'])\n\t\t\t\t->setMembersLimit($line['service_members_limit'])\n\t\t\t\t->setDateCreated($line['service_date_created'])\n\t\t\t\t->setDateModified($line['service_date_modified']);\n\n\t\t\t$result[] = $service;\n \t}\n \treturn $result;\n }",
"function findStatus($id);",
"public function findPetsByTags($tags) {\n }",
"public function getMembersPets($status = null, $limit = null) {\n\t\tif ( !$this->getId() ) {\n\t\t\tthrow new Exception('Service id is not set.');\n\t\t}\n\n\t\t$members_pets = array();\n\t\t$service_members_pets = new Petolio_Model_PoServiceMembersPets();\n\n\t\t$files = new Petolio_Model_PoFiles();\n\t\t\n\t\tforeach ($service_members_pets->getServiceMembersPets($this->getId(), $status, $limit) as $line) {\n\t\t\t$owner = new Petolio_Model_PoUsers();\n\t\t\t$owner->setId($line['user_id'])\n\t\t\t\t->setName($line['user_name'])\n\t\t\t\t->setEmail($line['user_email'])\n\t\t\t\t->setPassword($line['user_password'])\n\t\t\t\t->setActive($line['user_active'])\n\t\t\t\t->setStreet($line['user_street'])\n\t\t\t\t->setAddress($line['user_address'])\n\t\t\t\t->setZipcode($line['user_zipcode'])\n\t\t\t\t->setLocation($line['user_location'])\n\t\t\t\t->setCountryId($line['user_country_id'])\n\t\t\t\t->setPhone($line['user_phone'])\n\t\t\t\t->setHomepage($line['user_homepage'])\n\t\t\t\t->setGender($line['user_gender'])\n\t\t\t\t->setDateOfBirth($line['user_date_of_birth'])\n\t\t\t\t->setGpsLatitude($line['user_gps_latitude'])\n\t\t\t\t->setGpsLongitude($line['user_gps_longitude'])\n\t\t\t\t->setDateForgot($line['user_date_forgot'])\n\t\t\t\t->setAvatar($line['user_avatar'])\n\t\t\t\t->setDateCreated($line['user_date_created'])\n\t\t\t\t->setDateModified($line['user_date_modified'])\n\t\t\t\t->setType($line['user_type']);\n\n\t\t\t$pet = new Petolio_Model_PoPets();\n\t\t\t$pet->setId($line['pet_id'])\n\t\t\t\t->setUserId($line['pet_user_id'])\n\t\t\t\t->setAttributeSetId($line['pet_attribute_set_id'])\n\t\t\t\t->setDateCreated($line['pet_date_created'])\n\t\t\t\t->setDateModified($line['pet_date_modified'])\n\t\t\t\t->setDeleted($line['pet_deleted'])\n\t\t\t\t->setName($line['pet_name'])\n\t\t\t\t->setBreed($line['pet_breed'])\n\t\t\t\t->setDateOfBirth($line['pet_dateofbirth'])\n\t\t\t\t->setOwner($owner);\n\t\t\t\n\t\t\t// take the first picture\r\n\t\t\t$picture = !is_null($line['folder_id']) ? $files->fetchList(\"folder_id = {$line['folder_id']}\", \"date_created ASC\", 1) : array();\r\n\t\t\t$pet->setPicture(!count($picture) > 0 ? null : reset($picture)->getFile());\r\n\n\t\t\t$member = new Petolio_Model_PoServiceMembersPets();\n\t\t\t$member->setId($line['id'])\n\t\t\t\t->setPetId($line['pet_id'])\n\t\t\t\t->setServiceId($line['service_id'])\n\t\t\t\t->setStatus($line['status'])\n\t\t\t\t->setMemberPet($pet);\n\n\t\t\tarray_push($members_pets, $member);\n\t\t}\n\n\t\treturn $members_pets;\n\t}",
"public function getByStatus($status);",
"public function findPetsByTags($tags) {\n\n \t\t//parse inputs\n \t\t$resourcePath = \"/pet.{format}/findByTags\";\n \t\t$resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n \t\t$method = \"GET\";\n $queryParams = array();\n $headerParams = array();\n\n if($tags != null) {\n \t\t $queryParams['tags'] = $this->apiClient->toPathValue($tags);\n \t\t}\n \t\t//make the API Call\n if (! isset($body)) {\n $body = null;\n }\n \t\t$response = $this->apiClient->callAPI($resourcePath, $method,\n \t\t $queryParams, $body,\n \t\t $headerParams);\n\n\n if(! $response){\n return null;\n }\n\n \t\t$responseObject = $this->apiClient->deserialize($response,\n \t\t 'array[Pet]');\n \t\treturn $responseObject;\n\n }",
"public function findPetsByTags(string[] $tags);",
"public function getProductsByStatus($status) {\n try {\n // create query\n $query = $this->getEntityManager()->createQuery(\n \"SELECT p\n FROM Champs\\Entity\\Product p, Champs\\Entity\\ProductProfile pp\n WHERE pp.product = p and pp.profile_key = 'status' and pp.profile_value != ?1\"\n );\n\n $query->setParameter(1, $status);\n\n // get the result\n $result = $query->getResult();\n\n return $result;\n } catch (\\Exception $e) {\n throw new \\Exception($e->getMessage());\n }\n }",
"public function findByStatus($status)\n\t{\n\t\t$all = $this->findAll()->tickets;\n\t\t$tickets = array();\n\n\t\tforeach ($all as $key => $ticket) {\n\t\t\tif ($ticket->status == $status) {\n\t\t\t\tarray_push($tickets, $ticket);\n\t\t\t}\n\t\t}\n\n\t\treturn $tickets;\n\t}",
"public function filterByStatus(string $status): array\n {\n $result = [];\n \n // Generate the query\n\n $sql = \"SELECT id, name, status\n FROM toppings\n WHERE status = :status\n ORDER BY name\";\n \n // Open the connection\n $pdo = DbConfig::getPdo();\n \n // Execute the query\n $resultSet = $pdo->prepare($sql);\n $resultSet->execute([':status' => $status]);\n \n // Add the results to the array \n foreach ($resultSet as $row) {\n $topping = $this->createFromDbRow($row);\n \n if ($topping !== null) {\n array_push($result, $topping);\n }\n }\n \n // Close the connection\n $pdo = null;\n \n // Return the result\n return $result;\n }",
"public function getVetAssignedMyPets($pets){\n $vets = false;\n\n foreach ($pets as $pet) {\n if (!$vets) {\n $vets = $pet->vet()->get();\n } else {\n $vets = $vets->merge($pet->vet()->get());\n }\n }\n\n return $vets;\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set Format_GetTextFramesOnPageResult value This property is removable from request (nillable=true+minOccurs=0), therefore if the value assigned to this property is null, it is removed from this object | public function setFormat_GetTextFramesOnPageResult(\ArrayType\ArrayOfTextFrame $format_GetTextFramesOnPageResult = null)
{
if (is_null($format_GetTextFramesOnPageResult) || (is_array($format_GetTextFramesOnPageResult) && empty($format_GetTextFramesOnPageResult))) {
unset($this->Format_GetTextFramesOnPageResult);
} else {
$this->Format_GetTextFramesOnPageResult = $format_GetTextFramesOnPageResult;
}
return $this;
} | [
"public function setFormat_GetAllTextFramesResult(\\ArrayType\\ArrayOfTextFrame $format_GetAllTextFramesResult = null)\n {\n if (is_null($format_GetAllTextFramesResult) || (is_array($format_GetAllTextFramesResult) && empty($format_GetAllTextFramesResult))) {\n unset($this->Format_GetAllTextFramesResult);\n } else {\n $this->Format_GetAllTextFramesResult = $format_GetAllTextFramesResult;\n }\n return $this;\n }",
"public function setFrames($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Google\\Cloud\\VideoIntelligence\\V1\\TextFrame::class);\n $this->frames = $arr;\n\n return $this;\n }",
"public function setTextFrames(\\ArrayType\\ArrayOfTextFrame $textFrames = null)\n {\n if (is_null($textFrames) || (is_array($textFrames) && empty($textFrames))) {\n unset($this->textFrames);\n } else {\n $this->textFrames = $textFrames;\n }\n return $this;\n }",
"public function setResponseMessages() {\n }",
"private function _parseFrames(array $frames)\n {\n // TODO: Throw exceptions/errors instead of continue! (best would be, to display all at once)\n foreach ($frames as $identifier => $frame) {\n if (isset($frame['identifier']) === true) {\n $identifier = $frame['identifier'];\n }\n\n if (strlen($identifier) !== 4) {\n continue;\n }\n\n // Text frames must have content, as default encoding UTF-16LE will be used.\n // Non-Text frames must have raw element.\n if ($identifier{0} === \"T\") {\n if (isset($frame['content']) === false) {\n continue;\n }\n\n if (isset($frame['encoding']) === false || $frame['encoding'] === null) {\n $frame['encoding'] = \"UTF-16LE\";\n $frame['content'] = mb_convert_encoding($frame['content'], \"UTF-16LE\");\n } elseif (in_array($frame['encoding'], $this->_tagWriter->getSupportedTextEncodings()) === false) {\n throw new \\UnexpectedValueException(\"Invalid text encoding, got: \".$frame['encoding']);\n }\n } else {\n if (isset($frame['raw']) === false) {\n continue;\n }\n }\n\n $this->_frames[$identifier] = $frame;\n }\n }",
"public function setFormatResponse($value)\n {\n $this->format_response = $value;\n return $this;\n }",
"public function getFrames();",
"public function setFrames($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Clarifai\\Internal\\_Frame::class);\n $this->frames = $arr;\n\n return $this;\n }",
"public function setNumFrames($var)\n {\n GPBUtil::checkUint32($var);\n $this->num_frames = $var;\n\n return $this;\n }",
"public function getFrames()\n {\n return $this->frames;\n }",
"public function setResponseFormat($value)\n {\n return $this->set('ResponseFormat', $value);\n }",
"public function setFramesCountUnwrapped($var)\n {\n $this->writeWrapperValue(\"frames_count\", $var);\n return $this;}",
"public function setTextFrame(\\StructType\\TextFrame $textFrame = null)\n {\n if (is_null($textFrame) || (is_array($textFrame) && empty($textFrame))) {\n unset($this->textFrame);\n } else {\n $this->textFrame = $textFrame;\n }\n return $this;\n }",
"public function getFramesReported()\n {\n return $this->frames_reported;\n }",
"public function setFormatTimeout($value)\n {\n return $this->set('FormatTimeout', $value);\n }",
"public function setResponse( $pValue );",
"private function setFormatResponse(){\n if($this->_response->format === null){\n $this->_response->format = $this->_default_format;\n }\n }",
"public function setResponseMetadata($value) \n {\n $this->_fields['ResponseMetadata']['FieldValue'] = $value;\n return;\n }",
"public function setMessageFrame($frame);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Are the provided dates within the schedule look ahead | private function inScheduleLookAhead()
{
if ($this->isAlwaysDayPart())
return true;
// From Date and To Date are in UNIX format
$currentDate = $this->getDate()->parse();
$rfLookAhead = clone $currentDate;
$rfLookAhead->addSeconds(intval($this->config->getSetting('REQUIRED_FILES_LOOKAHEAD')));
// Dial current date back to the start of the day
$currentDate->startOfDay();
// Test dates
if ($this->recurrenceType != '') {
// A recurring event
$this->getLog()->debug('Checking look ahead based on recurrence');
// we should check whether the event from date is before the lookahead (i.e. the event has recurred once)
// we should also check whether the recurrence range is still valid (i.e. we've not stopped recurring and we don't recur forever)
return (
$this->fromDt <= $rfLookAhead->format('U')
&& ($this->recurrenceRange == 0 || $this->recurrenceRange > $currentDate->format('U'))
);
} else if (!$this->isCustomDayPart() || $this->eventTypeId == self::$COMMAND_EVENT) {
// Day parting event (non recurring) or command event
// only test the from date.
$this->getLog()->debug('Checking look ahead based from date ' . $currentDate->toRssString());
return ($this->fromDt >= $currentDate->format('U') && $this->fromDt <= $rfLookAhead->format('U'));
} else {
// Compare the event dates
$this->getLog()->debug('Checking look ahead based event dates ' . $currentDate->toRssString() . ' / ' . $rfLookAhead->toRssString());
return ($this->fromDt <= $rfLookAhead->format('U') && $this->toDt >= $currentDate->format('U'));
}
} | [
"function overlapping_dates($start_date, $end_date, $test_date){\r\n\t\tif($test_date >= $start_date && $test_date <= $end_date)\r\n\t\t\treturn true;\r\n\t\telse\r\n\t\t\treturn false;\r\n}",
"public function takesPlaceAllTheDay() {\n if (($this->takesPlaceInTheMorning() == false) && ($this->takesPlaceInTheAfternoon() == false)) return true;\n //if ((($this->start_date->format('H:i:s') >= \"09:00\")) && (($this->end_date->format('H:i:s') <= \"18:00\"))) return true;\n else return false;\n }",
"function isInDateRange($dateFrom1, $dateTo1, $dateFrom2, $dateTo2) {\n\n $from1 = new DateTime($dateFrom1);\n $to1 = new DateTime($dateTo1); \n $booked1 = $from1;\n \n do\n {\n $from2 = new DateTime($dateFrom2);\n $to2 = new DateTime($dateTo2); \n $booked2 = $from2; \n do\n {\n if($booked1 == $booked2) {\n return true;\n }\n $booked2->add(new DateInterval(\"P1D\"));\n } while($booked2 <= $to2);\n $booked1->add(new DateInterval(\"P1D\"));\n } while($booked1 <= $to1); \n return false;\n }",
"function test_valid_date() {\n\n return (!empty($this->fields[\"begin\"])\n && !empty($this->fields[\"end\"])\n && (strtotime($this->fields[\"begin\"]) < strtotime($this->fields[\"end\"])));\n }",
"private function checkTime()\n {\n $morning_start = new \\DateTime($this->date->format('Y-m-d') . '07:00', $this->date->getTimezone());\n $morning_end = new \\DateTime($this->date->format('Y-m-d') . '09:30', $this->date->getTimezone());\n\n if ($this->date >= $morning_start && $this->date < $morning_end) {\n return false;\n }\n\n $afternoon_start = new \\DateTime($this->date->format('Y-m-d') . ' 16:00', $this->date->getTimezone());\n $afternoon_end = new \\DateTime($this->date->format('Y-m-d') . '19:30', $this->date->getTimezone());\n \n if ($this->date >= $afternoon_start && $this->date < $afternoon_end) {\n return false;\n }\n\n return true;\n }",
"function verify_scheduled($date_time)\n {\n // Acquiring scheduled date as time\n $date_scheduled = strtotime($date_time);\n\n // Acquiring today's date as time\n $date_issued = strtotime(date(\"Y-m-d\"));\n\n if ($date_issued > $date_scheduled) // If the issued date is before to the scheduled date...\n {\n return false; // The scheduled date would be past the issued date --> INVALID\n }\n else\n {\n return true; // The scheduled date would be before the issued date --> VALID\n }\n }",
"function ercore_reporting_date_callback(&$within_date, array &$dates) {\n\n if ($within_date == NULL) {\n return FALSE;\n }\n else {\n $within_date = str_replace(\"T\", \" \", $within_date);\n $within_date = strtotime($within_date);\n return (($dates[0]) <= $within_date && ($dates[1]) >= $within_date);\n }\n}",
"function IsInside( $date )\n {\n if( $this->periods == null )\n {\n if( $this->days[date_get_day( $date )] > 0 )\n return true;\n\n return false;\n }\n\n foreach( $this->periods as $period )\n {\n if( $period[0] > $date )\n return false;\n if( ($period[0] <= $date) && ($period[1] >= $date) )\n return true;\n }\n\n return false;\n }",
"public function action_check_date()\n\t{\n\t\t$post = $this->request->post();\n\n\t\tif (array_key_exists('start', $post))\n\t\t{\n\t\t\tif (strtotime($post['start']) <= strtotime($post['end']))\n\t\t\t\techo TRUE;\n\t\t\telse\n\t\t\t\techo 'Dates are invalid.';\n\t\t}\n\t}",
"public function checkAvailability($date) {\n $dateTime = DateTime::createFromFormat('d/m/Y', $date)->getTimestamp();\n $startDateTime = $this->startDate->getTimestamp();\n $endDateTime = $this->endDate->getTimestamp();\n return ($dateTime >= $startDateTime && $dateTime <= $endDateTime);\n }",
"public function hasDates()\n {\n return $this->isFilled($this->getDates());\n }",
"public function dateMatchesWith($date): bool;",
"public function test_interval_hit() {\n\t\t$mock = get_month_mock(6);\n\t\t$mock->set_start('2019-03-13');\n\t\t$schedule = new RecurringDowntime($mock);\n\n\t\t// Full dates - ensure both first and last days of month evaluates to true.\n\t\t$this->assertTrue($schedule->match_month_interval(mock_date('first day of september 2019')));\n\t\t$this->assertTrue($schedule->match_month_interval(mock_date('last day of september 2019')));\n\t\t$this->assertTrue($schedule->match_month_interval(mock_date('first day of march 2020')));\n\t\t$this->assertTrue($schedule->match_month_interval(mock_date('last day of march 2020')));\n\t\t$this->assertTrue($schedule->match_month_interval(mock_date('first day of september 2020')));\n\t\t$this->assertTrue($schedule->match_month_interval(mock_date('last day of september 2020')));\n\t}",
"public function containsCalculatesCorrectResult()\n {\n $dateSpanDay = new stubDateSpanDay('2007-04-04');\n $this->assertFalse($dateSpanDay->contains(new stubDate('2007-04-03')));\n $this->assertTrue($dateSpanDay->contains(new stubDate('2007-04-04')));\n $this->assertFalse($dateSpanDay->contains(new stubDate('2007-04-05')));\n }",
"public function contains( $date ){\n\n $dateTime = DateTime::create( $date );\n return $dateTime >= $this->start && $dateTime <= $this->end;\n }",
"public function test_interval_hit() {\n\t\t$mock = get_week_mock(5);\n\t\t$mock->set_start('1980-03-01');\n\t\t$schedule = new RecurringDowntime($mock);\n\n\t\t// Create future dates that coincides with the repeat interval\n\t\t$input1 = mock_date('1980-04-07');\n\t\t$input2 = mock_date('1980-05-14');\n\t\t$input3 = mock_date('1980-06-19');\n\n\t\t$this->assertTrue($schedule->match_week_interval($input1));\n\t\t$this->assertTrue($schedule->match_week_interval($input2));\n\t\t$this->assertTrue($schedule->match_week_interval($input3));\n\t}",
"function processDate($oDateCurrent, $oDateEnd)\n{\n\t$result = true;\n\n\t$current = date_format($oDateCurrent, 'Ymd');\n\t$end = date_format($oDateEnd, 'Ymd');\n\n\t$intResult = strcmp($current, $end);\n\t$result = ( $intResult <= 0 );\n\n\t//print(\"diff [\" . $intResult . \"]<br />\\n\");\n\n\treturn $result;\n}",
"function checkifGraveYard($start_time,$end_time,$off_day)\n\t{\n\t\tif($off_day==1)\n\t\t{\n\t\t\t$graveyard=0; //non working day\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$dtA = new DateTime($start_time);\n\t\t\t$dtB = new DateTime($end_time);\n\n\t\t\tif ( $dtA > $dtB )\n\t\t\t{\n\t\t\t\t// Yes Graveyard\n\t\t\t\t//echo 'dtA > dtB';\n\t\t\t\t// $graveyard = 1;\n\t\t\t\t$graveyard = 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Not Graveyard\n\t\t\t\t//echo 'dtA <= dtB';\n\t\t\t\t// $graveyard = 0;\n\t\t\t\t$graveyard = 2;\n\t\t\t}\n\t\t}\n\t\treturn $graveyard;\n\t}",
"public function contains(Date $date)\n {\n $startIsOpen = !$this->hasStart();\n $containsStart = $startIsOpen || $this->start <= $date;\n\n $endIsOpen = !$this->hasEnd();\n $containsEnd = $endIsOpen || $this->end >= $date;\n\n return $containsStart && $containsEnd;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the Whoops custom resource path. | protected function getResourcePath()
{
$base = $this->app['path.base'];
return $base . '/vendor/laravel/framework/src/Illuminate/Exception/resources';
} | [
"public function getResourcePath()\n {\n return $this->get('resourcePath') ?: '';\n }",
"public function get_custom_path(){\n return (is_null($this->custompath)) ? false : $this->custompath;\n }",
"public function getResourcePath()\n {\n return $this->resource_path;\n }",
"public function generateResourcePath()\n {\n $this->validateResourceOptions();\n\n return $this->buildResourcePath();\n }",
"function getPath()\n\t{\n\t\treturn dirname(__FILE__) . \"/../restrict/event_resource/\" . $this->club_id . \"/\" . $this->event_id . \"/\" . $this->id;\n\t}",
"function oz_get_resource_path ()\r\n{\r\n\t//Defaults to \"./res/\" URI path relative to the current url.\r\n\t//This may be changed to point to some other folders in case Apache mod_rewrite or\r\n\t//SEO friendly urls are used and the \"./res/\" path doesn't point to correct location.\r\n\treturn $_REQUEST['oz_res_uri'];\r\n}",
"public function resourceWatchPath(): string\n {\n return \"{$this->getApiPathPrefix(true, 'watch')}/\".static::getPlural().\"/{$this->getIdentifier()}\";\n }",
"public function get_resources_path()\n\t\t{\n\t\t\treturn self::get_themes_path(false).$this->code.'/resources';\n\t\t}",
"public function resourceLogPath(): string\n {\n return \"{$this->getApiPathPrefix()}/\".static::getPlural().\"/{$this->getIdentifier()}/log\";\n }",
"private function getResourcesPath()\n {\n return __DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.$this->resources_folder_name.DIRECTORY_SEPARATOR;\n }",
"public function resourceWatchPath(): string\n {\n return \"/api/{$this->getApiVersion()}/watch/namespaces/{$this->getNamespace()}/configmaps/{$this->getIdentifier()}\";\n }",
"public function getRessourcePath()\r\n {\r\n return $this->getURLPath($this->pathOffset);\r\n }",
"public function getBaseResourcePath()\n {\n return self::$baseResourcePath;\n }",
"public function resourcePath(): string\n {\n return \"{$this->getApiPathPrefix()}/\".static::getPlural().\"/{$this->getIdentifier()}\";\n }",
"public function getPath() {\n return $this->buildResourcePath('show');\n }",
"public function resourcesPath()\r\n {\r\n return $this->resourcesPath;\r\n }",
"public function pathOf(string $resource): string;",
"public function resourceExecPath(): string\n {\n return \"{$this->getApiPathPrefix()}/\".static::getPlural().\"/{$this->getIdentifier()}/exec\";\n }",
"function micro_get_theme_path_for( string $resource )\n{\n global $app;\n return $app->getThemePathFor($resource);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Lookup a single violator_notification_settings row by its store id | public function get_violator_notification_settings_by_store($store_id) {
return $this->_get_violator_notification_settings('store_id', (int)$store_id);
} | [
"public function get_violator_notification_email_setting_by_store($store_id)\n {\n $store_id = intval($store_id);\n \n $this->db->select('*');\n $this->db->from('violator_notification_email_settings');\n $this->db->where('store_id', $store_id);\n \n $query = $this->db->get();\n \n return $query->row_array();\n }",
"public function get_notification_email_setting_by_store($store_id)\n {\n $store_id = intval($store_id);\n \n $this->db->select('*');\n $this->db->from($this->_table_violator_notification_email_settings);\n $this->db->where('store_id', $store_id);\n \n $query = $this->db->get();\n \n return $query->row_array();\n }",
"public function get_map_enforcement_settings($store_id=0,$email_from=''){\n $store_id = strtolower($store_id)=='all'?0:$store_id;\n $this->db->where('store_id',$store_id);\n //$this->db->where('email_from',$email_from);\n $query = $this->db->get($this->_table_violator_notification_email_settings);\n if($query->num_rows()>0){\n //if seetings found return data as object\n return $query->row();\n }\n else{\n //if not found return false\n return false;\n }\n }",
"public function getByStoreId($value);",
"function getNotificationUserSettings($user_id, $notification_id)\n\t{\n\t\tglobal $CFG, $db;\n\n\t\t$sql = 'SELECT status FROM '.$CFG['db']['tbl']['notification_settings'].' WHERE'.\n\t\t\t\t' user_id = '.$db->Param('user_id').' AND'.\n\t\t\t\t' notification_id = '.$db->Param('notification_id');\n\n\t\t$stmt = $db->Prepare($sql);\n\t\t$rs = $db->Execute($stmt, array($user_id, $notification_id));\n\t\t\tif (!$rs)\n\t\t\t\ttrigger_db_error($db);\n\n\t\tif($row = $rs->FetchRow())\n\t\t\t{\n\t\t\t\treturn $row['status'];\n\t\t\t}\n\t\treturn false;\n\t}",
"public function findByName($settingName);",
"function hypeapps_get_notification_by_id($id) {\n\t$svc = elgg()->{'notifications.site'};\n\n\t/* @var $svc SiteNotificationsService */\n\n\treturn $svc->getTable()->get($id) ? : false;\n}",
"function getByWlId($wl_id){\n $sql = \"SELECT * FROM settings WHERE wl_id = ?\";\n $query = $this->db->query($sql, array($wl_id));\n if($query->num_rows() > 0 ){\n foreach ($query->result() as $row){\n $data[] = $row;\n }\n return $data;\n }else{\n //todo error handling\n return -1;\n }\n }",
"public function findById($searchedIdStoreWorkforce) { ; }",
"public function getNotificationSettingForPerson($personId, $notificationSlug)\r\n {\r\n $notificationSetting = NULL;\r\n \r\n // Get the notification setting\r\n $q = $this->createQuery('ns')\r\n ->innerJoin('ns.Notifications n')\r\n ->where('ns.person_id = ?', array($personId))\r\n ->andWhere('n.Slug = ?', array($notificationSlug));\r\n $results = $q->execute();\r\n \r\n // If a notification setting was retrieved, return it\r\n if ($results->count() == 1)\r\n {\r\n $notificationSetting = $results->getFirst();\r\n }\r\n return $notificationSetting;\r\n }",
"public function get($id, $storeId = null);",
"function getSettingsItem($getting_item = null)\n {\n $store_settings = storeConfigItem('store_settings');\n $item = $getting_item ? $store_settings['settings'][$getting_item] \n : $store_settings['settings'];\n unset($store_settings);\n return $item;\n }",
"function get_systemsettings($id)\n {\n return $this->db->get_where('systemsettings',array('id'=>$id))->row_array();\n }",
"public function getStoreInfoByStoreID($store_id) {\r\n $where = \"store_id = $store_id\";\r\n return $this->select($this->_name, '*', $where, 1);\r\n }",
"public function get_setting($setting_name, $provider_id)\r\n {\r\n $provider_settings = $this->db->get_where('ea_user_settings', ['id_users' => $provider_id])->row_array();\r\n return $provider_settings[$setting_name];\r\n }",
"public function getSetting(){\n\t\treturn $this->findById(1);\n\t}",
"function getSettingType($id){\n return sqlSelectOne(\"SELECT * FROM settings WHERE setting_id='$id'\", 'setting_type');\n}",
"public static function getUserSettingsRow($alias){\r\n \tif ($alias) {\r\n \t\t$objUserDb \t\t\t\t= Appdbmanager::getUserConnection();\r\n \t$db \t\t\t\t\t= new Db($objUserDb);\r\n \t$settingsValue\t\t\t= $db->selectRecord(\"settings\",\"*\",\"settings_name='\".$alias.\"'\");\r\n\t\t\treturn $settingsValue;\r\n \t}\r\n }",
"function getSetting($settingName = 'name'){ // by default $sittingName equal name of namesetting col.\n\n return \\App\\SiteSetting::where('namesetting', $settingName)->get()[0]->value;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/This Contact belongs to lawyer | public function lawyer()
{
return $this->belongsTo('App\Lawyer');
} | [
"public function getContactBy()\n {\n return $this->contact_by;\n }",
"public function lawyer()\n {\n \treturn $this->belongsTo('App\\Lawyer');\n }",
"public function contact() {\n return DB::table('contacts')\n ->where('owner_id', $this->id)\n ->where('owner_type_id', OwnerType::USER)\n ->first();\n }",
"public function getSellerContact()\n {\n return $this->sellerContact;\n }",
"public function getRequestorContact()\n {\n return $this->requestorContact;\n }",
"public function getContactInformation();",
"public function setContactDetail()\n\t{\n\t\t// DIRECT CALL \n\t\tif($this->directCall)\n\t\t{\n\t\t\t//invalid phone condition: \n\t\t\tif(!JsCommon::isPhoneValid($this->profileObj))\n\t\t\t{\n\t\t\t$PHONE_MOB = \"I\";\n\t\t\t$PHONE_RES = \"I\";\n\t\t\t$ALT_NUM=\"I\";\n\t\t\t$chk_landlStatus=\"I\";\n\t\t\t$chk_mobStatus=\"I\";\n\t\t\t}\n\t\t\telse // verified status\n\t\t\t{\n\t\t\tif($this->profileObj->getPHONE_MOB()!='')\n\t\t\t\t$chk_mobStatus=$this->profileObj->getMOB_STATUS();\n\t\t\tif($this->profileObj->getPHONE_RES()!='')\n\t\t\t\t$chk_landlStatus=$this->profileObj->getLANDL_STATUS();\n\t\t\t}\n\t\t\t\n\t\t\tif($chk_landlStatus ==Messages::YES)\n\t\t\t\t$this->setVERIFIED_LANDLINE(Messages::YES);\n\t\t\telse\n\t\t\t\t$this->setVERIFIED_LANDLINE(Messages::NO);\t\n\t\t\t\t\t\n\t\t\tif($chk_mobStatus ==Messages::YES)\n\t\t\t\t\t$this->setVERIFIED_MOB(Messages::YES);\n\t\t\telse\n\t\t\t\t$this->setVERIFIED_MOB(Messages::NO);\n\t\t\t\n\t\t}\n\t\t\n\t\t/*********DIRECT CALL Ends here******************/\n\t\t\n\t\t//Residence phone number and Owner details\n\t\t\n if(($this->profileObj->getSHOWPHONE_RES()==Messages::YES || $this->profileObj->getSHOWPHONE_RES()==\"\"|| ($this->profileObj->getSHOWPHONE_RES()==\"C\" && ($this->contactHandlerObj->getContactType() == ContactHandler::ACCEPT ||($this->contactHandlerObj->getContactType() == ContactHandler::INITIATED && $this->contactHandlerObj->getContactInitiator() == ContactHandler::RECEIVER))))&& $PHONE_RES!=\"I\" && $this->profileObj->getPHONE_RES()!=\"\") \n\t\t{\n\t\t\t$this->setRES_PHONE_OWNER_NUMBER($this->profileObj->getDecoratedLandlineNumberOwner());\n\t\t\t$this->setRES_PHONE_OWNER_NAME($this->profileObj->getPHONE_OWNER_NAME());\n\t\t\t$res_phone=$this->profileObj->getSTD().\"-\".$this->profileObj->getPHONE_RES();\n\t\t\tif($this->profileObj->getISD())\n\t\t\t$this->setRES_PHONE_NO($this->profileObj->getISD().\"-\".$res_phone);\n }\n \n /*********Ends here******************/\n\t\t\n\t\t//Mobile phone number and Owner details\n\t\t\n if(($this->profileObj->getSHOWPHONE_MOB()==Messages::YES || $this->profileObj->getSHOWPHONE_MOB()==\"\"|| ($this->profileObj->getSHOWPHONE_MOB()==\"C\" && ($this->contactHandlerObj->getContactType() == ContactHandler::ACCEPT ||($this->contactHandlerObj->getContactType() == ContactHandler::INITIATED && $this->contactHandlerObj->getContactInitiator() == ContactHandler::RECEIVER))))&& $PHONE_MOB!=\"I\" && $this->profileObj->getPHONE_MOB()!=\"\") \n {\n\t\t\t$this->setMOB_PHONE_OWNER_NUMBER($this->profileObj->getDecoratedMobileNumberOwner());\n\t\t\t$this->setMOB_PHONE_OWNER_NAME($this->profileObj->getMOBILE_OWNER_NAME());\n\t\t\t$mob_phone=$this->profileObj->getPHONE_MOB(); \n\t\t\tif($this->profileObj->getISD())\n\t\t\t$this->setMOB_PHONE_NO($this->profileObj->getISD().\"-\".$mob_phone);\n }\n \n\t\t/*********Ends here******************/\n\t\t\n\t\t//Email Detail\n\t\t\n\t\tif($this->profileObj->getVERIFY_EMAIL()==Messages::YES)\n {\n\t\t\t\n\t\t}\n\t\t$this->setEMAIL_ID($this->profileObj->getEMAIL());\n\t\t/*******Ends Here********************/\n\t\t\n\t\t//calculating left allotted count\n\t\t\t\n\t\t\t$jsadmin_CONTACTS_ALLOTED_OBJ =new jsadmin_CONTACTS_ALLOTED();\n\t\t\t\n\t\t\t$this->setLEFT_ALLOTED($jsadmin_CONTACTS_ALLOTED_OBJ->getViewedContacts($this->contactHandlerObj->getViewer()->getPROFILEID()));\n\t\t\t/************Ends here********/\n\t\t\n\t\t//show viewer address\n\t\t\n if($this->profileObj->getCONTACT()!=\"\" && $this->profileObj->getSHOWADDRESS()==Messages::YES)\n\t\t\t{\n\t\t\t\t$address=$this->profileObj->getCONTACT();\n\t\t\t\tif($this->profileObj->getPINCODE())\n\t\t\t\t\t$address=$address.\"\\n Pincode:\".$this->profileObj->getPINCODE();\n\t\t\t\t$this->setSHOW_ADDRESS(nl2br($address));\n\t\t\t}\n\t\t\t\n\t\t/*********Ends here******************/\n\t\t\t\n\t\t//show parent Address\t\n\t\t\n if($this->profileObj->getSHOW_PARENTS_CONTACT()==Messages::YES && $this->profileObj->getPARENTS_CONTACT()!=\"\")\n {\n\t\t\t$address=$this->profileObj->getPARENTS_CONTACT();\n\t\t\t\tif($this->profileObj->getPARENT_PINCODE())\n\t\t\t\t\t$address=$address.\"\\n Pincode:\".$this->profileObj->getPARENT_PINCODE();\n\t\t\t$this->setSHOW_PARENTS_ADDRESS(nl2br($address));\n\t\t}\n\t\t\t\n\t\t/*********Ends here******************/\n\t\t\n\t\t //Time to call details\n\t\t\tif($this->profileObj->getTIME_TO_CALL_START() && $this->profileObj->getTIME_TO_CALL_END())\n {\n\t\t\t\t\t$this->setTIME_TO_CALL_START($this->profileObj->getTIME_TO_CALL_START());\n\t\t\t\t\t$this->setTIME_TO_CALL_END($this->profileObj->getTIME_TO_CALL_END());\n }\n /*********Ends here******************/\n \n //Relation details \n \n if( $this->profileObj->getRELATION())\n\t\t\t$this->setRELATION_NAME($this->profileObj->getDecoratedRelation());\n\t\t\t\n\t\t/*********Ends here******************/\n\t\t\t\n\t\t//messenger details\t\n\t\t\n\t\tif($this->profileObj->getSHOWMESSENGER()==Messages::YES && $this->profileObj->getMESSENGER_CHANNEL() && $this->profileObj->getMESSENGER_ID())\n\t\t\t{\n $messenger=$this->profileObj->getMESSENGER_ID();\n if(!strstr($messenger,\"@\"))\n\t\t\t\t\t$messenger=$messenger.\"@\".FieldMap::getFieldLabel(\"messenger_channel\",$this->profileObj->getMESSENGER_CHANNEL());\n\t\t\t\t$this->setSHOW_MESSENGER($messenger);\n\t\t\t}\n\t\t\t\n\t\t/*********Ends here******************/\n\t\t\n\t\t/*********Alternative number********/\n\t\t$altMob = \"\";\n\t\t$altMobDetail = \"\";\n\t\t$jProfileContactObj= new ProfileContact();\n\t\t$altArr=$jProfileContactObj->getProfileContacts($this->profileObj->getPROFILEID()); \n\t\tif($altArr[\"ALT_MOB_STATUS\"]==Messages::YES || $altArr[\"SHOWALT_MOBILE\"] == \"C\")\n\t\t\t$this->setVERIFIED_ALT_MOB(Messages::YES);\n\t\telse\n\t\t\t$this->setVERIFIED_ALT_MOB(Messages::NO);\n\t\t\t\n\t\tif(($altArr[\"SHOWALT_MOBILE\"]==Messages::YES || !$altArr[\"SHOWALT_MOBILE\"] || ($altArr[\"SHOWALT_MOBILE\"]==\"C\" && ($this->contactHandlerObj->getContactType() == ContactHandler::ACCEPT ||($this->contactHandlerObj->getContactType() == ContactHandler::INITIATED && $this->contactHandlerObj->getContactInitiator() == ContactHandler::RECEIVER))))&& $altArr[\"ALT_MOBILE\"] && $ALT_NUM!=\"I\") \n\t\t{\n\t\t\t\tif($altArr[\"ALT_MOBILE_ISD\"])\n\t\t\t\t\t$altIsd = $altArr[\"ALT_MOBILE_ISD\"].\"-\";\n\t\t\t\telse\n\t\t\t\t\t$altIsd =$this->profileObj->getISD().\"-\";\n\t\t\t\t\t$altMob = $altIsd.$altArr[\"ALT_MOBILE\"];\n\t\t\t\tif($altArr[\"ALT_MOBILE_OWNER_NAME\"])\n\t\t\t\t{ \n\t\t\t\t\t$altMobDetail.=\" of \".$altArr[\"ALT_MOBILE_OWNER_NAME\"];\n\t\t\t\tif($altArr[\"ALT_MOBILE_NUMBER_OWNER\"])\n\t\t\t\t\t$altMobDetail.=\" (\".FieldMap::getFieldLabel(\"number_owner\",$altArr[\"ALT_MOBILE_NUMBER_OWNER\"]).\")\";\n\t\t\t\t}\n\t\t\t\tif($altArr[\"SHOW_ALT_MESSENGER\"]==Messages::YES && $altArr[\"ALT_MESSENGER_ID\"] && $altArr[\"ALT_MESSENGER_CHANNEL\"])\n\t\t\t\t{\n\t\t\t\t\t$altMessenger=$altArr[\"ALT_MESSENGER_ID\"];\n if(!strstr($altMessenger,\"@\"))\n\t\t\t\t\t$altMessenger=$altMessenger.\"@\".FieldMap::getFieldLabel(\"messenger_channel\",$altArr[\"ALT_MESSENGER_CHANNEL\"]);\n\t\t\t\t$this->setSHOW_MESSENGER2($altMessenger);\n\t\t\t\t}\n\t\t}\n\t\tif($altMob)\n\t\t{\n\t\t\t$this->setALT_MOBILE_LABEL($altMobDetail);\n\t\t\t$this->setALT_MOBILE($altMob);\n\t\t}\n // block for setting hidden contacts messages \n \n if(!($this->contactHandlerObj->getContactType() == ContactHandler::ACCEPT) && !($this->contactHandlerObj->getContactType() == ContactHandler::INITIATED && $this->contactHandlerObj->getContactInitiator() == ContactHandler::RECEIVER))\n $contactedFlag=0;\n else \n $contactedFlag=1;\n \n \n if($altArr['ALT_MOBILE'] && $altArr[\"ALT_MOB_STATUS\"]=='Y')\n {\n if($altArr[\"SHOWALT_MOBILE\"]==\"C\" && !$contactedFlag)\n $this->setAltMobileHiddenMessage(Messages::PHONE_VISIBLE_ON_ACCEPT);\n elseif($altArr[\"SHOWALT_MOBILE\"]=='N')\n $this->setAltMobileHiddenMessage(Messages::PHONE_HIDDEN);\n } \n\n if($this->profileObj->getPHONE_RES() && $this->profileObj->getLANDL_STATUS()=='Y' )\n {\n $showPhoneRes = $this->profileObj->getSHOWPHONE_RES();\n if($showPhoneRes==\"C\" && !$contactedFlag)\n $this->setLandlMobileHiddenMessage(Messages::PHONE_VISIBLE_ON_ACCEPT);\n elseif($showPhoneRes=='N')\n $this->setLandlMobileHiddenMessage(Messages::PHONE_HIDDEN);\n } \n\n if($this->profileObj->getPHONE_MOB() && $this->profileObj->getMOB_STATUS()=='Y' )\n {\n $showPhoneMob = $this->profileObj->getSHOWPHONE_MOB();\n if($showPhoneMob==\"C\" && !$contactedFlag)\n $this->setPrimaryMobileHiddenMessage(Messages::PHONE_VISIBLE_ON_ACCEPT);\n elseif($showPhoneMob=='N')\n $this->setPrimaryMobileHiddenMessage(Messages::PHONE_HIDDEN);\n } \n // block for setting hidden contacts messages ends here\n \n \n\t\tif($altArr[\"SHOWBLACKBERRY\"] == Messages::YES && $altArr[\"BLACKBERRY\"])\n\t\t{\n\t\t\t$this->setBlackberry($altArr[\"BLACKBERRY\"]);\n\t\t}\n\t\tif($altArr[\"SHOWLINKEDIN\"] == Messages::YES && $altArr[\"LINKEDIN_URL\"])\n\t\t{\n\t\t\t$this->setLinkedIn($altArr[\"LINKEDIN_URL\"]);\n\t\t}\n\t\tif($altArr[\"SHOWFACEBOOK\"] == Messages::YES && $altArr[\"FB_URL\"])\n\t\t{\n\t\t\t$this->setFacebook($altArr[\"FB_URL\"]);\n\t\t}\n\t\t\n\t\t\n\t\t/*********Ends here******************/\n\t\t\n\t\t\t//call directly from mobile\n\t\tif($this->fromMobile)\n\t\t{\n\t\t\t//Mobile/lanline number formatting to make it work for adding to phonebook\n\t\t\tif($this->getMOB_PHONE_NO())\n\t\t\t$this->setMOB_PHONE_NO(\"+\".str_replace(\"-\",\"\",$this->getMOB_PHONE_NO()));\n\t\t\t\n\t\t\tif($this->getRES_PHONE_NO())\n\t\t\t$this->setRES_PHONE_NO(\"+\".str_replace(\"-\",\"\",$this->getRES_PHONE_NO()));\n\t\t\tif(substr($this->getRES_PHONE_NO(),3,1) ==='0')\n\t\t\t\t$this->setRES_PHONE_NO(substr($this->getRES_PHONE_NO(),0,3).substr($this->getRES_PHONE_NO(),4));\n\t\t\t\n\t\t\tif($this->getALT_MOBILE())\n\t\t\t$this->setALT_MOBILE(\"+\".str_replace(\"-\",\"\",$this->getALT_MOBILE()));\n\t\t\tif(substr($this->getALT_MOBILE(),3,1) ==='0')\n\t\t\t\t$this->setALT_MOBILE(substr($this->getALT_MOBILE(),0,3).substr($this->getALT_MOBILE(),4));\t\t\n\t\t\t\t\n\t\t\t$this->setPROFILENAME($this->profileObj->getUSERNAME());\n\t\t\t\t\n\t\t}\n\t\t/************Ends here********/\n\t\t$this->setContactDetailArr( $this->displayContactDetailsArray());\n\t\t//print_r($this->displayContactDetailsArray());die;\n\t\t\n\n\t\t\n\t}",
"public function getContact()\n {\n }",
"public function isContact()\n {\n return $this->contact;\n }",
"public function referrer()\n {\n return $this->belongsTo('App\\Contact', 'referral_id');\n }",
"public function getSponsor();",
"function getSecondaryContact()\n {\n return $this->__secondarycontact ;\n }",
"function getContact() {\n return $this->_getDescription('Contact');\n }",
"public function getContactUrl()\n {\n return 'contact/show?id='.$this->document->getClienteId();\n }",
"public function getSellerContactDetails()\n {\n return $this->sellerContactDetails;\n }",
"public function getAccountingContact()\n {\n return $this->accountingContact;\n }",
"public function test_cannot_get_others_contact() : void\n {\n $user = User::factory()\n ->has(Contact::factory()->count(1))\n ->create();\n\n $otherUser = User::factory()\n ->has(Contact::factory()->count(1))\n ->create();\n\n $contact = $otherUser->contacts[0];\n\n Sanctum::actingAs($user);\n\n $response = $this->get(\"/api/contact/{$contact->id}\");\n\n $response->assertStatus(403);\n }",
"public function getBuyerInfo()\n\t{\n\t\t// TODO: Implement getBuyerInfo() method.\n\t}",
"function abbey_author_contacts( $author, $key = \"\" ){\n\t$social_contacts = apply_filters( \"abbey_author_social_contacts\", array( \"facebook\", \"twitter\", \"google-plus\", \"linkedin\", \"github\" ) );\n\t$author_contacts = array();\n\tif( !empty( $social_contacts ) ){\n\t\tforeach( $social_contacts as $contact ){\n\t\t\tif( $author_contact = get_the_author_meta( $contact, $author->ID ) )\n\t\t\t\t$author_contacts[ $contact ] = $author_contact;\n\t\t}\n\t}//end if social_contacts //\n\treturn $author_contacts;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
set value isDelivred type : bool | public function setIsDelivred($isDelivred)
{
$this->isDelivred = $isDelivred;
} | [
"public function setIsDelivred(bool $isDelivred)\n {\n $this->isDelivred = $isDelivred;\n }",
"public function setExpert(bool $isExpert);",
"public function setIsRefinable(?bool $value): void {\n $this->getBackingStore()->set('isRefinable', $value);\n }",
"public function setIsDraft($flag);",
"public function setDormant(bool $value = true): void {\n\t\t$this->dormant = $value;\n\t}",
"public function setIsRemediatable(?bool $value): void {\n $this->getBackingStore()->set('isRemediatable', $value);\n }",
"protected function _setBoolean($name, $value) {}",
"public function setDormant(bool $value = true): void\n {\n $this->dormant = $value;\n }",
"public function setIsExpeditable(?bool $value): void {\n $this->getBackingStore()->set('isExpeditable', $value);\n }",
"public function setValueTypeToBool(): void\n {\n $this->valueType = OptionData::VAL_TYPE_BOOL;\n }",
"protected function setIsDrink(bool $value): void\n {\n $this->_isDrink = $value;\n }",
"public function setIsModerated(?bool $value): void {\n $this->getBackingStore()->set('isModerated', $value);\n }",
"protected function setBool(){\n $this->bool = array(\n\t 'true'=>1,\n\t 'false'=>0,\n\t 'yes'=>1,\n\t 'no'=>0,\n\t\t'on'=>1,\n\t\t'off'=>0,\n\t);\n }",
"public function testDataPrivateSetBoolAsBool(): void\n {\n $this->dataPrivateSetBool('bool', true);\n $this->assertTrue($this->dataPrivateGet('bool'));\n\n $this->dataPrivateSetBool('bool', false);\n $this->assertFalse($this->dataPrivateGet('bool'));\n }",
"public function setIsDraft($draft);",
"public function setVisio(?bool $value): void {\n $this->getBackingStore()->set('visio', $value);\n }",
"protected function setIsNonLiquidAnalgesic(bool $value): void\n {\n $this->_isNonLiquidAnalgesic = $value;\n }",
"public function testSetDesactive() {\n\n $obj = new SaisiePrepaEntete();\n\n $obj->setDesactive(true);\n $this->assertEquals(true, $obj->getDesactive());\n }",
"public function setIsPrivileged(?bool $value): void {\n $this->getBackingStore()->set('isPrivileged', $value);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Split data into nevironment specific collections from `$config>mergedData` recursively. | protected static function dumpSplitDataRecursive (\stdClass $currentMerged, \stdClass $currentSeparated, array & $allEnvNames) {
$commonEnvDataKey = static::$commonEnvironmentDataKey;
// get common level keys (keys existing in all environments)
// and specific level keys (keys existing only in some environments).
list($allCommonKeys, $allSpecificKeys) = static::dumpSplitDataKeys(
$currentMerged, $allEnvNames
);
// comparing and separating values under common level keys:
foreach ($allCommonKeys as $commonKey) {
$compareValues = [];
$childrenMerged = new \stdClass;
$childrenSeparated = new \stdClass;
foreach ($allEnvNames as $envName) {
$compareValue = & $currentMerged->{$envName}[$commonKey];
$compareValues[] = & $compareValue;
$childrenMerged->{$envName} = & $compareValue;
}
// Compare values in current level:
list (
$commonValue,
$valuesAreEqual,
$valuesAreScalars
) = static::dumpSplitDataCompareValues(
$compareValues, $allEnvNames
);
if ($valuesAreEqual) {
// All environments values are equal - assign it into common values collection:
$commonEnvDataCollection = & $currentSeparated->{$commonEnvDataKey};
$commonEnvDataCollection[$commonKey] = $commonValue;
} else if ($valuesAreScalars) {
// All environments values are NOT equal - assign it into specific environments collections:
foreach ($allEnvNames as $envName) {
$separatedCollection = & $currentSeparated->{$envName};
$separatedCollection[$commonKey] = $childrenMerged->{$envName};
}
} else {
// Values are collections - move collections into sublevel and process recursion:
foreach ($allEnvNames as $envName) {
$separatedCollection = & $currentSeparated->{$envName};
$separatedCollection[$commonKey] = [];
$childrenSeparated->{$envName} = & $separatedCollection[$commonKey];
}
$commonCollection = & $currentSeparated->{$commonEnvDataKey};
$commonCollection[$commonKey] = [];
$childrenSeparated->{$commonEnvDataKey} = & $commonCollection[$commonKey];
static::dumpSplitDataRecursive(
$childrenMerged, $childrenSeparated, $allEnvNames
);
// If and env. collection or common collection is empty - unset it:
foreach ($allEnvNames as $envName) {
$separatedCollection = & $currentSeparated->{$envName};
if (count($separatedCollection[$commonKey]) === 0)
unset($separatedCollection[$commonKey]);
}
if (count($commonCollection[$commonKey]) === 0)
unset($commonCollection[$commonKey]);
}
}
// assign specific level keys:
foreach ($allSpecificKeys as $envName => $specificKeys) {
$separatedCollection = & $currentSeparated->{$envName};
$mergedCollection = & $currentMerged->{$envName};
foreach ($specificKeys as $specificKey)
$separatedCollection[$specificKey] = $mergedCollection[$specificKey];
}
} | [
"protected static function dumpSplitData (\\MvcCore\\IConfig $config, array & $environmentNames) {\n\t\t$mergedDataArr = static::dumpCastToArrayRecursive($config->mergedData);\n\t\t$commonEnvDataKey = static::$commonEnvironmentDataKey;\n\t\tif (count($environmentNames) == 1) {\n\t\t\t$singleEnvName = $environmentNames[0];\n\t\t\t$config->envData[$commonEnvDataKey] = $mergedDataArr[$singleEnvName];\n\t\t\treturn;\n\t\t}\n\t\t// Split merged data into environment-specific\n\t\t// collections and into common data collection:\n\t\t$currentMerged = new \\stdClass;\n\t\t$currentSeparated = new \\stdClass;\n\t\tforeach ($environmentNames as $envName) {\n\t\t\t$config->envData[$envName] = [];\n\t\t\t$currentMerged->{$envName} = & $mergedDataArr[$envName];\n\t\t\t$currentSeparated->{$envName} = & $config->envData[$envName];\n\t\t}\n\t\t$config->envData[$commonEnvDataKey] = [];\n\t\t$currentSeparated->{$commonEnvDataKey} = & $config->envData[$commonEnvDataKey];\n\t\tstatic::dumpSplitDataRecursive(\n\t\t\t$currentMerged, $currentSeparated, $environmentNames\n\t\t);\n\t}",
"private function parseDataFolder() {\n if (!is_dir($this->dataFolder)) {\n if ($this->gitRepo == \"\" ) {\n SJTMapTools::getInstance()->getLogger()->info('The regions folder doesn\\'t exist. No git repo configured, creating a local repo…');\n mkdir($this->dataFolder, 0755, true);\n GitTools::gitCreate($this->dataFolder);\n } else {\n SJTMapTools::getInstance()->getLogger()->info('The regions folder doesn\\'t exist. Cloning from ' . $this->gitRepo . '…');\n GitTools::gitClone($this->dataFolder, $this->gitRepo);\n }\n }\n\n $directories = scandir($this->dataFolder);\n\n foreach ($directories as $directory) {\n if ($directory[0] === '.') { continue; }\n $region = Region::fromFolder($directory, $this->dataFolder);\n $this->regions[$region->name] = $region;\n $region->drawMarkers();\n }\n }",
"public function processConfigData(array $data)\n {\n // going through $data\n foreach ($data as $cond => $vars) {\n\n // Just a comment\n if ($cond == '--') continue;\n\n // Convert potentials Tags\n if (is_string($vars)) $vars = $this->convertTags($vars);\n $include = false;\n\n $tagcode = '';\n if (strpos($cond, ':') !== false) {\n // Substitute tags for strings\n $cond = $this->convertTags(trim($cond));\n list($tagcode, $tagvalue) = explode(\":\", $cond, 2);\n $tagcode = trim($tagcode);\n $tagvalue = trim($tagvalue);\n\n if ($this->isConditionalTag($tagcode))\n $include = $this->getConditionalTagResult($tagcode, $tagvalue);\n elseif ($this->isAssignationTag($tagcode)) {\n $this->setAssignationTag($tagcode, $tagvalue, $vars);\n continue;\n } else {\n $this->core->errors->add('unknown tag: |' . $tagcode . '|');\n continue;\n }\n\n } else {\n $include = true;\n $vars = [$cond => $vars];\n\n }\n\n // Include config vars.\n if ($include) {\n if (is_array($vars)) {\n foreach ($vars as $key => $value) {\n if ($key == '--') continue; // comment\n // Recursive call to analyze subelements\n if (strpos($key, ':')) {\n $this->processConfigData([$key => $value]);\n } else {\n // Assign conf var values converting {} tags\n $this->set($key, $this->convertTags($value));\n }\n }\n }\n }\n }\n\n }",
"public function structure()\n {\n $data = $this->pullData();\n if (empty($data['campuses'])) {\n return $data;\n }\n\n //If config has defined compuses names - import only them.\n $campuses_list = !empty($this->options['campusesList']) ? explode(',', $this->options['campusesList']) : array();\n\n //loop through campuses and add them to the database\n foreach ($data['campuses'] as $campus) {\n if (!empty($campuses_list) && !in_array($campus['name'], $campuses_list)) {\n continue;\n }\n $campus['model'] = Campus::import($this->mapper->mapCampus($campus));\n\n //create schools and sync them with campuses\n $school = $this->syncSchoolToCampus($campus['model']->id, $campus['model']->campus_name);\n\n //add campus and school IDs to the list of synced items\n $this->addImported('campuses', $campus['model']->campus_ale_id)\n ->addImported('schools', $school->id);\n\n if (empty($campus['buildingList'])) {\n continue;\n }\n\n // import all buildings for the current campus iteration\n foreach ($campus['buildingList'] as $building) {\n $building['model'] = Building::import($this->mapper->mapBuilding($school->id, $campus['model']->id, $building));\n\n $this->addImported('buildings', $building['model']->building_ale_id);\n\n if (empty($building['floorList'])) {\n continue;\n }\n\n // import all floors for the current building iteration\n foreach ($building['floorList'] as $floor) {\n $floor['model'] = Floor::import($this->mapper->mapFloor($school->id, $building['model']->id, $floor));\n $floor['id'] = $floor['model']->id;\n\n $this->addImported('floors', $floor['model']->floor_ale_id);\n\n //Floor image\n $mapped = $this->mapper->mapImage($this->options['baseUrl'], $this->options['imagesUrl'], $floor);\n $this->downloadImage($mapped['name'], $mapped['path']);\n $map = FloorImage::import(\n $mapped['image'],\n [\n 'floor_id' => $floor['model']->id,\n ]\n );\n $this->addImported('floor_images', $map->file_name);\n }\n }\n }\n\n //clean up old records\n $this->cleanUp();\n\n return $data;\n }",
"public function merge($data, $base)\r\n {\r\n foreach($data as $name => $value) {\r\n }\r\n }",
"protected function getFlattenedConfig() {\n\n $platform_name = $this->platform->getNormalizedName();\n $environment = $this->platform->getEnvironment();\n\n $flattened = array();\n\n foreach ($this->config_contents as $filename => $config) {\n\n // Replace any defaults defined in successive configurations.\n if (!empty($config['default'])) {\n\n $flattened = array_replace_recursive($flattened, $config['default']);\n }\n\n // Replace any environment specific default overrides.\n if (!empty($config[$environment])) {\n\n $flattened = array_replace_recursive($flattened, $config[$environment]);\n }\n\n // Load in any platform specific default overrides that are defined.\n if (!empty($config[$platform_name]['default'])) {\n\n $flattened = array_replace_recursive($flattened, $config[$platform_name]['default']);\n }\n\n // Load platform and environment specific overrides.\n if (!empty($config[$platform_name][$environment])) {\n\n $flattened = array_replace_recursive($flattened, $config[$platform_name][$environment]);\n }\n }\n\n return $flattened;\n }",
"protected function seedMergeStorage() {\n // Clear out any existing data.\n $this->mergedStorage->deleteAll();\n\n // First, export all configuration from the active storage.\n // Get raw configuration data without overrides.\n foreach ($this->configManager->getConfigFactory()->listAll() as $name) {\n $this->mergedStorage->write($name, $this->configManager->getConfigFactory()->get($name)->getRawData());\n }\n // Get all override data from the remaining collections.\n foreach ($this->activeStorage->getAllCollectionNames() as $collection) {\n $collection_storage = $this->activeStorage->createCollection($collection);\n $merged_collection_storage = $this->mergedStorage->createCollection($collection);\n $merged_collection_storage->deleteAll();\n foreach ($collection_storage->listAll() as $name) {\n $merged_collection_storage->write($name, $collection_storage->read($name));\n }\n }\n }",
"private function splitOnValue($configurables)\n {\n if (! $this->splitOnValue) {\n return $configurables;\n }\n\n $newConfigurables = [];\n foreach ($configurables as $identifier => $configurable) {\n $splitConfigurables = [];\n $variations = $configurable['configurable_variations'];\n unset($configurable['configurable_variations']);\n\n foreach ($variations as $variation) {\n $splitKey = (string) $variation['split'];\n if (!isset($splitConfigurables[$splitKey])) {\n //Base the new configurable on the first variation\n $splitConfigurables[$splitKey] =\n $this->initConfigurable($this->items[$variation['sku']], $identifier);\n\n $splitConfigurables[$splitKey]['configurable_variations'] = [];\n }\n unset($variation['split']);\n $splitConfigurables[$splitKey]['configurable_variations'][] = $variation;\n }\n\n $splitConfigurables = $this->filterConfigurables($splitConfigurables);\n ksort($splitConfigurables);\n $sequence = 0;\n foreach ($splitConfigurables as $splitConfigurable) {\n if (! isset($newConfigurables[$identifier])) {\n $newConfigurables[$identifier] = $splitConfigurable;\n } else {\n $newSku = $identifier.'-'.$sequence;\n $splitConfigurable['sku'] = $newSku;\n $newConfigurables[$newSku] = $splitConfigurable;\n }\n $sequence++;\n }\n }\n\n $count = count($newConfigurables) - count($configurables);\n if ($count > 0) {\n $this->consoleOutput->writeln(\"Created {$count} extra configurables while splitting\");\n $this->log->info(\"Created {$count} extra configurables while splitting\");\n }\n\n return $newConfigurables;\n }",
"protected function normalizeData()\n\t{\n\t\tforeach ($this->data as &$dividing) {\n\t\t\tforeach ($dividing as $groupValueKey => &$values) {\n\t\t\t\t// iterate data one more time to search other group values\n\t\t\t\t$values[$this->valueType] = (float) $values[$this->valueType];\n\t\t\t\tforeach ($values as $valueKey => $value) {\n\t\t\t\t\tforeach ($this->data as &$otherDividing) {\n\t\t\t\t\t\tif (!isset($otherDividing[$groupValueKey][$valueKey])) {\n\t\t\t\t\t\t\t// if record doesn't have this value,\n\t\t\t\t\t\t\t// doesn't have records with picklist value that other records have\n\t\t\t\t\t\t\t// if we doesn't have picklist_id we can't set up color_id (picklist_id)\n\t\t\t\t\t\t\t// for example this could be work_time but current user is just signed (no work time)\n\t\t\t\t\t\t\t// set this as null or 0 (if it is valueType)\n\t\t\t\t\t\t\t// 0 is for chart data (0 work time),\n\t\t\t\t\t\t\t// null is used to find out missing color (maybe other purpose as well)\n\t\t\t\t\t\t\t// null colors will be replaced in the last stage getChartData when all colors are already set\n\t\t\t\t\t\t\tif ($valueKey !== $this->valueType) {\n\t\t\t\t\t\t\t\t$otherDividing[$groupValueKey][$valueKey] = null;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$otherDividing[$groupValueKey][$valueKey] = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tunset($group, $values);\n\t\t$groupCalculate = $this->groupFieldModel->isCalculateField();\n\t\tksort($this->data, SORT_LOCALE_STRING);\n\t\tforeach ($this->data as &$dividing) {\n\t\t\tif ($groupCalculate) {\n\t\t\t\tksort($dividing, SORT_NUMERIC);\n\t\t\t} else {\n\t\t\t\tksort($dividing, SORT_LOCALE_STRING);\n\t\t\t}\n\t\t\tforeach ($dividing as &$group) {\n\t\t\t\tksort($group);\n\t\t\t}\n\t\t}\n\t}",
"private function mergeData()\n {\n\n $files = $this->files;\n $folders = $this->folders;\n $this->templates = [];\n\n if($this->deletedTemplates) {\n\n if ($folders) {\n foreach ($folders as $item) {\n if ($item->is_dir) {\n $this->templates[] = $item;\n } else {\n $this->folderReferenceFiles[] = $item;\n $this->templates[] = $this->fileFindById($item->reference_id);\n }\n }\n }\n\n } else {\n\n if ($folders) {\n foreach ($folders as $item) {\n if ($item->is_dir) {\n $this->templates[] = $item;\n } else {\n $this->folderReferenceFiles[] = $item;\n }\n }\n }\n\n if($files) {\n foreach($files as $file) {\n $file['parent_id'] = $this->findParentIdByRefId($file->id);\n $file['ancestors'] = $this->getFileAncestors($file->id);\n $this->templates[] = $file;\n }\n }\n }\n\n if(!$this->limit) {\n return $this->templates;\n }\n $this->templates = Paginator::make($this->templates, $this->folders->getTotal(), $this->folders->getPerPage());\n return true;\n }",
"public function mergeConfig();",
"function buildSupplementalData()\n{\n $supplementalDataFile = LOCAL_VCS_DIR . str_replace(\"/\", DIRECTORY_SEPARATOR, \"/supplemental/supplementalData.xml\");\n $supplementalMetaDataFile = LOCAL_VCS_DIR . str_replace(\"/\", DIRECTORY_SEPARATOR, \"/supplemental/supplementalMetadata.xml\");\n $numberingSystemsDataFile = LOCAL_VCS_DIR . str_replace(\"/\", DIRECTORY_SEPARATOR, \"/supplemental/numberingSystems.xml\");\n $likelySubtagsDataFile = LOCAL_VCS_DIR . str_replace(\"/\", DIRECTORY_SEPARATOR, \"/supplemental/likelySubtags.xml\");\n\n $dataHandlers = [\n 'supplemental' => [\n $supplementalDataFile => [\n 'handleGeneralCurrencyData',\n 'handleGeneralTerritoryInfoData',\n 'handleGeneralTerritoryContainmentData',\n 'handleGeneralTerritoryMapping',\n 'handleGeneralCurrencyMapping',\n 'handleGeneralParentLocales'\n ],\n $supplementalMetaDataFile => [\n 'handleLanguageAlias',\n 'handleTerritoryAlias',\n ]\n ],\n 'likelySubtags' => [\n $likelySubtagsDataFile => [\n 'handleLikelySubtagsData'\n ]\n ],\n 'numeric' => [\n $numberingSystemsDataFile => [\n 'handleNumberingSystemsData'\n ]\n ]\n ];\n\n foreach ($dataHandlers as $dataCategory => $handlersPerFile) {\n if ($handlersPerFile) {\n echo \"Building $dataCategory data... \\n\";\n\n foreach ($handlersPerFile as $fileName => $handlers) {\n processDataFileWithHandlers($fileName, $handlers);\n }\n\n echo ucfirst($dataCategory) . \" data was built. \\n \\n\";\n }\n }\n}",
"public function collect()\n {\n //Setting servers\n $this->collectedServers = $this->localConf['Environments'];\n\n if ($this->doLog) {\n echo \"\\n\";\n echo \"Now extracting environments:\";\n echo \"\\n\";\n echo \"\\n\";\n }\n\n foreach (new DirectoryIterator($this->reposDir) as $fileInfo) {\n if($fileInfo->isDir() && !$fileInfo->isDot()) {\n //echo $fileInfo->getFilename() . ' (' . $fileInfo->getPathname() . \")\\n\";\n\n if ($this->subDirMode) {\n foreach (new DirectoryIterator($fileInfo->getPathname()) as $fileInfo) {\n if ($fileInfo->isDir() && !$fileInfo->isDot()) {\n //echo ' ' . $fileInfo->getFilename() . \"\\n\";\n $this->extractEnvironments($fileInfo->getPathname());\n }\n }\n } else {\n $this->extractEnvironments($fileInfo->getPathname());\n }\n }\n }\n }",
"protected function _prepareCollection()\n {\n $websites = Mage::app()->getWebsites();\n $allgroups = Mage::app()->getGroups();\n $resourceTransaction = Mage::getModel('core/resource_transaction');\n \n $websiteConfigCollection = Mage::getModel(Constants::WS_CONFIG_TBL)\n ->getCollection()\n ->loadAllWebsiteConfig();\n \n $storeConfigCollection = Mage::getModel(Constants::WS_CONFIG_TBL)\n ->getCollection()\n ->loadAllStoreConfig();\n \n $websiteIDs = array();\n foreach ($websiteConfigCollection as $config) {\n array_push($websiteIDs, $config->getWebsiteId()); \n }\n \n foreach ($websites as $website) {\n $found = in_array($website->getId(), $websiteIDs); \n \n if (!$found) {\n $row = Mage::getModel(Constants::WS_CONFIG_TBL);\n $row->setData(\n array(\n 'website_id' => $website->getId(),\n 'store_id' => 0,\n 'is_enable_calc' => Constants::USE_GLOBAL_SETTINGS,\n 'use_business_unit' => Constants::YES,\n 'business_unit' => '',\n 'use_default_address' => Constants::YES,\n 'street_address1' => null,\n 'street_address2' => null,\n 'city' => null,\n 'country' => null,\n 'state_province' => null,\n 'zip_postal' => null\n )\n );\n $resourceTransaction->addObject($row);\n WoltersKluwer_CchSureTax_Helper_Utility::logMessage(\n 'Saving Default Website Configuration for website : ' .\n $website->getName(),\n Zend_Log::DEBUG\n ); \n } \n }\n \n $groupIDs = array();\n foreach ($storeConfigCollection as $config) {\n array_push($groupIDs, $config->getStoreId()); \n }\n \n foreach ($allgroups as $group) {\n $found = in_array($group->getId(), $groupIDs); \n if (!$found) {\n $row = Mage::getModel(Constants::WS_CONFIG_TBL);\n $row->setData(\n array(\n 'website_id' => $group->getWebsiteId(),\n 'store_id' => $group->getId(),\n 'is_enable_calc' => Constants::USE_WEBSITE_SETTINGS,\n 'use_business_unit' => Constants::YES,\n 'business_unit' => '',\n 'use_default_address' => Constants::YES,\n 'street_address1' => null,\n 'street_address2' => null,\n 'city' => null,\n 'country' => null,\n 'state_province' => null,\n 'zip_postal' => null\n )\n );\n $resourceTransaction->addObject($row);\n WoltersKluwer_CchSureTax_Helper_Utility::logMessage(\n 'Saving Default Store Configuration for Store : ' .\n $group->getName(),\n Zend_Log::DEBUG\n );\n }\n } \n\n $resourceTransaction->save();\n \n $collection = Mage::getModel(Constants::WS_CONFIG_TBL)->getCollection();\n\n $collection->joinWebsite()->joinStore();\n\n\n $this->setCollection($collection);\n\n return parent::_prepareCollection();\n }",
"public function testArrayMergeRecursive($data)\n {\n static $iteration = 1;\n\n $merged = ArrayHelper::arrayMergeRecursive($data[0], $data[1], $data[2]);\n $name = 'expectedArrayRecursive' . $iteration;\n $expected = $this->$name();\n\n $this->assertEquals($expected, $merged);\n $iteration++;\n }",
"private function parseCustomizations($data){\r\n\t\t$customizations = array();\r\n\r\n\t\t/* OFFER CUSTOMIZATIONS */\r\n\t\tif($data['PRIMARY']){\r\n\t\t\tforeach ($data['PRIMARY'] as $offerType => $offers) {\r\n\t\t\t\t$sub = isset($data['SUB'][$offerType]) ? $data['SUB'][$offerType] : false;\r\n\t\t\t\t$type = $offerType;\r\n\t\t\t\tif($type=='DSL'){\r\n\t\t\t\t\t$type = 'INTERNET';\r\n\t\t\t\t}\r\n\t\t\t\tif($type=='ACCESS'){\r\n\t\t\t\t\t$type = 'VOIP';\r\n\t\t\t\t}\r\n\t\t\t\tforeach($offers as $key => $val){\r\n\t\t\t\t\t$customizations[$type][] = array(\r\n\t\t\t\t\t\t'customization_combination_id' \t=> $val['combination_id'],\r\n\t\t\t\t\t\t'customization_component_id' \t=> $val['component_id'],\r\n\t\t\t\t\t\t'customization_id' \t\t\t\t=> $val['customization_id'],\r\n\t\t\t\t\t\t'customization_code' \t\t\t=> $val['CustomizationCode'],\r\n\t\t\t\t\t\t'customization_group' \t\t\t=> $val['GroupName'],\r\n\t\t\t\t\t\t'customization_type'\t\t\t=> $val['CustomizationType'],\r\n\t\t\t\t\t\t'customization_required'\t\t=> $val['required'],\r\n\t\t\t\t\t\t'customization_name'\t\t\t=> $val['Name'],\r\n\t\t\t\t\t\t'customization_short'\t\t\t=> $val['ShortDescription'],\r\n\t\t\t\t\t\t'customization_long'\t\t\t=> $val['LongDescription'],\r\n\t\t\t\t\t\t'customization_choice_id'\t\t=> $val['choice_id'],\r\n\t\t\t\t\t\t'customization_select_choice'\t=> $val['selectChoice'],\r\n\t\t\t\t\t\t'customization_answer'\t\t\t=> $val['answer'],\r\n\t\t\t\t\t\t'customization_choices_array'\t=> $this->getCustomizationChoices($val['customization_id'], $sub)\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $customizations;\r\n\t}",
"function mergeConfig(&$themeConfig, &$dimensions){\n global $cl_config;\n $themeConfig[\"candidates\"] = [\"barOnly\"=>[], \"barStack\"=>[]];\n $tsvDims = $themeConfig[\"tsvDims\"];\n foreach($dimensions as $cl_name => $cl){\n\n //1. get code list hierarchies (inline or pointer or global)\n if(isset($themeConfig[\"mapping\"][\"CL_\".$cl_name])){\n if(is_array($themeConfig[\"mapping\"][\"CL_\".$cl_name])){\n //1a. array = inline configuration\n $dimensions[$cl_name] = array_merge($dimensions[$cl_name], $themeConfig[\"mapping\"][\"CL_\".$cl_name]);\n } else {\n //1b. string = for lookup in $cl_config\n $clVersion = \"CL_\".$cl_name.\":\".$themeConfig[\"mapping\"][\"CL_\".$cl_name];\n //foreach($cl_config[$clVersion] as $attribute=>$value) $dimensions[$cl_name][$attribute] = $value;\n $dimensions[$cl_name] = array_merge($dimensions[$cl_name], $cl_config[$clVersion]); //should copy structure\n }\n } elseif(isset($cl_config[\"CL_\".$cl_name])){ //3. else check for generic cl_config\n //foreach($cl_config[$cl_name] as $attribute=>$value) $dimensions[$cl_name][$attribute] = $value;\n $dimensions[$cl_name] = array_merge($dimensions[$cl_name], $cl_config[\"CL_\".$cl_name]);\n }\n if(isset($dimensions[$cl_name][\"renames\"])) $dimensions[$cl_name][\"allCodes\"] = array_merge($dimensions[$cl_name][\"allCodes\"], $dimensions[$cl_name][\"renames\"]);\n /* \"rootCode\" vs. \"hierarchy\"? Either are valid ways to describe codeList structure in the config file\n >> \"rootCode\" is simpler, required a single code value. May be used in combination with a ex(clude) array for excluding\n >> \"hierarchy\" allow more complex description and is definitive (excludes are ignored)\n\n */\n //check for rootCode if not already defined in (1) hierarchy or (2) as TOTAL code\n if(!isset($dimensions[$cl_name][\"rootCode\"])){\n if(isset($dimensions[$cl_name][\"hierarchy\"]) && count($dimensions[$cl_name][\"hierarchy\"])==1){\n foreach($dimensions[$cl_name][\"hierarchy\"] as $rootCode => $h2){ //just want the key = root code\n $dimensions[$cl_name][\"rootCode\"] = $rootCode;\n }\n } elseif(array_key_exists (\"TOTAL\",$dimensions[$cl_name][\"allCodes\"])) {\n $dimensions[$cl_name][\"rootCode\"] = \"TOTAL\";\n }\n }\n //name DNE, create\n if(!isset($dimensions[$cl_name][\"name\"])) $dimensions[$cl_name][\"name\"] = strtolower($cl_name);\n\n //if $rootCode DNE create as null\n if(!isset($dimensions[$cl_name][\"rootCode\"])) $dimensions[$cl_name][\"rootCode\"] = null;\n\n //make hierarchy if DNE\n if(!isset($dimensions[$cl_name][\"hierarchy\"])){\n if($dimensions[$cl_name][\"rootCode\"]){\n $dimensions[$cl_name][\"hierarchy\"] = [$dimensions[$cl_name][\"rootCode\"] => [] ];\n\n $list =& $dimensions[$cl_name][\"hierarchy\"][$dimensions[$cl_name][\"rootCode\"]];\n } else {\n $dimensions[$cl_name][\"hierarchy\"] = [];\n $list =& $dimensions[$cl_name][\"hierarchy\"];\n }\n foreach($dimensions[$cl_name][\"allCodes\"] as $code=>$value){\n if(!(isset($dimensions[$cl_name][\"ex\"])&&in_array($code, $dimensions[$cl_name][\"ex\"]) || $dimensions[$cl_name][\"rootCode\"]==$code)){\n array_push($list, $code);\n }\n }\n }\n //is this dimension a bar or a stack candidate?\n if(in_array($cl_name, $tsvDims) && $cl_name!=\"TIME\" && $cl_name!=\"GEO\" && $cl_name!=\"SEX\"){ //lots of weird unused code lists in the DSD: don't process these or the time or geography dimensions; sex dimension handled below\n $index = array_search($cl_name, $tsvDims);\n if($themeConfig[\"unitIndex\"]!==$index){ //\n if($dimensions[$cl_name][\"rootCode\"]!==null){\n if(count($dimensions[$cl_name][\"hierarchy\"][$dimensions[$cl_name][\"rootCode\"]])>1) array_push($themeConfig[\"candidates\"][\"barStack\"], $cl_name);\n } else {\n if(count($dimensions[$cl_name][\"hierarchy\"])>4) array_push($themeConfig[\"candidates\"][\"barOnly\"], $cl_name);\n }\n }\n }\n }\n\n //set SEX related flags\n if(in_array(\"SEX\", $tsvDims)){\n $themeConfig[\"sexTotal\"] = isset($dimensions[\"SEX\"][\"allCodes\"][\"T\"]);\n $themeConfig[\"sexMF\"] = isset($dimensions[\"SEX\"][\"allCodes\"][\"M\"]) && isset($dimensions[\"SEX\"][\"allCodes\"][\"F\"]);\n } else {\n $themeConfig[\"sexTotal\"] = false;\n $themeConfig[\"sexMF\"] = false;\n }\n\n //determine cubable\n if(count($themeConfig[\"candidates\"][\"barOnly\"])+count($themeConfig[\"candidates\"][\"barStack\"])==0 && !$themeConfig[\"sexMF\"]) {\n $themeConfig[\"cubable\"] = false; //overrides if user set to true\n } else {\n if(!isset($themeConfig[\"cubable\"])) $themeConfig[\"cubable\"] = true; //do not overide if user has set to false\n }\n $themeConfig[\"dimDefs\"] = [];\n $themeConfig[\"cubes\"] = [];\n}",
"protected function _prepareData(&$data)\n {\n $base = array(\n 'blog' => $this->_config['blog'],\n 'user_ip' => $this->_request->server('REMOTE_ADDR'),\n 'user_agent' => $this->_request->http('user_agent'),\n 'referrer' => $this->_request->http('referer'),\n 'permalink' => null,\n 'comment_type' => null,\n 'comment_author' => null,\n 'comment_author_email' => null,\n 'comment_author_url' => null,\n 'comment_content' => null,\n );\n \n // merge the base info, data overrides, and the server info\n $data = array_merge($base, $data, $this->_request->server());\n }",
"private function load_data($data_dir) {\r\r\r\r $data_files = array();\r\r $format = \"/([0-9a-z\\\\-_]+)\\\\.(json|csv)$/i\";\r\r\r\r //see if there's a folder for partial data relating to this page or layout\r //if so iterate all json/csv files and load the data\r\r $partial_data_folder = \"{$data_dir}/{$this->type}s/partials/{$this->name}\";\r\r $stats = null;\r\r if (is_dir($partial_data_folder)) {\r\r $files = scandir($partial_data_folder);\r\r foreach ($files as $name) {\r\r if ($name == '.' OR $name == '..')\r continue;\r\r\r\r if (!preg_match($format, $name, $filename))\r continue;\r\r $data_files[$filename[1]] = \"{$partial_data_folder}/{$name}\";\r }\r }\r\r\r\r\r\r foreach ($data_files as $var_name => $var_value) {\r\r $new_data = '';\r\r if (preg_match(\"/\\.json$/i\", $data_files[$var_name])) {\r\r $new_data = json_decode(file_get_contents($data_files[$var_name]), TRUE);\r } else if (preg_match(\"/\\.csv$/i\", $data_files[$var_name])) {\r\r //load csv data into an array\r\r $new_data = CSV::to_array($data_files[$var_name]);\r\r foreach ($new_data as &$data)\r if (isset($data['status']))\r $data[$data['status']] = true;\r }\r\r\r\r $this->vars[str_replace('.', '_', $var_name)] = $new_data;\r\r //here we replace '.' with '_' in variable names, so template compiler can recognize it as a variable not an object\r //for example change sidebar.navList to sidebar_navList , because sidebar is not an object\r }\r\r\r\r return true;\r }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
CREATE AND UPDATE Method to save new poster to the db, and save poster image to the uploads directory. | public function save (Request $request) {
$posterId = \request ('posterId');
if ( !$posterId) {
$poster = new Poster ();
}
else {
// Retrieve poster from db
$poster = Poster::where ('id', '=', $posterId)->first ();
// Delete old image file from storage
$oldFilename = $poster->filename;
$oldFilePath = 'uploads/'.$oldFilename;
if (File::exists ($oldFilePath)) {
File::delete ($oldFilePath);
}
}
$author = \request ('author');
$quote = \request ('quote');
$text_overlay = \request ('text_overlay') || 0;
$background_id = \request ('background_id');
$design = \request ('design');
// Construct filename
$filename = $this->setFilename ($author, $quote,
$text_overlay,
$background_id);
// Store base64 image file
$imageBase64 = \request ('file');
// Extract the image base64 data by exploding the file (This
// looks like JS destructuring!!)
// There is only one ; and one , in the encoded file so we can do
list($type, $data) = explode (';', $imageBase64);
list(, $base64) = explode (',', $data);
// Then decode the file
$decodedImage = base64_decode ($base64);
// This will open/create a filename, write image on to filename,
// then close it.
// SEE https://www.php.net/manual/en/function.file-put-contents.php
file_put_contents ('uploads/'.$filename, $decodedImage);
// Trying to save posters to AWS S3;
/* $s3 = Storage::disk ('s3');
$filePath = '/user_posters/'.$filename;
$s3->put ($filePath, file_get_contents ($imageBase64), 'public');*/
// Query for the background to associate to the poster
$background = Background::where ('id', '=', $background_id)->first ();
$user_id = Auth::id ();
$user = User::where ('id', '=', $user_id)->first ();
$poster->author = $author;
$poster->quote = $quote;
$poster->text_overlay = $text_overlay;
$poster->background ()->associate ($background);
$poster->design = $design;
$poster->user ()->associate ($user);
$poster->filename = $filename;
// Save new poster
$poster->save ();
return redirect ()->route ('home');
} | [
"public function save() {\n\t\t/* Uploading image section */\n\t\t$directory = \"images/\";\n\t\t$uploadFile = $directory . time() . $this->image['name'];\n\t if (move_uploaded_file($this->image[\"tmp_name\"], $uploadFile)) {\n\t $this->image = $uploadFile;\n\t } else {\n\t echo \"Sorry, there was an error uploading your file.\";\n\t }\n\t\t/* DB operations section */\n\t\t$db = DBConnection::getInstance();\n\t\t$connection = $db->getConnection();\n\t\t//we use prepared statements to prevent SQL injections\n\t\t$statement = $connection->prepare(\"INSERT INTO posts (name, surname, email, message, image_path) VALUES (?, ?, ?, ?, ?)\");\n\t\t$statement->bind_param(\"sssss\", $st_name, $st_surname, $st_email, $st_message, $st_image_path);\n\t\t$st_name = $this->name;\n\t\t$st_surname = $this->surname;\n\t\t$st_email = $this->email;\n\t\t$st_message = $this->message;\n\t\t$st_image_path = $this->image;\n\t\tif ($statement->execute()) {\n\t\t\t//echo \"Success<br>\";\n\t\t}\n\t\telse {\n\t\t\techo \"Failed to save data to database.<br>\";\n\t\t}\n\t\t$statement->close();\n\t\t$connection->close();\n\t}",
"public function saveAttachment()\r\n\t{\r\n\t\t$query = \"INSERT INTO attachments (filename, mimetype, filesize, post_id) VALUES (:filename, :mimetype, :filesize, :post_id)\";\r\n\t\t\r\n\t\t$params[0] = $this->filename;\r\n\t\t$params[1] = $this->mimetype;\r\n\t\t$params[2] = $this->filesize;\r\n\t\t$params[3] = $this->post_id;\r\n\t\t\r\n\t\t$paramNames[0] = \":filename\";\r\n\t\t$paramNames[1] = \":mimetype\";\r\n\t\t$paramNames[2] = \":filesize\";\r\n\t\t$paramNames[3] = \":post_id\";\r\n\t\t\r\n\t\t$this->dbaccess->prepared_insert_query($query, $params, $paramNames);\r\n\t}",
"public function savePost()\n {\n $contentContainer = ContentContainer::findRecord($this->guid);\n\n $post = new Post($contentContainer);\n $post->message = $this->message;\n\n if($post->save())\n {\n if(!empty($this->fileList) && is_array($this->fileList))\n {\n foreach($this->fileList as $fileGuid)\n {\n $file = File::findOne(['guid' => $fileGuid]);\n\n if($file)\n {\n $post->fileManager->attach($file);\n }\n }\n }\n }\n }",
"private function create_poster() {\n $this->model->generate_poster();\n // Poster was created successfully //\n if ($this->model->get_result()) {\n // Assign template variables //\n $download_location = 'index.php?imageserve&im=' . $this->model->get_name();\n $this->view->compose_template_late($this->template['success']);\n $this->view->assign('dest', $this->model->get_destination());\n $this->view->assign('name', $this->model->get_name());\n $this->view->assign('button_query', $download_location);\n return TRUE;\n }\n // Creation failed, log entry //\n log_message($this->log, __METHOD__, 'Could not create poster from source: ' . $this->model->get_name());\n // Poster did not get created, send to error page instead //\n $this->view->compose_template_late($this->template['error']);\n\n return FALSE;\n }",
"public function storeAndSetThumbnail(UploadedFile $thumbnail, Post $post)\n {\n //$thumbnail_name = $thumbnail->store('uploads/posts');\n $image_large = Image::make($thumbnail)->fit(1200, 700);\n $image_medium = Image::make($thumbnail)->fit(435, 250);\n $image_small = Image::make($thumbnail)->fit(140, 90);\n $fb_feature = Image::make($thumbnail)->fit(600, 315);\n $ext = $thumbnail->getClientOriginalExtension();\n $path = storage_path('app/public/uploads/posts/' . $post->id . '/');\n $file_name = str_random(50) . '.' . $ext;\n if (!file_exists($path)) {\n mkdir($path, 0777, true);\n }\n if (!$this->hasThumbnail()) {\n $media = $this->media()->create([\n 'filename' => $file_name,\n 'original_filename' => $thumbnail->getClientOriginalName(),\n 'mime_type' => $thumbnail->getMimeType()\n ]);\n $image_large->save($path . 'large_' . $file_name, 50);\n $image_medium->save($path . 'medium_' . $file_name, 50);\n $image_small->save($path . 'small_' . $file_name, 50);\n $fb_feature->save($path . 'feature_' . $file_name, 40);\n $this->update(['thumbnail_id' => $media->id]);\n } else {\n $name = $this->media->first()->filename;\n $old_path = [\n 'public/uploads/posts/' . $post->id . '/' . 'large_' . $name,\n 'public/uploads/posts/' . $post->id . '/' . 'medium_' . $name,\n 'public/uploads/posts/' . $post->id . '/' . 'small_' . $name,\n 'public/uploads/posts/' . $post->id . '/' . 'feature_' . $name\n ];\n if (File::exists(storage_path('app/public/uploads/posts'))) {\n Storage::delete($old_path);\n }\n $this->media->first()->update([\n 'filename' => $file_name,\n 'original_filename' => $thumbnail->getClientOriginalName(),\n 'mime_type' => $thumbnail->getMimeType()\n ]);\n $image_large->save($path . 'large_' . $file_name, 50);\n $image_medium->save($path . 'medium_' . $file_name, 50);\n $image_small->save($path . 'small_' . $file_name, 50);\n $fb_feature->save($path . 'feature_' . $file_name, 40);\n }\n return $thumbnail;\n }",
"protected function updateAndPersistBlog() {}",
"public function saveAction()\n {\n\n if (!$this->request->isPost()) {\n $this->dispatcher->forward([\n 'controller' => \"memberImage\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $id = $this->request->getPost(\"id\");\n $memberImage = Memberimage::findFirstByid($id);\n\n if (!$memberImage) {\n $this->flash->error(\"memberImage does not exist \" . $id);\n\n $this->dispatcher->forward([\n 'controller' => \"memberImage\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $memberImage->setmemberid($this->request->getPost(\"memberid\"));\n $memberImage->setdescription($this->request->getPost(\"description\"));\n $memberImage->setimagefile($this->request->getPost(\"imagefile\"));\n \n\n if (!$memberImage->save()) {\n\n foreach ($memberImage->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n $this->dispatcher->forward([\n 'controller' => \"memberImage\",\n 'action' => 'edit',\n 'params' => [$memberImage->getId()]\n ]);\n\n return;\n }\n\n $this->flash->success(\"memberImage was updated successfully\");\n\n $this->dispatcher->forward([\n 'controller' => \"memberImage\",\n 'action' => 'index'\n ]);\n }",
"public function save()\n {\n $image = $this->realEntity->addImage($this->makeimage()); // add image \n\n $this->file->storeAs($this->realEntity->slug . '/', $image->name, 'dropbox'); // move to directory \n\n $client = new DropboxClient(config('filesystems.disks.dropbox.token'));\n \n $imageData = $client->getMetadata($this->realEntity->slug . '/' . $image->name); \n \n $image->update(['dropbox_id' => $imageData['id']]); \n\n }",
"public function update_image()\n {\n $image = $this->pluploadlib_new->process_upload();\n $out = array(\n 'url' => config_item('upload_url') . '/' . $image,\n 'image_name' => $image\n );\n\n $data = new stdClass();\n\n $img_link = X_TEACHER_UPLOAD_PATH . DIRECTORY_SEPARATOR. trim($image);\n $fp = fopen($img_link,'r');\n\n $data->avatar = base64_encode(fread($fp,filesize($img_link)));\n $this->teacher_model->save($data, TeacherHelper::getUserId());\n\n fclose($fp);\n\n $this->output->set_output($image);\n\n }",
"function gallery_save()\n{\n // If we have really received form data\n if (isset($_POST)) {\n\n /*@var \\samson\\activerecord\\gallery $dbItem */\n $dbItem = null;\n\n // Clear received variable\n $id = isset($_POST['id']) ? filter_var($_POST['id']) : null;\n\n /*\n * Try to recieve one first record from DB by identifier,\n * in case of success store record into $dbItem variable,\n * otherwise create new gallery item\n */\n\n\n if (!dbQuery('gallery')->id($id)->first($dbItem)) {\n // Create new instance but without creating a db record\n $dbItem = new \\samson\\activerecord\\gallery(false);\n }\n // At this point we can guarantee that $dbItem is not empty\n\n\n $tmp_name = $_FILES[\"file\"][\"tmp_name\"];\n $name = $_FILES[\"file\"][\"name\"];\n $imgsize = $_FILES[\"file\"][\"size\"]/1024;\n\n\n // Create upload dir with correct rights\n if (!file_exists('upload')) {\n mkdir('upload', 0775);\n }\n\n $src = 'upload/'.$name;\n\n // If file has been created\n if (move_uploaded_file($tmp_name, $src)) {\n // Save image name\n $dbItem->name = filter_var($_POST['name']);\n // Save image description\n $dbItem->description = filter_var($_POST['description']);\n // Store file in upload dir\n $dbItem->src = $src;\n $dbItem->imgsize = $imgsize;\n $dbItem->save();\n } elseif (isset($id)){\n $dbItem->name = filter_var($_POST['name']);\n $dbItem->description = filter_var($_POST['description']);\n $dbItem->save();\n }\n }\n // Redirect to main page\n url()->redirect('gallery');\n}",
"public function savePost()\n {\n if ($this->hasTrappId()) {\n $this->updateTrappRevision();\n } else {\n $this->createTrappRevision();\n }\n }",
"public function saveImageAction()\n {\n Pi::service('log')->mute();\n\n $return = ['status' => false];\n\n $id = $this->params('id', 0);\n if (empty($id)) {\n $id = $this->params('fake_id', 0);\n }\n if (empty($id)) {\n $return['message'] = _a('Invalid ID!');\n echo json_encode($return);\n exit;\n }\n\n $uploadFakeId = $this->params('upload_id', 0);\n if (empty($uploadFakeId)) {\n $return['message'] = _a('Invalid image fake ID!');\n echo json_encode($return);\n exit;\n }\n\n $module = $this->getModule();\n $session = Media::getUploadSession($module, 'author');\n $image = $session->$uploadFakeId;\n if (empty($image['tmp_name'])\n or !file_exists(Pi::path($image['tmp_name']))\n ) {\n $return['message'] = _a('Image is not exists!');\n echo json_encode($return);\n exit;\n }\n $sourceName = $image['tmp_name'];\n\n $ext = strtolower(pathinfo($sourceName, PATHINFO_EXTENSION));\n $fileName = dirname($sourceName) . '/' . $id . '.' . $ext;\n\n $width = $this->params('w', 0);\n $height = $this->params('h', 0);\n $x = $this->params('x', 0);\n $y = $this->params('y', 0);\n if (empty($width) or empty($height)) {\n $return['message'] = _a('Image width or height is needed');\n echo json_encode($return);\n exit;\n }\n\n // Crop and resize avatar\n Pi::image()->crop(\n Pi::path($sourceName),\n [$x, $y],\n [$width, $height],\n Pi::path($fileName)\n );\n Pi::image()->resize(\n Pi::path($fileName),\n [$this->config('author_size'), $this->config('author_size')]\n );\n\n // Scale image\n $uploadInfo = [];\n $uploadInfo['tmp_name'] = $fileName;\n $uploadInfo['w'] = $this->config('author_size');\n $uploadInfo['h'] = $this->config('author_size');\n\n Media::saveImage($uploadInfo);\n\n $rowAuthor = $this->getModel('author')->find($id);\n if ($rowAuthor) {\n if ($rowAuthor->photo && $rowAuthor->photo != $fileName) {\n @unlink(Pi::path($rowAuthor->photo));\n }\n\n $rowAuthor->photo = $fileName;\n $rowAuthor->save();\n } else {\n // Or save info to session\n $session = Media::getUploadSession($module, 'author');\n $session->$id = $uploadInfo;\n }\n\n $imageSize = getimagesize(Pi::path($fileName));\n\n @unlink(Pi::path($sourceName));\n\n // Prepare return data\n $return['data'] = [\n 'size' => filesize(Pi::path($fileName)),\n 'w' => $imageSize['0'],\n 'h' => $imageSize['1'],\n 'preview_url' => Pi::url($fileName),\n 'filename' => $fileName,\n ];\n\n $return['status'] = true;\n echo json_encode($return);\n exit();\n }",
"public function save($key = null) {\n\t\t$new = !$this->loaded() && !$key;\n\n\t\tif ($new) {\n\t\t\tif (!$this->file || !Upload::not_empty($this->file)) {\n\t\t\t\tthrow new Kohana_Exception(__('No image'));\n\t\t\t} else if (!Upload::size($this->file, Kohana::config('image.filesize'))) {\n\t\t\t\tthrow new Kohana_Exception(__('Image too big (limit :size)', array(':size' => Kohana::config('image.filesize'))));\n\t\t\t} else if (!Upload::type($this->file, Kohana::config('image.filetypes'))) {\n\t\t\t\tthrow new Kohana_Exception(__('Invalid image type (use :types)', array(':types' => implode(', ', Kohana::config('image.filetypes')))));\n\t\t\t}\n\t\t}\n\n\t\tparent::save($key);\n\n\t\t// Some magic on created images only\n\t\tif ($new) {\n\n\t\t\t// Make sure we have the new target directory\n\t\t\t$new_path = Kohana::config('image.path') . URL::id($this->id);\n\t\t\tif (!is_dir($new_path)) {\n\t\t\t\tmkdir($new_path, 0777, true);\n\t\t\t\tchmod($new_path, 0777);\n\t\t\t}\n\t\t\tif (is_writable($new_path)) {\n\t\t\t\t$new_path = rtrim($new_path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;\n\t\t\t} else {\n\t\t\t\tthrow new Kohana_Exception(get_class($this) . ' can not write to directory');\n\t\t\t}\n\n\t\t\t// New file name with some random postfix for hard to guess filenames\n\t\t\t!$this->postfix and $this->postfix = Text::random('alnum', 8);\n\t\t\t$new_file = $this->id . '_' . $this->postfix . Kohana::config('image.postfix_original') . '.jpg';\n\n\t\t\t// Rename and move to correct directory using image id\n\t\t\t$old_path = Kohana::config('image.upload_path');\n\t\t\t$old_file = $this->file;\n\t\t\tif (!rename($old_path . $old_file, $new_path . $new_file)) {\n\t\t\t\tthrow new Kohana_Exception(get_class($this) . ' could not move uploaded image');\n\t\t\t}\n\t\t\t$this->file = $new_file;\n\n\t\t\t// Start creating images\n\t\t\t$this->_generate_images($new_path . $new_file);\n\n\t\t\tparent::save();\n\t\t}\n\n\t\treturn $this;\n\t}",
"public function uploadAvatar()\n {\n\n $userId = $this->getUserId();\n\n $conn = Db::getConnection();\n $statement = $conn->prepare(\"update Users set profileImage=:avatar where id = :id \");\n $statement->bindValue(':avatar', $this->avatar);\n $statement->bindValue(':id', $userId);\n $statement->execute();\n }",
"function save($destImagePath);",
"public function save_preview() {\n\n\t\t$id = $_POST['id'];\n\t\t$post = $_POST['post'];\n\t\t$hash = $_POST['hash'];\n\t\t$data = $_POST['data'];\n\n\t\t$w = $_POST['w'];\n\t\t$h = $_POST['h'];\n\n\t\tCortexPreview::save_preview($id, $post, $hash, $data, array($w, $h));\n\n\t\texit;\n\t}",
"function saveNew()\n\t{\n\t\tglobal $sql;\n\t\t$title = sql::Escape($this->title);\n\t\t$originalname = sql::Escape($this->originalname);\n\t\t$context = sql::Escape($this->context);\n\t\t$path = sql::Escape($this->path);\n\t\t$thumbnail = sql::Escape($this->thumbnail);\n\t\t$square = sql::Escape($this->square);\n\t\t$small = sql::Escape($this->small);\n\t\t$medium = sql::Escape($this->medium);\n\t\t$large = sql::Escape($this->large);\n\t\t$comment = sql::Escape($this->comment);\n\n\t\t$sql->Query(\"INSERT INTO $this->tablename SET\n\t\t\t\t\ttitle = '$title',\n\t\t\t\t\toriginalname = '$originalname',\n\t\t\t\t\tcontext = '$context',\n\t\t\t\t\tpath = '$path',\n\t\t\t\t\tthumbnail = '$thumbnail',\n\t\t\t\t\tsquare = '$square',\n\t\t\t\t\tsmall = '$small',\n\t\t\t\t\tmedium = '$medium',\n\t\t\t\t\tlarge = '$large',\n\t\t\t\t\tcomment = '$comment',\n\t\t\t\t\tuploaddate = NOW()\n\t\t\t\t\t\");\n\t\t$this->id=$sql->GetLastId();\n\t}",
"public function save()\n {\n try {\n $stm = Db::instanceGet()->prepare('\n INSERT INTO photo(id, album_id, url) \n VALUES(:id, :album_id, :url) \n ON DUPLICATE KEY UPDATE \n album_id=VALUES(album_id),\n url=VALUES(url)\n ');\n\n $stm->execute([\n 'id' => $this->photo_id,\n 'album_id' => $this->album_id,\n 'url' => $this->photo_url\n ]);\n } catch (\\PDOException $e) {\n throw new ImportException('Error while importing photos to database');\n }\n }",
"function store()\n {\n initiateSession();\n $this->set(\"title\",\"Image Upload\");\n if(!isset($_SESSION['user_id']))\n {\n $this->set(\"message\",\"User is not logged in\");\n return;\n }\n $img=new Image($_FILES['content_image']);\n if($img->validate()==false)\n {\n $this->set(\"message\",\"Not an valid image file\");\n }\n else\n {\n $img->setUploadPath(ROOT.DS.'public'.DS.'uploads'.DS.'users');\n if(isset($_POST['content_caption']))\n {\n $caption=sqlSafe($_POST['content_caption']);\n }\n else\n {\n $caption=null;\n }\n $author=sqlSafe($_SESSION['user_username']);\n $date=date(\"Y-m-d H:i:s\");\n $img->moveUploadedImage();\n $path=$img->getUploadLocation();\n if($this->Picture->insertPicture($path,$caption,$author,$date))\n {\n $this->set(\"message\",\"Upload successful\");\n }\n else\n {\n $this->set(\"message\",\"Upload failed\");\n }\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TODO: Implement onAttach() method. | public function onAttach()
{
} | [
"public function attach()\n {\n $this->attached = true;\n }",
"public function attach()\n {\n // dummy implementation\n }",
"public function onDetach()\n {\n }",
"public function attach()\n\t{\n\t\t\\Model\\Registry::getInstance()->register($this);\n\t}",
"public function onAttach(IEntity $entity): void;",
"static function onAttach( &$node, &$query )\n {\n }",
"public function attach($object): void;",
"public function attach() {\n\t\t$this->createRemoteObject( array( $this->hostWindow ) );\n\t\t$this->insertElement();\n\t}",
"public function Attach(&$entity)\n {\n \n }",
"public function attachUser() {\n }",
"public function attach($component)\n\t{\n\t}",
"public function attach($observer)\n\t{\n\t}",
"public function after_construct() {}",
"public function testAttachListener1()\n {\n // the right object\n $l = new Listener();\n $this->object->attachListener($l);\n }",
"protected function onLoaded()\r\n\t{\r\n\t\t\r\n\t}",
"public abstract function attach(Observer $observer);",
"public function onAfterInitialise()\n\t{\n\t}",
"function MailAttach() {\n\n $this->parts = array();\n\n $this->to = \"\";\n\n $this->from = \"\";\n\n $this->subject = \"\";\n\n $this->body = \"\";\n\n $this->headers = \"\";\n\n }",
"protected function registerPhandaAttachments()\n {\n static::setInstance($this);\n $this->instance('app', $this);\n $this->instance(Container::class, $this);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generates admin field object $attributes can container: $type type of the field to generate $name name of the field. This will be name of the option in database $default_value $label title of the option $description $options assoc array of option. Used only for select and radiogroup field types $args assoc array of additional parameters. Used for dependency $hidden_property name of option that hides field $hidden_values array of valus of $hidden_property that hides field $parent parent object to which to add field | function gotravel_mikado_add_admin_field($attributes) {
$type = '';
$name = '';
$default_value = '';
$label = '';
$description = '';
$options = array();
$args = array();
$hidden_property = '';
$hidden_values = array();
$parent = '';
extract($attributes);
if(!empty($parent) && !empty($type) && !empty($name)) {
$field = new GoTravelMikadoField($type, $name, $default_value, $label, $description, $options, $args, $hidden_property, $hidden_values);
if(is_object($parent)) {
$parent->addChild($name, $field);
return $field;
}
}
return false;
} | [
"function superfood_elated_add_admin_field($attributes) {\n $type = '';\n $name = '';\n $default_value = '';\n $label = '';\n $description = '';\n $options = array();\n $args = array();\n $hidden_property = '';\n $hidden_values = array();\n $parent = '';\n\n extract($attributes);\n\n if(!empty($parent) && !empty($type) && !empty($name)) {\n $field = new SuperfoodElatedClassField($type, $name, $default_value, $label, $description, $options, $args, $hidden_property, $hidden_values);\n\n if(is_object($parent)) {\n $parent->addChild($name, $field);\n\n return $field;\n }\n }\n\n return false;\n }",
"function libero_mikado_add_admin_field($attributes) {\n $type = '';\n $name = '';\n $default_value = '';\n $label = '';\n $description = '';\n $options = array();\n $args = array();\n $hidden_property = '';\n $hidden_values = array();\n $parent = '';\n\n extract($attributes);\n\n if(!empty($parent) && !empty($type) && !empty($name)) {\n $field = new LiberoField($type, $name, $default_value, $label, $description, $options, $args, $hidden_property, $hidden_values);\n\n if(is_object($parent)) {\n $parent->addChild($name, $field);\n\n return $field;\n }\n }\n\n return false;\n }",
"function bridge_qode_add_admin_field($attributes) {\n $type = '';\n $name = '';\n $default_value = '';\n $label = '';\n $description = '';\n $options = array();\n $args = array();\n $hidden_property = '';\n $hidden_values = array();\n $parent = '';\n\n extract($attributes);\n\n if(!empty($parent) && !empty($type) && !empty($name)) {\n $field = new BridgeQodeField($type, $name, $default_value, $label, $description, $options, $args, $hidden_property, $hidden_values);\n\n if(is_object($parent)) {\n $parent->addChild($name, $field);\n\n return $field;\n }\n }\n\n return false;\n }",
"function fluid_edge_add_admin_field($attributes) {\n $type = '';\n $name = '';\n $default_value = '';\n $label = '';\n $description = '';\n $options = array();\n $args = array();\n $hidden_property = '';\n $hidden_values = array();\n $parent = '';\n\n extract($attributes);\n\n if(!empty($parent) && !empty($type) && !empty($name)) {\n $field = new FluidEdgeClassField($type, $name, $default_value, $label, $description, $options, $args, $hidden_property, $hidden_values);\n\n if(is_object($parent)) {\n $parent->addChild($name, $field);\n\n return $field;\n }\n }\n\n return false;\n }",
"function biagiotti_mikado_add_admin_field( $attributes ) {\n\t\t$type = '';\n\t\t$name = '';\n\t\t$default_value = '';\n\t\t$label = '';\n\t\t$description = '';\n\t\t$options = array();\n\t\t$args = array();\n\t\t$parent = '';\n\t\t$dependency\t\t = array();\n\t\t\n\t\textract( $attributes );\n\n\t\tif ( ! empty( $parent ) && ! empty( $type ) && ! empty( $name ) ) {\n\t\t\t$field = new BiagiottiMikadoClassField( $type, $name, $default_value, $label, $description, $options, $args, $dependency );\n\t\t\t\n\t\t\tif ( is_object( $parent ) ) {\n\t\t\t\t$parent->addChild( $name, $field );\n\t\t\t\t\n\t\t\t\treturn $field;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn false;\n\t}",
"function superfood_elated_add_meta_box_field($attributes) {\n $type = '';\n $name = '';\n $default_value = '';\n $label = '';\n $description = '';\n $options = array();\n $args = array();\n $hidden_property = '';\n $hidden_values = array();\n $parent = '';\n\n extract($attributes);\n\n if(!empty($parent) && !empty($type) && !empty($name)) {\n $field = new SuperfoodElatedClassMetaField($type, $name, $default_value, $label, $description, $options, $args, $hidden_property, $hidden_values);\n\n if(is_object($parent)) {\n $parent->addChild($name, $field);\n\n return $field;\n }\n }\n\n return false;\n }",
"function gotravel_mikado_add_meta_box_field($attributes) {\n\t\t$type = '';\n\t\t$name = '';\n\t\t$default_value = '';\n\t\t$label = '';\n\t\t$description = '';\n\t\t$options = array();\n\t\t$args = array();\n\t\t$hidden_property = '';\n\t\t$hidden_values = array();\n\t\t$parent = '';\n\n\t\textract($attributes);\n\n\t\tif(!empty($parent) && !empty($type) && !empty($name)) {\n\t\t\t$field = new GoTravelMikadoMetaField($type, $name, $default_value, $label, $description, $options, $args, $hidden_property, $hidden_values);\n\n\t\t\tif(is_object($parent)) {\n\t\t\t\t$parent->addChild($name, $field);\n\n\t\t\t\treturn $field;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"function sienna_mikado_add_meta_box_field($attributes) {\n\t\t$type = '';\n\t\t$name = '';\n\t\t$default_value = '';\n\t\t$label = '';\n\t\t$description = '';\n\t\t$options = array();\n\t\t$args = array();\n\t\t$hidden_property = '';\n\t\t$hidden_values = array();\n\t\t$parent = '';\n\n\t\textract($attributes);\n\n\t\tif(!empty($parent) && !empty($type) && !empty($name)) {\n\t\t\t$field = new SiennaMikadoMetaField($type, $name, $default_value, $label, $description, $options, $args, $hidden_property, $hidden_values);\n\n\t\t\tif(is_object($parent)) {\n\t\t\t\t$parent->addChild($name, $field);\n\n\t\t\t\treturn $field;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"function klippe_mikado_add_meta_box_field( $attributes ) {\n\t\t$type = '';\n\t\t$name = '';\n\t\t$default_value = '';\n\t\t$label = '';\n\t\t$description = '';\n\t\t$options = array();\n\t\t$args = array();\n\t\t$dependency\t\t = array();\n\t\t$parent = '';\n\t\t\n\t\textract( $attributes );\n\t\t\n\t\tif ( ! empty( $parent ) && ! empty( $type ) && ! empty( $name ) ) {\n\t\t\t$field = new KlippeMikadoMetaField( $type, $name, $default_value, $label, $description, $options, $args, $dependency );\n\t\t\t\n\t\t\tif ( is_object( $parent ) ) {\n\t\t\t\t$parent->addChild( $name, $field );\n\t\t\t\t\n\t\t\t\treturn $field;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn false;\n\t}",
"function bridge_qode_add_dashboard_field( $attributes ) {\n $type = '';\n $name = '';\n $label = '';\n $description = '';\n $options = array();\n $args = array();\n $value = '';\n $parent = '';\n $repeat = array();\n\n extract( $attributes );\n\n if ( ! empty( $parent ) && ! empty( $name ) ) {\n $field = new BridgeQodeDashboardField( $type, $name, $label, $description, $options, $args, $value, $repeat);\n if ( is_object( $parent ) ) {\n $parent->addChild( $name, $field );\n\n return $field;\n }\n }\n\n return false;\n }",
"public function ajax_create_field() {\n\t\tglobal $wpdb;\n\n\t\t$data = array();\n\t\t$field_options = $field_validation = $parent = $previous = '';\n\n\t\tforeach ( $_REQUEST['data'] as $k ) {\n\t\t\t$data[ $k['name'] ] = $k['value'];\n\t\t}\n\n\t\tcheck_ajax_referer( 'create-field-' . $data['form_id'], 'nonce' );\n\n\t\t$form_id = absint( $data['form_id'] );\n\t\t$field_key = sanitize_title( $_REQUEST['field_type'] );\n\t\t$field_type = strtolower( sanitize_title( $_REQUEST['field_type'] ) );\n\n\t\t$parent = ( isset( $_REQUEST['parent'] ) && $_REQUEST['parent'] > 0 ) ? $_REQUEST['parent'] : 0;\n\t\t$previous = ( isset( $_REQUEST['previous'] ) && $_REQUEST['previous'] > 0 ) ? $_REQUEST['previous'] : 0;\n\n\t\t// If a Page Break, the default name is Next, otherwise use the field type\n\t\t$field_name = ( 'page-break' == $field_type ) ? 'Next' : $_REQUEST['field_type'];\n\n\t\t// Set defaults for validation\n\t\tswitch ( $field_type ) :\n\t\t\tcase 'select' :\n\t\t\tcase 'radio' :\n\t\t\tcase 'checkbox' :\n\t\t\t\t$field_options = serialize( array( 'Option 1', 'Option 2', 'Option 3' ) );\n\t\t\t\tbreak;\n\n\t\t\tcase 'email' :\n\t\t\tcase 'url' :\n\t\t\tcase 'phone' :\n\t\t\t\t$field_validation = $field_type;\n\t\t\t\tbreak;\n\n\t\t\tcase 'currency' :\n\t\t\t\t$field_validation = 'number';\n\t\t\t\tbreak;\n\n\t\t\tcase 'number' :\n\t\t\t\t$field_validation = 'digits';\n\t\t\t\tbreak;\n\n\t\t\tcase 'min' :\n\t\t\tcase 'max' :\n\t\t\t\t$field_validation = 'digits';\n\t\t\t\t$field_options = serialize( array( '10' ) );\n\t\t\t\tbreak;\n\n\t\t\tcase 'range' :\n\t\t\t\t$field_validation = 'digits';\n\t\t\t\t$field_options = serialize( array( '1', '10' ) );\n\t\t\t\tbreak;\n\n\t\t\tcase 'time' :\n\t\t\t\t$field_validation = 'time-12';\n\t\t\t\tbreak;\n\n\t\t\tcase 'file-upload' :\n\t\t\t\t$field_options = serialize( array( 'png|jpe?g|gif' ) );\n\t\t\t\tbreak;\n\n\t\t\tcase 'ip-address' :\n\t\t\t\t$field_validation = 'ipv6';\n\t\t\t\tbreak;\n\n\t\t\tcase 'hidden' :\n\t\t\tcase 'custom-field' :\n\t\t\t\t$field_options = serialize( array( '' ) );\n\t\t\t\tbreak;\n\n\t\t\tcase 'autocomplete' :\n\t\t\t\t$field_validation = 'auto';\n\t\t\t\t$field_options = serialize( array( 'Option 1', 'Option 2', 'Option 3' ) );\n\t\t\t\tbreak;\n\n\t\t\tcase 'name' :\n\t\t\t\t$field_options = serialize( array( 'normal' ) );\n\t\t\t\tbreak;\n\n\t\t\tcase 'date' :\n\t\t\t\t$field_options = serialize( array( 'dateFormat' => 'mm/dd/yy' ) );\n\t\t\t\tbreak;\n\n\t\t\tcase 'rating' :\n\t\t\t\t$field_options = serialize( array( 'negative' => 'Disagree', 'positive' => 'Agree', 'scale' => '10' ) );\n\t\t\t\tbreak;\n\n\t\t\tcase 'likert' :\n\t\t\t\t$field_options = serialize( array( 'rows' => \"Ease of Use\\nPortability\\nOverall\", 'cols' => \"Strongly Disagree\\nDisagree\\nUndecided\\nAgree\\nStrongly Agree\" ) );\n\t\t\t\tbreak;\n\t\tendswitch;\n\n\n\n\t\t// Get fields info\n\t\t$all_fields = $wpdb->get_results( $wpdb->prepare( \"SELECT * FROM $this->field_table_name WHERE form_id = %d ORDER BY field_sequence ASC\", $form_id ) );\n\t\t$field_sequence = 0;\n\n\t\t// We only want the fields that FOLLOW our parent or previous item\n\t\tif ( $parent > 0 || $previous > 0 ) {\n\t\t\t$cut_off = ( $previous > 0 ) ? $previous : $parent;\n\n\t\t\tforeach( $all_fields as $field_index => $field ) {\n\t\t\t\tif ( $field->field_id == $cut_off ) {\n\t\t\t\t\t$field_sequence = $field->field_sequence + 1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tunset( $all_fields[ $field_index ] );\n\t\t\t}\n\t\t\tarray_shift( $all_fields );\n\n\t\t\t// If the previous had children, we need to remove them so our item is placed correctly\n\t\t\tif ( !$parent && $previous > 0 ) {\n\t\t\t\tforeach( $all_fields as $field_index => $field ) {\n\t\t\t\t\tif ( !$field->field_parent )\n\t\t\t\t\t\tbreak;\n\t\t\t\t\telse {\n\t\t\t\t\t\t$field_sequence = $field->field_sequence + 1;\n\t\t\t\t\t\tunset( $all_fields[ $field_index ] );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Create the new field's data\n\t\t$newdata = array(\n\t\t\t'form_id' \t\t\t=> absint( $data['form_id'] ),\n\t\t\t'field_key' \t\t=> $field_key,\n\t\t\t'field_name' \t\t=> $field_name,\n\t\t\t'field_type' \t\t=> $field_type,\n\t\t\t'field_options' \t=> $field_options,\n\t\t\t'field_sequence' \t=> $field_sequence,\n\t\t\t'field_validation' \t=> $field_validation,\n\t\t\t'field_parent' \t\t=> $parent\n\t\t);\n\n\t\t// Create the field\n\t\t$wpdb->insert( $this->field_table_name, $newdata );\n\t\t$insert_id = $wpdb->insert_id;\n\n\t\t// VIP fields\n\t\t$vip_fields = array( 'verification', 'secret', 'submit' );\n\n\t\t// Rearrange the fields that follow our new data\n\t\tforeach( $all_fields as $field_index => $field ) {\n\t\t\tif ( !in_array( $field->field_type, $vip_fields ) ) {\n\t\t\t\t$field_sequence++;\n\t\t\t\t// Update each field with it's new sequence and parent ID\n\t\t\t\t$wpdb->update( $this->field_table_name, array( 'field_sequence' => $field_sequence ), array( 'field_id' => $field->field_id ) );\n\t\t\t}\n\t\t}\n\n\t\t// Move the VIPs\n\t\tforeach ( $vip_fields as $update ) {\n\t\t\t$field_sequence++;\n\t\t\t$where = array(\n\t\t\t\t'form_id' \t\t=> absint( $data['form_id'] ),\n\t\t\t\t'field_type' \t=> $update\n\t\t\t);\n\t\t\t$wpdb->update( $this->field_table_name, array( 'field_sequence' => $field_sequence ), $where );\n\n\t\t}\n\n\t\techo $this->field_output( $data['form_id'], $insert_id );\n\n\t\tdie(1);\n\t}",
"function medigroup_mikado_add_meta_box_field($attributes) {\n\t\t$type = '';\n\t\t$name = '';\n\t\t$default_value = '';\n\t\t$label = '';\n\t\t$description = '';\n\t\t$options = array();\n\t\t$args = array();\n\t\t$hidden_property = '';\n\t\t$hidden_values = array();\n\t\t$parent = '';\n\n\t\textract($attributes);\n\n\t\tif(!empty($parent) && !empty($type) && !empty($name)) {\n\t\t\t$field = new MedigroupMikadoMetaField($type, $name, $default_value, $label, $description, $options, $args, $hidden_property, $hidden_values);\n\n\t\t\tif(is_object($parent)) {\n\t\t\t\t$parent->addChild($name, $field);\n\n\t\t\t\treturn $field;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"function buildField($name, $generictype, $size=0, $flags=0, $default=NULL)\n {\n $res = $name.\" \".$this->getType($generictype);\n if ($size>0 && $this->needsSize($generictype))\n {\n $res.=\"(\".$size.\")\";\n }\n if ($default!==NULL)\n {\n if ($this->needsQuotes($generictype))\n {\n $default = \"'\".$default.\"'\";\n }\n $res.= \" DEFAULT \".$default;\n }\n if (hasFlag($flags, DDL_NOTNULL))\n {\n $res.= \" NOT NULL\";\n } \n \n return $res;\n }",
"function succulents_qodef_add_repeater_field( $attributes ) {\n\t\t$name = '';\n\t\t$label = '';\n\t\t$description = '';\n\t\t$fields = array();\n\t\t$parent = '';\n\t\t$button_text = '';\n\t\t$table_layout = false;\n\t\t\n\t\textract( $attributes );\n\t\t\n\t\tif ( ! empty( $parent ) && ! empty( $name ) ) {\n\t\t\t$field = new SucculentsQodefRepeater( $fields, $name, $label, $description, $button_text, $table_layout );\n\t\t\t\n\t\t\tif ( is_object( $parent ) ) {\n\t\t\t\t$parent->addChild( $name, $field );\n\t\t\t\t\n\t\t\t\treturn $field;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn false;\n\t}",
"protected function makeBaseField(array $attributes = [])\n {\n // create a proper instance with these attributes. We set only the\n // interesting attributes, but could theoretically add more.\n $field = (new BaseField())->newFromBuilder([\n // TODO we serialize the array here to mimic the database, but\n // BaseField calls unserialize() anyway. Can we somehow spare these\n // function calls?\n 'post_content' => serialize($attributes),\n 'post_excerpt' => $attributes['name'],\n 'post_name' => $attributes['key'],\n 'post_status' => 'publish',\n ]);\n\n // now check if we have sub_fields/layouts, and populate the main fields\n // relation\n if (Arr::has($attributes, 'sub_fields')) {\n // group and repeater. Sub fields can be taken directly from the\n // config array\n $subFieldConfigs = collect(Arr::get($attributes, 'sub_fields'));\n } elseif (Arr::has($attributes, 'layouts')) {\n // flexible content field. Here the sub fields are encapsulated\n // twice, the fc config has an array \"layouts\", and each layout has\n // multiple \"sub_fields\". We need to get a flat list of sub fields,\n // and each sub fields needs to have the key \"parent_layout\" set\n $subFieldConfigs = collect(Arr::get($attributes, 'layouts'))\n\n // each layout gets replaced by its sub fields, each having the\n // \"parent_layout\" key set\n ->map(function ($layout) {\n return collect($layout['sub_fields'])->map(function ($subField) use ($layout) {\n $subField['parent_layout'] = $layout['key'];\n return $subField;\n });\n })\n\n // remove one level from the multi-dimensional array to get a\n // flat list of sub fields\n ->flatten(1);\n }\n\n // manually set the related children\n if (isset($subFieldConfigs)) {\n $field->setRelation(\n 'children',\n $subFieldConfigs->map(function ($x) {\n return $this->makeBaseField($x);\n })\n );\n }\n\n return $field;\n }",
"public function create_settings_fields( $args = array() ) {\n\t\t\n\t\t//Init vars\n\t\t$field_name = null;\n\t\t$defaults = array(\n\t\t\t'class' \t=> NULL,\n\t\t\t'default' \t=> NULL,\n\t\t\t'id' \t\t=> NULL,\n\t\t\t'page' \t\t=> NULL,\n\t\t\t'desc'\t\t=> NULL,\n\t\t\t'choices'\t=> array(),\n\t\t\t'array_key'\t=> NULL\n\t\t);\n\t\t\n\t\t$args = wp_parse_args( $args, $defaults );\n\t\t\n\t\tif( !empty($args) ) {\n\t\t\t\n\t\t\t//Extract vars from args array\n\t\t\textract( $args );\n\t\t\t\n\t\t\t// additional field class. output only if the class is defined in the create_setting arguments \n \t\t$field_class = $class; \n\t\t\t\n\t\t\t//Detect if we need to set field name structure to create a nested array of data - e.g. name=\"Foo['bar']\" or name=\"bar\"\n\t\t\tif( $page === 'post' ) {\n\t\t\t\t$field_name = $id;\n\t\t\t} else {\n\t\t\t\n\t\t\t\t//Check if we should nest within an array key\n\t\t\t\tif( isset($array_key) ) {\n\t\t\t\t\t$field_name = $page . \"[{$array_key}]\" . \"[{$id}]\";\n\t\t\t\t} else {\n\t\t\t\t\t$field_name = $page . \"[{$id}]\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t//Prep title string\n\t\t\tif( !empty($title) ) {\n\t\t\t\t$title = strtolower( $title );\n\t\t\t\t$title = ucfirst( $title );\n\t\t\t}\n\t\t\t\n\t\t\t// switch html display based on the setting type.\n\t\t\tswitch ( $type ) { \n\t\t case 'text': \n\t\t \t$default_class = 'prso-regular-text';\n\t\t \t\n\t\t $default = stripslashes($default); \n\t\t $default = esc_attr( $default); \n\t\t \n\t\t //If this is a post/page meta field then add a label\n\t\t if( $page === 'post' ) {\n\t\t \t$default_class = 'mf_text';\n\t\t \t//echo \"<label for='{$id}'>{$title}</label>\";\n\t\t \techo \"<p><strong>{$title}</strong></p>\";\n\t\t }\n\t\t \n\t\t echo \"<input class='$default_class $field_class' type='text' id='$id' name='{$field_name}' value='$default' />\"; \n\t\t \n\t\t //Detect if admin page or post/page\n\t\t if( $page === 'post' ) {\n\t\t \techo \"<p class='mf_caption'>{$desc}</p>\";\n\t\t } else {\n\t\t \t//Output validation field\n\t\t\t\t\t\techo \"<div id='{$id}-error' style='display:none;color: red;font-weight: bold;'></div>\";\n\t\t \techo ($desc != '') ? \"<br /><span class='description'>$desc. ({$id})</span>\" : \"\";\n\t\t }\n\t\t \n\t\t break; \n\t\t \n\t\t case 'hidden': \n\t\t $default = stripslashes($default); \n\t\t $default = esc_attr( $default); \n\t\t echo \"<input class='regular-text $field_class' type='hidden' id='$id' name='{$field_name}' value='$default' />\";\n\t\t break; \n\t\t \t\t\n\t\t \t\tcase \"multi-text\": \n\t\t \t\t\t\n\t\t \t\t\t//First see if $choices is a string or array - allows comma seperated choices\n\t\t \tif( is_string($choices) ) {\n\t\t \t\t$choices_tmp = array();\n\t\t \t\t\n\t\t \t\t//Explode the string\n\t\t \t\t$choices_tmp = explode( ',', $choices );\n\t\t \t\t\n\t\t \t\t//Check for errors in explode, then loop choices_tmp\n\t\t \t\tif( !empty($choices_tmp) && $choices_tmp[0] != $choices ) {\n\t\t \t\t\t//Unset $choice string so we can use it as an array next\n\t\t \t\t\tunset($choices);\n\t\t \t\t\t\n\t\t \t\t\t//Loop choices_tmp and redefine $choices array\n\t\t \t\t\tforeach( $choices_tmp as $choice ) {\n\t\t \t\t\t\t$choices[ $choice ] = $choice;\n\t\t \t\t\t}\n\t\t \t\t}\n\t\t \t}\n\t\t \t\t\t\n\t\t foreach($choices as $name => $item) { \n\t\t \n\t\t $item = esc_html($item); \n\t\t $name = esc_html($name);\n\t\t \n\t\t if ( !empty($default) && is_array($default) && isset($default[$item]) ) { \n\t\t \t$value = $default[$item];\n\t\t } else { \n\t\t \t$value = ''; \n\t\t } \n\t\t \n\t\t $_field_name = $field_name . \"[{$item}]\";\n\t\t \n\t\t echo \"<span>$name:</span> <input class='$field_class' type='text' id='$id-{$item}' name='{$_field_name}' value='$value' /><br/>\"; \n\t\t } \n\t\t echo ($desc != '') ? \"<span class='description'>$desc. ({$id})</span>\" : \"\"; \n\t\t //Output validation field\n\t\t\t\t\techo \"<div id='{$id}-error' style='display:none;color: red;font-weight: bold;'></div>\";\n\t\t break;\n\t\t \t\t\n\t\t case 'text_area': \n\t\t \t$default_class = 'prso-textarea';\n\t\t \t\n\t\t $default = stripslashes($default); \n\t\t $default = esc_html( $default); \n\t\t \n\t\t //If this is a post/page meta field then add a label\n\t\t if( $page === 'post' ) {\n\t\t \t$default_class = '';\n\t\t \t//echo \"<label for='{$id}'>{$title}</label>\";\n\t\t \techo \"<p><strong>{$title}</strong></p>\";\n\t\t }\n\t\t \n\t\t echo \"<textarea class='$default_class $field_class' type='text' id='$id' name='{$field_name}' rows='5' cols='30'>$default</textarea>\"; \n\t\t \n\t\t //Detect if admin page or post/page\n\t\t if( $page === 'post' ) {\n\t\t \techo \"<p class='mf_caption'>{$desc}</p>\";\n\t\t } else {\n\t\t \t//Output validation field\n\t\t\t\t\t\techo \"<div id='{$id}-error' style='display:none;color: red;font-weight: bold;'></div>\";\n\t\t \techo ($desc != '') ? \"<br /><span class='description'>$desc. ({$id})</span>\" : \"\";\n\t\t }\n\t\t \n\t\t break; \n\t\t \n\t\t case 'wysiwyg': \n\t\t \t$default_class = 'wp-editor-area';\n\t\t \t\n\t\t $default = stripslashes($default); \n\t\t //$default = esc_html( $default); Breaks html tags in visual editor \n\t\t \n\t\t //If this is a post/page meta field then add a label\n\t\t if( $page === 'post' ) {\n\t\t \t$default_class = '';\n\t\t \t//echo \"<label for='{$id}'>{$title}</label>\";\n\t\t \techo \"<p><strong>{$title}</strong></p>\";\n\t\t }\n\n\t\t //Create a unique id for tinymce editor - lower-case letters. No underscores, no hyphens.\n\t\t $tinymce_id = strtolower(str_replace('_', '', $id));\n\t\t \n\t\t //Call wordpress function to output std wordpress visual editor\n\t\t wp_editor( $default, $tinymce_id,\n\t\t \tarray(\n\t\t \t\t'wpautop' \t\t=> true,\n\t\t \t\t'media_buttons'\t=> false,\n\t\t \t\t'textarea_name'\t=> $field_name,\n\t\t \t\t'editor_class'\t=> 'custom-wp-editor',\n\t\t \t\t'tinymce'\t\t=> true\n\t\t \t)\n\t\t );\n\t\t \n\t\t //Detect if admin page or post/page\n\t\t if( $page === 'post' ) {\n\t\t \techo \"<p class='mf_caption'>{$desc}</p>\";\n\t\t } else {\n\t\t \t//Output validation field\n\t\t\t\t\t\techo \"<div id='{$id}-error' style='display:none;color: red;font-weight: bold;'></div>\";\n\t\t \techo ($desc != '') ? \"<br /><span class='description'>$desc. ({$id})</span>\" : \"\";\n\t\t }\n\t\t \n\t\t break; \n\t\t \n\t\t case 'select': \n\t\t \t$default_class = 'select';\n\t\t \t\n\t\t \t//If this is a post/page meta field then add a label\n\t\t if( $page === 'post' ) {\n\t\t \t$default_class = '';\n\t\t \t//echo \"<label for='{$id}'>{$title}</label>\"; USING P TAG INSTEAD\n\t\t \techo \"<p><strong>{$title}</strong></p>\";\n\t\t }\n\t\t \t\n\t\t \t//First see if $choices is a string or array - allows comma seperated choices\n\t\t \tif( is_string($choices) ) {\n\t\t \t\t$choices_tmp = array();\n\t\t \t\t\n\t\t \t\t//Explode the string\n\t\t \t\t$choices_tmp = explode( ',', $choices );\n\t\t \t\t\n\t\t \t\t//Check for errors in explode, then loop choices_tmp\n\t\t \t\tif( !empty($choices_tmp) && $choices_tmp[0] != $choices ) {\n\t\t \t\t\t//Unset $choice string so we can use it as an array next\n\t\t \t\t\tunset($choices);\n\t\t \t\t\t\n\t\t \t\t\t//Loop choices_tmp and redefine $choices array\n\t\t \t\t\tforeach( $choices_tmp as $choice ) {\n\t\t \t\t\t\t$choices[ $choice ] = $choice;\n\t\t \t\t\t}\n\t\t \t\t}\n\t\t \t}\n\t\t \t\n\t\t echo \"<select id='$id' class='$default_class $field_class' name='{$field_name}'>\"; \n\t\t foreach($choices as $name => $item) { \n\t\t $name = esc_html($name); \n\t\t \t$item = esc_html($item); \n\t\t \n\t\t $selected = ($default==$item) ? 'selected=\"selected\"' : ''; \n\t\t echo \"<option value='$item' $selected>$name</option>\"; \n\t\t } \n\t\t echo \"</select>\"; \n\t\t \n\t\t //Detect if admin page or post/page\n\t\t if( $page === 'post' ) {\n\t\t \techo \"<p class='mf_caption'>{$desc}</p>\";\n\t\t } else {\n\t\t \t//Output validation field\n\t\t\t\t\t\techo \"<div id='{$id}-error' style='display:none;color: red;font-weight: bold;'></div>\";\n\t\t \techo ($desc != '') ? \"<br /><span class='description'>$desc. ({$id})</span>\" : \"\";\n\t\t }\n\t\t \n\t\t break; \n\t\t \n\t\t case 'checkbox': \n\t\t \t$default_class = 'checkbox';\n\t\t \t\n\t\t \t//If this is a post/page meta field then add a label\n\t\t if( $page === 'post' ) {\n\t\t \t$default_class = '';\n\t\t \t//echo \"<label for='{$id}'>{$title}</label>\";\n\t\t \techo \"<p><strong>{$title}</strong></p>\";\n\t\t }\n\t\t \t\n\t\t \techo \"<input class='$default_class $field_class' type='hidden' id='$id' name='{$field_name}' value='0' checked='checked' />\";\n\t\t echo \"<input class='$default_class $field_class' type='checkbox' id='$id' name='{$field_name}' value='1' \" . checked( $default, 1, false ) . \" />\"; \n\t\t \n\t\t //Detect if admin page or post/page\n\t\t if( $page === 'post' ) {\n\t\t \techo \"<p class='mf_caption'>{$desc}</p>\";\n\t\t } else {\n\t\t \t//Output validation field\n\t\t\t\t\t\techo \"<div id='{$id}-error' style='display:none;color: red;font-weight: bold;'></div>\";\n\t\t \techo ($desc != '') ? \"<br /><span class='description'>$desc. ({$id})</span>\" : \"\";\n\t\t }\n\t\t \n\t\t break; \n\t\t \n\t\t case \"multi-checkbox\": \n\t\t \t$default_class = 'checkbox';\n\t\t \t\n\t\t \t//If this is a post/page meta field then add a label\n\t\t if( $page === 'post' ) {\n\t\t \t$default_class = '';\n\t\t \t//echo \"<label for='{$id}'>{$title}</label>\";\n\t\t \techo \"<p><strong>{$title}</strong></p>\";\n\t\t }\n\t\t \t\n\t\t \t//First see if $choices is a string or array - allows comma seperated choices\n\t\t \tif( is_string($choices) ) {\n\t\t \t\t$choices_tmp = array();\n\t\t \t\t\n\t\t \t\t//Explode the string\n\t\t \t\t$choices_tmp = explode( ',', $choices );\n\t\t \t\t\n\t\t \t\t//Check for errors in explode, then loop choices_tmp\n\t\t \t\tif( !empty($choices_tmp) && $choices_tmp[0] != $choices ) {\n\t\t \t\t\t//Unset $choice string so we can use it as an array next\n\t\t \t\t\tunset($choices);\n\t\t \t\t\t\n\t\t \t\t\t//Loop choices_tmp and redefine $choices array\n\t\t \t\t\tforeach( $choices_tmp as $choice ) {\n\t\t \t\t\t\t$choices[ $choice ] = $choice;\n\t\t \t\t\t}\n\t\t \t\t}\n\t\t \t}\n\t\t \t\n\t\t foreach($choices as $name => $item) { \n\t\t \n\t\t $name = esc_html($name);\n\t\t $item = esc_html($item); \n\t\t $checked = ''; \n\t\t \t\t\n\t\t \t\t\t\tif ( !empty($default) && is_array($default) ) { \n\t\t \tif( in_array($item, $default) ) {\n\t\t \t\t$checked = 'checked=\"checked\"';\n\t\t \t}\n\t\t } \n\t\t \n\t\t $_field_name = $field_name . \"[]\";\n\t\t \t\t\t\t\n\t\t \t\t\t\techo \"<input class='$default_class $field_class' type='hidden' id='$id' name='{$_field_name}' value='' checked='checked' />\";\n\t\t \t\t\t\t\n\t\t echo \"<input class='$default_class $field_class' type='checkbox' id='$id-{$item}' name='{$_field_name}' value='{$item}' $checked /> $name <br/>\"; \n\t\t } \n\t\t \n\t\t //Detect if admin page or post/page\n\t\t if( $page === 'post' ) {\n\t\t \techo \"<p class='mf_caption'>{$desc}</p>\";\n\t\t } else {\n\t\t \t//Output validation field\n\t\t\t\t\t\techo \"<div id='{$id}-error' style='display:none;color: red;font-weight: bold;'></div>\";\n\t\t \techo ($desc != '') ? \"<br /><span class='description'>$desc. ({$id})</span>\" : \"\";\n\t\t }\n\t\t \n\t\t break;\n\t\t \n\t\t case \"radio\":\n\t\t \t$default_class = 'radio';\n\t\t \t\n\t\t \t//If this is a post/page meta field then add a label\n\t\t if( $page === 'post' ) {\n\t\t \t$default_class = '';\n\t\t \t//echo \"<label for='{$id}'>{$title}</label>\";\n\t\t \techo \"<p><strong>{$title}</strong></p>\";\n\t\t }\n\t\t \t\n\t\t \t//First see if $choices is a string or array - allows comma seperated choices\n\t\t \tif( is_string($choices) ) {\n\t\t \t\t$choices_tmp = array();\n\t\t \t\t\n\t\t \t\t//Explode the string\n\t\t \t\t$choices_tmp = explode( ',', $choices );\n\t\t \t\t\n\t\t \t\t//Check for errors in explode, then loop choices_tmp\n\t\t \t\tif( !empty($choices_tmp) && $choices_tmp[0] != $choices ) {\n\t\t \t\t\t//Unset $choice string so we can use it as an array next\n\t\t \t\t\tunset($choices);\n\t\t \t\t\t\n\t\t \t\t\t//Loop choices_tmp and redefine $choices array\n\t\t \t\t\tforeach( $choices_tmp as $choice ) {\n\t\t \t\t\t\t$choices[ $choice ] = $choice;\n\t\t \t\t\t}\n\t\t \t\t}\n\t\t \t}\n\t\t \t\n\t\t \tforeach( $choices as $name => $item ){\n\t\t \t\n\t\t \t\t$name = esc_html($name);\n\t\t $item = esc_html($item); \n\t\t $checked = '';\n\t\t \t\t\n\t\t \t\tif ( !empty($default) ) { \n\t\t \tif( $default === $item ) {\n\t\t \t\t$checked = 'checked=\"checked\"';\n\t\t \t}\n\t\t } \n\t\t \t\t\n\t\t \t\techo \"<input class='$default_class $field_class' type='radio' id='$id-{$item}' name='{$field_name}' value='{$item}' {$checked} /> $name <br/>\";\n\t\t \t}\n\t\t \t\n\t\t \t//Detect if admin page or post/page\n\t\t if( $page === 'post' ) {\n\t\t \techo \"<p class='mf_caption'>{$desc}</p>\";\n\t\t } else {\n\t\t \t//Output validation field\n\t\t\t\t\t\techo \"<div id='{$id}-error' style='display:none;color: red;font-weight: bold;'></div>\";\n\t\t \techo ($desc != '') ? \"<br /><span class='description'>$desc. ({$id})</span>\" : \"\";\n\t\t }\n\t\t \t\n\t\t break;\n\t\t \n\t\t case 'media': \n\t\t \t$default_class = 'regular-text';\n\t\t \t\n\t\t $default = stripslashes($default); \n\t\t $default = esc_attr( $default); \n\t\t \n\t\t //If this is a post/page meta field then add a label\n\t\t if( $page === 'post' ) {\n\t\t \t$default_class = 'mf_text';\n\t\t \t//echo \"<label for='{$id}'>{$title}</label>:\";\n\t\t \techo \"<p><strong>{$title}</strong></p>\";\n\t\t }\n\t\t \n\t\t //Media URL Field\n\t\t echo \"<input class='$default_class media-url $field_class' type='text' id='$id' name='{$field_name}' value='$default' />\"; \n\t\t \n\t\t //Action button\n\t\t echo \"<input id='{$id}_button' type='button' class='button' value='Upload' />\";\n\t\t \n\t\t //Detect if admin page or post/page\n\t\t if( $page === 'post' ) {\n\t\t \techo \"<p class='mf_caption'>{$desc}</p>\";\n\t\t } else {\n\t\t \t//Output validation field\n\t\t\t\t\t\techo \"<div id='{$id}-error' style='display:none;color: red;font-weight: bold;'></div>\";\n\t\t \techo ($desc != '') ? \"<br /><span class='description'>$desc. ({$id})</span>\" : \"\";\n\t\t }\n\t\t \n\t\t //Setup scripts required to activate wordpress media uploader using helper\n\t\t $media_defaults = array(\n\t\t\t\t\t\t'action_id'\t\t\t\t=> \"{$id}_button\", //ID of action button\n\t\t\t\t\t\t'url_destination_id'\t=> $id, //ID of page element to recieve returned file url\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\t$args = wp_parse_args( $args, $media_defaults );\n\t\t\t\t\t\n\t\t\t\t\techo $this->wp_media_uploader_helper( $args );\n\t\t \n\t\t break;\n\t\t } \n\t\t \n\t\t}\n\t\t\n\t}",
"protected function createFormFields() {\n\t}",
"private function generateGetAdminAddFields() {\n $method = $this->class->addMethod(\"getAdminAddFields\")\n ->setVisibility(\"public\")\n ->addComment(\"Returns all fields to display to an admin attempting to add a service with the module\")\n ->addComment('@param stdClass $package A stdClass object representing the selected package')\n ->addComment('@param mixed $vars A stdClass object representing a set of post fields')\n ->addComment('@return ModuleFields A ModuleFields object, containg the fields to render as well as any additional HTML markup to include');\n\n $method->addParameter(\"package\");\n $method->addParameter(\"vars\", null);\n\n //generate dummy implementation with module field named \"testField\"\n $body_lines = array(\n 'Loader::loadHelpers($this, array(\"Html\"));',\n '$fields = new ModuleFields();' . \"\\n\",\n '$module_fields = $fields->label(\"testModule.label\", \"testModule.testField\");',\n '$module_fields->attach(',\n \"\\t\" . '$fields->fieldText(\"testField\", $this->Html->ifSet($vars->testField), array(\"id\" => \"testModule.testField\"))',\n ');' . \"\\n\",\n '$fields->setField($module_fields);' . \"\\n\",\n 'return $fields;'\n );\n\n foreach($body_lines as $l) {\n $method->addBody($l);\n }\n }",
"protected function makeField() {\n\t\tswitch ($this->config()->get('show_as')) {\n\t\tcase self::ShowAsDropdown:\n\t\t\t$field = new \\DropdownField(\n\t\t\t\tstatic::single_field_name(),\n\t\t\t\t'',\n\t\t\t\tstatic::options()\n\t\t\t);\n\t\t\tif ($emptyString = static::config()->get('empty_string')) {\n\t\t\t\t$field->setEmptyString($emptyString);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase self::ShowAsRadio:\n\t\t\t$field = new \\OptionsetField(\n\t\t\t\tstatic::single_field_name(),\n\t\t\t\t'',\n\t\t\t\tstatic::options()\n\t\t\t);\n\t\t\t// if it is null then nothing will be set which is fine anyway\n\t\t\tif (!is_null($defaultValue = static::default_value())) {\n\t\t\t\t// TODO do we need this to set if no value, what happens if there is?\n//\t\t\t\t$field->setValue($defaultValue);\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$field = null;\n\t\t}\n\t\treturn $field;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns large icon if exists | public function getLargeIcon(){
if(file_exists(StyleManager::getStyle()->getIconPath(str_replace('M.png', 'L.png', $this->icon))))
return StyleManager::getStyle()->getIconPath(str_replace('M.png', 'L.png', $this->icon));
return StyleManager::getStyle()->getIconPath($this->icon);
} | [
"function GetIcon(){}",
"public function getIcon();",
"function GetIcon(wxSize $size, $flags=FALLBACK_SYSTEM, $size=wxDefaultCoord, $flags=FALLBACK_SYSTEM){}",
"function find_icon($ino) \n{\n $path = WPF_PATH . \"/icons/\".$ino;\n $ext=\".gif\";\n \n if ( file_exists($path.\".gif\") )\n $ext= \".gif\";\n else if ( file_exists($path.\".png\") )\n $ext= \".png\";\n else if ( file_exists($path.\".jpg\") )\n $ext= \".jpg\";\n else if ( file_exists($path.\".GIF\") )\n $ext= \".GIF\";\n else if ( file_exists($path.\".PNG\") )\n $ext= \".PNG\";\n else if ( file_exists($path.\".JPG\") )\n $ext= \".JPG\";\n else if ( file_exists($path.\".jpeg\") )\n $ext= \".jpeg\"; \n else if ( file_exists($path.\".JPEG\") )\n $ext= \".JPEG\";\n return $ino . $ext;\n}",
"public function getIcon() {\t\n\t\t$data = $this->data[$this->name];\n\t\t$field = 'icon';\n\t\t$path = $this->getImagePath($data, $this->name, FILES, Configure::read('Folders.files.games').DS.$data['id'].DS.$field, $field);\n\t\tif(!$data[$field]) $path.= DS.'general'.DS.$field.'.png';\n\t\t\n\t\treturn $path;\t\t\n\t}",
"public function getIcon()\n {\n return $this->info['icon'];\n }",
"public function get_icon() {\n return ($this->has_icon ? \"/static/img/user/icon/$this->id.png\" : \"/static/img/user/icon/NONE.png\");\n }",
"function clanpress_get_game_icon( $term_id, $size = 'thumbnail' ) {\n $meta = Clanpress_Game_Taxonomy::get_term_meta( $term_id );\n if ( !empty( $meta[ 'clanpress_game_icon' ] ) ) {\n $attachment_id = (int) $meta[ 'clanpress_game_icon' ];\n return clanpress_get_image( $attachment_id, $size );\n }\n\n return '';\n}",
"public function getIconUrl();",
"abstract public function get_font_icon();",
"public function getManifestLargeImage() {\n $image = '';\n if ($manifest = $this->getManifest()) {\n $size = 0;\n foreach ($manifest['icons'] as $icon) {\n $icon_size = explode('x', $icon['sizes']);\n if ($icon_size[0] > $size) {\n $image = $this->getDirectory() . $icon['src'];\n }\n }\n }\n else {\n // New version of real favicon do not generate a manifest.\n return $this->getDirectory() . '/apple-touch-icon.png';\n }\n return $image;\n }",
"private function getPageIcon()\n {\n if (strlen($this->pageId) > 0)\n {\n if (strlen($this->pageId) > 1)\n if (isset(BaseConfig::$data['pageId'][$this->pageId])) {\n return BaseConfig::$data['pageId'][$this->pageId]['icon'];\n }\n return array_key_exists($this->pageId, BaseConfig::$data['pageId'][(string)$this->pageId[0]]['submenu'])\n ? BaseConfig::$data['pageId'][$this->pageId[0]]['submenu'][$this->pageId]['icon'] :'';\n\n return array_key_exists($this->pageId, BaseConfig::$data['pageId'])\n ? BaseConfig::$data['pageId'][$this->pageId]['icon'] : '';\n }\n }",
"public function getIconIdentifier() : string {}",
"public function getLargeIconUrl() {\n return BLIZZARD_D3_PORTRAIT_BASE_PATH . '42/' . $this->getIconFileName() . '.png';\n }",
"public function getIconName() {}",
"public function getIcon()\n {\n return $this->_getValue('icon');\n }",
"public function Icon()\n {\n $path = Config::inst()->get('AWS_S3File','icons_path');\n\n $ext = strtolower($this->getExtension());\n\n //\n // Find an icon symbol in the defined app-icon folder. If not available fail over to\n // framework icons. If that fails, too, use the generic icon from framework.\n if(!Director::fileExists($path.\"/{$ext}_32.gif\"))\n {\n $ext = File::get_app_category($this->getExtension());\n }\n if (Director::fileExists($path.\"{$ext}_32.gif\"))\n {\n return $path.\"{$ext}_32.gif\";\n }\n\n //\n // taken from File.Icon()\n $ext = strtolower($this->getExtension());\n\n if(!Director::fileExists(FRAMEWORK_DIR . \"/images/app_icons/{$ext}_32.gif\")) {\n $ext = File::get_app_category($this->getExtension());\n }\n\n if(!Director::fileExists(FRAMEWORK_DIR . \"/images/app_icons/{$ext}_32.gif\")) {\n $ext = \"generic\";\n }\n\n return FRAMEWORK_DIR . \"/images/app_icons/{$ext}_32.gif\";\n }",
"public function get_icon() {\n\t\t\treturn WC_SUMO_Sagepay_Common_Functions::get_icon( $this->cardtypes, $this->sagelink, $this->sagelogo, $this->id );\n\t\t}",
"public function getIcon() {\n\t\t$icon = '';\n\t\tif ($this->iconFile) {\n\t\t\t$icon = '../uploads/tx_templavoila/' . $this->iconFile;\n\t\t}\n\t\treturn $icon;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieves the list of accessible Business Profiles. (liasettings.getaccessiblegmbaccounts) | public function getaccessiblegmbaccounts($merchantId, $accountId, $optParams = [])
{
$params = ['merchantId' => $merchantId, 'accountId' => $accountId];
$params = array_merge($params, $optParams);
return $this->call('getaccessiblegmbaccounts', [$params], LiasettingsGetAccessibleGmbAccountsResponse::class);
} | [
"public function getBannedAccountsList() {\n\t\t$result = $this->db->queryFetch(\"SELECT \"._CLMN_MEMBID_.\", \"._CLMN_USERNM_.\", \"._CLMN_EMAIL_.\" FROM \"._TBL_MI_.\" WHERE \"._CLMN_BLOCCODE_.\" = 1 ORDER BY \"._CLMN_MEMBID_.\" ASC\");\n\t\tif(!is_array($result)) return;\n\t\treturn $result;\n\t}",
"public function meGetBankAccounts();",
"public function getAccountList() {\n return parent::_requestData('get','accounts');\n }",
"public function getBannedAccountsList() {\n\t\t\n\t\treturn;\n\t}",
"public function get_allowed_users() {\n\t\t$access_list = get_site_option( 'learndash_hub_access_list' );\n\n\t\tif ( ! is_array( $access_list ) || empty( $access_list ) ) {\n\t\t\t$access_list = $this->populate_access_list();\n\t\t}\n\n\t\treturn $access_list;\n\t}",
"public function getUserLibraryAccounts();",
"public function get_accounts() {\n $result = array();\n // get GA accounts\n $accounts = $this->management_accounts->listManagementAccounts();\n $accounts_items = $accounts->getItems();\n if (count($accounts_items) > 0) {\n foreach ($accounts_items as $account_item) {\n // create \"id&name\" - key\n // $result[ $account_item->getId() . '&' . $account_item->getName() ] = array();\n $result[ $account_item->getName() ] = array();\n // get webproperties for current account\n\t\t\t\t\n $webproperties = $this->management_webproperties->listManagementWebproperties($account_item->getId());\n $webproperties_items = $webproperties->getItems();\n // add each webproperty to array\n foreach($webproperties_items as $webproperty_item) {\n $profiles = $this->management_profiles->listManagementProfiles($account_item->getId(), $webproperty_item->getId());\n $profiles_items = $profiles->getItems();\n if (is_array($profiles_items)) {\n foreach($profiles_items as $profile_item) {\n // $result[ $account_item->getId() . '&' . $account_item->getName() ]\n $result[ $account_item->getName() ]\n // [ $webproperty_item->getId() . '&' . $webproperty_item->getName() ]\n [ $webproperty_item->getName() ]\n [ $profile_item->getId() ] = $profile_item->getName(); \n }\n } else if( ! is_null($profiles_items) ) {\n // $result[ $account_item->getId() . '&' . $account_item->getName() ]\n $result[ $account_item->getName() ]\n // [ $webproperty_item->getId() . '&' . $webproperty_item->getName() ]\n [ $webproperty_item->getName() ]\n [ $profiles_items['id'] ] = $profiles_items['name'];\n }\n } \n }\n return $result;\n } else {\n throw new Exception('No accounts found');\n }\n }",
"public function accounts ()\n {\n return $this->accountProvider;\n }",
"public function core_get_accounts()\n\t{\n\t\t$data = $this->db\n\t\t\t->select('account_id, account_type, username, bucket, path')\n\t\t\t->from('backup_accounts')\n\t\t\t->where('account_type', $this->core_get_short_name())\n\t\t\t->order_by('account_type', 'asc')\n\t\t\t->get()\n\t\t\t->result();\n\t\t$result = array();\n\t\tforeach($data as $row)\n\t\t{\n\t\t\t$result[$row->account_id] = $row->username;\n\t\t}\n\t\t\n\t\treturn $result;\n\t}",
"public static function getActive() {\r\n \r\n try {\r\n \t$banks = array();\r\n \t\r\n $items = Doctrine_Query::create ()\r\n ->from ( 'Banks b' )\r\n ->where ( \"b.enabled = ?\", true )\r\n ->execute ( array (), Doctrine_Core::HYDRATE_ARRAY );\r\n \r\n\t foreach ( $items as $item ) {\r\n\t $banks [$item ['bank_id']] = $item ['name'];\r\n\t }\r\n\t \r\n return $banks; \r\n } catch (Exception $e) {\r\n die ( $e->getMessage () );\r\n }\r\n }",
"public function getAccountsList() {\r\n return $this->_em->getRepository(\"CommercialBankAccount\")->findAll();\r\n }",
"public static function publicAccounts()\n {\n return db('account_types')->get('showpublic=1')->orderby('accounttype', 'asc');\n }",
"public function getAccounts();",
"public function getLockedAccounts()\n {\n $result = $this->client->sendRequest(\"/json-api/listlockedaccounts\", \"GET\", []);\n if ( ! empty($result['metadata']) && $result['metadata']['result'] === 1) {\n return $result['data']['account'];\n }\n\n return [];\n }",
"private function getAccount()\n {\n $links = [];\n $links[] = [\n 'url' => '/bar/account',\n 'text' => 'Bar Account',\n 'icon' => 'check'\n ];\n\n return $links;\n }",
"private function getBankOptions() {\n \n $this->checkBankOptions();\n $aBanks = $this->fetchBankOptions();\n return $aBanks;\n }",
"function getBankLists() {\r\n\t\t$idealPlugin = os_payments::loadPaymentMethod('os_ideal');\t\t\r\n\t\t$params = new JRegistry($idealPlugin->params) ;\t\t\r\n\t\t$partnerId = $params->get('partner_id');\r\n\t\t$ideal = new iDEAL_Payment($partnerId) ;\r\n\t\t$bankLists = $ideal->getBanks();\r\n\t\treturn $bankLists ;\r\n\t}",
"public function get(): array\n {\n // No account has been set, return empty array.\n if (!isset($this->account)) return [];\n\n $url = $this->endpoint . 'pasteaccount/' . $this->account;\n $pasteAccounts = $this->requestGet($url);\n\n return $pasteAccounts;\n }",
"function getAccessionList()\n\t{\n\t\tstatic $lab_accession_list = [];\n\n\t\t$res = $qbc->get('/api/v1/accessioningtype');\n\t\tforeach ($res['data'] as $x) {\n\t\t\t$x['@id'] = sprintf('qbench:%d', $x['id']);\n\t\t\t// var_dump($x);\n\t\t}\n\n\t\treturn $lab_accession_list;\n\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create Invoice test Should throw InvalidArgumentException | public function testIsCreatableThrowInvalidArgumentException()
{
$this->expectException(\Xendit\Exceptions\InvalidArgumentException::class);
$params = [
'external_id' => 'demo_147580196270',
'payer_email' => 'sample_email@xendit.co',
'description' => 'Trip to Bali',
];
Invoice::create($params);
} | [
"public function testIsCreatableThrowInvalidArgumentException()\n {\n $this->expectException(\\Xendit\\Exceptions\\InvalidArgumentException::class);\n $params = [\n 'external_id' => 'demo_147580196270'\n ];\n\n Payouts::create($params);\n }",
"public function testMakeInvoicePayment()\n {\n }",
"public function testCancelInvoice()\n {\n }",
"public function test_createIsCalled_invalidPrice_throwAnException()\n {\n Price::create('type', 'invalid_price');\n }",
"public function testFailInvoice()\n {\n }",
"public function test_ShouldThrowException_IfInvoiceDoesntExistsInDatabase()\n {\n $this->tempSaleJson['dte_number'] = '666666';\n $this->tempSaleJson['is_ticket'] = false;\n $response = $this->changeServiceOrder();\n $this->assertError($response);\n }",
"public function testDeleteInvoice()\n {\n }",
"public function testIsPaymentMethodCreatableThrowApiException()\n {\n // $this->expectException(\\Xendit\\Exceptions\\InvalidArgumentException::class);\n $this->expectException(\\Xendit\\Exceptions\\ApiException::class);\n $params = self::PAYMENT_METHOD_PARAMS;\n\n DirectDebit::createPaymentMethod($params);\n }",
"public function testOutboundDocumentCreateSalesInvoice()\n {\n }",
"public function testRetrieveInvoice()\n {\n }",
"public function testInvoiceSubmit()\n {\n }",
"public function test_ShouldThrowException_IfNoSaleExists_Invoice()\n {\n $this->tempSaleJson['dte_number'] = '2';\n $this->tempSaleJson['is_ticket'] = false;\n $response = $this->cancelServiceOrder();\n $this->assertError($response);\n }",
"public function testInvoicesAdd()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function testCreateByInvoice()\n {\n $invoice = $this->getInvoice('100000001');\n $creditmemo = $this->creditmemoFactory->createByInvoice($invoice);\n self::assertEquals(14, $creditmemo->getTotalQty(), 'Creditmemo has wrong total qty.');\n }",
"public function testIs20200519CustomerCreatableThrowInvalidArgumentException()\n {\n $this->expectException(\\Xendit\\Exceptions\\InvalidArgumentException::class);\n $params = [\n 'reference_id' => self::REFERENCE_ID\n ];\n\n Customers::createCustomer($params);\n }",
"public function testSupplierInvoiceReleaseInvoiceByinvoiceNumber()\n {\n }",
"public function testSendInvoiceViaPost()\n {\n }",
"public function testIsBatchCreatableThrowInvalidArgumentException()\n {\n $this->expectException(\\Xendit\\Exceptions\\InvalidArgumentException::class);\n $params = [\n 'external_id' => 'demo_147580196270'\n ];\n\n Disbursements::createBatch($params);\n }",
"public function testPayInvoice()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Delete posts by form config id | public function delPostsByFormConfigId($formConfigId) {
$this->_em->getConnection()->delete(
'wf_formpost', array('wf_formconfig_id' => $formConfigId));
} | [
"public function deletePostAction(){\n if(!SearchHelper::isIndexerEnabled()){\n return;\n }\n $postId = InputHelper::getParam('postId');\n if(!$postId){\n return;\n }\n $post = get_post($postId);\n if(wp_is_post_autosave($post) || wp_is_post_revision($post)){\n return;\n }\n\n SearchHelper::deletePost($postId);\n\n }",
"public function deletePost( $postId );",
"public function planner_delete_post_by_id() {\n \n // Save a post\n (new MidrubBaseUserAppsCollectionPlannerHelpers\\Posts)->planner_delete_post_by_id();\n \n }",
"public function deleteById($postsId);",
"public function deleteAction(Post $post)\n {\n\n }",
"function removePost($id)\n {\n }",
"function admin_delete($post_type = \"\", $post_id = 0) {\n // Looking for the post type\n if (!in_array($post_type, $this->_post_types)) {\n $post_type = \"\";\n }\n\n // Checking $post_id\n if (!is_numeric($post_id) || $post_id <= 0) {\n $post_id = 0;\n }\n\n // Deleting post content\n $this->loadModel('PostsModel');\n $this->PostsModel->delete($post_id);\n \n // Checking if media is associated with the post\n $this->loadModel('MediasModel');\n $filters = array('medias' => array('type' => $post_type, \n 'post_id' => $post_id));\n $var['media'] = $this->MediasModel->findFirst(array('filters' => $filters));\n\n // If there is a media associated, we delete the media\n if (!empty($var['media'])) {\n $this->MediasModel->delete($var['media']);\n }\n\n $this->redirect(BASE_URL.'/'.array_search('admin', Router::$prefixes).'/posts/index/'.$post_type);\n }",
"public function deletePost($id) {\n\t\treturn $this->post->delete($id);\n\t}",
"public function delete_post() {\n if (empty($_GET['id']))\n error(__(\"No ID Specified\"), __(\"An ID is required to delete a post.\"));\n\n $post = new Post($_GET['id'], array(\"drafts\" => true));\n\n if (!$post->deletable())\n show_403(__(\"Access Denied\"), __(\"You do not have sufficient privileges to delete this post.\"));\n\n $this->display(\"delete_post\", array(\"post\" => $post));\n }",
"public function postDelete($id){\n $post = new Post();\n $singlePost = $post->deletePost($id);\n return Redirect::back();\n }",
"public function delete() {\n\t\ttry {\n\t\t\t$this->model->deletePost($this->args[1], $this->args[2] );\n\t\t\tHTML::redirect('/blog/view/'. $this->args[1]);\n\t\t} catch(Exception $excpt){\n\t\t\t$this->view->setError($excpt);\n\t\t}\t\n\t}",
"private function delete()\r\n\t\t{\r\n\t\t\t$id = $_REQUEST['id'];\r\n\t\t\tDB::delete(\"blog\", \"WHERE id=$id\");\r\n\t\t\t$this->doRSS();\r\n\t\t}",
"public function postDelete()\n {\n $post = Post::findorfail(Input::get('id'));\n if ($post->user_id == Auth::id()) {\n // Find and delete all related comments.\n $comments = $post->comments();\n $comments->delete();\n // Find and delete all related uploads.\n $uploads = $post->uploads()->get();\n $uploads->each(function ($upload) {\n $path = public_path('uploads');\n $filename = $upload->filename_saved_as;\n File::delete($path.'/'.$filename);\n $upload->delete();\n });\n $post->delete();\n return Redirect::back()->with('message', 'Post deleted!');\n } else {\n return Redirect::to('posts/index')\n ->with('message', 'You cannot delete posts that do not belong to you.');\n }\n }",
"public function delete()\n {\n try {\n //..if the post 'id' variable is not null, then get the variable and invokes the delete method of DAO object.\n if (!is_null($this->post['id'])) {\n $id = (int)$this->post['id'];\n $this->dao->delete($id);\n (new Message())->show(); //..show a message to user\n }\n } catch (\\Exception $ex) {\n (new Message(null, \"Erro: {$ex->getMessage()}.\"))->show();\n }\n }",
"public function delete() {\n\t\t//Create a post if the form was submitted\n\t\tif ( isset($_REQUEST[\"deletePost\"]) ) {\n\t\t\t$this->deletePost();\n\t\t\treturn;\n\t\t}\n\n\t\tif ( $this->request->args ) {\n\t\t\t//Get the requested post for editing\n\t\t\t$postId = $this->request->args[0];\n\t\t\t$result = readPost($postId);\n\n\t\t\t//Display the post for deletion if it was found successfully\n\t\t\tif ( $result->status == 0 ) {\n\t\t\t\t$post = $result->data;\n\n\t\t\t\t//Include the Delete page\n\t\t\t\trequire_once(VIEWS . \"/Blog/delete.php\");\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\t//Create an error message and redirect to the Blog page\n\t\t\t\t$message = new MessageResponse(1, \"Requested Post Not Found\", \"The Post you requested to delete does not exist\");\n\t\t\t}\n\t\t} else {\n\t\t\t//Create an error message and redirect to the Blog page\n\t\t\t$message = new MessageResponse(1, \"No Post Specified\", \"No Post was chosen for deletion\");\n\t\t}\n\n\t\t$this->setMessage($message);\n\n\t\t//Redirect to the blog home page\n\t\tRoute::redirect(\"/Blog\");\n\t\treturn;\n\t}",
"public function testDeletePostById()\n {\n $post = factory(Post::class)->create();\n \n $this->call('Delete', '/post/' . $post->id);\n $this->seeHeader('content-type', 'application/json');\n $this->seeStatusCode(200);\n }",
"public function delete( ) {\n\t\tif ( !empty( $this->id ) && !empty( $this->token ) ) {\n\t\t\t$url = \"/posts/\" . $this->id . \"?token=\" . $this->token;\n\t\t\t$response = $this->context->request( $url );\n\t\t}\n\t}",
"static function delete($post){\n\t\t$index = self::_index(true);\n\n\t\t$type = $index->getType($post->post_type);\n\n\t\ttry{\n\t\t\t$type->deleteById($post->ID);\n\t\t}catch(\\Elastica\\Exception\\NotFoundException $ex){\n\t\t\t// ignore\n\t\t}\n\t}",
"public function removePost(){\n $connection = new Connection();\n $link = $connection->connect();\n $link->exec(\"DELETE FROM post WHERE id = '\" . $this->id . \"'\");\n $connection = null;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the original array | public function getOrigArray() {
return $this->origArray;
} | [
"public function getOriginalValues(): array;",
"public function getArrayCopy()\n {\n \treturn get_object_vars($this);\n }",
"public function getArrayCopy()\n {\n return $this->rows;\n }",
"abstract public function convertArray();",
"public function getOriginalData()\n {\n\n // initialize the array for the original data\n $originalData = array();\n\n // query whether or not the column contains original data\n if ($this->hasOriginalData()) {\n // unerialize the original data from the column\n $originalData = unserialize($this->row[$this->headers[ColumnKeys::ORIGINAL_DATA]]);\n }\n\n // return an empty array, if not\n return $originalData;\n }",
"function getOriginal()\n {\n $lines = array();\n foreach ($this->_edits as $edit) {\n if ($edit->orig) {\n array_splice($lines, count($lines), 0, $edit->orig);\n }\n }\n return $lines;\n }",
"public function data_swap() {\n\t\t\t$data = array(\n\t\t\t\tarray(array(array(1, 2)), array(array(2, 1))),\n\t\t\t);\n\t\t\treturn $data;\n\t\t}",
"public function getOriginalData()\n\t{\n\t\treturn $this->originalData;\n\t}",
"function array_copy( array $array ) {\n $copy = array();\n foreach( $array as $key => $val ) {\n if(is_array($val)) \n $copy[$key] = array_copy($val);\n elseif (is_object( $val )) \n $copy[$key] = clone $val;\n else \n $copy[$key] = $val;\n }\n return $copy;\n }",
"public function getLegacyArr() {\n return $this->legacyArr;\n }",
"public function getModifiedArrayCopy()\n {\n $columns = array_intersect_key(\n $this->data,\n array_filter($this->modifiedDataFields)\n );\n\n return array_diff_key(\n $columns,\n array_combine(array_keys($this->relations), array_keys($this->relations))\n );\n }",
"public function scrubArray(array $data) : array;",
"public function getOriginalValues()\n {\n return $this->_original_values;\n }",
"public function toArray() {}",
"public function getPlainArray()\n {\n }",
"public function orig() {\n $lines = [];\n\n foreach ($this->edits as $edit) {\n if ($edit->orig) {\n array_splice($lines, sizeof($lines), 0, $edit->orig);\n }\n }\n return $lines;\n }",
"public function getArrayCopy() {\n return $this->_hits->getArrayCopy();\n }",
"function arrayShift($array) {\n\n unset($array[0]);\n return $array;\n}",
"abstract function to_array();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Pass in a word as a string, get back an array of definitions. Optional params: count : the number of results returned (default=10) part_of_speech : only get definitions with a specific part(s) of speech. More info: | public function getDefinitions($word, $count=10, $part_of_speech=null) {
if(is_null($word) || trim($word) == '') {
throw new InvalidParameterException("getDefinitions expects word to be a string");
}
$params = array();
$params['count'] = $count;
if (isset($part_of_speech)) {
$params['partOfSpeech'] = $part_of_speech;
}
return $this->callApi('/word.json/' . rawurlencode($word) . '/definitions', $params);
} | [
"public function getDefinition($word);",
"public function getDefinitions($word, $partOfSpeech=null, $sourceDictionaries=null, $limit=null, $includeRelated=null, $useCanonical=null, $includeTags=null) {\n\n \t\t//parse inputs\n \t\t$resourcePath = \"/word.{format}/{word}/definitions\";\n \t\t$resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n \t\t$method = \"GET\";\n $queryParams = array();\n $headerParams = array();\n $headerParams['Accept'] = 'application/json';\n $headerParams['Content-Type'] = 'application/json';\n\n if($limit != null) {\n \t\t $queryParams['limit'] = $this->apiClient->toQueryValue($limit);\n \t\t}\n \t\tif($partOfSpeech != null) {\n \t\t $queryParams['partOfSpeech'] = $this->apiClient->toQueryValue($partOfSpeech);\n \t\t}\n \t\tif($includeRelated != null) {\n \t\t $queryParams['includeRelated'] = $this->apiClient->toQueryValue($includeRelated);\n \t\t}\n \t\tif($sourceDictionaries != null) {\n \t\t $queryParams['sourceDictionaries'] = $this->apiClient->toQueryValue($sourceDictionaries);\n \t\t}\n \t\tif($useCanonical != null) {\n \t\t $queryParams['useCanonical'] = $this->apiClient->toQueryValue($useCanonical);\n \t\t}\n \t\tif($includeTags != null) {\n \t\t $queryParams['includeTags'] = $this->apiClient->toQueryValue($includeTags);\n \t\t}\n \t\tif($word != null) {\n \t\t\t$resourcePath = str_replace(\"{\" . \"word\" . \"}\",\n \t\t\t $this->apiClient->toPathValue($word), $resourcePath);\n \t\t}\n \t\t//make the API Call\n if (! isset($body)) {\n $body = null;\n }\n \t\t$response = $this->apiClient->callAPI($resourcePath, $method,\n \t\t $queryParams, $body,\n \t\t $headerParams);\n\n\n if(! $response){\n return null;\n }\n\n \t\t$responseObject = $this->apiClient->deserialize($response,\n \t\t 'array[Definition]');\n \t\treturn $responseObject;\n\n }",
"public function getDefinitions($word) {\n\t\tif(is_null($word) || trim($word) == '') {\n\t\t\tthrow new InvalidParameterException(\"getDefinitions expects word to be a string\");\n\t\t}\n\n\t\treturn $this->curlData( '/word.json/' . rawurlencode($word) . '/definitions' );\n\t}",
"public function getWords();",
"public function getDefinitions(string $word, string $partOfSpeech='', string $sourceDictionaries='', int $limit=200, bool $includeRelated=true, bool $useCanonical=false, bool $includeTags=false): array {\n\n\t\t//parse inputs\n\t\t$resourcePath = \"/word.{format}/{word}/definitions\";\n\t\t$resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\t\t$method = \"GET\";\n\t\t$queryParams = array();\n\t\t$headerParams = array();\n\n\t\t$queryParams['limit'] = $this->apiClient->toPathValue($limit);\n\t\t$queryParams['partOfSpeech'] = $this->apiClient->toPathValue($partOfSpeech);\n\t\t$queryParams['includeRelated'] = $this->apiClient->toPathValue($includeRelated);\n\t\t$queryParams['sourceDictionaries'] = $this->apiClient->toPathValue($sourceDictionaries);\n\t\t$queryParams['useCanonical'] = $this->apiClient->toPathValue($useCanonical);\n\t\t$queryParams['includeTags'] = $this->apiClient->toPathValue($includeTags);\n\t\t$resourcePath = str_replace(\"{\" . \"word\" . \"}\", $this->apiClient->toPathValue($word), $resourcePath);\n\t\t//make the API Call\n\t\tif (! isset($body)) {\n\t\t\t$body = array();\n\t\t}\n\t\t$response = $this->apiClient->callAPI($resourcePath, $method, $queryParams, $body, $headerParams);\n\n\n\t\tif(! $response){\n\t\t\tif (count($response) === 0) {\n\t\t\t\t$err = 'Response has length 0';\n\t\t\t} else {\n\t\t\t\t$err = 'Unknown Error';\n\t\t\t}\n\t\t\tthrow new \\Exception(\"Error: Response is falsey\" . $err, 1);\t\t\t\n\t\t}\n\n\t\t$responseObject = $this->apiClient->deserialize($response, 'array[Definition]');\n\t\treturn $responseObject;\n\n\t}",
"public function getWords(): array;",
"public function getRandomWord($has_definition=true) {\n $params = array();\n if (!$has_definition) {\n $params['hasDictionaryDef'] = false;\n }\n\t\treturn $this->callApi('/words.json/randomWord', $params);\n\t}",
"public function wordDefinitions($word)\n\t{\n\t\treturn new Requests\\Word\\DefinitionsRequest($this, $word);\n\t}",
"public function getRandomWord($includePartOfSpeech=null, $excludePartOfSpeech=null, $hasDictionaryDef=null, $minCorpusCount=null, $maxCorpusCount=null, $minDictionaryCount=null, $maxDictionaryCount=null, $minLength=null, $maxLength=null) {\n\n \t\t//parse inputs\n \t\t$resourcePath = \"/words.{format}/randomWord\";\n \t\t$resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n \t\t$method = \"GET\";\n $queryParams = array();\n $headerParams = array();\n $headerParams['Accept'] = 'application/json';\n $headerParams['Content-Type'] = 'application/json';\n\n if($hasDictionaryDef != null) {\n \t\t $queryParams['hasDictionaryDef'] = $this->apiClient->toQueryValue($hasDictionaryDef);\n \t\t}\n \t\tif($includePartOfSpeech != null) {\n \t\t $queryParams['includePartOfSpeech'] = $this->apiClient->toQueryValue($includePartOfSpeech);\n \t\t}\n \t\tif($excludePartOfSpeech != null) {\n \t\t $queryParams['excludePartOfSpeech'] = $this->apiClient->toQueryValue($excludePartOfSpeech);\n \t\t}\n \t\tif($minCorpusCount != null) {\n \t\t $queryParams['minCorpusCount'] = $this->apiClient->toQueryValue($minCorpusCount);\n \t\t}\n \t\tif($maxCorpusCount != null) {\n \t\t $queryParams['maxCorpusCount'] = $this->apiClient->toQueryValue($maxCorpusCount);\n \t\t}\n \t\tif($minDictionaryCount != null) {\n \t\t $queryParams['minDictionaryCount'] = $this->apiClient->toQueryValue($minDictionaryCount);\n \t\t}\n \t\tif($maxDictionaryCount != null) {\n \t\t $queryParams['maxDictionaryCount'] = $this->apiClient->toQueryValue($maxDictionaryCount);\n \t\t}\n \t\tif($minLength != null) {\n \t\t $queryParams['minLength'] = $this->apiClient->toQueryValue($minLength);\n \t\t}\n \t\tif($maxLength != null) {\n \t\t $queryParams['maxLength'] = $this->apiClient->toQueryValue($maxLength);\n \t\t}\n \t\t//make the API Call\n if (! isset($body)) {\n $body = null;\n }\n \t\t$response = $this->apiClient->callAPI($resourcePath, $method,\n \t\t $queryParams, $body,\n \t\t $headerParams);\n\n\n if(! $response){\n return null;\n }\n\n \t\t$responseObject = $this->apiClient->deserialize($response,\n \t\t 'WordObject');\n \t\treturn $responseObject;\n\n }",
"public function getRelatedWords($word, $count=10, $type=null) {\n\t\tif(is_null($word) || trim($word) == '') {\n\t\t\tthrow new InvalidParameterException(\"getRelatedWords expects word to be a string\");\n\t\t}\n $params = array();\n $params['count'] = $count;\n if (isset($type)) {\n $params['type'] = $type;\n }\n\t\treturn $this->callApi('/word.json/' . rawurlencode($word) . '/related', $params);\n\t}",
"public function findAllForWord($wordId){\n $sql = \"select * from definitions where word_id = ? order by likes desc\";\n $results = $this->getDb()->fetchAll($sql, array($wordId));\n\n if ($results) {\n $definitons = array();\n $word = $this->wordDAO->find($wordId);\n\n foreach ($results as $row) {\n $id = $row[\"id\"];\n $row[\"word\"] = $word;\n $definitions[$id] = $this->buildDomainObject($row);\n }\n\n // group definitions by language\n $jpDefs = array();\n $engDefs = array();\n\n foreach ($definitions as $definition) {\n if ($definition->getLanguage() == 'japanese'){\n $jpDefs[] = $definition;\n } else {\n $engDefs[] = $definition;\n }\n }\n\n $definitions = array(\n 'eng_definitions' => $engDefs,\n 'jp_definitions' => $jpDefs\n );\n\n // return definitions grouped by language\n return $definitions;\n } else { // no definitions is registered for given $wordId\n return null;\n }\n }",
"function getWord($word, $category_id)\r\n {\r\n $details = array();\r\n $crit = new CriteriaCompo(new Criteria('word', $word));\r\n $crit->add(new Criteria('category_id', $category_id));\r\n\r\n $ret = $this->con->query('SELECT count FROM '. $this->con->prefix('xhelp_bayes_wordfreqs'). $crit->renderWhere());\r\n\r\n if (!$ret) {\r\n $details['count'] = 0;\r\n } else {\r\n $details = $this->con->fetchRow($ret);\r\n }\r\n return $details;\r\n }",
"public function\tgetSemanticsForWord($word, $partOfSpeech);",
"public function getSuggestions($word_fragment, $count=10, $start_at=0) {\n\t\tif(is_null($word_fragment) || trim($word_fragment) == '') {\n\t\t\tthrow new InvalidParameterException(\"Autocomplete expects word to be a string\");\n\t\t}\n $params = array();\n $params['count'] = $count;\n $params['startAt'] = $start_at;\n\t\treturn $this->callApi('/suggest.json/' . rawurlencode($word_fragment), $params);\n\t}",
"public function searchWords($query, $includePartOfSpeech=null, $excludePartOfSpeech=null, $caseSensitive=null, $minCorpusCount=null, $maxCorpusCount=null, $minDictionaryCount=null, $maxDictionaryCount=null, $minLength=null, $maxLength=null, $skip=null, $limit=null) {\n\n \t\t//parse inputs\n \t\t$resourcePath = \"/words.{format}/search/{query}\";\n \t\t$resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n \t\t$method = \"GET\";\n $queryParams = array();\n $headerParams = array();\n $headerParams['Accept'] = 'application/json';\n $headerParams['Content-Type'] = 'application/json';\n\n if($caseSensitive != null) {\n \t\t $queryParams['caseSensitive'] = $this->apiClient->toQueryValue($caseSensitive);\n \t\t}\n \t\tif($includePartOfSpeech != null) {\n \t\t $queryParams['includePartOfSpeech'] = $this->apiClient->toQueryValue($includePartOfSpeech);\n \t\t}\n \t\tif($excludePartOfSpeech != null) {\n \t\t $queryParams['excludePartOfSpeech'] = $this->apiClient->toQueryValue($excludePartOfSpeech);\n \t\t}\n \t\tif($minCorpusCount != null) {\n \t\t $queryParams['minCorpusCount'] = $this->apiClient->toQueryValue($minCorpusCount);\n \t\t}\n \t\tif($maxCorpusCount != null) {\n \t\t $queryParams['maxCorpusCount'] = $this->apiClient->toQueryValue($maxCorpusCount);\n \t\t}\n \t\tif($minDictionaryCount != null) {\n \t\t $queryParams['minDictionaryCount'] = $this->apiClient->toQueryValue($minDictionaryCount);\n \t\t}\n \t\tif($maxDictionaryCount != null) {\n \t\t $queryParams['maxDictionaryCount'] = $this->apiClient->toQueryValue($maxDictionaryCount);\n \t\t}\n \t\tif($minLength != null) {\n \t\t $queryParams['minLength'] = $this->apiClient->toQueryValue($minLength);\n \t\t}\n \t\tif($maxLength != null) {\n \t\t $queryParams['maxLength'] = $this->apiClient->toQueryValue($maxLength);\n \t\t}\n \t\tif($skip != null) {\n \t\t $queryParams['skip'] = $this->apiClient->toQueryValue($skip);\n \t\t}\n \t\tif($limit != null) {\n \t\t $queryParams['limit'] = $this->apiClient->toQueryValue($limit);\n \t\t}\n \t\tif($query != null) {\n \t\t\t$resourcePath = str_replace(\"{\" . \"query\" . \"}\",\n \t\t\t $this->apiClient->toPathValue($query), $resourcePath);\n \t\t}\n \t\t//make the API Call\n if (! isset($body)) {\n $body = null;\n }\n \t\t$response = $this->apiClient->callAPI($resourcePath, $method,\n \t\t $queryParams, $body,\n \t\t $headerParams);\n\n\n if(! $response){\n return null;\n }\n\n \t\t$responseObject = $this->apiClient->deserialize($response,\n \t\t 'WordSearchResults');\n \t\treturn $responseObject;\n\n }",
"public function getRandomWords($includePartOfSpeech=null, $excludePartOfSpeech=null, $sortBy=null, $sortOrder=null, $hasDictionaryDef=null, $minCorpusCount=null, $maxCorpusCount=null, $minDictionaryCount=null, $maxDictionaryCount=null, $minLength=null, $maxLength=null, $limit=null) {\n\n \t\t//parse inputs\n \t\t$resourcePath = \"/words.{format}/randomWords\";\n \t\t$resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n \t\t$method = \"GET\";\n $queryParams = array();\n $headerParams = array();\n $headerParams['Accept'] = 'application/json';\n $headerParams['Content-Type'] = 'application/json';\n\n if($hasDictionaryDef != null) {\n \t\t $queryParams['hasDictionaryDef'] = $this->apiClient->toQueryValue($hasDictionaryDef);\n \t\t}\n \t\tif($includePartOfSpeech != null) {\n \t\t $queryParams['includePartOfSpeech'] = $this->apiClient->toQueryValue($includePartOfSpeech);\n \t\t}\n \t\tif($excludePartOfSpeech != null) {\n \t\t $queryParams['excludePartOfSpeech'] = $this->apiClient->toQueryValue($excludePartOfSpeech);\n \t\t}\n \t\tif($minCorpusCount != null) {\n \t\t $queryParams['minCorpusCount'] = $this->apiClient->toQueryValue($minCorpusCount);\n \t\t}\n \t\tif($maxCorpusCount != null) {\n \t\t $queryParams['maxCorpusCount'] = $this->apiClient->toQueryValue($maxCorpusCount);\n \t\t}\n \t\tif($minDictionaryCount != null) {\n \t\t $queryParams['minDictionaryCount'] = $this->apiClient->toQueryValue($minDictionaryCount);\n \t\t}\n \t\tif($maxDictionaryCount != null) {\n \t\t $queryParams['maxDictionaryCount'] = $this->apiClient->toQueryValue($maxDictionaryCount);\n \t\t}\n \t\tif($minLength != null) {\n \t\t $queryParams['minLength'] = $this->apiClient->toQueryValue($minLength);\n \t\t}\n \t\tif($maxLength != null) {\n \t\t $queryParams['maxLength'] = $this->apiClient->toQueryValue($maxLength);\n \t\t}\n \t\tif($sortBy != null) {\n \t\t $queryParams['sortBy'] = $this->apiClient->toQueryValue($sortBy);\n \t\t}\n \t\tif($sortOrder != null) {\n \t\t $queryParams['sortOrder'] = $this->apiClient->toQueryValue($sortOrder);\n \t\t}\n \t\tif($limit != null) {\n \t\t $queryParams['limit'] = $this->apiClient->toQueryValue($limit);\n \t\t}\n \t\t//make the API Call\n if (! isset($body)) {\n $body = null;\n }\n \t\t$response = $this->apiClient->callAPI($resourcePath, $method,\n \t\t $queryParams, $body,\n \t\t $headerParams);\n\n\n if(! $response){\n return null;\n }\n\n \t\t$responseObject = $this->apiClient->deserialize($response,\n \t\t 'array[WordObject]');\n \t\treturn $responseObject;\n\n }",
"public function retrieveDefinitionsFromDB()\r\n{\r\n $query_string = \"SELECT wordid, word FROM glossary\";\r\n\r\n return $query_string;\r\n}",
"public static function getSynonyms($word){\n\t\t// api prefix for Big Huge Thesaurus \n\t\t$api = \"http://words.bighugelabs.com/api/2/cea9d907d978fbd67304260c97b20d2d/\";\n\t\t// The word to lookup\n\t\t$lookfor = $word;\n\t\t// Form the complete URL\n\t\t$request_url = $api.$lookfor.'/json';\n\t\t// Get result in json\n\t\t$json = file_get_contents($request_url);\n\t\t// decode json into array\n\t\t$arr = json_decode($json, true);\n\t\t// Get only adjective and synonyms\n\t\t$syns = $arr['adjective']['syn'];\n\t\t$syns[] = $word;\n\t\treturn $syns;\n\t}",
"public function getDefinitionFromDB()\r\n{\r\n $query_string = \"SELECT word, worddefinition FROM glossary \";\r\n $query_string .= \"WHERE wordid = :wordid\";\r\n\r\n return $query_string;\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a new ProductReview entity. | public function createAction(Request $request)
{
$entity = new ProductReview();
$form = $this->createCreateForm($entity);
$form->handleRequest($request);
if ($form->isValid()) {
$em = $this->getDoctrine()->getManager();
$entity->setCreatedDate();
$entity->setModifiedDate();
$em->persist($entity);
$em->flush();
$this->session->getFlashBag()->add('notice', 'Review Added Successfully.');
return $this->redirect($this->generateUrl('product-review'));
//return $this->redirect($this->generateUrl('product-review_show', array('id' => $entity->getId())));
}
return $this->render('BitcoinAdminBundle:ProductReview:new.html.twig', array(
'entity' => $entity,
'form' => $form->createView(),
));
} | [
"public function actionCreate() {\n $model = new ProductReviews();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionAddReview() {\r\n $prod_id = $this->_input->filterSingle(\"product_id\", XenForo_Input::INT);\r\n $current_user = XenForo_Visitor::getInstance()->toArray();\r\n $user_review = $this->getModelFromCache('ProdsTool_Model_PTUtils')->getUserProductReview($current_user['user_id'], $prod_id);\r\n\t\tif (!$current_user['user_id'] || $user_review) { return $this->responseNoPermission(); }\r\n\r\n if(isset($_REQUEST['submit'])) {\r\n $data = $this->_input->filter(array(\"product_id\" => XenForo_Input::INT,\r\n \"title\" => XenForo_Input::STRING,\r\n \"rating\" => XenForo_Input::FLOAT,\r\n \"editor_rating\" => XenForo_Input::FLOAT));\r\n $data['description'] = $this->getHelper('Editor')->getMessageText('description', $this->_input);\r\n $data['created_by'] = $current_user['user_id'];\r\n $this->getModelFromCache('ProdsTool_Model_PTUtils')->createProductReview($data);\r\n\r\n $product = $this->getModelFromCache('ProdsTool_Model_PTUtils')->getProductDetails($data['product_id']);\r\n $redirect_link = 'pthome/product/'. ($data['editor_rating'] ? \"userreviews/\" : 'review/');\r\n return $this->responseRedirect(XenForo_ControllerResponse_Redirect::SUCCESS,\r\n XenForo_Link::buildPublicLink($redirect_link, $product),\r\n \"Review added successfully...\",\r\n array(\"review\" => \"add\"));\r\n }\r\n\r\n $viewParams = array();\r\n $product = $this->getModelFromCache('ProdsTool_Model_PTUtils')->getProductDetails($prod_id);\r\n $category = $this->getModelFromCache('ProdsTool_Model_PTUtils')->getProductCategoryDetails($prod_id);\r\n $viewParams = array(\"product\" => $product, \"category\" => $category);\r\n\r\n return $this->responseView('ProdsTool_ViewPublic_ProductAddReview', 'ProdsTool_ProductAddReview', $viewParams);\r\n }",
"public function createProductReview($data) {\r\n\t\t$editor_rating = $data['editor_rating'];\r\n\t\tunset($data['editor_rating']);\r\n\t\t$this->_getDb()->insert(\"pt_product_reviews\", $data);\r\n\r\n\t\t// Update the product overall rating\r\n// \t\tif($editor_rating) {\r\n\t\t\t$counts_sql = \"select count(id) as reviews_count, sum(rating) as total_rating from pt_product_reviews where product_id = ?\";\r\n\t\t\t$counts = $this->_getDb()->fetchRow($counts_sql, $data['product_id']);\r\n\t\t\t$rev_cnt = $counts['reviews_count'] - 1;\r\n\t\t\t$user_rating = ($rev_cnt > 1) ? (($counts['total_rating'] - $editor_rating) / $rev_cnt) : $data['rating'];\r\n\t\t\t$update_data = array(\"user_rating\" => $user_rating);\r\n// \t\t} else {\r\n// \t\t\t$update_data = array(\"editor_rating\" => $data['rating']);\r\n// \t\t}\r\n\t\t$this->_getDb()->update(\"pt_products\", $update_data, \" id = \" . $data['product_id']);\r\n\t}",
"public function add($productId = null)\n {\n $review = $this->Reviews->newEntity();\n if ($this->request->is('post')) {\n $review = $this->Reviews->patchEntity($review, $this->request->getData());\n $review->customer_id = $this->Reviews\n ->Customers\n ->find()\n ->where(['user_id' => $this->Auth->User('id')])\n ->first()\n ->id;\n if ($this->Reviews->save($review)) {\n $this->Flash->success(__('The review has been saved.'));\n\n return $this->redirect(['controller' => 'Products', 'action' => 'view', $productId]);\n }\n $this->Flash->error(__('The review could not be saved. Please, try again.'));\n }\n $this->set(compact('review', 'productId'));\n }",
"public function store(CreateProductRatingRequest $request)\n {\n $input = $request->all();\n\n $productRating = $this->productRatingRepository->create($input);\n\n Flash::success(trans('productRating.messages.created'));\n\n return redirect(route('productRatings.index'));\n }",
"public function created(RatingReview $ratingReview)\n {\n $product=Product::where('id',$ratingReview->entity_id)->first();\n $product->ratings=$product->starrating();\n $product->save();\n }",
"public function created(Review $review)\n {\n $this -> recalculateProductRating($review -> product_id);\n }",
"protected function _createReview($productId, $order)\n {\n $review = $this->reviewFactory->create();\n $product = $this->productRepository->getById($productId);\n\n //Set review\n $sentence = $this->dataHelper->getRandomSentence();\n $review->setEntityId($review->getEntityIdByCode(Review::ENTITY_PRODUCT_CODE))\n ->setEntityPkValue($productId)\n ->setStatusId(Review::STATUS_APPROVED)\n ->setCustomerId($order->getCustomerId())\n ->setStoreId($order->getStoreId())\n ->setStores([$order->getStoreId()])\n ->setTitle(substr($sentence, 0, strpos($sentence, ' ', 30)).'...')\n ->setNickname($order->getCustomerFirstname() . ' ' . $order->getCustomerLastname())\n ->setDetail($sentence)\n ->save();\n\n //Add rates for all ratings\n $ratings = $this->ratingsCollectionFactory;\n\n foreach ($ratings as $rating) {\n //Get best option for current rate\n $lastValue = 0;\n $options = $rating->getOptions();\n $optionId = null;\n $lastOptionId = null;\n\n foreach($options as $option)\n {\n if($option->getValue() > $lastValue)\n {\n $lastOptionId = $optionId;\n $optionId = $option->getId();\n }\n }\n\n //Random option ID between rate 4 and 5\n $optionId = ($lastOptionId && rand(1, 2) < 2)?$lastOptionId:$optionId;\n\n if($optionId)\n {\n $this->ratingFactory->create()\n ->setRatingId($rating->getId())\n ->setReviewId($review->getId())\n ->setCustomerId($order->getCustomerId())\n ->addOptionVote($optionId, $product->getId());\n }\n }\n\n $review->aggregate();\n }",
"public function add_review_rating_post() {\n\n $product_id = $this -> post('product_id') ? $this -> post('product_id') : \"\";\n $user_id = $this -> post('user_id') ? $this -> post('user_id') : \"\";\n\n $review_comment = $this -> post('review_comment') ? $this -> post('review_comment') : \"\";\n $review_rating = $this -> post('review_rating') ? $this -> post('review_rating') : \"\";\n\n $result = $this -> reviewmodel -> add_review_rating($user_id, $product_id, $review_comment, $review_rating);\n \n // Get Reviews for the product\n $allReviews = $this -> reviewmodel -> get_products_all_reviews($product_id);\t\n \n if ($result) { //If reviews added\n $retArr['status'] = SUCCESS;\n $retArr['message'] = \"Review added successfully\";\n $retArr['allReviews'] = ($allReviews);\n $this -> response($retArr, 200); // 200 being the HTTP response code\n die;\n }\n else { //If reviews exists already\n $retArr['status'] = FAIL;\n $retArr['message'] = \"Review already exists\";\n $retArr['allReviews'] = ($allReviews);\n $this -> response($retArr, 200); // 200 being the HTTP response code\n die;\n }\n }",
"public function actionCreate()\r\n {\r\n $model = new Review();\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n return $this->redirect(['view', 'id' => $model->id]);\r\n } else {\r\n return $this->render('create', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }",
"private function createCreateForm(ProductReview $entity)\n {\n $form = $this->createForm(new ProductReviewType(), $entity, array(\n 'action' => $this->generateUrl('product-review_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }",
"public function createAction()\n {\n $entity = new Product();\n $request = $this->getRequest();\n $form = $this->createForm(new ProductType(), $entity);\n $form->bind($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('BSDataBundle_product_show', array('id' => $entity->getId())));\n\n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView()\n );\n }",
"public function add_review($product_id) {\n\t\t$this->form_validation->set_rules($this->m_product_review->conf_review_input_form_val);\n\n\t\tif ($this->form_validation->run()) {\n\t\t\t$this->m_product_review->insert($this->input->post());\n\t\t\t$this->session->set_flashdata('success', 'Thanks for your review! Your review will be show after admin accepted this.');\n\t\t} else {\n\t\t\t$this->session->set_flashdata('err', validation_errors());\n\t\t}\n\n\t\tredirect('shop/product/detail/'.$product_id,'refresh');\n\t}",
"private function addReviews()\n {\n $this->_doQuery(\n \"\n INSERT INTO \" . $this->_getTableName(\n 'catalog_product_entity_text'\n ) . \" (\n attribute_id,\n store_id,\n entity_id,\n value\n )(\n SELECT\n \" . $this->_getProductAttributeId('reviews')\n . \",\n w.website,\n a.entity_id,\n b.Reviews\n FROM \" . $this->_getTableName(\n 'catalog_product_entity'\n ) . \" a\n INNER JOIN \" . $this->_getTableName(\n 'products_temp'\n ) . \" b\n ON a.store_product_id = b.store_product_id\n INNER JOIN \" . $this->_getTableName(\n 'products_website_temp'\n ) . \" w\n ON a.store_product_id=w.store_product_id\n )\n ON DUPLICATE KEY UPDATE\n value = b.Reviews\n \"\n );\n\n // product Reviews for all web sites\n $this->_doQuery(\n \"\n INSERT INTO \" . $this->_getTableName(\n 'catalog_product_entity_text'\n ) . \" (\n attribute_id,\n store_id,\n entity_id,\n value\n )(\n SELECT\n \" . $this->_getProductAttributeId('reviews')\n . \",\n 0,\n a.entity_id,\n b.Reviews\n FROM \" . $this->_getTableName(\n 'catalog_product_entity'\n ) . \" a\n INNER JOIN \" . $this->_getTableName(\n 'products_temp'\n ) . \" b\n ON a.store_product_id = b.store_product_id\n )\n ON DUPLICATE KEY UPDATE\n value = b.Reviews\n \"\n );\n }",
"public function store(CreateEServiceReviewRequest $request)\n {\n $input = $request->all();\n $customFields = $this->customFieldRepository->findByField('custom_field_model', $this->eServiceReviewRepository->model());\n try {\n $eServiceReview = $this->eServiceReviewRepository->create($input);\n $eServiceReview->customFieldsValues()->createMany(getCustomFieldsValues($customFields, $request));\n\n } catch (ValidatorException $e) {\n Flash::error($e->getMessage());\n }\n\n Flash::success(__('lang.saved_successfully', ['operator' => __('lang.e_service_review')]));\n\n return redirect(route('eServiceReviews.index'));\n }",
"public function postAction(){\n $return_result = array(\n 'code'=> 0,\n 'model'=> null,\n );\n $params = $this->postJsonParams();\n $product_id = $params('product_id');\n\n if ($data = Mage::getSingleton('review/session')->getFormData(true)) {\n $rating = array();\n if (isset($data['ratings']) && is_array($data['ratings'])) {\n $rating = $data['ratings'];\n }\n } else {\n $data = $params;\n $rating = isset($params['ratings'])?$params['ratings']:array();\n }\n $product = Mage::getModel('catalog/product')->setStoreId(Mage::app()->getStore()->getId())->load($product_id);\n if (($product) && !empty($data)) {\n $session = Mage::getSingleton('core/session');\n /* @var $session Mage_Core_Model_Session */\n $review = Mage::getModel('review/review')->setData($data);\n /* @var $review Mage_Review_Model_Review */\n $validate = $review->validate();\n if ($validate === true) {\n try {\n $review->setEntityId($review->getEntityIdByCode(Mage_Review_Model_Review::ENTITY_PRODUCT_CODE))\n ->setEntityPkValue($product->getId())\n ->setStatusId(Mage_Review_Model_Review::STATUS_PENDING)\n ->setCustomerId(Mage::getSingleton('customer/session')->getCustomerId())\n ->setStoreId(Mage::app()->getStore()->getId())\n ->setStores(array(Mage::app()->getStore()->getId()))\n ->save();\n foreach ($rating as $ratingId => $optionId) {\n Mage::getModel('rating/rating')\n ->setRatingId($ratingId)\n ->setReviewId($review->getId())\n ->setCustomerId(Mage::getSingleton('customer/session')->getCustomerId())\n ->addOptionVote($optionId, $product->getId());\n }\n $review->aggregate();\n $return_result['message'] = 'Your review has been accepted for moderation.';\n }\n catch (Exception $e) {\n $return_result['code'] = 1;\n $return_result['error'] = 'Unable to post the review.';\n }\n }\n else {\n $session->setFormData($data);\n if (is_array($validate)) {\n foreach ($validate as $errorMessage) {\n $return_result['error'] = $errorMessage;\n }\n }\n else {\n $return_result['error'] = 'Unable to post the review.';\n }\n }\n }\n echo json_encode($return_result);\n }",
"public function createAReview()\n {\n }",
"public function createProduct() {\n\n $name= $_POST[\"name\"];\n $status=$_POST[\"status\"];\n $category=$_POST[\"category\"];\n\n $var = Object_Product::create([\n \"name\" => $name,\n \"status\" => $status,\n \"category\" => $category,\n ]);\n\n $var->setKey($_POST[\"key\"]);\n $var->setParentId(48);\n $var->save();\n\n }",
"public function createProductAction(){\n $reponse = array(\n 'status' => \\Helpers\\Language::$postStatusFailure,\n 'message' => \\Helpers\\Language::$errorPostParameters\n );\n // must be a POST request\n if ($this->request->isPost() == true) {\n $params = $this->request->get();\n $product = new \\Multiple\\Models\\Product();\n foreach($params as $key => $value){\n \\Helpers\\Model::setCreateProperty($product,$key,$value);\n }\n $auth = $this->session->get('auth');\n $user = \\Multiple\\Models\\User::findFirst(array(\n \"username = :username:\",\n \"bind\" => array(\n \"username\" => $auth['username']\n )\n ));\n $product->created = 'NOW()';\n $product->created_by = $user->username;\n $response['message'] = 'Failed to create product';\n if($product->create()){\n $response['status'] = \\Helpers\\Language::$postStatusSuccess;\n $response['message'] = 'Product created successfully';\n $response['id'] = $product->id;\n }\n }\n \\Helpers\\Controller::jsonify($response);\n $this->view->disable();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determines if a Schule is participating at the schulwettbewerb. | public function isSchulwettbewerb() {
return $this->getSchulwettbewerb();
} | [
"public function isFainted()\n {\n return $this->getStamina() == 0;\n }",
"function isForSite()\n {\n if (count($this->getInvitee()) == 1) {\n return true;\n }\n \n return false;\n }",
"public function IsInTeam()\n\t{\n\t\treturn $this->IsStaff();\n\t}",
"public function hasSegwit()\n {\n return $this->segwit !== null;\n }",
"public function isSeniorVolunteer() : bool {\n return $this->type === Volunteer::TYPE_SENIOR ||\n $this->type === Volunteer::TYPE_STAFF;\n }",
"public function hasParticipations(): bool;",
"public function estTechnicien()\n\t{\n\t\tif(!empty($this->matricule))\n\t\t\tif(!($this->respAchat))\n\t\t\t\treturn true;\n\n\t\treturn false;\n\t}",
"public function hasGoCourier() {\n\n $courier = $this->getCourier();\n if (is_object($courier)) {\n return $courier->getId() == 3; // hard coded\n }\n return false;\n }",
"public function isStaff() {\n\t\tif ($this->staffId > 0) {\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}",
"public function isVideoConferenceProgrammed(){\n $today = new \\DateTime();\n if(!empty($this->begin_date_hour)) {\n $beginVideoConference = new \\DateTime($this->begin_date_hour);\n return ($beginVideoConference > $today);\n }\n return false;\n }",
"public function worksOnWeekends(): bool\n {\n return $this->weekend;\n }",
"public function isHtSupporter()\n\t{\n\t\tif(!isset($this->isHTSup) || $this->isHTSup === null)\n\t\t{\n\t\t\t$this->isHTSup = $this->getXml()->getElementsByTagName('SupporterTier')->item(0)->nodeValue != \"\";\n\t\t}\n\t\treturn $this->isHTSup;\n\t}",
"public function isStaff()\n\t{\n\t\treturn $this->role()->where('type', 'Staff')->exists();\n\t}",
"function isFaculty(){\r\n\t\tsession_start();\r\n\t\tif($_SESSION['role'] == \"Faculty\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"protected function isWorker() {\n\t\treturn $this->Session->read ( \"isWorker\" ) == 1;\n\t}",
"public function hasSchedule(): bool {\n $hasSchedule = false;\n if (!is_null($this->next_event_scheduled)) {\n $nextEventDate = strToTime($this->next_event_scheduled);\n $hasSchedule = ($nextEventDate > time());\n\n }\n return $hasSchedule;\n }",
"public function is_faculty_advisor() {\n if($this->username == sge::config('facadv')){\n return true;\n }\n return false;\n }",
"public function hasIsSoleProprietor()\n {\n return $this->IsSoleProprietor !== null;\n }",
"public function hasSeatAssignment(): boolean\n {\n return $this->getSeat() ? true : false;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Lists all TagLog models. | public function actionIndex()
{
$searchModel = new TagLogSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
} | [
"public function actionIndex()\n {\n $searchModel = new LogSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public static function getAllTags()\n {\n return Tag::find()->all();\n }",
"public function viewAllLogs()\n\t{\n\t\t$allLogs = array();\n\t\t\n\t\t$stmt=\"SELECT * FROM log ORDER BY log_id;\";\n\t\t$result=pg_query($stmt);\n\t\t\n\t\t//create an instance for every log entry and add it to the array\n\t\twhile($row=pg_fetch_assoc($result))\n\t\t\t$allLogs[] = new Log($row['log_id'], $row['log_date'], $row['log_time'], $row['type'], $row['whereabouts'], $row['username']);\n\t\t//return the array of all log entries\n\t\treturn $allLogs;\n\t}",
"public function listAction() {\n $logs = Modules_Dotnetcore_Logs_Helper::getServiceLogEntries();\n $logsList = new Modules_Dotnetcore_Logs_List($this->view, $this->_request, $logs);\n\n $this->view->list = $logsList;\n $this->view->tabs = Modules_Dotnetcore_Common_TabsHelper::getDomainTabs('logs');\n $this->view->pageTitle = pm_Locale::lmsg('pageLogsTitle', [\n 'domain' => $this->domain->getName()\n ]);\n }",
"public function actionIndex()\n {\n $searchModel = new AuditLogSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function getAllTags();",
"public function find_all() {\n\t\t\t// Return all \n\t\t\treturn $this->all = $this->db->query('SELECT * FROM logs', PDO::FETCH_ASSOC);\n\t\t}",
"public function getLogs()\n {\n $this->db->query(\"SELECT * FROM logs\");\n\n if ($this->db->execute()) {\n return $this->db->resultset();\n }\n }",
"public static function logActivityLists()\n {\n \treturn LogActivityModel::latest()->get();\n }",
"public function actionIndex() {\n $searchModel = new LogAbsensiSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n return $this->render(\n 'index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]\n );\n }",
"public function actionIndex()\n {\n $searchModel = new AdminLogSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function all() {\n return $this->app->entityManager->getRepository($this->model_name)->findAll();\n }",
"public function actionIndex()\n {\n $searchModel = new WebsightLogSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public static function getAll(){\n global $conn;\n $result_logs = array();\n $logs = $conn->query(\"SELECT * FROM log\")->fetchAll(PDO::FETCH_ASSOC);\n\n foreach($logs as $log_){\n $log = new Log();\n $data = json_decode($log_['atividade'], true);\n $log->atividade = $data['atividade'];\n if(isset($data['dados']))\n $log->dados = $data['dados'];\n if(isset($data['data']))\n $log->dados = $data['data'];\n $log->tempo = new DateTime($log_['tempo']);\n $log->dados_sessao = json_decode($log_['dados_sessao'], true);\n array_push($result_logs, $log);\n }\n\n return $result_logs;\n }",
"public function index(){\n return view('admin.logs.index', [\n 'logs' => Log::orderBy('id', 'desc')->get()\n ]);\n }",
"function getAllLogEvents() {\n $sql = \"SELECT * FROM \\\"LogEvents\\\" ORDER BY \\\"ID\\\";\";\n return $this->getLogEventsImpl($sql);\n }",
"public function actionIndex()\n {\n $searchModel = new LogExpSearchModel();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function fetchAllTags() {\n $data = $this->tagModel->getAllTags();\n\n return $data;\n }",
"public function allTags()\n {\n // fetch settings\n $setting=Helper::settings();\n\n // fetch header category\n $headCategories =Helper::headerCategories(5);\n\n // fetch footer category\n $footerCategories=Helper::footerCategories(50);\n\n // fetch all Tag\n $allTag=Helper::allTags('','title','asc');\n\n return view('front.all-tags')\n ->with('headCategories',$headCategories)\n ->with('footerCategories',$footerCategories)\n ->with('setting',$setting)\n ->with('tags',$allTag);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get a job addon expiration date | function _jr_job_addon_expire_date( $addon, $job_id ) {
$enabled = get_post_meta( $job_id, $addon, true);
if ( ! $enabled )
return;
$start_date = get_post_meta( $job_id, $addon . '_start_date', true);
$duration = get_post_meta( $job_id, $addon.'_duration', true );
if( !$start_date || !$duration ){
return 'never';
}
return jr_get_expiration_date( $start_date, $duration );
} | [
"public function getExpirationDate();",
"public static function expiration()\n {\n return strtotime( \"+\" . self::EXPIRATION );\n }",
"function jr_get_addon_expire_date( $addon, $job_id = 0, $user_id = 0 ) {\n\n\t$user_id = !empty( $user_id ) ? $user_id : get_current_user_id();\n\n\t$expire_date = '';\n\n\t$addons = jr_get_addons( 'job' );\n\tif ( in_array( $addon, $addons ) && $job_id ) {\n\t\t$expire_date = _jr_job_addon_expire_date( $job_id, $addon );\n\t} else {\n\t\t$addons = jr_get_addons( 'user' );\n\t\tif ( in_array( $addon, $addons ) )\n\t\t\t$expire_date =_jr_user_addon_expire_date( $user_id, $addon );\n\t}\n\treturn $expire_date;\n}",
"public function getExpirationDate()\r\n {\r\n\r\n return $this->expiration_date;\r\n }",
"public function getExpirationDate()\n {\n return $this->expiration_date;\n }",
"public function get_expire_date() {\n $expire_date = '';\n $account_info = $this->account_model->getAccountInfo($this->properties['lis.account']);\n\n $old_expire_date = $account_info['expire_date'];\n $status = $account_info['status'];\n\n if($status == 'premium') {\n $timediff = $this->lis_tz[$this->properties['lis.timezone']];\n $days_remaining = getDaysRemaining($old_expire_date,$timediff);\n if($days_remaining <= 60) { // only if the days remaining are less than 60 then add a year\n $expire_date = addDaysToDate($old_expire_date, 365);\n }\n }\n else {\n $expire_date = addDaysToDate($this->get_lis_date(), 365);\n }\n return $expire_date;\n }",
"public function getExpirationDate()\n {\n return $this->expirationDate;\n }",
"public function get_default_expiration_date() {\n return (strtotime('+ ' . $this->expiresby . ' months'));\n }",
"public function GetExpiryDate();",
"public function get_expiration() {\n\t\t$days = get_theme_mod( 'wfc_cookie_duration', 30 );\n\t\t$days = absint( $days );\n\t\t$expiration = time() + 86400 * $days;\n\n\t\treturn $expiration;\n\t}",
"public function getExpiration()\n { \n return $this->expiration;\n }",
"public function expirationDate()\n {\n return $this->isDurable() ? new \\DateTime(sprintf('+%d %s', $this->duration, $this->durationUnit)) : null;\n }",
"function cs_update_job_expired_date($cs_trans_id = '') {\n $transaction_listing_expiry = get_post_meta($cs_trans_id, 'cs_transaction_listing_expiry', true);\n $transaction_listing_period = get_post_meta($cs_trans_id, 'cs_transaction_listing_period', true);\n\n $cs_adexp = date('Y-m-d H:i:s');\n if (isset($transaction_listing_expiry) && is_numeric($transaction_listing_expiry)) {\n\tif ($transaction_listing_period == \"days\") {\n\t $cs_adexp = date('Y-m-d H:i:s', strtotime(\"+\" . $transaction_listing_expiry . \" days\"));\n\t} elseif ($transaction_listing_period == \"months\") {\n\t $cs_adexp = date('Y-m-d H:i:s', strtotime(\"+\" . $transaction_listing_expiry . \" months\"));\n\t} elseif ($transaction_listing_period == \"years\") {\n\t $cs_adexp = date('Y-m-d H:i:s', strtotime(\"+\" . $transaction_listing_expiry . \" years\"));\n\t} else {\n\t $cs_adexp = '';\n\t}\n }\n return $cs_adexp;\n}",
"public function expiration_date()\n {\n $app = $this->entity->app;\n\n if ($app) {\n if ($app->renewal_date) {\n return $app->renewal_date;\n } else if ($app->renewal_years && $this->entity->approved_at) {\n $date = Carbon::parse($this->entity->approved_at);\n $date->addYears($app->renewal_years);\n return $date->toDateTimeString();\n }\n } else {\n return $this->entity->renewal_date->toDateTimeString();\n }\n }",
"function _jr_user_addon_expire_date( $user_id, $addon ) {\n\n\t$enabled = get_user_meta( $user_id, $addon, true);\n\tif ( ! $enabled )\n\t\treturn;\n\n\t$start_date = get_user_meta( $user_id, $addon . '_start_date', true);\n\t$duration = get_user_meta( $user_id, $addon.'_duration', true );\n\n\tif( !$start_date || !$duration ){\n\t\treturn 'never';\n\t}\n\treturn jr_get_expiration_date( $start_date, $duration );\n}",
"public function getExpirationTime( );",
"function jr_get_expiration_date( $start_date, $duration ) {\n\t$expiration_date = strtotime( $start_date . ' + ' . $duration . 'days' );\n\treturn appthemes_display_date( $expiration_date, 'date' );\n}",
"function get_expiration()\n\t{\n\t\treturn $this->cache_expiration;\n\t}",
"public function getExpirationDate()\n {\n return isset($this->response[\"expires\"]) ? new \\DateTime($this->response[\"expires\"]) : null;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
2.1 Connection handling methods 2.1.1 : Connects to the server. Just creates a connection which is used in all later access to the LDAP server. If it can't connect and bind anonymously, it creates an error code of 1. Returns true if connected, false if failed. Takes an array of possible servers if one doesn't work, it tries the next and so on. | function connect() {
foreach ($this->server as $key => $host) {
$this->connection = ldap_connect( $host);
if ( $this->connection) {
if ($this->serverType == "ActiveDirectory") {
return true;
} else {
// Connected, now try binding anonymously
$this->result=@ldap_bind( $this->connection);
}
return true;
}
}
$this->ldapErrorCode = -1;
$this->ldapErrorText = "Unable to connect to any server";
return false;
} | [
"protected function _openLDAP() {\n if($this->con) return true; // connection already established\n\n $this->bound = 0;\n\n $port = $this->getConf('port');\n $bound = false;\n $servers = explode(',', $this->getConf('server'));\n foreach($servers as $server) {\n $server = trim($server);\n $this->con = @ldap_connect($server, $port);\n if(!$this->con) {\n continue;\n }\n\n /*\n * When OpenLDAP 2.x.x is used, ldap_connect() will always return a resource as it does\n * not actually connect but just initializes the connecting parameters. The actual\n * connect happens with the next calls to ldap_* funcs, usually with ldap_bind().\n *\n * So we should try to bind to server in order to check its availability.\n */\n\n //set protocol version and dependend options\n if($this->getConf('version')) {\n if(!@ldap_set_option(\n $this->con, LDAP_OPT_PROTOCOL_VERSION,\n $this->getConf('version')\n )\n ) {\n error('Setting LDAP Protocol version '.$this->getConf('version').' failed', -1);\n $this->_debug('LDAP version set: '.htmlspecialchars(ldap_error($this->con)), 0, __LINE__, __FILE__);\n } else {\n //use TLS (needs version 3)\n if($this->getConf('starttls')) {\n if(!@ldap_start_tls($this->con)) {\n error('Starting TLS failed', -1);\n $this->_debug('LDAP TLS set: '.htmlspecialchars(ldap_error($this->con)), 0, __LINE__, __FILE__);\n }\n }\n // needs version 3\n if($this->getConf('referrals')) {\n if(!@ldap_set_option(\n $this->con, LDAP_OPT_REFERRALS,\n $this->getConf('referrals')\n )\n ) {\n error('Setting LDAP referrals to off failed', -1);\n $this->_debug('LDAP referal set: '.htmlspecialchars(ldap_error($this->con)), 0, __LINE__, __FILE__);\n }\n }\n }\n }\n\n //set deref mode\n if($this->getConf('deref')) {\n if(!@ldap_set_option($this->con, LDAP_OPT_DEREF, $this->getConf('deref'))) {\n error('Setting LDAP Deref mode '.$this->getConf('deref').' failed', -1);\n $this->_debug('LDAP deref set: '.htmlspecialchars(ldap_error($this->con)), 0, __LINE__, __FILE__);\n }\n }\n /* As of PHP 5.3.0 we can set timeout to speedup skipping of invalid servers */\n if(defined('LDAP_OPT_NETWORK_TIMEOUT')) {\n ldap_set_option($this->con, LDAP_OPT_NETWORK_TIMEOUT, 1);\n }\n\n if($this->getConf('binddn') && $this->getConf('bindpw')) {\n $bound = @ldap_bind($this->con, $this->getConf('binddn'), $this->getConf('bindpw'));\n $this->bound = 2;\n } else {\n $bound = @ldap_bind($this->con);\n }\n if($bound) {\n break;\n }\n }\n\n if(!$bound) {\n error(\"LDAP: couldn't connect to LDAP server\", -1);\n return false;\n }\n\n $this->cando['getUsers'] = true;\n return true;\n }",
"private function _connect_ldap() {\n if($this->tls_ca_cert) {\n // Create temporary CA certificate file\n $this->tmp_tls_ca_certfile = $this->_create_tmp_file($this->tls_ca_cert);\n }\n if($this->tls_cert) {\n // Create temporary certificate file\n $this->tmp_tls_certfile = $this->_create_tmp_file($this->tls_cert);\n }\n if($this->tls_key) {\n // Create temporary key file\n $this->tmp_tls_keyfile = $this->_create_tmp_file($this->tls_key);\n }\n\n // Loop over all configured LDAP servers and attempt connection\n foreach($this->servers as $i => $server) {\n // Validate server connection string\n $this->ldap_connection = ldap_connect($server);\n\n if($this->ldap_connection) {\n log_message(\"info\", \"LDAP connection endpoint \\\"\" . $server . \"\\\" valid.\");\n \n // Set LDAP protocol version\n if(! ldap_set_option($this->ldap_connection, LDAP_OPT_PROTOCOL_VERSION, 3)) {\n log_message(\"error\", \"Error setting LDAPv3.\");\n show_error(\"Error setting LDAPv3.\", 500, $heading = \"An Error Was Encountered\");\n }\n // Set LDAP referrals to 0\n if(! ldap_set_option($this->ldap_connection, LDAP_OPT_REFERRALS, 0)) {\n log_message(\"error\", \"Error setting Referrals to 0.\");\n show_error(\"Error setting Referrals to 0.\", 500, $heading = \"An Error Was Encountered\");\n }\n // Set LDAP connection timeout to 10 seconds\n if(! ldap_set_option($this->ldap_connection, LDAP_OPT_NETWORK_TIMEOUT, 10)) {\n log_message(\"error\", \"Error setting connection timeout.\");\n show_error(\"Error setting connection timeout.\", 500, $heading = \"An Error Was Encountered\");\n }\n // Check if TLS required\n if($this->tls_required) {\n // Switch statement to determine if REQUIRE_CERT should be FALSE, NEVER, HARD, DEMAND, ALLOW, TRY\n switch($this->tls_required) {\n case \"NEVER\":\n // Set REQUIRE_CERT to Never\n if(! ldap_set_option($this->ldap_connection, LDAP_OPT_X_TLS_REQUIRE_CERT, LDAP_OPT_X_TLS_NEVER)) {\n log_message(\"error\", \"Error setting TLS REQCERT to NEVER.\");\n show_error(\"Error setting TLS REQCERT to NEVER.\", 500, $heading = \"An Error Was Encountered\");\n }\n break;\n case \"HARD\":\n // Set REQUIRE_CERT to Never\n if(! ldap_set_option($this->ldap_connection, LDAP_OPT_X_TLS_REQUIRE_CERT, LDAP_OPT_X_TLS_HARD)) {\n log_message(\"error\", \"Error setting TLS REQCERT to HARD.\");\n show_error(\"Error setting TLS REQCERT to HARD.\", 500, $heading = \"An Error Was Encountered\");\n }\n break;\n case \"DEMAND\":\n // Set REQUIRE_CERT to Never\n if(! ldap_set_option($this->ldap_connection, LDAP_OPT_X_TLS_REQUIRE_CERT, LDAP_OPT_X_TLS_DEMAND)) {\n log_message(\"error\", \"Error setting TLS REQCERT to DEMAND.\");\n show_error(\"Error setting TLS REQCERT to DEMAND.\", 500, $heading = \"An Error Was Encountered\");\n }\n break;\n case \"ALLOW\":\n // Set REQUIRE_CERT to Never\n if(! ldap_set_option($this->ldap_connection, LDAP_OPT_X_TLS_REQUIRE_CERT, LDAP_OPT_X_TLS_ALLOW)) {\n log_message(\"error\", \"Error setting TLS REQCERT to ALLOW.\");\n show_error(\"Error setting TLS REQCERT to ALLOW.\", 500, $heading = \"An Error Was Encountered\");\n }\n break;\n case \"TRY\":\n // Set REQUIRE_CERT to Never\n if(! ldap_set_option($this->ldap_connection, LDAP_OPT_X_TLS_REQUIRE_CERT, LDAP_OPT_X_TLS_TRY)) {\n log_message(\"error\", \"Error setting TLS REQCERT to TRY.\");\n show_error(\"Error setting TLS REQCERT to TRY.\", 500, $heading = \"An Error Was Encountered\");\n }\n break;\n default:\n // Set REQUIRE_CERT to TRY\n if(! ldap_set_option($this->ldap_connection, LDAP_OPT_X_TLS_REQUIRE_CERT, LDAP_OPT_X_TLS_TRY)) {\n log_message(\"error\", \"Error setting TLS REQCERT to TRY.\");\n show_error(\"Error setting TLS REQCERT to TRY.\", 500, $heading = \"An Error Was Encountered\");\n }\n break;\n }\n\n if($this->tls_ca_cert) {\n // Set CACERTFILE location to the tmp_tls_ca_certfile path\n if(! ldap_set_option($this->ldap_connection, LDAP_OPT_X_TLS_CACERTFILE, $this->tmp_tls_ca_certfile)) {\n log_message(\"error\", \"Error setting the TLS CA Certificate file.\");\n show_error(\"Error setting the TLS CA Certificate file.\", 500, $heading = \"An Error Was Encountered\");\n }\n }\n if($this->tls_cert) {\n // Set CERTFILE location to the tmp_tls_certfile path\n if(! ldap_set_option($this->ldap_connection, LDAP_OPT_X_TLS_CERTFILE, $this->tmp_tls_certfile)) {\n log_message(\"error\", \"Error setting the TLS Certificate file.\");\n show_error(\"Error setting the TLS Certificate file.\", 500, $heading = \"An Error Was Encountered\");\n }\n }\n if($this->tls_key) {\n // Set KEYFILE location to the tmp_tls_keyfile path\n if(! ldap_set_option($this->ldap_connection, LDAP_OPT_X_TLS_KEYFILE, $this->tmp_tls_keyfile)) {\n log_message(\"error\", \"Error setting the TLS Key file.\");\n show_error(\"Error setting the TLS Key file.\", 500, $heading = \"An Error Was Encountered\");\n }\n }\n if($this->start_tls) {\n // Start TLS\n ldap_start_tls($this->ldap_connection);\n }\n }\n \n // Bind to LDAP for user lookup\n if($this->bind_user_dn) {\n // Perform authenticated bind\n $bind = ldap_bind($this->ldap_connection, $this->bind_user_dn, $this->bind_user_pw);\n } else {\n // Perform anonymous bind\n $bind = ldap_bind($this->ldap_connection);\n }\n\n // Break out of foreach loop if bind is successful\n if($bind) {\n log_message(\"info\", \"Connection to \" . $server . \" successful.\");\n break;\n } else {\n log_message(\"info\", \"Connection to \" . $server . \" failed.\");\n }\n } else {\n log_message(\"info\", \"LDAP connection endpoint \\\"\" . $server . \"\\\" invalid.\");\n }\n }\n\n if(! $this->ldap_connection) {\n log_message(\"error\", \"Error connecting to all defined LDAP servers.\");\n show_error(\"Error connecting to all defined LDAP servers.\", 500, $heading = \"An Error Was Encountered\");\n }\n\n // Check if bind succeeded\n if(! $bind) {\n log_message(\"error\", \"Error performing initial LDAP bind. Request originated from \" . $this->client_ip . \".\");\n show_error(\"Error performing initial LDAP bind. Request originated from \" . $this->client_ip . \".\", 500, $heading = \"An Error Was Encountered\");\n }\n\n return TRUE;\n }",
"protected function _connect()\n {\n /* Connecting is briefly described in RFC1777. Basicly it works like\n * this:\n * 1. set up TCP connection\n * 2. secure that connection if neccessary\n * 3a. setVersion to tell server which version we want to speak\n * 3b. perform bind\n * 3c. setVersion to tell server which version we want to speak\n * together with a test for supported versions\n * 4. set additional protocol options */\n\n /* Return if we are already connected. */\n if ($this->_link) {\n return;\n }\n\n /* Connnect to the LDAP server if we are not connected. Note that\n * ldap_connect() may return a link value even if no connection is\n * made. We need to do at least one anonymous bind to ensure that a\n * connection is actually valid.\n *\n * See: http://www.php.net/manual/en/function.ldap-connect.php */\n\n /* Default error message in case all connection attempts fail but no\n * message is set. */\n $current_error = new Horde_Ldap_Exception('Unknown connection error');\n\n /* Catch empty $_hostList arrays. */\n if (!is_array($this->_hostList) || !count($this->_hostList)) {\n throw new Horde_Ldap_Exception('No servers configured');\n }\n\n /* Cycle through the host list. */\n foreach ($this->_hostList as $host) {\n /* Ensure we have a valid string for host name. */\n if (is_array($host)) {\n $current_error = new Horde_Ldap_Exception('No Servers configured');\n continue;\n }\n\n /* Skip this host if it is known to be down. */\n if (in_array($host, $this->_downHostList)) {\n continue;\n }\n\n /* Record the host that we are actually connecting to in case we\n * need it later. */\n $this->_config['hostspec'] = $host;\n\n /* Attempt a connection. */\n $this->_link = @ldap_connect($host, $this->_config['port']);\n if (!$this->_link) {\n $current_error = new Horde_Ldap_Exception('Could not connect to ' . $host . ':' . $this->_config['port']);\n $this->_downHostList[] = $host;\n continue;\n }\n\n /* If we're supposed to use TLS, do so before we try to bind, as\n * some strict servers only allow binding via secure\n * connections. */\n if ($this->_config['tls']) {\n try {\n $this->startTLS();\n } catch (Horde_Ldap_Exception $e) {\n $current_error = $e;\n $this->_link = false;\n $this->_downHostList[] = $host;\n continue;\n }\n }\n\n /* Try to set the configured LDAP version on the connection if LDAP\n * server needs that before binding (eg OpenLDAP).\n * This could be necessary since RFC 1777 states that the protocol\n * version has to be set at the bind request.\n * We use force here which means that the test in the rootDSE is\n * skipped; this is neccessary, because some strict LDAP servers\n * only allow to read the LDAP rootDSE (which tells us the\n * supported protocol versions) with authenticated clients.\n * This may fail in which case we try again after binding.\n * In this case, most probably the bind() or setVersion() call\n * below will also fail, providing error messages. */\n $version_set = false;\n $this->setVersion(0, true);\n\n /* Attempt to bind to the server. If we have credentials\n * configured, we try to use them, otherwise it's an anonymous\n * bind.\n * As stated by RFC 1777, the bind request should be the first\n * operation to be performed after the connection is established.\n * This may give an protocol error if the server does not support\n * v2 binds and the above call to setVersion() failed.\n * If the above call failed, we try an v2 bind here and set the\n * version afterwards (with checking to the rootDSE). */\n try {\n $this->bind();\n } catch (Exception $e) {\n /* The bind failed, discard link and save error msg.\n * Then record the host as down and try next one. */\n if ($this->errorName($e->getCode()) == 'LDAP_PROTOCOL_ERROR' &&\n !$version_set) {\n /* Provide a finer grained error message if protocol error\n * arises because of invalid version. */\n $e = new Horde_Ldap_Exception($e->getMessage() . ' (could not set LDAP protocol version to ' . $this->_config['version'].')', $e->getCode());\n }\n $this->_link = false;\n $current_error = $e;\n $this->_downHostList[] = $host;\n continue;\n }\n\n /* Set desired LDAP version if not successfully set before.\n * Here, a check against the rootDSE is performed, so we get a\n * error message if the server does not support the version.\n * The rootDSE entry should tell us which LDAP versions are\n * supported. However, some strict LDAP servers only allow\n * bound users to read the rootDSE. */\n if (!$version_set) {\n try {\n $this->setVersion();\n } catch (Exception $e) {\n $current_error = $e;\n $this->_link = false;\n $this->_downHostList[] = $host;\n continue;\n }\n }\n\n /* Set LDAP parameters, now that we know we have a valid\n * connection. */\n if (isset($this->_config['options']) &&\n is_array($this->_config['options']) &&\n count($this->_config['options'])) {\n foreach ($this->_config['options'] as $opt => $val) {\n try {\n $this->setOption($opt, $val);\n } catch (Exception $e) {\n $current_error = $e;\n $this->_link = false;\n $this->_downHostList[] = $host;\n continue 2;\n }\n }\n }\n\n /* At this stage we have connected, bound, and set up options, so\n * we have a known good LDAP server. Time to go home. */\n return;\n }\n\n /* All connection attempts have failed, return the last error. */\n throw $current_error;\n }",
"function connect()\n\t{\n\t\tglobal $lang;\n\t\t$this->ldapconn = ldap_connect($this->ldapconfig['host'])\n\t \tor die($lang['posixldapauth_could_not_connect_to_ldap_server']);\n\t\tldap_set_option($this->ldapconn, LDAP_OPT_PROTOCOL_VERSION, 3);\n\t\t// set referals to 0 to search the entire AD! - Added April 2014\n\t\t\n\t\tif ($this->ldap_debug) { error_log( __FILE__ . \" \" . __METHOD__ . \" \" . __LINE__ . \" Connected to LDAP Server \" . $this->ldapconfig['host']); }\n\t\treturn 1;\n\t}",
"public function connect()\n {\n //Connection to LDAP\n //ldap_connect always has a return value, even if LDAP is not reachable\n $this->ldapConnection = ldap_connect($this->ldapHost);\n\n //Set options\n ldap_set_option($this->ldapConnection, LDAP_OPT_PROTOCOL_VERSION, 3);\n ldap_set_option($this->ldapConnection, LDAP_OPT_REFERRALS, 0);\n //ldap_set_option($this->ldapConnection, LDAP_OPT_DEBUG_LEVEL, 7);\n\n //StartTLS\n ldap_start_tls($this->ldapConnection);\n\n //Check trough anonymous bind if LDAP is reachable\n if (ldap_bind($this->ldapConnection)) {\n $message = \"connect - Connection to LDAP-Server (\" . $this->ldapHost . \") successfully established.\";\n $this->logger->info($message);\n //$this->setStatus($message, LOGLEVEL::INFO);\n } else {\n $errorMessage = $this->getLdapError(\"connect - Error: Connection to LDAP-Server (\" . $this->ldapHost . \") could not be established.\");\n $this->logger->error($errorMessage);\n //$this->setStatus($errorMessage, LOGLEVEL::ERROR);\n $this->connected = false;\n return false;\n }\n\n //Authentication bind to access data (anonymous cant read)\n if (ldap_bind($this->ldapConnection, $this->ldapUser, $this->ldapPassword)) {\n $message = \"connect - Bind successfull.\";\n $this->logger->info($message);\n //$this->setStatus($message, LOGLEVEL::INFO);\n $this->connected = true;\n } else {\n $errorMessage = $this->getLdapError(\"connect - Error: Bind failed.\");\n $this->logger->error($errorMessage);\n //$this->setStatus($errorMessage, LOGLEVEL::ERROR);\n $this->connected = false;\n return false;\n }\n return true;\n }",
"public function connect($bindDN = null, $passwd = null) {\n\t\t$config = array_merge($this->_baseConfig, $this->config);\n\t\t$this->connected = false;\n\t\t$hasFailover = false;\n\t\tif (isset($config['host']) && is_array($config['host'])) {\n\t\t\t$config['host'] = $config['host'][$this->_multiMasterUse];\n\t\t\tif (count($this->config['host']) > (1 + $this->_multiMasterUse)) {\n\t\t\t\t$hasFailover = true;\n\t\t\t}\n\t\t}\n\t\t$bindDN = empty($bindDN) ? $config['login'] : $bindDN;\n\t\t$bindPasswd = empty($passwd) ? $config['password'] : $passwd;\n\t\t$this->database = ldap_connect($config['host']);\n\t\tif (!$this->database) {\n\t\t\t//Try Next Server Listed\n\t\t\tif ($hasFailover) {\n\t\t\t\t$this->log('Trying Next LDAP Server in list:' . $this->config['host'][$this->_multiMasterUse], 'ldap.error');\n\t\t\t\t$this->_multiMasterUse++;\n\t\t\t\t$this->connect($bindDN, $passwd);\n\t\t\t\tif ($this->connected) {\n\t\t\t\t\treturn $this->connected;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//Set our protocol version usually version 3\n\t\tldap_set_option($this->database, LDAP_OPT_PROTOCOL_VERSION, $config['version']);\n\n\t\tif ($config['tls']) {\n\t\t\tif (!ldap_start_tls($this->database)) {\n\t\t\t\t$this->log(\"Ldap_start_tls failed\", 'ldap.error');\n\t\t\t\treturn $this->disconnect();\n\t\t\t}\n\t\t}\n\t\t//So little known fact, if your php-ldap lib is built against openldap like pretty much every linux\n\t\t//distro out their like redhat, suse etc. The connect doesn't acutally happen when you call ldap_connect\n\t\t//it happens when you call ldap_bind. So if you are using failover then you have to test here also.\n\t\t$bindResult = @ldap_bind($this->database, $bindDN, $bindPasswd); // @codingStandardsIgnoreLine\n\t\tif (!$bindResult) {\n\t\t\tif (ldap_errno($this->database) == 49) {\n\t\t\t\t$this->log(\"Auth failed for '$bindDN'!\", 'ldap.error');\n\t\t\t} else {\n\t\t\t\t$this->log('Trying Next LDAP Server in list:' . $this->config['host'][$this->_multiMasterUse], 'ldap.error');\n\t\t\t\t$this->_multiMasterUse++;\n\t\t\t\t$this->connect($bindDN, $passwd);\n\t\t\t\tif ($this->connected) {\n\t\t\t\t\treturn $this->connected;\n\t\t\t\t}\n\t\t\t}\n\n\t\t} else {\n\t\t\t$this->connected = true;\n\t\t}\n\t\treturn $this->connected;\n\t}",
"public function connect()\n {\n $connection = $this->getConnection();\n\n try {\n // We'll only attempt connecting if we're not already bound to\n // the LDAP server so we prevent multiple rebind attempts.\n if (! $connection->isConnected() || $this->force) {\n $this->attempt($connection);\n }\n\n $this->connected();\n } catch (Exception $ex) {\n $this->failed($ex);\n }\n }",
"function create_connection()\n\t{\n\t\t/** -------------------------------------\n\t\t/** Connect to Server\n\t\t/** -------------------------------------*/\n\n\t\tif ($this->conn !== FALSE)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t$port = (ee()->config->item('ldap_port') === FALSE OR ee()->config->item('ldap_port') == '') ? 389 : ee()->config->item('ldap_port');\n\n\t\tif ( ! $this->conn = @ldap_connect(ee()->config->item('ldap_server'), $port))\n\t\t{\n\t\t\t$this->output_error();\n\t\t\treturn FALSE;\n\t\t}\n\n\t\tldap_set_option($this->conn, LDAP_OPT_PROTOCOL_VERSION, 3);\n\n\t\t/** -------------------------------------\n\t\t/** Enable DLS\n\t\t/** -------------------------------------*/\n\n\t\tif (ee()->config->item('ldap_enable_dls') == 'y')\n\t\t{\n\t\t\tif ( ! @ldap_start_tls($this->conn))\n\t\t\t{\n\t\t\t\t$this->output_error();\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\n\t\t/** -------------------------------------\n\t\t/** Bind!\n\t\t/** -------------------------------------*/\n\n\t\tif ( ! ee()->config->item('ldap_manager_dn') && ! ee()->config->item('ldap_manager_pass'))\n\t\t{\n\t\t\tif ( ! @ldap_bind($this->conn))\n\t\t\t{\n\t\t\t\t$this->output_error();\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ( ! preg_match('/^(\\w+=\\w+,)*\\w+=\\w+$/', ee()->config->item('ldap_manager_dn')))\n\t\t\t{\n\t\t\t\t$this->output_error('Manager DN is invalidly formed');\n\t\t\t\treturn FALSE;\n\t\t\t}\n\n\n\t\t\tif ( ! @ldap_bind($this->conn, ee()->config->item('ldap_manager_dn'), ee()->config->item('ldap_manager_pass')))\n\t\t\t{\n\t\t\t\t$this->output_error();\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t}",
"function ldap_get_connection()\n {\n // Try all uris until one server is responding\n $uris= explode(',', get_option('ldap_uris'));\n $ds= null;\n $bind= false;\n foreach ($uris as $uri) {\n $ds= ldap_connect($uri);\n\n // Set LDAP version if requested, if it does not work, use next server\n if (get_option('ldap_v3') == 'true'){\n if (!ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3)) {\n next;\n }\n }\n\n // Anonymous bind?\n if (get_option('ldap_dn') == ''){\n $bind= @ldap_bind($ds);\n } else {\n $bind= @ldap_bind($ds, get_option('ldap_dn'), get_option('ldap_password'));\n }\n\n // Server down? Try next...\n if (!$bind && ldap_errno($ds) == 81) {\n next;\n }\n }\n\n return $bind?$ds:null;\n }",
"public function testConnection()\n {\n $connection = ldap_connect(ADLDS_HOST);\n $success = false;\n if ($connection) {\n ldap_set_option($connection, LDAP_OPT_PROTOCOL_VERSION, 3);\n if (ldap_bind($connection, ADLDS_BINDDN, ADLDS_PSWD)) {\n $success = true;\n }\n }\n ldap_close($connection);\n\n return $success;\n }",
"function LDAP_connectServer($name)\n{\n\t$server = LDAP_loadServer($name);\n\t\n\t$ds = LDAP_makeConnection($server['host'] , $server['base'], $server['login_pass']);\n\n\treturn($ds);\n}",
"function connect() {\n $this->connection = ldap_connect($this->host, $this->port);\n if (!$this->connection) {\n throw \\Exception(\"Could not connect to LDAP server\");\n }\n\n if (!ldap_bind($this->connection, $this->distinguishedName, $this->password)) {\n ldap_close($this->connection);\n throw \\Exception(\"Could not bind to LDAP server\");\n }\n }",
"public function connect() {\n if ($this->connection) {\n return $this->connection;\n } else {\n $ldapConn = ldap_connect(AppConstants::LDAP_SERVER); \n if ($ldapConn) {\n //ldap_set_option($ldapConn, LDAP_OPT_PROTOCOL_VERSION, 3);\n if (ldap_bind($ldapConn, AppConstants::LDAP_USERNAME, AppConstants::LDAP_PASSWORD)) { \n $this->connection = $ldapConn;\n return $this->connection;\n }\n }\n }\n }",
"private function connect() {\n $this->connection = ldap_connect($this->ldap_server, $this->ldap_port) or die('Could not connect to LDAP Server');\n\n ldap_set_option($this->connection, LDAP_OPT_PROTOCOL_VERSION, 3);\n ldap_start_tls($this->connection);\n return $this->connection;\n }",
"function ad_connect() {\n//postcondition: returns a bound LDAP handle\n\n\t$ldh = ldap_connect(AD_HOST) or die (MSG_LDAP_ERROR);\n\t//Set options required by Windows Server 2003\n\tldap_set_option($ldh, LDAP_OPT_REFERRALS, 0);\n\tldap_set_option($ldh, LDAP_OPT_PROTOCOL_VERSION, 3);\n\t$bound = ldap_bind($ldh, AD_DN, AD_PW);\n\treturn $ldh;\n}",
"private function checkLdapConnection()\n\t{\n\t\tif (empty($this->ldapAuth['LdapConnectorAuthentication']['auth_users'])) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$connector = $this->ldapAuth['AuthUsers'];\n\n\t\t$LdapConnector = $this->LdapConnectorsMgt->getConnector($connector);\n\t\t$ldapConnection = $LdapConnector->connect();\n\t\t$LdapConnector->unbind();\n\n\t\t$this->set('ldapConnection', $ldapConnection);\n\t}",
"private function connect()\n {\n if (!$this->connection) {\n\n $this->connection = ldap_connect( ( $this->getUseSsl() ? 'ldaps://' : '') . $this->getHost(), $this->getPort());\n\n ldap_set_option($this->connection, LDAP_OPT_PROTOCOL_VERSION, $this->getVersion());\n ldap_set_option($this->connection, LDAP_OPT_REFERRALS, $this->getOptReferrals());\n\n if ($this->getUseStartTls()) {\n $tlsResult = ldap_start_tls($this->connection);\n if (!$tlsResult) throw new ConnectionException('TLS initialization failed!');\n }\n\n if ($this->adminBind) {\n if ( ($this->adminDn === null) || ($this->adminPassword === null) ) {\n throw new ConnectionException('Admin bind required but credentials not provided. Please see ldapcredentials.yml.');\n }\n if (false === @ldap_bind($this->connection, $this->adminDn, $this->adminPassword)) {\n throw new ConnectionException('Admin bind credentials incorrect. Please see ldapcredentials.yml or review your LDAP configurations.');\n }\n }\n }\n\n return $this;\n }",
"function conn_ldap($host,$port,$user,$pwd,$username, &$err) {\n\t$err = '';\n $ldapconn = ldap_connect($host, $port);\n ldap_set_option($ldapconn, LDAP_OPT_NETWORK_TIMEOUT, 5);\n if ($ldapconn) {\n // binding to ldap server\n syslog(LOG_INFO, \"$username: Info: LDAP: Trying to connect to $host:$port\");\n $ldapbind = ldap_bind($ldapconn, $user, $pwd);\n // verify binding\n if ($ldapbind) {\n syslog(LOG_INFO, \"$username: Info: LDAP: Successfully BIND as <\".$user.'>.');\n\t\t\treturn $ldapconn;\n }\n else {\n $err = 'LDAP: Error trying to bind on <'.$host.'> as <'.$user.'>: '.ldap_error($ldapconn);\n\t\t\tldap_get_option($ldapconn, LDAP_OPT_DIAGNOSTIC_MESSAGE, $detail);\n\t\t\tif (!is_null($detail)) $err.= \". Details: $detail.\";\n syslog(LOG_ERR, \"$username: Error: $err.\");\n ldap_unbind($ldapconn);\n\t\t\t$err = str_replace(\" on <$host> as <$user>\", '', $err);\n\t\t\treturn FALSE;\n }\n }\n else {\n $err = 'LDAP: Could not connect to LDAP server '.$host.':'.$port;\n\t\tldap_get_option($ldapconn, LDAP_OPT_DIAGNOSTIC_MESSAGE, $detail);\n\t\t$err .= \". Details: $detail.\";\n syslog(LOG_ERR, $username.\": Error: $err. Details: $detail.\");\n\t\treturn FALSE;\n }\n}",
"public function connect() {\r\n // create a socket\r\n if (($this->m_oSocket = socket_create(AF_INET,SOCK_STREAM, SOL_TCP)) === false) {\r\n return false;\r\n }\r\n // connect it\r\n \r\n if (@socket_connect($this->m_oSocket, $this->m_sAddress, $this->m_iPort) === false) {\r\n $this->m_oSocket = false;\r\n return false;\r\n }\r\n // send authentication request\r\n $this->rawPacketSend($this->m_sPassword, null, self::SERVERDATA_AUTH);\r\n // read the response\r\n $aResult = $this->rawPacketRead();\r\n // check if we authenticated succesfully\r\n if(isset($aResult[0])){\r\n if ($aResult[0]['CommandResponse'] != self::SERVERDATA_AUTH_RESPONSE) {\r\n $this->__destruct();\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }else{\r\n $this->connect();\r\n }\r\n \r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
end function uf_create_release_db_libre_V_3_58 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | function uf_create_release_db_libre_V_3_59()
{
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Function: uf_create_release_db_libre_V_3_59
// Access: public
// Modulos: Activos Fijos
// Description:
// Fecha Creacion: 05/05/2008 Fecha Ultima Modificacion :
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$lb_valido=true;
$ls_sql="";
switch($_SESSION["ls_gestor"])
{
case "MYSQL":
$ls_sql= " ALTER TABLE saf_dta ADD estactpre SMALLINT DEFAULT 0; ";
break;
case "POSTGRE":
$ls_sql= " ALTER TABLE saf_dta ADD estactpre INT2 DEFAULT 0; ";
break;
}
$li_row=$this->io_sql->execute($ls_sql);
if($li_row===false)
{
$this->io_msg->message("Problemas al ejecutar Release 3.59");
$lb_valido=false;
}
return $lb_valido;
} | [
"function uf_create_release_db_libre_V_2008_3_67()\r\n\t{\r\n\t\t/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\r\n\t\t//\t Function: uf_create_release_db_libre_V_2008_3_67\r\n\t\t//\t\t Access: public \r\n\t\t// Modulos: SNO\r\n\t\t//\t Description: \r\n\t\t// Fecha Creacion: 16/05/2008 \t\t\t\t\t\t\t\tFecha Ultima Modificacion : \r\n\t\t////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\r\n\t $lb_valido=true;\r\n\t $ls_sql=\"\";\r\n\t switch($_SESSION[\"ls_gestor\"])\r\n\t {\r\n\t\t\tcase \"MYSQL\":\r\n\t\t\t $ls_sql=\" ALTER TABLE sno_hnomina \".\r\n \t\t\t\t\t \" ADD COLUMN confidnom VARCHAR(5), \".\r\n \t\t\t\t\t \" ADD COLUMN recdocfid VARCHAR(1), \".\r\n \t\t\t\t\t \" ADD COLUMN tipdocfid VARCHAR(5), \".\r\n \t\t\t\t\t \" ADD COLUMN codbenfid VARCHAR(10), \".\r\n \t\t\t\t\t \" ADD COLUMN cueconfid VARCHAR(25); \";\t\t\t\t\t\t \r\n\t\t\t break;\r\n\t\t\t \r\n\t\t\tcase \"POSTGRE\":\r\n\t\t\t $ls_sql=\" ALTER TABLE sno_hnomina \".\r\n \t\t\t\t\t \" ADD COLUMN confidnom VARCHAR(5), \".\r\n \t\t\t\t\t \" ADD COLUMN recdocfid VARCHAR(1), \".\r\n \t\t\t\t\t \" ADD COLUMN tipdocfid VARCHAR(5), \".\r\n \t\t\t\t\t \" ADD COLUMN codbenfid VARCHAR(10), \".\r\n \t\t\t\t\t \" ADD COLUMN cueconfid VARCHAR(25); \";\t\t \r\n\t\t\t break;\t \r\n\t\t\t\r\n\t\t}\t\r\n\t\t$li_row=$this->io_sql->execute($ls_sql);\r\n\t\tif($li_row===false)\r\n\t\t{ \r\n\t\t\t $this->io_msg->message(\"Problemas al ejecutar Release 2008_3_67\");\r\n\t\t\t $lb_valido=false;\r\n\t\t}\r\n\t return $lb_valido;\t\r\n\t}",
"function uf_create_release_db_libre_V_2008_3_62()\r\n\t{\r\n\t\t/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\r\n\t\t//\t Function: uf_create_release_db_libre_V_2008_3_62\r\n\t\t//\t\t Access: public \r\n\t\t// Modulos: INV\r\n\t\t//\t Description: \r\n\t\t// Fecha Creacion: 12/05/2008 \t\t\t\t\t\t\t\tFecha Ultima Modificacion : \r\n\t\t////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\r\n\t $lb_valido=true;\r\n\t $ls_sql=\"\";\r\n\t switch($_SESSION[\"ls_gestor\"])\r\n\t {\r\n\t\t\tcase \"MYSQL\":\r\n\t\t\t $ls_sql=\" ALTER TABLE siv_dt_scg \".\r\n\t\t\t \" ADD COLUMN fechaconta DATETIME DEFAULT '1900-01-01'; \";\t\t\t\t\t \r\n\t\t\t break;\r\n\t\t\t \r\n\t\t\tcase \"POSTGRE\":\r\n\t\t\t $ls_sql=\" ALTER TABLE siv_dt_scg \".\r\n\t\t\t \" ADD COLUMN fechaconta DATE DEFAULT '1900-01-01'; \";\t\t\t \r\n\t\t\t break;\t \r\n\t\t\t\r\n\t\t}\t\r\n\t\t$li_row=$this->io_sql->execute($ls_sql);\r\n\t\tif($li_row===false)\r\n\t\t{ \r\n\t\t\t $this->io_msg->message(\"Problemas al ejecutar Release 2008_3_62\");\r\n\t\t\t $lb_valido=false;\r\n\t\t}\r\n\t return $lb_valido;\t\r\n\t}",
"function uf_create_release_db_libre_V_2008_3_80()\r\n\t{\r\n\t\t/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\r\n\t\t//\t Function: uf_create_release_db_libre_V_2008_3_80\r\n\t\t//\t\t Access: public \r\n\t\t// Modulos: SNO\r\n\t\t//\t Description: \r\n\t\t// Fecha Creacion: 02/06/2008\t\t\t\t\t\t\t\tFecha Ultima Modificacion : \r\n\t\t////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\r\n\t $lb_valido=true;\r\n\t $ls_sql=\"\";\r\n\t switch($_SESSION[\"ls_gestor\"])\r\n\t {\r\n\t\t\tcase \"MYSQL\":\r\n \t\t\t $ls_sql= \" alter table tepuy_empresa \".\r\n\t\t\t\t\t\t\" add telfrep varchar(15); \";\t\t\t\t\t\r\n\t\t\t break;\r\n\t\t\t \r\n\t\t\tcase \"POSTGRE\":\r\n\t\t\t $ls_sql= \" alter table tepuy_empresa \".\r\n\t\t\t\t\t\t\" add telfrep varchar(15); \";\t\r\n\t\t break;\t \r\n\t\t\t \r\n\t\t}\r\n\t\tif (!empty($ls_sql))\r\n\t\t{\t\r\n\t\t $li_row=$this->io_sql->execute($ls_sql);\r\n\t\t if($li_row===false)\r\n\t\t { \r\n\t\t\t $this->io_msg->message(\"Problemas al ejecutar Release 2008_3_80\");\r\n\t\t\t $lb_valido=false;\r\n\t\t }\r\n\t\t}\r\n\t return $lb_valido;\t\r\n\t}",
"function uf_create_release_db_libre_V_2008_3_79()\r\n\t{\r\n\t\t/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\r\n\t\t//\t Function: uf_create_release_db_libre_V_2008_3_79\r\n\t\t//\t\t Access: public \r\n\t\t// Modulos: SNO\r\n\t\t//\t Description: \r\n\t\t// Fecha Creacion: 02/06/2008\t\t\t\t\t\t\t\tFecha Ultima Modificacion : \r\n\t\t////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\r\n\t $lb_valido=true;\r\n\t $ls_sql=\"\";\r\n\t switch($_SESSION[\"ls_gestor\"])\r\n\t {\r\n\t\t\tcase \"MYSQL\":\r\n \t\t\t $ls_sql= \" alter table tepuy_empresa \".\r\n\t\t\t\t\t\t\" add cedrep varchar(10); \";\t\t\t\t\t\t\r\n\t\t\t break;\r\n\t\t\t \r\n\t\t\tcase \"POSTGRE\":\r\n\t\t\t $ls_sql= \" alter table tepuy_empresa \".\r\n\t\t\t\t\t\t\" add cedrep varchar(10); \";\t\r\n\t\t break;\t\t\t \r\n\t\t\t\r\n\t\t}\r\n\t\tif (!empty($ls_sql))\r\n\t\t{\t\r\n\t\t $li_row=$this->io_sql->execute($ls_sql);\r\n\t\t if($li_row===false)\r\n\t\t { \r\n\t\t\t $this->io_msg->message(\"Problemas al ejecutar Release 2008_3_79\");\r\n\t\t\t $lb_valido=false;\r\n\t\t }\r\n\t\t}\r\n\t return $lb_valido;\t\r\n\t}",
"function uf_create_release_db_libre_V_3_57()\r\n\t{\r\n\t\t/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\r\n\t\t//\t Function: uf_create_release_db_libre_V_3_57\r\n\t\t//\t\t Access: public \r\n\t\t// Modulos: Activos Fijos\r\n\t\t//\t Description: \r\n\t\t// Fecha Creacion: 05/05/2008 \t\t\t\t\t\t\t\tFecha Ultima Modificacion : \r\n\t\t////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\r\n\t $lb_valido=true;\r\n\t $ls_sql=\"\";\r\n\t switch($_SESSION[\"ls_gestor\"])\r\n\t {\r\n\t\t\tcase \"MYSQL\":\r\n \t\t\t $ls_sql= \" create table saf_prestamo( \".\r\n\t\t\t\t\t \" codemp char(4) not null, \".\r\n\t\t\t\t\t \" cmppre char(15) not null, \".\r\n\t\t\t\t\t\t\" coduniced varchar(10) not null, \".\r\n\t\t\t\t\t\t\" codunirec varchar(10) not null, \".\r\n\t\t\t\t\t\t\" fecpreact date not null, \".\r\n\t\t\t\t\t\t\" codtespre varchar(10) not null, \".\r\n\t\t\t\t\t\t\" codresced varchar(10) not null, \".\r\n\t\t\t\t\t\t\" codresrec varchar(10) not null, \".\r\n\t\t\t\t\t\t\" estpropre smallint default 0, \".\r\n\t\t\t\t\t\t\" obspre varchar(500), \".\r\n\t\t\t\t\t\t\" primary key (codemp, cmppre, coduniced, codunirec, fecpreact))\".\r\n\t\t\t\t\t\t\" ENGINE = InnoDB CHAR SET `utf8` COLLATE `utf8_general_ci`;\"; \r\n\t\t\t break;\r\n\t\t\t \r\n\t\t\tcase \"POSTGRE\":\r\n\t\t\t $ls_sql=\t\" CREATE TABLE saf_prestamo(\".\r\n\t\t\t\t\t\t\" codemp character(4) NOT NULL,\".\r\n\t\t\t\t\t\t\" cmppre character varying(15) NOT NULL, \".\r\n\t\t\t\t\t\t\" coduniced character varying(10) NOT NULL, \".\r\n\t\t\t\t\t\t\" codunirec character varying(10) NOT NULL, \".\r\n\t\t\t\t\t\t\" codresced character varying(10) NOT NULL, \".\r\n\t\t\t\t\t\t\" codresrec character varying(10) NOT NULL, \".\r\n\t\t\t\t\t\t\" codtespre character varying(10) NOT NULL, \".\r\n\t\t\t\t\t\t\" fecpreact date NOT NULL, \".\r\n\t\t\t\t\t\t\" estpropre smallint DEFAULT 0, \".\r\n\t\t\t\t\t\t\" obspre character varying(500), \".\r\n\t\t\t\t\t\t\" CONSTRAINT pk_saf_prestamo PRIMARY KEY (codemp, cmppre, coduniced, codunirec, fecpreact), \".\r\n\t\t\t\t\t\t\" CONSTRAINT fk_saf_pres_fk_tepuy_tepuy_e FOREIGN KEY (codemp) \".\r\n\t\t\t\t\t\t\" REFERENCES tepuy_empresa (codemp) MATCH SIMPLE \".\r\n\t\t\t\t\t\t\" ON UPDATE RESTRICT ON DELETE RESTRICT) \".\r\n\t\t\t\t\t\t\" WITHOUT OIDS;\";\r\n\t\t\t break;\r\n\t\t}\t\r\n\t\t$li_row=$this->io_sql->execute($ls_sql);\r\n\t\tif($li_row===false)\r\n\t\t{ \r\n\t\t\t $this->io_msg->message(\"Problemas al ejecutar Release 3.57\");\r\n\t\t\t $lb_valido=false;\r\n\t\t}\r\n\t\t///-------------------------------------------------------------------------------------------------------------\r\n\t\t$ls_sql=\"\";\r\n\t\tswitch($_SESSION[\"ls_gestor\"])\r\n\t\t {\r\n\t\t\t\t case \"MYSQL\":\r\n\t\t\t\t $ls_sql= \" ALTER TABLE saf_prestamo \".\r\n\t\t\t\t \t\t\t\" ADD constraint fk_tepuy_empresa__saf_prestamo foreign key (codemp) \".\r\n\t\t\t\t\t\t \" references tepuy_empresa (codemp) on delete restrict on update restrict \";\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t $li_row=$this->io_sql->execute($ls_sql);\r\n\t\t\t\t\tif($li_row===false)\r\n\t\t\t\t\t{ \r\n\t\t\t\t\t\t $this->io_msg->message(\"Problemas al ejecutar Release 3.57-1 -->Ver el tipo de las Tablas<--\");\r\n\t\t\t\t\t\t $lb_valido=false;\r\n\t\t\t\t\t}\t\t\t\t\t\t\t \r\n\t\t\t\t break;\t\t\t\r\n\t\t\t}\r\n\t\t//---------------------------------------------------------------------------------------------------------\t\r\n\t\t $ls_sql=\"\";\r\n\t switch($_SESSION[\"ls_gestor\"])\r\n\t {\r\n\t\t\tcase \"MYSQL\":\r\n \t\t\t $ls_sql= \" create table saf_dt_prestamo( \".\r\n\t\t\t\t\t\t\" codemp char(4) not null, \".\r\n\t\t\t\t\t\t\" cmppre char(15) not null, \".\r\n\t\t\t\t\t\t\" coduniced varchar(10) not null, \".\r\n\t\t\t\t\t\t\" codunirec varchar(10) not null, \".\r\n\t\t\t\t\t\t\" fecpreact date not null, \".\r\n\t\t\t\t\t\t\" codact char(15) not null, \".\r\n\t\t\t\t\t\t\" ideact char(15) not null, \".\r\n\t\t\t\t\t\t\" primary key (codemp, cmppre, coduniced, codunirec, fecpreact, codact, ideact)) \".\r\n\t\t\t\t\t\t\" ENGINE = InnoDB CHAR SET `utf8` COLLATE `utf8_general_ci`;\";\r\n\t\t\t break;\r\n\t\t\t \r\n\t\t\tcase \"POSTGRE\":\r\n\t\t\t $ls_sql=\t\" CREATE TABLE saf_dt_prestamo( \".\r\n\t\t\t\t\t\t\" codemp character(4) NOT NULL, \".\r\n\t\t\t\t\t\t\" cmppre character varying(15) NOT NULL, \".\r\n\t\t\t\t\t\t\" coduniced character varying(10) NOT NULL, \".\r\n\t\t\t\t\t\t\" codunirec character varying(10) NOT NULL, \".\r\n\t\t\t\t\t\t\" fecpreact date NOT NULL, \".\r\n\t\t\t\t\t\t\" codact character(15) NOT NULL, \".\r\n\t\t\t\t\t\t\" ideact character(15) NOT NULL, \".\r\n\t\t\t\t\t\t\" CONSTRAINT pk_saf_dt_prestamo PRIMARY KEY (codemp, cmppre, coduniced, codunirec, fecpreact, codact, ideact), \".\r\n\t\t\t\t\t\t\" CONSTRAINT fk_saf_dt_p_fk_saf_dt_saf_pres FOREIGN KEY (codemp, cmppre, coduniced, codunirec, fecpreact) \".\r\n\t\t\t\t\t\t\" REFERENCES saf_prestamo (codemp, cmppre, coduniced, codunirec, fecpreact) MATCH SIMPLE \".\r\n\t\t\t\t\t\t\" ON UPDATE RESTRICT ON DELETE RESTRICT, \".\r\n\t\t\t\t\t\t\" CONSTRAINT fk_saf_dt_pres__saf_dta FOREIGN KEY (codemp, codact, ideact) \".\r\n\t\t\t\t\t\t\" REFERENCES saf_dta (codemp, codact, ideact) MATCH SIMPLE \".\r\n\t\t\t\t\t\t\" ON UPDATE RESTRICT ON DELETE RESTRICT) \".\r\n\t\t\t\t\t\t\" WITHOUT OIDS;\";\r\n\t\t\t break;\r\n\t\t }\t\r\n\t\t $li_row=$this->io_sql->execute($ls_sql);\r\n\t\t if($li_row===false)\r\n\t\t { \r\n\t\t\t $this->io_msg->message(\"Problemas al ejecutar Release 3.57 - 2\");\r\n\t\t\t $lb_valido=false;\r\n\t\t }\r\n\t //-----------------------------------------------------------------------------------------------------------------------\r\n\t\t$ls_sql=\"\";\r\n\t\t switch($_SESSION[\"ls_gestor\"])\r\n\t\t {\r\n\t\t\t\t case \"MYSQL\":\r\n\t\t\t\t $ls_sql= \" ALTER TABLE saf_dt_prestamo \".\r\n\t\t\t\t \t\t\t\" ADD constraint fk_saf_prestmo__saf_dt_pres foreign \".\r\n\t\t\t\t\t\t\t\" key (codemp, cmppre, coduniced, codunirec, fecpreact) \".\r\n\t\t\t\t\t\t \" references saf_prestamo (codemp, cmppre, coduniced, \".\r\n\t\t\t\t\t\t\t\" codunirec, fecpreact) on delete restrict on update restrict, \".\r\n\t\t\t\t\t\t\t\" ADD constraint fk_saf_dta__saf_dt_pres foreign key (codemp, codact, ideact) \".\r\n\t\t\t\t\t\t \" references saf_dta (codemp, codact, ideact) on delete restrict on update restrict\";\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t $li_row=$this->io_sql->execute($ls_sql);\r\n\t\t\t\t\tif($li_row===false)\r\n\t\t\t\t\t{ \r\n\t\t\t\t\t\t $this->io_msg->message(\"Problemas al ejecutar Release 3.57-3 -->Ver el tipo de las Tablas<--\");\r\n\t\t\t\t\t\t $lb_valido=false;\r\n\t\t\t\t\t}\t\t\t\t\t\t\t \r\n\t\t\t\t break;\t\t\t\r\n\t\t\t}\r\n\t\t//-----------------------------------------------------------------------------------------------------------------------\r\n\t return $lb_valido;\t\r\n\t}",
"function uf_create_release_db_libre_V_3_53()\r\n\t{\r\n\t\t/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\r\n\t\t//\t Function: uf_create_release_db_libre_V_2008_1_21\r\n\t\t//\t\t Access: public \r\n\t\t// Modulos: NOMINA\r\n\t\t//\t Description: \r\n\t\t// Fecha Creacion: 14/03/2008 \t\t\t\t\t\t\t\tFecha Ultima Modificacion : \r\n\t\t////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\r\n\t $lb_valido=true;\r\n\t $ls_sql=\"\";\r\n\t switch($_SESSION[\"ls_gestor\"])\r\n\t {\r\n\t\t\tcase \"MYSQL\":\r\n\t\t\t $ls_sql=\"ALTER TABLE sno_thpersonalnomina \".\r\n\t\t\t \t\t \" ADD COLUMN grado CHAR(4) DEFAULT '0000';\";\r\n\t\t\t break;\r\n\t\t\t \r\n\t\t\tcase \"POSTGRE\":\r\n\t\t\t $ls_sql=\"ALTER TABLE sno_thpersonalnomina \".\r\n\t\t\t \t\t \" ADD COLUMN grado CHAR(4) DEFAULT '0000';\";\r\n\t\t\t break;\r\n\t\t}\t\r\n\t\t$li_row=$this->io_sql->execute($ls_sql);\r\n\t\tif($li_row===false)\r\n\t\t{ \r\n\t\t\t $this->io_msg->message(\"Problemas al ejecutar Release 3.53\");\r\n\t\t\t $lb_valido=false;\r\n\t\t}\r\n\t return $lb_valido;\t\r\n\t}",
"private static function create_table_package_release(){\n\t\tglobal $wpdb;\n\n\t\t// name\n\t\t$table_name = self::get_package_release_table_name($wpdb);\n\n\t\t// charset collate\n\t\t$charset_collate = '';\n\t\tif (!empty($wpdb->charset))\n\t\t\t$charset_collate = \"DEFAULT CHARACTER SET {$wpdb->charset}\";\n\t\tif (!empty($wpdb->collate))\n\t\t\t$charset_collate .= \" COLLATE {$wpdb->collate}\";\n\t\t\t\n\t\t// sql create\n\t\t$sql = \"CREATE TABLE IF NOT EXISTS `{$table_name}` ( \";\n\t\t$sql .= \"id bigint(20) NOT NULL AUTO_INCREMENT,\";\n\t\t$sql .= \"id_package bigint(20) NULL,\"; // package (FOREIGN KEY)\n\t\t$sql .= \"version varchar(255) NULL,\"; // format x.x.x\n\t\t$sql .= \"type varchar(255) NULL,\"; // release | prerelease\n\t\t$sql .= \"info text NULL,\"; // public information for woodmanager API - json\n\t\t$sql .= \"info_repository text NULL,\"; // private information from Github repository - json\n\t\t$sql .= \"date datetime NULL,\";\n\t\t$sql .= \"date_modif datetime NULL,\";\n\t\t$sql .= \"UNIQUE KEY id (id) ) {$charset_collate};\";\n\n\t\t// table creation\n\t\tdbDelta($sql);\n\t}",
"function bbp_db_version()\n{\n}",
"function ds4agocardless_createdb() {\r\n # check the table exists\r\n if(mysql_num_rows(full_query(\"SHOW TABLES LIKE 'mod_gocardless'\"))) {\r\n # the table exists, check its at the latest version\r\n if(mysql_num_rows(full_query(\"SHOW FULL COLUMNS FROM `mod_gocardless` LIKE 'preauth_id'\")) == 0) {\r\n # we are running the old version of the table\r\n $query = \"ALTER TABLE `mod_gocardless`\r\n ADD COLUMN `setup_id` varchar(16) default NULL,\r\n ADD COLUMN `preauth_id` varchar(16) default NULL,\r\n ADD COLUMN `payment_failed` varchar(16) NOT NULL default '0',\r\n ADD CONSTRAINT UNIQUE KEY `invoiceid` (`invoiceid`),\r\n ADD CONSTRAINT UNIQUE KEY `resource_id` (`resource_id`),\r\n ADD CONSTRAINT UNIQUE KEY `setup_id` (`setup_id`)\";\r\n\r\n full_query($query);\r\n }\r\n } else {\r\n # create the new table\r\n $query = \"CREATE TABLE IF NOT EXISTS `mod_ds4agocardless` (\r\n `id` int(11) NOT NULL auto_increment,\r\n `invoiceid` int(11) NOT NULL,\r\n `billcreated` int(11) default NULL,\r\n `resource_id` varchar(16) default NULL,\r\n `setup_id` varchar(16) default NULL,\r\n `preauth_id` varchar(16) default NULL,\r\n `payment_failed` tinyint(1) NOT NULL default '0',\r\n PRIMARY KEY (`id`),\r\n UNIQUE KEY `invoiceid` (`invoiceid`),\r\n UNIQUE KEY `resource_id` (`resource_id`),\r\n UNIQUE KEY `setup_id` (`setup_id`))\";\r\n\r\n full_query($query);\r\n\r\n # create the new table\r\n $query = \"CREATE TABLE IF NOT EXISTS `mod_ds4agocardless_preauth` (\r\n `id` int(11) NOT NULL auto_increment,\r\n `userid` int(10) NOT NULL,\r\n `subscriptionid` varchar(16) default NULL,\r\n PRIMARY KEY (`id`),\r\n UNIQUE KEY `userid` (`userid`),\r\n UNIQUE KEY `subscriptionid` (`subscriptionid`))\";\r\n\r\n full_query($query); \r\n\r\n }\r\n }",
"private function BuildDB() {\n \n }",
"public abstract function begin_database_export($version, $release, $timestamp, $description);",
"private function initVersionTable() {\n $this->db->execute('create table \"' . self::VERSION_TABLE . '\" (\n id integer primary key not null,\n name varchar not null,\n creationTime datetime not null\n )');\n }",
"function pfex_create_database() {\n\t\n\tglobal $wpdb;\n\t\n\t$db_version = \"1.0\";\n\t$table_name = $wpdb->prefix . 'pfex_feed';\n\t$charset_collate = $wpdb->get_charset_collate();\n\t\n\t$installed_db_version = get_option(\"pfex_db_version\");\n\t\n\tif($installed_db_version != $db_version)\n\t{\n\t\n\t\t$sql = \"CREATE TABLE $table_name (\n\t\t\tid mediumint(9) NOT NULL AUTO_INCREMENT,\n\t\t\tlink text NOT NULL,\n\t\t\ttitle text NOT NULL,\n\t\t\tpodcast text NOT NULL,\n\t\t\tepisodetype text NOT NULL,\n\t\t\tepisodenumber text NOT NULL,\n\t\t\tpubdate datetime NOT NULL,\n\t\t\tshortcode text NOT NULL,\n\t\t\tPRIMARY KEY (id)\n\t\t) $charset_collate;\";\n\t\t\n\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\t\tdbDelta( $sql );\n\t\t\n\t\tif($installed_db_version)\n\t\t{\n\t\t\tupdate_option('pfex_db_version', $db_version);\n\t\t} else {\n\t\t\tadd_option('pfex_db_version', $db_version);\n\t\t}\n\t}\n\t\n\t\n}",
"private static function create_table_package(){\n\t\tglobal $wpdb;\n\n\t\t// name\n\t\t$table_name = self::get_package_table_name($wpdb);\n\n\t\t// charset collate\n\t\t$charset_collate = '';\n\t\tif (!empty($wpdb->charset))\n\t\t\t$charset_collate = \"DEFAULT CHARACTER SET {$wpdb->charset}\";\n\t\tif (!empty($wpdb->collate))\n\t\t\t$charset_collate .= \" COLLATE {$wpdb->collate}\";\n\n\t\t// sql create\n\t\t$sql = \"CREATE TABLE IF NOT EXISTS `$table_name` (\n\t\tid bigint(20) NOT NULL AUTO_INCREMENT,\n\t\tslug varchar(255) NULL,\n\t\tfree varchar(20) NULL,\n\t\tpackage_release text NULL,\n\t\tpackage_release_github text NULL,\n\t\tpackage_release_date datetime NULL,\n\t\tdate datetime NULL,\n\t\tdate_modif datetime NULL,\n\t\tUNIQUE KEY id (id)\n\t\t) $charset_collate;\";\n\n\t\t// table creation\n\t\tdbDelta($sql);\n\t}",
"public function createDb(){\r\n\t\t//genera un $DATAbase esterno sqLite se non presente sulla base delle proprietÓ sqLite definite nella classe dell'oggetto\r\n\t\t$fields=$this->getPropertiesNames();\r\n\t\t$table=$this->getDbName();\r\n\t\t$indexes=$this->getDbKeys();\r\n\t\t\r\n\t\t$sqlite=$GLOBALS['config']->sqlite;\r\n\t\t\r\n\t\t$fieldsToAdd='';\r\n\t\t//campi normali\r\n\t\t$fieldsToAdd.=implode($fields,' TEXT, ').' TEXT,';\r\n\t\t//campi indice\r\n\t\t//$fieldsToAdd.=implode($indexes,' TEXT NOT NULL, ');\r\n\t\t//chiavi primarie\r\n\t\t$fieldsToAdd.=' PRIMARY KEY ('.implode($indexes,',').')';\r\n\t\techo $sqlite->database;\r\n\t\t//apro il $DATAbase\r\n\t\t$db = new SQLite3($sqlite->database);\r\n\t\t//creo la tabella\r\n\t\t$query=\"CREATE TABLE if not exists $table($fieldsToAdd)\";\r\n\t\t$db->exec($query) or die($query);\r\n\t\treturn;\r\n\t}",
"function defensio_create_table() {\n $version = get_option('defensio_db_version');\n $table_name = DefensioDB::getTableName();\n\n if(is_null($version))\n $version = 0;\n\n if ($version < DefensioDB::TABLE_VERSION || !DefensioDB::tableExists($table_name) ){\n if (DefensioDB::createTable(DefensioDB::getTableName(), $version, !DefensioDB::tableExists($table_name) ))\n update_option('defensio_db_version', DefensioDB::TABLE_VERSION);\n }\n}",
"function _createRevision() {\n\t}",
"function notes_create_db($database_name) {}",
"protected function createDBtable(){\n global $wpdb;\n $sql = \"CREATE TABLE IF NOT EXISTS $this->tableName(\n id INT(1) NOT NULL AUTO_INCREMENT PRIMARY KEY,\n open_time TIME,\n close_time TIME,\n status VARCHAR(20) NOT NULL DEFAULT 'close'\n )\";\n\n include_once(ABSPATH . 'wp-admin' . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'upgrade.php');\n dbDelta($sql);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This method is responsible for validating the values passed to the setOrganization_Assignment_Restrictions method This method is willingly generated in order to preserve the oneline inline validation within the setOrganization_Assignment_Restrictions method | public static function validateOrganization_Assignment_RestrictionsForArrayConstraintsFromSetOrganization_Assignment_Restrictions(array $values = array())
{
$message = '';
$invalidValues = [];
foreach ($values as $organization_Assignment_Restrictions_Response_DataTypeOrganization_Assignment_RestrictionsItem) {
// validation for constraint: itemType
if (!$organization_Assignment_Restrictions_Response_DataTypeOrganization_Assignment_RestrictionsItem instanceof \WorkdayWsdl\\StructType\Organization_Assignment_RestrictionsType) {
$invalidValues[] = is_object($organization_Assignment_Restrictions_Response_DataTypeOrganization_Assignment_RestrictionsItem) ? get_class($organization_Assignment_Restrictions_Response_DataTypeOrganization_Assignment_RestrictionsItem) : sprintf('%s(%s)', gettype($organization_Assignment_Restrictions_Response_DataTypeOrganization_Assignment_RestrictionsItem), var_export($organization_Assignment_Restrictions_Response_DataTypeOrganization_Assignment_RestrictionsItem, true));
}
}
if (!empty($invalidValues)) {
$message = sprintf('The Organization_Assignment_Restrictions property can only contain items of type \WorkdayWsdl\\StructType\Organization_Assignment_RestrictionsType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
}
unset($invalidValues);
return $message;
} | [
"public function __construct(array $organization_Assignment_Restrictions = array())\n {\n $this\n ->setOrganization_Assignment_Restrictions($organization_Assignment_Restrictions);\n }",
"function options_validate(&$form, &$form_state) {\n if (!array_filter($form_state['values']['access_options']['restrictions'])) {\n form_error($form['restrictions'], t('You must select at least one restriction if type is \"by restriction\"'));\n }\n }",
"public function buildRestrictionElement(): void;",
"public function addToOrganization_Assignment_Restrictions(\\WorkdayWsdl\\\\StructType\\Organization_Assignment_RestrictionsType $item)\n {\n // validation for constraint: itemType\n if (!$item instanceof \\WorkdayWsdl\\\\StructType\\Organization_Assignment_RestrictionsType) {\n throw new \\InvalidArgumentException(sprintf('The Organization_Assignment_Restrictions property can only contain items of type \\WorkdayWsdl\\\\StructType\\Organization_Assignment_RestrictionsType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);\n }\n $this->Organization_Assignment_Restrictions[] = $item;\n return $this;\n }",
"public function getRestrictions() { return $this->_restrictions; }",
"protected function _prepare_restrictions ()\n {\n parent::_prepare_restrictions ();\n $this->_calculated_restrictions [] = 'att.object_id = ' . $this->_host->id;\n }",
"protected function _count_restrictions ()\n {\n $Result = parent::_count_restrictions ();\n $Result [] = $this->_usable_restriction;\n return $Result;\n }",
"public function checkParticipatingOrg()\n {\n $this->rules['funding_participating_organization'] = sprintf(\n 'required_any:funding_participating_organization,%s,implementing_participating_organization,%s',\n $this->csvRow['funding_participating_organization'],\n $this->csvRow['implementing_participating_organization']\n );\n $this->messages['funding_participating_organization.required_any'] = 'At least one of Funding/Implementing Participating Organization is required.';\n }",
"protected function _prepare_restrictions ()\n {\n parent::_prepare_restrictions ();\n\n if (! $this->_returns_no_data ())\n {\n include_once ('webcore/db/query_security.php');\n $restriction = new QUERY_SECURITY_RESTRICTION ($this, $this->_user);\n $sql = $restriction->as_sql (array (Privilege_set_folder, Privilege_set_entry, $this->_privilege_set));\n if (! $sql)\n {\n $this->_set_returns_no_data ();\n }\n else\n {\n $this->_calculated_restrictions [] = $sql;\n }\n }\n }",
"private function _can_modify_restrictions () {\n\t\treturn $this->_can_access(Upfront_Permissions::MODIFY_RESTRICTIONS);\n\t}",
"public static function validateInstructor_Eligibility_Line_DataForArrayConstraintsFromSetInstructor_Eligibility_Line_Data(array $values = array())\n {\n $message = '';\n $invalidValues = [];\n foreach ($values as $manage_Instructor_Eligibility_Sub_Business_Process_DataTypeInstructor_Eligibility_Line_DataItem) {\n // validation for constraint: itemType\n if (!$manage_Instructor_Eligibility_Sub_Business_Process_DataTypeInstructor_Eligibility_Line_DataItem instanceof \\WorkdayWsdl\\\\StructType\\Instructor_Eligibility_Line_DataType) {\n $invalidValues[] = is_object($manage_Instructor_Eligibility_Sub_Business_Process_DataTypeInstructor_Eligibility_Line_DataItem) ? get_class($manage_Instructor_Eligibility_Sub_Business_Process_DataTypeInstructor_Eligibility_Line_DataItem) : sprintf('%s(%s)', gettype($manage_Instructor_Eligibility_Sub_Business_Process_DataTypeInstructor_Eligibility_Line_DataItem), var_export($manage_Instructor_Eligibility_Sub_Business_Process_DataTypeInstructor_Eligibility_Line_DataItem, true));\n }\n }\n if (!empty($invalidValues)) {\n $message = sprintf('The Instructor_Eligibility_Line_Data property can only contain items of type \\WorkdayWsdl\\\\StructType\\Instructor_Eligibility_Line_DataType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));\n }\n unset($invalidValues);\n return $message;\n }",
"public function validate()\n {\n $result = parent::validate();\n\n if ($this->IsApprovalRequired && !$this->ApprovalGroup()->exists()) {\n $result->addError('Please select Approval group.');\n } else if (!$this->TaskType) {\n $result->addError('Please select a task type.');\n } else if ($this->TaskType === 'risk questionnaire' && !$this->RiskCalculation) {\n $result->addError('Please select a risk-calculation.');\n }\n\n return $result;\n }",
"public function testCreateInvalidRestriction()\n {\n Gatekeeper::restrict('foobar', array());\n }",
"protected function award_validation()\n {\n if (is_superadmin_loggedin()) {\n $this->form_validation->set_rules('branch_id', translate('branch'), 'required');\n }\n $this->form_validation->set_rules('role_id', translate('role'), 'trim|required');\n $this->form_validation->set_rules('user_id', translate('winner'), 'trim|required');\n $this->form_validation->set_rules('award_name', translate('award_name'), 'trim|required');\n $this->form_validation->set_rules('gift_item', translate('gift_item'), 'trim|required');\n $this->form_validation->set_rules('award_reason', translate('award_reason'), 'trim|required');\n $this->form_validation->set_rules('given_date', translate('given_date'), 'trim|required');\n $roleID = $this->input->post('role_id');\n if ($roleID == 7) {\n $this->form_validation->set_rules('class_id', translate('class'), 'trim|required');\n }\n }",
"private function validateRoomQuotationEdit()\n {\n $this->form_validation->set_data($this->requestData);\n\n $this->form_validation->set_rules([\n [\n 'field' => 'room_quotation_id',\n 'label' => 'Project Room',\n 'rules' => 'trim|required|is_natural_no_zero'\n ],\n [\n 'field' => 'price_per_luminaries',\n 'label' => 'Price per luminaries',\n 'rules' => 'trim|numeric'\n ],\n [\n 'field' => 'installation_charges',\n 'label' => 'Installation charges',\n 'rules' => 'trim|numeric'\n ],\n [\n 'field' => 'discount_price',\n 'label' => 'Discount price',\n 'rules' => 'trim|numeric'\n ]\n ]);\n }",
"protected function grade_validation()\n {\n if (is_superadmin_loggedin()) {\n $this->form_validation->set_rules('branch_id', translate('branch'), 'required');\n }\n $this->form_validation->set_rules('name', translate('name'), 'trim|required');\n $this->form_validation->set_rules('grade_point', translate('grade_point'), 'trim|required');\n $this->form_validation->set_rules('lower_mark', translate('mark_from'), 'trim|required');\n $this->form_validation->set_rules('upper_mark', translate('mark_upto'), 'trim|required');\n }",
"public function chkVaildInput()\n\t\t\t{\n\t\t\t\t$this->chkIsNotEmpty('menu_name', $this->LANG['menumangement_err_tip_compulsory']);\n\t\t\t\t$this->chkIsValidSize('menu_name','menu_name',$this->LANG['menumangement_err_tip_menu_size']);\n\t\t\t\tif($this->fields_arr['page_type']!='normal')\n\t\t\t\t\t$this->chkIsNotEmpty('menu_page_name', $this->LANG['menumangement_err_tip_compulsory']);\n\n\t\t\t\t$this->LANG['menumangement_err_tip_menu_size']=str_replace(array('VAR_MIN','VAR_MAX'),array($this->CFG['fieldsize']['menu_name']['min'],$this->CFG['fieldsize']['menu_name']['max']),$this->LANG['menumangement_err_tip_menu_size'] );\n\t\t\t\tif($this->fields_arr['page_type'] == 'normal')\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->chkIsNotEmpty('menu_normal_query_string', $this->LANG['menumangement_err_tip_compulsory']);\n\t\t\t\t\t\t$this->chkIsNotEmpty('menu_htaccess_query_string', $this->LANG['menumangement_err_tip_compulsory']);\n\t\t\t\t\t}\n\t\t\t}",
"protected function account_validation()\n {\n if (is_superadmin_loggedin()) {\n $this->form_validation->set_rules('branch_id', translate('branch'), 'required');\n }\n $this->form_validation->set_rules('account_name', translate('account_name'), array('trim','required',array('unique_account_name',\n array($this->accounting_model, 'unique_account_name'))));\n $this->form_validation->set_rules('opening_balance', translate('opening_balance'), 'trim|numeric');\n }",
"public function getRestrictions()\n {\n return $this->restrictions;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return rma for generated order | public function getRmaFromGeneratedOrder($generatedOrder)
{
$rma = null;
//if this is not an order generated from a rma
if ($generatedOrder->getorder_type() != 'rma')
return $rma;
$collection = mage::getModel('ProductReturn/RmaProducts')
->getCollection()
->addFieldToFilter('rp_object_type', 'order')
->addFieldToFilter('rp_object_id', $generatedOrder->getId());
foreach ($collection as $rmaProduct)
{
$rma = mage::getModel('ProductReturn/Rma')->load($rmaProduct->getrp_rma_id());
break;
}
return $rma;
} | [
"public function getArma()\n {\n return $this->arma;\n }",
"public function getRmas()\n\t{\n\t\tif(null === $this->_rmas)\n\t\t{\n\t\t\t$this->_rmas = Mage::getResourceModel('rma/rma_collection')\n\t\t\t\t\t\t\t\t\t->addCustomerFilter($this->_getCustomer())\n\t\t\t\t\t\t\t\t\t->addChronologicalOrder();\n\t\t}\n\t\treturn $this->_rmas;\n\t}",
"public function getMinimiumOrderAmount();",
"public function getSumma()\n {\n $summa = 0;\n\n foreach ($purchases as $purchase) {//place for future comments\n\n if($purchase->status_bought == 1)\n {\n\n if($purchase->first()->book->author->status_discont_id == 1 && $purchase->first()->book->discont_privat != 0 && $purchase->magazin->author->status_discont_id == 1 && $purchase->magazin->discont_privat != 0)\n\n {//\n\n if (round($purchase->first()->book->discont_global,2) >= round($purchase->first()->book->author->discont_id,2) && round($purchase->magazin->discont_global,2) >= round($purchase->magazin->author->discont_id,2)) \n\n {//\n\n $summa += ($purchase->first()->book->price - ($purchase->first()->book->price * $purchase->first()->book->discont_global / 100)) * $purchase->qty + ($purchase->magazin->price - ($purchase->magazin->price * $purchase->magazin->discont_global / 100)) * $purchase->qty_m;\n\n } elseif(round($purchase->first()->book->discont_global,2) <= round($purchase->first()->book->author->discont_id,2) && round($purchase->magazin->discont_global,2) <= round($purchase->magazin->author->discont_id,2))\n\n {//\n\n $summa += ($purchase->first()->book->price - ($purchase->first()->book->price * $purchase->first()->book->author->discont_id / 100)) * $purchase->qty + $purchase->magazin->price - ($purchase->magazin->price * $purchase->magazin->author->discont_id / 100)) * $purchase->qty_m;\n\n } elseif (round($purchase->first()->book->discont_global,2) >= round($purchase->first()->book->author->discont_id,2) && round($purchase->magazin->discont_global,2) <= round($purchase->magazin->author->discont_id,2))\n\n {//\n\n $summa += ($purchase->first()->book->price - ($purchase->first()->book->price * $purchase->first()->book->discont_global / 100)) * $purchase->qty + $purchase->magazin->price - ($purchase->magazin->price * $purchase->magazin->author->discont_id / 100)) * $purchase->qty_m;\n\n } elseif (round($purchase->first()->book->discont_global,2) <= round($purchase->first()->book->author->discont_id,2) && round($purchase->magazin->discont_global,2) >= round($purchase->magazin->author->discont_id,2))\n\n {//\n\n $summa += ($purchase->first()->book->price - ($purchase->first()->book->price * $purchase->first()->book->author->discont_id / 100)) * $purchase->qty + ($purchase->magazin->price - ($purchase->magazin->price * $purchase->magazin->discont_global / 100)) * $purchase->qty_m;\n\n } elseif (round($purchase->first()->book->discont_global,2) >= round($purchase->first()->book->author->discont_id,2))\n\n {//\n\n $summa += ($purchase->first()->book->price - ($purchase->first()->book->price * $purchase->first()->book->discont_global / 100)) * $purchase->qty + $purchase->magazin->price * $purchase->qty_m;//\n\n } elseif (round($purchase->first()->book->discont_global,2) <= round($purchase->first()->book->author->discont_id,2))\n\n {//\n\n $summa += ($purchase->first()->book->price - ($purchase->first()->book->price * $purchase->first()->book->author->discont_id / 100)) * $purchase->qty + $purchase->magazin->price * $purchase->qty_m;\n\n } elseif (round($purchase->magazin->discont_global,2) >= round($purchase->magazin->author->discont_id,2))\n\n {//\n\n $summa += ($purchase->magazin->price - ($purchase->magazin->price * $purchase->magazin->discont_global / 100)) * $purchase->qty_m + $purchase->first()->book->price * $purchase->qty;\n\n } elseif (round($purchase->magazin->discont_global,2) <= round($purchase->magazin->author->discont_id,2))\n\n {//\n\n $summa += ($purchase->magazin->price - ($purchase->magazin->price * $purchase->magazin->author->discont_id / 100)) * $purchase->qty_m + $purchase->first()->book->price * $purchase->qty;\n\n }\n\n // \n } elseif($purchase->first()->book->discont_privat != 0 && $purchase->magazin->discont_privat != 0)\n\n {//\n if($purchase->first()->book->discont_privat != 0) \n\n {//\n\n $summa += ($purchase->first()->book->price - ($purchase->first()->book->price * $purchase->first()->book->discont_global / 100)) * $purchase->qty + $purchase->magazin->price * $purchase->qty_m;\n\n\n }\n\n elseif($purchase->magazin->discont_privat != 0) \n\n {//\n\n $summa += ($purchase->magazin->price - ($purchase->magazin->price * $purchase->magazin->discont_global / 100)) * $purchase->qty_m + $purchase->first()->book->price * $purchase->qty;\n\n }\n\n $summa += ($purchase->first()->book->price - ($purchase->first()->book->price * $purchase->first()->book->discont_global / 100)) * $purchase->qty + ($purchase->magazin->price - ($purchase->magazin->price * $purchase->magazin->discont_global / 100)) * $purchase->qty_m;\n\n //\n } elseif($purchase->first()->book->author->status_discont_id == 1 && $purchase->magazin->author->status_discont_id == 1)\n\n {//\n\n if($purchase->first()->book->author->status_discont_id == 1) \n\n {//\n $summa += ($purchase->first()->book->price - ($purchase->first()->book->price * $purchase->first()->book->author->discont_id / 100)) * $purchase->qty + $purchase->magazin->price * $purchase->qty_m;\n\n }\n elseif($purchase->magazin->author->status_discont_id == 1) \n\n {//\n\n $summa += ($purchase->magazin->price - ($purchase->magazin->price * $purchase->magazin->author->discont_id / 100)) * $purchase->qty_m + $purchase->first()->book->price * $purchase->qty;\n\n }\n\n $summa += ($purchase->first()->book->price - ($purchase->first()->book->price * $purchase->first()->book->author->discont_id / 100)) * $purchase->qty + ($purchase->magazin->price - ($purchase->magazin->price * $purchase->magazin->author->discont_id / 100)) * $purchase->qty_m;\n\n // \n } else \n\n {//\n\n $summa += $purchase->first()->book->price * $purchase->qty + $purchase->magazin->price * $purchase->qty_m;\n\n }\n } \n\n }\n return $summa;\n\n }",
"public function summa($summa)\n {\n\n // $summa = 0; \n\n foreach ($purchases as $purchase) {\n\n if($purchase->first()->book->author->status_discont_id == 1 && $purchase->first()->book->discont_privat != null && $purchase->magazin->author->status_discont_id == 1 && $purchase->magazin->discont_privat != null)\n\n {\n\n if ($purchase->first()->book->discont_global > $purchase->first()->book->author->discont_id && $purchase->magazin->discont_global >= $purchase->magazin->author->discont_id) \n\n {\n\n $summa += ($purchase->first()->book->price - ($purchase->first()->book->price * $purchase->first()->book->discont_global / 100)) * $purchase->qty + ($purchase->magazin->price - ($purchase->magazin->price * $purchase->magazin->discont_global / 100)) * $purchase->qty_m;\n\n } else {\n\n $summa += ($purchase->first()->book->price - ($purchase->first()->book->price * $purchase->first()->book->author->discont_id / 100)) * $purchase->qty + $purchase->magazin->price - ($purchase->magazin->price * $purchase->magazin->author->discont_id / 100)) * $purchase->qty_m;\n }\n\n } elseif($purchase->first()->book->discont_privat != null && $purchase->magazin->discont_privat != null)\n\n {\n $summa += ($purchase->first()->book->price - ($purchase->first()->book->price * $purchase->first()->book->discont_global / 100)) * $purchase->qty + ($purchase->magazin->price - ($purchase->magazin->price * $purchase->magazin->discont_global / 100)) * $purchase->qty_m;\n\n } elseif($purchase->first()->book->author->status_discont_id == 1 && $purchase->magazin->author->status_discont_id == 1)\n\n {\n\n $summa += ($purchase->first()->book->price - ($purchase->first()->book->price * $purchase->first()->book->author->discont_id / 100)) * $purchase->qty + ($purchase->magazin->price - ($purchase->magazin->price * $purchase->magazin->author->discont_id / 100)) * $purchase->qty_m;\n\n } else {\n $summa += $purchase->first()->book->price * $purchase->qty + $purchase->magazin->price * $purchase->qty_m;\n } \n}\n }",
"private function _getMCNoSmontaggio()\n {\n $mc = 0;\n foreach ($this->lista_arredi as $arredo)\n {\n $tmp = $arredo->getMC();\n if ($arredo->getParametroB() == Arredo::MONTATO_PIENO)\n {\n $tmp = $tmp * $arredo->getCampo(Arredo::MONTATO_PIENO);\n $mc+= $tmp;\n\n }\n\n if ($arredo->getParametroB() == Arredo::MONTATO_VUOTO)\n {\n $tmp = $tmp * $arredo->getCampo(Arredo::MONTATO_VUOTO);\n $mc+= $tmp;\n\n }\n\n\n\n }\n\n return $mc;\n }",
"function Get_RMAOrders ($DB, $LastRun, $Region) {\n\n // Define table name variables for use in HereDOC strings.\n $TableOrders = TABLE_ORDERS;\n $TableOrdersProducts = TABLE_ORDERS_PRODUCTS;\n $TableOrdersItemsRefs = TABLE_ORDERS_ITEMS_REFS;\n $TableRefundItems = TABLE_RETURNS_PRODUCTS_DATA;\n\n // Create a MySQL timestamp out of last runtime.\n $LastRun = new DateTime(\"@$LastRun\");\n $LastRun->setTimezone (new DateTimeZone (LOCAL_TIMEZONE));\n $LastRun = $LastRun->format (\"Y-m-d H:i:s\");\n\n // Retrieve updated orders from database.\n $Query = <<<OutSQL\nSELECT DISTINCT oir.ref_value AS orders_id, \n rp.last_modified AS last_modified,\n r.refund_amount AS refund_amount,\n oir.ref_refid AS item_id, \n op.products_quantity AS quantity,\n op.products_exchanged,\n r.refund_shipping_amount AS shipping,\n rp.rma_value AS rma_num\nFROM $TableOrders AS o\nINNER JOIN $TableOrdersProducts op ON op.orders_id = o.orders_id\nINNER JOIN $TableOrdersItemsRefs oir ON oir.ref_item_id = op.orders_products_id\nINNER JOIN returned_products rp ON rp.order_id = o.orders_id\nINNER JOIN $TableRefundItems r ON r.order_id = o.orders_id AND r.products_id = op.products_id\nINNER JOIN refund_payments pay ON pay.returns_id = rp.returns_id\nWHERE\n o.customers_email_address LIKE \"%@marketplace.amazon.%\"\n AND (op.products_returned = 1 OR op.products_exchanged = 1)\n AND rp.returns_status = 4\n AND rp.returns_date_finished >= '{$LastRun}'\n /* AND rp.date_purchased >= DATE_ADD(NOW(), INTERVAL - 1 MONTH)*/ \nORDER BY o.orders_id, op.products_id\nOutSQL;\n\n // Return with error code if query fails.\n if (!$Res = $DB->Query ($Query)) {\n trigger_error (\"Could not retrieve order shipment updates.\\nSQL: $Query\\nError: \".$DB->error, E_USER_WARNING);\n return 11;\n }\n\n // Reasons for RMA.\n $ReasonRMA = array (\n \"Other\",\n \"NoInventory\",\n \"CustomerReturn\",\n \"GeneralAdjustment\",\n \"CouldNotShip\",\n \"DifferentItem\",\n \"Abandoned\",\n \"CustomerCancel\",\n \"PriceError\",\n \"ProductOutofStock\",\n \"CustomerAddressIncorrect\",\n \"Exchange\",\n \"CarrierCreditDecision\",\n \"RiskAssessmentInformationNotValid\",\n \"CarrierCoverageFailure\",\n \"TransactionRecord\",\n \"Undeliverable\",\n \"RefusedDelivery\"\n );\n\n // Run through all orders, adding them to the updates array.\n $Data = array ();\n $LastOrder = 0;\n \n while ($Row = $Res->fetch_array()) {\n // # Save the order ID for easier referencing.\n $OrderID = $Row['orders_id'];\n\n // Check for new order.\n if ($LastOrder != $OrderID) {\n // Add order details to array.\n $Data[$OrderID]['id'] = $OrderID;\n $LastOrder = $OrderID;\n }\n\n // # Amazon requires price adjustment - they DO NOT do the currency conversion.\n // # We created function () using the Google Finance API\n // # hopefully there isnt any noticable downtime with google it this doesnt fail.\n\n // # Canada\n if ($Region == 'ca') {\n $currency = 'CAD';\n // # Europe\n } elseif($Region == 'de' || $Region == 'es' || $Region == 'fr' || $Region == 'it') {\n $currency = 'EUR';\n // # UK\n } elseif($Region == 'uk') {\n $currency = 'GBP';\n // # Japan\n } elseif($Region == 'jp') {\n $currency = 'JPY';\n // # India\n } elseif($Region == 'in') {\n $currency = 'INR';\n // # China\n } elseif($Region == 'cn') {\n $currency = 'CNY';\n // # United states\n } else { \n $currency = 'USD';\n }\n\n if($Region != 'us') { \n $currency_offset = convert_currency($currency, 'USD', $Row['refund_amount']);\n } else { \n $currency_offset = number_format($Row['refund_amount'],2);\n }\n\n // # Define the proper refund reason.\n // # Detect products_exchanged flag from orders_products table\n $Reason = ($Row['products_exchanged'] == '1' ) ? $ReasonRMA[11] : $ReasonRMA[2];\n\n // # Define the shipping charges\n $shipping = $Row['shipping'];\n\n // # Define Internal RMA value:\n $rma_num = $Row['rma_num'];\n\n // # Add item to current order.\n $ItemID = $Row['item_id'];\n\n\n $Data[$OrderID]['items'][$ItemID] = array (\n 'id' => $ItemID,\n 'reason' => $Reason,\n 'quantity' => $Row['quantity'],\n 'amount' => $currency_offset,\n 'shipping' => $shipping,\n 'rma_num' => $rma_num\n );\n \n if($Row['products_exchanged'] == 1) { \n\n // # If Amazon requires the price adjustment data, or to enable support for partial refunds.\n $Data[$OrderID]['items'][$ItemID]['rma'] = array (\n 'type' => 'Principal',\n 'currency' => $currency, \n 'value' => $currency_offset\n );\n } // # end exchange detection\n }\n\n//if(!empty($Data)) error_log(print_r($Data,1), 1, 'chrisd@zwaveproducts.com', 'Subject: Data dump from amazon_orders php Get_RMAOrders function');\n\n return $Data;\n}",
"public function getCurrentMonthTotalOrder() : int;",
"public function pdfRmaAction() {\n $orderIds = $this->getRequest()->getPost('order_ids');\n $flag = false;\n if (!empty($orderIds)) {\n foreach ($orderIds as $orderId) {\n $order = Mage::getModel('sales/order')->load($orderId);\n $flag = true;\n $order->setOrder($order);\n if (!isset($pdf)) {\n $pdf = Mage::getModel('GSC_Orderslips/order_pdf_order')->getPdf(array($order));\n } else {\n $pages = Mage::getModel('GSC_Orderslips/order_pdf_order')->getPdf(array($order));\n $pdf->pages = array_merge($pdf->pages, $pages->pages);\n }\n }\n if ($flag) {\n return $this->_prepareDownloadResponse(\n 'rma'.Mage::getSingleton('core/date')->date('Y-m-d_H-i-s').'.pdf', $pdf->render(),\n 'application/pdf'\n );\n } else {\n $this->_getSession()->addError($this->__('There are no printable documents related to selected orders.'));\n $this->_redirect('*/*/history');\n }\n }\n $this->_redirect('*/*/history');\n }",
"function CreateRMA_Order($int_productid,\n $int_amount,\n $int_ContactID,\n $RMAactionID,\n $str_order_refrma = RMA_RETOUR_TEXT,\n $flt_price = 0,\n $bl_credit=FALSE)\n{\n $int_order_id = GetOpenRMAOrder(TRUE,\n $int_ContactID,\n $RMAactionID,\n FALSE,\n $str_order_refrma,\n $bl_credit);\n //echo \"Order product $int_productid * $int_amount on order $int_order_id with description $str_order_refrma <br>\";\n\n $flt_unitprice = 0;\n $str_korting = 0;\n $flt_extendedprice = 0;\n\n if ($int_order_id)\n {\n $int_order_detail_id = GetField(\"SELECT OrderDetailsID\n FROM order_details\n WHERE ProductID='$int_productid'\n AND RMA_actionID = '$RMAactionID'\");\n $bl_BTW = GetField(\"SELECT Btw_YN\n FROM orders \n WHERE OrderID = $int_order_id\");\n $btw_perce = $bl_BTW ? GetBtwClass($int_productid) : 0;\n $btw_value = (float) $btw_perce * $flt_price;\n echo \"VAT $bl_BTW, $btw_perce, $btw_value\";\n\n if ($int_order_detail_id)\n {\n $sql_orderdetail = \"UPDATE order_details SET Quantity= $int_amount, \"\n .\" to_deliver= $int_amount, \"\n .\" Extended_price= '$flt_price', \"\n .\" UnitBTW = '$btw_value', \"\n .\" btw_percentage = '$btw_perce',\"\n .\" manual_price = 1\"\n .\" WHERE RMA_actionID = '$RMAactionID'\";\n } else\n {\n $int_to_deliver_amount = $bl_credit ? 0 : $int_amount;\n $sql_orderdetail = \"INSERT INTO order_details SET Quantity='$int_amount', \"\n .\" ProductID='$int_productid',\"\n .\" ProductName='\".GetProductName($int_productid).\"',\"\n .\" UnitPrice= '$flt_price',\"\n .\" UnitBTW = '$btw_value', \"\n .\" btw_percentage = '$btw_perce',\"\n .\" to_deliver='$int_to_deliver_amount', \"\n .\" Discount='0',\"\n .\" Extended_price='\".$flt_price*$int_amount.\"',\"\n .\" OrderID='$int_order_id',\"\n .\" RMA_actionID = '$RMAactionID', \"\n .\" manual_price = 1\";\n //echo $sql_orderdetail.'<br>';\n }\n $query = mysql_query($sql_orderdetail)\n or die(\"Invalid sql createrma order: $sql_orderdetail\" . mysql_error());\n // Now update the order date and time with the current time. To make sure that this order doesn't age.\n $sql_update_order = \"UPDATE orders SET OrderDate=\".insertDate(date(\"Y-m-d H:i\"))\n .\" WHERE OrderID = '$int_order_id'\";\n $query = mysql_query($sql_update_order);\n } else\n {\n echo \"Order aanmaken/opzoeken mislukt<br>\";\n }\n}",
"public function getaleAtorioArray()\n {\n if ($this->aleatorioNumber!=0)\n {\n for ($i=0; $i < $this->aleatorioNumber; $i++)\n {\n $this->aleatorioArray[$i]=rand(1,$this->lado);\n }\n return $this->aleatorioArray;\n }\n else\n {\n return 0;\n }\n\n }",
"public function calculateA()\n {\n $this->A = gmp_powm($this->g, $this->a, $this->N);\n\n return $this->A;\n }",
"public function getRaca()\n {\n return $this->raca;\n }",
"public static function calculate($mrr)\n {\n return $mrr * 12;\n }",
"public function getMorders()\n {\n return $this->hasMany(Morder::className(), ['warehouse_id' => 'warehouse_id']);\n }",
"function trix($arr)\n{\n\n $data = array();\n $count = count($arr);\n\n $N=12;\n $M=20;\n\n $close = array();\n for($i=0;$i<$count;$i++)\n $close[$i] = $arr[$i]->{\"close\"};\n\n $tr = EMA($close, 0, $N);\n $tr = EMA($tr, $N, $N);\n $tr = EMA($tr, $N+$N, $N);\n\n $tr_l = REF($tr, $N+$N+$N, 1);\n\n $trix = array();\n for($i=0;$i<$N+$N+$N+1;$i++){\n array_push($trix, -100000.0);\n }\n for($i=$N+$N+$N+1;$i<$count;$i++){\n array_push($trix, ($tr[$i] - $tr_l[$i])*100/$tr_l[$i]);\n }\n\n $trma = MA($trix, $N+$N+$N+1, $M);\n\n $data['name']=\"三重指数平滑平均线\";\n\n $data['lines'][0]['type']=\"line\";\n $data['lines'][0]['name']=\"TRIX\";\n $data['lines'][0]['data']=$trix;\n\n $data['lines'][1]['type']=\"line\";\n $data['lines'][1]['name']=\"TRMA\";\n $data['lines'][1]['data']=$trma;\n\n return json_encode($data);\n}",
"function get_armys() {\n if (empty($this->_arrArmy)) {\n $this->_arrArmy = $this->get_tbl_data(TBL_ARMY);\n//var_dump ($this->_arrArmy);\n }\n return $this->_arrArmy;\n }",
"public function getMAtk()\n {\n return $this->mAtk;\n }",
"public function getArmazenamento()\r\n {\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TODO: Implement initTableFields() method. | protected function initTableFields()
{
$this->addField(self::$ID, STRING, "");
$this->addField(self::$NAME, STRING, "");
$this->addField(self::$PARENT, STRING, "");
$this->addField(self::$DESCRIPTION, STRING, "");
} | [
"protected function initTableFields()\r\n {\r\n }",
"protected function initTableFields()\n {\n }",
"protected function initTableFields()\r\n {\r\n $this->addField(self::$PUBLISHER_OWNER_ID, STRING, \"\");\r\n $this->addField(self::$ID, STRING, \"\");\r\n $this->addField(self::$NAME, STRING, \"\");\r\n $this->addField(self::$PARENT_ID, STRING, \"\");\r\n $this->addField(self::$TYPE, INTEGER, AUDIENCE_TYPE_UNKNOWN);\r\n $this->addField(self::$ORDER_VALUE, INTEGER, 100);\r\n $this->addField(self::$SIMPLY_NAME, STRING, \"\");\r\n $this->addField(self::$CNAME, STRING, \"\");\r\n }",
"protected function initTableFields()\r\n {\r\n $this->addField(self::$ELI_PUBLISHER_OWNER_ID, STRING, \"\");\r\n $this->addField(self::$ID, STRING, \"\");\r\n $this->addField(self::$NAME, STRING, \"\");\r\n $this->addField(self::$DESCRIPTION, STRING, \"\");\r\n $this->addField(self::$APPLICATION_ID, STRING, \"\");\r\n }",
"protected function initTableFields()\r\n {\r\n $this->addField(self::$ID, STRING, \"\");\r\n $this->addField(self::$NAME, STRING, \"\");\r\n $this->addField(self::$PASSWORD, STRING, \"\");\r\n $this->addField(self::$CELL_PHONE, STRING, \"\");\r\n $this->addField(self::$PHONE_NUMBER, STRING, \"\");\r\n $this->addField(self::$E_MAIL, STRING, \"\");\r\n $this->addField(self::$QQ_NUMBER, STRING, \"\");\r\n $this->addField(self::$WECHAT_ID, STRING, \"\");\r\n $this->addField(self::$ACCOUNT_TYPE, INTEGER, ELI_ACCOUNT_TYPE_COMPANY);\r\n $this->addField(self::$STATUS, INTEGER, ELI_ACCOUNT_STATUS_INIT);\r\n $this->addField(self::$BUSINESS_LICENSE, STRING, \"\");\r\n $this->addField(self::$ORGANIZATION_CODE, STRING, \"\");\r\n $this->addField(self::$TAX_REGISTRATION_CERTIFICATE, STRING, \"\");\r\n $this->addField(self::$COMPANY_NAME, STRING, \"\");\r\n $this->addField(self::$COMPANY_ADDRESS, STRING, \"\");\r\n $this->addField(self::$TRADE_LICENSE, STRING, \"\");\r\n $this->addField(self::$INDUSTRY_ID, STRING, \"\");\r\n $this->addField(self::$BUDGET, DOUBLE, 0.0);\r\n $this->addField(self::$SPENT, DOUBLE, 0.0);\r\n $this->addField(self::$CREATE_TIME, STRING, date('Y-m-d H:i:s'));\r\n $this->addField(self::$LAST_MODIFY_TIME, STRING, date('Y-m-d H:i:s'));\r\n $this->addField(self::$CLIENT_IP, STRING, \"\");\r\n }",
"abstract public function getTableFields();",
"public function prepareFieldsFromTable()\n {\n foreach ($this->columns as $column) {\n $type = $column->getType()->getName();\n\n switch ($type) {\n case 'integer':\n $field = $this->generateIntFieldInput($column, 'integer');\n break;\n case 'smallint':\n $field = $this->generateIntFieldInput($column, 'smallInteger');\n break;\n case 'bigint':\n $field = $this->generateIntFieldInput($column, 'bigInteger');\n break;\n case 'boolean':\n $name = title_case(str_replace('_', ' ', $column->getName()));\n $field = $this->generateField($column, 'boolean', 'checkbox,1');\n break;\n case 'datetime':\n $field = $this->generateField($column, 'datetime', 'date');\n break;\n case 'datetimetz':\n $field = $this->generateField($column, 'dateTimeTz', 'date');\n break;\n case 'date':\n $field = $this->generateField($column, 'date', 'date');\n break;\n case 'time':\n $field = $this->generateField($column, 'time', 'text');\n break;\n case 'decimal':\n $field = $this->generateNumberInput($column, 'decimal');\n break;\n case 'float':\n $field = $this->generateNumberInput($column, 'float');\n break;\n case 'string':\n $field = $this->generateField($column, 'string', 'text');\n break;\n case 'text':\n $field = $this->generateField($column, 'text', 'textarea');\n break;\n default:\n $field = $this->generateField($column, 'string', 'text');\n break;\n }\n\n if (strtolower($field->name) == 'password') {\n $field->htmlType = 'password';\n } elseif (strtolower($field->name) == 'email') {\n $field->htmlType = 'email';\n } elseif (in_array($field->name, $this->timestamps)) {\n $field->isSearchable = false;\n $field->isFillable = false;\n $field->inForm = false;\n $field->inIndex = false;\n }\n\n $this->fields[] = $field;\n }\n }",
"public function initTable()\n {\n $this->reflection_class = new \\ReflectionClass($this->model);\n $this->table_fields = $this->getTableFields(true);\n if ($this->table_name == \"\") {\n $this->table_name = (new \\ReflectionClass($this))->getShortName();\n }\n }",
"public function prepareFieldsFromTable()\n {\n foreach ($this->columns as $column) {\n $type = $column->getType()->getName();\n\n /** @var array $fieldTypeMaps 'column type' => ['db type', 'html type'] */\n $fieldTypeMaps = [\n 'integer' => ['integer'],\n 'smallint' => ['smallInteger'],\n 'bigint' => ['bigInteger'],\n 'boolean' => ['boolean', 'checkbox,1'],\n 'datetime' => ['datetime', 'date'],\n 'datetimetz' => ['dateTimeTz', 'date'],\n 'date' => ['date', 'date'],\n 'time' => ['time', 'text'],\n 'decimal' => ['decimal'],\n 'float' => ['float'],\n 'text' => ['text', 'textarea'],\n 'string' => ['string', 'text']\n ];\n\n $type = isset($fieldTypeMaps[$type]) ? $type : 'string';\n\n $field = null;\n if (in_array($type, ['integer', 'smallint', 'bigint'])) {\n $field = $this->generateIntFieldInput($column, $fieldTypeMaps[$type][0]);\n }\n\n if (in_array($type, ['decimal', 'float'])) {\n $field = $this->generateNumberInput($column, $fieldTypeMaps[$type][0]);\n }\n\n if (empty($field)) {\n $field = $this->generateField($column, $fieldTypeMaps[$type][0], $fieldTypeMaps[$type][1]);\n }\n\n $this->fields[] = $this->prepareAdditionalFieldPropertiesFromTable($field, $column);\n }\n\n return $this;\n }",
"public function initTable(){\n\t\t\t\n\t\t}",
"protected function init_table() \t\r\n\t\t{ \r\n\t\t\treturn self::TABLE; \r\n\t\t}",
"private function initialize_table()\n\t{\n\t\tself::$xform_table_name = $this->config->item(\"table_xform\");\n\t\tlog_message(\"debug\", \"Xform table => \" . $this->config->item(\"table_xform\"));\n\t\tself::$archive_xform_table_name = $this->config->item(\"table_archive_xform\");\n\t}",
"abstract protected function initializeFields();",
"function createFields()\n {\n $fields = array();\n $it =& new ArrayIterator(\n $this->parseList($this->getProperty('fields'))\n );\n for ( ; $it->isValid(); $it->next())\n {\n $names = $this->query->getFullFieldNames($it->getCurrent());\n if (!in_array($names[0], $this->tables))\n {\n array_push($this->tables, $names[0]);\n }\n $name = join('.', $names);\n if (!in_array($name, $fields))\n {\n array_push($fields, $name);\n }\n }\n $this->setProperty('fields', $fields);\n $this->fieldCount = count($fields);\n }",
"protected function initDbTable()\r\n {\r\n }",
"protected function setFields()\n {\n $this->fields = [];\n $fields = $this->select('COLUMN_NAME', 'INFORMATION_SCHEMA.COLUMNS')\n ->where('TABLE_SCHEMA', '=', $this->getDatabaseName())\n ->andWhere('TABLE_NAME', '=', $this->tableName)\n ->all();\n\n foreach ($fields as $field) {\n $this->fields[] = \"$this->tableName.$field->COLUMN_NAME\";\n }\n }",
"abstract protected function buildTable();",
"protected function initTableDefinition() {\n\n global $db;\n if ( !$this->tableDefinition ) {\n //make sure we have a table object\n static::initTable();\n\n //grab the table definition from the database\n $tableInfo = static::$table->info();\n $tableInfo = $tableInfo['metadata'];\n\n $standardPrefix = '';\n\n foreach($tableInfo as $col => $data){\n //save all data but with lowercase strings\n foreach($data as $k => $v){\n $thisData[strtolower($k)] = $v;\n }\n\n //by default we just use the column name as the accessor\n $thisName = $col;\n\n //take care of primary key special treatment\n if($data['PRIMARY'] == 1){\n $thisName = 'id';\n $thisData['column'] = static::MODEL_PRIMARY_KEY;\n $thisData['permission'] = static::MODEL_PERMISSION_RO;\n $standardPrefix = str_ireplace('_id','',$col);\n\n //if column name contains '_id' we assume this is an object\n } elseif(preg_match('/_id$/',$col)){\n $thisName = str_ireplace('_id','',$col);\n $thisData['data_type'] = static::MODEL_TYPE_OBJECT;\n\n // determine if there is an override for this\n if(!$this->hasObjectOverride($col, $thisName)){\n // try to find the correct class, it could be\n // in any namespace\n $thisData['class'] = $this->getRealClassName($thisName);\n }\n\n } elseif($col == \"{$standardPrefix}_name\") {\n $thisName = 'label';\n }\n\n // if its an enum we want to create an array of all\n // possible values\n elseif(stristr($data['DATA_TYPE'],'enum')){\n $thisData['data_type']= static::MODEL_TYPE_ENUM;\n $thisData['enum_values'] = array();\n $values = str_ireplace(\"enum('\",'',$data['DATA_TYPE']);\n $values = str_ireplace(\"')\",'',$values);\n $values = explode(\"','\",$values);\n $thisData['enum_values'] = $values;\n }\n\n //save this data set to be assigned to the\n //tableDefinition attribute\n $newInfo[$thisName] = $thisData;\n\n //unset data for next round of the loop\n unset($thisData);\n unset($thisName);\n }\n\n //check for any overrides\n if($this->tableDefinitionOverride){\n foreach($this->tableDefinitionOverride as $name => $options){\n\n // Apply the column_name override first to ensure\n // the other overrides work properly\n if(array_key_exists('column_name',$options)){\n $newInfo = $this->renameAccessor($name, $options['column_name'], $newInfo);\n }\n\n // Apply all other overrrides\n foreach($options as $option=>$value) {\n if(array_key_exists($name,$newInfo) ||\n $options['data_type']==static::MODEL_TYPE_MANY_MANY || $options['data_type']==static::MODEL_TYPE_HAS_MANY){\n $newInfo[$name][$option] = $value;\n }\n }\n }\n }\n\n\n foreach($newInfo as $accessor => $data) {\n // Make sure any attributes with type object have a\n // class assigned\n if( $data['data_type'] == static::MODEL_TYPE_OBJECT\n && empty($data['class'])) {\n throw new Zebu_Model_Exception(\"accessor type is MODEL_TYPE_OBJECT, but no class found for accessor: $accessor\");\n }\n\n // Automagically figure out class name for linking tables\n if( $data['data_type'] == static::MODEL_TYPE_MANY_MANY\n && !isset($data['linking_class'])){\n $newInfo[$accessor]['linking_class'] =\n $this->getLinkingClass($data['class']);\n $newInfo[$accessor]['linking_accessor'] =\n $this->getAccessorFromClassName($data['class']);\n }\n\n // Automagically figure out accessor name for linking class\n if( $data['data_type'] == static::MODEL_TYPE_MANY_MANY\n && !isset($data['linking_accessor'])){\n $newInfo[$accessor]['linking_accessor'] =\n $this->getAccessorFromClassName($data['class']);\n }\n }\n\n //use the info to generate table definition array\n $this->tableDefinition = $newInfo;\n }\n }",
"private function populateDummyTable() {}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remove the media entities for that field and type. | private function removeMediaEntities($entity_type_id, $bundle, $field_name) {
// Grab all our nodes to get the media ids.
$entities = $this->entityTypeManager
->getStorage($entity_type_id)
->loadByProperties([
'type' => [$bundle],
]);
// Go through and load up the target entity ids.
foreach ($entities as $entity) {
$media = [];
$ids = $entity->get($field_name)->getValue();
foreach ($ids as $id) {
if (isset($id['target_id'])) {
$media_check = $this->entityTypeManager
->getStorage('media')->load($id['target_id']);
if ($media_check !== NULL) {
$media[] = $media_check;
}
}
}
// Remove the media entities associated with that type.
if (!empty($media)) {
$this->entityTypeManager->getStorage('media')->delete($media);
}
}
} | [
"public function removeMedia(Request $request)\n {\n $input = $request->all();\n $eProviderType = $this->eProviderTypeRepository->findWithoutFail($input['id']);\n try {\n if ($eProviderType->hasMedia($input['collection'])) {\n $eProviderType->getFirstMedia($input['collection'])->delete();\n }\n } catch (Exception $e) {\n Log::error($e->getMessage());\n }\n }",
"public function removeMedia(Request $request)\n {\n $input = $request->all();\n $country = $this->countryRepository->findWithoutFail($input['id']);\n try {\n if ($country->hasMedia($input['collection'])) {\n $country->getFirstMedia($input['collection'])->delete();\n }\n } catch (Exception $e) {\n Log::error($e->getMessage());\n }\n }",
"public function removeMedia(Request $request)\n {\n $input = $request->all();\n $franchise = $this->franchiseRepository->findWithoutFail($input['id']);\n try {\n if ($franchise->hasMedia($input['collection'])) {\n $franchise->getFirstMedia($input['collection'])->delete();\n }\n } catch (\\Exception $e) {\n Log::error($e->getMessage());\n }\n }",
"function removeType()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n\r\n // delete values\r\n $db->query( \"DELETE FROM eZMediaCatalogue_AttributeValue WHERE MediaID='$this->ID'\" );\r\n\r\n $db->query( \"DELETE FROM eZMediaCatalogue_TypeLink WHERE MediaID='$this->ID'\" );\r\n\r\n }",
"public function removeMedia(Request $request)\n {\n $input = $request->all();\n $food = $this->foodRepository->findWithoutFail($input['id']);\n try {\n if ($food->hasMedia($input['collection'])) {\n $food->getFirstMedia($input['collection'])->delete();\n }\n } catch (\\Exception $e) {\n Log::error($e->getMessage());\n }\n }",
"public function removeMedia(Request $request)\n {\n $input = $request->all();\n $extraGroup = $this->extraGroupRepository->findWithoutFail($input['id']);\n try {\n if($extraGroup->hasMedia($input['collection'])){\n $extraGroup->getFirstMedia($input['collection'])->delete();\n }\n } catch (\\Exception $e) {\n Log::error($e->getMessage());\n }\n }",
"public function removeMedia(Request $request)\n {\n $input = $request->all();\n $paymentStatus = $this->paymentStatusRepository->findWithoutFail($input['id']);\n try {\n if ($paymentStatus->hasMedia($input['collection'])) {\n $paymentStatus->getFirstMedia($input['collection'])->delete();\n }\n } catch (Exception $e) {\n Log::error($e->getMessage());\n }\n }",
"public function removeMedia(Request $request)\n {\n $input = $request->all();\n $store = $this->storeRepository->findWithoutFail($input['id']);\n try {\n if ($store->hasMedia($input['collection'])) {\n $store->getFirstMedia($input['collection'])->delete();\n }\n } catch (\\Exception $e) {\n Log::error($e->getMessage());\n }\n }",
"private function unlinkMedia()\n {\n $params = ['displayGroupId' => $this->displayGroupId];\n\n $sql = 'DELETE FROM `lkmediadisplaygroup` WHERE DisplayGroupID = :displayGroupId AND mediaId NOT IN (0';\n\n $i = 0;\n foreach ($this->media as $media) {\n /* @var Media $media */\n $i++;\n $sql .= ',:mediaId' . $i;\n $params['mediaId' . $i] = $media->mediaId;\n }\n\n $sql .= ')';\n\n $this->getStore()->update($sql, $params);\n }",
"public function removeMedia(Request $request)\n {\n $input = $request->all();\n $driversPayout = $this->driversPayoutRepository->findWithoutFail($input['id']);\n try {\n if($driversPayout->hasMedia($input['collection'])){\n $driversPayout->getFirstMedia($input['collection'])->delete();\n }\n } catch (\\Exception $e) {\n Log::error($e->getMessage());\n }\n }",
"public function removeMedia(Request $request)\n {\n $input = $request->all();\n $market = $this->marketRepository->findWithoutFail($input['id']);\n try {\n if ($market->hasMedia($input['collection'])) {\n $market->getFirstMedia($input['collection'])->delete();\n }\n } catch (\\Exception $e) {\n Log::error($e->getMessage());\n }\n }",
"public function removeMedia(Request $request)\n {\n $input = $request->all();\n $slide = $this->slideRepository->findWithoutFail($input['id']);\n try {\n if ($slide->hasMedia($input['collection'])) {\n $slide->getFirstMedia($input['collection'])->delete();\n }\n } catch (Exception $e) {\n Log::error($e->getMessage());\n }\n }",
"public function removeMedia()\n {\n global $current_screen;\n\n if ($current_screen->post_type != 'page') {\n remove_action('media_buttons', 'media_buttons');\n }\n }",
"public function removeMedia(Request $request)\n {\n $input = $request->all();\n $marketsPayout = $this->marketsPayoutRepository->findWithoutFail($input['id']);\n try {\n if ($marketsPayout->hasMedia($input['collection'])) {\n $marketsPayout->getFirstMedia($input['collection'])->delete();\n }\n } catch (\\Exception $e) {\n Log::error($e->getMessage());\n }\n }",
"public function removeMedia(Request $request)\n {\n $input = $request->all();\n $driver = $this->driverRepository->findWithoutFail($input['id']);\n try {\n if($driver->hasMedia($input['collection'])){\n $driver->getFirstMedia($input['collection'])->delete();\n }\n } catch (\\Exception $e) {\n Log::error($e->getMessage());\n }\n }",
"public function removeMedia(Request $request)\n {\n $input = $request->all();\n $shop = $this->shopRepository->findWithoutFail($input['id']);\n try {\n if ($shop->hasMedia($input['collection'])) {\n $shop->getFirstMedia($input['collection'])->delete();\n }\n } catch (\\Exception $e) {\n Log::error($e->getMessage());\n }\n }",
"public function removeMedia(Request $request)\n {\n $input = $request->all();\n $restaurantReview = $this->restaurantReviewRepository->findWithoutFail($input['id']);\n try {\n if($restaurantReview->hasMedia($input['collection'])){\n $restaurantReview->getFirstMedia($input['collection'])->delete();\n }\n } catch (\\Exception $e) {\n Log::error($e->getMessage());\n }\n }",
"public function removeMedia(Request $request)\n {\n $input = $request->all();\n $shopsPayout = $this->shopsPayoutRepository->findWithoutFail($input['id']);\n try {\n if ($shopsPayout->hasMedia($input['collection'])) {\n $shopsPayout->getFirstMedia($input['collection'])->delete();\n }\n } catch (\\Exception $e) {\n Log::error($e->getMessage());\n }\n }",
"public function removeMedia(Request $request)\n {\n $input = $request->all();\n $shopReview = $this->shopReviewRepository->findWithoutFail($input['id']);\n try {\n if ($shopReview->hasMedia($input['collection'])) {\n $shopReview->getFirstMedia($input['collection'])->delete();\n }\n } catch (\\Exception $e) {\n Log::error($e->getMessage());\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Visits the node representing the INSERT action of MERGE statement | public function walkMergeInsert(nodes\merge\MergeInsert $clause); | [
"function mINSERT(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$INSERT;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:19:3: ( 'insert' ) \n // Tokenizer11.g:20:3: 'insert' \n {\n $this->matchString(\"insert\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }",
"abstract protected function _insert();",
"protected abstract function insert();",
"protected function insertStatement()\n {\n }",
"protected function insertStmt()\n {\n }",
"public function lInsert() {\n\t}",
"abstract public function insert ( \\Hoa\\Tree\\Generic $child );",
"public function insert(Entity $entity) {}",
"public function is_insert_statement(): bool\n {\n $sql = $this->get_query();\n return StatementTypes::is_insert_statement($sql);\n }",
"protected function preInsert() {}",
"abstract public function insert(Model $source, $targets);",
"public function selectSourceRecordsAsInsertStatements();",
"public function insertAsParentOf(Doctrine_Record $dest);",
"function insertScenario()\n\t{\n\t\tglobal $ilCtrl;\n\n\t\tinclude_once(\"./Modules/Scorm2004/classes/class.ilSCORM2004OrganizationHFormGUI.php\");\n\n\t\t$slm_tree =& new ilTree($this->object->getId());\n\t\t$slm_tree->setTreeTablePK(\"slm_id\");\n\t\t$slm_tree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');\n\n\t\t$node_id = $_POST[\"node_id\"];\n\n\t\tinclude_once(\"./Modules/Scorm2004/classes/class.ilSCORM2004PageNode.php\");\n\t\tinclude_once(\"./Modules/Scorm2004/classes/class.ilSCORM2004Node.php\");\n\t\tinclude_once(\"./Modules/Scorm2004/classes/seq_editor/class.ilSCORM2004SeqTemplate.php\");\n\n\t\tif (!$_POST[\"first_child\"])\t// insert after node id\n\t\t{\n\t\t\t$parent_id = $slm_tree->getParentId($node_id);\n\t\t\t$target = $node_id;\n\t\t}\n\t\telse // insert as first child\n\t\t{\n\t\t\t$parent_id = $node_id;\n\t\t\t$target = IL_FIRST_NODE;\n\t\t}\n\n\t\t$template = new ilSCORM2004SeqTemplate($_POST[\"identifier\"]);\n\t\t$id = $template->insertTemplateForObjectAtParent($this->object,$parent_id,$target);\n\t\t$ilCtrl->setParameter($this, \"highlight\", $id);\n\t\t$ilCtrl->redirect($this, \"showOrganization\", \"node_\".$node_id);\n\n\t}",
"public function insertingnode( $newnode=null,$refnode=null,$type=null, $nodenaming=true , $inheritvalues=false ) {\n// if ( $type==\"inside\") {\n// $parent=$refnode;\n// } else {\n// $parent=$refnode->parent();\n// }\n $parent = ($type==\"inside\") ? $refnode : $refnode->parent();\n\n $newnode= ($nodenaming) ? $this->nodeNaming($parent, $newnode) : $newnode;\n\n $success=false;\n switch ( $type ) {\n case \"inside\":\n if ( $refnode->append($newnode,false) ) {\n $success=true;\n }\n break;\n case \"before\":\n if ( $newnode->insertBefore($refnode,false) ) {\n $success=true;\n }\n break;\n case \"after\":\n if ( $newnode->insertAfter($refnode,false) ) {\n $success=true;\n }\n break;\n }\n if($success) {\n if($inheritvalues) {\n $this->inheritvalues( $newnode , $parent );\n }\n $jsondata=$this->formatNode($newnode);\n return CJSON::encode($jsondata);\n }\n\n return $success;\n }",
"private function evaluateInsert(Statement $statement)\n\t\t{\t\t\t\n\t\t\t$TABLES = $this->evaluateTables($statement);\n\t\t\t$FIELDS = $this->evaluateFields($statement);\n\t\t\t$VALUES = $this->evaluateValues($statement);\n\t\t\t\n\t\t\treturn\n\t\t\t\t'INSERT INTO '. $TABLES .\n\t\t\t\t' (' . $FIELDS . ') ' .\n\t\t\t\t'VALUES (' . $VALUES . ')'\n\t\t\t;\t\t\t\t\n\t\t}",
"public function parseInsertStatement()\n {\n $sql = Sql::createSql($this->_adapter)->insert('users');\n $sql->set(\n [\n 'name' => 'filipe',\n 'email' => 'filipe@example.com'\n ]\n );\n $expected = \"INSERT INTO users (name, email) VALUES (:name, :email)\";\n $this->assertEquals($expected, $sql->getQueryString());\n $this->assertEquals(\n [\n ':name' => 'filipe',\n ':email' => 'filipe@example.com'\n ],\n $sql->getParameters()\n );\n\n $this->assertEquals(1, $sql->execute());\n $this->assertEquals($sql, InsertAdapter::$sql);\n $this->assertEquals($sql->getParameters(), InsertAdapter::$params);\n }",
"public function insertRowInEntityTblDML()\n {\n\t\t$sql = $this->getQueryContent('insertRowInEntityTblDML');\n\t\treturn $this->db->fireFastSqlQuery($sql,'insertRowInEntityTblDML');\n\t}",
"public function insertAction()\n\t{\n\t\t$module = $this->_useModules ? \"{$this->_moduleName}/\" : '';\n\t\t\n\t\t$data = $this->_getDataFromPost();\n\n\t\t$options = array(\n\t\tFgsl_Form_Edit::DATA => $data,\n\t\tFgsl_Form_Edit::ACTION => BASE_URL.\"$module{$this->_controllerAction}/save\",\n\t\tFgsl_Form_Edit::MODEL => $this->_model\n\t\t);\n\n\t\t$this->_view->assign('form', new Fgsl_Form_Edit($options));\n\t\t$this->_view->render('insert.phtml');\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add a Province or State | public function addProvince() {
if (!$this->validCSRFToken()) $this->error("Invalid Request");
$country = new \Geography\Country($_REQUEST['country_id']);
if (! $country->id) $this->error("Country not found");
$province = new \Geography\Province();
$parameters = array();
if (isset($_REQUEST['name'])) $parameters['name'] = $_REQUEST['name'];
if (isset($_REQUEST['abbreviation'])) $parameters['abbreviation'] = $_REQUEST['abbreviation'];
$parameters['country_id'] = $country->id;
if (! $province->add($parameters)) $this->error("Error adding province: ".$province->error());
$response = new \HTTP\Response();
$response->success = 1;
$response->province = $province;
print $this->formatOutput($response);
} | [
"public function addProvince(Province $province) {\n $this->provinces[] = $province;\n }",
"public function addCity(ProvinceInterface $province, $cityName);",
"public function actionCreate()\n {\n $model = new Province();\n $model->status = 10;\n $model->created_at = date('Y-m-d H:i:s');\n $model->updated_at = date('Y-m-d H:i:s');\n if ($this->request->isPost) {\n if ($model->load($this->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n } else {\n $model->loadDefaultValues();\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function addState(CountryInterface $country, $stateCode, $stateName);",
"public function addCity() {\n\t\tglobal $REQUEST_DATA;\n\n\t\treturn SystemDatabaseManager::getInstance()->runAutoInsert('city', array('cityCode','cityName','stateId'), array(strtoupper($REQUEST_DATA['cityCode']),$REQUEST_DATA['cityName'],$REQUEST_DATA['states']) );\n\t}",
"public function addStateAction()\n {\n $form = new Admin_Form_State();\n $this->view->form = $form;\n \n if ($this->getRequest()->isPost()) {\n $formData = $this->getRequest()->getPost();\n if ($form->isValid($formData)) {\n $name = $form->getValue('name');\n $abbv = $form->getValue('abbv');\n $states = new Admin_Model_stateService();\n $states->add($name, $abbv);\n $this->_helper->flashMessenger->addMessage(\"State saved\");\n \n $this->_forward('index');\n } else {\n $form->populate($formData);\n }\n\n }\n \n }",
"public function add(State $additional): State;",
"public function isStateProvinceRequired();",
"function setStateOrProvince($stateorprovince)\n {\n $this->__stateorprovince = $stateorprovince ;\n }",
"public function setProvince($value) {\n return $this->set(self::PROVINCE, $value);\n }",
"public function isStateProvinceRequired()\n {\n return true;\n }",
"function set_RegistrantStateProvince($state)\r\n{\r\n\t$this->RegistrantStateProvince = $state;\r\n}",
"public function addnewcountry($country, $region){\n\t\t$connection = Database::getConnection();\n\t\t$query=\"INSERT INTO country VALUES (DEFAULT, '\".$country.\"', '\".$region.\"')\";\n\t\tif (!$connection->query($query)){\n\t\t\techo \"Error :\" .$query . \"<br>\" . $connection->error;\n\t\t}else{\n\t\t\techo \"Country added successfully.<br>\\n\";\n\t\t}\n\t}",
"public function add_country($data) {\n $this->db->insert('tours_country', $data);\n }",
"function wc_add_portugal_districts( $states ) {\n\n $states['PT'] = array(\n\t\t'AV' => 'Distrito de Aveiro',\n\t\t'BE' => 'Distrito de Beja',\n\t\t'BR' => 'Distrito de Braga',\n\t\t'BG' => 'Distrito de Bragança',\n\t\t'CB' => 'Distrito de Castelo Branco',\n\t\t'CO' => 'Distrito de Coimbra',\n\t\t'EV' => 'Distrito de Évora',\n\t\t'FA' => 'Distrito de Faro',\n\t\t'GU' => 'Distrito da Guarda',\n\t\t'LE' => 'Distrito de Leiria',\n\t\t'LI' => 'Distrito de Lisboa',\n\t\t'PO' => 'Distrito do Porto',\n\t\t'PA' => 'Distrito de Portalegre',\n\t\t'SA' => 'Distrito de Santarém',\n\t\t'SE' => 'Distrito de Setúbal',\n\t\t'VC' => 'Distrito de Viana do Castelo',\n\t\t'VR' => 'Distrito de Vila Real',\n\t\t'VI' => 'Distrito de Viseu',\n\t);\n\n return $states;\n\n}",
"public function store(CreateprovinceRequest $request)\n {\n if(!Sentinel::inRole('main')){\n return redirect('dashboard');\n }\n $input = $request->all();\n\n $province = $this->provinceRepository->create($input);\n\n Flash::success('province saved successfully.');\n\n return redirect(route('provinces.index'));\n }",
"public function setProvince($value)\n {\n return $this->set(self::province, $value);\n }",
"function setStateOrProvinceLabel($label)\n {\n $this->__user_stateorprovince_label = $label ;\n }",
"public function actionCreate()\n {\n\t\t\tif (Yii::$app->user->can('create-countries'))\n\t\t\t{\n\t\t\t\t$model = new Mtprovinces();\n\n if ($model->load(Yii::$app->request->post())) {\n\t\t\t\t\t$model->province_created = date('Y-m-d h:i:s');\n\t\t\t\t\t$model->province_status = 'ACTIVE';\n\t\t\t\t\t$model->province_updated = date('Y-m-d h:i:s');\n\t\t\t\t\t$model->save();\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new ForbiddenHttpException; \n\t\t\t}\n \n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get expiration time for a specific Level and User | public static function get_user_expiration( $level, $user_id = null ) {
$key = 'svbk_rcp_ctd_' . $level->role . '_discount_expires';
$expire = null;
$discount = self::main_discount($level->id);
if( $discount ) {
$discounts_db = new \RCP_Discounts();
$expire = $discounts_db->get_expiration( $discount->id );
if ( $expire ) {
$expdate = DateTime::createFromFormat('Y-m-d', $expire);
$expdate->setTime(23, 59, 59);
return $expdate;
}
}
if ( $user_id && ( $user_expiration = get_user_meta( $user_id, $key, true ) ) ) {
$expire = $user_expiration;
} else {
$session = WP_Session::get_instance();
if ( isset( $session[ $key ] ) ) {
$expire = $session[ $key ];
}
}
return apply_filters( 'svbk_rcp_countdown_get_user_expiration', $expire, $level, $user_id );
} | [
"public function getExpirationTime( );",
"function ihc_update_user_level_expire($level_data, $l_id, $u_id){\n\tglobal $wpdb;\n\t$table = $wpdb->prefix . 'ihc_user_levels';\n\n\tif (empty($level_data)){\n\t\t$temp_level_data = get_option('ihc_levels');\n\t\tif (isset($temp_level_data[$l_id])){\n\t\t\t$level_data = $temp_level_data[$l_id];\n\t\t}\n\t}\n\n\tif (empty($level_data['access_type'])){\n\t\t$level_data['access_type'] = 'unlimited';\n\t}\n\n\t$current_time = time();\n\t//getting the current expire time, if it's exists. Old expire time will be current time\n\t$q = $wpdb->prepare(\"SELECT expire_time, start_time FROM $table WHERE user_id=%d AND level_id=%d ;\", $u_id, $l_id);\n\t$data = $wpdb->get_row($q);\n\tif ($data && isset($data->expire_time) && isset($data->start_time)){ //&& !empty($data->expire_time)\n\t\t$expire_time = strtotime($data->expire_time);\n\t\t$start_time = strtotime($data->start_time);\n\t\tif ( $expire_time>0 && $expire_time>time() && $expire_time>$start_time){ /// level has not expired yet\n\t\t\t$current_time = $expire_time;\n\t\t} else if ($start_time>$current_time){ /// made for magic feat\n\t\t\t$current_time = $start_time;\n\t\t}\n\t}\n\n\t/// LOGS\n\tIhc_User_Logs::set_user_id($u_id);\n\tIhc_User_logs::set_level_id($l_id);\n\t$username = Ihc_Db::get_username_by_wpuid($u_id);\n\t$level_name = Ihc_Db::get_level_name_by_lid($l_id);\n\tif (empty($expire_time) || $expire_time<0){\n\t\tIhc_User_Logs::write_log(__('Level ', 'ihc') . $level_name . __(' become active for User ', 'ihc') . $username, 'user_logs');\n\t\t$first_time = TRUE;\n\t} else {\n\t\tIhc_User_Logs::write_log(__('Level ', 'ihc') . $level_name . __(' was renewed by User ', 'ihc') . $username, 'user_logs');\n\t\t$first_time = FALSE;\n\t}\n\t/// LOGS\n\n\t//set end time\n\tswitch ($level_data['access_type']){\n\t\tcase 'unlimited':\n\t\t\t$end_time = strtotime('+10 years', $current_time);//unlimited will be ten years\n\t\tbreak;\n\t\tcase 'limited':\n\t\t\tif (!empty($level_data['access_limited_time_type']) && !empty($level_data['access_limited_time_value'])){\n\t\t\t\t$multiply = ihc_get_multiply_time_value($level_data['access_limited_time_type']);\n\t\t\t\t$end_time = $current_time + $multiply * $level_data['access_limited_time_value'];\n\t\t\t}\n\t\tbreak;\n\t\tcase 'date_interval':\n\t\t\tif (!empty($level_data['access_interval_end'])){\n\t\t\t\t$end_time = strtotime($level_data['access_interval_end']);\n\t\t\t}\n\t\tbreak;\n\t\tcase 'regular_period':\n\t\t\tif (!empty($level_data['access_regular_time_type']) && !empty($level_data['access_regular_time_value'])){\n\t\t\t\t$multiply = ihc_get_multiply_time_value($level_data['access_regular_time_type']);\n\t\t\t\t$end_time = $current_time + $multiply * $level_data['access_regular_time_value'];\n\t\t\t}\n\t\tbreak;\n\t}\n\n\n\t$update_time = date('Y-m-d H:i:s', time());\n\t$end_time = date('Y-m-d H:i:s', $end_time);\n\n\t$q = $wpdb->prepare(\"UPDATE $table SET update_time='$update_time', expire_time='$end_time', notification=0, status=1 WHERE user_id=%d AND level_id=%d \", $u_id, $l_id);\n\t$result = $wpdb->query($q);\n\n\tdo_action('ihc_action_after_subscription_activated', $u_id, $l_id, $first_time);\n}",
"public function getExpirationTime($params);",
"protected function expirationTime()\n {\n $ttl = $this->getOptions()->getTtl();\n if ($ttl > 2592000) {\n return time() + $ttl;\n }\n return $ttl;\n }",
"protected function getExpirationTime(): int {\n /** @var int $expiration_time */\n $expiration_time = $this->configFactory->get('cas_mock_server.settings')->get('users.expire');\n return $expiration_time;\n }",
"private static function PSD2expiration()\n {\n return now()->addDays(90)->subMinutes(AccessToken::TTL);\n }",
"public function createExpirationTime(){\n return time() + (int)$this->_expirationTime;\n }",
"private function expireTime()\n {\n return time() + Config::get('jwt.expiry'); // in seconds\n }",
"public function getExpiration()\n { \n return $this->expiration;\n }",
"function ihc_is_user_level_expired($u_id, $l_id, $not_started_check=TRUE, $expire_check=TRUE){\n\n\tglobal $wpdb;\n\t$grace_period = get_option('ihc_grace_period');\n\t$data = $wpdb->get_row('SELECT expire_time, start_time FROM ' . $wpdb->prefix . 'ihc_user_levels WHERE user_id=\"' . $u_id . '\" AND level_id=\"' . $l_id . '\";');\n\t$current_time = time();\n\tif (!empty($data->start_time) && $not_started_check){\n\t\t$start_time = strtotime($data->start_time);\n\t\tif ($current_time<$start_time){\n\t\t\t//it's not available yet\n\t\t\treturn 1;\n\t\t}\t\t\t\t\n\t}\t\n\tif (!empty($data->expire_time) && $expire_check){\n\t\t$expire_time = strtotime($data->expire_time) + ((int)$grace_period * 24 * 60 *60);\n\t\tif ($current_time>$expire_time){\n\t\t\t//it's expired\n\t\t\treturn 1;\n\t\t}\n\t}\n\treturn 0;\t\n}",
"function expire(){\n $now = new DateTime();\n $now = $now->format('Y-m-d H:i:s');\n $expiry_time = date('Y-m-d H:i',strtotime('+2 hours',strtotime($now)));\n\n return $expiry_time;\n }",
"function getLoginIDExpiration()\n {\n return $this->settings[TBL_SETTINGS_LOGIN_ID_EXP_INTERVAL];\n }",
"public function getExpirationTime()\n {\n return $this->expiration_time;\n }",
"public static function get_expire_time_otp()\n {\n return apply_filters('wordpress_acl_otp_time_expire', (MINUTE_IN_SECONDS * 5));\n }",
"public function getExpirationTime()\n {\n return $this->expirationTime;\n }",
"function cgsi_preprocess_views_view_field__User_Management__feed_2__expiration(&$vars) {\n\t$vars['output'] = date('m/d/Y', ($vars['row']->uc_roles_expirations_expiration - (60 * 60 * 24 * 10)));\n}",
"public function getExpirationDate();",
"public function get_expiration() {\n\t\t$days = get_theme_mod( 'wfc_cookie_duration', 30 );\n\t\t$days = absint( $days );\n\t\t$expiration = time() + 86400 * $days;\n\n\t\treturn $expiration;\n\t}",
"public static function getTimeToExpire(&$entry, $pwdmaxage) {\n global $currenttime;\n if(!isset($currenttime)) $currenttime = time();\n\n $age = $currenttime - self::getChangedTime($entry);\n \n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a new Juiz model. If creation is successful, the browser will be redirected to the 'view' page. | public function actionCreate()
{
$model = new Juiz();
if($model->load(Yii::$app->request->post()))
{
if($model->save())
{
return ['status' => true , 'errors' => 'asd'];
}else
{
return ['status' => false , 'errors' => $model->errors];
}
}else
{
return $this->render('create', [
'model' => $model,
]);
}
} | [
"public function actionCreate()\n {\n $model = new Typzamku();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n //return $this->redirect(['view', 'id' => $model->id]);\n\t\t\treturn $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Konsultasi();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Uzyt();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Huxuan();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Mahasiswa();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Haus();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['update', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new SurveyKepuasan();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'fakultas' => $model->fakultas, 'jurusan' => $model->jurusan]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Absensi();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Pengguna();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new Pelanggan();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Vypusk81();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new LaporanKunjungan();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n \n }",
"public function actionCreate()\n {\n $model = new Nomina();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect('index');\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate() {\n\n $model = new DataBukuKas();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new Objects();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new penjualan();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_penjualan]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new Model();\n $model->setScenario('insert');\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['/admin/model']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n\t\t$model = new Rol();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect('index');\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new HasilKonsultasi();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_hasil_konsultasi]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
OGRSetGetIntegerList() Create a field as integer, assign a value and retrive it after. | function OGRSetGetIntegerList($hFeatureIn, $iField, &$nCount, $value)
{
/*Assigning an integer value to the field to the field "0".*/
OGR_F_SetFieldIntegerList($hFeatureIn, $iField, $nCount, $value);
/*Retrieving the field value. */
$value[] = OGR_F_GetFieldAsIntegerList($hFeatureIn, $iField, $nCount);
for ($i = 0; $i < $nCount; $i++) {
printf("Integer value[%d] = %d\n", $i, $value[$i] );
}
return OGRERR_NONE;
} | [
"function field2int($list, $field){\n //$list -> Array que contiene el campo JSON\n //$field -> Nombre del Campo JSON a convertir\n foreach ($list as &$row) {\n $row[$field] = intval($row[$field]);\n }\n return $list; //Se retorna $list con el campo ya convertido\n}",
"function int(...$fields) {\n if (is_array($fields)) {\n $fields = reset($fields);\n }\n\n return $this->castField(\"int\", $fields);\n }",
"public function setFields($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::INT32);\n $this->fields = $arr;\n\n return $this;\n }",
"function castInts() {\n\t\t$this->id = (null === $this->id) ? null : (int) $this->id;\n\t\t$this->type = (null === $this->type) ? null : (int) $this->type;\n\t\t$this->updated = (null === $this->updated) ? null : (int) $this->updated;\n\t\t$this->created = (null === $this->created) ? null : (int) $this->created;\n\t\treturn $this;\n\t}",
"public function setIntField($value)\n {\n return $this->set(self::INT_FIELD, $value);\n }",
"function &_createIntegerField($fieldName)\n {\n $element = HTML_QuickForm::createElement($this->_getQFType('integer'),\n $this->_fb->getFieldName($fieldName),\n $this->_fb->getFieldLabel($fieldName));\n $attr = $this->_getAttributes('integer', $fieldName);\n $element->updateAttributes($attr);\n return $element;\n }",
"public static function getPicklistIdNr(string $fieldName): int\n\t{\n\t\treturn (int) (new \\App\\Db\\Query())->select(['picklistid'])\n\t\t\t->from('vtiger_picklist')\n\t\t\t->where(['name' => $fieldName])\n\t\t\t->scalar();\n\t}",
"public function getInteger() {\r\n\t return $this->integer;\t\r\n\t}",
"abstract public function integer($field,$length=11);",
"function castInts() {\n\t\t$this->pid = (null === $this->pid) ? null : (int) $this->pid;\n\t\t$this->age = (null === $this->age) ? null : (int) $this->age;\n\t\t$this->education = (null === $this->education) ? null : (int) $this->education;\n\t\t$this->sex = (null === $this->sex) ? null : (int) $this->sex;\n\t\t$this->paidTier = (null === $this->paidTier) ? null : (int) $this->paidTier;\n\t\t$this->highScore = (null === $this->highScore) ? null : (int) $this->highScore;\n\t\treturn $this;\n\t}",
"function castInts() {\n\t\t$this->id = (null === $this->id) ? null : (int) $this->id;\n\t\t$this->user_id = (null === $this->user_id) ? null : (int) $this->user_id;\n\t\t$this->created = (null === $this->created) ? null : (int) $this->created;\n\t\t$this->updated = (null === $this->updated) ? null : (int) $this->updated;\n\t\treturn $this;\n\t}",
"public function setInt($identifier, $value);",
"private function change_type_make_new_field_id(){\n if(!$query=$this->uCore->query('uCat',\"SELECT\n `field_id`\n FROM\n `u235_fields`\n WHERE\n `site_id`='\".site_id.\"'\n ORDER BY\n `field_id` DESC\n LIMIT 1\n \")) $this->uFunc->error(322);\n $id=$query->fetch_object();\n if(mysqli_num_rows($query)>0) $field_id=$id->field_id+1;\n else $field_id=1;\n\n //create new column in fields\n if(!$this->uCore->query(\"uCat\",\"ALTER TABLE\n `u235_items`\n ADD\n `field_\".$field_id.\"`\n \".$this->field_sql_type.\" NULL \")) $this->uFunc->error(423);\n\n return $field_id;\n }",
"function integerlist($start, $end, $inc, $name, $attribs = null, $selected = null, $format = \"\")\n\t{\n\t\t$start = intval($start);\n\t\t$end = intval($end);\n\t\t$inc = intval($inc);\n\t\t$arr = array();\n\n\t\tfor ($i = $start; $i <= $end; $i += $inc) {\n\t\t\t$fi = $format ? sprintf(\"$format\", $i) : \"$i\";\n\t\t\t$arr[] = GantrySelect::Option($fi, $fi);\n\t\t}\n\n\t\treturn GantrySelect::genericlist($arr, $name, $attribs, 'value', 'text', $selected);\n\t}",
"public function setNegativeIntValue($var) {}",
"public function getListType()\n {\n $value = $this->get(self::list_type);\n return $value === null ? (integer)$value : $value;\n }",
"public function readArrayOfInteger()\n {\n return $this->arrayWalk($this->readArray(), function(&$value)\n {\n $value = (integer) $value;\n });\n }",
"function db_prepare_int( $p_int ) {\r\n\t\treturn (integer)$p_int;\r\n\t}",
"function _toInteger( $key )\r\n\t{\r\n\t\tsettype( $this->$key, \"integer\" );\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
USER BAR FUNCTIONS Get logo base on theme settings. | function cubic_get_logo() {
global $PAGE, $OUTPUT;
if (!empty($PAGE->theme->settings->bar_logo)) {
$image = $OUTPUT->pix_url($PAGE->theme->settings->bar_logo, 'theme');
} else {
$image = $OUTPUT->pix_url('logo', 'theme');
}
$html = '<img src="'.$image.'" alt="'.cubic_get_title().'" />';
return $html;
} | [
"function get_logo() : array {\n\t\treturn registry_get( 'logo' )->get_custom_logo();\n\t}",
"function get_logo() {\n return File::exists('assets/images/logo-user.png')\n ? asset('assets/images/logo-user.png')\n : asset('assets/images/logo-default.png');\n }",
"function et_get_company_logo($user){\n\n\tif(!is_numeric($user)) {\n\t\tif($user instanceof WP_User)\n\t\t\t$user\t=\t$user->ID;\n\t}\n\n\t$user_logo\t= et_get_user_field( $user, 'user_logo' );\n\n\tif ( empty($user_logo) ){ // return default logo if user logo empty\n\t\t$general_opt = new ET_GeneralOptions();\n\t\t$default_logo\t= $general_opt->get_default_logo();\n\t\t$default_user_logo = array(\n\t\t\t'small_thumb'\t=> $default_logo,\n\t\t\t'company-logo'\t=> $default_logo,\n\t\t\t'thumbnail'\t\t=> $default_logo,\n\t\t\t'attach_id'\t\t=> 0\n\t\t);\n\t\treturn $default_user_logo;\n\t}\n\n\treturn $user_logo;\n\n}",
"public function getUserLogo() {\n return $this->get(self::USER_LOGO);\n }",
"private function get_company_logo()\n {\n }",
"private function getLogo() {\n\t\tglobal $wgStylePath, $wgDefaultTheme;\n\n\t\t$logoURL = '';\n\t\t$customLogo = wfFindFile( 'Bouquet-skin-logo.png' );\n\n\t\tif ( is_object( $customLogo ) ) {\n\t\t\t// Prefer a custom logo over the defaults (obviously!)\n\t\t\t$logoURL = $customLogo->getUrl();\n\t\t} else {\n\t\t\t$logoURL = \"{$wgStylePath}/Bouquet/resources/images/pink-header.png\";\n\t\t\t// $wgDefaultTheme is provided by [[mw:Extension:Theme]] and it is set\n\t\t\t// by default at least on ShoutWiki, but probably not elsewhere\n\t\t\t// Grumble grumble grumble...\n\t\t\t// Pasta from /extensions/Theme/Theme.php\n\t\t\t$themeFromRequest = $this->getSkin()->getRequest()->getVal( 'usetheme', false );\n\t\t\tif ( $themeFromRequest ) {\n\t\t\t\t$themeName = $themeFromRequest;\n\t\t\t} elseif ( isset( $wgDefaultTheme ) && $wgDefaultTheme != 'default' ) {\n\t\t\t\t$themeName = $wgDefaultTheme;\n\t\t\t} else {\n\t\t\t\t$themeName = false;\n\t\t\t}\n\n\t\t\t// internal (hyphenless) theme name -> directory/logo file mapping\n\t\t\t// yes, this is lame as hell and I should just rename the dirs & files instead\n\t\t\t$map = array(\n\t\t\t\t'forgetmenot' => 'forget-me-not',\n\t\t\t\t'pinkdogwood' => 'pink-dogwood',\n\t\t\t\t'tigerlily' => 'tiger-lily',\n\t\t\t);\n\n\t\t\tif ( isset( $map[$themeName] ) && $map[$themeName] ) {\n\t\t\t\t$logoURL = \"{$wgStylePath}/Bouquet/resources/colors/{$map[$themeName]}/{$map[$themeName]}-header.png\";\n\t\t\t}\n\t\t}\n\n\t\treturn $logoURL;\n\t}",
"function app_logo()\n {\n if (($model = Settings::instance('logo')) && $file = $model->getFirstMediaUrl('logo')) {\n return $file;\n }\n\n return 'https://ui-avatars.com/api/?name='.rawurldecode(config('app.name')).'&bold=true';\n }",
"function get_laborator_admin_menu_logo() {\n\treturn sprintf( '<span class=\"laborator-icon\">%s</span>', kalium_get_svg_file( 'assets/admin/images/laborator-admin-menu.svg' ) );\n}",
"function get_the_site_logo() {\n\n // Verify if logo exists\n if ( the_option('main_logo') ) {\n\n echo '<a class=\"home-page-link\" href=\"' . site_url() . '\">'\n . '<img src=\"' . the_option('main_logo') . '\">'\n . '</a>';\n\n }\n \n }",
"public static function siteLogo()\n\t{\n\t\t$custom_logo_id = get_theme_mod( 'custom_logo' );\n\t\t$image = wp_get_attachment_image_src( $custom_logo_id , 'full' );\n\t\t//print_r($image);\n\t\t//break;\n\t\treturn $image[0];\n\t}",
"public function get_org_logo() {\n\t\treturn Helper::get_settings( 'titles.knowledgegraph_logo', '' );\n\t}",
"function vodi_header_logo() {\n ?><div class=\"site-header__logo\"><?php\n if ( has_custom_logo() ) {\n the_custom_logo();\n } elseif ( apply_filters( 'vodi_use_svg_logo', false ) ) {\n ?><a href=\"<?php echo esc_url( home_url( '/' ) ); ?>\" rel=\"home\" class=\"navbar-brand\"><?php vodi_get_template( 'global/logo-svg.php' ); ?></a><?php\n } else {\n ?><a href=\"<?php echo esc_url( home_url( '/' ) ); ?>\" rel=\"home\" class=\"navbar-brand\"><h1 class=\"site-title\"><?php bloginfo( 'name' ); ?></h1></a><?php\n }\n ?></div><?php\n }",
"function cb_theme_logo(){\n\t\n\t\t$options = cuisine_get_theme_style();\n\t\t$html = '<a class=\"logo\" href=\"'.cuisine_site_url().'\">';\n\t\t\n\t\tif( isset( $options['logo-image'] ) && $options['logo-image'] != 'none' && $options['logo-image'] != '' )\n\t\t\t$html .= '<img src=\"'.$options['logo-image'].'\"/>';\n\t\t\n\t\n\t\tif( isset( $options['logo-show-text'] ) && $options['logo-show-text'] == '1')\n\t\t\t$html .= '<h1>'.get_bloginfo( 'name', 'raw' ).'</h1>';\n\t\n\t\t$html .= '</a>';\n\t\n\t\techo $html;\n\t}",
"public function getLogo() { \n if($this->getConfigData(\"invertlogo\") == 1){\n return \"https://staticpg.paytm.in/pg_plugins_logo/paytm_logo_invert.svg\";\n } \n return \"https://staticpg.paytm.in/pg_plugins_logo/paytm_logo_paymodes.svg\";\n }",
"function dashboard_logo() {\n\techo '\n\t <style type=\"text/css\">\n\t #wpadminbar #wp-admin-bar-wp-logo > .ab-item .ab-icon { content: url('. get_site_icon_url( ) .') !important; width: 25px; height: 25px; top: 3px; }\n\t </style>\n\t\t ';\n }",
"public static function change_admin_bar_logo_front_end() {\n\t\tif (static::show_admin_bar())\n\t\t\treturn static::change_admin_bar_logo();\n\t}",
"public static function getUserLogoPath()\n {\n return !empty(\\Yii::$app->user->identity->logo) ? \\Yii::$app->user->identity->logo : \\Yii::$app->params['defaultLogo'];\n }",
"function get_custom_logo_uri()\n{\n\t$custom_logo_id = get_theme_mod('custom_logo');\n\t$image = wp_get_attachment_image_src($custom_logo_id, 'full');\n\treturn $image[0];\n}",
"function wp_login_fluency_custom_logo() {\n\techo get_option('fluency_login_logo')!='' ? '<style type=\"text/css\">#login h1 a { background-image:url('.get_option('fluency_login_logo').') !important; }</style>' : null;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if the item type is valid. | public static function isItemTypeValid($itemType)
{
$itemTypes = ['project', 'milestone', 'task', 'bug', 'file'];
return in_array($itemType, $itemTypes);
} | [
"function is_valid_item_type($type)\n {\n $temp = array('books',\n 'electronic_books',\n 'consumer_electronics',\n 'food',\n 'personal_computers',\n 'software',\n 'sports_and_outdoors',\n 'music',\n 'musical_instrument',\n 'video_games',\n 'clothes',\n 'office_products',\n 'others');\n return (in_array($type, $temp));\n }",
"protected function checkItemType($itemObj)\n {\n return true;\n }",
"protected function validateType()\n {\n $types = [null, 'proportion', 'portion_num', 'portion_str'];\n\n return in_array($this->input['type'], $types, true);\n }",
"public function checkType() {\n return !$this->bTypeMissmatch;\n }",
"public function hasItemType(): bool\n {\n return $this->itemTypeAttr !== NULL;\n }",
"private function _check_items() {\n $is_valid = true;\n if(count($this->_data['items']) <= 0) {\n $is_valid = false;\n $this->add_error('the order must contain at least one item');\n }\n return $is_valid;\n }",
"protected function verifyItem($item): bool {\n if (!is_object($item)) {\n return FALSE;\n }\n if (empty($this->permittedClasses)) {\n return TRUE;\n }\n\n // We check each permitted class individually.\n $isValid = false;\n foreach ($this->permittedClasses as $permittedClass) {\n if ($item instanceof $permittedClass) {\n $isValid = true;\n }\n }\n\n return $isValid;\n }",
"abstract protected function validate($item);",
"protected function validateItem($item){\n if(!is_object($item)) throw new InvalidArgumentException(\"Item must be an object\");\n\n if(!is_a($item, $this->objectName)){\n throw new InvalidArgumentException(\"Item is not of subtype \" . $this->objectName);\n }\n }",
"public function validType ($type) {\r\n return in_array($type, static::$types);\r\n }",
"abstract public function validate( $item );",
"function is_valid_type($type){\n\t\treturn in_array($type, $this->valid_types);\n\t}",
"function validate_fishbowl_item($mysqli, $item)\n{\n\tif ( empty($item[\"date\"])\n\t || !is_numeric($item[\"log_type\"]) ) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}",
"public function validateOptionType() {\r\n\t\t$isValid = false;\r\n\t\tforeach($this->optionTypes as $application => $optionTypes) {\r\n\t\t\tif(isset($optionTypes[$this->optionType])) {\r\n\t\t\t\t$isValid = true;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(!$isValid) $this->errorType['optionType'] = 'invalid';\r\n\t}",
"static function check(mixed $item, mixed $type) : void\n {\n if(gettype($item) === 'array')\n {\n foreach($item as $i)\n {\n self::check($i, $type);\n }\n } \n else if(!$item instanceof $type)\n {\n throw new InvalidArgumentException(\n 'Found an item of type ' . gettype($item) . \n ' where a type of ' . $type . ' was expected.'\n );\n }\n }",
"private function assertIsCorrectType($item): void\n {\n $itemDataType = gettype($item);\n\n if ($itemDataType !== $this->dataType) {\n throw new InvalidArgumentException(sprintf('Item is not an instance of \"%s\"', $this->dataType));\n }\n\n if ($itemDataType === 'object' && !($item instanceof $this->instanceType)) {\n throw new InvalidArgumentException(sprintf('Item is not an instance of \"%s\"', $this->instanceType));\n }\n }",
"protected function validateType()\r\n {\r\n $ok = TRUE;\r\n $type = $this->column->getType();\r\n\r\n if ($type == \\Db\\Column\\Column::TYPE_INTEGER)\r\n {\r\n if (!self::isInteger($this->value))\r\n {\r\n $ok = FALSE;\r\n }\r\n }\r\n else if ($type == \\Db\\Column\\Column::TYPE_DECIMAL)\r\n {\r\n if (!is_numeric(str_replace(',', '', $this->value)))\r\n {\r\n $ok = FALSE;\r\n }\r\n }\r\n\r\n return $ok;\r\n }",
"protected function isCorrectType($item)\n {\n if (is_null($this->type)) {\n return true;\n }\n\n if ($this->type !== 'object' && is_object($item)) {\n return $item instanceof $this->type;\n }\n\n return gettype($item) === $this->type;\n }",
"public function validateItem(Item $item)\n\t{\n\t\t$this->itemValidator->validate($item);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create request for operation 'getCorporationsCorporationIdFacilities' | public function getCorporationsCorporationIdFacilitiesRequest($corporation_id, $datasource = 'tranquility', $if_none_match = null, $token = null, string $contentType = self::contentTypes['getCorporationsCorporationIdFacilities'][0])
{
// verify the required parameter 'corporation_id' is set
if ($corporation_id === null || (is_array($corporation_id) && count($corporation_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $corporation_id when calling getCorporationsCorporationIdFacilities'
);
}
if ($corporation_id < 1) {
throw new \InvalidArgumentException('invalid value for "$corporation_id" when calling CorporationApi.getCorporationsCorporationIdFacilities, must be bigger than or equal to 1.');
}
$resourcePath = '/v2/corporations/{corporation_id}/facilities/';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// query params
$queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
$datasource,
'datasource', // param base name
'string', // openApiType
'', // style
false, // explode
false // required
) ?? []);
// query params
$queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
$token,
'token', // param base name
'string', // openApiType
'', // style
false, // explode
false // required
) ?? []);
// header params
if ($if_none_match !== null) {
$headerParams['If-None-Match'] = ObjectSerializer::toHeaderValue($if_none_match);
}
// path params
if ($corporation_id !== null) {
$resourcePath = str_replace(
'{' . 'corporation_id' . '}',
ObjectSerializer::toPathValue($corporation_id),
$resourcePath
);
}
$headers = $this->headerSelector->selectHeaders(
['application/json', ],
$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 OAuth (access token)
if (!empty($this->config->getAccessToken())) {
$headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
}
$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 testGetCorporationsCorporationIdFacilities()\n {\n }",
"public function getFacilities()\n {\n $facilitiesArray = [];\n $facilityType = FacilityType::all();\n foreach ($facilityType as $k => $type) {\n $facilitiesArray[$k]['id'] = $type->id;\n $facilitiesArray[$k]['name'] = $type['name_' . app()->getLocale()];\n foreach ($type->facility_values as $key => $value) {\n $facilitiesArray[$k]['facilities'][$key]['id'] = $value->id;\n $facilitiesArray[$k]['facilities'][$key]['name'] = $value['name_' . app()->getLocale()];\n }\n }\n return $this->fire($facilitiesArray);\n }",
"public function getFacility();",
"public function getFacilitiesRelation()\n {\n $facilitiesrelation = $this->_objectManager->create('Ced\\Booking\\Model\\ProductFacilityRelation')->getCollection()->addFieldToFilter('product_id',$this->getProductId());\n return $facilitiesrelation;\n }",
"public function getAllFacilities(){\n return $this->getFacilities();\n }",
"function getRequestFacilities($requestID){ \n// Return IDs of facilities selected in request by user.\n\tglobal $DB;\n\t\n\tif($DB->query(\n\t\"SELECT facilityID FROM request_facility WHERE requestID = :requestID\", \n\t\t\t\t\tarray(':requestID' => $requestID))) {\n\t\treturn $DB->results();\n\t}\n\t\n\telse{\n\t\treturn false;\n\t}\n}",
"public function getCorporationsNpccorpsRequest($datasource = 'tranquility', $if_none_match = null, string $contentType = self::contentTypes['getCorporationsNpccorps'][0])\n {\n\n\n\n\n $resourcePath = '/v2/corporations/npccorps/';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(\n $datasource,\n 'datasource', // param base name\n 'string', // openApiType\n '', // style\n false, // explode\n false // required\n ) ?? []);\n\n // header params\n if ($if_none_match !== null) {\n $headerParams['If-None-Match'] = ObjectSerializer::toHeaderValue($if_none_match);\n }\n\n\n\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', ],\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\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 getDoctors(Request $request)\n {\n $spec_id = $request->id;\n\n $specs = User::where('specialization_id', $spec_id)->where('id', '!=', auth()->user()->id)->get();\n\n $response = \"\";\n\n if(count($specs))\n {\n foreach ($specs as $spec) {\n $response .= \"<option value='\" . $spec['id'] . \"'>\" . $spec['name'] . \"</option>\";\n }\n return $response;\n }\n else\n return json_encode('error: No Doctor matches your request',500);\n\n\n }",
"protected function allowanceChargeCodeTypesRequest()\n {\n\n $resourcePath = '/v2/dataelements/allowancechargecodetypes';\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 // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function getIdentityprovidersCicRequest()\n {\n\n $resourcePath = '/api/v2/identityproviders/cic';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function getCompanyIndustriesRequest($id)\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 getCompanyIndustries'\n );\n }\n\n $resourcePath = '/company/{id}/industries';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n // 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 }",
"protected function infoAvailableCountriesRequest()\n {\n\n $resourcePath = '/info/countries';\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', 'text/json', 'application/xml', 'text/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml'],\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\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 actionCreate() {\n if (User::userIsAllowedTo('Manage facilities')) {\n $model = new Facility();\n if (Yii::$app->request->isAjax) {\n $model->load(Yii::$app->request->post());\n return Json::encode(\\yii\\widgets\\ActiveForm::validate($model));\n }\n if ($model->load(Yii::$app->request->post())) {\n //get latitude and longitude and create a geom array\n if (!empty($model->coordinates)) {\n $arr = explode(\",\", $model->coordinates);\n $model->latitude = $arr[0];\n $model->longitude = $arr[1];\n $model->geom = new Expression(\"ST_SetSRID(ST_GeomFromText(:point),4326)\",\n array(':point' => 'POINT(' . $model->longitude . ' ' . $model->latitude . ')'));\n }\n if (empty($model->coordinates) && (!empty($model->latitude) && !empty($model->longitude))) {\n $model->geom = new Expression(\"ST_SetSRID(ST_GeomFromText(:point),4326)\",\n array(':point' => 'POINT(' . $model->longitude . ' ' . $model->latitude . ')'));\n }\n\n $model->date_created = new Expression('NOW()');\n $model->date_updated = new Expression('NOW()');\n $model->created_by = Yii::$app->user->identity->id;\n $model->updated_by = Yii::$app->user->identity->id;\n $model->province_approval_status = 0;\n $model->national_approval_status = 0;\n $model->status = 0; //pending provincial approval\n //all facilities created through MFL are public=1\n //All those from HPCZ are private=2\n $model->ownership_type = 1;\n\n if ($model->save()) {\n //We log action taken\n $audit = new AuditTrail();\n $audit->user = Yii::$app->user->id;\n $audit->action = \"Added Facility \" . $model->name;\n $audit->ip_address = Yii::$app->request->getUserIP();\n $audit->user_agent = Yii::$app->request->getUserAgent();\n $audit->save();\n //We notify province that a facility has been approved for their review\n $role_model = \\common\\models\\RightAllocation::findOne(['right' => \"Approve facility - Province\"]);\n if (!empty($role_model)) {\n $facility_province = \\backend\\models\\Districts::findOne($model->district_id);\n $user = User::findOne([\"role\" => $role_model->role, \"province_id\" => $facility_province->province_id]);\n if ($user) {\n $subject = \"New MFL Facility:\" . $model->name;\n $msg = \"\";\n $msg .= \"<p>Hello! \" . $user->first_name . \" \" . $user->last_name . \"<br>\";\n $msg .= \"A new MFL facility:\" . $model->name . \" has been created. You need to verify the submitted information as a province \"\n . \"user before it can be approved at National level<br>\";\n $msg .= \"Login below to view the full details</p>\";\n if (self::sendEmail($subject, $user->email, $msg)) {\n Yii::$app->session->setFlash('success', 'Facility was added successfully.You can add Services after it has been approved');\n } else {\n Yii::$app->session->setFlash('warning', 'Facility was added successfully. But notification was not sent to province user for verification!');\n }\n } else {\n Yii::$app->session->setFlash('warning', 'Facility was added successfully. But notification was not sent to province user for verification!');\n }\n } else {\n Yii::$app->session->setFlash('warning', 'Facility was added successfully. But notification was not sent to province user for verification!');\n }\n\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n $message = \"\";\n foreach ($model->getErrors() as $error) {\n $message .= $error[0];\n }\n Yii::$app->session->setFlash('error', 'Error occured while adding facility. Error::' . $message);\n }\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n } else {\n Yii::$app->session->setFlash('error', 'You are not authorised to perform that action.');\n return $this->redirect(['home/home']);\n }\n }",
"function fetchCommodity(array &$form, FormStateInterface $form_state) \n {\n $vr_variety_id = $form_state->getValue('vr_variety');\n $commodity_options = array();\n if (!empty($vr_variety_id) && is_numeric($vr_variety_id)) {\n // Fetch Parents of selected variety.\n $storage = \\Drupal::service('entity_type.manager')->getStorage('taxonomy_term');\n $variety_parents = $storage->loadParents($vr_variety_id);\n foreach ($variety_parents as $term_id => $term) {\n $commodity_options[$term_id] = $term->getName();\n }\n foreach ($form['field_vr_fc_commodity']['widget'] as $index => $pc_item) {\n if (is_numeric($index)) {\n $form['field_vr_fc_commodity']['widget'][$index]['field_fc_commodity']['widget']['#default_value'] = array();\n $form['field_vr_fc_commodity']['widget'][$index]['field_fc_commodity']['widget']['#options'] = $commodity_options;\n }\n }\n } else {\n $commodity_options = redbook_pcl_custom_get_terms('commodity');\n foreach ($form['field_vr_fc_commodity']['widget'] as $index => $pc_item) {\n if (is_numeric($index)) {\n $form['field_vr_fc_commodity']['widget'][$index]['field_fc_commodity']['widget']['#options'] = $commodity_options;\n }\n }\n }\n return $form['field_vr_fc_commodity'];\n }",
"public function getMFLFacilities() {\n return $this->hasMany(MFLFacility::className(), ['constituency_id' => 'id']);\n }",
"public function getCorporationsCorporationIdFacilitiesAsync($corporation_id, $datasource = 'tranquility', $if_none_match = null, $token = null, string $contentType = self::contentTypes['getCorporationsCorporationIdFacilities'][0])\n {\n return $this->getCorporationsCorporationIdFacilitiesAsyncWithHttpInfo($corporation_id, $datasource, $if_none_match, $token, $contentType)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function getAccessibleFacultyIds(): array;",
"protected function getAuthorizationDivisionsLimitRequest()\n {\n\n $resourcePath = '/api/v2/authorization/divisions/limit';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function getAffiliationList(Request $request)\n {\n try {\n $data = [];\n $jobSeekerAffiliationData = [];\n $userId = $request->userServerData->user_id;\n if ($userId > 0) {\n $affiliationList = Affiliation::getAffiliationList();\n $jobseekerAffiliation = JobSeekerAffiliation::getUserAffiliationList($userId);\n\n if (!empty($jobseekerAffiliation)) {\n foreach ($jobseekerAffiliation as $key => $value) {\n $jobSeekerAffiliationData[$value['affiliationId']] = ['affiliationId' => $value['affiliationId'], 'otherAffiliation' => $value['otherAffiliation']];\n }\n }\n\n if (!empty($affiliationList)) {\n foreach ($affiliationList as $key => $value) {\n $data[$key]['affiliationId'] = $value['affiliationId'];\n $data[$key]['affiliationName'] = $value['affiliationName'];\n $data[$key]['otherAffiliation'] = !empty($jobSeekerAffiliationData[$value['affiliationId']]['otherAffiliation']) ? $jobSeekerAffiliationData[$value['affiliationId']]['otherAffiliation'] : null;\n $data[$key]['jobSeekerAffiliationStatus'] = !empty($jobSeekerAffiliationData[$value['affiliationId']]) ? 1 : 0;\n }\n }\n\n $return['list'] = array_values($data);\n\n $returnResponse = ApiResponse::customJsonResponse(1, 200, trans(\"messages.affiliation_list_success\"), ApiResponse::convertToCamelCase($return));\n } else {\n $returnResponse = ApiResponse::customJsonResponse(0, 204, trans(\"messages.invalid_token\"));\n }\n } catch (\\Exception $e) {\n Log::error($e);\n $returnResponse = ApiResponse::responseError(trans(\"messages.something_wrong\"), [\"data\" => $e->getMessage()]);\n }\n\n return $returnResponse;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ convert $basicData to map of listing_id => $basicData for that listing_id. | private function _cacheListingBasicData(&$basicData)
{
$map = array();
foreach ($basicData as &$listing){
if (array_key_exists('Listing', $listing) && array_key_exists('listing_id', $listing['Listing']))
Cache::write('ListingBasicData-'.$listing['Listing']['listing_id'], $listing, 'MapData');
$map[$listing['Listing']['listing_id']] = &$listing;
}
return $map;
} | [
"protected abstract function mapData();",
"private function map_fields( $location_data ) {\n\t\t$field_map = array (\n\t\t\t'name' => 'sl_store',\n\t\t);\n\t\tforeach ( $field_map as $alias => $field ) {\n\t\t\tif ( ! isset( $location_data[$field] ) || empty( $location_data[$field] ) ) {\n\t\t\t\tif ( isset( $location_data[$alias] ) && ! empty( $location_data[$alias] ) ) {\n\t\t\t\t\t$location_data[ $field ] = $location_data[ $alias ];\n\t\t\t\t}\n\t\t\t\tif ( isset( $location_data[ 'sl_' . $alias] ) && ! empty( $location_data[ 'sl_' . $alias] ) ) {\n\t\t\t\t\t$location_data[ $field ] = $location_data[ 'sl_' . $alias ];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $location_data;\n\t}",
"function edit($listing_id)\n {\n $query = \"\n SELECT\n PaidListingField.listing_id AS element_id, PaidListingField.fields\n FROM\n #__jreviews_paid_listing_fields AS PaidListingField\n WHERE\n PaidListingField.listing_id IN (\" .cleanIntegerCommaList($listing_id). \")\"\n ;\n\n $fieldValues = $this->query($query,'loadObjectList','element_id');\n\n if(empty($fieldValues)) return false;\n\n foreach($fieldValues AS $key=>$values) {\n\n $fields = json_decode($values->fields);\n\n $fieldValues[$key] = (object) array_merge((array)$values,(array)$fields);\n\n unset($fieldValues[$key]->fields,$fields);\n }\n\n return $fieldValues;\n }",
"public function map()\n {\n $item = $this->item;\n\n $map = [];\n $map['url'] = $item['id'];\n $map['title'] = strip_tags($this->translate($item['title']));\n $map['content'] = strip_tags($this->translate($item['description']), '<br>');\n $map['#price'] = $this->decimal($item['price']);\n $map['email'] = $this->config['email'];\n $map['contact'] = $this->config['contact_data'];\n\n if (!empty($item['location']['city']))\n {\n $map['city'] = $item['location']['city'];\n }\n\n if (!empty($item['location']['state']))\n {\n $map['province'] = $item['location']['state'];\n }\n\n // http://www.clasf.es/feed-specifications/#categories\n $map['category'] = 'Inmobiliaria';\n $map['subcategory'] = $this->subcategory();\n $map['subcategory2'] = $this->subcategory2();\n $map['subcategory3'] = $this->subcategory3();\n\n $map['pictures']['url_img']= $this->pictures();\n\n return $map;\n }",
"public function extractDetailsData($raw_current_data,$raw_detail_data){\n\n\t\t\t$main_data = $this->extractCurrentData($raw_current_data);\n\n\t\t\t$raw_data_array = $raw_detail_data->list;\n\n\t\t\t$hourly_data_array = array();\n\n\t\t\t//daily forcasts not provided by this source so it is aproximated from hourly data\n\t\t\t$daily_data_array = $this->createDailyDataArray($raw_data_array);\n\n\n\t\t\t//fill hourly array with data\n\t\t\tforeach($raw_data_array as $current_data_block){\n\t\t\t\t$current_main = $current_data_block->main;\n\t\t\t\t$current_weather = $current_data_block->weather[0];\n\t\t\t\t$current_wind = $current_data_block->wind;\n\n\t\t\t\t$precip = $this->calculateprecip($current_data_block->rain,$current_data_block->snow);\n\n\t\t\t\t//normalize icon value\n\t\t\t\t$icon = $this->convertIcon($current_weather->icon);\n\n\t\t\t\t//three of each data block is added because source frequency is every 3 hours and needs to be normalized\n\t\t\t\tfor($num_to_add = 2; $num_to_add >= 0; $num_to_add--){\n\t\t\t\t\tarray_push($hourly_data_array,new HourlyDataBlock($current_data_block->dt - (3600*$num_to_add),$icon,\n\t\t\t\t\t$current_weather->description,$precip,null,$current_main->temp,$current_wind->speed));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//no descriptions for this source\n\t\t\t$hourly_data = new DataArray($hourly_data_array,null);\n\t\t\t$daily_data = new DataArray($daily_data_array,null);\n\n\t\t\t//substitute null values with data arrays\n\t\t\t$main_data->hourly = $hourly_data;\n\t\t\t$main_data->daily = $daily_data;\n\n\t\t\treturn $main_data;\n\t\t}",
"public function getAmenitiesFromListingId($listingId) {\n $query = \"SELECT * \n FROM listingAmenities \n WHERE listingId=?\";\n\n $stmt = $this->databaseConnection->prepare($query);\n $stmt->bind_param(\"d\", $listingId);\n $result = $stmt->execute();\n\n $return = [];\n foreach ($stmt->get_result() as $row) {\n // Append amenity pair\n $return[$row['amenity']] = $row['amenityValue'];\n }\n\n return $return;\n }",
"protected function prepareDataForMapping()\n {\n $data = parent::prepareDataForMapping();\n\n if (isset($data['membership_id']) && 0 < (int)$data['membership_id']) {\n $membership = \\XLite\\Core\\Database::getRepo('XLite\\Model\\Membership')->find($data['membership_id']);\n\n if (isset($membership)) {\n $data['membership'] = $membership;\n }\n }\n\n if (!isset($data['membership'])) {\n $data['membership'] = null;\n }\n\n return $data;\n }",
"static public function getDataMap()\n {\n return array(\n 'fields' => array(\n 'wiki_id' => array(\n 'type' => 'string',\n ),\n 'wiki_mata_id' => array(\n 'type' => 'string',\n ),\n 'video_playlist_id' => array(\n 'type' => 'string',\n ),\n 'title' => array(\n 'type' => 'string',\n ),\n 'url' => array(\n 'type' => 'string',\n ),\n 'config' => array(\n 'type' => 'raw',\n ),\n 'time' => array(\n 'type' => 'string',\n ),\n 'mark' => array(\n 'type' => 'integer',\n ),\n 'model' => array(\n 'type' => 'string',\n ),\n 'referer' => array(\n 'type' => 'string',\n ),\n 'publish' => array(\n 'type' => 'boolean',\n ),\n 'vc_id' => array(\n 'type' => 'string',\n ),\n 'created_at' => array(\n 'type' => 'date',\n ),\n 'updated_at' => array(\n 'type' => 'date',\n ),\n ),\n 'references' => array(\n\n ),\n 'embeddeds' => array(\n\n ),\n 'relations' => array(\n\n ),\n );\n }",
"static public function getDataMap()\n {\n return array(\n 'fields' => array(\n 'douban_id' => array(\n 'type' => 'integer',\n ),\n 'name' => array(\n 'type' => 'string',\n ),\n 'name_en' => array(\n 'type' => 'string',\n ),\n 'avatars' => array(\n 'type' => 'string',\n ),\n 'summary' => array(\n 'type' => 'string',\n ),\n 'gender' => array(\n 'type' => 'string',\n ),\n 'birthday' => array(\n 'type' => 'string',\n ),\n 'country' => array(\n 'type' => 'string',\n ),\n 'born_place' => array(\n 'type' => 'string',\n ),\n 'professions' => array(\n 'type' => 'string',\n ),\n 'constellation' => array(\n 'type' => 'raw',\n ),\n 'created_at' => array(\n 'type' => 'date',\n ),\n 'updated_at' => array(\n 'type' => 'date',\n ),\n ),\n 'references' => array(\n\n ),\n 'embeddeds' => array(\n\n ),\n 'relations' => array(\n\n ),\n );\n }",
"public function buildDataMap() {\n\t\t$this->dataMap = $this->dataMapFactory->buildDataMap(get_class($this->object));\n\t}",
"public function prepareDetailsData()\n {\n $array = $this->picalcdata->getData();\n $this->setDetailsTotalAmount($array['total_amount']);\n $this->setDetailsAmount($array['amount']);\n $this->setDetailsInterestRate($array['interest_rate']);\n $this->setDetailsInterestAmount($array['interest_amount']);\n $this->setDetailsServiceCharge($array['service_charge']);\n $this->setDetailsAnnualPercentageRate($array['annual_percentage_rate']);\n $this->setDetailsMonthlyDebitInterest($array['monthly_debit_interest']);\n $this->setDetailsNumberOfRates($array['number_of_rates']);\n $this->setDetailsRate($array['rate']);\n $this->setDetailsLastRate($array['last_rate']);\n }",
"protected function extract_field_map_data($complete_field_map_data) {\n\n foreach ($complete_field_map_data as $field_array) {\n\n $array = array();\n\n foreach ($this->fields_to_extract as $field) {\n\n $array[$field] = $field_array[$field];\n }\n $this->field_map_data[] = $array;\n }\n }",
"private function get_mapped_col_info($data_col_index){\n\n\t\t//first prepare all table fileds list into one array\n\n\t\t$all_master_field_single_array = array();\n\n\t\t$all_field_list_multy_array = $this->get_all_fields_array();\n\n\t\t//make it a single multy array\n\n\t\tforeach($all_field_list_multy_array as $categories){\n\n\t\t\tforeach($categories as $category=>$field){\n\n\t\t\t\t$all_master_field_single_array[$field['FIELD_ID']] = $field;\n\t\t\t}\n\n\t\t}//end foreach\n\n\t\t//get column-table field mapped array to identify appropriate mapped table field\n\n\t\t$mapped_col_field_array = $this->get_mapped_cols_array();\n\n\t\t//now get corresponding table field info\n\n\t\t$field_index = $mapped_col_field_array[$data_col_index];\n\t\t\t\n\t\treturn $all_master_field_single_array[$data_col_index];\n\n\t}",
"function cp_listing_data_values() {\n\tglobal $post;\n\n\t$output = array();\n\n\t$make_address = get_post_meta( $post->ID, 'cp_street', true ) . ' ' . get_post_meta( $post->ID, 'cp_city', true ) . ' ' . get_post_meta( $post->ID, 'cp_state', true ) . ' ' . get_post_meta( $post->ID, 'cp_zipcode', true );\n\t$coordinates = cp_get_geocode( $post->ID );\n\n\t$data['id'] = $post->ID;\n\t$data['title'] = the_title_attribute( array( 'post' => $post, 'echo' => false ) );\n\t$data['permalink'] = get_permalink( $post->ID );\n\t$data['address'] = $make_address;\n\n\tif ( $coordinates ) {\n\t\t$data['lat'] = (float) $coordinates['lat'];\n\t\t$data['lng'] = (float) $coordinates['lng'];\n\t}\n\n\t$image = wp_get_attachment_image_src( cp_get_featured_image_id( $post->ID ), 'thumbnail' );\n\n\tif ( is_array( $image ) && isset( $image[ 0 ] ) ) {\n\t\t$data['image'] = $image[ 0 ];\n\t} else {\n\t\t$data['image'] = get_template_directory_uri() . '/assets/images/placeholder.png';\n\t}\n\n\t// Build out the data attributes.\n\tforeach ( $data as $key => $value ) {\n\t\t$output[] .= sprintf( 'data-%s=\"%s\"', $key, esc_attr( strip_tags( $value ) ) );\n\t}\n\n\treturn implode( ' ', $output );\n}",
"private function mapSet($data, $response_field) {\n // This method will handle values tagged with set keyword to indicate\n // the a response field expects an array of values. ie:\n // response field [\n // {\n // name 1,\n // age 1\n // },\n // {\n // name 2,\n // age 2\n // } ....\n // ]\n\n $map_data = [];\n\n foreach($data as $set_key => $set_value) {\n $set_ctr = 0;\n\n foreach($set_value as $set_item_value) {\n $map_data[ $set_key ][ $response_field[ $set_ctr ] ] = $set_item_value;\n $set_ctr++;\n }\n }\n\n return $map_data;\n }",
"public function getListingsFromCollectionId($collectionId) {\n $query = \"SELECT * \n FROM collections \n INNER JOIN collectionListings as cl\n ON collections.collectionId = cl.collectionId\n INNER JOIN listings \n ON listings.listingId=cl.listingId \n INNER JOIN \n (SELECT * FROM images GROUP BY listingId) as image \n ON listings.listingId = image.listingId\n WHERE collections.collectionId=?\";\n\n $stmt = $this->databaseConnection->prepare($query);\n $stmt->bind_param(\"d\", $collectionId);\n $result = $stmt->execute();\n\n $listings = [];\n foreach ($stmt->get_result() as $row) {\n // Append listing\n $listing = $this->constructListingFromRow($row);\n $listing->setImageLink($row['link']);\n $listings[] = $listing;\n }\n\n return $listings;\n }",
"function getOneListing($listing_id) {\n $end_point = 'listings/'.$listing_id;\n $result = $this->apiGet($end_point);\n print_r($result);\n\n return $result;\n }",
"protected function _buildAttributeData()\n {\n $this->_attributeData = array();\n $collection = Mage::getResourceModel('gene_bluefoot/attribute_collection')\n ->addVisibleFilter();\n\n foreach($collection as $attr){\n $this->_attributeData[$attr->getAttributeCode()] = $this->_flattenAttributeData($attr);\n $this->_attributeCodes[$attr->getId()] = $attr->getAttributeCode();\n }\n $this->_initAttributeFlag = true;\n }",
"public function set_listing_fields(){\r\n\r\n //Nuevo para Trestle\r\n $field_mapping = FFD_Listings_Trestle_Sync::fields('trestle', 'meta');\r\n\r\n $fields = array();\r\n $field_types = array();\r\n foreach($field_mapping as $pb_key => $db_key){\r\n $sanitize_field = $this->sanitize_field_key($db_key);\r\n $key = $sanitize_field['key'];\r\n $type = $sanitize_field['type'];\r\n if( !empty($key) ){\r\n $field_types[$key] = $type;\r\n $fields[$key] = $pb_key;\r\n }\r\n }\r\n /* $fields = array(\r\n 'mls_id' => 'mls_id__c',\r\n 'listdate' => 'listed_date__c',\r\n 'saledate' => 'sale_date__c',\r\n 'listprice' => 'pba__listingprice_pb__c',\r\n 'saleprice' => 'sale_price__c',\r\n 'sqftprice' => 'price_per_sqft__c',\r\n 'status' => 'pba__status__c',\r\n 'listtype' => 'pba__listingtype__c',\r\n 'proptype' => 'propertytypenormailzed__c',\r\n 'dom' => 'dom__c',\r\n 'lat' => 'pba__latitude_pb__c',\r\n 'lng' => 'pba__longitude_pb__c',\r\n 'beds' => 'pba__bedrooms_pb__c',\r\n 'baths' => 'pba__fullbathrooms_pb__c',\r\n 'halfbaths => 'pba__halfbathrooms_pb__c',\r\n 'lotsize' => 'pba__lotsize_pb__c',\r\n 'totalarea' => 'pba__totalarea_pb__c',\r\n 'city' => 'pba__city_pb__c',\r\n 'state' => 'pba__state_pb__c',\r\n 'neighborhood' => 'area_text__c',\r\n 'address' => 'pba__address_pb__c',\r\n 'postalcode' => 'pba__postalcode_pb__c',\r\n 'image' => 'media',\r\n 'openhouse' => 'open_house_date_time__c',\r\n 'yearbuilt' => 'pba__yearbuilt_pb__c',\r\n 'parking' => 'parkingspaces__c',\r\n 'view' => 'view__c'\r\n ); */\r\n\r\n $_fields = apply_filters( 'ffd_listing_fields', $fields);\r\n\r\n if( !empty($_fields) ){\r\n foreach($fields as $name => $value ){\r\n if( isset($_fields[$name]) ){\r\n $fields[$name] = $_fields[$name];\r\n }\r\n }\r\n }\r\n\r\n $this->listing_fields = $fields;\r\n $this->field_types = $field_types;\r\n\r\n\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/! Constructs a new eZFormRenderer object. | function eZFormRenderer( $form = "" )
{
$ini =& INIFile::globalINI();
if ( get_class( $form ) == "ezform" )
{
$this->Form = $form;
}
$Language = $ini->read_var( "eZFormMain", "Language" );
$this->Template = new eZTemplate( "ezform/admin/" . $ini->read_var( "eZFormMain", "AdminTemplateDir" ),
"ezform/admin/intl/", $Language, "form.php" );
$this->Template->setAllStrings();
$this->Template->set_file( "form_renderer_page_tpl", "formrenderer.tpl" );
$this->Template->set_block( "form_renderer_page_tpl", "text_field_item_tpl", "text_field_item" );
$this->Template->set_block( "form_renderer_page_tpl", "text_block_item_tpl", "text_block_item" );
$this->Template->set_block( "form_renderer_page_tpl", "text_area_item_tpl", "text_area_item" );
$this->Template->set_block( "form_renderer_page_tpl", "result_item_tpl", "result_item" );
$this->Template->set_block( "form_renderer_page_tpl", "text_label_item_tpl", "text_label_item" );
$this->Template->set_block( "form_renderer_page_tpl", "text_header_1_item_tpl", "text_header_1_item" );
$this->Template->set_block( "form_renderer_page_tpl", "text_header_2_item_tpl", "text_header_2_item" );
$this->Template->set_block( "form_renderer_page_tpl", "hr_line_item_tpl", "hr_line_item" );
$this->Template->set_block( "form_renderer_page_tpl", "empty_item_tpl", "empty_item" );
$this->Template->set_block( "form_renderer_page_tpl", "numerical_float_item_tpl", "numerical_float_item" );
$this->Template->set_block( "form_renderer_page_tpl", "numerical_integer_item_tpl", "numerical_integer_item" );
$this->Template->set_block( "form_renderer_page_tpl", "multiple_select_item_tpl", "multiple_select_item" );
$this->Template->set_block( "form_renderer_page_tpl", "header_tpl", "header" );
$this->Template->set_block( "form_renderer_page_tpl", "frequency_tpl", "frequency" );
$this->Template->set_block( "form_renderer_page_tpl", "sum_tpl", "sum" );
$this->Template->set_block( "form_renderer_page_tpl", "average_tpl", "average" );
$this->Template->set_block( "form_renderer_page_tpl", "min_tpl", "min" );
$this->Template->set_block( "form_renderer_page_tpl", "max_tpl", "max" );
$this->Template->set_block( "form_renderer_page_tpl", "median_tpl", "median" );
$this->Template->set_block( "form_renderer_page_tpl", "percentile_tpl", "percentile" );
$this->Template->set_block( "form_renderer_page_tpl", "cross_table_tpl", "cross_table" );
$this->Template->set_block( "form_renderer_page_tpl", "graph_table_tpl", "graph_table" );
$this->Template->set_block( "form_renderer_page_tpl", "min25median75max_tpl", "min25median75max" );
$this->Template->set_block( "form_renderer_page_tpl", "list_tpl", "list" );
$this->Template->set_block( "list_tpl", "list_row_tpl", "list_row" );
$this->Template->set_block( "graph_table_tpl", "graph_row_tpl", "graph_row" );
$this->Template->set_block( "graph_row_tpl", "graph_cell_tpl", "graph_cell" );
$this->Template->set_block( "graph_cell_tpl", "bar_tpl", "bar" );
$this->Template->set_block( "cross_table_tpl", "header_row_tpl", "header_row" );
$this->Template->set_block( "header_row_tpl", "header_cell_tpl", "header_cell" );
$this->Template->set_block( "cross_table_tpl", "cross_table_row_tpl", "cross_table_row" );
$this->Template->set_block( "cross_table_row_tpl", "cross_table_cell_tpl", "cross_table_cell" );
$this->Template->set_block( "frequency_tpl", "frequency_element_tpl", "frequency_element" );
$this->Template->set_block( "form_renderer_page_tpl", "count_tpl", "count" );
$this->Template->set_block( "multiple_select_item_tpl", "multiple_select_item_sub_item_tpl", "multiple_select_item_sub_item" );
$this->Template->set_block( "form_renderer_page_tpl", "dropdown_item_tpl", "dropdown_item" );
$this->Template->set_block( "dropdown_item_tpl", "dropdown_item_sub_item_tpl", "dropdown_item_sub_item" );
$this->Template->set_block( "form_renderer_page_tpl", "user_email_item_tpl", "user_email_item" );
$this->Template->set_block( "numerical_float_item_tpl", "numerical_float_range_tpl", "numerical_float_range" );
$this->Template->set_block( "numerical_integer_item_tpl", "numerical_integer_range_tpl", "numerical_integer_range" );
$this->Template->set_block( "form_renderer_page_tpl", "table_item_tpl", "table_item" );
$this->Template->set_block( "table_item_tpl", "table_item_sub_item_tpl", "table_item_sub_item" );
$this->Template->set_block( "table_item_sub_item_tpl", "table_item_cell_tpl", "table_item_cell" );
$this->Template->set_block( "form_renderer_page_tpl", "radiobox_item_tpl", "radiobox_item" );
$this->Template->set_block( "radiobox_item_tpl", "radiobox_item_sub_item_tpl", "radiobox_item_sub_item" );
$this->Template->set_block( "form_renderer_page_tpl", "checkbox_item_tpl", "checkbox_item" );
$this->Template->set_block( "checkbox_item_tpl", "checkbox_item_sub_item_tpl", "checkbox_item_sub_item" );
$this->Template->set_block( "form_renderer_page_tpl", "form_list_tpl", "form_list" );
$this->Template->set_block( "form_list_tpl", "form_item_tpl", "form_item" );
$this->Template->set_block( "form_item_tpl", "break_tpl", "break" );
$this->Template->set_block( "form_list_tpl", "form_start_tag_tpl", "form_start_tag" );
$this->Template->set_block( "form_list_tpl", "form_edit_start_tag_tpl", "form_edit_start_tag" );
$this->Template->set_block( "form_list_tpl", "form_end_tag_tpl", "form_end_tag" );
$this->Template->set_block( "form_list_tpl", "form_buttons_tpl", "form_buttons" );
$this->Template->set_block( "form_buttons_tpl", "previous_button_tpl", "previous_button" );
$this->Template->set_block( "form_buttons_tpl", "ok_button_tpl", "ok_button" );
$this->Template->set_block( "form_buttons_tpl", "next_button_tpl", "next_button" );
$this->Template->set_block( "form_list_tpl", "form_instructions_tpl", "form_instructions" );
$this->Template->set_block( "form_renderer_page_tpl", "error_list_tpl", "error_list" );
$this->Template->set_block( "error_list_tpl", "error_item_tpl", "error_item" );
$this->Template->set_var( "list", "" );
$this->Template->set_var( "min25median75max", "" );
$this->Template->set_var( "graph_table", "" );
$this->Template->set_var( "cross_table", "" );
$this->Template->set_var( "percentile", "" );
$this->Template->set_var( "madian", "" );
$this->Template->set_var( "max", "" );
$this->Template->set_var( "min", "" );
$this->Template->set_var( "sum", "" );
$this->Template->set_var( "average", "" );
$this->Template->set_var( "frequency", "" );
$this->Template->set_var( "count", "" );
$this->Template->set_var( "error_list", "" );
$this->Template->set_var( "error_item", "" );
$this->Template->set_var( "form_start_tag", "" );
$this->Template->set_var( "form_edit_start_tag", "" );
$this->Template->set_var( "form_sender", "" );
$this->Template->set_var( "form_end_tag", "" );
$this->Template->set_var( "form_buttons", "" );
$this->Template->set_var( "previous_button", "" );
$this->Template->set_var( "ok_button", "" );
$this->Template->set_var( "next_button", "" );
$this->Template->set_var( "form_list", "" );
$this->Template->set_var( "form_item", "" );
$this->Template->set_var( "text_field_item", "" );
$this->Template->set_var( "result_item", "" );
$this->Template->set_var( "text_area_item", "" );
$this->Template->set_var( "text_block_item", "" );
$this->Template->set_var( "text_label_item", "" );
$this->Template->set_var( "text_header_1_item", "" );
$this->Template->set_var( "text_header_2_item", "" );
$this->Template->set_var( "hr_line_item", "" );
$this->Template->set_var( "empty_item", "" );
$this->Template->set_var( "table_item", "" );
$this->Template->set_var( "table_item_sub_item", "" );
$this->Template->set_var( "form_instructions", "" );
$this->Template->set_var( "form_sender_value", "" );
$this->Template->set_var( "numerical_float_range", "" );
$this->Template->set_var( "numerical_integer_range", "" );
$this->Template->set_var( "user_email_item", "" );
global $GlobalSectionID, $SectionIDOverride;
if ( isSet( $SectionIDOverride ) )
{
$this->Template->set_var( "section_id", $SectionIDOverride );
}
else
{
$this->Template->set_var( "section_id", $GlobalSectionID );
}
$this->Page = -1;
} | [
"public function getFormRenderer() : FormRenderer;",
"public function getFormRenderer();",
"protected function getMaker_Renderer_FormTypeRendererService()\n {\n include_once \\dirname(__DIR__, 4).'/vendor/symfony/maker-bundle/src/Renderer/FormTypeRenderer.php';\n\n return $this->privates['maker.renderer.form_type_renderer'] = new \\Symfony\\Bundle\\MakerBundle\\Renderer\\FormTypeRenderer(($this->privates['maker.generator'] ?? $this->getMaker_GeneratorService()));\n }",
"protected function getMaker_Renderer_FormTypeRendererService()\n {\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\maker-bundle\\\\src\\\\Renderer\\\\FormTypeRenderer.php';\n\n return $this->privates['maker.renderer.form_type_renderer'] = new \\Symfony\\Bundle\\MakerBundle\\Renderer\\FormTypeRenderer(($this->privates['maker.generator'] ?? $this->getMaker_GeneratorService()));\n }",
"abstract public function newRenderer();",
"function newPNForm($name)\n {\n Loader::requireOnce('includes/pnForm.php');\n return new pnFormRender($name);\n }",
"public function generate_renderer(){\n if(class_exists($this->type) && method_exists($this->type, 'render_content'))\n $this->renderer = new $this->type( $this->value, $this->control_settings);\n else\n $this->renderer = null;\n }",
"protected function getTwig_Form_RendererService()\n {\n return $this->privates['twig.form.renderer'] = new \\Symfony\\Component\\Form\\FormRenderer(new \\Symfony\\Bridge\\Twig\\Form\\TwigRendererEngine($this->parameters['twig.form.resources'], ($this->services['twig'] ?? $this->getTwigService())), NULL);\n }",
"protected function getTwig_Form_RendererService()\n {\n return $this->services['twig.form.renderer'] = new \\Symfony\\Bridge\\Twig\\Form\\TwigRenderer(new \\Symfony\\Bridge\\Twig\\Form\\TwigRendererEngine(array(0 => 'form_div_layout.html.twig'), ${($_ = isset($this->services['twig']) ? $this->services['twig'] : $this->get('twig')) && false ?: '_'}), NULL);\n }",
"protected function createRendererFactory() {\n\t\t$factoryClassName = $this->config('form-renderer-factory.class-name');\n\t\t$factoryConstructorArguments = $this->config('form-renderer-factory.constructor-arguments');\n\t\treturn TypeUtilities::buildTypeCheckedObject(\n\t\t\t$factoryClassName,\n\t\t\t'form renderer factory',\n\t\t\tnull,\n\t\t\tarray( '\\\\Sitegear\\\\Form\\\\Renderer\\\\Factory\\\\RendererFactoryInterface' ),\n\t\t\t$factoryConstructorArguments\n\t\t);\n\t}",
"static public function &getForm()\n {\n static $renderer = null;\n\n if (is_null($renderer)) {\n require_once 'HTML/QuickForm/Renderer/Tip.php';\n $renderer = new HTML_QuickForm_Renderer_Tip();\n }\n\n return $renderer;\n }",
"protected function createRenderer() {\n\t\t$this->renderer = t3lib_div::makeInstance($this->rendererClass);\n\t}",
"protected function form()\n\t{\n\t\t$options = array('language' => preg_replace('/_.*/', '', get_locale()));\n\t\tif (class_exists('edwardForm'))\n\t\t\treturn new edwardForm($options);\n\t\trequire_once('edwardForm.php');\n\t\treturn new edwardForm($options);\n\t}",
"protected function createForm() {\n /*\n * Create and store the values of plugin manager form.\n */\n $form = $this->Form();\n\n //checkbox which determines whether the Einkaufspreis (merchant price) includes Tax\n $form->setElement('checkbox', 'includesTax', array(\n 'label' => 'Einkaufspreis inkl. Mwst.',\n 'value' => false,\n 'scope' => \\Shopware\\Models\\Config\\Element::SCOPE_SHOP\n ));\n\n $form->setElement('text', 'shippingCosts', array(\n 'label' => 'Versandkosten (fix oder prozentual)',\n 'value' => '',\n 'scope' => \\Shopware\\Models\\Config\\Element::SCOPE_SHOP\n ));\n\n $form->setElement('text', 'runningCosts', array(\n 'label' => 'Laufende Kosten (fix oder prozentual)',\n 'value' => '',\n 'scope' => \\Shopware\\Models\\Config\\Element::SCOPE_SHOP\n ));\n }",
"public function form()\r\n\t{\r\n\t\treturn new O_Form_Handler($this);\r\n\t}",
"public function generate_renderer(){\n $control_class = is_array($this->control) && isset($this->control['type']) && is_string($this->control['type']) ? $this->control['type'] : $this->default_type;\n if($control_class && class_exists($control_class) && method_exists($control_class, 'render_content')){\n $this->control['type'] = $control_class;\n $this->control['id'] = $this->get_id();\n $this->renderer = new $control_class( $this->get_value(), $this->control);\n }\n else\n $this->renderer = null;\n }",
"function &buildForm();",
"protected function getTwig_Form_RendererService()\n {\n return $this->services['twig.form.renderer'] = new \\Symfony\\Bridge\\Twig\\Form\\TwigRenderer(new \\Symfony\\Bridge\\Twig\\Form\\TwigRendererEngine(array(0 => 'form_div_layout.html.twig', 1 => 'LiipImagineBundle:Form:form_div_layout.html.twig'), ${($_ = isset($this->services['twig']) ? $this->services['twig'] : $this->get('twig')) && false ?: '_'}), ${($_ = isset($this->services['security.csrf.token_manager']) ? $this->services['security.csrf.token_manager'] : $this->get('security.csrf.token_manager', ContainerInterface::NULL_ON_INVALID_REFERENCE)) && false ?: '_'});\n }",
"public function __construct(FormDefinition $form, FormRendererInterface $renderer = NULL)\n {\n if ($renderer == NULL)\n {\n $renderer = new FormRenderer;\n }\n \n $this->form = $form;\n $this->renderer = $renderer;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets has accepted answer. | public function hasAcceptedAnswer(); | [
"public function hasAnswer();",
"public function getAnswerOk()\n {\n return $this->answerOk;\n }",
"public function getCorrectAnswer();",
"public function getAccepted():?bool{\n return $this->accepted;\n }",
"public function getAccepted()\n\t{\n\t\treturn $this->accepted;\n\t}",
"public function isCorrectAnswer() {\n\t\treturn $this->getCorrectAnswer();\n\t}",
"public function getAnswer();",
"public function getAnswer()\n {\n return $this->answer;\n }",
"public function isCorrect() {\n\t\treturn $this->getCorrectAnswer();\n\t}",
"public function getHasAnswerQuestion()\n {\n return $this->hasAnswerQuestion;\n }",
"public function isAccepted()\n {\n if($this->specimen_status_id == Specimen::ACCEPTED)\n {\n return true;\n }\n else {\n return false;\n }\n }",
"public function getAskResult()\n {\n return $this->askResult;\n }",
"public function getOptionanswerrequired()\n {\n return $this->optionanswerrequired;\n }",
"public function getValidatedAnswer()\n {\n return $this->validatedAnswer;\n }",
"public function isAnswer()\n {\n return $this->dialStatus == 'ANSWER';\n }",
"public function isAccepted()\n {\n return $this->status === 'accepted';\n }",
"public function get_best_answer_id()\n {\n return PostMetaBox::get_setting_for_topic(PostMetaBox::SOLVED_BY_REPLY_SETTING_KEY) ?: false;\n }",
"function isAnswerApproved ($pk_answer) {\n\t$con = __openDB();\n\n\t$i_status = __getAnswerStatus($con, $pk_answer);\n\t\n\t__closeDB($con);\n\t\n\tif ($i_status == 1) { return TRUE; }\n\treturn FALSE;\n}",
"public function isAnswered()\n {\n return $this->getHeaders()->get('answered');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Alphabet Search Bar configuration | public function alphabetSearchConfig($action)
{
$supported_views = array('index', 'find');
if(in_array($action, $supported_views)) {
return array(
'search.familyNameStart' => array(
'label' => _txt('me.alpha.label'),
),
);
}
} | [
"public function getAlphabetSearchField(){\n\t\treturn 'notes_title';\n\t}",
"public function autoComplete($input);",
"public function setSearch()\n\t{\n\t\t$this->search_term = DB::table('settings')->where('key', 'twitter_search')->pluck('value');\n\t}",
"function electro_header_search_box() {\n\n\t}",
"public function printSearchBox() {}",
"public function getAlphabetSearchField(){\n\t\t$focus = CRMEntity::getInstance($this->get('name'));\n\t\treturn $focus->def_basicsearch_col;\n\t}",
"private function sortBySearch() : void\n {\n if ($this->searchText !== '') {\n $label = $this->label;\n $searchText = $this->searchText;\n $this->sortedOptions = $this->options;\n \n usort($this->sortedOptions, function($a, $b) use ($searchText, $label) {\n return similar_text($searchText, $b[$label]) <=> similar_text($searchText, $a[$label]);\n });\n } else {\n $this->sortedOptions = $this->options;\n }\n }",
"function suggest()\n\t{\t\t\n\t\t$suggestions = $this->Asset->get_search_suggestions($this->input->post('q'), $this->input->post('limit'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->input->post('search_custom'), !empty($this->input->post('is_deleted')));\n\n\t\techo implode(\"\\n\",$suggestions);\n\t}",
"public function search()\r\n {\r\n $this->setTpl('search.htm');\r\n $this->setControllerTitle('Apollo');\r\n $this->setCurrentControllerName('Rechecher une condition');\r\n }",
"function suggest()\n\t{\n\t\t$suggestions = $this->Customer->get_search_suggestions($this->input->post('q'),$this->input->post('limit'));\n\t\techo implode(\"\\n\",$suggestions);\n\t}",
"public function autocomplete_search() {\n\tif (!empty($this->request->query['term'])) {\n\t $model = Inflector::camelize(Inflector::singularize($this->request->params['controller']));\n\t $my_models = $this->$model->find('all', array(\n\t\t 'conditions' => array($model . '.name LIKE' => $this->request->query['term'] . '%'),\n\t\t 'limit' => 10,\n\t\t 'contain' => false,\n\t\t\t ));\n\t $json_array = array();\n\t foreach ($my_models as $my_model) {\n\t\t$json_array[] = $my_model[$model];\n\t }\n\t $json_str = json_encode($json_array);\n\t $this->autoRender = false;\n\t return $json_str;\n\t}\n }",
"protected function searchMenu()\n {\n $searchFields = array();\n $session = \\Session::getInstance()->getData();\n $sessionKey = \\Input::get('id') ? $this->strTable . '_' . CURRENT_ID : $this->strTable;\n\n // Get search fields\n foreach ($GLOBALS['TL_DCA'][$this->strTable]['fields'] as $k=>$v)\n {\n if ($v['search'])\n {\n $searchFields[] = $k;\n }\n }\n\n // Return if there are no search fields\n if (empty($searchFields))\n {\n return '';\n }\n\n // Store search value in the current session\n if (\\Input::post('FORM_SUBMIT') == 'tl_filters')\n {\n $session['search'][$sessionKey]['value'] = '';\n $session['search'][$sessionKey]['field'] = \\Input::post('tl_field', true);\n\n // Make sure the regular expression is valid\n if (\\Input::postRaw('tl_value') != '')\n {\n try\n {\n $this->Database->prepare(\"SELECT * FROM \" . $this->strTable . \" WHERE \" . \\Input::post('tl_field', true) . \" REGEXP ?\")\n ->limit(1)\n ->execute(\\Input::postRaw('tl_value'));\n\n $session['search'][$sessionKey]['value'] = \\Input::postRaw('tl_value');\n }\n catch (\\Exception $e) {}\n }\n\n \\Session::getInstance()->setData($session);\n }\n\n // Set the search value from the session\n elseif ($session['search'][$sessionKey]['value'] != '')\n {\n if (substr(\\Config::get('dbCollation'), -3) == '_ci')\n {\n $this->procedure[] = \"LOWER(CAST(\".$session['search'][$sessionKey]['field'].\" AS CHAR)) REGEXP LOWER(?)\";\n }\n else\n {\n $this->procedure[] = \"CAST(\".$session['search'][$sessionKey]['field'].\" AS CHAR) REGEXP ?\";\n }\n\n $this->values[] = $session['search'][$sessionKey]['value'];\n }\n\n $options_sorter = array();\n\n foreach ($searchFields as $field)\n {\n $option_label = $GLOBALS['TL_DCA'][$this->strTable]['fields'][$field]['label'][0] ?: $GLOBALS['TL_LANG']['MSC'][$field];\n $options_sorter[utf8_romanize($option_label).'_'.$field] = ' <option value=\"'.specialchars($field).'\"'.(($field == $session['search'][$sessionKey]['field']) ? ' selected=\"selected\"' : '').'>'.$option_label.'</option>';\n }\n\n // Sort by option values\n $options_sorter = natcaseksort($options_sorter);\n $active = ($session['search'][$sessionKey]['value'] != '') ? true : false;\n\n return '\n\n<div class=\"tl_search tl_subpanel\">\n<strong>' . $GLOBALS['TL_LANG']['MSC']['search'] . ':</strong>\n<select name=\"tl_field\" class=\"tl_select' . ($active ? ' active' : '') . '\">\n'.implode(\"\\n\", $options_sorter).'\n</select>\n<span> = </span>\n<input type=\"search\" name=\"tl_value\" class=\"tl_text' . ($active ? ' active' : '') . '\" value=\"'.specialchars($session['search'][$sessionKey]['value']).'\">\n</div>';\n }",
"public function actionSuggestName()\n\t{\n\t\tif(isset($_GET['q']) && ($keyword=trim($_GET['q']))!=='')\n\t\t{\n\t\t\t$titles=Order::model()->suggestName($keyword);\n\t\t\tif($titles!==array())\n\t\t\t\techo implode(\"\\n\",$titles);\n\t\t}\n\t}",
"private function doAlphabetList() {\n\t\t\n\t\t$active = ($this->getParam('view') == 'active');\n\t\t$alpabet = PornstarServices::getPornstarsAlphabet($active);\n\t\tif ($active) {\n\t\t\tasort($alpabet);\n\t\t}\n\t\t\n\t\t$this->assign('alphabet', $alpabet);\n\t\t\n\t}",
"public function getSearchText();",
"function drawSearchBar() {\n global $ast_tips,$as_cssclass,$self,$ast_hidesearchbar;\n $txtclass = empty($as_cssclass['textfield'])?'':\"class='{$as_cssclass['textfield']}'\";\n $btnclass = empty($as_cssclass['button'])?'':\"class='{$as_cssclass['button']}'\";\n if(empty($this->search)) return;\n $showreset=0;\n $tid = 'flt_'.$this->tbrowseid; # id in $_SESSION\n\n $searchcoll = explode(',',$this->search);\n if(count($searchcoll)<1) return;\n $sbody = \"<!-- astedit search bar -->\\n<div style=\\\"text-align:center;width:auto;\\\">\n <table class='astedit-search' style='margin-left:auto;margin-right:auto;'>\\n\"; # astedit-search\n $envelope = array('',''); #search bar envelope\n $icol = 0;\n $rowstarted = false;\n\n foreach($searchcoll as $isc=>$item) { #<2>\n $tsplit = explode('/', $item); # case \"...,fieldname/range,...\" - ranged search !\n $fname = $tsplit[0];\n $sr_type = empty($tsplit[1])? '' : strtolower($tsplit[1]);\n $searchcode = '';\n $icol++;\n $fltfunc = '';\n if(substr($fname,0,1)=='@') { # @filter_function\n $fltfunc = substr($fname,1);\n if(is_callable($fltfunc)) {\n $searchcode = \"<input type='hidden' name='search_function' value='$fltfunc' />\".call_user_func($fltfunc,'form');\n }\n }\n else { #<4> draw standard search form for a field\n $ffunc = '';\n $fsplit = explode(':',$fname);\n if(count($fsplit)>1) {\n $fname = $fsplit[0];\n $ffunc = is_callable($fsplit[1])?$fsplit[1]:'';\n }\n $values = array();\n if(isset($_SESSION[$tid])) $values = $_SESSION[$tid];\n # TODO : field=2 is not good for SELECTED\n if (!isset($this->fields[$fname])) continue; # wrong field name\n $fld = $this->fields[$fname];\n if($sr_type === 'range') {\n $search1 = $this->drawInput($fname,'from','',$values);\n $search2 = $this->drawInput($fname,'to','',$values);\n $lb_from = is_callable('appEnv::getLocalized') ? appEnv::getLocalized('label_range_from','') : ' ';\n $lb_to = is_callable('appEnv::getLocalized') ? appEnv::getLocalized('label_range_to','...') : '...';\n $searchHtml = $fld->shortdesc . ': '. $lb_from . ' '.$search1 . ' ' . $lb_to .' '. $search2;\n }\n else {\n $searchHtml = $this->drawInput($fname,true);\n }\n # $searchcode .= \"<td nowrap style='vertical-align:top; text-align:right; width:90%'>\".$searchHtml . '</td>';\n $searchcode .= $searchHtml;\n } #<4> <std code>\n\n if(!$rowstarted) {\n $rowstarted = true;\n $sbody .= \"<tr>\"; # class='{$as_cssclass['troweven']}'>\";\n }\n $formcode = \"<form name='search{$isc}' method='post'><input type='hidden' name='ast_act' value='setfilter'><input type='hidden' name='flt_name' value='{$fname}' />\";\n $sbody .= \"<td style='text-align:right;margin-left:auto;margin-right:auto;white-space: nowrap;'>$formcode\"\n . \" <table style='width:100%'><tr><td style='vertical-align:top; text-align:right; white-space: nowrap; width:90% !important'>$searchcode</td>\"\n . \" <td><input type='submit' {$btnclass} name='ast_submit_flt' value='{$ast_tips['setfilter']}'></td>\";\n\n if(true) { # ($showreset) add 'RESET' mini-form (one button !)\n if($fltfunc) {\n $fld_id = \"@$fltfunc\";\n $disabl = call_user_func($fltfunc,'isfilterset') ? '' : 'disabled=\"disabled\"';\n }\n elseif(is_object($fld)) {\n $fld_id = $fld->id;\n $disabl = isset($_SESSION[$tid][$fld->id]) ? '':'disabled=\"disabled\"';\n }\n/* $sbody .=\"<form action='{$this->baseuri}' method='post'>\n <input type=hidden name=ast_act value='resetfilter'><input type=hidden name='flt_name' value='$fld_id'>\";\n*/\n# $sbody .=\"<input type='hidden' name='flt_name' value='$fld_id'>\";\n $sbody .=\"<td><input type='submit' name='clearfilter' $btnclass value=\\\"{$ast_tips['tipresetfilter']}\\\" $disabl /></td>\";\n }\n else $sbody .='<td> </td>'; # fill table row for looking good\n $sbody .=\"</tr></table></form></td>\\n\";\n\n if($rowstarted && ($icol >= $this->searchcols))\n {\n $rowstarted = false;\n $sbody .= \"</tr>\\n\";\n $icol = 0;\n }\n\n } #<2>\n if($rowstarted) $sbody .= '</tr>'; # vaild table row ending !\n if(!empty($ast_hidesearchbar)) {\n $envelope[0]=\"<table border=0 cellspacing=0 cellpadding=0><td id='' valign='top'><a href='javascript:#' onclick='alert(\\\"Show/Hide\\\")'>[+]</a></td>\n <td id='astedit_searchbar' _width='100%'>\";\n $envelope[1]=\"</td></tr></table>\";\n }\n $sbody = $envelope[0].$sbody.\"</table><div>\\n<!-- search bar end -->\\n\".$envelope[1];\n if($this->_togglefilters) {\n $state = !empty($_COOKIE['ast_hidesearch']);\n $srdisp = ($state)? 'style=\"display:none\"':'';\n $tgltitle= isset($ast_tips['title_showsearchbar']) ? $ast_tips['title_showsearchbar']:'Show/hide search';\n if (defined('USE_JQUERY_UI')) {\n $curClass = ($state) ? 'ui-icon-triangle-1-s': 'ui-icon-triangle-1-n';\n $htmlToggle = \"<span id='img_srchhide' class='ui-state-default ui-icon $curClass pnt' onclick=\\\"ToggleSearchBar()\\\" title='$tgltitle'></span>\";\n }\n else {\n $btimg = ($state)? 'plus.gif':'minus.gif';\n $htmlToggle = \"<a href=\\\"#\\\" onclick=\\\"return ToggleSearchBar()\\\"><img id=\\\"img_srchhide\\\" src=\\\"\".IMGPATH.$btimg.\"\\\" border=0 width=12 height=12 title=\\\"$tgltitle\\\"/></a>\";\n }\n $sbody = \"<table border=0 cellspacing=0 cellpadding=0><tr class='odd'><td>$htmlToggle</td><td style='width:100%'> </td></tr>\n <tr id=\\\"tr_astsearchbar\\\" $srdisp ><td colspan=2>$sbody</td></tr></table>\";\n }\n echo $sbody;\n\n }",
"function honeycomb_handheld_footer_bar_search() {\n\t\t//echo '<a href=\"\">' . esc_attr__( 'Search', 'honeycomb' ) . '</a>';\n\t\t//honeycomb_property_search();\n\t}",
"public function searchable() {\n\n $search = \"'iris*'\";\n $search = \"'azie*' 'agric*' 'biologica*'\";\n \n $suppliersTable = TableRegistry::get('Suppliers');\n $results = $suppliersTable->find() \n ->select(['name', 'id', \n 'relevance' => \"MATCH(Suppliers.name) AGAINST(\".$search.\" IN BOOLEAN MODE)\"])\n ->where([\n \"MATCH(Suppliers.name) AGAINST(:search IN BOOLEAN MODE)\" \n ])\n ->order(['relevance' => 'desc'])\n ->bind(':search', $search, 'string');\n\n debug('Found '.$results->count()); \n debug($search); \n foreach($results as $result) {\n debug($result->relevance.' '.$result->name);\n }\n\n $this->set(compact('results'));\n $this->render('index'); \n }",
"function suggest()\r\n\t{\r\n\t\t$suggestions = $this->Item->get_search_suggestions($this->input->post('q'),$this->input->post('limit'));\r\n\t\techo implode(\"\\n\",$suggestions);\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get the points between hr1 and hr2 | function getEffectivePoints( $x1, $y1, $x2, $y2 ){
global $hr1;
global $hr2;
$points = array();
if( $y1 > $hr2 && $y2 < $hr2 ){
if($y2 >= $hr1){
if( $x1 == $x2 ){
array_push( $points, $x1, $hr2 );
}
else{
$k = ($y2-$y1) / ($x2-$x1);
$c = $y1 - $x1*$k;
array_push( $points, ($hr2-$c)/$k, $hr2 );
}
}
else{
if( $x1 == $x2 ){
array_push( $points, $x1, $hr2, $x1, $hr1 );
}
else{
$k = ($y2-$y1) / ($x2-$x1);
$c = $y1 - $x1*$k;
array_push( $points, ($hr2-$c)/$k, $hr2, ($hr1-$c)/$k, $hr1 );
}
}
}
else if( $y1 == $hr2 && $y2 < $hr1 ){
array_push( $points, $x1, $y1 );
if( $x1 == $x2 ){
array_push( $points, $x1, $hr1 );
}
else{
$k = ($y2-$y1) / ($x2-$x1);
$c = $y1 - $x1*$k;
array_push( $points, ($hr1-$c)/$k, $hr1 );
}
}
else if( $y1 > $hr1 && $y1 < $hr2 && ( $y2 > $hr2 || $y2 < $hr1 ) ){
array_push( $points, $x1, $y1 );
if( $y2 > $hr2 ){
if( $x1 == $x2 ){
array_push( $points, $x1, $hr2 );
}
else{
$k = ($y2-$y1) / ($x2-$x1);
$c = $y1 - $x1*$k;
array_push( $points, ($hr2-$c)/$k, $hr2 );
}
}
else{
if( $x1 == $x2 ){
array_push( $points, $x1, $hr2 );
}
else{
$k = ($y2-$y1) / ($x2-$x1);
$c = $y1 - $x1*$k;
array_push( $points, ($hr1-$c)/$k, $hr1 );
}
}
}
else if( $y1 == $hr1 && $y2 > $hr2 ){
array_push( $points, $x1, $y1 );
if( $x1 == $x2 ){
array_push( $points, $x1, $hr2 );
}
else{
$k = ($y2-$y1) / ($x2-$x1);
$c = $y1 - $x1*$k;
array_push( $points, ($hr2-$c)/$k, $hr2 );
}
}
else if( $y1 < $hr1 && $y2 > $hr1 ){
if($y2 <= $hr2){
if( $x1 == $x2 ){
array_push( $points, $x1, $hr1 );
}
else{
$k = ($y2-$y1) / ($x2-$x1);
$c = $y1 - $x1*$k;
array_push( $points, ($hr1-$c)/$k, $hr1 );
}
}
else{
if( $x1 == $x2 ){
array_push( $points, $x1, $hr1, $x1, $hr2 );
}
else{
$k = ($y2-$y1) / ($x2-$x1);
$c = $y1 - $x1*$k;
array_push( $points, ($hr1-$c)/$k, $hr1, ($hr2-$c)/$k, $hr2 );
}
}
}
return $points;
} | [
"public static function lineMidPointUp($x1=100, $y1=100, $x2=200, $y2=50) {\r\n$xm=$x1+abs($x2-$x1)/2; $ym=$y1-abs($y2-$y1)/2;\r\nreturn array($xm,$ym);\r\n}",
"private function _findIntersection( $p1_start, $p1_end, $p2_start, $p2_end )\n {\n $result = null;\n\n if ( $p1_start <= $p2_start && $p1_end > $p2_start && $p1_end <= $p2_end ) {\n $result = array( 'start' => $p2_start, 'end' => $p1_end );\n } elseif ( $p1_start <= $p2_start && $p1_end >= $p2_end ) {\n $result = array( 'start' => $p2_start, 'end' => $p2_end );\n } elseif ( $p1_start >= $p2_start && $p1_start < $p2_end && $p1_end >= $p2_end ) {\n $result = array( 'start' => $p1_start, 'end' => $p2_end );\n } elseif ( $p1_start >= $p2_start && $p1_end <= $p2_end ) {\n $result = array( 'start' => $p1_start, 'end' => $p1_end );\n }\n\n return $result;\n }",
"function getCommonHourSlots($marker1, $marker2 ){\r\n\r\n $slot_duration =30*60; // minimum split duration in secs\r\n\r\n // half hour time slots of marker1\r\n $array_of_time1 = splitIntoHalfSlots($marker1);\r\n $count1=count($array_of_time1);// count number of slots, -1 coz array starts from 0\r\n\r\n // half hour time slots of marker2\r\n $array_of_time2 = splitIntoHalfSlots($marker2);\r\n $count2=count($array_of_time2);// count number of slots, -1 coz array starts from 0\r\n\r\n $common_slots =array();\r\n\r\n// calculate half an hour common slots\r\n foreach($array_of_time1 as $marker1_slot){\r\n\r\n foreach($array_of_time2 as $marker2_slot){\r\n\r\n if ($marker1_slot === $marker2_slot)\r\n $common_slots[] = $marker1_slot;\r\n\r\n }\r\n\r\n }\r\n\r\n $common_hour_slots_count = 0;\r\n $common_hour_start_time=array();\r\n\r\n//index variable for common slots array\r\n $index= 0;\r\n\r\n while($index < count($common_slots)-1 ){\r\n\r\n $current_slot = strtotime($common_slots[$index]);\r\n $next_slot = strtotime($common_slots[$index+1]);\r\n\r\n if($current_slot+$slot_duration == $next_slot) {\r\n $common_hour_slots_count += 1;\r\n $common_hour_start_time[] = date(\"Y-m-d H:i\",$current_slot);\r\n $index +=2;\r\n }\r\n\r\n // if common not found then increment\r\n else\r\n $index++;\r\n\r\n }\r\n\r\n return $common_hour_start_time;\r\n\r\n}",
"private function _findIntersections( $p1_start, $p1_end, $p2_start, $p2_end )\n {\n $result = array();\n\n if ( $p2_start > $p2_end ) {\n $result[] = $this->_findIntersections($p1_start, $p1_end, 0, $p2_end);\n $result[] = $this->_findIntersections($p1_start, $p1_end, $p2_start, 86400);\n }\n else {\n if ( $p1_start <= $p2_start && $p1_end > $p2_start && $p1_end <= $p2_end ) {\n $result[] = array( 'start' => $p2_start, 'end' => $p1_end );\n } else if ( $p1_start <= $p2_start && $p1_end >= $p2_end ) {\n $result[] = array( 'start' => $p2_start, 'end' => $p2_end );\n } else if ( $p1_start >= $p2_start && $p1_start < $p2_end && $p1_end >= $p2_end ) {\n $result[] = array( 'start' => $p1_start, 'end' => $p2_end );\n } else if ( $p1_start >= $p2_start && $p1_end <= $p2_end ) {\n $result[] = array( 'start' => $p1_start, 'end' => $p1_end );\n }\n }\n\n return $result;\n }",
"public static function addPoints(Array $pt1, Array $pt2, $a, $p){\r\n if(gmp_cmp($pt1['x'], $pt2['x']) == 0 && gmp_cmp($pt1['y'], $pt2['y']) == 0) //if identical\r\n {\r\n return self::doublePoint($pt1, $a, $p);\r\n }\r\n\r\n $gcd = gmp_strval(gmp_gcd(gmp_sub($pt1['x'], $pt2['x']), $p));\r\n if($gcd != '1')\r\n {\r\n throw new \\Exception('This library doesn\\'t yet supports point at infinity. See https://github.com/BitcoinPHP/BitcoinECDSA.php/issues/9');\r\n }\r\n\r\n // SLOPE = (pt1Y - pt2Y)/( pt1X - pt2X )\r\n // Equals (pt1Y - pt2Y) * ( pt1X - pt2X )^-1\r\n $slope = gmp_mod(\r\n gmp_mul(\r\n gmp_sub(\r\n $pt1['y'],\r\n $pt2['y']\r\n ),\r\n gmp_invert(\r\n gmp_sub(\r\n $pt1['x'],\r\n $pt2['x']\r\n ),\r\n $p\r\n )\r\n ),\r\n $p\r\n );\r\n\r\n // nPtX = slope^2 - ptX1 - ptX2\r\n $nPt = array();\r\n $nPt['x'] = gmp_mod(\r\n gmp_sub(\r\n gmp_sub(\r\n gmp_pow($slope, 2),\r\n $pt1['x']\r\n ),\r\n $pt2['x']\r\n ),\r\n $p\r\n );\r\n\r\n // nPtX = slope * (ptX1 - nPtX) - ptY1\r\n $nPt['y'] = gmp_mod(\r\n gmp_sub(\r\n gmp_mul(\r\n $slope,\r\n gmp_sub(\r\n $pt1['x'],\r\n $nPt['x']\r\n )\r\n ),\r\n $pt1['y']\r\n ),\r\n $p\r\n );\r\n\r\n return $nPt;\r\n }",
"public function intervalHSGrouped($start,$finish,$points)\n {\n\t\t$start = date(\"Y-m-d H:i:s\",$start);\n\t\t$finish = date(\"Y-m-d H:i:s\",$finish);\n\n\t\t$interval =round((strtotime($finish)-strtotime($start))/($points-1));\n\n\t\t$result = $this->CALMori->getAdapter()->query(\"select start_date_time as time, \n\tavg(uncorrected)+std(uncorrected) as uncorrected_open, max(uncorrected) as uncorrected_max, min(uncorrected) as uncorrected_min, avg(uncorrected)-std(uncorrected) as uncorrected_close, \n\tavg(corr_for_pressure)+std(corr_for_pressure) as corr_for_pressure_open, max(corr_for_pressure) as corr_for_pressure_max, min(corr_for_pressure) as corr_for_pressure_min, avg(corr_for_pressure)-std(corr_for_pressure) as corr_for_pressure_close,\n\t\n\tavg(corr_for_efficiency)+std(corr_for_efficiency) as corr_for_efficiency_open, max(corr_for_efficiency) as corr_for_efficiency_max, min(corr_for_efficiency) as corr_for_efficiency_min, avg(corr_for_efficiency)-std(corr_for_efficiency) as corr_for_efficiency_close,\n\n\tavg(pressure_mbar) as pressure_mbar_avg\n\n\tfrom(select t2.*,ROUND(UNIX_TIMESTAMP(t2.start_date_time)/(\".$interval.\")) as timekey from(SELECT o.start_date_time,\n\tCASE WHEN r.start_date_time IS NULL THEN o.measured_uncorrected ELSE r.revised_uncorrected END AS uncorrected, \n\tCASE WHEN r.start_date_time IS NULL THEN o.measured_corr_for_pressure ELSE r.revised_corr_for_pressure END AS corr_for_pressure,\n\tCASE WHEN r.start_date_time IS NULL THEN o.measured_corr_for_efficiency ELSE r.revised_corr_for_efficiency END AS corr_for_efficiency,\n\tCASE WHEN r.start_date_time IS NULL THEN o.measured_pressure_mbar ELSE r.revised_pressure_mbar END AS pressure_mbar\n\nFROM CALM_ori o LEFT JOIN CALM_rev r ON o.start_date_time = r.start_date_time WHERE o.start_date_time >= '\".$start.\"' AND o.start_date_time < '\".$finish.\"' ORDER BY start_date_time ASC) as t2) as t3 group by timekey;\")->execute();\n\n\t\t$resultSet = new ResultSet;\n \t$resultSet->initialize($result);\n\n\t\t$rows = array();\n\t\tforeach ($resultSet as $CALM_oriModel){\n\t\t\t\t$rows[0][]=array(\n\t\t\t\t\tstrtotime($CALM_oriModel->time)*1000,\n\t\t\t\t\t$this->handleFloat($CALM_oriModel->uncorrected_open),\n\t\t\t\t\t$this->handleFloat($CALM_oriModel->uncorrected_max),\n\t\t\t\t\t$this->handleFloat($CALM_oriModel->uncorrected_min),\n\t\t\t\t\t$this->handleFloat($CALM_oriModel->uncorrected_close),\n\t\t\t\t);\n\t\t\t\t$rows[1][]=array(\n\t\t\t\t\tstrtotime($CALM_oriModel->time)*1000,\n\t\t\t\t\t$this->handleFloat($CALM_oriModel->corr_for_pressure_open),\n\t\t\t\t\t$this->handleFloat($CALM_oriModel->corr_for_pressure_max),\n\t\t\t\t\t$this->handleFloat($CALM_oriModel->corr_for_pressure_min),\n\t\t\t\t\t$this->handleFloat($CALM_oriModel->corr_for_pressure_close),\n\t\t\t\t);\n\t\t\t\t$rows[2][]=array(\n\t\t\t\t\tstrtotime($CALM_oriModel->time)*1000,\n\t\t\t\t\t$this->handleFloat($CALM_oriModel->corr_for_efficiency_open),\n\t\t\t\t\t$this->handleFloat($CALM_oriModel->corr_for_efficiency_max),\n\t\t\t\t\t$this->handleFloat($CALM_oriModel->corr_for_efficiency_min),\n\t\t\t\t\t$this->handleFloat($CALM_oriModel->corr_for_efficiency_close),\n\t\t\t\t);\n\t\t\t\t$rows[3][]=array(\n\t\t\t\t\tstrtotime($CALM_oriModel->time)*1000,\n\t\t\t\t\t$this->handleFloat($CALM_oriModel->pressure_mbar_avg),\n\t\t\t\t);\n\t\t\t}\n\n\t\treturn Json::encode($rows);\n\n }",
"function aerofoil_extendLineToX($known_point_x, &$pointA, &$pointB) {\n\t$t = (($known_point_x - $pointA[\"x\"])/($pointB[\"x\"]-$pointA[\"x\"]));\n \n $point = array(\n \"x\" => $pointA[\"x\"]+$t*($pointB[\"x\"]-$pointA[\"x\"]),\n \"y\" => $pointA[\"y\"]+$t*($pointB[\"y\"]-$pointA[\"y\"]),\n \"z\" => $pointA[\"z\"]+$t*($pointB[\"z\"]-$pointA[\"z\"]),\n\t);\n return($point);\n\n}",
"function lineEquation($p1, $p2) {\n // b = y - mx\n // mx - y + b = 0\n // ax + by + c = 0\n list($x1, $y1) = array($p1['x'], $p1['y']);\n list($x2, $y2) = array($p2['x'], $p2['y']);\n if ($x1 === $x2) {\n return array(\n \"a\" => 1.0,\n \"b\" => 0.0,\n \"c\" => -$x1\n );\n }\n $slope = ($y2 - $y1) / ($x2 - $x1);\n $b = $y1 - $slope * $x1;\n return array(\n \"a\" => $slope,\n \"b\" => -1.0,\n \"c\" => $b\n );\n}",
"function calcul_distance_points($point1,$point2)\r\n{\r\n return calcul_distance_gps($point1->latitude,$point1->longitude,$point2->latitude,$point2->longitude);\r\n}",
"function hour1_before_hour2($hour1, $hour2){\n\n\tif ($hour1['hours'] < $hour2['hours']){\n\t\treturn -1;\n\t}\n\t\n\tif ($hour1['hours'] == $hour2['hours']){\n\t\n\t\tif ($hour1['minutes'] < $hour2['minutes']){\n\t\t\treturn -1;\n\t\t} \n\t\tif ($hour1['minutes'] == $hour2['minutes']){\n\t\t\treturn 0;\n\t\t}\n\t}\n\t\n\treturn 1;\n}",
"public function getPoints();",
"public function getPoints(): array {\n return [$this->start, $this->end];\n }",
"public function getPoints()\n {\n return [$this->point1, $this->point2];\n }",
"function lineLineIntersection($x1=100, $y1=120, $x2=180, $y2=100, \r\n$x3=100, $y3=100, $x4=200, $y4=100) {\r\n$tnum=($x1-$x3)*($y3-$y4)-($y1-$y3)*($x3-$x4);\r\n$tden=($x1-$x2)*($y3-$y4)-($y1-$y2)*($x3-$x4);\r\n$t=$tnum/$tden;\r\n$x=$x1+$t*($x2-$x1); $y=$y1+$t*($y2-$y1);\r\nreturn array($x,$y);\r\n}",
"static function compareTwoPoint($km1, $m1, $km2, $m2)\n {\n $pos_point1 = $km1 * 10000 + $m1;\n $pos_point2 = $km2 * 10000 + $m2;\n if ($pos_point1 > $pos_point2)\n {\n return 1;\n }\n else if ($pos_point1 == $pos_point2)\n {\n return 0;\n }\n else\n {\n return -1;\n }\n }",
"public function getStartingAndEndingPoints()\n\t{\n\t\t// Get Tour Ending Point\n\t\tforeach ($this->destinations as $location) {\n if (!in_array($location, $this->sources)) {\n $this->tourEndingPoint = $location;\n }\n }\n // Get Tour Starting Point\t\n foreach ($this->sources as $location) {\n if (!in_array($location, $this->destinations)) {\n $this->tourStartingPoint = $location;\n }\n }\t\n\n $this->currentLocation = $this->tourStartingPoint;\n\t}",
"function sumarHoras($h1,$h2)\n\t{\n\t\t$dbExec = new DBX;\n\t\t$sqlText = \"select sec_to_time((time_to_sec('\".$h1.\"') + time_to_sec('\".$h2.\"'))) result from dual\";\n\t\t$result = $dbExec->selSql($sqlText);\n\t\treturn $result['0']['result'];\n\n\t}",
"public static function addPoints(Array $pt1, Array $pt2, $a, $p) {\r\n\r\n $nPt = array();\r\n\r\n $gcd = self::bcgcd(bcsub($pt1['x'], $pt2['x']), $p);\r\n if($gcd != '1'){\r\n throw new \\Exception('This library doesn\\'t yet supports point at infinity.');\r\n }\r\n\r\n if (bcmod(bccomp($pt1['x'], $pt2['x']), $p) == 0) {\r\n if (bcmod(bcadd($pt1['y'], $pt2['y']), $p) == 0) {\r\n throw new \\Exception('This library doesn\\'t yet supports point at infinity.');\r\n } else {\r\n return self::doublePoint($pt1, $a, $p);\r\n }\r\n }\r\n\r\n // (pt1Y - pt2Y) * ( pt1X - pt2X )^-1\r\n $slope = bcmod(bcmul(bcsub($pt2['y'], $pt1['y']), self::inverse_mod(bcsub($pt2['x'], $pt1['x']), $p)), $p);\r\n\r\n // slope^2 - ptX1 - ptX2\r\n $nPt['x'] = bcmod(bcsub(bcsub(bcpow($slope, 2), $pt1['x']), $pt2['x']), $p);\r\n\r\n // slope * (ptX1 - nPtX) - ptY1\r\n $nPt['y'] = bcmod(bcsub(bcmul($slope, bcsub($pt1['x'], $nPt['x'])), $pt1['y']), $p);\r\n\r\n if (bccomp(0, $nPt['y']) == 1) {\r\n $nPt['y'] = bcadd($p, $nPt['y']);\r\n }\r\n\r\n return $nPt;\r\n }",
"public function getPoints(): array\n {\n return [$this->point1, $this->point2];\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Function marks QSOs as uploaded to HRDLog. $primarykey is the unique id for that QSO in the logbook | function mark_hrdlog_qsos_sent($primarykey) {
$data = array(
'COL_HRDLOG_QSO_UPLOAD_DATE' => date("Y-m-d H:i:s", strtotime("now")),
'COL_HRDLOG_QSO_UPLOAD_STATUS' => 'Y',
);
$this->db->where('COL_PRIMARY_KEY', $primarykey);
$this->db->update($this->config->item('table_name'), $data);
return true;
} | [
"public function saveT3sRecordsToDb($rows) {\r\n\t\tif(count($rows)) {\r\n\t\t\tforeach($rows as $row) {\r\n\t\t\t\t// header\r\n\t\t\t\t$title = strip_tags($row['header']);\r\n\r\n\t\t\t\t// following lines prevents having words one after the other like: HelloAllTogether\r\n\t\t\t\t$bodytext = $row['bodytext'];\r\n\t\t\t\t$bodytext = str_replace('<td', ' <td', $bodytext);\r\n\t\t\t\t$bodytext = str_replace('<br', ' <br', $bodytext);\r\n\t\t\t\t$bodytext = str_replace('<p', ' <p', $bodytext);\r\n\t\t\t\t$bodytext = str_replace('<li', ' <li', $bodytext);\r\n\r\n\t\t\t\t// crdate is always given, but can be overwritten\r\n\t\t\t\tif(isset($row['crdate']) && $row['crdate'] > 0) {\r\n\t\t\t\t\t$additionalFields['sortdate'] = $row['crdate'];\r\n\t\t\t\t}\r\n\t\t\t\t// if TYPO3 sets last changed\r\n\t\t\t\tif(isset($row['tstamp']) && $row['tstamp'] > 0) {\r\n\t\t\t\t\t$additionalFields['sortdate'] = $row['tstamp'];\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// fill orig_uid\r\n\t\t\t\tif(isset($row['uid']) && $row['uid'] > 0) {\r\n\t\t\t\t\t$additionalFields['orig_uid'] = $row['uid'];\r\n\t\t\t\t}\r\n\t\t\t\t// fill orig_pid\r\n\t\t\t\tif(isset($row['pid']) && $row['pid'] > 0) {\r\n\t\t\t\t\t$additionalFields['orig_pid'] = $row['pid'];\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// save record to index\r\n\t\t\t\t$this->pObj->storeInIndex(\r\n\t\t\t\t\t$this->indexerConfig['storagepid'], // storage PID\r\n\t\t\t\t\t$title, // content title\r\n\t\t\t\t\t't3s_content', // content type\r\n\t\t\t\t\t$this->indexerConfig['targetpid'], // target PID: where is the single view?\r\n\t\t\t\t\t$row['bodytext'], // indexed content, includes the title (linebreak after title)\r\n\t\t\t\t\t'', // tags\r\n\t\t\t\t\t'', // typolink params for singleview\r\n\t\t\t\t\t'', // abstract\r\n\t\t\t\t\t$row['sys_language_uid'], // language uid\r\n\t\t\t\t\t$row['starttime'], // starttime\r\n\t\t\t\t\t$row['endtime'], // endtime\r\n\t\t\t\t\t0, // fe_group\r\n\t\t\t\t\tfalse, // debug only?\r\n\t\t\t\t\t$additionalFields // additional fields added by hooks\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\treturn;\r\n\t\t}\r\n\t}",
"private function saveJournalEntry($taxEntityId,$jounalArrProperties,ServiceQueI $serviceQue){\n //create an array to make journal entry\n $journalArr = $journalAdjArr = array();\n $journalArr['parent'] = $taxEntityId;\n $journalArr['objectType'] = 'journal';\n $journalArr['properties'] = $jounalArrProperties;\n //set all journal properties in an array \n $resp = $serviceQue->executeQue(\"ws_oml_create\", $journalArr); \n $journalId = $resp['data']['id'];\n return $journalId;\n }",
"function asa_add_audio_entry_to_upload_queue($xmlrpc_server, $user_info, $entry_info) {\n\n global $asa_db_options;\n\n\n // open connection to database server\n $db_link = mysql_connect($asa_db_options['server'], $asa_db_options['user'], $asa_db_options['password']);\n\n if (!$db_link) {\n eh_error('Could not connect to database server: ' . mysql_error());\n return FALSE;\n }\n\n // select database to be used\n\n $db = mysql_select_db( $asa_db_options['db_name'], $db_link);\n\n if (!$db_link) {\n eh_error('Can\\'t use ' . $asa_db_options['db_name'] . ' : ' . mysql_error());\n return FALSE;\n }\n\n // insert audio entry in the database\n\n $upload_status = ASA_TO_BE_UPLOADED;\n $tags = (isset($entry_info['tags']))?$entry_info['tags']:NULL;\n $extra_fields = (isset($entry_info['extra_fields']))?$entry_info['extra_fields']:array();\n $notes = 'empty note';\n\n $query = \"INSERT INTO asa_upload_queue\n ( title, body, file, xmlrpc_url, user_name, password, status, promote, downloadable, categories, og_public, og_groups, date_created, tags, extra_fields, upload_status, notes)\n VALUES( '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, %d, '%s', %d, '%s', '%s', '%s', '%s', '%s', '%s')\";\n $query = _asa_format_query($query,\n $entry_info['title'],\n $entry_info['body'], \n $entry_info['file'],\n $xmlrpc_server,\n $user_info['user_name'],\n $user_info['password'],\n $entry_info['status'],\n $entry_info['promote'],\n $entry_info['downloadable'],\n serialize($entry_info['categories']),\n (isset($entry_info['og_public'])?$entry_info['og_public']:TRUE),\n (isset($entry_info['og_groups'])?serialize($entry_info['og_groups']):serialize(array())),\n $entry_info['date_created'],\n serialize($tags),\n serialize($extra_fields),\n $upload_status, \n $notes);\n\n $db_result = mysql_query($query, $db_link);\n\n if (!$db_result) {\n eh_error( 'Could not add audio entry to database: ' . mysql_error());\n return FALSE;\n }\n\n return TRUE;\n\n}",
"protected function writeSysFileStorageRecords() {}",
"function mark_webadif_qsos_sent(array $qsoIDs)\n\t{\n\t\t$data = [];\n\t\t$now = date(\"Y-m-d H:i:s\", strtotime(\"now\"));\n\t\tforeach ($qsoIDs as $qsoID) {\n\t\t\t$data[] = [\n\t\t\t\t'upload_date' => $now,\n\t\t\t\t'qso_id' => $qsoID,\n\t\t\t];\n\t\t}\n\t\t$this->db->insert_batch('webadif', $data);\n\t\treturn true;\n\t}",
"public function toInsertSOLRdocument(&$client, $id='', $sid, $datasource, $resultNumber, $seg, $user, $dscachetimestamp) {\n \n //print \"<br>toInsertSOLRdocument ($datasource)<br>\";\n\n // create a new document for the data\n $result_doc = new Solarium_Document_ReadWrite();\n\n $result_doc->sid = $sid;\n $result_doc->seg = $seg;\n $result_doc->lod = $this->getLod()?1:0;\n $result_doc->rank \t\t= $this->getRank();\n if ($this->getExplanation())\n \t$result_doc->explanation= $this->getExplanation();\n\t\t\n\t\t\n\t\tif ($result_doc->rank == 0)\n\t\t{\n\t\t\t//print \"<br>NULL RANK... stimmtes? \";var_dump($this);\n\t\t}\n\t\t\n\t\t\n $result_doc->rank = $result_doc->rank; //FRI neu\n $result_doc->user = $user;\n $result_doc->id = $id // do we have already one id?\n \t\t\t\t\t\t\t\t\t\t\t\t? $id // yes: take old id\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//: $result_doc->sid.'-'.$resultNumber.'-'.uniqid(); //SOLR ID unique!!!\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: $result_doc->sid.'-'.$datasource.'-'.$resultNumber; //SOLR ID unique - but if it comes several times, only one doc should be stored\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n $result_doc->type = $this->getResultType();\n $result_doc->title = encode4solr($this->getTitle());\n $result_doc->authors = encode4solr($this->getAuthors());\n $result_doc->date = $this->getDate();\n $result_doc->urlPage = encode4solr($this->getUrlPage());\n $result_doc->wdatasource = $datasource; //rodin datasource id (the widget url)\n $result_doc->wdscachetimestamp = $dscachetimestamp; //rodin datasource generation time of the current record\n \n \n //print \"<hr>inserting result: \";var_dump($result_doc);\n \n //Add specific attr/value fields:\n\n $fulltext=$result_doc->title;\n\n foreach ($this->resultProperties as $propertyName=>$propertyValue) {\n\t\t\tif ($propertyValue != '') {\n\n $result_doc->$propertyName = $propertyValue;\n\n $fields[] = array($propertyName,'string',$propertyValue);\n $fulltext.=($fulltext<>'')?' ':'';\n\t\t\t}\n\t\t}\n #Put everything together in order to find per search the value: TBD \n $result_doc->body = encode4solr($fulltext);\n \n\t\treturn $result_doc;\n\t}",
"function qualify($fkQual) {\n $i = \"\nINSERT INTO ioc.PQualLPType\nSET fkPType = {$this->Id}\n, fkPQual = {$fkQual}\n, dateCreated = UNIX_TIMESTAMP()\";\n\n try {\n $this->conn->query($i);\n }\n catch (Exception $e) {\n echo 'Caught exception: ', $e->getMessage(),\n \"\\nThe type Id ({$this->Id}) could not be qualified to quality Id ({$fkQual}).\",\n \"\\nsql: {$i}\\n\";\n }\n }",
"function submit_stock_claims( $purchase_log_id ) {\n\t\t$claimed_query = new WPSC_Claimed_Stock( array( 'cart_id' => $this->unique_id ) );\n\t\t$claimed_query->submit_claimed_stock( $purchase_log_id );\n\t}",
"function log_fishbowl_item($mysqli, $item)\n{\n\t$q = \"INSERT INTO `fishbowl_log` SET \"\n\t\t. \"username = '$_SESSION[username]', \"\n\t\t. \"date = '$item[date]', \"\n\t\t. \"log_type = '$item[log_type]', \"\n\t\t. \"description = '$item[description]';\";\n\texec_query($mysqli, $q);\n}",
"function writeRowId(){\r\n\t\tdie('Not implemented');\r\n\t}",
"function upload_enrollment_doc_s3($enrollmentId) {\n global $wpdb;\n $client = S3Client::factory(array(\n 'key' => S3_ACCESS_KEY_ID,\n 'secret' => S3_SECRET_KEY\n ));\n\n $count = 0;\n\n\tif(isset($_REQUEST['type'])) {\n\n $source = $_FILES[\"webcam\"][\"tmp_name\"];\n if(!$source) {\n continue;\n }\n $name = $_FILES[\"webcam\"][\"tmp_name\"].'.jpg';\n\n /* Create a random 32 character key */\n $key = wp_generate_password(32, false);\n $result = $client->putObject(array(\n 'Bucket' => S3_BUCKET,\n 'Key' => $key,\n 'SourceFile' => $source,\n 'ServerSideEncryption' => 'AES256'\n ));\n\n $wpdb->insert(\n 'enrollment_doc',\n array(\n 'enrollment_id' => $enrollmentId,\n 'name' => $name,\n 'url' => $result['ObjectURL'],\n 'key' => $key\n ),\n array(\n '%d',\n '%s',\n '%s',\n '%s'\n )\n );\n $count++;\n\t\n\t} else {\n\t\t\n\t try {\n\t foreach ($_FILES[\"documents\"][\"error\"] as $key => $error) {\n\t $source = $_FILES[\"documents\"][\"tmp_name\"][$key];\n\t if(!$source) {\n\t continue;\n\t }\n\t $name = $_FILES[\"documents\"][\"name\"][$key];\n\t\n\t /* Create a random 32 character key */\n\t $key = wp_generate_password(32, false);\n\t $result = $client->putObject(array(\n\t 'Bucket' => S3_BUCKET,\n\t 'Key' => $key,\n\t 'SourceFile' => $source,\n\t 'ServerSideEncryption' => 'AES256'\n\t ));\n\t\n\t $wpdb->insert(\n\t 'enrollment_doc',\n\t array(\n\t 'enrollment_id' => $enrollmentId,\n\t 'name' => $name,\n\t 'url' => $result['ObjectURL'],\n\t 'key' => $key\n\t ),\n\t array(\n\t '%d',\n\t '%s',\n\t '%s',\n\t '%s'\n\t )\n\t );\n\t $count++;\n\t }\n\t } catch (Exception $e) {\n\t echo $e->getMessage();\n\t }\n\n\t}\n\t\n return $count;\n}",
"private function SaveAliquot(){\n $save_position = $this->settings['aliquot2save']['nextPosition'];\n $save_tray = $this->settings['aliquot2save']['nextBox'];\n $prev_sample = $this->settings['aliquot2save']['label'];\n $aliquotIndex = $this->settings['aliquot2save']['aliquotIndex'];\n $aliqNo = $aliquotIndex + 1;\n $tray_size = $this->settings['settings']['trays'][$aliquotIndex]['size'];\n $trayFormat = $this->settings['settings']['trays'][$aliquotIndex]['format2use'];\n $parentSample = $this->settings['parent']['label'];\n \n //we have something to save, so save it, bt first confirm that the aliquot is right and the tray is ok\n if(preg_match('/^' . $this->settings['settings']['aliquot_format2use'] . '$/i', $prev_sample) && preg_match('/^' . $trayFormat . '$/i', $save_tray) && is_numeric($save_position) \n && is_numeric($aliquotIndex)){\n \n //check if there are other aliquots from this sample\n $this->Dbase->query = \"select a.* from aliquots as a inner join aliq_samples as b on a.parent_sample=b.id where b.label='$parentSample' order by a.aliquot_number\";\n $aliq = $this->Dbase->ExecuteQuery(MYSQLI_ASSOC);\n if($aliq == 1) return \"There was an error while fetching data from the database.\";\n elseif(count($aliq) + 1 > $this->settings['settings']['noOfAliquots']){\n //if there are enough aliquots it means we dont need to add another aliquot\n return \"Error! A sample can only have {$this->settings['settings']['noOfAliquots']} aliquots.\";\n }\n //check if wee have an aliquot saved in the current position\n $this->Dbase->query = \"select * from aliquots where tray='$save_tray' and position=$save_position\";\n $new_pos = $this->Dbase->ExecuteQuery(MYSQLI_ASSOC);\n if($new_pos == 1) return $this->Dbase->lastError;\n elseif(count($new_pos) > 1) return \"<b>Serious Error! The position $save_tray:$save_position has more than 1 aliquot saved there!</b>\";\n elseif(count($new_pos) == 1) return \"<b>Error! The position $save_tray:$save_position already has an aliquot saved there!</b>\";\n \n if($save_position > 0 && $save_position <= $tray_size){\n $parentSampleId = $this->Dbase->GetSingleRowValue('aliq_samples', 'id', 'label', $parentSample);\n if($parentSampleId == -2){\n return \"There was an error while fetching data from the database.\";\n }\n else{\n $this->settings['currentAliquots'] = $aliq;\n $cols = array('label', 'parent_sample', 'aliquot_number', 'tray', 'position');\n $colvals = array(strtoupper($prev_sample), $parentSampleId, $aliqNo, $save_tray, $save_position);\n $results = $this->Dbase->InsertData(\"aliquots\", $cols, $colvals);\n if($results == 1) return \"There was an error while saving the aliquot <b>$prev_sample</b>.\";\n return 0;\n //echo \"save this $save_aliquot $save_position $save_tray\";\n }\n }\n else return \"Unable to save <b>$prev_sample($aliqNo)</b> in tray <b>$save_tray</b> at position <b>$save_position</b>.\";\n }\n else return 0;\n }",
"public function save(){\n \n \n $this->type = \"insert\";\n \n $pk = \"\"; //Primary key\n foreach($this->fields['name'] as $key => $value){ \n //Check to see if primary key value is set, if not then insert a new row else update\n \n if($this->fields['key'][$key] == \"PRI\" && !empty($value)){\n \n $this->type = \"update\"; //Change type \n $pk = $value; //Set primary key\n break;\n }\n \n }\n \n if($this->type == \"insert\"){\n $this->insert();\n \n }elseif($this->type == \"update\"){\n \n $this->update($pk);\n }\n \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 static function insertQueueLog(){\n \n }",
"private function storeToDB() {\n\t\tDBQuery::getInstance() -> insert('INSERT INTO `ItemSuppliers`' . DBUtils::buildMultipleInsert($this -> aStoreData) . 'ON DUPLICATE KEY UPDATE ItemSupplierRowID=VALUES(ItemSupplierRowID),IsRebateAllowed=VALUES(IsRebateAllowed),Priority=VALUES(Priority),Rebate=VALUES(Rebate),SupplierDeliveryTime=VALUES(SupplierDeliveryTime),SupplierItemNumber=VALUES(SupplierItemNumber),SupplierMinimumPurchase=VALUES(SupplierMinimumPurchase),VPE=VALUES(VPE)');\n\t}",
"public function save() {\n $fields = $this->getDbFields();\n\n db_merge('sm_form_submission')\n ->key([\n 'sid' => $this->getSid(),\n ])\n ->fields($fields)\n ->execute();\n }",
"public function doUpload( $id , $type , $key );",
"protected function _savePrimaryKey() {\n\t if (!empty($this->_primaryKey)) {\n\t foreach ($this->_primaryKey as $pkey) {\n\t $name = $pkey[\"name\"];\n\t $this->_oldPrimaryKey[$name] = $this->$name;\n\t }\n\t }\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the Renderer object | public function getRenderer(); | [
"public function getRenderer()\n {\n return $this->_renderer;\n }",
"public function getRenderer()\n {\n return $this->renderer;\n }",
"public function getRenderer()\n\t{\n\t\treturn isset($this->renderer) ? $this->renderer : NULL;\n\t}",
"public function getRender()\n\t{\n\t\treturn new Renderer;\n\t}",
"protected function getRenderer() {\n if (!isset($this->renderer)) {\n $this->renderer = \\Drupal::service('renderer');\n }\n return $this->renderer;\n }",
"public function renderer()\n {\n return $this->renderer;\n }",
"protected function getRenderer()\n {\n return $this->renderer === null ?\n new HtmlRenderer :\n $this->renderer;\n }",
"final public function renderer()\r\n\t{\r\n\t\t// return it\r\n\t\treturn $this->renderer;\r\n\t}",
"public static function get_instance() : Renderer\n {\n if (self::$instance == null) {\n self::$instance = new Renderer();\n }\n\n return self::$instance;\n }",
"protected function getRenderer() {\n return \\Drupal::service('renderer');\n }",
"protected function getViewRenderer() {\n\t\treturn $this->renderer;\n\t}",
"public function &getRenderer()\n {\n if(is_null($this->render))\n {\n $this->render = new \\ActionController\\Response\\Render;\n }\n return $this->render;\n }",
"public function getViewRenderer()\n\t{\n\t\treturn $this->renderer;\n\t}",
"public static function get_renderer() {\n // It probably doesn't take very long to construct one, but let's cache it anyhow\n static $out;\n if (!$out) {\n global $PAGE;\n $out = $PAGE->get_renderer('mod_forumng');\n }\n return $out;\n }",
"public function get_renderer(): Renderer {\n\t\t$story_attributes = $this->get_story_attributes();\n\t\t$view_type = ! empty( $story_attributes['view_type'] ) ? $story_attributes['view_type'] : '';\n\n\t\tswitch ( $view_type ) {\n\t\t\tcase 'carousel':\n\t\t\tcase 'circles':\n\t\t\t\t$renderer = new Carousel_Renderer( $this );\n\t\t\t\tbreak;\n\t\t\tcase 'list':\n\t\t\tcase 'grid':\n\t\t\tdefault:\n\t\t\t\t$renderer = new Generic_Renderer( $this );\n\t\t}\n\n\t\t$renderer->init();\n\n\t\treturn $renderer;\n\t}",
"public function getRender()\n {\n if ($this->render_factory !== null) {\n $retval = $this->render_factory->getInterface();\n } else {\n $retval = $this->render;\n }\n\n return $retval;\n }",
"public static function getRenderers()\n\t{\n\t\treturn static::$renderers;\n\t}",
"public function getImageRenderer()\n {\n return $this->imageRenderer;\n }",
"public function resolveRenderer()\n\t{\n\t\treturn SharedRendererResolver::resolveRenderer($this->getRenderer());\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if country is allowed | public function isCountryAllowed()
{
return $this->getConfig()->isCountryAllowed($this->getStore());
} | [
"function chkIsAllowedCountry()\n\t{\n\t\tglobal $CFG;\n\t\t$country_code = apache_note(\"GEOIP_COUNTRY_CODE\");\n\t\tif(in_array($country_code, $CFG['admin']['geo_country']))\n\t\t\treturn false;\n\t\treturn true;\n\t}",
"public function validateCountry($country);",
"public function is_valid_country()\r\n {\r\n // country code.\r\n return (!empty($this->country) &&\r\n array_key_exists(strtoupper($this->country), $GLOBALS['piplapi_countries']));\r\n }",
"public function canUseForCountry($country)\n {\n }",
"public function hasCountry(): bool;",
"function venture_deal_validate_country($element) {\n global $form_values;\n if ($form_values['field_deal_country']['key'] == 'United States') {\n if ($profile = venture_profile_retrieve(arg(1))) {\n if (!venture_profile_is_accredited($profile)) {\n form_set_error('field_deal_country', 'Country field is invalid. United States deals may not be submitted to a non-accredited investor.');\n }\n }\n }\n}",
"public function country_check(){\n\t\t\t$str = $this->input->post('vehicle_location_country');\n\t\t\tif ($str == '' || $str == '0'){\n\t\t\t\t$this->form_validation->set_message('country_check', 'Please select a country');\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}",
"function isValidCountry($country) {\n\tif($country == \"\")\n\t\treturn false;\n\n\tif(!preg_match(\"#^[a-zA-Z]{3,}$#\", $country))\n\t\treturn false;\n\n\treturn true;\n}",
"public function validate()\n {\n # nothing to do, but you have to create validator class for your country\n return true;\n }",
"private function validateCountryForIp(Request $request): bool\n {\n if( in_array($request->getClientIp(), IpInfoService::POSSIBLE_LOCALHOST_IPS) ){\n return true;\n }\n\n if( in_array($this->services->getUrlMatcherService()->getRouteForCalledUri($request->getRequestUri()), self::ROUTES_EXCLUDED_FROM_IP_CHECK) ){\n return true;\n }\n\n $this->saveIncomingRequest($request);\n\n try{\n $countryShortName = $this->services->getIpInfoService()->getCountryShortNameForIp($request->getClientIp());\n if( !in_array($countryShortName, self::ALLOWED_COUNTRIES_IP_ACCESS) ){\n $this->services->getLoggerService()->getLogger()->warning(\"Tried to access the project from blocked country\", [\n \"allowedCountries\" => self::ALLOWED_COUNTRIES_IP_ACCESS,\n \"countryShortName\" => $countryShortName,\n \"ip\" => $request->getClientIp(),\n ]);\n return false;\n }\n }catch(Exception | TypeError $e){\n $this->services->getLoggerService()->logException($e, [\n \"info\" => \"Exception was thrown while trying to validate country for ip, probably the api could not resolve ip\",\n \"ip\" => $request->getClientIp(),\n ]);\n return false;\n }\n\n return true;\n }",
"public function isCountryRequired()\n {\n return $this->getConfig()->isCountryRequired($this->getStore());\n }",
"public function hasCountries();",
"public function validate_country(){\n\t\t\t\n\t\t\t//obtain posted value\n\t\t\t$country = $this->input->post('country');\n\t\t\t\n\t\t\t//check if selected or default\n\t\t\tif ($country == '0')\n\t\t\t{\n\t\t\t\t//no country selected\n\t\t\t\t$this->form_validation->set_message('validate_country', 'Please select a country!');\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}",
"public function restrict()\n {\n $default = ee()->TMPL->fetch_param('default');\n $allowed = explode(\"|\", ee()->TMPL->fetch_param('allow'));\n $debug = ee()->TMPL->fetch_param('debug');\n\n\n // Was a default country specified?\n if ($default === FALSE) {\n ee()->TMPL->log_item('MC Country: No \"default\" parameter provided.');\n }\n\n if ($debug != '') {\n $country = $debug;\n } else {\n $ip = $_SERVER['REMOTE_ADDR'];\n $country = $this->_find($ip);\n }\n\n // Check if the user's detected country matches an allowed value\n if (in_array($country, $allowed)) {\n return $country;\n } else {\n return $default;\n }\n }",
"function is_valid_country_name ($countryName) {\n global $geoIP;\n \n foreach ($geoIP->GEOIP_COUNTRY_NAMES as $name) {\n if (strcasecmp($name, $countryName) === 0) { \n return true;\n break;\n }\n }\n unset($name);\n \n return false;\n }",
"private function __validate_dn_country() {\n if (isset($this->initial_data['dn_country'])) {\n # Ensure country is known\n if (in_array($this->initial_data[\"dn_country\"], array_keys(get_cert_country_codes()))) {\n $this->dn[\"countryName\"] = strval($this->initial_data['dn_country']);\n } else {\n $this->errors[] = APIResponse\\get(1051);\n }\n }\n }",
"public function has_valid_country_code($country_code)\n {\n }",
"private function isCountryCodeValid(): bool\n {\n $countryCode = $this->getCountryCode();\n \n return !(isset(static::$ibanFormatMap[$countryCode]) === false);\n }",
"public static function isValidIsoCode( $country ) {\n\t\t/**\n\t\t * List of valid iso 3166 country codes, regenerated on 1380836686\n\t\t * Code generated by a happy script at\n\t\t * https://gerrit.wikimedia.org/r/#/admin/projects/wikimedia/fundraising/tools,branches\n\t\t */\n\t\t$iso_3166_codes = [\n\t\t\t'AF', 'AX', 'AL', 'DZ', 'AS', 'AD', 'AO', 'AI', 'AQ', 'AG', 'AR', 'AM', 'AW', 'AU',\n\t\t\t'AT', 'AZ', 'BS', 'BH', 'BD', 'BB', 'BY', 'BE', 'BZ', 'BJ', 'BM', 'BT', 'BO', 'BQ',\n\t\t\t'BA', 'BW', 'BV', 'BR', 'IO', 'BN', 'BG', 'BF', 'BI', 'KH', 'CM', 'CA', 'CV', 'KY',\n\t\t\t'CF', 'TD', 'CL', 'CN', 'CX', 'CC', 'CO', 'KM', 'CG', 'CD', 'CK', 'CR', 'CI', 'HR',\n\t\t\t'CU', 'CW', 'CY', 'CZ', 'DK', 'DJ', 'DM', 'DO', 'EC', 'EG', 'SV', 'GQ', 'ER', 'EE',\n\t\t\t'ET', 'FK', 'FO', 'FJ', 'FI', 'FR', 'GF', 'PF', 'TF', 'GA', 'GM', 'GE', 'DE', 'GH',\n\t\t\t'GI', 'GR', 'GL', 'GD', 'GP', 'GU', 'GT', 'GG', 'GN', 'GW', 'GY', 'HT', 'HM', 'VA',\n\t\t\t'HN', 'HK', 'HU', 'IS', 'IN', 'ID', 'IR', 'IQ', 'IE', 'IM', 'IL', 'IT', 'JM', 'JP',\n\t\t\t'JE', 'JO', 'KZ', 'KE', 'KI', 'KP', 'KR', 'KW', 'KG', 'LA', 'LV', 'LB', 'LS', 'LR',\n\t\t\t'LY', 'LI', 'LT', 'LU', 'MO', 'MK', 'MG', 'MW', 'MY', 'MV', 'ML', 'MT', 'MH', 'MQ',\n\t\t\t'MR', 'MU', 'YT', 'MX', 'FM', 'MD', 'MC', 'MN', 'ME', 'MS', 'MA', 'MZ', 'MM', 'NA',\n\t\t\t'NR', 'NP', 'NL', 'NC', 'NZ', 'NI', 'NE', 'NG', 'NU', 'NF', 'MP', 'NO', 'OM', 'PK',\n\t\t\t'PW', 'PS', 'PA', 'PG', 'PY', 'PE', 'PH', 'PN', 'PL', 'PT', 'PR', 'QA', 'RE', 'RO',\n\t\t\t'RU', 'RW', 'BL', 'SH', 'KN', 'LC', 'MF', 'PM', 'VC', 'WS', 'SM', 'ST', 'SA', 'SN',\n\t\t\t'RS', 'SC', 'SL', 'SG', 'SX', 'SK', 'SI', 'SB', 'SO', 'ZA', 'GS', 'SS', 'ES', 'LK',\n\t\t\t'SD', 'SR', 'SJ', 'SZ', 'SE', 'CH', 'SY', 'TW', 'TJ', 'TZ', 'TH', 'TL', 'TG', 'TK',\n\t\t\t'TO', 'TT', 'TN', 'TR', 'TM', 'TC', 'TV', 'UG', 'UA', 'AE', 'GB', 'US', 'UM', 'UY',\n\t\t\t'UZ', 'VU', 'VE', 'VN', 'VG', 'VI', 'WF', 'EH', 'YE', 'ZM', 'ZW',\n\t\t];\n\n\t\tif ( in_array( $country, $iso_3166_codes ) ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test the forgot password page works. | public function testForgotPasswordPage()
{
$this->visit('password/reset')->see('Reset Password');
} | [
"public function testForgotPassword()\n {\n $this->browse(function($browser)\n {\n $browser->visit('/password/reset')\n ->assertSee('Reset Password'); \n });\n }",
"public function testForgotPassword()\n {\n // to ensure that email exists we need to create new account before\n $this->create();\n\n $this->url('customer/account/logout/');\n sleep(5);// waiting for auto-redirection afte log-out\n\n $this->url('customer/account/login/');\n sleep(2);\n $this->assertContains(\"Customer Login\", $this->title());\n\n $this->byXPath('//*[@id=\"login-form\"]/div/div[2]/div[1]/ul/li[3]/a')->click();\n sleep(2);\n $this->assertContains(\"Forgot Your Password\", $this->title());\n\n $this->byId('email_address')->value($this->getTmpEmail());\n $this->byXPath('//*[@id=\"form-validate\"]/div[2]/button')->click();\n\n sleep(2);\n //$this->assertContains(\"Customer Login\", $this->title());\n $alertMessage = $this->byXPath('//html/body/div/div/div[1]/div/div/div/div[2]')->text();\n $this->assertContains($this->getTmpEmail(), $alertMessage);\n }",
"public function testGetResetPasswordPage()\n\t{\n\t\t$meta = \\Orchestra\\Memory::make('user');\n\t\t$hash = \\Str::random(32);\n\t\t$meta->put('reset_password_hash.1', $hash);\n\n\t\t$this->call('orchestra::forgot@reset', array(1, $hash));\n\t\t$this->assertRedirectedTo(handles('orchestra::login'));\n\n\t\t$user = \\Orchestra\\Model\\User::find(1);\n\t\t$this->assertFalse(\\Hash::check('123456', $user->password));\n\t}",
"public function testPasswordResetPage()\n {\n $this->visit('/password/reset')\n ->see('Enter Email to reset password');\n }",
"public function testPasswordResetPage()\n {\n $this->visit('/password/reset')\n ->seePageIs('/login');\n }",
"public function testGetResetPasswordPage()\n\t{\n\t\t$response = $this->call('orchestra::forgot@index', array(), 'POST', array(\n\t\t\t'email' => 'example@test.com',\n\t\t\tSession::csrf_token => Session::token(),\n\t\t));\n\n\t\t$this->assertInstanceOf('Laravel\\Redirect', $response);\n\t\t$this->assertEquals(302, $response->foundation->getStatusCode());\n\t\t$this->assertEquals(handles('orchestra::forgot'), \n\t\t\t$response->foundation->headers->get('location'));\n\n\t\t// Mimic restarting Orchestra.\n\t\tOrchestra\\Core::shutdown();\n\t\tOrchestra\\Core::start();\n\t\t\n\t\t$meta = Orchestra\\Model\\User\\Meta::where('user_id', '=', 1)\n\t\t\t\t\t->where('name', '=', 'reset_password_hash')\n\t\t\t\t\t->first();\n\n\t\t$this->assertNotNull($meta);\n\t\t$this->assertNotNull($meta->value);\n\n\t\t$response = $this->call('orchestra::forgot@reset', array(1, $meta->value));\n\n\t\t$this->assertInstanceOf('Laravel\\Redirect', $response);\n\t\t$this->assertEquals(302, $response->foundation->getStatusCode());\n\t\t$this->assertEquals(handles('orchestra::login'), \n\t\t\t$response->foundation->headers->get('location'));\n\n\t\t$user = Orchestra\\Model\\User::find(1);\n\n\t\t$this->assertFalse(Hash::check('123456', $user->password));\n\t}",
"public function testDoForgotPasswordValid()\r\n\t{\r\n\t\t$user = Woodling::saved('User');\r\n\t\t$params = array(\r\n\t\t\t'email' => $user->email,\r\n\t\t);\r\n\r\n\t\t$this->call('POST', 'user/forgot_password', $params);\r\n\t\t$this->assertRedirectedTo('user/login');\r\n\t\t$this->assertSessionHas('notice');\r\n\t}",
"public function testPostForgotPage()\n\t{\n\t\t$response = $this->call('orchestra::forgot@index', array(), 'POST', array(\n\t\t\t'email' => 'example@test.com',\n\t\t\tSession::csrf_token => Session::token(),\n\t\t));\n\n\t\t$this->assertInstanceOf('Laravel\\Redirect', $response);\n\t\t$this->assertEquals(302, $response->foundation->getStatusCode());\n\t\t$this->assertEquals(handles('orchestra::forgot'), \n\t\t\t$response->foundation->headers->get('location'));\n\n\t\t// Mimic shutting down Orchestra.\n\t\tOrchestra\\Core::shutdown();\n\n\t\t$meta = Orchestra\\Model\\User\\Meta::where('user_id', '=', 1)\n\t\t\t\t\t->where('name', '=', 'reset_password_hash')\n\t\t\t\t\t->first();\n\n\t\t$this->assertNotNull($meta);\n\t\t$this->assertNotNull($meta->value);\n\t}",
"public function testSendPasswordReset()\n {\n dump('testSendPasswordReset');\n\n $this->browse(function (Browser $browser) {\n $user = factory(\\App\\User::class)->create();\n $browser->visit('password/reset')\n ->type('email', $user->email)\n ->press('Send Password Reset Link')\n ->waitFor('#result')\n ->pause(1000)\n ->assertSee('We have e-mailed your password reset link!');\n });\n }",
"public function forgottenpasswordTest(FunctionalTester $I){\n $user = HelperController::common_login($I, $this->name, $this->email, $this->password);\n HelperController::logout($I);\n $I->amOnPage( route('auth.password.reset') );\n $I->fillField('.email_form', 'nonregistered email');\n $I->click( trans('text.send_password_reset_link') );\n $I->see( 'The email must be a valid email address.' );\n\n $I->fillField('.email_form', 'some@gibberish.com');\n $I->click( trans('text.send_password_reset_link') );\n $I->see( trans('passwords.user') );\n\n $I->fillField('.email_form', $this->email);\n $I->click( trans('text.send_password_reset_link') );\n $I->see( trans('passwords.sent') );\n\n # check email\n $token = DB::table('password_resets')->where('email', $this->email)->first()->token;\n $log_path = storage_path('logs/laravel.log');\n $match = preg_grep( \"/$token/\" , file($log_path));\n $match = implode('|', $match);\n\n preg_match('#href=\"(.*)\"#', $match, $url);\n $url = $url[1];\n\n # follow email\n $I->amOnPage($url);\n\n $I->see( trans('text.reset_password') );\n $I->click( '.reset_password_button' );\n $I->see( trans('validation.filled', ['attribute' => 'password']) );\n $I->fillField('password', $this->new_password);\n $I->click( '.reset_password_button' );\n $I->see( trans('validation.confirmed', ['attribute' => 'password']) );\n \n # change password\n $I->fillField('password', $this->new_password);\n $I->fillField('password_confirmation', $this->new_password);\n $I->click( '.reset_password_button' );\n\n # see index page\n \n $I->click('.logged_user');\n }",
"public function testUserCanSuccessfullyGenerateNewPassword()\n {\n $user = factory(App\\User::class)->create();\n\n $this->visit('/forgot-password')\n ->type($user->email, 'email')\n ->press('Generate password')\n ->seeRouteIs('forgot-password')\n ->see('New password sent to your email')\n ->assertPasswordWasReset($user);\n }",
"public function testResetPasswordForm()\n {\n // Make a token for the user.\n $token = Confide::forgotPassword($this->user->email);\n $this->assertNotEquals(false, $token);\n\n $crawler = $this->client->request('GET', '/users/reset_password/' . $token);\n\n $this->assertTrue($this->client->getResponse()->isOk());\n\n // Check if reset password form is displayed.\n $this->assertEquals(0, $crawler->filter('html:contains(\"Email\")')->count());\n $this->assertEquals(1, $crawler->filter('html:contains(\"Password\")')->count());\n $this->assertEquals(1, $crawler->filter('html:contains(\"Confirm Password\")')->count());\n\n // Fill in the password and try to change it.\n $form = $crawler->selectButton('Continue')->form();\n \n $form['password'] = 'test123';\n $form['password_confirmation'] = 'test123';\n\n $crawler = $this->client->submit($form);\n\n $this->assertSessionHas('notice');\n $this->assertRedirectedToAction('B302AuthUsersController@login');\n\n // checks if the token is deleted\n $deleted = Confide::destroyForgotPasswordToken($token);\n $this->assertFalse($deleted);\n }",
"public function testResetPassword()\n {\n }",
"public function test_check_if_forget_password_request_success()\n {\n\n $response = $this->post('/password/email', [\n 'email' => 'admin@gmail.com',\n ]);\n $response->assertStatus(302);\n }",
"public function testDoForgotPasswordInvalid()\r\n\t{\r\n\t\t$params = array(\r\n\t\t\t'email' => 'email@example.com',\r\n\t\t);\r\n\r\n\t\t$this->call('POST', 'user/forgot_password', $params);\r\n\t\t$this->assertRedirectedTo('user/forgot_password');\r\n\t\t$this->assertSessionHas('error');\r\n\t}",
"public function testRequestPasswordReset()\n {\n }",
"public function user_can_view_reset_password_page()\n {\n \t// Get the URL\n $this->get('/password/reset')\n \t// See the string\n ->assertSee('Reset Password');\n }",
"public function testForgotPassword()\n {\n // init and mock\n $oMockController = $this->initController('/index.php/user/forgot_password');\n $this->mockIsLogedIn(false, $oMockController);\n $this->mockSecurityCheckToken(true, $oMockController);\n $this->mockValidate(true, $oMockController);\n $this->mockIsPost(true, $oMockController);\n\n $this->setPOST(\n [\n 'email' => 'test@test.com',\n ],\n $oMockController\n );\n\n // the test\n $oMockController->forgot_password();\n\n $messages = $this->invokeMethod($oMockController, 'getMessages', []);\n\n // asserts\n $this->assertInternalType(IsType::TYPE_ARRAY, $messages);\n $this->assertArrayHasKey('An email has benn sent to your email address', $messages);\n }",
"private function forgotPassword() {\n $this->_template->title = 'Forgot Password';\n if (filter_has_var(INPUT_POST, 'forgotPassword')) {\n $this->_user->forgotPassword();\n $passToken = $this->_user->getPassToken();\n $email = $this->_user->getSanitizedValue('email');\n $token = $this->_user->getSanitizedValue('token');\n $this->_security->checkCsrfToken($token);\n if ($this->_user->isTokenInserted() == true) {\n $this->_mail->sendPasswordToken($email, $passToken);\n } else {\n $this->_template->token = $this->_security->generateToken();\n $this->_template->forgotError = '<p class=\"error\">Please try again.</p>';\n $this->_template->errors = $this->_user->getErrors();\n $this->_template->missing = $this->_user->getMissingValues();\n $this->_template->buildFromTemplates('header.php', 'sidebar.php', 'main.forgotpass.php', 'footer.php');\n }\n } else {\n $this->_template->token = $this->_security->generateToken();\n $this->_template->buildFromTemplates('header.php', 'sidebar.php', 'main.forgotpass.php', 'footer.php');\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initializes the collTblproductoprecios collection. By default this just sets the collTblproductoprecios collection to an empty array (like clearcollTblproductoprecios()); however, you may wish to override this method in your stub class to provide setting appropriate to your application for example, setting the initial array to the values stored in database. | public function initTblproductoprecios($overrideExisting = true)
{
if (null !== $this->collTblproductoprecios && !$overrideExisting) {
return;
}
$collectionClassName = TblproductoprecioTableMap::getTableMap()->getCollectionClassName();
$this->collTblproductoprecios = new $collectionClassName;
$this->collTblproductoprecios->setModel('\propel\propel\Tblproductoprecio');
} | [
"public function setTblproductoprecios(Collection $tblproductoprecios, ConnectionInterface $con = null)\n {\n /** @var ChildTblproductoprecio[] $tblproductopreciosToDelete */\n $tblproductopreciosToDelete = $this->getTblproductoprecios(new Criteria(), $con)->diff($tblproductoprecios);\n\n\n $this->tblproductopreciosScheduledForDeletion = $tblproductopreciosToDelete;\n\n foreach ($tblproductopreciosToDelete as $tblproductoprecioRemoved) {\n $tblproductoprecioRemoved->setTblproductos(null);\n }\n\n $this->collTblproductoprecios = null;\n foreach ($tblproductoprecios as $tblproductoprecio) {\n $this->addTblproductoprecio($tblproductoprecio);\n }\n\n $this->collTblproductoprecios = $tblproductoprecios;\n $this->collTblproductopreciosPartial = false;\n\n return $this;\n }",
"public function getTblproductoprecios(Criteria $criteria = null, ConnectionInterface $con = null)\n {\n $partial = $this->collTblproductopreciosPartial && !$this->isNew();\n if (null === $this->collTblproductoprecios || null !== $criteria || $partial) {\n if ($this->isNew() && null === $this->collTblproductoprecios) {\n // return empty collection\n $this->initTblproductoprecios();\n } else {\n $collTblproductoprecios = ChildTblproductoprecioQuery::create(null, $criteria)\n ->filterByTblproductos($this)\n ->find($con);\n\n if (null !== $criteria) {\n if (false !== $this->collTblproductopreciosPartial && count($collTblproductoprecios)) {\n $this->initTblproductoprecios(false);\n\n foreach ($collTblproductoprecios as $obj) {\n if (false == $this->collTblproductoprecios->contains($obj)) {\n $this->collTblproductoprecios->append($obj);\n }\n }\n\n $this->collTblproductopreciosPartial = true;\n }\n\n return $collTblproductoprecios;\n }\n\n if ($partial && $this->collTblproductoprecios) {\n foreach ($this->collTblproductoprecios as $obj) {\n if ($obj->isNew()) {\n $collTblproductoprecios[] = $obj;\n }\n }\n }\n\n $this->collTblproductoprecios = $collTblproductoprecios;\n $this->collTblproductopreciosPartial = false;\n }\n }\n\n return $this->collTblproductoprecios;\n }",
"public function initJ805tTipoRecursos()\n\t{\n\t\t$this->collJ805tTipoRecursos = array();\n\t}",
"public function initTbcoordenadorcursos()\n\t{\n\t\t$this->collTbcoordenadorcursos = array();\n\t}",
"public function initShoppingCarts()\n\t{\n\t\t$this->collShoppingCarts = array();\n\t}",
"public function initprUsers()\n\t{\n\t\t$this->collprUsers = new PropelObjectCollection();\n\t\t$this->collprUsers->setModel('prUser');\n\t}",
"public function __construct()\r\n\t{\r\n\t\t$this->produtos = new ArrayCollection();\r\n\t}",
"public function initItemPedidos()\n\t{\n\t\t$this->collItemPedidos = array();\n\t}",
"public function initProducts($overrideExisting = true)\n {\n if (null !== $this->collProducts && !$overrideExisting) {\n return;\n }\n $this->collProducts = new PropelObjectCollection();\n $this->collProducts->setModel('Product');\n }",
"protected function initProductsWithOperations()\n {\n \t$mainTable = Mage::getSingleton('core/resource')->getTableName(\"catalogrule_product\");\n \t$this->productsWithOperation = Mage::getSingleton('core/resource')->getConnection('core_read')->fetchCol('select distinct product_id from ' . $mainTable);\n Mage::log('Products with operation : '.count($this->productsWithOperation), null, 'antidot.log');\n }",
"public function initProspectAtendimentos()\n\t{\n\t\t$this->collProspectAtendimentos = array();\n\t}",
"public function resetPartialTblproductoprecios($v = true)\n {\n $this->collTblproductopreciosPartial = $v;\n }",
"public function initJ006tLugarSeguros()\n\t{\n\t\t$this->collJ006tLugarSeguros = array();\n\t}",
"public function initRecibos()\n\t{\n\t\t$this->collRecibos = array();\n\t}",
"public function clearTblproductocostos()\n {\n $this->collTblproductocostos = null; // important to set this to NULL since that means it is uninitialized\n }",
"public function cargar_productos() {\r\n\t\t\t$productos = $this->sql->cargar_filas_tabla ('productos', 'id_producto');\r\n\t\t\tforeach($productos as $producto) {\r\n\t\t\t\t$p = new Producto(\r\n\t\t\t\t\tintval($producto['id_producto']),\r\n\t\t\t\t\t$producto['nombre'],\r\n\t\t\t\t\tfloatval($producto['precio_actual']),\r\n\t\t\t\t\tintval($producto['stock']),\r\n\t\t\t\t\t$producto['imagen'],\r\n\t\t\t\t\t$producto['descripcion']\r\n\t\t\t\t);\r\n\t\t\t\tarray_push(self::$productos, $p);\r\n\t\t\t}\r\n }",
"public function initClientes()\n\t{\n\t\t$this->collClientes = new PropelObjectCollection();\n\t\t$this->collClientes->setModel('Cliente');\n\t}",
"public function initRlOrgaoProjetos($overrideExisting = true)\n\t{\n\t\tif (null !== $this->collRlOrgaoProjetos && !$overrideExisting) {\n\t\t\treturn;\n\t\t}\n\t\t$this->collRlOrgaoProjetos = new PropelObjectCollection();\n\t\t$this->collRlOrgaoProjetos->setModel('RlOrgaoProjeto');\n\t}",
"public function clearProducts()\n {\n $this->collProducts = null; // important to set this to NULL since that means it is uninitialized\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the viewed posts in session. | private function getViewedPostsInSession()
{
return collect(session()->get('viewed_posts'));
} | [
"private function getViewedPosts()\n {\n return $this->session->get('viewed_posts', null);\n }",
"private function getViewedPosts()\n {\n return session()->get('viewed_posts', null);\n }",
"private function getViewedPosts() {\n // entry in the session exists, default to null.\n return $this->session->get('viewed_posts', null);\n }",
"public function viewedPosts()\n {\n return $this->morphedByMany(Post::class, 'viewable', 'user_page_views')\n ->withTimestamps()\n ->withPivot(['updated_at', 'count', 'id']);\n }",
"public function actionPostsByViews() {\n // prepare the view\n $this->setView('blog/postlist');\n $this->pagetitle = 'Most viewed posts';\n $this->content->user = $this->_user;\n $this->content->heading = 'Most viewed posts';\n $this->content->blogposts = BaseDAO::factory('Blogpost')->findByViews();\n }",
"public static function getMarkedPosts() {\n\t\t$sessionVars = WCF::getSession()->getVars();\n\t\tif (isset($sessionVars['markedPosts'])) {\n\t\t\treturn $sessionVars['markedPosts'];\n\t\t}\n\t\treturn null;\n\t}",
"public function getVisiblePages()\n\t{\n\t\treturn unserialize(get_user_meta(get_current_user_id(), 'np_visible_posts', true));\n\t}",
"public function posts()\n {\n return $this->_posts;\n }",
"public static function viewablePosts()\n {\n return DB::table('posts')\n ->leftJoin('post_privacy', 'posts.id', '=', 'post_privacy.post_id')\n ->leftJoin('friend_requests AS sender', 'posts.user_id', '=', 'sender.sender_id')\n ->leftJoin('friend_requests AS receiver', 'posts.user_id', '=', 'receiver.receiver_id')\n ->where('posts.user_id', '=', Auth::id())\n ->orWhere('posts.privacy', '=', 'public')\n ->where(function ($query) {\n $query->where('sender.receiver_id', '!=', Auth::id())\n ->orWhere('receiver.sender_id', '!=', Auth::id())\n ->orWhere('sender.receiver_id', '=', Auth::id())\n ->where('sender.status', '!=', 'block')\n ->orWhere('receiver.sender_id', '=', Auth::id())\n ->where('receiver.status', '!=', 'block');\n })\n ->orWhere('posts.privacy', '=', 'friends')\n ->where(function ($query) {\n $query->where('receiver.sender_id', '=', Auth::id())\n ->where('receiver.status', '=', 'friend')\n ->orWhere('sender.receiver_id', '=', Auth::id())\n ->where('sender.status', '=', 'friend');\n })\n ->orWhere('post_privacy.viewer_id', '=', Auth::id())\n ->select('posts.*')\n ->distinct()\n ->paginate(10);\n }",
"public function getPostViews($id);",
"public function getRecentPosts()\n\t{\n\t\t$sql = \"SELECT * FROM posts WHERE published = 1 ORDER BY created_at DESC LIMIT 4\";\n\t\treturn $this->findAll($sql, 'obj');\n\t}",
"protected function getUserPosts()\n {\n // if a user is logged in, then return the user's saved posts\n // otherwise, return an empty array\n $user_posts = \\Auth::check() ? \\Auth::user()->posts->all() : [];\n\n // sort user's saved posts\n Post::sortPosts($user_posts, \\Session::get('sort_by'));\n\n return $user_posts;\n }",
"public function getAll()\n {\n return view('/backoffice/sessions_read')->with(['sessions' => Session::with(['question', 'users', 'answers', 'tag'])->paginate(Config::get('constants.backoffice.NUMBER_OF_DISPLAYED_SESSIONS_PER_PAGE'))]);\n }",
"public function getUserPosts()\n {\n return auth()->user()->posts;\n }",
"public static function getPosts()\n {\n return Cache::rememberForever('post.posts', function () {\n return self::where('type', 'post')->orderBy('published_at', 'DESC')->get();\n }); \n }",
"public function hasSeenPost()\n {\n return $this->belongsToMany('App\\Post', 'has_seen_post', 'user_id', 'post_id');\n }",
"public function get_popular_posts()\n\t{\n\t\t$this->db->from('post');\n\t\t$this->db->select('post.*');\n\t\t$this->db->where('post_status = 1');\n\t\t$this->db->order_by('post_views', 'DESC');\n\t\t$query = $this->db->get('', 3);\n\t\t\n\t\treturn $query;\n\t}",
"public function getPublicPosts(){\n $this->db->query(\"SELECT *, posts.id as postId, users.id as userId FROM posts INNER JOIN users ON posts.user_id = users.id WHERE visibility = 'Public' ORDER BY posts.created_at DESC;\");\n\n $results = $this->db->resultset();\n\n return $results;\n }",
"function LatestPosts() {\n\t\treturn Post::get()\n\t\t\t->filter('AuthorID', (int)$this->urlParams['ID'])\n \t\t\t->limit(0,5)\n\t\t\t->sort(\"Created\", \"DESC\")\n\t\t\t->filterByCallback(function($post){\n\t\t\t\treturn $post->canView();\n\t\t\t});\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get cached roles if caching enabled | public function getRoles()
{
$enabled = config('rbac.cache.enabled');
$minutes = config('rbac.cache.minutes');
$key = static::class.".rbac#{$this->getKey()}";
if ($enabled) {
return Cache::remember($key, $minutes, function () {
return $this->roles()->get();
});
}
return $this->roles()->get();
} | [
"public function cachedRoles()\n {\n return Cache::remember(\n $this->getCachePrefix().'_roles',\n config('permissionsHandler.cacheExpiration'),\n function () {\n return $this->roles->pluck('name', 'id')->toArray();\n }\n );\n }",
"public function cachedRoles()\n {\n if (is_cache_taggable()) {\n return Cache::tags(model_cache_tag($this, config('access.cache.tag')))\n ->remember(model_cache_key($this), config('access.cache.ttl.roles'), function () {\n return $this->roles()->get();\n });\n }\n\n return $this->roles()->get();\n }",
"public function cachedRoles()\n {\n $userPrimaryKey = $this->primaryKey;\n $cacheKey = 'entrust_roles_for_user_' . $this->$userPrimaryKey;\n\n return Cache::rememberForever($cacheKey, function () {\n return $this->roles()->get();\n });\n }",
"private function getRouteRoles()\n {\n $router = $this->router;\n\n $cache = $this->getConfigCacheFactory()->cache(\n $this->options['cache_dir'].'/tenside_roles.php',\n function (ConfigCacheInterface $cache) use ($router) {\n $routes = $router->getRouteCollection();\n $roles = [];\n foreach ($routes as $name => $route) {\n if ($requiredRole = $route->getOption('required_role')) {\n $roles[$name] = $requiredRole;\n }\n }\n\n $cache->write('<?php return ' . var_export($roles, true) . ';', $routes->getResources());\n }\n );\n\n return require_once $cache->getPath();\n }",
"private static function cacheUserRoles()\n\t{\n\t\t$roles = ORM::for_table( _table_user_roles)\n\t\t\t\t\t->distinct()->select('role_id')\n\t\t\t\t\t->select('name')\n\t\t\t\t\t->join( _table_roles, array( _table_user_roles.'.role_id','=', _table_roles.'.id'))\n\t\t\t\t\t->where('user_id',$_SESSION[session_key]['user_id'])\n\t\t\t\t\t->find_many();\n\n\t\tif(!$roles)\n\t\t{\n\t\t\t$_SESSION[session_key]['has_roles'] = null;\n\t\t\tunset($_SESSION[session_key]['has_roles']);\n\t\t\treturn false;\n\t\t}\n\n\t\tforeach($roles as $role)\n\t\t{\n\t\t\t$_SESSION[session_key]['has_roles'][$role->role_id] = $role->name;\n\t\t}\n\n\t\treturn $_SESSION[session_key]['has_roles'];\n\t}",
"private function updateRolesCache() {\n\t\tif (is_null($this->userRolesArr))\n\t\t\t$this->userRolesArr = $this->SQL->getAllUserRoles();\n\t}",
"private function cacheEnabled() {\n\t\treturn (bool) config( 'roles.cache.enabled' );\n\t}",
"protected function getRoles()\n\t{\n\t\tif ($this->session !== null || $this->config->getAuthenticationType() == Config::AUTH_USER)\n\t\t{\n\t\t\t$actor_type = 'user';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$actor_type = 'application';\n\t\t}\n\t\t\n\t\t$roles = $this->loadRolesFromCache($actor_type);\n\t\t\n\t\tif ($roles === false)\n\t\t{\n\t\t\t$roles = $this->loadRolesFromApi($actor_type);\n\t\t\t\n\t\t\t// Store it in the cache\n\t\t\t$this->token_cache->set($this->rolesCacheKey($actor_type), $roles);\n\t\t}\n\t\t\n\t\treturn $roles;\n\t}",
"private function loadRoles()\r\n {\r\n $db = Sweia::getInstance()->getDB();\r\n\r\n $roles = $db->query(\"SELECT ur.rid, r.role FROM \" . SystemTables::DB_TBL_USER_ROLE . \" ur LEFT JOIN role r ON (r.rid = ur.rid) WHERE uid='$this->uid'\");\r\n while ($role = $db->fetchObject($roles))\r\n {\r\n $this->roles[$role->rid] = $role->role;\r\n }\r\n\r\n /* If the currently logged in user is this user, add the authenticated user role to this user */\r\n if (Session::loggedInUid() == $this->uid)\r\n {\r\n $this->roles[2] = \"authenticated\";\r\n }\r\n \r\n return $this->roles;\r\n }",
"function roles_get_all_roles() {\r\n\treturn roles()->getAll();\r\n}",
"public function getRoles()\n {\n }",
"public function getRoles()\n {\n // if the roles are not initialized\n if (!$this->roles) {\n // initialize them\n $this->roles = array(\n 'magelocal' => array('name'=>'Magento Local module file', 'dir_config'=>'mage_local_dir'),\n 'magecommunity' => array('name'=>'Magento Community module file', 'dir_config'=>'mage_community_dir'),\n 'magecore' => array('name'=>'Magento Core team module file', 'dir_config'=>'mage_core_dir'),\n 'magedesign' => array('name'=>'Magento User Interface (layouts, templates)', 'dir_config'=>'mage_design_dir'),\n 'mageetc' => array('name'=>'Magento Global Configuration', 'dir_config'=>'mage_etc_dir'),\n 'magelib' => array('name'=>'Magento PHP Library file', 'dir_config'=>'mage_lib_dir'),\n 'magelocale' => array('name'=>'Magento Locale language file', 'dir_config'=>'mage_locale_dir'),\n 'magemedia' => array('name'=>'Magento Media library', 'dir_config'=>'mage_media_dir'),\n 'mageskin' => array('name'=>'Magento Theme Skin (Images, CSS, JS)', 'dir_config'=>'mage_skin_dir'),\n 'mageweb' => array('name'=>'Magento Other web accessible file', 'dir_config'=>'mage_web_dir'),\n 'magetest' => array('name'=>'Magento PHPUnit test', 'dir_config'=>'mage_test_dir'),\n 'mage' => array('name'=>'Magento other', 'dir_config'=>'mage_dir'),\n 'php' => array('dir_config'=>'php_dir'),\n 'data' => array('dir_config'=>'data_dir'),\n 'doc' => array('dir_config'=>'doc_dir'),\n 'test' => array('dir_config'=>'test_dir'),\n 'temp' => array('dir_config'=>'temp_dir'),\n );\n }\n // return the initialized roles\n return $this->roles;\n }",
"public function getRoles()\n {\n Yii::trace('getRoles()', 'application.components.RinkfinderWebUser');\n\treturn $this->getState('__roles');\n }",
"public function loadRoles()\n {\n $this->roles = array();\n $db = Codeli::getInstance()->getDB();\n\n $sql = \"SELECT ur.rid, r.* FROM \" . SystemTables::USER_ROLE\n . \" ur LEFT JOIN \" . SystemTables::ROLE . \" r ON (r.rid = ur.rid) WHERE uid=':uid'\";\n $roles = $db->query($sql, array(\":uid\" => $this->user->getId()));\n while ($row = $db->fetchObject($roles))\n {\n $role = new Role();\n $role->loadFromMap($row);\n $this->roles[$row->rid] = $role;\n }\n\n return $this->roles;\n }",
"public function getUserRoles();",
"function monsterinsights_get_roles() {\n\tglobal $wp_roles;\n\n\t$all_roles = $wp_roles->roles;\n\t$roles = array();\n\n\t/**\n\t * Filter: 'editable_roles' - Allows filtering of the roles shown within the plugin (and elsewhere in WP as it's a WP filter)\n\t *\n\t * @api array $all_roles\n\t */\n\t$editable_roles = apply_filters( 'editable_roles', $all_roles );\n\n\tforeach ( $editable_roles as $id => $name ) {\n\t\t$roles[ $id ] = translate_user_role( $name['name'] );\n\t}\n\n\treturn $roles;\n}",
"public function getRoles() {\n return DB::getAll(\n DB::T(DB::ROLE),\n new DBCondIn(\n 'id',\n DB::prepGetAll(\n DB::T(DB::ROLE_PERMISSION),\n new DBCond('permission', $this),\n array('role')\n )));\n }",
"public function get_roles()\r\n {\r\n return $this->roles;\r\n }",
"public static function loadRoles(){\n $roles = new self();\n $select = $roles->select();\n $select->order('role asc');\n $result = $roles->fetchAll($select);\n return $result;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Action Name : delete Description : To delete the note sent by the particular commenting person. Created by : AKILAN Updated by : AKILAN Created Date : 23082016 Updated Date : 23082016 URL : /peoplecaddieapi/entities/note/delete_note/?id=4 Request input : id => ID of the note, isDeleted = true Request method: POST Responses: 1. success: 2.fail: | public function delete($params = null) {
$params = $this->request->data;
$this->bh_connect = $this->BullhornConnection->BHConnect();
$url = $_SESSION['BH']['restURL'] . '/entity/Note/' . $params['id'] . '?BhRestToken=' . $_SESSION['BH']['restToken'];
$params['isDeleted'] = 'true';
$post_params = json_encode($params);
$req_method = 'POST';
$response = $this->BullhornCurl->curlFunction($url, $post_params, $req_method);
echo json_encode($response);
} | [
"public function actionDelete(){\n include_once('model/MNote.php');\n $note_model = new MNotes();\n\n $id = isset($_REQUEST['id']) ? trim($_REQUEST['id']) : '';\n\n if(empty($id)){\n die(json_encode([\n MSG_RESULT => false,\n MSG_TYPE => MSG_ERROR,\n MSG_MSG => 'Your request is wrong!'\n ]));\n }\n\n $sticky_note = $note_model->getNoteById($id);\n if(empty($sticky_note)){\n die(json_encode([\n MSG_RESULT => false,\n MSG_TYPE => MSG_ERROR,\n MSG_MSG => 'This sticky note is not exists!'\n ]));\n }\n\n if($note_model->deleteNote($id)){\n die(json_encode([\n MSG_RESULT => true,\n MSG_TYPE => MSG_SUCCESS,\n MSG_MSG => 'This item has been deleted successfully!'\n ]));\n }else{\n die(json_encode([\n MSG_RESULT => false,\n MSG_TYPE => MSG_ERROR,\n MSG_MSG => 'This item has not been deleted successfully!'\n ]));\n }\n }",
"public function delete_note_id(Request $request, $id_note){\n \t$note = ContactNote::find($id_note);\n\n if (sizeof($note) == 0){\n \treturn response('No contact note with that specific id found', 404);\n }\n\n $note->delete();\n\n return 204;\n }",
"public function deleteNoteAction(Note $note){\n if (!$note) {\n throw $this->createNotFoundException('Error! no note found for id '.$id);\n }\n\t\t$em = $this->getDoctrine()->getEntityManager();\n $em->remove($note);\n $em->flush();\n // return new Response('Note deleted!');\n $this->addFlash('notice', 'Note has been deleted!');\n return $this->redirectToRoute('notes_homepage');\n\t}",
"public function delete(NoteEntity $note);",
"function deleteNote($_id){\n\t\t$sql = \"DELETE FROM notes WHERE id = '$_id'\";\n\t\tif ($this-> conn->query($sql)) {\n\n\t\t\t$data = array('Status' => 'Success', 'message'=> 'deleted Successfully', 'debug'=> $sql);\n\t\t\techo json_encode($data);\n\t\t}else{\n\t\t\t$data = array('Status' => 'Failure', 'message'=> 'delete failure', 'debug'=> $sql);\n\t\t\techo json_encode($data);\n\t\t}\n\n\t\t\n\t}",
"public static function delete_note() {\n $request_id = absint( $_REQUEST['request'] );\n $note = absint( $_REQUEST['note_id'] );\n\n wp_delete_comment( $note, true );\n\n ob_start();\n include WooCommerce_Warranty::$base_path .'templates/list-item-notes.php';\n $list = ob_get_clean();\n\n die( $list );\n }",
"function ajax_note_delete() {\n $note = ModelJB::newInstance()->getNoteByID(Params::getParam('noteID'));\n $result = ModelJB::newInstance()->deleteNote(Params::getParam('noteID'));\n if( ($result !== false) && ($result > 0 ) ) {\n $st = new Stream();\n $st->log_remove_note(Params::getParam('applicantID'), Params::getParam('noteID'));\n }\n }",
"public static function delete_ticket_note($params = array())\n\t{\n\t\t$params['action'] = 'deleteticketnote';\n\t\treturn self::send_request($params);\n\t}",
"public static function delete_note() {\n\t\tNotes::delete_notes_with_name( self::NOTE_NAME );\n\t}",
"public function action_delete() {\n\t\t$id = Input::param('id', $this->param('id'));\n\n\t\t// Delete the notice\n\t\t$results = DB::delete('notices')->where('id', '=', $id)->limit(1)->execute();\n\n\t\t$data = array('affected_rows' => $results, 'notice_id' => $id);\n\t\t$meta = array(\n\t\t 'error' => ($results > 0) ? null : 'Unable to delete notice '.$id,\n\t\t 'status' => ($results > 0) ? 1 : 0);\n\n\t\t// Delete locations associated with the notice\n\t\tif ($results > 0) {\n\t\t $ids = array();\n\t\t $locations = DB::select('id')->from('locations')->where('notice_id', '=', $id)->execute();\n\t\t foreach($locations as $item) { array_push($ids, $item['id']); }\n\n\t\t $results += DB::delete('locations')->where('notice_id', '=', $id)->execute();\n\t\t $data['affected_rows'] = $results;\n\t\t $data['location_ids'] = $ids;\n\t\t}\n\n\t\tksort($data);\n\t\tksort($meta);\n\n\t\t$output = array('data' => $data, 'meta' => $meta);\n\t\t$this->response($output);\n\t}",
"public function delete_staff_note(){\n $this->_response_type('json');\n \n $ids = $this->input->post(\"ids\");\n \n $this->data->status = FALSE;\n if ( $this->permission_id != 0 && $this->permission_id != 2 ) {\n $this->data->html = 'You have not permission to write';\n } else { // owner, admin\n $this->load->model(\"merchant_staff_notes_m\", \"Merchant_Staff_Notes\");\n $this->data->status = $this->Merchant_Staff_Notes->deleteStaffNotes($ids);\n\n $this->data->html = $this->data->status ? 'Staff notes deleted successfully.' : 'Staff notes not be delete.';\n }\n\t}",
"public static function delete_order_note()\n {\n }",
"public function delete( $note )\n\t{\n\t\t$entry = $this->get_entry( $note['postID'], $note['userID'] );\n\t\tif ( $entry ) {\n\t\t\t$where = array( 'id' => $entry->id );\n\t\t\t$where_format = array( '%d' );\n\n\t\t\t$this->_wpdb->delete( $ekNotesTable, $where, $where_format );\n\t\t}\n\t}",
"public function testRemoveNote() \n\t{\t\n\t\t$response = $this->actingAs($this->user)->json('DELETE', 'api/deleteNote/' . $this->notes->first()->id, $this->notes->first()->toArray());\n\n\t\t$response\n\t\t\t->assertSuccessful();\n\t}",
"function deleteNote(NoteInterface $note);",
"public function delete() {\n $this->request->onlyAllow('post');\n $this->response->type('json');\n\n $status = false;\n $message = \"\";\n $userId = AuthComponent::user('id');\n\n if (isset($this->request->data)) {\n $type = $this->request->data['type'];\n $id = $this->request->data['id'];\n }\n\n if ($type == 'Discussion') {\n $status = $this->Discussion->deleteDiscussion($id, $userId);\n } elseif ($type == 'Reply') {\n $status = $this->Discussion->Reply->deleteReply($id, $userId);\n }\n\n if ($status) {\n $message = \"{$type} deleted successfully\";\n } else {\n $message = \"Could not delete {$type}, Already deleted or unauthorized\";\n }\n $this->set(compact('status', 'message'));\n $this->set('_serialize', array('status', 'message'));\n }",
"public function deleteNote($id) {\n try{ \n $query = $this->con->prepare(\"DELETE FROM notes WHERE id = :id;\");\n $query->bindParam(':id', $id);\n $query->execute();\n } catch (PDOException $e) {\n echo $e->getMessage();\n }\n }",
"public static function delete_note( $note ) {\n\t\t$note->set_is_deleted( 1 );\n\t\t$note->save();\n\t}",
"public function delete_delete(){\n \t\t$id = $this->uri->segment(3);\n \t\t// $r = $this->delete('id');\n \t\t// $this->response($id);\n\t $response = $this->PersonM->delete_person(\n\t $id\n\t );\n\t $this->response($response);\n \t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initializes the objectmap as used by AbstractObject | function _initObjectMaps()
{
$this->objectmap['dbtable'] = 'TBL_USER';
$this->objectmap['primary']['id'] = 'USER_ID';
$this->objectmap['properties']['name'] = 'USER_NAME';
$this->objectmap['properties']['password'] = 'USER_PASSWORD';
$this->objectmap['properties']['email'] = 'USER_EMAIL';
$this->objectmap['properties']['accesslevel'] = 'USER_ACCESSLEVEL';
$this->objectmap['properties']['img'] = 'USER_IMG';
$this->objectmap['properties']['color'] = 'USER_COLOR';
$this->objectmap['properties']['gender'] = 'USER_GENDER';
$this->objectmap['properties']['link'] = 'USER_LINK';
$this->sqltypemap['id'] = 'INT(11) NOT NULL';
$this->sqltypemap['name'] = 'VARCHAR(64) NOT NULL';
$this->sqltypemap['password'] = "VARCHAR(32) NOT NULL DEFAULT ''";
$this->sqltypemap['email'] = 'VARCHAR(255) DEFAULT NULL';
$this->sqltypemap['accesslevel'] = 'INT(11) NOT NULL';
$this->sqltypemap['img'] = "VARCHAR(255) NOT NULL DEFAULT ''";
$this->sqltypemap['color'] = "VARCHAR(255) NOT NULL DEFAULT ''";
$this->sqltypemap['gender'] = "TINYINT(4) NOT NULL DEFAULT 0";
$this->sqltypemap['link'] = "VARCHAR(255) NOT NULL DEFAULT ''";
$this->sqlprops['index'] = 'INDEX(`USER_NAME`)';
} | [
"function _initObjectMaps()\r\n\t{\r\n\t}",
"public function initializeObject() {\r\n\t\t// Set default values.\r\n\t\t$this->mapOptions = $this->objectManager->create('Tx_AdGoogleMaps_MapBuilder_Options_MapOptions');\r\n\t\t$this->mapControl = $this->objectManager->create('Tx_AdGoogleMaps_MapBuilder_Options_MapControl');\r\n\t\t$this->layers = $this->objectManager->create('Tx_Extbase_Persistence_ObjectStorage');\r\n\t}",
"public function __construct () {\n\t\t#D:\\tools\\haxe\\std/php/_std/haxe/ds/ObjectMap.hx:33: characters 3-33\n\t\t$this->_keys = [];\n\t\t#D:\\tools\\haxe\\std/php/_std/haxe/ds/ObjectMap.hx:34: characters 3-35\n\t\t$this->_values = [];\n\t}",
"protected function Init()\r\n\t{\r\n\t\t$this->_map_object_class = str_replace(\"Criteria\",\"Map\",get_class($this));\r\n\t}",
"private function init()\n\t{\n\t\tif (!$this->init) {\n\t\t\t$this->init = true;\n\t\t\t$this->defaultMapper = new DefaultMapper;\n\t\t\t$this->checkConflicts();\n\t\t\tforeach ($this->mappers as $mapper) {\n\t\t\t\tforeach ($mapper->getMappedTables() as $table) {\n\t\t\t\t\t$this->tableToMapper[$table] = $mapper;\n\t\t\t\t}\n\n\t\t\t\tforeach ($mapper->getMappedEntities() as $entity) {\n\t\t\t\t\t$this->entityClassToMapper[$entity] = $mapper;\n\t\t\t\t}\n\n\t\t\t\tforeach ($mapper->getMappedNamespaces() as $namespace) {\n\t\t\t\t\t$this->entityNamespaceToMapper[$namespace] = $mapper;\n\t\t\t\t}\n\n\t\t\t\tforeach ($mapper->getMappedRepositories() as $repository) {\n\t\t\t\t\t$this->repositoryClassToMapper[$repository] = $mapper;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"protected function init(): void\n {\n $this->map = $this->mapService->getMap();\n $this->shooter = $this->map->getShooter();\n $this->target = $this->map->getTarget();\n }",
"public function init()\n {\n $valid = null;\n\n if ($this->cache->has(self::CACHE_KEY)) {\n $cached = $this->cache->get(self::CACHE_KEY);\n $valid = $cached && isset($cached['hosts']) && count($cached['hosts']);\n }\n\n\n if ($valid) {\n $this->map = $cached;\n } else {\n $this->build();\n }\n }",
"public function __construct()\n {\n\t\t$this->_objectMap = new DataMapper();\n\t\t$this->_objectMap->configure(array(\n\t\t\t'title'\t=> new MapItem(array(\n\t\t\t\t'map:input' \t=> 'tickets->name',\n\t\t\t\t'map:output'\t=> 'mytitle',\n\t\t\t\t'alias'\t\t=> 'mTitle'\n\t\t\t))\n\t\t));\n\t\t\t\t\n\t\t//-------------------\n /*$this->foo = new stdClass();\n $this->foo->bar = 'baz';\n $this->foo->myarr = array('blah');\n\n $this->sample = new Sample();*/\n }",
"function __construct()\n {\n $this->fields_map = new Fields_map();\n }",
"protected function initializeObject()\n {\n }",
"public function initializeObject()\n {\n $this->setNameAndPackageKey();\n }",
"public function __construct() {\n\t\t$this->_resources = new TechDivision_Collections_HashMap();\n\t}",
"public function initializeObject()\n {\n $operationsAndFinalOperationNames = static::buildOperationsAndFinalOperationNames($this->objectManager);\n $this->operations = $operationsAndFinalOperationNames[0];\n $this->finalOperationNames = $operationsAndFinalOperationNames[1];\n }",
"public function initImportMappingsRelatedByMapping()\n\t{\n\t\t$this->collImportMappingsRelatedByMapping = array();\n\t}",
"protected function _initOldFieldsMap()\n {\n\n }",
"public function initComplexObjects(): void\n {\n }",
"final public function __construct(mapObj $map, $symbolname) {}",
"public function __construct()\n {\n $this->geoImageMaps = new ArrayCollection();\n }",
"protected function initHookObjects() {}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Decodes the extension array from a binary .t3x data stream. The array consists of three parts 1: $parts[0]the md5 of the content (part 2/3) 2: $parts[1]keyword "gzcompress" when the file is compressed 3: $parts[2]the actual content, a serialized content | protected function decodeExchangeData($t3xdata) {
$parts = explode(':', $t3xdata, 3);
if ($parts[1] == 'gzcompress') {
if (function_exists('gzuncompress')) {
$parts[2] = gzuncompress($parts[2]);
} else {
return 'Decoding Error: No decompressor available for compressed content. gzcompress()/gzuncompress() functions are not available!';
}
}
if (md5($parts[2]) == $parts[0]) {
$content = unserialize($parts[2]);
if (is_array($content)) {
return $content;
} else {
return 'Error: Content could not be unserialized to an array. Strange (since MD5 hashes match!)';
}
} else {
return 'Error: MD5 mismatch. Maybe the extension file was downloaded and saved as a text file by the browser and thereby corrupted!? (Always select "All" filetype when saving extensions)';
}
} | [
"public function run_binary_parse() { \n\n\t\t// Switch on the extension\n\t\tswitch ($this->_pathinfo['extension']) { \n\t\t\tcase 'mp3': \n\t\t\t\t$this->_raw['tags'] = $this->mp3_binary_parse();\n\t\t\tbreak; \n\t\t\tdefault:\n\t\t\t\t$this->_raw['tags'] = array(); \n\t\t\tbreak; \n\t\t} // switch on extension\n\n\t}",
"abstract public function decompress($content);",
"public function read_tag(){\n\t\tif($this->file_loaded == true){\n\t\t\tfseek($this->fp,0);\n\t\t\tif(fread($this->fp,3) == 'ID3'){\n\t\t\t\tunset($this->tag_array);\n\t\t\t\t$this->tag_array = array();\n\t\t\t\t$this->flag = 0;\n\t\t\t\t$this->header_array['size'] = 0;\n\t\t\t\t$this->header_array['flags'] = 0;\n\t\t\t\t$this->header_array['crc32'] = FALSE;\n\t\t\t\t$this->tag_readable = true;\n\t\t\t\t$this->version_major = ord(fread($this->fp,1));\n\t\t\t\t$this->version_revision = ord(fread($this->fp,1));\n\t\t\t\t$this->flag = ord(fread($this->fp,1));\n\t\t\t\tif($this->flag & 128)\n\t\t\t\t\tsleep(0);\t\t\t\t\t\t// Not Supported\n\t\t\t\t$bytes = array();\n\t\t\t\t$count_byte = 0;\n\t\t\t\t$count = 0;\n\t\t\t\tfor($i=0;$i<4;$i++)\n\t\t\t\t\t$bytes[] = ord(fread($this->fp,1));\n\t\t\t\tfor($i=3;$i>=0;$i--){\n\t\t\t\t\tfor($j=0;$j<7;$j++){\n\t\t\t\t\t\t$count_byte += (($bytes[$i] & 1<<$j)==1<<$j)?1<<$count:0;\n\t\t\t\t\t\t$count++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$this->size = $count_byte;\n\t\t\t\tif($this->flag & 64) {\n\t\t\t\t\t$this->get_extended_header();\t\t\t\t// Treating Extended Header\n\t\t\t\t\t$this->size -= 10;\n\t\t\t\t}\n\t\t\t\tif($this->size>0)\n\t\t\t\t\t$tag = fread($this->fp,$this->size);\n\t\t\t\telse\n\t\t\t\t\t$tag = '';\n\t\t\t\t$this->tag_end = ftell($this->fp);\n\t\t\t\t$count = 0;\n\t\t\t\t$count_tag = 0;\n\t\t\t\twhile($count < $this->size){\n\t\t\t\t\t// 4 chars FRAME ID\n\t\t\t\t\t$this->tag_array[$count_tag] = new TagValue();\n\t\t\t\t\t$this->tag_array[$count_tag]->id = substr($tag,$count,4);\n\t\t\t\t\tif(trim($this->tag_array[$count_tag]->id) == ''){ // Padding detected\n\t\t\t\t\t\tunset($this->tag_array[$count_tag]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t$count+=4;\n\t\t\t\t\t$this->tag_array[$count_tag]->size = $this->get_int32(substr($tag,$count,4));\n\t\t\t\t\t$count+=4;\n\t\t\t\t\t$this->tag_array[$count_tag]->flag = $this->get_int16(substr($tag,$count,2));\n\t\t\t\t\t$count+=2;\n\t\t\t\t\t$this->tag_array[$count_tag]->data = substr($tag,$count,$this->tag_array[$count_tag]->size);\n\t\t\t\t\t$count+=$this->tag_array[$count_tag]->size;\n\t\t\t\t\t$count_tag++;\n\t\t\t\t}\n\t\t\t\t$this->padding_size = $this->size-$count;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$this->tag_readable = false;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}",
"public function decompress () {}",
"function xf_decode($text){\n\n\tif ($text == '') return array();\n\n\t// MODERN METHOD\n\tif (substr($text,0,4) == \"SER|\") return unserialize(substr($text,4));\n\n\t// OLD METHOD. OBSOLETE but supported for reading\n\t$xfieldsdata = explode(\"||\", $text);\n\n\tforeach ($xfieldsdata as $xfielddata) {\n\t\tlist($xfielddataname, $xfielddatavalue) = explode(\"|\", $xfielddata);\n\t\t$xfielddataname = str_replace(\"|\", \"|\", $xfielddataname);\n\t\t$xfielddataname = str_replace(\"__NEWL__\", \"\\r\\n\", $xfielddataname);\n\t\t$xfielddatavalue = str_replace(\"|\", \"|\", $xfielddatavalue);\n\t\t$xfielddatavalue = str_replace(\"__NEWL__\", \"\\r\\n\", $xfielddatavalue);\n\t\t$data[$xfielddataname] = $xfielddatavalue;\n\t}\n\treturn $data;\n}",
"public function get_content_compressed();",
"abstract public function unpack($bin);",
"function gz_decode ($data, $length = null)\n{\n return gzdecode($data, $length);\n}",
"private function parseId3v23Body($fp, $lastByte) {\n while (ftell($fp) < $lastByte) {\n $raw = fread($fp, 10);\n $frame_id = substr($raw, 0, 4);\n\n if ($frame_id == str_repeat(chr(0), 4)) {\n fseek($fp, $lastByte);\n break;\n }\n\n $data = unpack('Nframe_size/H2flags', substr($raw, 4));\n $frame_size = $data['frame_size'];\n $flags = base_convert($data['flags'], 16, 2);\n $this->id3v2TagsFlags[$frame_id] = array(\n 'flags' => array(\n 'tag_alter_preservation' => (bool)substr($flags, 0, 1),\n 'file_alter_preservation' => (bool)substr($flags, 1, 1),\n 'read_only' => (bool)substr($flags, 2, 1),\n 'compression' => (bool)substr($flags, 8, 1),\n 'encryption' => (bool)substr($flags, 9, 1),\n 'grouping_identity' => (bool)substr($flags, 10, 1),\n ),\n );\n switch ($frame_id) {\n // case 'UFID': # Unique file identifier\n // break;\n\n ################# Text information frames\n case 'TALB': # Album/Movie/Show title\n case 'TCON': # Content type\n case 'TYER': # Year\n case 'TXXX': # User defined text information frame\n case 'TRCK': # Track number/Position in set\n case 'TIT2': # Title/songname/content description\n case 'TPE1': # Lead performer(s)/Soloist(s)\n $this->tags2[$frame_id] = $this->handleTextFrame($frame_size, fread($fp, $frame_size));\n break;\n // case 'TBPM': # BPM (beats per minute)\n // case 'TCOM': # Composer\n // case 'TCOP': # Copyright message\n // case 'TDAT': # Date\n // case 'TDLY': # Playlist delay\n // case 'TENC': # Encoded by\n // case 'TEXT': # Lyricist/Text writer\n // case 'TFLT': # File type\n // case 'TIME': # Time\n // case 'TIT1': # Content group description\n // case 'TIT3': # Subtitle/Description refinement\n // case 'TKEY': # Initial key\n // case 'TLAN': # Language(s)\n // case 'TLEN': # Length\n // case 'TMED': # Media type\n // case 'TOAL': # Original album/movie/show title\n // case 'TOFN': # Original filename\n // case 'TOLY': # Original lyricist(s)/text writer(s)\n // case 'TOPE': # Original artist(s)/performer(s)\n // case 'TORY': # Original release year\n // case 'TOWN': # File owner/licensee\n // case 'TPE2': # Band/orchestra/accompaniment\n // case 'TPE3': # Conductor/performer refinement\n // case 'TPE4': # Interpreted, remixed, or otherwise modified by\n // case 'TPOS': # Part of a set\n // case 'TPUB': # Publisher\n // case 'TRDA': # Recording dates\n // case 'TRSN': # Internet radio station name\n // case 'TRSO': # Internet radio station owner\n // case 'TSIZ': # Size\n // case 'TSRC': # ISRC (international standard recording code)\n // case 'TSSE': # Software/Hardware and settings used for encoding\n\n ################# Text information frames\n\n ################# URL link frames\n // case 'WCOM': # Commercial information\n // break;\n // case 'WCOP': # Copyright/Legal information\n // break;\n // case 'WOAF': # Official audio file webpage\n // break;\n // case 'WOAR': # Official artist/performer webpage\n // break;\n // case 'WOAS': # Official audio source webpage\n // break;\n // case 'WORS': # Official internet radio station homepage\n // break;\n // case 'WPAY': # Payment\n // break;\n // case 'WPUB': # Publishers official webpage\n // break;\n // case 'WXXX': # User defined URL link frame\n // break;\n ################# URL link frames\n\n // case 'IPLS': # Involved people list\n // break;\n // case 'MCDI': # Music CD identifier\n // break;\n // case 'ETCO': # Event timing codes\n // break;\n // case 'MLLT': # MPEG location lookup table\n // break;\n // case 'SYTC': # Synchronized tempo codes\n // break;\n // case 'USLT': # Unsychronized lyric/text transcription\n // break;\n // case 'SYLT': # Synchronized lyric/text\n // break;\n case 'COMM': # Comments\n $dataEnd = ftell($fp) + $frame_size;\n $raw = fread($fp, 4);\n $data = unpack('C1encoding/A3language', $raw);\n // read until \\null character\n $short_description = null;\n $last_null = false;\n $actual_text = false;\n while (ftell($fp) < $dataEnd) {\n $char = fgetc($fp);\n if ($char == \"\\00\" && $actual_text === false) {\n if ($data['encoding'] == 0x1) { # two null-bytes for utf-16\n if ($last_null)\n $actual_text = null;\n else\n $last_null = true;\n } else # no condition for iso-8859-1\n $actual_text = null;\n\n }\n else if ($actual_text !== false) $actual_text .= $char;\n else $short_description .= $char;\n }\n if ($actual_text === false) $actual_text = $short_description;\n // list($short_description, $actual_text) = sscanf(\"s\".chr(0).\"s\", $data['texts']);\n // list($short_description, $actual_text) = explode(chr(0), $data['texts']);\n $this->tags2[$frame_id][$data['language']] = array(\n 'short' => (bool)($data['encoding'] == 0x00) ? mb_convert_encoding($short_description, 'utf-8', 'iso-8859-1') : mb_convert_encoding($short_description, 'utf-8', 'utf-16'),\n 'actual' => (bool)($data['encoding'] == 0x00) ? mb_convert_encoding($actual_text, 'utf-8', 'iso-8859-1') : mb_convert_encoding($actual_text, 'utf-8', 'utf-16'),\n );\n break;\n // case 'RVAD': # Relative volume adjustment\n // break;\n // case 'EQUA': # Equalization\n // break;\n // case 'RVRB': # Reverb\n // break;\n // case 'APIC': # Attached picture\n // break;\n // case 'GEOB': # General encapsulated object\n // break;\n case 'PCNT': # Play counter\n $data = unpack('L', fread($fp, $frame_size));\n $this->tags2[$frame_id] = $data[1];\n break;\n // case 'POPM': # Popularimeter\n // break;\n // case 'RBUF': # Recommended buffer size\n // break;\n // case 'AENC': # Audio encryption\n // break;\n // case 'LINK': # Linked information\n // break;\n // case 'POSS': # Position synchronisation frame\n // break;\n // case 'USER': # Terms of use\n // break;\n // case 'OWNE': # Ownership frame\n // break;\n // case 'COMR': # Commercial frame\n // break;\n // case 'ENCR': # Encryption method registration\n // break;\n // case 'GRID': # Group identification registration\n // break;\n // case 'PRIV': # Private frame\n // break;\n default:\n fseek($fp, $frame_size, SEEK_CUR);\n break;\n }\n }\n }",
"protected function unpackData ( ) {\n\n $this->filename->seek(0);\n\n /**\n * The first two words serve the identification of the file.\n * The magic number will always signal GNU MO files. \n * The number is stored in the byte order of the generating machine,\n * so the magic number really is two numbers: `0x950412de' and `0xde120495'.\n **/\n $magicNumber = $this->_read(1);\n\n switch(dechex($magicNumber)) {\n\n case '950412de':\n $this->_bigEndianByte = false;\n break;\n\n case 'de120495':\n $this->_bigEndianByte = true;\n break;\n\n default:\n throw new Hoa_Translate_Exception('%s is not a GNU MO file.', 0);\n }\n\n /**\n * For explain the following code, we will look this table :\n *\n * byte\n * +------------------------------------------+\n * 0 | magic number = 0x950412de |\n * | |\n * 4 | file format revision = 0 |\n * | |\n * 8 | number of strings | == N\n * | |\n * 12 | offset of table with original strings | == O\n * | |\n * 16 | offset of table with translation strings | == T\n * | |\n * 20 | size of hashing table | == S\n * | |\n * 24 | offset of hashing table | == H\n * | |\n * . .\n * . (possibly more entries later) .\n * . .\n * | |\n * O | length & offset 0th string ----------------.\n * O + 8 | length & offset 1st string ------------------.\n * ... ... | |\n * O + ((N-1)*8)| length & offset (N-1)th string | | |\n * | | | |\n * T | length & offset 0th translation ---------------.\n * T + 8 | length & offset 1st translation -----------------.\n * ... ... | | | |\n * T + ((N-1)*8)| length & offset (N-1)th translation | | | | |\n * | | | | | |\n * H | start hash table | | | | |\n * ... ... | | | |\n * H + S * 4 | end hash table | | | | |\n * | | | | | |\n * | NUL terminated 0th string <----------------' | | |\n * | | | | |\n * | NUL terminated 1st string <------------------' | |\n * | | | |\n * ... ... | |\n * | | | |\n * | NUL terminated 0th translation <---------------' |\n * | | |\n * | NUL terminated 1st translation <-----------------'\n * | |\n * ... ...\n * | |\n * +------------------------------------------+\n */\n\n $revision = $this->_read(1);\n $notsh = array(\n 'N' => $this->_read(1),\n 'O' => $this->_read(1),\n 'T' => $this->_read(1),\n 'S' => $this->_read(1),\n 'H' => $this->_read(1)\n );\n\n\n // Prepare original strings array.\n $this->filename->seek($notsh['O']);\n $originalStrOffset = $this->_read(2 * $notsh['N'], null);\n\n // Prepare translation strings array.\n $this->filename->seek($notsh['T']);\n $translationStrOffset = $this->_read(2 * $notsh['N'], null);\n $headers = null;\n\n for($e = 0, $max = $notsh['N']; $e < $max; $e++) {\n\n if($originalStrOffset[$e*2+1] == 0) {\n\n if(!empty($header))\n continue;\n\n $this->filename->seek($translationStrOffset[$e * 2 + 2]);\n $headers = $this->filename->read($translationStrOffset[$e * 2 + 1]);\n }\n\n $this->filename->seek($originalStrOffset[$e * 2 + 2]);\n $key = $this->filename->read($originalStrOffset[$e * 2 + 1]);\n\n $this->filename->seek($translationStrOffset[$e * 2 + 2]);\n $return[$key] = $this->filename->read($translationStrOffset[$e * 2 + 1]);\n }\n\n $this->_makeHeaders($headers);\n\n return $return;\n }",
"function unpack ($format, $data) {}",
"function _getTZFromMAPIBlob($data) {\n $unpacked = unpack(\"lbias/lstdbias/ldstbias/\" .\n \"vconst1/vdstendyear/vdstendmonth/vdstendday/vdstendweek/vdstendhour/vdstendminute/vdstendsecond/vdstendmillis/\" .\n \"vconst2/vdststartyear/vdststartmonth/vdststartday/vdststartweek/vdststarthour/vdststartminute/vdststartsecond/vdststartmillis\", $data);\n\n return $unpacked;\n }",
"public function readAmf3Data()\n {\n $type = $this->readByte();\n switch ($type) {\n case 0x00 :\n return new \\Amfphp_Core_Amf_Types_Undefined();\n case 0x01 :\n return null; //null\n case 0x02 :\n return false; //boolean false\n case 0x03 :\n return true; //boolean true\n case 0x04 :\n return $this->readAmf3Int();\n case 0x05 :\n return $this->readDouble();\n case 0x06 :\n return $this->readAmf3String();\n case 0x07 :\n return $this->readAmf3XmlDocument();\n case 0x08 :\n return $this->readAmf3Date();\n case 0x09 :\n return $this->readAmf3Array();\n case 0x0A :\n return $this->readAmf3Object();\n case 0x0B :\n return $this->readAmf3Xml();\n case 0x0C :\n return $this->readAmf3ByteArray();\n case 0x0D :\n case 0x0E :\n case 0x0F :\n case 0x10 :\n return $this->readAmf3Vector($type);\n case 0x11 :\n throw new AmfException('Dictionaries not supported, as it is not possible to use an object as array key in PHP ');\n //\n // In case of unknown type\n default:\n if ($this->fixController++ >= self::MAX_FIX_TRIES)\n throw new AmfException('Undefined Amf3 type encountered: ' . $type);\n //\n // Skip... read next byte\n $this->readByte();\n\n return $this->readAmf3Data();\n break;\n\n }\n }",
"private function &_xformExtract($offset)\n\t{\n\t\t$false = false; // Used to return false values in case an error occurs\n\n\t\t// Generate a return array\n\t\t$retArray = [\n\t\t\t\"filename\" => '', // File name extracted\n\t\t\t\"data\" => '', // File data\n\t\t\t\"offset\" => 0, // Offset in ZIP file\n\t\t\t\"skip\" => false, // Skip this?\n\t\t\t\"done\" => false // Are we done yet?\n\t\t];\n\n\t\t// If we can't open the file, return an error condition\n\t\tif ($this->_xform_fp === false)\n\t\t{\n\t\t\treturn $false;\n\t\t}\n\n\t\t// Go to the offset specified\n\t\tif (!fseek($this->_xform_fp, $offset) == 0)\n\t\t{\n\t\t\treturn $false;\n\t\t}\n\n\t\t// Get and decode Entity Description Block\n\t\t$signature = fread($this->_xform_fp, 3);\n\n\t\t// Check signature\n\t\tif ($signature == 'JPF')\n\t\t{\n\t\t\t// This a JPA Entity Block. Process the header.\n\n\t\t\t// Read length of EDB and of the Entity Path Data\n\t\t\t$length_array = unpack('vblocksize/vpathsize', fread($this->_xform_fp, 4));\n\t\t\t// Read the path data\n\t\t\t$file = fread($this->_xform_fp, $length_array['pathsize']);\n\t\t\t// Read and parse the known data portion\n\t\t\t$bin_data = fread($this->_xform_fp, 14);\n\t\t\t$header_data = unpack('Ctype/Ccompression/Vcompsize/Vuncompsize/Vperms', $bin_data);\n\t\t\t// Read any unknwon data\n\t\t\t$restBytes = $length_array['blocksize'] - (21 + $length_array['pathsize']);\n\n\t\t\tif ($restBytes > 0)\n\t\t\t{\n\t\t\t\t$junk = fread($this->_xform_fp, $restBytes);\n\t\t\t}\n\n\t\t\t$compressionType = $header_data['compression'];\n\n\t\t\t// Populate the return array\n\t\t\t$retArray['filename'] = $file;\n\t\t\t$retArray['skip'] = ($header_data['compsize'] == 0); // Skip over directories\n\n\t\t\tswitch ($header_data['type'])\n\t\t\t{\n\t\t\t\tcase 0:\n\t\t\t\t\t// directory\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 1:\n\t\t\t\t\t// file\n\t\t\t\t\tswitch ($compressionType)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase 0: // No compression\n\t\t\t\t\t\t\tif ($header_data['compsize'] > 0) // 0 byte files do not have data to be read\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$retArray['data'] = fread($this->_xform_fp, $header_data['compsize']);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 1: // GZip compression\n\t\t\t\t\t\t\t$zipData = fread($this->_xform_fp, $header_data['compsize']);\n\t\t\t\t\t\t\t$retArray['data'] = gzinflate($zipData);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 2: // BZip2 compression\n\t\t\t\t\t\t\t$zipData = fread($this->_xform_fp, $header_data['compsize']);\n\t\t\t\t\t\t\t$retArray['data'] = bzdecompress($zipData);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// This is not a file header. This means we are done.\n\t\t\t$retArray['done'] = true;\n\t\t}\n\n\t\t$retArray['offset'] = ftell($this->_xform_fp);\n\n\t\treturn $retArray;\n\t}",
"function mp3info()\n\t{\n\t\t$byte \t\t\t= array();\n\t\t$version \t\t= array(\"MPEG Version 2.5\",false,\"MPEG Version 2 (ISO/IEC 13818-3)\",\"MPEG Version 1 (ISO/IEC 11172-3)\");\n\t\t$version_bitrate\t= array(1,false,1,0);\n\t\t$version_sampling\t= array(2,false,1,0);\n\t\t$layer\t\t\t= array(false,\"Layer III\",\"Layer II\",\"Layer I\");\n\t\t$layer_bitrate\t\t= array(false,2,1,0);\n\t\t$layer_lengt\t\t= array(false,1,1,0);\n\t\t$protection \t\t= array(\"Protected by CRC (16bit crc follows header)\",\"Not protected\");\n\t\t$byterate\t\t= array(\n\t\t\t\tarray(\n\t\t\t\t\t\tarray(\"free\",32,64,96,128,160,192,224,256,288,320,352,384,416,448,\"bad\"),\n\t\t\t\t\t\tarray(\"free\",32,48,56, 64, 80, 96,112,128,160,192,224,256,320,384,\"bad\"),\n\t\t\t\t\t\tarray(\"free\",32,40,48, 56, 64, 80, 96,112,128,160,192,224,256,320,\"bad\")\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t\tarray(\"free\",32,48,56, 64, 80, 96,112,128,144,160,176,192,224,256,\"bad\"),\n\t\t\t\t\t\tarray(\"free\", 8,16,24, 32, 40, 48, 56, 64, 80, 96,112,128,144,160,\"bad\"),\n\t\t\t\t\t\tarray(\"free\", 8,16,24, 32, 40, 48, 56, 64, 80, 96,112,128,144,160,\"bad\")\n\t\t\t\t)\n\t\t);\n\t\t$samplingrate\t\t= array(\n\t\t\t\tarray(44100,48000,32000,false),\n\t\t\t\tarray(22050,24000,16000,false),\n\t\t\t\tarray(11025,12000, 8000,false)\n\t\t);\n\t\t$cannel_mode\t= array(\"Stereo\",\"Joint stereo (Stereo)\",\"Dual channel (Stereo)\",\"Single channel (Mono)\");\n\t\t$copyright\t= array(\"Audio is not copyrighted\",\"Audio is copyrighted \");\n\t\t$original\t= array(\"Copy of original media\",\"Original media\");\n\t\t$emphasis\t= array(\"none\",\"50/15 ms\",false,\"CCIT J.17 \");\n\n\t\t//id3-stuff\n\n\t\t$genre\t\t\t= array\n\t\t(\"Blues\",\"Classic Rock\",\"Country\",\"Dance\",\"Disco\",\"Funk\",\"Grunge\",\"Hip-Hop\",\"Jazz\",\"Metal\",\"New Age\",\"Oldies\",\"Other\",\"Pop\",\"R&B\",\n\t\t\t\t\"Rap\",\"Reggae\",\"Rock\",\"Techno\",\"Industrial\",\"Alternative\",\"Ska\",\"Death Metal\",\"Pranks\",\"Soundtrack\",\"Euro-Techno\",\"Ambient\",\"Trip-Hop\",\n\t\t\t\t\"Vocal\",\"Jazz+Funk\",\"Fusion\",\"Trance\",\"Classical\",\"Instrumental\",\"Acid\",\"House\",\"Game\",\"Sound Clip\",\"Gospel\",\"Noise\",\"Alternative Rock\",\n\t\t\t\t\"Bass\",\"Soul\",\"Punk\",\"Space\",\"Meditative\",\"Instrumental Pop\",\"Instrumental Rock\",\"Ethnic\",\"Gothic\",\"Darkwave\",\"Techno-Industrial\",\n\t\t\t\t\"Electronic\",\"Pop-Folk\",\"Eurodance\",\"Dream\",\"Southern Rock\",\"Comedy\",\"Cult\",\"Gangsta\",\"Top 40\",\"Christian Rap\",\"Pop/Funk\",\"Jungle\",\n\t\t\t\t\"Native US\",\"Cabaret\",\"New Wave\",\"Psychadelic\",\"Rave\",\"Showtunes\",\"Trailer\",\"Lo-Fi\",\"Tribal\",\"Acid Punk\",\"Acid Jazz\",\"Polka\",\"Retro\",\n\t\t\t\t\"Musical\",\"Rock & Roll\",\"Hard Rock\",\"Folk\",\"Folk-Rock\",\"National Folk\",\"Swing\",\"Fast Fusion\",\"Bebob\",\"Latin\",\"Revival\",\"Celtic\",\"Bluegrass\",\n\t\t\t\t\"Avantgarde\",\"Gothic Rock\",\"Progressive Rock\",\"Psychedelic Rock\",\"Symphonic Rock\",\"Slow Rock\",\"Big Band\",\"Chorus\",\"Easy Listening\",\"Acoustic\",\n\t\t\t\t\"Humour\",\"Speech\",\"Chanson\",\"Opera\",\"Chamber Music\",\"Sonata\",\"Symphony\",\"Booty Bass\",\"Primus\",\"Porn Groove\",\"Satire\",\"Slow Jam\",\"Club\",\n\t\t\t\t\"Tango\",\"Samba\",\"Folklore\",\"Ballad\",\"Power Ballad\",\"Rhytmic Soul\",\"Freestyle\",\"Duet\",\"Punk Rock\",\"Drum Solo\",\"Acapella\",\"Euro-House\",\n\t\t\t\t\"Dance Hall\",\"Goa\",\"Drum & Bass\",\"Club-House\",\"Hardcore\",\"Terror\",\"Indie\",\"BritPop\",\"Negerpunk\",\"Polsk Punk\",\"Beat\",\"Christian Gangsta Rap\",\n\t\t\t\t\"Heavy Metal\",\"Black Metal\",\"Crossover\",\"Contemporary Christian\",\"Christian Rock\",\"Merengue\",\"Salsa\",\"Trash Metal\",\"Anime\",\"Jpop\",\"Synthpop\");\n\n\t\t//id3v2 check----------------------------\n\t\t$footer = 0;\n\t\t$header = 0;\n\t\t$v1tag\t= 0;\n\t\t$fp = fopen($this->wave_filename,\"r\");\n\t\t$tmp = fread($fp,3);\n\t\tif($tmp == \"ID3\")\n\t\t{\n\t\t\t// id3v2 tag is present\n\t\t\t$this->getId3v2($fp);\n\n\t\t\t// getId3v2 will position pointer at end of header\n\t\t\t$header= ftell($fp);\n\n\t\t} else {\n\t\t\tfseek ($fp,0);\n\t\t\t$this->id3v2 = false;\n\t\t}\n\n\t\tfor ($x=0;$x<4;$x++)\n\t\t{\n\t\t\t$byte[$x] = ord(fread($fp,1));\n\t\t}\n\t\tfseek ($fp, -128 ,SEEK_END);\n\t\t$TAG = fread($fp,128);\n\t\tfclose($fp);\n\n\t\t//id tag?-------------------------------\n\n\t\tif(substr($TAG,0,3) == \"TAG\")\n\t\t{\n\t\t\t$v1tag = 128;\n\t\t\t$info[\"mpeg_id3v1_tag\"][\"title\"] \t= rtrim(substr($TAG,3,30));\n\t\t\t$info[\"mpeg_id3v1_tag\"][\"artist\"] \t= rtrim(substr($TAG,33,30));\n\t\t\t$info[\"mpeg_id3v1_tag\"][\"album\"] \t= rtrim(substr($TAG,63,30));\n\t\t\t$info[\"mpeg_id3v1_tag\"][\"year\"] \t= rtrim(substr($TAG,93,4));\n\t\t\t$info[\"mpeg_id3v1_tag\"][\"comment\"] \t= rtrim(substr($TAG,97,30));\n\t\t\t$info[\"mpeg_id3v1_tag\"][\"genre\"]\t= \"\";\n\t\t\t$tmp = ord(substr($TAG,127,1));\n\t\t\tif($tmp < count($genre))\n\t\t\t{\n\t\t\t\t$info[\"mpeg_id3v1_tag\"][\"genre\"] = $genre[$tmp];\n\t\t\t}\n\t\t} else {\n\t\t\t$info[\"mpeg_id3v1_tag\"] = false;\n\t\t}\n\n\t\t//version-------------------------------\n\n\t\t$tmp = $byte[1] & 24;\n\t\t$tmp = $tmp >> 3;\n\t\t$info_i[\"mpeg_version\"] = $tmp;\n\t\t$byte_v = $version_bitrate[$tmp];\n\t\t$byte_vs = $version_sampling[$tmp];\n\t\t$info[\"mpeg_version\"] = $version[$tmp];\n\n\t\t//layer---------------------------------\n\n\t\t$tmp = $byte[1] & 6;\n\t\t$tmp = $tmp >> 1;\n\t\t$info_i[\"mpeg_layer\"] = $tmp;\n\t\t$byte_l = $layer_bitrate[$tmp];\n\t\t$byte_len = $layer_lengt[$tmp];\n\t\t$info[\"mpeg_layer\"] = $layer[$tmp];\n\n\t\t//bitrate-------------------------------\n\n\t\t$tmp = $byte[2] & 240;\n\t\t$tmp = $tmp >> 4;\n\t\t$info_i[\"mpeg_bitrate\"] = $tmp;\n\t\t$info[\"mpeg_bitrate\"] = $byterate[$byte_v][$byte_l][$tmp];\n\n\t\t//samplingrate--------------------------\n\n\t\t$tmp = $byte[2] & 12;\n\t\t$tmp = $tmp >> 2;\n\t\t$info[\"mpeg_sampling_rate\"] = $samplingrate[$byte_vs][$tmp];\n\n\t\t//protection----------------------------\n\n\t\t$tmp = $byte[1] & 1;\n\t\t$info[\"mpeg_protection\"] = $protection[$tmp];\n\n\t\t//paddingbit----------------------------\n\n\t\t$tmp = $byte[2] & 2;\n\t\t$tmp = $tmp >> 1;\n\t\t$byte_pad = $tmp;\n\t\t$info[\"mpeg_padding_bit\"] = $tmp;\n\n\t\t//privatebit----------------------------\n\n\t\t$tmp = $byte[2] & 1;\n\t\t$byte_prv = $tmp;\n\n\t\t//channel_mode--------------------------\n\n\t\t$tmp = $byte[3] & 192;\n\t\t$tmp = $tmp >> 6;\n\t\t$info[\"mpeg_channel_mode\"] = $cannel_mode[$tmp];\n\n\t\t//copyright-----------------------------\n\n\t\t$tmp = $byte[3] & 8;\n\t\t$tmp = $tmp >> 3;\n\t\t$info[\"mpeg_copyright\"] = $copyright[$tmp];\n\n\t\t//original------------------------------\n\n\t\t$tmp = $byte[3] & 4;\n\t\t$tmp = $tmp >> 2;\n\t\t$info[\"mpeg_original\"] = $original[$tmp];\n\n\t\t//emphasis------------------------------\n\n\t\t$tmp = $byte[3] & 3;\n\t\t$info[\"mpeg_emphasis\"] = $emphasis[$tmp];\n\n\t\t//framelenght---------------------------\n\n\t\tif($info[\"mpeg_bitrate\"] == 'free' or $info[\"mpeg_bitrate\"] == 'bad' or\n\t\t!$info[\"mpeg_bitrate\"] or !$info[\"mpeg_sampling_rate\"])\n\t\t{\n\t\t\t$info[\"mpeg_framelength\"] = 0;\n\t\t} else {\n\t\t\tif($byte_len == 0)\n\t\t\t{\n\t\t\t\t$rate_tmp = $info[\"mpeg_bitrate\"] * 1000;\n\t\t\t\t$info[\"mpeg_framelength\"] = (12 * $rate_tmp / $info[\"mpeg_sampling_rate\"] + $byte_pad) * 4 ;\n\t\t\t} elseif($byte_len == 1) {\n\t\t\t\t$rate_tmp = $info[\"mpeg_bitrate\"] * 1000;\n\t\t\t\t$info[\"mpeg_framelength\"] = 144 * $rate_tmp / $info[\"mpeg_sampling_rate\"] + $byte_pad;\n\t\t\t}\n\t\t}\n\n\t\t//duration------------------------------\n\n\t\t$tmp = filesize($this->wave_filename);\n\t\t$tmp = $tmp - $header - 4 - $v1tag;\n\n\t\t$tmp2 = 0;\n\t\t$info[\"mpeg_frames\"]=\"\";\n\t\t$info[\"mpeg_playtime\"]=\"\";\n\t\tif(!$info[\"mpeg_bitrate\"] or $info[\"mpeg_bitrate\"] == 'bad' or !$info[\"mpeg_sampling_rate\"])\n\t\t{\n\t\t\t$info[\"mpeg_playtime\"] = -1;\n\t\t} elseif($info[\"mpeg_bitrate\"] == 'free')\n\t\t{\n\t\t\t$info[\"mpeg_playtime\"] = -1;\n\t\t} else {\n\t\t\t$tmp2 = ((8 * $tmp) / 1000) / $info[\"mpeg_bitrate\"];\n\t\t\t$info[\"mpeg_frames\"] = floor($tmp/$info[\"mpeg_framelength\"]);\n\t\t\t$tmp = $tmp * 8;\n\t\t\tif ($rate_tmp<>0)\n\t\t\t{\n\t\t\t\t$info[\"mpeg_playtime\"] = $tmp/$rate_tmp;\n\t\t\t}\n\t\t\t$info[\"mpeg_playtime\"] = $tmp2;\n\t\t}\n\n\t\t// transfer the extracted data into classAudioFile-structure\n\n\t\t$this->wave_id = \"MPEG\";\n\t\t$this->wave_type = $info[\"mpeg_version\"];\n\t\t$this->wave_compression = $info[\"mpeg_layer\"];\n\t\t$this->wave_channels = $info[\"mpeg_channel_mode\"];\n\t\t$this->wave_framerate = $info[\"mpeg_sampling_rate\"];\n\t\t$this->wave_byterate = $info[\"mpeg_bitrate\"] . \" Kbit/sec\";\n\t\t$this->wave_bits = \"n/a\";\n\t\t$this->wave_size = filesize($this->wave_filename);\n\t\t$this->wave_length = $info[\"mpeg_playtime\"];\n\n\t\t// pick up length from id3v2 tag if necessary and available\n\t\tif ($this->wave_length<1 && is_array($this->id3v2->TLEN) )\n\t\t{\n\t\t\t$this->wave_length= ( $this->id3v2->TLEN['value'] / 1000 );\n\t\t}\n\n\t\t$this->id3_tag = $info[\"mpeg_id3v1_tag\"];\n\n\t\tif ($this->id3_tag)\n\t\t{\n\t\t\t$this->id3_title = $info[\"mpeg_id3v1_tag\"][\"title\"];\n\t\t\t$this->id3_artist = $info[\"mpeg_id3v1_tag\"][\"artist\"];\n\t\t\t$this->id3_album = $info[\"mpeg_id3v1_tag\"][\"album\"];\n\t\t\t$this->id3_year = $info[\"mpeg_id3v1_tag\"][\"year\"];\n\t\t\t$this->id3_comment = $info[\"mpeg_id3v1_tag\"][\"comment\"];\n\t\t\t$this->id3_genre = $info[\"mpeg_id3v1_tag\"][\"genre\"];\n\t\t}\n\t}",
"private function _parseCextension($input, &$offset, $extensions, $c_start)\n {\n $extensions_read = array();\n\n // first handle the up to 2 extensions inside the 2nd part\n if ($extensions == 0) { // only padding\n $this->checkStr($input, $offset, str_repeat(\" \", 69));\n } elseif ($extensions == 1) {\n /* field 19 */\n $ext_type = $this->getNum($input, $offset, 2);\n /* field 20 */\n $ext_content = $this->getStr($input, $offset, 27, true);\n array_push($extensions_read, array($ext_type, $ext_content));\n /* fields 21,22,23 */\n $this->checkStr($input, $offset, str_repeat(\" \", 2+27+11));\n } else {\n /* field 19 */\n $ext_type = $this->getNum($input, $offset, 2);\n /* field 20 */\n $ext_content = $this->getStr($input, $offset, 27, true);\n array_push($extensions_read, array($ext_type, $ext_content));\n /* field 21 */\n $ext_type = $this->getNum($input, $offset, 2);\n /* field 22 */\n $ext_content = $this->getStr($input, $offset, 27, true);\n array_push($extensions_read, array($ext_type, $ext_content));\n /* fields 23 */\n $this->checkStr($input, $offset, str_repeat(\" \", 11));\n }\n // end 2nd part of C record\n assert($offset % 128 === 0);\n\n // up to 4 more parts, each with 128 bytes & up to 4 extensions\n while (count($extensions_read) < $extensions) {\n $ext_in_part = $extensions - count($extensions_read);\n // one switch to read the content\n switch($ext_in_part) {\n default: // =4\n case 4: /* fallthrough */\n $ext_type = $this->getNum($input, $offset, 2);\n $ext_content = $this->getStr($input, $offset, 27, true);\n array_push($extensions_read, array($ext_type, $ext_content));\n case 3: /* fallthrough */\n $ext_type = $this->getNum($input, $offset, 2);\n $ext_content = $this->getStr($input, $offset, 27, true);\n array_push($extensions_read, array($ext_type, $ext_content));\n case 2: /* fallthrough */\n $ext_type = $this->getNum($input, $offset, 2);\n $ext_content = $this->getStr($input, $offset, 27, true);\n array_push($extensions_read, array($ext_type, $ext_content));\n case 1: /* fallthrough */\n $ext_type = $this->getNum($input, $offset, 2);\n $ext_content = $this->getStr($input, $offset, 27, true);\n array_push($extensions_read, array($ext_type, $ext_content));\n break;\n case 0:\n // should never happen\n throw new Payment_DTA_ParseException(\n 'confused about number of extensions in transaction number '.\n strval($this->count()+1) .' @ offset '. strval($c_start) .\n ', please file a bug report'\n );\n }\n\n // and one switch for the padding\n switch($ext_in_part) {\n case 1:\n $this->checkStr($input, $offset, str_repeat(\" \", 29));\n case 2: /* fallthrough */\n $this->checkStr($input, $offset, str_repeat(\" \", 29));\n case 3: /* fallthrough */\n $this->checkStr($input, $offset, str_repeat(\" \", 29));\n case 4: /* fallthrough */\n default: /* fallthrough */\n $this->checkStr($input, $offset, str_repeat(\" \", 12));\n break;\n }\n // end n-th part of C record\n assert($offset % 128 === 0);\n }\n return $extensions_read;\n }",
"public static function gzdecode($data)\n\t{\n\t\tif (function_exists(\"gzdecode\"))\n\t\t{\n\t\t\treturn gzdecode($data);\n\t\t}\n\n\t\t$data = self::getBinarySubstring($data, 10, -8);\n\t\tif ($data !== \"\")\n\t\t{\n\t\t\t$data = gzinflate($data);\n\t\t}\n\n\t\treturn $data;\n\t}",
"function tagReader($file){\n $id3v23 = array(\"TIT2\",\"TALB\",\"TPE1\",\"TRCK\",\"TDRC\",\"TLEN\",\"USLT\");\n $id3v22 = array(\"TT2\",\"TAL\",\"TP1\",\"TRK\",\"TYE\",\"TLE\",\"ULT\");\n $fsize = filesize($file);\n $fd = fopen($file,\"r\");\n $tag = fread($fd,$fsize);\n $tmp = \"\";\n fclose($fd);\n if (substr($tag,0,3) == \"ID3\") {\n $result['FileName'] = $file;\n $result['TAG'] = substr($tag,0,3);\n $result['Version'] = hexdec(bin2hex(substr($tag,3,1))).\".\".hexdec(bin2hex(substr($tag,4,1)));\n }\n if($result['Version'] == \"4.0\" || $result['Version'] == \"3.0\"){\n for ($i=0;$i<count($id3v23);$i++){\n if (strpos($tag,$id3v23[$i].chr(0))!= FALSE){\n $pos = strpos($tag, $id3v23[$i].chr(0));\n $len = hexdec(bin2hex(substr($tag,($pos+5),3)));\n $data = substr($tag, $pos, 10+$len);\n for ($a=0;$a<strlen($data);$a++){\n $char = substr($data,$a,1);\n if($char >= \" \" && $char <= \"~\") $tmp.=$char;\n }\n if(substr($tmp,0,4) == \"TIT2\") $result['Title'] = substr($tmp,4);\n if(substr($tmp,0,4) == \"TALB\") $result['Album'] = substr($tmp,4);\n if(substr($tmp,0,4) == \"TPE1\") $result['Artist'] = substr($tmp,4);\n if(substr($tmp,0,4) == \"TRCK\") $result['Track'] = substr($tmp,4);\n if(substr($tmp,0,4) == \"TDRC\") $result['Year'] = substr($tmp,4);\n if(substr($tmp,0,4) == \"TLEN\") $result['Length'] = substr($tmp,4);\n if(substr($tmp,0,4) == \"USLT\") $result['Lyric'] = substr($tmp,7);\n $tmp = \"\";\n }\n }\n }\n if($result['Version'] == \"2.0\"){\n for ($i=0;$i<count($id3v22);$i++){\n if (strpos($tag,$id3v22[$i].chr(0))!= FALSE){\n $pos = strpos($tag, $id3v22[$i].chr(0));\n $len = hexdec(bin2hex(substr($tag,($pos+3),3)));\n $data = substr($tag, $pos, 6+$len);\n for ($a=0;$a<strlen($data);$a++){\n $char = substr($data,$a,1);\n if($char >= \" \" && $char <= \"~\") $tmp.=$char;\n }\n if(substr($tmp,0,3) == \"TT2\") $result['Title'] = substr($tmp,3);\n if(substr($tmp,0,3) == \"TAL\") $result['Album'] = substr($tmp,3);\n if(substr($tmp,0,3) == \"TP1\") $result['Artist'] = substr($tmp,3);\n if(substr($tmp,0,3) == \"TRK\") $result['Track'] = substr($tmp,3);\n if(substr($tmp,0,3) == \"TYE\") $result['Year'] = substr($tmp,3);\n if(substr($tmp,0,3) == \"TLE\") $result['Length'] = substr($tmp,3);\n if(substr($tmp,0,3) == \"ULT\") $result['Lyric'] = substr($tmp,6);\n $tmp = \"\";\n }\n }\n }\n return $result;\n}",
"function mp3info()\n\t{\n\t\t$byte \t\t\t= array();\n\t\t$version \t\t= array(\"MPEG Version 2.5\",false,\"MPEG Version 2 (ISO/IEC 13818-3)\",\"MPEG Version 1 (ISO/IEC 11172-3)\");\n\t\t$version_bitrate\t= array(1,false,1,0);\n\t\t$version_sampling\t= array(2,false,1,0);\n\t\t$layer\t\t\t= array(false,\"Layer III\",\"Layer II\",\"Layer I\");\n\t\t$layer_bitrate\t\t= array(false,2,1,0);\n\t\t$layer_lengt\t\t= array(false,1,1,0);\n\t\t$protection \t\t= array(\"Protected by CRC (16bit crc follows header)\",\"Not protected\");\n\t\t$byterate\t\t= array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\tarray(\"free\",32,64,96,128,160,192,224,256,288,320,352,384,416,448,\"bad\"),\n\t\t\t\t\t\t\tarray(\"free\",32,48,56, 64, 80, 96,112,128,160,192,224,256,320,384,\"bad\"),\n\t\t\t\t\t\t\tarray(\"free\",32,40,48, 56, 64, 80, 96,112,128,160,192,224,256,320,\"bad\")\n\t\t\t\t\t\t ),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\tarray(\"free\",32,48,56, 64, 80, 96,112,128,144,160,176,192,224,256,\"bad\"),\n\t\t\t\t\t\t\tarray(\"free\", 8,16,24, 32, 40, 48, 56, 64, 80, 96,112,128,144,160,\"bad\"),\n\t\t\t\t\t\t\tarray(\"free\", 8,16,24, 32, 40, 48, 56, 64, 80, 96,112,128,144,160,\"bad\")\n\t\t\t\t\t\t )\n\t\t\t\t\t );\n\t\t$samplingrate\t\t= array(\n\t\t\t\t\t\tarray(44100,48000,32000,false),\n\t\t\t\t\t\tarray(22050,24000,16000,false),\n\t\t\t\t\t\tarray(11025,12000, 8000,false)\n\t\t\t\t\t );\n\t\t$cannel_mode\t= array(\"Stereo\",\"Joint stereo (Stereo)\",\"Dual channel (Stereo)\",\"Single channel (Mono)\");\n\t\t$copyright\t= array(\"Audio is not copyrighted\",\"Audio is copyrighted \");\n\t\t$original\t= array(\"Copy of original media\",\"Original media\");\n\t\t$emphasis\t= array(\"none\",\"50/15 ms\",false,\"CCIT J.17 \");\n\n\t//id3-stuff DjAmolGroup Inc\n\n\t$genre\t\t\t= array\n\t\t\t\t\t(\"Blues\",\"Classic Rock\",\"Country\",\"Dance\",\"Disco\",\"Funk\",\"Grunge\",\"Hip-Hop\",\"Jazz\",\"Metal\",\"New Age\",\"Oldies\",\"Other\",\"Pop\",\"R&B\",\n\t\t\t\t\t\"Rap\",\"Reggae\",\"Rock\",\"Techno\",\"Industrial\",\"Alternative\",\"Ska\",\"Death Metal\",\"Pranks\",\"Soundtrack\",\"Euro-Techno\",\"Ambient\",\"Trip-Hop\",\n\t\t\t\t\t\"Vocal\",\"Jazz+Funk\",\"Fusion\",\"Trance\",\"Classical\",\"Instrumental\",\"Acid\",\"House\",\"Game\",\"Sound Clip\",\"Gospel\",\"Noise\",\"Alternative Rock\",\n\t\t\t\t\t\"Bass\",\"Soul\",\"Punk\",\"Space\",\"Meditative\",\"Instrumental Pop\",\"Instrumental Rock\",\"Ethnic\",\"Gothic\",\"Darkwave\",\"Techno-Industrial\",\n\t\t\t\t\t\"Electronic\",\"Pop-Folk\",\"Eurodance\",\"Dream\",\"Southern Rock\",\"Comedy\",\"Cult\",\"Gangsta\",\"Top 40\",\"Christian Rap\",\"Pop/Funk\",\"Jungle\",\n\t\t\t\t\t\"Native US\",\"Cabaret\",\"New Wave\",\"Psychadelic\",\"Rave\",\"Showtunes\",\"Trailer\",\"Lo-Fi\",\"Tribal\",\"Acid Punk\",\"Acid Jazz\",\"Polka\",\"Retro\",\n\t\t\t\t\t\"Musical\",\"Rock & Roll\",\"Hard Rock\",\"Folk\",\"Folk-Rock\",\"National Folk\",\"Swing\",\"Fast Fusion\",\"Bebob\",\"Latin\",\"Revival\",\"Celtic\",\"Bluegrass\",\n\t\t\t\t\t\"Avantgarde\",\"Gothic Rock\",\"Progressive Rock\",\"Psychedelic Rock\",\"Symphonic Rock\",\"Slow Rock\",\"Big Band\",\"Chorus\",\"Easy Listening\",\"Acoustic\",\n\t\t\t\t\t\"Humour\",\"Speech\",\"Chanson\",\"Opera\",\"Chamber Music\",\"Sonata\",\"Symphony\",\"Booty Bass\",\"Primus\",\"Porn Groove\",\"Satire\",\"Slow Jam\",\"Club\",\n\t\t\t\t\t\"Tango\",\"Samba\",\"Folklore\",\"Ballad\",\"Power Ballad\",\"Rhytmic Soul\",\"Freestyle\",\"Duet\",\"Punk Rock\",\"Drum Solo\",\"Acapella\",\"Euro-House\",\n\t\t\t\t\t\"Dance Hall\",\"Goa\",\"Drum & Bass\",\"Club-House\",\"Hardcore\",\"Terror\",\"Indie\",\"BritPop\",\"Negerpunk\",\"Polsk Punk\",\"Beat\",\"Christian Gangsta Rap\",\n\t\t\t\t\t\"Heavy Metal\",\"Black Metal\",\"Crossover\",\"Contemporary Christian\",\"Christian Rock\",\"Merengue\",\"Salsa\",\"Trash Metal\",\"Anime\",\"Jpop\",\"Synthpop\");\n\n\t//id3v2 check----------------------------\n\n\t\t$footer = 0;\n\t\t$header = 0;\n\t\t$v1tag\t= 0;\n\t\t$fp = fopen($this->wave_filename,\"r\");\n\t\t$tmp = fread($fp,3);\n\t\tif($tmp == \"ID3\")\n\t\t{\n\t\t\t$tmp \t= ord(fread($fp,1));\n\t\t\t$tmp2 \t= ord(fread($fp,1));\n\t\t\t$info[\"mpeg_id3v2_tag\"][\"version\"] = \"ID3v2.\".$tmp.\".\".$tmp2;\n\t\t\t$tmp \t= ord(fread($fp,1));\n\t\t\tif($tmp & 128)$info[\"mpeg_id3v2_tag\"][\"flag\"][\"unsync\"] = \"set\";\n\t\t\tif($tmp & 64) $info[\"mpeg_id3v2_tag\"][\"flag\"][\"extended\"] = \"set\";\n\t\t\tif($tmp & 32) $info[\"mpeg_id3v2_tag\"][\"flag\"][\"experimental\"] = \"set\";\n\t\t\tif($tmp & 16)\n\t\t\t{\n\t\t\t\t$info[\"mpeg_id3v2_tag\"][\"flag\"][\"footer\"] = \"set\";\n\t\t\t\t$footer = 10;\n\t\t\t}\n\t\t\t$tmp \t= ord(fread($fp,1))& 127;\n\t\t\t$tmp2 \t= ord(fread($fp,1))& 127;\n\t\t\t$tmp3\t= ord(fread($fp,1))& 127;\n\t\t\t$tmp4 \t= ord(fread($fp,1))& 127;\n\t\t\t$info[\"mpeg_id3v2_tag\"][\"header_lenght\"] = ($tmp * 2097152) + ($tmp2 * 16384) + ($tmp3 * 128) + $tmp4 + 10 + $footer;\n\t\t\tfseek ($fp,$info[\"mpeg_id3v2_tag\"][\"header_lenght\"]);\n\t\t\t$header = $info[\"mpeg_id3v2_tag\"][\"header_lenght\"];\n\t\t} else {\n\t\t\tfseek ($fp,0);\n\t\t\t$info[\"mpeg_id3v2_tag\"] = false;\n\t\t}\n\n\t\tfor ($x=0;$x<4;$x++)\n\t\t{\n\t\t\t$byte[$x] = ord(fread($fp,1));\n\t\t}\n\t\tfseek ($fp, -128 ,SEEK_END);\n\t\t$TAG = fread($fp,128);\n\t\tfclose($fp);\n\n\t//id tag?-------------------------------\n\n\t\tif(substr($TAG,0,3) == \"TAG\")\n\t\t{\n\t\t\t$v1tag = 128;\n\t\t\t$info[\"mpeg_id3v1_tag\"][\"title\"] \t= substr($TAG,3,30);\n\t\t\t$info[\"mpeg_id3v1_tag\"][\"artist\"] \t= substr($TAG,33,30);\n\t\t\t$info[\"mpeg_id3v1_tag\"][\"album\"] \t= substr($TAG,63,30);\n\t\t\t$info[\"mpeg_id3v1_tag\"][\"year\"] \t= substr($TAG,93,4);\n\t\t\t$info[\"mpeg_id3v1_tag\"][\"comment\"] \t= substr($TAG,97,30);\n\t\t\t$info[\"mpeg_id3v1_tag\"][\"genre\"]\t= \"\";\n\t\t\t$tmp = ord(substr($TAG,127,1));\n\t\t\tif($tmp < count($genre))\n\t\t\t{\n\t\t\t\t$info[\"mpeg_id3v1_tag\"][\"genre\"] = $genre[$tmp];\n\t\t\t}\n\t\t} else {\n\t\t\t$info[\"mpeg_id3v1_tag\"] = false;\n\t\t}\n\n\t//version-------------------------------\n\n\t\t$tmp = $byte[1] & 24;\n\t\t$tmp = $tmp >> 3;\n\t\t$info_i[\"mpeg_version\"] = $tmp;\n\t\t$byte_v = $version_bitrate[$tmp];\n\t\t$byte_vs = $version_sampling[$tmp];\n\t\t$info[\"mpeg_version\"] = $version[$tmp];\n\n\t//layer---------------------------------\n\n\t\t$tmp = $byte[1] & 6;\n\t\t$tmp = $tmp >> 1;\n\t\t$info_i[\"mpeg_layer\"] = $tmp;\n\t\t$byte_l = $layer_bitrate[$tmp];\n\t\t$byte_len = $layer_lengt[$tmp];\n\t\t$info[\"mpeg_layer\"] = $layer[$tmp];\n\n\t//bitrate-------------------------------djamol.com\n\n\t\t$tmp = $byte[2] & 240;\n\t\t$tmp = $tmp >> 4;\n\t\t$info_i[\"mpeg_bitrate\"] = $tmp;\n\t\t$info[\"mpeg_bitrate\"] = $byterate[$byte_v][$byte_l][$tmp].\" Кбит/сек.\";\n\n\t//samplingrate-------------------------- djamol.com\n\n\t\t$tmp = $byte[2] & 12;\n\t\t$tmp = $tmp >> 2;\n\t\t$info[\"mpeg_sampling_rate\"] = $samplingrate[$byte_vs][$tmp];\n\n\t//protection------------------djamol.com----------\n\n\t\t$tmp = $byte[1] & 1;\n\t\t$info[\"mpeg_protection\"] = $protection[$tmp];\n\n\t//paddingbit--djamol.com--------------------------\n\n\t\t$tmp = $byte[2] & 2;\n\t\t$tmp = $tmp >> 1;\n\t\t$byte_pad = $tmp;\n\t\t$info[\"mpeg_padding_bit\"] = $tmp;\n\n\t//privatebit----------------------------\n\n\t\t$tmp = $byte[2] & 1;\n\t\t$byte_prv = $tmp;\n\n\t//channel_mode--------------------------\n\n\t\t$tmp = $byte[3] & 192;\n\t\t$tmp = $tmp >> 6;\n\t\t$info[\"mpeg_channel_mode\"] = $cannel_mode[$tmp];\n\n\t//copyright-----------------------------\n\n\t\t$tmp = $byte[3] & 8;\n\t\t$tmp = $tmp >> 3;\n\t\t$info[\"mpeg_copyright\"] = $copyright[$tmp];\n\n\t//original------------------------------\n\n\t\t$tmp = $byte[3] & 4;\n\t\t$tmp = $tmp >> 2;\n\t\t$info[\"mpeg_original\"] = $original[$tmp];\n\n\t//emphasis------------------------------\n\n\t\t$tmp = $byte[3] & 3;\n\t\t$info[\"mpeg_emphasis\"] = $emphasis[$tmp];\n\n\t//framelenght---------------------------\n\n\t\tif($byte_len == 0)\n\t\t{\n\t\t\t$rate_tmp = $info[\"mpeg_bitrate\"] * 1000;\n\t\t\t$info[\"mpeg_framelenght\"] = (12 * $rate_tmp / $info[\"mpeg_sampling_rate\"] + $byte_pad) * 4 ;\n\t\t} elseif($byte_len == 1) {\n\t\t\t$rate_tmp = $info[\"mpeg_bitrate\"] * 1000;\n\t\t\t$info[\"mpeg_framelenght\"] = 144 * $rate_tmp /\n\t\t\t$info[\"mpeg_sampling_rate\"] + $byte_pad;\n\t\t}\n\n\t//duration------------------------------\n\n\t\t$tmp = filesize($this->wave_filename);\n\t\t$tmp = $tmp - $header - 4 - $v1tag;\n\n\t\t$tmp2 = 0;\n\t\tif ($info[\"mpeg_bitrate\"]<>0)\n\t\t{\n\t\t\t$tmp2 = ((8 * $tmp) / 1000) / $info[\"mpeg_bitrate\"];\n\t\t}\n\t\t$info[\"mpeg_frames\"]=\"\";\n\t\tif ($info[\"mpeg_framelenght\"]<>0)\n\t\t{\n\t\t\t$info[\"mpeg_frames\"] = floor($tmp/$info[\"mpeg_framelenght\"]);\n\t\t}\n\t\t$tmp = $tmp * 8;\n\t\t$info[\"mpeg_playtime\"]=\"\";\n\t\tif ($rate_tmp<>0)\n\t\t{\n\t\t\t$info[\"mpeg_playtime\"] = $tmp/$rate_tmp;\n\t\t}\n\t\t$info[\"mpeg_playtime\"] = $tmp2;\n\n\t\t// transfer the extracted data into classAudioFile-structure\n\n\t\t$this->wave_id = \"MPEG\";\n\t\t$this->wave_type = $info[\"mpeg_version\"];\n\t\t$this->wave_compression = $info[\"mpeg_layer\"];\n\t\t$this->wave_channels = $info[\"mpeg_channel_mode\"];\n\t\t$this->wave_framerate = $info[\"mpeg_sampling_rate\"];\n\t\t$this->wave_byterate = $info[\"mpeg_bitrate\"];\n\t\t$this->wave_bits = \"n/a\";\n\t\t$this->wave_size = filesize($this->wave_filename);\n\t\t$this->wave_length = $info[\"mpeg_playtime\"];\n\n\t\t$this->id3_tag = $info[\"mpeg_id3v1_tag\"];\n\n\t\tif ($this->id3_tag)\n\t\t{\n\t\t\t$this->id3_title = $info[\"mpeg_id3v1_tag\"][\"title\"];\n\t\t\t$this->id3_artist = $info[\"mpeg_id3v1_tag\"][\"artist\"];\n\t\t\t$this->id3_album = $info[\"mpeg_id3v1_tag\"][\"album\"];\n\t\t\t$this->id3_year = $info[\"mpeg_id3v1_tag\"][\"year\"];\n\t\t\t$this->id3_comment = $info[\"mpeg_id3v1_tag\"][\"comment\"];\n\t\t\t$this->id3_genre = $info[\"mpeg_id3v1_tag\"][\"genre\"];\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Functions function timelinerow($startdate,$enddate) function getRecommendation($uid,$startdate,$enddate) function getsituationDescription($sid) Add timeline row fixed user 39 | function timelinerow($uid,$startdate,$enddate){
//print_r(getRecommendation(39,'2015 05 04 00:30:01','2015 05 04 23:30:01'));
//$result=json_decode(getRecommendation(39,'2015 05 04 00:30:01','2015 05 04 23:30:01'),true);
$result=json_decode(getRecommendation($uid,$startdate,$enddate),true);
//echo '<pre>';print_r($result);
//[recommendationDate] => 2015-05-20 13:50:59.0
$desc=count($result)-1;
if(count($result))
{
for($i=$desc;$i>-1;$i--){
//for($i=0;$i<count($result);$i++){
?>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title"> <a data-toggle="collapse" data-parent="#accordion" href="#plus_<?php echo $result[$i]['recommendationID'];?>"><strong>Time:</strong> <?php if(isset($result[$i]['recommendationDate']))echo substr($result[$i]['recommendationDate'],10,6);?> </br><strong>Recommendation</strong>: <?php if(isset($result[$i]['recommendationDescription'])) echo $result[$i]['recommendationDescription'];?></a> </h4>
</div>
<div id="plus_<?php echo $result[$i]['recommendationID'];?>" class="panel-collapse collapse">
<div class="panel-body"><strong>Reason</strong>: <?php echo getsituationDescription($result[$i]['situationID']);?></div>
<div class="panel-body"><strong>Feedback</strong>: <?php echo getRecommendationFeedbackbyID($result[$i]['recommendationID']);?></div>
</div>
</div>
<?php
}//for loop
}//if cond
else{
?>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title"> <a data-parent="#accordion" href="#plus_"> <strong>No Recommendations</strong>: </a> </h4>
</div>
</div>
<?php
}
} | [
"function get_timesheet_rows($datestamp=NULL,$uid=NULL,$id=0,$idlist='', $showApproved=false, $showOnlyApproved=false, $showOnlyRejected=false){\r\n global $_TABLES;\r\n\r\n $lowerextent=$datestamp-14400;\r\n $upperextent=$datestamp+14400;\r\n\r\n if($id!=0 || $id!=NULL){//specific row we're after\r\n $sql=\"SELECT * FROM {$this->fulltablename} WHERE id='{$id}'\";\r\n\r\n }elseif( ($datestamp!=NULL || $datestamp!=0) && ($uid!=NULL || $uid!=0)){//after a user and specific day (may return multiple rows\r\n $sql=\"SELECT * FROM {$this->fulltablename} WHERE datestamp<='{$upperextent}' AND datestamp>='{$lowerextent}' AND uid='{$uid}' \";\r\n $sql.=\" ORDER BY ID ASC \";\r\n\r\n }elseif(($datestamp==NULL || $datestamp==0) && ($uid!=NULL || $uid!=0)){//after all the records for a user\r\n $sql=\"SELECT * FROM {$this->fulltablename} WHERE uid='{$uid}' \";\r\n $sql.=\" ORDER BY ID ASC \";\r\n }elseif($idlist!=''){//get a row whose user ids are in this list\r\n $approvedClause='';\r\n if($showApproved){\r\n $approvedClause=' AND (a.approved=1 or a.approved=0) ';\r\n }\r\n if($showOnlyApproved){\r\n $approvedClause=' AND (a.approved=1) ';\r\n }\r\n if($showOnlyRejected){\r\n $approvedClause=' AND (a.rejected=1) ';\r\n }\r\n $sql =\"SELECT a.*,b.region,b.tech_number FROM {$this->fulltablename} a \";\r\n $sql .=\"LEFT OUTER JOIN {$_TABLES['nextime_extra_user_data']} b ON a.uid=b.uid \";\r\n $sql .=\"WHERE a.uid in ($idlist) {$approvedClause} ORDER BY a.UID ASC \";\r\n\r\n }//end elseif\r\n $this->resultSet=DB_query($sql);\r\n $this->rowsReturned=DB_numRows($this->resultSet);\r\n $this->fetchNextRow();\r\n }",
"function get_timeline($dbh, $user, $count = 10, $start = PHP_INT_MAX) {\n\n}",
"function show_timeline()\n\t{\n?>\n\t<!-- SIMILE-Timle-Integration for Scoutnet-Calendar // http://simile.mit.edu/timeline/ -->\n\t<div id=\"my-timeline\" style=\"height: 150px; border: 1px solid #aaa\"></div>\n<?php\t\n\t}",
"private function get_timeline($date) {\n\t\t$timeline = array();\n\n\t\t//timeless\n\t\tforeach($this->settings['custom_rows'] as $key=>$label)\n\t\t\t$timeline[] = array('label'=>$label,'time'=>$key);\n\n\t\tif($this->settings['timeline']) {\n\t\t\t//other\n\t\t\t$interval = strtotime($date.' '.$this->settings['interval']);\n\t\t\t$zero_t = strtotime($date.' 0:00');\n\t\t\t$interval -= $zero_t;\n\t\t\t$start = strtotime($date.' '.$this->settings['start_day']);\n\t\t\t$end = strtotime($date.' '.$this->settings['end_day']);\n\t\t\tif($end===false || $start===false || $interval===false)\n\t\t\t\ttrigger_error('Invalid start/end_day or interval.',E_USER_ERROR);\n\t\t\t$interval_shift = '+'.str_replace(':',' hours ',$this->settings['interval']).' mins';\n\t\t\t$used = array();\n\t\t\tif($end<$start) {\n\t\t\t\t$curr = strtotime('0:00');\n\t\t\t\t$x = $curr;\n\t\t\t\twhile($x<$end) {\n\t\t\t\t\t$x = $x+$interval;\n\t\t\t\t\t$time = (strtotime($date.' '.date('H:i:s',$curr))-$zero_t);\n\t\t\t\t\tif(isset($used[$time]))\n\t\t\t\t\t\t$timeline[$used[$time]]['time'] = false;\n\t\t\t\t\t$used[$time] = count($timeline);\n\t\t\t\t\t$timeline[] = array('label'=>Base_RegionalSettingsCommon::time2reg($curr,2,false,false).' - '.Base_RegionalSettingsCommon::time2reg($x,2,false,false),'time'=>$time,'join_rows'=>1);\n\t\t\t\t\t$curr = $x;\n\t\t\t\t}\n\t\t\t\t$timeline[] = array('label'=>Base_RegionalSettingsCommon::time2reg($curr,2,false,false).' - '.Base_RegionalSettingsCommon::time2reg($start,2,false,false),'time'=>(strtotime($date.' '.date('H:i:s',$curr))-$zero_t),'join_rows'=>ceil(($start-$curr)/$interval));\n\t\t\t\t$day_end = strtotime('23:59')-$interval;\n\t\t\t\t$curr = $start;\n\t\t\t\t$x = $curr;\n\t\t\t\twhile($x<$day_end) {\n\t\t\t\t\t$x = strtotime($interval_shift, $x);\n\t\t\t\t\t$time = (strtotime($date.' '.date('H:i:s',$curr))-$zero_t);\n\t\t\t\t\tif(isset($used[$time]))\n\t\t\t\t\t\t$timeline[$used[$time]]['time'] = false;\n\t\t\t\t\t$used[$time] = count($timeline);\n\t\t\t\t\t$timeline[] = array('label'=>Base_RegionalSettingsCommon::time2reg($curr,2,false,false).' - '.Base_RegionalSettingsCommon::time2reg($x,2,false,false),'time'=>$time,'join_rows'=>1);\n\t\t\t\t\t$curr = $x;\n\t\t\t\t}\n\t\t\t\t$timeline[] = array('label'=>Base_RegionalSettingsCommon::time2reg($curr,2,false,false).' - '.Base_RegionalSettingsCommon::time2reg('23:59',2,false,false),'time'=>(strtotime($date.' '.date('H:i:s',$curr))-$zero_t));\n\t\t\t} else {\n\t\t\t\tif(date('H:i:s',strtotime('0:00'))!=date('H:i:s',$start))\n\t\t\t\t\t$timeline[] = array('label'=>Base_RegionalSettingsCommon::time2reg('0:00',2,false,false),'time'=>0,'join_rows'=>ceil((strtotime(date('H:i:s',$start))-strtotime('0:00'))/$interval));\n\t\t\t\t$x = $start;\n\t\t\t\twhile($x<$end) {\n\t\t\t\t\t$x = strtotime($interval_shift, $x);\n//\t\t\t\t\t$start_serv = $start;\n//\t\t\t\t\t$zero_t_serv = $zero_t;\n\t\t\t\t\t$start_serv = Base_RegionalSettingsCommon::reg2time($date.' '.date('H:i:s',$start));\n\t\t\t\t\t$zero_t_serv = Base_RegionalSettingsCommon::reg2time($zero_t);\n\t\t\t\t\t$time = ($start_serv-$zero_t_serv);\n\t\t\t\t\tif(isset($used[$time]))\n\t\t\t\t\t\t$timeline[$used[$time]]['time'] = false;\n\t\t\t\t\t$used[$time] = count($timeline);\n\t\t\t\t\t$timeline[] = array('label'=>Base_RegionalSettingsCommon::time2reg($start,2,false,false),'time'=>$time,'join_rows'=>1);\n\t\t\t\t\t$start = $x;\n\t\t\t\t}\n\t\t\t\tif($start<strtotime($date.' '.'23:59'))\n\t\t\t\t\t$timeline[] = array('label'=>Base_RegionalSettingsCommon::time2reg($start,2,false,false),'time'=>(strtotime($date.' '.date('H:i:s',$start))-$zero_t));\n\t\t\t}\n\t\t}\n\t\treturn $timeline;\n\t}",
"public function createTimeline($userId) {\r\n\r\n $timelineEdges = $this->_graphModule->traverseNodes($userId, 'timeline', '1', '10');\r\n\r\n foreach($timelineEdges as $edgeArr){\r\n $edge = $edgeArr[0];\r\n $actionNode = $edge['data'];\r\n\r\n if($this->getActionType($actionNode['actionType']) === \"user\"){\r\n //We have determined that this is a user-related action, so grab the destination users details and return a nice array.\r\n $userNode = $this->_userModule->userDetailsById($actionNode['uid']);\r\n\r\n $rtn[] = array(\r\n 'tlType'=>\"user\",\r\n 'timestamp'=>$actionNode['timestamp'],\r\n 'actionType'=>$actionNode['actionType'],\r\n 'userid'=>$actionNode['uid'],\r\n 'firstname'=>$userNode['firstname'],\r\n 'lastname'=>$userNode['lastname'],\r\n 'username'=>$userNode['username'],\r\n );\r\n\r\n }elseif($this->getActionType($actionNode['actionType']) === \"status\"){\r\n //This is a STATUS update that we are showing... Lets do it...\r\n $rtn[] = array(\r\n 'tlType'=>'status',\r\n 'timestamp'=>$actionNode['timestamp'],\r\n 'actionType'=>$actionNode['actionType'],\r\n 'statusData'=>$actionNode['statusData'],\r\n );\r\n\r\n }elseif($this->getActionType($actionNode['actionType']) === \"event\"){\r\n //This is EVENT related...\r\n //Get the Event Node\r\n $eventNode = $this->_graphModule->selectNodeById($actionNode['uid']);\r\n $eventData = $eventNode['data'][0][0]['data'];\r\n\r\n $event = array(\r\n 'tlType' =>'event',\r\n 'timestamp' => $eventData['timestamp'],\r\n 'actionType' => 'addEvent',\r\n 'eventid' => $actionNode['uid'],\r\n );\r\n $rtn[] = array_merge($event, $eventData);\r\n\r\n }elseif($this->getActionType($actionNode['actionType']) === \"group\"){\r\n //This is EVENT related...\r\n //Get the Event Node\r\n $groupNode = $this->_graphModule->selectNodeById($actionNode['uid']);\r\n $groupData = $groupNode['data'][0][0]['data'];\r\n\r\n $group = array(\r\n 'tlType' =>'group',\r\n 'timestamp' => $groupData['timestamp'],\r\n 'actionType' => 'addEvent',\r\n 'groupid' => $actionNode['uid'],\r\n );\r\n\r\n\r\n $rtn[] = array_merge($group, $groupData);\r\n }elseif($this->getActionType($actionNode['actionType']) === \"page\"){\r\n //This is PAGE related...\r\n //Get the Page Node\r\n $pageNode = $this->_graphModule->selectNodeById($actionNode['uid']);\r\n $pageData = $pageNode['data'][0][0]['data'];\r\n\r\n $page = array(\r\n 'tlType' =>'page',\r\n 'timestamp' => $pageData['timestamp'],\r\n 'actionType' => 'addPage',\r\n 'pageid' => $actionNode['uid'],\r\n );\r\n $rtn[] = array_merge($page, $pageData);\r\n }elseif($this->getActionType($actionNode['actionType']) === \"group\"){\r\n //This is GROUP related...\r\n //Get the Group Node\r\n $groupNode = $this->_graphModule->selectNodeById($actionNode['uid']);\r\n $groupData = $groupNode['data'][0][0]['data'];\r\n\r\n $page = array(\r\n 'tlType' =>'group',\r\n 'timestamp' => $groupData['timestamp'],\r\n 'actionType' => 'groupPage',\r\n 'groupid' => $actionNode['uid'],\r\n );\r\n $rtn[] = array_merge($page, $groupData);\r\n }\r\n\r\n }\r\n $user = $this->_userModule->userDetailsById($userId);\r\n\r\n /*********************************************************\r\n * STYLE THE ARRAY CONSTRUCTED ABOVE.\r\n *********************************************************/\r\n //Temporary Vars because language isnt working.\r\n $this->_language->_timeline['started-following'] = \"started following\";\r\n $this->_language->_timeline['is-friends-with'] = \"is now friends with\";\r\n $this->_language->_timeline['updated-his-status'] = \"updated his status\";\r\n $this->_language->_timeline['updated-her-status'] = \"updated her status\";\r\n $this->_language->_timeline['started-event'] = \"Started Event: \";\r\n $this->_language->_timeline['started-group'] = \"Started Group: \";\r\n $this->_language->_timeline['added-page'] = \"Added Page: \";\r\n $this->_language->_timeline['added-group'] = \"Added Group: \";\r\n\r\n $html = '';\r\n foreach($rtn as $act){\r\n\r\n $html.= '<i>'.date(CONF_DATEFORMAT, $act['timestamp']).'</i><br />';\r\n if($act['tlType'] === \"user\"){\r\n if($act['actionType'] === \"followerOf\"){\r\n $html.= ''.$user['firstname'].' '.$this->_language->_timeline['started-following'].' <a href=\"user.php?username='.$act['username'].'\">'.$act['firstname'].' '.$act['lastname'].'</a>';\r\n }elseif($act['actionType'] === \"friendOf\"){\r\n $html.= ''.$user['firstname'].' '.$this->_language->_timeline['is-friends-with'].' <a href=\"user.php?username='.$act['username'].'\">'.$act['firstname'].' '.$act['lastname'].'</a>';\r\n }\r\n\r\n }elseif($act['tlType'] === \"status\"){\r\n if($user['gender'] === \"male\"){\r\n $html.= ''.$user['firstname'].' '.$this->_language->_timeline['updated-his-status'].'<br />'.$act['statusData'].'';\r\n }else{\r\n $html.= ''.$user['firstname'].' '.$this->_language->_timeline['updated-her-status'].'<br />'.$act['statusData'].'';\r\n }\r\n\r\n }elseif($act['tlType'] === \"event\"){\r\n $html.= ''.$user['firstname'].' '.$this->_language->_timeline['started-event'].' <a href=\"event.php?eventid='.$act['eventid'].'\">'.$act['name'].'</a>';\r\n\r\n }elseif($act['tlType'] === \"group\"){\r\n $html.= ''.$user['firstname'].' '.$this->_language->_timeline['started-group'].' <a href=\"group.php?groupid='.$act['groupid'].'\">'.$act['name'].'</a>';\r\n\r\n }\r\n elseif($act['tlType'] === \"page\"){\r\n $html.= ''.$user['firstname'].' '.$this->_language->_timeline['added-page'].' <a href=\"event.php?eventid='.$act['pageid'].'\">'.$act['name'].'</a>';\r\n }\r\n elseif($act['tlType'] === \"group\"){\r\n $html.= ''.$user['firstname'].' '.$this->_language->_timeline['added-group'].' <a href=\"event.php?eventid='.$act['groupid'].'\">'.$act['name'].'</a>';\r\n }\r\n $html.= '<hr>';\r\n }\r\n\r\n return $html;\r\n }",
"function show_js()\n\t{\n?>\n\t<!-- SIMILE-Timle-Integration for Scoutnet-Calendar // http://simile.mit.edu/timeline/ -->\n\t<script src=\"http://simile.mit.edu/timeline/api/timeline-api.js\" type=\"text/javascript\"></script>\n\t<script type=\"text/javascript\">\n\tvar tl;\n\tfunction onLoad() {\n \t\tvar eventSource = new Timeline.DefaultEventSource();\n\t\tvar bandInfos = [\n\t\t\tTimeline.createBandInfo({\n\t\t\t\teventSource: eventSource,\n\t\t\t\tdate: \"Jun 28 2006 00:00:00 GMT\",\n\t\t\t\twidth: \"70%\", \n\t\t\t\tintervalUnit: Timeline.DateTime.MONTH, \n\t\t\t\tintervalPixels: 100\n\t\t\t}),\n\t\t\tTimeline.createBandInfo({\n\t\t\t\teventSource: eventSource,\n\t\t\t\tdate: \"Jun 28 2006 00:00:00 GMT\",\n\t\t\t\twidth: \"30%\", \n\t\t\t\tintervalUnit: Timeline.DateTime.YEAR, \n\t\t\t\tintervalPixels: 200\n\t\t\t})\n\t\t];\n\t\tbandInfos[1].syncWith = 0;\n\t\tbandInfos[1].highlight = true;\n\t\ttl = Timeline.create(document.getElementById(\"my-timeline\"), bandInfos);\n\t\tTimeline.loadXML(\"<?php echo get_settings('home').\"/wp-content/plugins/sp_scoutnetKalender/simile_timline_xml.php\" ?>\", function(xml, url) { eventSource.loadXML(xml, url); });\n\t\t//Timeline.loadXML(\"http://simile.mit.edu/timeline/docs/example1.xml\", function(xml, url) { eventSource.loadXML(xml, url); });\n\t\t//Timeline.loadXML(\"<?php echo get_settings('home');?>/wp-content/plugins/sp_scoutnetKalender/example1.xml\", function(xml, url) { eventSource.loadXML(xml, url); });\n\t}\n\t\n\tvar resizeTimerID = null;\n\tfunction onResize() {\n\t\tif (resizeTimerID == null) {\n\t\t\tresizeTimerID = window.setTimeout(function() {\n\t\t\t\tresizeTimerID = null;\n\t\t\t\ttl.layout();\n\t\t\t}, 500);\n\t\t}\n\t}\n\t</script>\n<?php\t\n\t}",
"public function getFormLine( $yearWeek,$lineNumber,$headers,$whitelistemode,$status=\"DRAFT\",$tsUserId)\n {\n global $statusTsColor;\n if(empty($yearWeek)||empty($headers))\n return '<tr>ERROR: wrong parameters for getFormLine'.empty($yearWeek).'|'.empty($headers).'</tr>';\n \n $timetype=TIMESHEET_TIME_TYPE;\n $dayshours=TIMESHEET_DAY_DURATION;\n $hidezeros=TIMESHEET_HIDE_ZEROS;\n $hidden=false;\n if(($whitelistemode==0 && !$this->listed)||($whitelistemode==1 && $this->listed))$hidden=true;\n $linestyle=(($hidden)?'display:none;':'').(($this->pStatus == \"2\")?'background:#'.TIMESHEET_BC_FREEZED.'\";':'');\n $html= '<tr '.((!empty($linestyle))?'style=\"'.$linestyle.'\"':'').' class=\"'.(($lineNumber%2=='0')?'pair':'impair').'\">'.\"\\n\"; \n //title section\n foreach ($headers as $key => $title){\n $html.=\"\\t<th align=\\\"left\\\">\";\n switch($title){\n case 'Project':\n if(version_compare(DOL_VERSION,\"3.7\")>=0){\n //if(file_exists(\"../projet/card.php\")||file_exists(\"../../projet/card.php\")){\n $html.='<a href=\"'.DOL_URL_ROOT.'/projet/card.php?id='.$this->fk_project2.'\">'.$this->ProjectTitle.'</a>';\n }else{\n $html.='<a href=\"'.DOL_URL_ROOT.'/projet/fiche.php?id='.$this->fk_project2.'\">'.$this->ProjectTitle.'</a>';\n\n }\n break;\n case 'TaskParent':\n $html.='<a href=\"'.DOL_URL_ROOT.'/projet/tasks/task.php?id='.$this->fk_task_parent.'&withproject='.$this->fk_project2.'\">'.$this->taskParentDesc.'</a>';\n break;\n case 'Tasks':\n $html.='<a href=\"'.DOL_URL_ROOT.'/projet/tasks/task.php?id='.$this->id.'&withproject='.$this->fk_project2.'\">'.$this->description.'</a>';\n break;\n case 'DateStart':\n $html.=$this->date_start?dol_print_date($this->date_start,'day'):'';\n break;\n case 'DateEnd':\n $html.=$this->date_end?dol_print_date($this->date_end,'day'):'';\n break;\n case 'Company':\n $html.='<a href=\"'.DOL_URL_ROOT.'/societe/soc.php?socid='.$this->companyId.'\">'.$this->companyName.'</a>';\n break;\n case 'Progress':\n $html .=$this->parseTaskTime($this->duration_effective).'/';\n if($this->planned_workload)\n {\n $html .= $this->parseTaskTime($this->planned_workload).'('.floor($this->duration_effective/$this->planned_workload*100).'%)';\n }else{\n $html .= \"-:--(-%)\";\n }\n break;\n }\n\n $html.=\"</th>\\n\";\n }\n\n // day section\n $isOpenSatus=($status==\"DRAFT\" || $status==\"CANCELLED\"|| $status==\"REJECTED\");\n $opendays=str_split(TIMESHEET_OPEN_DAYS);\n\n for($dayOfWeek=0;$dayOfWeek<7;$dayOfWeek++)\n {\n //$shrinkedStyle=(!$opendays[$dayOfWeek+1] && $shrinked)?'display:none;':'';\n $today= strtotime($yearWeek.' +'.($dayOfWeek).' day ');\n # to avoid editing if the task is closed \n $dayWorkLoadSec=isset($this->tasklist[$dayOfWeek])?$this->tasklist[$dayOfWeek]['duration']:0;\n \n if ($timetype==\"days\")\n {\n $dayWorkLoad=$dayWorkLoadSec/3600/$dayshours;\n }else {\n $dayWorkLoad=date('H:i',mktime(0,0,$dayWorkLoadSec));\n }\n\t\t\t \t$startDates=($this->date_start>$this->startDatePjct )?$this->date_start:$this->startDatePjct;\n\t\t\t \t$stopDates=(($this->date_end<$this->stopDatePjct && $this->date_end!=0) || $this->stopDatePjct==0)?$this->date_end:$this->stopDatePjct;\n if($isOpenSatus){\n $isOpen=$isOpenSatus && (($startDates==0) || ($startDates <= $today +86399));\n $isOpen= $isOpen && (($stopDates==0) ||($stopDates >= $today ));\n \n $isOpen= $isOpen && ($this->pStatus < \"2\") && $opendays[$dayOfWeek+1];\n // var_dump($opendays[$dayOfWeek+1]);\n $bkcolor='';\n \n if($isOpen){\n if($dayWorkLoadSec!=0)$bkcolor='background:#'.TIMESHEET_BC_VALUE;\n }else{\n $bkcolor='background:#'.TIMESHEET_BC_FREEZED;\n } \n \n \n $html .= '<th ><input type=\"text\" '.(($isOpen)?'':'readonly').' class=\"time4day['.$tsUserId.']['.$dayOfWeek.']\" ';\n// $html .= 'name=\"task['.$tsUserId.']['.$this->id.']['.$dayOfWeek.']\" '; if one whant multiple ts per validation\n $html .= 'name=\"task['.$tsUserId.']['.$this->id.']['.$dayOfWeek.']\" ';\n $html .=' value=\"'.((($hidezeros==1) && ($dayWorkLoadSec==0))?\"\":$dayWorkLoad);\n $html .='\" maxlength=\"5\" style=\"width: 90%;'.$bkcolor.'\" ';\n $html .='onkeypress=\"return regexEvent(this,event,\\'timeChar\\')\" ';\n $html .= 'onblur=\"validateTime(this,'.$tsUserId.','.$dayOfWeek.',0)\" />';\n $html .= \"</th>\\n\"; \n }else{\n $bkcolor='background:#'.$statusTsColor[$status];\n $html .= ' <th style=\"'.$bkcolor.'\"><a class=\"time4day['.$tsUserId.']['.$dayOfWeek.']\"';\n //$html .= ' name=\"task['.$tsUserId.']['.$this->id.']['.$dayOfWeek.']\" ';if one whant multiple ts per validation\n $html .= ' name=\"task['.$this->id.']['.$dayOfWeek.']\" ';\n $html .= ' style=\"width: 90%;\"';\n $html .=' >'.((($hidezeros==1) && ($dayWorkLoadSec==0))?\"\":$dayWorkLoad);\n $html .='</a> ';\n $html .= \"</th>\\n\"; \n\n \n }\n }\n $html .= \"</tr>\\n\";\n return $html;\n\n }",
"function show_project_timeline($project_id){\n\n$pr=new project($project_id);\n$work_arr=$pr->current_timeline($project_id);\nfor($t=0;$t<sizeof($work_arr);$t++){\n$task1=new task($work_arr[$t]['w_id']);\n$mb1=new member($task1->alloted_by);\n$mb2=new member($task1->alloted_to);\n// show the csss view for the resulting timeline \n?>\n\n<div class=\"sl-item sl-primary\">\n <div class=\"sl-content\">\n <small class=\"text-muted\"><?php echo $this->return_timespan($task1->starts_at);?></small>\n <p><?php echo $task1->title?></p>\n </div>\n</div>\n\n\n\n<?php \n}\n?>\n<a href=\"all-task.php?projectid=<?php echo $project_id;?>\" style=\"color:red\">All activities</a>\n<?php \n}",
"public function display_rides() {\n\n if ($this->checkLogin('A') == '') {\n redirect(ADMIN_ENC_URL);\n } else {\n $ride_act = '';\n $from = '';\n $to = '';\n $location = '';\n\t\t\t$filter = \"\";\n\t\t\t$filterKV = array();\n\t\t\tif (isset($_GET['date_range'])) {\n\t\t\t\t$from = $this->input->get('date_range');\n\t\t\t\t$filter = \"filter\";\n\t\t\t\t$filterKV[] = \"date_range=\".$from;\n\t\t\t}\n\t\t\tif (isset($_GET['dateto'])) {\n\t\t\t\t$to = $this->input->get('dateto');\n\t\t\t\t$filterKV[] = \"dateto=\".$to;\n\t\t\t}\n\t\t\t\t\n\t\t\t\n\t\t\t$filter_array = array('from' => $from, 'to' => $to);\n if (isset($_GET['act'])) {\n $ride_act = $this->input->get('act');\n }\n $offsetVal = 0;\n if (isset($_GET['per_page'])) {\n $offsetVal = $this->input->get('per_page');\n }\n if ($ride_act == 'Booked') {\n\t\t\t\t\t\t\t\t\t\t\t\t if ($this->lang->line('dash_just_booked') != '') \n\t\t $this->data['heading']= stripslashes($this->lang->line('dash_just_booked')); \n\t\t else $this->data['heading'] = 'Just Booked , Not Yet Started Rides';\n } else if ($ride_act == 'OnRide') {\n\t\t\t\t\t\t\t\t\t\t\t\t if ($this->lang->line('dash_on_rides_list') != '') \n\t\t $this->data['heading']= stripslashes($this->lang->line('dash_on_rides_list')); \n\t\t else $this->data['heading'] = 'On Rides List';\n } else if ($ride_act == 'Completed') {\n\t\t\t\tif ($this->lang->line('dash_completed_rides_list') != '') \n\t\t\t\t\t$this->data['heading']= stripslashes($this->lang->line('dash_completed_rides_list')); \n\t\t else $this->data['heading'] = 'Completed Rides List';\n } else if ($ride_act == 'Cancelled') {\n\t\t\t\tif ($this->lang->line('dash_cancelled_rides_list') != '') \n\t\t\t\t\t$this->data['heading']= stripslashes($this->lang->line('dash_cancelled_rides_list')); \n\t\t else $this->data['heading'] = 'Cancelled Rides List';\n } else if ($ride_act == 'riderCancelled') {\n\t\t\t\tif ($this->lang->line('dash_rider_cancelled_rides_list') != '') $this->data['heading']= stripslashes($this->lang->line('dash_rider_cancelled_rides_list')); else $this->data['heading'] = 'Rider Cancelled Rides List';\n } else if ($ride_act == 'driverCancelled') {\n\t\t\t\tif ($this->lang->line('dash_driver_cancelled_rides_list') != '') $this->data['heading']= stripslashes($this->lang->line('dash_driver_cancelled_rides_list')); else $this->data['heading'] = 'Driver Cancelled Rides List';\n\t\t\t} else if ($ride_act == 'Expired') {\n\t\t\t\tif ($this->lang->line('heading_expired_ride_list') != '') $this->data['heading']= stripslashes($this->lang->line('heading_expired_ride_list')); else $this->data['heading'] = 'Expired Rides List';\n } else {\n\t\t\t\tif ($this->lang->line('dash_all_rides_list') != '') $this->data['heading']= stripslashes($this->lang->line('dash_all_rides_list')); else $this->data['heading'] = 'All Rides List';\n }\n \n $type = $this->input->get('type');\n $value = $this->input->get('value');\n $this->data['type'] = $type;\n $filter_condition = array();\n if($type == 'driver_name'){\t\t\t\t\t\t\t\n if($this->input->get('value') != ''){\t\t\t\t\t\t\t\t\n $filter = \"filter\";\n $this->data['value'] = $value = $this->input->get('value');\n $filter_condition = array('driver.name'=>array('$regex'=> $value,'$options'=> 'i'));\n }\n } else if($type == 'driver_email'){\t\t\t\t\t\t\t\n if($this->input->get('value') != ''){\n $filter = \"filter\";\n $this->data['value'] = $value = $this->input->get('value');\n $filter_condition = array('driver.email'=>array('$regex'=> $value,'$options'=> 'i'));\n }\n } else if($type == 'user_name'){\t\t\t\t\t\t\t\n if($this->input->get('value') != ''){\n $filter = \"filter\";\n $this->data['value'] =$value = $this->input->get('value');\n $filter_condition = array('user.name'=>array('$regex'=> $value,'$options'=> 'i'));\n }\n } else if($type == 'user_email'){\t\t\t\t\t\t\t\n if($this->input->get('value') != ''){\n $filter = \"filter\";\n $this->data['value'] = $value = $this->input->get('value');\n $filter_condition = array('user.email'=>array('$regex'=> $value,'$options'=> 'i'));\n }\n } else if($type == 'driver_location'){\t\t\t\t\t\t\n if($this->input->get('locations_id') != ''){\n $filter = \"filter\";\n $this->data['locations_id'] = $locations_id = $this->input->get('locations_id');\n $filter_condition = array('location.id'=>$locations_id);\n }\n } else if($type == 'vehicle_type'){\n if($this->input->get('vehicle_category') != ''){\n $filter = \"filter\";\n $this->data['vehicle_category'] = $vehicle_category = $this->input->get('vehicle_category');\n $filter_condition = array('booking_information.service_id'=>$vehicle_category);\n }\n } else if($type == 'ride_id'){ \n if($this->input->get('value') != ''){\n $filter = \"filter\"; \n $this->data['value'] = $ride_id = $this->input->get('value'); \n $filter_condition = array('ride_id'=>$ride_id);\n }\n }\n\t\t\t$this->data['filter'] = $filter;\n\t\t\t$rides_total = $ridesList = $this->rides_model->get_rides_total($ride_act,'','',$filter_array,$filter_condition);\n $export_type = $this->input->get('export_type');\n if ($rides_total->num_rows() > 500 && $export_type != 'all') {\n $limit = 500;\n\n $this->data['ridesList'] = $ridesList = $this->rides_model->get_rides_list($ride_act, $limit, $offsetVal, '', $filter_array, '', $filter_condition);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$fv = \"\";\n\t\t\t\tif(!empty($filterKV)){\n\t\t\t\t\t$fv = @implode(\"&\",$filterKV);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$searchbaseUrl = ADMIN_ENC_URL.'/rides/display_rides?act=' . $ride_act.'&'.$fv.'&type='.$type.'&value='.$value;\n $config['num_links'] = 3;\n $config['display_pages'] = TRUE;\n $config['page_query_string'] = TRUE;\n $config['base_url'] = $searchbaseUrl;\n $config['total_rows'] = $rides_total->num_rows();\n $config[\"per_page\"] = $limit;\n $config[\"uri_segment\"] = 4;\n $config['first_link'] = '';\n $config['last_link'] = '';\n $config['full_tag_open'] = '<ul class=\"tsc_pagination tsc_paginationA tsc_paginationA01\">';\n $config['full_tag_close'] = '</ul>';\n if ($this->lang->line('pagination_prev_lbl') != '') $config['prev_link'] =stripslashes($this->lang->line('pagination_prev_lbl')); else $config['prev_link'] ='Prev';\n $config['prev_tag_open'] = '<li>';\n $config['prev_tag_close'] = '</li>';\n if ($this->lang->line('pagination_next_lbl') != '') $config['next_link'] =stripslashes($this->lang->line('pagination_next_lbl')); else $config['next_link'] ='Next';\n $config['next_tag_open'] = '<li>';\n $config['next_tag_close'] = '</li>';\n $config['cur_tag_open'] = '<li class=\"current\"><a href=\"javascript:void(0);\" style=\"cursor:default;\">';\n $config['cur_tag_close'] = '</a></li>';\n $config['num_tag_open'] = '<li>';\n $config['num_tag_close'] = '</li>';\n $config['first_tag_open'] = '<li>';\n $config['first_tag_close'] = '</li>';\n $config['last_tag_open'] = '<li>';\n $config['last_tag_close'] = '</li>';\n if ($this->lang->line('pagination_first_lbl') != '') $config['first_link'] =stripslashes($this->lang->line('pagination_first_lbl')); else $config['first_link'] ='First';\n if ($this->lang->line('pagination_last_lbl') != '') $config['last_link'] = stripslashes($this->lang->line('pagination_last_lbl')); else $config['last_link'] ='Last';\n $this->pagination->initialize($config);\n $paginationLink = $this->pagination->create_links();\n $this->data['paginationLink'] = $paginationLink;\n } else {\n $this->data['paginationLink'] = '';\n $this->data['ridesList'] = $ridesList = $this->rides_model->get_rides_list($ride_act, FALSE,FALSE,'',$filter_array,'',$filter_condition);\n }\n\t\t\t\n $this->data['offsetVal'] = $offsetVal;\n \n $cabCats = $this->rides_model->get_selected_fields(CATEGORY, array(), array('_id', 'name'))->result();\n $cabsTypeArr = array();\n foreach ($cabCats as $cab) {\n $cabId = (string) $cab->_id;\n $cabsTypeArr[$cabId] = $cab;\n }\n $this->data['cabCats'] = $cabsTypeArr;\n \n $this->data['locationsList'] = $this->rides_model->get_selected_fields(LOCATIONS, array('status' => 'Active'),array('city','_id'),array('city' => 1));\n \n if(isset($_GET['export']) && $_GET['export'] == 'excel'){\n $this->load->helper('export_helper');\n export_rides_list($ridesList,$ride_act);\n }\n $this->load->view(ADMIN_ENC_URL.'/rides/display_rides', $this->data);\n }\n }",
"function get_calendar_snippet($training_start_date)/* v. 1.00 */{\n ?>\n <script type=\"text/javascript\">(function () {\n if (window.addtocalendar)if(typeof window.addtocalendar.start == \"function\")return;\n if (window.ifaddtocalendar == undefined) { window.ifaddtocalendar = 1;\n var d = document, s = d.createElement('script'), g = 'getElementsByTagName';\n s.type = 'text/javascript';s.charset = 'UTF-8';s.async = true;\n s.src = ('https:' == window.location.protocol ? 'https' : 'http')+'://addtocalendar.com/atc/1.5/atc.min.js';\n var h = d[g]('body')[0];h.appendChild(s); }})();\n </script>\n <?php\n $endtime; \n $training_provider = \"LockoutSafety.com\";\n $contact_email = \"sales@lockoutsafety.com\";\n $training_description = 'Lockout Tagout Safety Awareness Training - Portlaoise';\n $time = $training_start_date;\n $endtime = date('d-m-Y', strtotime($time . ' + 1 day')); ?>\n <div class=\"g_addtocalendar\">\n\n <span class=\"addtocalendar atc-style-blue g_addtocal\">\n <var class=\"atc_event\">\n <var class=\"atc_date_start\"><?php echo $training_start_date.' 09:30:00';?></var>\n <var class=\"atc_date_end\"><?php echo $endtime.' 16:30:00';?></var>\n <var class=\"atc_timezone\">Europe/London</var>\n <var class=\"atc_title\"><?php echo 'Lockout Tagout Safety Awareness Training';?></var>\n <var class=\"atc_description\"><?php echo $training_description;?></var>\n <var class=\"atc_location\"><?php echo 'Maldron Hotel, Portlaoise, Co. Laois';?></var>\n <var class=\"atc_organizer\"><?php echo $training_provider;?></var>\n <var class=\"atc_organizer_email\"><?php echo $contact_email;?></var>\n </var>\n </span>\n\n </div>\n\n <?php\n}",
"function psn_timeline_manage( $args ) {\n\t?>\n\t<div class=\"wrap\">\n\t\t<?php psn_the_timeline( $args ); ?>\n\t</div>\n\t<?php \n}",
"public function getTrainertimes($date, $trainer) {\r\n //stores results set from DB\r\n $result = $this->database->getTraniersSchedule ( $date, $trainer );\r\n\r\n //counter for number of returned rows\r\n $count = mysqli_num_rows ( $result );\r\n\r\n // stores all returned rows as array elements\r\n $hourlySchedule = array ();\r\n while ( $row = $result->fetch_assoc () ) {\r\n array_push ( $hourlySchedule, $row );\r\n }\r\n\r\n for( $f=0; $f<sizeof($hourlySchedule); $f++){\r\n if(isset($hourlySchedule[$f]['dates']) && $hourlySchedule[$f]['dates'] != $hourlySchedule[$f]['date']){\r\n \r\n $hourlySchedule[$f]['startTimes']=0;\r\n }\r\n }\r\n\r\n // stores trainers ids including duplicates\r\n $trainersIds = array ();\r\n\r\n foreach ( $hourlySchedule as &$value ) {\r\n array_push ( $trainersIds, $value ['memberId'] );\r\n }\r\n\r\n // count number of each trainer records returned.\r\n $noOfRowsForEachTrainer = array_count_values ( $trainersIds );\r\n\r\n // removes duplicates in trainer ids\r\n $trainersIds = array_unique ( $trainersIds );\r\n\r\n // stores unique trainers ids(with restored indexes)\r\n $uniqueTrainers = array ();\r\n $j = 0;\r\n\r\n foreach ( $trainersIds as $key => $valuex ) {\r\n if (! is_null ( $key )) {\r\n $uniqueTrainers [$j] = $valuex;\r\n $j ++;\r\n }\r\n }\r\n\r\n echo ' <table >';\r\n\r\n echo '<tr>';\r\n echo '<th>' . 'Time' . '</th> ';\r\n \r\n for($x = 1; $x <= count ( $trainersIds ); $x ++) {\r\n //display trainer image on the top of table\r\n echo '<th><img class=\"bookingPhoto\" width=\"150\" height=\"200\" src=\"assets/img/profilePhotos/'. $uniqueTrainers[$x-1] .'.png\" alt=\"'. $hourlySchedule[$x-1]['fName'].' ' . $hourlySchedule[$x-1]['lName'] .'\"></th> ';\r\n }\r\n echo ' <tr>';\r\n\r\n $arr = array (9, 10, 11, 12, 13, 14, 15, 16, 17, 18);\r\n\r\n //starts every row of the table\r\n foreach ( $arr as &$value ) {\r\n\r\n echo '<tr>';\r\n echo '<td>' . $value . '</td> ';\r\n\r\n //starts column for every trainer\r\n foreach ( $uniqueTrainers as $trId ) {\r\n \r\n $countUniqueId = 0;\r\n //checks for trainer's status at specific time\r\n for($c = 0; $c < $count; $c ++) {\r\n\r\n //checks if result row is for specified trainer\r\n if ($hourlySchedule [$c] ['memberId'] == $trId) {\r\n $countUniqueId ++;\r\n\r\n //checks if trainer is working at specified time\r\n if (($hourlySchedule [$c] ['startTime'] <= $value) && ($value < $hourlySchedule [$c] ['startTime'] + $hourlySchedule [$c] ['noOfHours'])) {\r\n\r\n //checks if trainer time slot is booked/free\r\n if ($hourlySchedule [$c] ['startTimes'] == $value) {\r\n echo '<td>' . '<span class=\"tdBooked\">Booked</span>' . '</td> ';\r\n break; // for loop\r\n } else if ($hourlySchedule [$c] ['startTimes'] >= $value) {\r\n echo '<td><a class=\"tdBook\"onclick=\"init(this);\" href=\"index.php?booked='.$trId .'&time=' . $value .'&dates='.$date.'\">Book Now</a></td> ';\r\n break;\r\n } else if ($countUniqueId == $noOfRowsForEachTrainer [$trId]) {\r\n echo '<td><a class=\"tdBook\" onclick=\"init(this);\" href=\"index.php?booked='.$trId .'&time=' . $value .'&dates='.$date.'\">Book Now</a></td> ';\r\n break;\r\n }\r\n } else {\r\n echo '<td><span class=\"tdNotWorking\">Not Working</span></td>';\r\n break; // for loop\r\n }\r\n }\r\n }\r\n }\r\n echo '</tr>';\r\n }\r\n echo ' </table>';\r\n }",
"function theme_litecal_timeslot($timespan, $start, $date, $format, $quickadd = array()) {\n $add = '';\n $attr = array('style' => '');\n $link_attr = array('class' => 'label');\n\n // Position\n if ($start < $timespan->granularity - 1) {\n $attr['style'] .= ' left:'. number_format($start / $timespan->granularity * 100, 2) .'%;';\n }\n // We position last items differently since slots often use borders and need tight alignment.\n else {\n $attr['style'] .= ' right:0%;';\n }\n\n // Width\n $attr['style'] .= ' width:'. number_format(1 / $timespan->granularity * 100, 2) .'%';\n\n // Classes\n $attr['class'] = 'litecal-slot rows-'. count($timespan->built);\n\n // Add class for today's slot.\n static $today;\n $today = !isset($today) ? date_format_date(date_now(), 'custom', 'Y-m-d') : $today;\n if ($today == date_format_date($date, 'custom', 'Y-m-d')) {\n $attr['class'] .= ' litecal-slot-today';\n }\n\n // If this timeslot is outside of the timespan's real time range,\n // add a class so it can be displayed accordingly.\n if (!litecal_date_between($date, $timespan->real_from, $timespan->real_to)) {\n $attr['class'] .= ' litecal-slot-gutter';\n }\n\n $attr = drupal_attributes($attr);\n\n // Quickadd\n if (!empty($quickadd['type'])) {\n $type = str_replace('_', '-', $quickadd['type']);\n $item = menu_get_item(\"node/add/{$type}\");\n if ($item && $item['access']) {\n $options = array('query' => \"edit[{$quickadd['field']}][0][value]=\". date_convert($date, DATE_OBJECT, DATE_ISO) .\"&destination=\" . $_GET['q']);\n $link_attr['href'] = url(\"node/add/{$type}\", $options);\n $add = \"<span class='add'>\". t('+ Add') .\"</span>\";\n }\n }\n $link_attr = drupal_attributes($link_attr);\n\n $formatted = date_format_date($date, 'custom', $format);\n\n return \"<div {$attr}>\n <a $link_attr>{$add}<span class='num'>{$formatted}</span></a>\n </div>\";\n}",
"public function dailyUserRecognizedActivity($uid,$starttime,$endtime){\n\n\nglobal $dclserver;\n$url=\"$dclserver/MMDataCurationRestfulService/webresources/InformationCuration/GetUserRecognizedActivity\";\n\t\n//$dclserver/MMDataCurationRestfulService/webresources/InformationCuration/GetUserRecognizedActivityAccumulate\n//$starttime=\"2015 05 04 01:00:04.000\";\n//$endtime=\"2015 05 04 01:59:59.000\";\n\n\n\t$data = array(\"userId\"=>$uid,\n\t\"startTime\"=>$starttime,\n\t\"endTime\"=>$endtime,\n\t\t\n\t\t);\n\t\t\n\t$json = json_encode($data,true);\n\t\n\t$result =$this->postJsonRest($url,$json);\n\treturn $result;\n\n}",
"public function getRecommendation($uid,$startdate,$enddate){\n\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\tglobal $dclserver;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$url=\"$dclserver/MMDataCurationRestfulService/webresources/ServiceCuration/RetrieveRecommendationByUserIDDate\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\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$data = array(\"userID\"=>$uid,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"startDate\"=>$startdate,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"endDate\"=>$enddate,\n\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\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//print_r($data);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$json = json_encode($data,true);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$result =$this->postJsonRest($url,$json);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn $result;\n\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\n\t\t\t\t\t\t\t\t\t\t\t\t\t}",
"public function getAllTimeline() {\n //$stmt = $this->conn->prepare(\"SELECT mt.username, mt.kd_mintol, mt.judul,mt.deskripsi,k.nama_kategori,mt.foto FROM kon_kat_mintol kkm INNER JOIN minta_tolong mt ON kkm.kd_mintol=mt.kd_mintol LEFT JOIN kategori k ON kkm.kd_kategori=k.kd_kategori\");\n\t\t$stmt = $this->conn->prepare(\"SELECT mt.username, mt.kd_mintol, mt.judul,mt.deskripsi,k.nama_kategori,mt.foto FROM kon_kat_mintol kkm INNER JOIN minta_tolong mt ON kkm.kd_mintol=mt.kd_mintol LEFT JOIN trx_pertolongan tp ON mt.kd_mintol=tp.kd_mintol LEFT JOIN kategori k ON kkm.kd_kategori=k.kd_kategori WHERE mt.status=0 GROUP BY mt.kd_mintol ORDER BY mt.createAt DESC \");\n $stmt->execute();\n $timeline = $stmt->get_result();\n $stmt->close();\n return $timeline;\n }",
"function futureStudentAppointments(){\n\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 get_myagenda_items($user_id,$userCourseList,$refMonth,$refDay,$refYear,$cmd)\n{\n $items = array();\n\t$agendaEventList = array();\n\n\tif ($cmd=='yearview')\n\t{\n\t\t$start_date_filter \t= \">= '\". date('Y-01-01 00:00:00',mktime(0,0,0,$refMonth,$refDay,$refYear)) .\"'\";\n\t\t$end_date_filter\t= \"<= '\". date('Y-12-31 23:59:59',mktime(0,0,0,$refMonth,$refDay,$refYear+1)) .\"'\";\n\t}\n\tif ($cmd=='monthview')\n\t{\n\t\t$start_date_filter \t= \">= '\". date('Y-m-01 00:00:00',mktime(0,0,0,$refMonth,$refDay,$refYear)) .\"'\";\n\t\t$end_date_filter\t= \"<= '\". date('Y-m-31 23:59:59',mktime(0,0,0,$refMonth+1,$refDay,$refYear)) .\"'\";\n\t}\n\tif ($cmd=='weekview')\n\t{\n\t\t$start_date_filter \t= \">= '\". date('Y-m-d 00:00:00',mktime(0,0,0,$refMonth,$refDay,$refYear)) .\"'\";\n\t\t$end_date_filter\t= \"<= '\". date('Y-m-d 23:59:59',mktime(0,0,0,$refMonth,$refDay+7,$refYear)) .\"'\";\n\t}\n\tif ($cmd=='dayview')\n\t{\n\t\t$start_date_filter \t= \">= '\". date('Y-m-d 00:00:00',mktime(0,0,0,$refMonth,$refDay,$refYear)) .\"'\";\n\t\t$end_date_filter\t= \"<= '\". date('Y-m-d 23:59:59',mktime(0,0,0,$refMonth,$refDay+1,$refYear)) .\"'\";\n\t}\n\tif ($cmd=='listview')\n\t{\n\t\t$start_date_filter \t= 'LIKE \\'____-__-__ __:__:__\\'';\n\t\t$end_date_filter\t= 'LIKE \\'____-__-__ __:__:__\\'';\n\t}\n\n\tif ($cmd=='yearview' || $cmd=='monthview' || $cmd=='weekview' || $cmd=='dayview' || $cmd=='listview')\n\t{\n\t\t// get agenda-items for every course\n\t\tforeach( $userCourseList as $thisCourse) //for each course where the user is registred\n\t\t{\n\t\t\t$cours_talbes_names = claro_get_course_db_name_glued($thisCourse['sysCode']);\n\t\t\t$tbl_cdb_names = claro_sql_get_course_tbl($cours_talbes_names);\n\t\n\t\t\t$tbl_groupUser = $tbl_cdb_names['group_rel_team_user'];\n\t\t\t$sql = \"SELECT team\n\t\t\t\tFROM \" . $tbl_groupUser . \"\n\t\t\t\tWHERE user = \" .(int) $user_id;\n\t\t\t$user_group_list = claro_sql_query_fetch_all($sql);//get al courses groups where the user is registred\n\t\n\t\n\t\t\t$tbl = get_conf('mainTblPrefix') . 'event AS event' . ' INNER JOIN ' \n\t\t\t\t. get_conf('mainTblPrefix') . 'rel_event_recipient AS rel_event_recipient' \n\t\t\t\t. ' ON event.id = rel_event_recipient.event_id';\n\t\n\t\t\t$sql = \"SELECT event.id \t\t\t\t\t\tAS id,\n\t\t\t\t\t\t event.title \t\t\t\t\t\tAS title,\n\t\t\t\t\t\t event.description \t\t\t\tAS description,\n\t\t\t\t\t\t event.start_date \t\t\t\tAS start_date,\n\t\t\t\t\t\t event.end_date \t\t\t\t\tAS end_date,\n\t\t\t\t\t\t event.author_id \t\t\t\t\tAS author_id,\n\t\t\t\t\t\t rel_event_recipient.visibility \tAS visibility\n\t\t\t\t\tFROM \" . $tbl . \"\n\t\t\t\t\tWHERE ( visibility = 'SHOW'\n\t\t\t\t\t\t\tAND rel_event_recipient.course_id = '\" . $thisCourse['sysCode'] .\"'\n\t\t\t\t\t\t\tAND rel_event_recipient.user_id is NULL\n\t\t\t\t\t\t\tAND rel_event_recipient.group_id is NULL\n\t\t\t\t\t\t\tAND event.start_date \". $start_date_filter .\"\n\t\t\t\t\t\t\tAND event.end_date \". $end_date_filter .\")\n\t\t\t\t\t\t OR\n\t\t\t\t\t\t ( visibility = 'SHOW'\n\t\t\t\t\t\t\tAND rel_event_recipient.course_id = '\" . $thisCourse['sysCode'] .\"'\n\t\t\t\t\t\t\tAND rel_event_recipient.user_id = \". (int) $user_id .\"\n\t\t\t\t\t\t\tAND event.start_date \". $start_date_filter .\"\n\t\t\t\t\t\t\tAND event.end_date \". $end_date_filter .\")\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tforeach($user_group_list as $this_user_group)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$sql .=\"OR (visibility = 'SHOW'\n\t\t\t\t\t\t\t\t\t\tAND rel_event_recipient.course_id = '\" . $thisCourse['sysCode'] .\"'\n\t\t\t\t\t\t\t\t\t\tAND rel_event_recipient.user_id is NULL\n\t\t\t\t\t\t\t\t\t\tAND rel_event_recipient.group_id = \". (int) $this_user_group['team'] .\"\n\t\t\t\t\t\t\t\t\t\tAND event.start_date \". $start_date_filter .\"\n\t\t\t\t\t\t\t\t\t\tAND event.end_date \". $end_date_filter .\")\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t$sql .= \"ORDER BY event.start_date ASC\";\n\t\n\t\t\t$courseEventList = claro_sql_query_fetch_all($sql);//get all course events and user shared events\n\t\n\t\t\tif ( is_array($courseEventList) && !empty($courseEventList))\n\t\t\t{\n\t\t\t\tforeach($courseEventList as $thisEvent ) \n\t\t\t\t{\n\t\t\t\t\t$eventLine = trim(strip_tags($thisEvent['title']));\n\t\t\n\t\t\t\t\tif ( $eventLine == '' )\n\t\t\t\t\t{\n\t\t\t\t\t\t$eventContent = trim(strip_tags($thisEvent['description']));\n\t\t\t\t\t\t$eventLine = substr($eventContent, 0, 60) . (strlen($eventContent) > 60 ? ' (...)' : '');\n\t\t\t\t\t}\n\t\t\t\n\t\t\t\t\t$url = '<a href=\"./../CLAG2/agenda.php?cidReq=' . $thisCourse['sysCode'] .'\">'\n\t\t\t\t\t\t.\t$thisCourse['officialCode']\n\t\t\t\t\t\t.\t'</a>';\n\t\t\t\t\t$eventStart = new claroDate($thisEvent['start_date']);\n\t\t\t\t\t$eventEnd \t= new claroDate($thisEvent['end_date']);\n\t\t\t\t\tif ($thisEvent['id']!=NULL) \n\t\t\t\t\t{\n\t\t\t\t\t\t$agendaEventList[] = new claroEvent( $eventStart, $thisEvent['title'],$thisEvent['description'],$eventEnd,$thisEvent['author_id'],$url);\n\t\t\t\t\t}\n\t\t\t\t} // end foreach courseEventList\n\t\t\t}\n\t\t}\n\t\t$tbl = get_conf('mainTblPrefix') . 'event AS event' . ' INNER JOIN ' \n\t\t\t. get_conf('mainTblPrefix') . 'rel_event_recipient AS rel_event_recipient' \n\t\t\t. ' ON event.id = rel_event_recipient.event_id';\n\t\n\t\t$sql = \"SELECT event.id \t\t\t\t\t\tAS id,\n\t\t\t\t\t event.title \t\t\t\t\t\tAS title,\n\t\t\t\t\t event.description \t\t\t\tAS description,\n\t\t\t\t\t event.start_date \t\t\t\tAS start_date,\n\t\t\t\t\t event.end_date \t\t\t\t\tAS end_date,\n\t\t\t\t\t event.author_id \t\t\t\t\tAS author_id,\n\t\t\t\t\t rel_event_recipient.visibility \tAS visibility,\n\t\t\t\t\t event.master_event_id \t\t\tAS master_event_id\n\t\t\t\tFROM \" . $tbl . \"\n\t\t\t\tWHERE event.author_id =\" . (int) $user_id .\"\n\t\t\t\t\tAND rel_event_recipient.user_id =\" . (int) $user_id .\"\n\t\t\t\t\tAND rel_event_recipient.course_id is NULL\n\t\t\t\t\tAND event.start_date \". $start_date_filter .\"\n\t\t\t\t\tAND event.end_date \". $end_date_filter .\"\n ORDER BY event.start_date ASC\";\n\t\t$userEventList = claro_sql_query_fetch_all($sql); //get all personal events\n\t\n\t\tif(!empty($userEventList))\n\t\t{\n\t\t\tforeach($userEventList as $thisEvent )\n\t\t\t{\n\t\t\t\t$eventLine = trim(strip_tags($thisEvent['title']));\n\t\t\n\t\t\t\tif ( $eventLine == '' )\n\t\t\t\t{\n\t\t\t\t\t$eventContent = trim(strip_tags($thisEvent['description']));\n\t\t\t\t\t$eventLine = substr($eventContent, 0, 60) . (strlen($eventContent) > 60 ? ' (...)' : '');\n\t\t\t\t}\n\t\t\n\t\t\t\t$url = \t'<a href=\"' . $_SERVER['PHP_SELF'] . '?cmd=exuserDelete&id=' . $thisEvent['id'] . '\" '\n\t\t\t\t\t. 'onclick=\"javascript:if(!confirm(\\''\n\t\t\t\t\t. clean_str_for_javascript(get_lang('Delete') . ' ' . $thisEvent['title'].' ?')\n\t\t\t\t\t. '\\')) {document.location=\\'' . $_SERVER['PHP_SELF'] . '\\'; return false}\" >'\n\t\t\t\t\t. '<img src=\"./img/delete.gif\" border=\"0\" alt=\"' . get_lang('Delete') . '\" />'\n\t\t\t\t\t. '</a>'\n\t\t\t\t\t.\t'<a href=\"' . $_SERVER['PHP_SELF'].'?cmd=rquserEdit&id=' . $thisEvent['id'] . '\">'\n\t\t\t\t\t.\t'<img src=\"./img/edit.gif\" border=\"O\" alt=\"' . get_lang('Modify') . '\">'\n\t\t\t\t\t. '</a> ';\n\t\t\t\tif ($thisEvent['master_event_id']!=NULL)\n\t\t\t\t{\n\t\t\t\t\t$url .=\t '<a href=\"' . $_SERVER['PHP_SELF'] . '?cmd=exuserDelete&id=' . $thisEvent['id'] . '&delete_item=all\" '\n\t\t\t\t\t\t. 'onclick=\"javascript:if(!confirm(\\''\n\t\t\t\t\t\t. clean_str_for_javascript(get_lang('Delete all related events') . ' ' . $thisEvent['title'].' ?')\n\t\t\t\t\t\t. '\\')) {document.location=\\'' . $_SERVER['PHP_SELF'] . '\\'; return false}\" >'\n\t\t\t\t\t\t. '<img src=\"./img/deleteall.gif\" border=\"0\" alt=\"' . get_lang('Delete all related events') . '\" />'\n\t\t\t\t\t\t. '</a>'\n\t\t\t\t\t\t;\t\n\t\t\t\t}\n\t\t\t\t$eventStart = new claroDate($thisEvent['start_date']);\n\t\t\t\t$eventEnd \t= new claroDate($thisEvent['end_date']);\n\t\t\t\tif ($thisEvent['id']!=NULL) \n\t\t\t\t{\n\t\t\t\t\t$agendaEventList[] = new claroEvent( $eventStart, $thisEvent['title'],$thisEvent['description'],$eventEnd,$thisEvent['author_id'],$url,TRUE);\n\t\t\t\t}\n\t\t\t} // end foreach courseEventList\n\t\t}\n\t}\n return $agendaEventList;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Extracts the package archive file | public function extractArchive() {
$base_Dir =JPath::clean( JPATH_BASE. '/media' );
$archivename = $base_Dir . $this->_realname;
$tmpdir = uniqid( 'install_' );
$extractdir =JPath::clean( $base_Dir . $tmpdir );
$archivename =JPath::clean( $archivename, false );
$this->_unpackdir = $extractdir;
if (preg_match( '/.zip$/', $archivename )) {
// Extract functions
require_once( JPATH_ADMINISTRATOR . '/includes/pcl/pclzip.lib.php' );
require_once( JPATH_ADMINISTRATOR. '/includes/pcl/pclerror.lib.php' );
$zipfile = new PclZip( $this->_uploadfile );
if($this->_iswin) {
define('OS_WINDOWS',1);
} else {
define('OS_WINDOWS',0);
}
$ret = $zipfile->extract( PCLZIP_OPT_PATH, $extractdir );
if($ret == 0) {
$this->errno = 1;
$this->error = 'Unrecoverable error "'.$zipfile->errorName(true).'"';
return false;
}
} else {
require_once( JPATH_SITE . '/includes/Archive/Tar.php' );
$archive = new Archive_Tar( $this->_uploadfile );
$archive->setErrorHandling( PEAR_ERROR_PRINT );
if (!$archive->extractModify( $extractdir, '' )) {
$this->setError( 1, 'Extract Error' );
return false;
}
}
// Try to find the correct install dir. in case that the package have subdirs
// Save the install dir for later cleanup
jimport('joomla.filesystem.folder');
$this->_uploadfile =JFolder::files($extractdir, '' );
if (count( $this->_uploadfile ) == 1) {
if (is_dir( $extractdir . $this->_uploadfile[0] )) {
$this->_unpackdir =JPath::clean( $extractdir . $this->_uploadfile[0] );
$this->_uploadfile = JFolder::files( $extractdir, '' );
}
}
return true;
} | [
"private function extractZipFile()\n {\n if (! file_exists('/tmp/' . self::VERSION)) {\n throw new \\Exception(\"Release file not found\");\n }\n \n $file = new \\ZipArchive();\n $file->open('/tmp/' . self::VERSION);\n \n if (! $file->extractTo($this->target)) {\n throw new \\Exception(\"Cannot extract Fennec CMS to {$this->target}\");\n }\n }",
"function unpack($p_filename)\n\t{\n\t\t/*\n\t\t * Initialize variables\n\t\t */\n\t\t// Base installation path\n\t\t$base_Dir = JPath::clean(JPATH_SITE.DS.'media');\n\t\t// Path to the archive\n\t\t$archivename = $base_Dir.$p_filename;\n\t\t// Temporary folder to extract the archive into\n\t\t$tmpdir = uniqid('install_');\n\n\t\t// Clean the paths to use for archive extraction\n\t\t$extractdir = JPath::clean($base_Dir.$tmpdir);\n\t\t$archivename = JPath::clean($archivename, false);\n\n\t\t/*\n\t\t * Are we working with a zipfile?\n\t\t */\n\t\tif (eregi('.zip$', $archivename))\n\t\t{\n\n\t\t\t/*\n\t\t\t * Import the zipfile libraries\n\t\t\t */\n\t\t\tjimport('pcl.pclzip');\n\t\t\tjimport('pcl.pclerror');\n\t\t\t//jimport('pcl.pcltrace');\n\n\t\t\t/*\n\t\t\t * Create a zipfile object\n\t\t\t */\n\t\t\t$zipfile = new PclZip($archivename);\n\n\t\t\t// Constants used by the zip library\n\t\t\tif (JPATH_ISWIN)\n\t\t\t{\n\t\t\t\tdefine('OS_WINDOWS', 1);\n\t\t\t} else\n\t\t\t{\n\t\t\t\tdefine('OS_WINDOWS', 0);\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * Now its time to extract the archive\n\t\t\t */\n\t\t\tif ($zipfile->extract(PCLZIP_OPT_PATH, $extractdir) == 0)\n\t\t\t{\n\t\t\t\t// Unable to extract the archive, set an error and fail\n\t\t\t\tJError::raiseWarning(1, JText::_('Unrecoverable error').' \"'.$zipfile->errorName(true).'\"');\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Free up PCLZIP memory\n\t\t\tunset ($zipfile);\n\t\t} else\n\t\t{\n\n\t\t\t/*\n\t\t\t * Not a zipfile, must be a tarball. Lets import that library.\n\t\t\t */\n\t\t\tjimport('archive.Tar');\n\n\t\t\t/*\n\t\t\t * Create a tarball object\n\t\t\t */\n\t\t\t$archive = new Archive_Tar($archivename);\n\n\t\t\t// Set the tar error handling\n\t\t\t$archive->setErrorHandling(PEAR_ERROR_PRINT);\n\n\t\t\t/*\n\t\t\t * Now its time to extract the archive\n\t\t\t */\n\t\t\tif (!$archive->extractModify($extractdir, ''))\n\t\t\t{\n\t\t\t\t// Unable to extract the archive, set an error and fail\n\t\t\t\tJError::raiseWarning(1, JText::_('Extract Error'));\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Free up PCLTAR memory\n\t\t\tunset ($archive);\n\t\t}\n\n\t\t/*\n\t\t * Lets set the extraction directory in the result array so we can\n\t\t * cleanup everything properly later on.\n\t\t */\n\t\t$retval['extractdir'] = $extractdir;\n\n\t\t/*\n\t\t * Try to find the correct install directory. In case the package is inside a\n\t\t * subdirectory detect this and set the install directory to the correct path.\n\t\t *\n\t\t * List all the items in the installation directory. If there is only one, and\n\t\t * it is a folder, then we will set that folder to be the installation folder.\n\t\t */\n\t\t$dirList = array_merge(JFolder::files($extractdir, ''), JFolder::folders($extractdir, ''));\n\n\t\tif (count($dirList) == 1)\n\t\t{\n\t\t\tif (JFolder::exists($extractdir.$dirList[0]))\n\t\t\t{\n\t\t\t\t$extractdir = JPath::clean($extractdir.$dirList[0]);\n\t\t\t}\n\t\t}\n\n\t\t/*\n\t\t * We have found the install directory so lets set it and then move on\n\t\t * to detecting the extension type.\n\t\t */\n\t\t$retval['dir'] = $extractdir;\n\n\t\t/*\n\t\t * Get the extension type and return the directory/type array on success or\n\t\t * false on fail.\n\t\t */\n\t\tif ($retval['type'] = JInstallerHelper::detectType($extractdir))\n\t\t{\n\t\t\treturn $retval;\n\t\t} else\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}",
"function extractPackage($package);",
"protected function extract()\n {\n try {\n $distill = new Distill();\n $extractionSucceeded = $distill->extractWithoutRootDirectory($this->majoraDownloader->getDestinationFile(), $this->destinationPath);\n } catch (FileCorruptedException $e) {\n $this->clean(true);\n throw new \\RuntimeException(sprintf(\n \"Majora Standard Edition can't be installed because the downloaded package is corrupted\"\n ));\n } catch (FileEmptyException $e) {\n $this->clean(true);\n throw new \\RuntimeException(sprintf(\n \"Majora Standard Edition can't be installed because the downloaded package is empty\"\n ));\n } catch (TargetDirectoryNotWritableException $e) {\n $this->clean(true);\n throw new \\RuntimeException(sprintf(\n \"Majora Standard Edition can't be installed because the installer doesn't have enough\\n\".\n 'permissions to uncompress and rename the package contents.'\n ));\n } catch (\\Exception $e) {\n $this->clean(true);\n throw new \\RuntimeException(sprintf(\n \"Majora Standard Edition can't be installed because the downloaded package is corrupted\\n\".\n \"or because the installer doesn't have enough permissions to uncompress and\\n\".\n \"rename the package contents.\\n\".\n 'To solve this issue, check the permissions of the %s directory',\n getcwd()\n ), null, $e);\n }\n\n if (!$extractionSucceeded) {\n $this->clean(true);\n throw new \\RuntimeException(sprintf(\n \"Majora Standard Edition can't be installed because the downloaded package is corrupted\\n\".\n \"or because the uncompress commands of your operating system didn't work.\"\n ));\n }\n }",
"public function extract($args) {\n\t\t$executor = $this->executor;\n\n\t\t$args->requireUnnamed(array('source sspak file'));\n\t\t$unnamedArgs = $args->getUnnamedArgs();\n\t\t$file = $unnamedArgs[0];\n\t\t$dest = !empty($unnamedArgs[1]) ? $unnamedArgs[1] : getcwd();\n\n\t\t// Phar and PharData use \"ustar\" format for tar archives (http://php.net/manual/pl/phar.fileformat.tar.php).\n\t\t// Ustar does not support files larger than 8 GB.\n\t\t// If the sspak has been created through tar and gz directly, it will probably be in POSIX, PAX or GNU formats,\n\t\t// which do support >8 GB files. Such archive cannot be accessed by Phar/PharData, and needs to be handled\n\t\t// manually - it will just spew checksum errors where PHP expects to see ustar headers, but finds garbage\n\t\t// from other formats.\n\t\t// There is no cross-platform way of checking the assets.tar.gz size without unpacking, so we assume the size\n\t\t// of database is negligible which lets us approximate the size of assets.\n\t\tif (filesize($file) > 8*1024*1024*1024) {\n\t\t\t$msg = <<<EOM\n\nERROR: SSPak is unable to extract archives over 8 GB.\n\nPacked asset or database sizes over 8 GB are not supported due to PHP Phar library limitations.\nYou can still access your data directly by using the tar utility:\n\n\ttar xzf \"%s\"\n\nThis tool is sorry for the inconvenience and stands aside in disgrace.\nSee http://silverstripe.github.io/sspak/, \"Manual access\" for more information.\n\nEOM;\n\t\t\tprintf($msg, $file);\n\t\t\tdie(1);\n\t\t}\n\n\t\t$sspak = new SSPakFile($file, $executor);\n\n\t\t// Validation\n\t\tif(!$sspak->exists()) throw new Exception(\"File '$file' doesn't exist.\");\n\n\t\t$phar = $sspak->getPhar();\n\t\t$phar->extractTo($dest);\n\t}",
"function unpack($p_filename)\n\t{\n\t\t// Path to the archive\n\t\t$archivename = $p_filename;\n\n\t\t// Temporary folder to extract the archive into\n\t\t$tmpdir = uniqid('install_');\n\n\t\t// Clean the paths to use for archive extraction\n\t\t$extractdir = JPath::clean(dirname($p_filename).DS.$tmpdir);\n\t\t$archivename = JPath::clean($archivename);\n\n\t\t// do the unpacking of the archive\n\t\t$result = JArchive::extract( $archivename, $extractdir);\n\n\t\tif ( $result === false ) {\n\t\t\treturn false;\n\t\t}\n\n\n\t\t/*\n\t\t * Lets set the extraction directory and package file in the result array so we can\n\t\t * cleanup everything properly later on.\n\t\t */\n\t\t$retval['extractdir'] = $extractdir;\n\t\t$retval['packagefile'] = $archivename;\n\n\t\t/*\n\t\t * Try to find the correct install directory. In case the package is inside a\n\t\t * subdirectory detect this and set the install directory to the correct path.\n\t\t *\n\t\t * List all the items in the installation directory. If there is only one, and\n\t\t * it is a folder, then we will set that folder to be the installation folder.\n\t\t */\n\t\t$dirList = array_merge(JFolder::files($extractdir, ''), JFolder::folders($extractdir, ''));\n\n\t\tif (count($dirList) == 1)\n\t\t{\n\t\t\tif (JFolder::exists($extractdir.DS.$dirList[0]))\n\t\t\t{\n\t\t\t\t$extractdir = JPath::clean($extractdir.DS.$dirList[0]);\n\t\t\t}\n\t\t}\n\n\t\t/*\n\t\t * We have found the install directory so lets set it and then move on\n\t\t * to detecting the extension type.\n\t\t */\n\t\t$retval['dir'] = $extractdir;\n\n\t\t/*\n\t\t * Get the extension type and return the directory/type array on success or\n\t\t * false on fail.\n\t\t */\n\t\tif ($retval['type'] = PagesAndItemsInstallerHelper::detectType($extractdir))\n\t\t{\n\t\t\treturn $retval;\n\t\t} else\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}",
"function extract()\n {\n $v_result=1;\n\n // ----- Reset the error handler\n $this->privErrorReset();\n\n // ----- Check archive\n if (!$this->privCheckFormat()) {\n return(0);\n }\n\n // ----- Set default values\n $v_options = array();\n// $v_path = \"./\";\n $v_path = '';\n $v_remove_path = \"\";\n $v_remove_all_path = false;\n\n // ----- Look for variable options arguments\n $v_size = func_num_args();\n\n // ----- Default values for option\n $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE;\n\n // ----- Look for arguments\n if ($v_size > 0) {\n // ----- Get the arguments\n $v_arg_list = func_get_args();\n\n // ----- Look for first arg\n if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) {\n\n // ----- Parse the options\n $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options,\n array (PCLZIP_OPT_PATH => 'optional',\n PCLZIP_OPT_REMOVE_PATH => 'optional',\n PCLZIP_OPT_REMOVE_ALL_PATH => 'optional',\n PCLZIP_OPT_ADD_PATH => 'optional',\n PCLZIP_CB_PRE_EXTRACT => 'optional',\n PCLZIP_CB_POST_EXTRACT => 'optional',\n PCLZIP_OPT_SET_CHMOD => 'optional',\n PCLZIP_OPT_BY_NAME => 'optional',\n PCLZIP_OPT_BY_EREG => 'optional',\n PCLZIP_OPT_BY_PREG => 'optional',\n PCLZIP_OPT_BY_INDEX => 'optional',\n PCLZIP_OPT_EXTRACT_AS_STRING => 'optional',\n PCLZIP_OPT_EXTRACT_IN_OUTPUT => 'optional',\n PCLZIP_OPT_REPLACE_NEWER => 'optional'\n ,PCLZIP_OPT_STOP_ON_ERROR => 'optional'\n ,PCLZIP_OPT_EXTRACT_DIR_RESTRICTION => 'optional',\n PCLZIP_OPT_TEMP_FILE_THRESHOLD => 'optional',\n PCLZIP_OPT_TEMP_FILE_ON => 'optional',\n PCLZIP_OPT_TEMP_FILE_OFF => 'optional'\n\t\t\t\t\t\t\t\t\t\t\t\t ));\n if ($v_result != 1) {\n return 0;\n }\n\n // ----- Set the arguments\n if (isset($v_options[PCLZIP_OPT_PATH])) {\n $v_path = $v_options[PCLZIP_OPT_PATH];\n }\n if (isset($v_options[PCLZIP_OPT_REMOVE_PATH])) {\n $v_remove_path = $v_options[PCLZIP_OPT_REMOVE_PATH];\n }\n if (isset($v_options[PCLZIP_OPT_REMOVE_ALL_PATH])) {\n $v_remove_all_path = $v_options[PCLZIP_OPT_REMOVE_ALL_PATH];\n }\n if (isset($v_options[PCLZIP_OPT_ADD_PATH])) {\n // ----- Check for '/' in last path char\n if ((strlen($v_path) > 0) && (substr($v_path, -1) != '/')) {\n $v_path .= '/';\n }\n $v_path .= $v_options[PCLZIP_OPT_ADD_PATH];\n }\n }\n\n // ----- Look for 2 args\n // Here we need to support the first historic synopsis of the\n // method.\n else {\n\n // ----- Get the first argument\n $v_path = $v_arg_list[0];\n\n // ----- Look for the optional second argument\n if ($v_size == 2) {\n $v_remove_path = $v_arg_list[1];\n }\n else if ($v_size > 2) {\n // ----- Error log\n PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, \"Invalid number / type of arguments\");\n\n // ----- Return\n return 0;\n }\n }\n }\n\n // ----- Look for default option values\n $this->privOptionDefaultThreshold($v_options);\n\n // ----- Trace\n\n // ----- Call the extracting fct\n $p_list = array();\n $v_result = $this->privExtractByRule($p_list, $v_path, $v_remove_path,\n\t $v_remove_all_path, $v_options);\n if ($v_result < 1) {\n unset($p_list);\n return(0);\n }\n\n // ----- Return\n return $p_list;\n }",
"private function extract(): void\n {\n if (file_exists($this->tmpDir) && is_dir($this->tmpDir)) {\n $this->rrmdir($this->tmpDir);\n }\n\n mkdir($this->tmpDir);\n\n $this->zipClass->open($this->path);\n $this->zipClass->extractTo($this->tmpDir);\n\n $index = 1;\n while (false !== $this->zipClass->locateName($this->getHeaderName($index))) {\n $this->tempDocumentHeaders[$index] = $this->readPartWithRels($this->getHeaderName($index));\n $index++;\n }\n $index = 1;\n while (false !== $this->zipClass->locateName($this->getFooterName($index))) {\n $this->tempDocumentFooters[$index] = $this->readPartWithRels($this->getFooterName($index));\n $index++;\n }\n\n $this->tempDocumentMainPart = $this->readPartWithRels($this->getMainPartName());\n\n $this->tempDocumentContentTypes = $this->zipClass->getFromName($this->getDocumentContentTypesName());\n\n $this->document = file_get_contents(sprintf('%s%sword%sdocument.xml', $this->tmpDir, DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR));\n }",
"protected function package()\n {\n $this->newline('Creating archive file...');\n $rootPath = str_replace('\\\\', '/', base_path());\n $archiveFile = dirname($rootPath) . '/laravel.zip';\n $archive = new ZipArchive();\n\n if ($archive->open($archiveFile, ZipArchive::CREATE | ZipArchive::OVERWRITE)) {\n $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($rootPath, RecursiveIteratorIterator::LEAVES_ONLY));\n foreach ($files as $name => $file) {\n $filePath = $file->getRealPath();\n // Format file name by removing root path\n // and replacing backslash with frontslash for Linux compatibility.\n $baseFilePath = str_replace('\\\\', '/', $filePath);\n $baseFilePath = str_replace(\"$rootPath/\", '', $baseFilePath);\n\n // Validate if file should be added to the package.\n if (! is_dir($filePath) && $this->validateFile($baseFilePath)) {\n $archive->addFile($filePath, $baseFilePath);\n }\n }\n }\n\n if ($archive->close()) {\n $this->info(\"Archive file created: $archiveFile\");\n }\n }",
"private function extractPackage(CFile $package) {\n // First ensure the package can be properly extracted\n if (!$package->exists || !$package->isFile || $package->size <= 0) {\n $maxUploadSize = ini_get('upload_max_filesize');\n $msg = 'There was an error uploading the package.';\n if ($maxUploadSize <= 2)\n $msg .= ' This can be caused when a package is larger than the ' .\n 'maximum upload size. This server is currently configured ' .\n 'to allow {maxUpload}.';\n Yii::app()->user->setFlash('error', Yii::t('admin', $msg, array('{maxUpload}' => $maxUploadSize)));\n $this->redirect('packager');\n }\n\n if ($package->extension !== 'zip') {\n Yii::app()->user->setFlash('error', Yii::t('admin', 'There was an error uploading the package. ' .\n 'Please select a valid zip archive.'));\n $this->redirect('packager');\n }\n\n $filename = $this->safePath($package->filename . \".zip\");\n if ($package->copy($filename) === false || !file_exists($filename)) {\n Yii::app()->user->setFlash('error', Yii::t('admin', \"There was an error saving the package.\"));\n $this->redirect('packager');\n }\n\n $zip = Yii::app()->zip;\n if ($zip->extractZip($filename, 'protected/data/') === false) {\n Yii::app()->user->setFlash('error', Yii::t('admin', \"There was an error unzipping the package. \" .\n \"Please ensure the zip archive is not corrupt.\"));\n $this->redirect('packager');\n }\n\n $packageName = str_replace('X2Package-', '', $package->filename);\n $admin = Admin::model()->findByPk(1);\n $appliedPackages = $admin->appliedPackages;\n if (!$appliedPackages)\n $appliedPackages = array();\n\n // Prepare the extracted package for import\n $packageDir = $this->safePath($packageName);\n $this->verifyPackageStructure($packageDir);\n $manifestContents = $this->loadPackageManifest($packageDir);\n\n // Ensure this package hasn't already been applied\n foreach ($appliedPackages as $pkg) {\n if ($pkg['name'] === $package) {\n Yii::app()->user->setFlash('error', Yii::t('admin', 'A package with the same name has already been applied'));\n return;\n }\n }\n return $manifestContents;\n }",
"public function extractSinglePackage($fileName)\n {\n\n $fileName = realpath($fileName);\n $packagePath = $this->getPackagePathFromFile($fileName);\n\n if (empty($packagePath)) {\n trigger_error('Empty is not a valid package-name.');\n }\n\n if (file_exists($fileName) === false) {\n trigger_error('File does not exist! '.$fileName);\n }\n\n ezDir::mkdir($packagePath, false, true);\n\n $this->logLine('Extracting Binary Package '.$fileName, __METHOD__);\n\n $phar = new PharData($fileName);\n $phar->extractTo($packagePath, null, true);\n\n }",
"public function extractFilesAction(){\n \t$filesDir = $this->container->getParameter('income_files_dir');\n \t$filesDir = array_diff(scandir($this->container->getParameter('income_files_dir')), array('..', '.'));\n \t$files = array_map(function($i){if (substr($i,-3)=='.gz') return $i;},$filesDir);\n\n \tforeach ($files as $file) {\n \t\tif (empty($file)) continue;\n\t \n\t \t$filesDir = $this->container->getParameter('income_files_dir');\n\n\t \tif (PHP_OS == 'WINNT'){\n\t \t\t$unzip = $this->container->getParameter('winnt_gunzip').' -d';\n\t \t}else{\n\t \t\t$unzip = 'unzip';\n\t \t}\n\t \tsystem($unzip.' '.$filesDir.$file);\n\t \t$decompressed_file = substr($file, 0,-3); \t\t\n \t}\n die();\n }",
"public static function extract($archive, $path);",
"protected function archiveDecode() {\n $data = $this->getArchive();\n $zip_path = 'temporary://' . $this->id() . '.zip';\n file_put_contents($zip_path, $data);\n $this->archiveExtract($zip_path);\n }",
"public function getArchive();",
"public function testExtractArchive()\n {\n // This should refer to the narrative bundle for unit testing.\n $narrativeBundle = Config::get('media.paths.uploads')\n . DIRECTORY_SEPARATOR\n . 'unit_testing_narrative_bundle.zip';\n\n $this->assertTrue(File::exists($narrativeBundle), 'The narrative bundle for unit testing is missing.');\n\n $name = time();\n\n // Mock the audio transcoding so that we don't spend any time\n // waiting for things to transcode.\n Queue::shouldReceive('push')->times(8)->andReturn(true);\n\n $narrative = new Narrative;\n $narrative->addArchive(\n $name,\n $narrativeBundle,\n Category::first()->CategoryID,\n true,\n Topic::first()->TopicID\n );\n\n $extractedPath = Config::get('media.paths.extracted') \n . DIRECTORY_SEPARATOR\n . $name;\n\n $this->assertFileExists($extractedPath);\n\n $directories = File::directories($extractedPath);\n\n $this->assertCount(1, $directories);\n\n File::deleteDirectory($extractedPath);\n }",
"function archiveFiles();",
"public function processPackageUpload() {\n\n $strFilename = generateSystemid().\".zip\";\n\n //stream the original package\n $objRemoteloader = new class_remoteloader();\n $objRemoteloader->setBitCacheEnabled(false);\n\n $objRemoteloader->setStrHost($this->STR_BROWSE_HOST);\n $objRemoteloader->setStrQueryParams($this->STR_DOWNLOAD_URL.\"?systemid=\".$this->getParam(\"systemid\"));\n\n $strResponse = $objRemoteloader->getRemoteContent();\n file_put_contents(_realpath_._projectpath_.\"/temp/\".$strFilename, $strResponse);\n\n class_resourceloader::getInstance()->flushCache();\n class_classloader::getInstance()->flushCache();\n class_reflection::flushCache();\n\n\n return _projectpath_.\"/temp/\".$strFilename;\n }",
"private function extract()\n {\n $zip = new ZipArchive;\n $zip->open($this->releaseZip);\n\n $this->progressStart('Extracting', $zip->numFiles);\n\n for($i=0; $i<$zip->numFiles; $i++) {\n $shopChunk = $zip->getNameIndex($i);\n $zip->extractTo($this->tmpDir, $shopChunk);\n\n $this->progress->advance();\n }\n\n $this->progressStop()\n ->progressClear();\n\n // detecting first level of archive\n // we only need contents of framework, no preceding folders.\n if (strpos($zip->getNameIndex(0), 'shop-script') !== false)\n {\n $tmpShopDir = $this->tmpDir . DIRECTORY_SEPARATOR . rtrim($zip->getNameIndex(0), \"/\");\n }\n\n $zip->close();\n\n if( ! is_dir($tmpShopDir)) {\n throw new \\Exception(\"Folder that matches - \\\"shop-script\\\" not present.\");\n }\n\n rename($tmpShopDir, $this->getTargetDir());\n\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
var $_name = 'htdb_services'; | function __construct(){
$this->_name = "htdb_services";
parent::__construct(array());
} | [
"public function getServ_name()\n {\n return $this->serv_name;\n }",
"function get_configwizard_meta_key_name2($hostname, $servicename = \"\")\n{\n $keyname = \"\";\n $keyname .= \"__\" . $hostname;\n $keyname .= \"__\" . $servicename;\n return $keyname;\n}",
"public function get_service_name();",
"public function getServiceName(): string\n {\n return 'MYSQL';\n }",
"function get_name()\r\n {\r\n return $this->sloodle_module_instance->name;\r\n }",
"function register_persistent($k,$v)\n{\n\n $GLOBALS['_cal_persistent_url'][$k] = $v;\n\n}",
"public function getServiceTitle() {}",
"function setname($var_name) {}",
"abstract protected function getServicePrefix();",
"function databaseName() {\r\n\t\treturn 'vl_' . $this->merchantName;\r\n\t}",
"public abstract function get_amd_name();",
"function smarty_function_servername($params, &$smarty) {\r\n return Pegasus::getServername();\r\n}",
"static public function __getGlobalVarName()\n {\n $cn = __CLASS__;\n return '__' . strtolower(substr($cn, strrpos($cn, '\\\\')+(int)($cn[0] === '\\\\')));\n }",
"function __construct() {\n $this->name=\"Customer\";\n }",
"abstract public function getServiceJS();",
"public function __construct() {\n\t\t$this->name = str_replace('tx_enetcacheanalytics_performance_backend_', '', get_class($this));\n\t}",
"public function getBackendName()\n {\n return 'Authserver';\n }",
"public function setJsonName($var) {}",
"public function get_c_services(){ return $this->c_services; }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the language files for the applet and puts them into the cache. | public static function generateAppletLanguageXmlFiles()
{
// List of the applets [directory => applet_id].
$applets = array(
'memberapplet' => 'JSM2_MemberApplet'
);
PrintMsg::displayMsg("\nGenerating applet language XMLs:");
$error = false;
try {
foreach ($applets as $appletDirectory => $appletLanguageId) {
PrintMsg::displayMsg("[APPLET: ".$appletLanguageId."]"
." - [DIR: ".$appletDirectory."]\n");
$languages = self::getAppletLanguages($appletLanguageId);
if (empty($languages)) {
$error = true;
throw new \Exception('There is no available languages for the ' . $appletLanguageId . ' applet.', 100);
}
$path = FileOperation::getLanguageCachePath('flash');
foreach ($languages as $language) {
$xmlContent = self::getAppletLanguageFile($appletLanguageId, $language);
if(empty($xmlContent)) {
$error = true;
throw new \Exception('There is no XMLContent for applet: ('.$appletLanguageId.')'
.' language: ('.$language.')!', 101);
} else {
$xmlFile = FileOperation::checkIfFileExists($path, '/lang_'.$language, '.xml');
if (FileOperation::storeLanguageFile($xmlFile, $xmlContent)) {
PrintMsg::displayMsg("\t[LANGUAGE: " .implode(', ', $languages)
. "] "."OK");
} else {
$error = true;
PrintMsg::displayMsg("\t[LANGUAGE: " . implode(', ', $languages)
. "] "."NOK");
throw new \Exception('Unable to save applet: ('.$appletLanguageId.')'
.'language: ('.$language.') xml ('.$xmlFile.')!', 102);
}
}
}
if (!$error) {
PrintMsg::displayMsg("\t[XML CACHED: ".$appletLanguageId."] "
."OK");
//below line is for execution of test case
return "applet xml file generated";
} else {
PrintMsg::displayMsg("\t[XML CACHED: ".$appletLanguageId."] "
."NOK");
//below line is for execution of test case
return "applet xml file generation failed";
}
}
} catch (\Exception $e) {
$error = true;
PrintMsg::displayMsg("\n\n["."ERROR".": (".$e->getCode().")]"
." detected \n\tOn file: ".$e->getFile().","
."\n\tAt line: ".$e->getLine().", with message: "
.$e->getMessage()."\n\n");
}
if (!$error) {
PrintMsg::displayMsg("Applet language XMLs generated.\n");
} else {
PrintMsg::displayMsg("Error during language XMLs generation.\n");
}
} | [
"function I18N_cacheWebinterfaceLanguages()\n{\n\tif (I18N_countCachedLanguages(true) > 2)\n\t\treturn(true);\n\n\t$pin=popen(\"find /m23/inc/help -iname language.info\",\"r\");\n\n\twhile (!feof($pin))\n\t{\n\t\t//read name of language file\n\t\t$langFile=fgets($pin,10000);\n\t\t//if it's empty, we should quit\n\t\tif (empty($langFile)) break;\n\t\t//open the language file\n\t\t$in=fopen(trim($langFile),\"r\");\n\n\t\twhile (!feof($in))\n\t\t{//get the variables and values\n\t\t\t$line=fgets($in,10000);\n\t\t\t//if it's empty, we should quit\n\t\t\tif (empty($line)) break;\n\t\t\t//split the line by variable name and value\n\t\t\t$varValue=explode(\":\",$line);\n\n\t\t\tswitch ($varValue[0])\n\t\t\t{\n\t\t\t\tcase language:\n\t\t\t\t\t{\n\t\t\t\t\t\t$longLanguage = trim($varValue[1]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t};\n\t\t\t\tcase shortlanguage:\n\t\t\t\t\t{\n\t\t\t\t\t\t$shortLanguage = trim($varValue[1]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t};\n\t\t\t};\n\t\t};\n\n\t\tI18N_addLanguage(true, $shortLanguage, $longLanguage, $shortLanguage, '', '', '', '', '', '', '', '');\n\t};\n\n\tpclose($pin);\n\tfclose($in);\n\treturn(true);\n}",
"public static function fetch() {\n\t\t\tself::$_languages = array();\n\n\t\t\t// Fetch list of active extensions\n\t\t\t$enabled = array();\n\t\t\tif(class_exists('Symphony')) {\n\t\t\t\t$enabled = Symphony::ExtensionManager()->listInstalledHandles();\n\t\t\t}\n\n\t\t\t// Fetch core languages\n\t\t\t$directory = General::listStructure(LANG);\n\t\t\tforeach($directory['filelist'] as $file) {\n\t\t\t\tself::$_languages = array_merge(self::$_languages, self::fetchLanguage('core', LANG, $file, $enabled));\n\t\t\t}\n\n\t\t\t// Fetch extensions\n\t\t\t$extensions = new DirectoryIterator(EXTENSIONS);\n\n\t\t\t// Language extensions\n\t\t\tforeach($extensions as $extension) {\n\t\t\t\t$folder = $extension->getPathname() . '/lang';\n\t\t\t\t$directory = General::listStructure($folder);\n\t\t\t\tif(is_array($directory['filelist']) && !empty($directory['filelist'])) {\n\t\t\t\t\tforeach($directory['filelist'] as $file) {\n\t\t\t\t\t\t$temp = self::fetchLanguage($extension->getFilename(), $folder, $file, $enabled);\n\t\t\t\t\t\t$lang = key($temp);\n\n\t\t\t\t\t\t// Core translations\n\t\t\t\t\t\tif(strpos($extension->getFilename(), 'lang_') !== false) {\n\n\t\t\t\t\t\t\t// Prepare merging\n\t\t\t\t\t\t\tif(array_key_exists($lang, self::$_languages)) {\n\t\t\t\t\t\t\t\tunset($temp[$lang]['name']);\n\t\t\t\t\t\t\t\tunset(self::$_languages[$lang]['status']);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Merge\n\t\t\t\t\t\t\tself::$_languages = array_merge_recursive(self::$_languages, $temp);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Extension translations\n\t\t\t\t\t\telse {\n\n\t\t\t\t\t\t\t// Create language if not exists\n\t\t\t\t\t\t\tif(!array_key_exists($lang, self::$_languages)) {\n\t\t\t\t\t\t\t\t$language = array(\n\t\t\t\t\t\t\t\t\t$lang => array(\n\t\t\t\t\t\t\t\t\t\t'name' => $temp[$lang]['name'],\n\t\t\t\t\t\t\t\t\t\t'status' => LANGUAGE_DISABLED,\n\t\t\t\t\t\t\t\t\t\t'extensions' => array()\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\tself::$_languages = array_merge(self::$_languages, $language);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Merge\n\t\t\t\t\t\t\tself::$_languages[$lang]['extensions'][$temp[$lang]['source']] = $temp[$lang]['path'];\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}",
"function load_lang() {\n\t\tglobal $_LANG;\n\t\t$dh = opendir( dirname( __FILE__ ) . '/lang/' );\n\n\t\twhile( false !== $file2 = readdir( $dh ) ) {\n\t\t\tif( ! is_dir( '' . 'lang/' . $file2 ) ) {\n\t\t\t\t$pieces = explode( '.', $file2 );\n\t\t\t\tif( $pieces[ 1 ] == 'txt' ) {\n\t\t\t\t\t$arrayoflanguagefiles[ ] = $pieces[ 0 ];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tclosedir( $dh );\n\n\t\t$language = @$_SESSION[ 'Language' ];\n\n\t\tif( ! in_array( $language, $arrayoflanguagefiles ) ) {\n\t\t\t$language = \"English\";\n\t\t}\n\n\t\tob_start();\n\t\tinclude dirname( __FILE__ ) . \"/lang/$language.txt\";\n\t\t$templang = ob_get_contents();\n\t\tob_end_clean();\n\t\teval ( $templang );\n\t\treturn $templang;\n\t}",
"protected function loadFileList()\n {\n global $LANGUAGES;\n if (is_array($LANGUAGES)) {\n $cnt = count($LANGUAGES);\n for ($i = 0; $i < $cnt; $i++) {\n $LANGUAGES[$i][1] = $this->loadFileDesc($this->LanguageFolder . $LANGUAGES[$i][2]);\n }\n }\n }",
"private function loadLanguages() {\r\n\t\tglobal $option;\r\n\t\t$db = JFactory::getDBO();\r\n\r\n\t\t$filter_order\t\t= JFactory::getApplication()->getUserStateFromRequest( $option.'filter_order',\t\t'filter_order',\t\t'lext.ordering',\t'cmd' );\r\n\t\t$filter_order_Dir\t= JFactory::getApplication()->getUserStateFromRequest( $option.'filter_order_Dir',\t'filter_order_Dir',\t'',\t\t\t\t'word' );\r\n\r\n\t\t// 1. read all known languages from the database\r\n\t\t//$sql = \"SELECT l.*\"\r\n\t\t//. \"\\nFROM #__jf_languages AS l\";\r\n\t\t\t$sql = 'select l.lang_id AS lang_id,l.lang_code AS lang_code,l.title AS title,l.title_native AS title_native,\r\n\t\t\t\tl.sef AS sef,l.description AS description,l.published AS published,l.image AS image,\r\n\t\t\t\tlext.image_ext AS image_ext,lext.fallback_code AS fallback_code,lext.params AS params,\r\n\t\t\t\tlext.ordering AS ordering \r\n\t\t\t\tfrom #__languages as l \r\n\t\t\t\tleft join #__jf_languages_ext as lext on l.lang_id = lext.lang_id'; \r\n\r\n\t\tif ($filter_order != ''){\r\n\t\t\t$sql .= ' ORDER BY ' .$filter_order .' '. $filter_order_Dir;\r\n\t\t}\r\n\t\t$db->setQuery( $sql\t);\r\n\t\t$contentlanguages = $db->loadObjectList('lang_code');\r\n\t\t\r\n\t\t// check for published Site Languages\r\n\t\t$query\t= $db->getQuery(true);\r\n\t\t$query->select('a.element AS lang_code, a.name AS title, a.enabled As enabled');\r\n\t\t$query->from('`#__extensions` AS a');\r\n\t\t$query->where('a.type = '.$db->Quote('language'));\r\n\t\t$query->where('a.client_id = 0');\r\n\t\t\r\n\t\t$db->setQuery($query);\r\n\t\t$frontlanguages = $db->loadObjectList('lang_code');\r\n\t\t\r\n\t\tforeach ($frontlanguages AS &$frontlang) {\r\n\t\t\t$langarr \t\t\t\t\t= explode ('-', $frontlang->lang_code);\r\n\t\t\t$frontlang->lang_id \t\t= null;\r\n\t\t\t$frontlang->title_native \t= $frontlang->title;\r\n\t\t\t$frontlang->sef \t\t\t= $langarr[0];\r\n\t\t\t$frontlang->published \t= 0; // default to unpublished as it needs to be saved before it can be used - inserted in languages table\r\n\t\t\t$frontlang->image_ext \t\t= 'media/com_joomfish/default/flags/' .$langarr[0]. '.gif';\r\n\t\t}\r\n\t\t\r\n\t\t$languages = array_merge($frontlanguages, $contentlanguages);\r\n\t\t\r\n\t\tif($languages === null) {\r\n\t\t\tJError::raiseWarning( 400, $db->getErrorMsg());\r\n\t\t}\r\n\t\t\r\n\t\t// We convert any language of the table into a JFLanguage object. As within the language list the key will be the language code\r\n\t\t$this->_languages = array();\r\n\t\tforeach($languages as $language) {\r\n\t\t\t$jfLanguage = $this->getTable('JFLanguage');\r\n\t\t\t$jfLanguage->bind($language);\r\n\r\n\t\t\t$this->_languages[$jfLanguage->lang_code] = $jfLanguage;\r\n\t\t}\r\n\t}",
"function LoadFileList() {\n\t\tglobal $EWR_LANGUAGE_FILE;\n\t\tif (is_array($EWR_LANGUAGE_FILE)) {\n\t\t\t$cnt = count($EWR_LANGUAGE_FILE);\n\t\t\tfor ($i = 0; $i < $cnt; $i++)\n\t\t\t\t$EWR_LANGUAGE_FILE[$i][1] = $this->LoadFileDesc($this->LanguageFolder . $EWR_LANGUAGE_FILE[$i][2]);\n\t\t}\n\t}",
"protected static function getAppletLanguages($applet)\n\t{\t\t\n\t\t$result = ApiCall::call(\n\t\t\t'system_api',\n\t\t\t'language_api',\n\t\t\tarray(\n\t\t\t\t'system' => 'LanguageFiles',\n\t\t\t\t'action' => 'getAppletLanguages'\n\t\t\t),\n\t\t\tarray('applet' => $applet)\n\t\t);\n\t\ttry {\t\n\t\t\tCheckApiError::checkForApiErrorResult($result);\n\t\t} catch (\\Exception $e) {\n\t\t\tthrow new \\Exception('Getting languages for applet (' . $applet . ') was unsuccessful ', 103);\n\t\t}\n\t\t\n\t\tif (empty($result)) {\n\t\t\treturn;\n\t\t} else {\n\t\t\treturn $result['data'];\n\t\t}\n\t}",
"function GetAlli18n(){\n $list=self::directory_map(LANG_PATH,TRUE);\n return $list;\n }",
"function loadLanguages()\n\t\t{\n\t\t\tif($this->loaded)\n\t\t\t\treturn;\n\n\t\t\t$languages = explode(\";\", ENABLED_LANGUAGES);\n\t\t\t$dh = opendir(LANGUAGE_DIR);\n\t\t\twhile (($entry = readdir($dh)) !== false) {\n\t\t\t\t$pick = 0;\n\t\t\t\t/*\n\t\t\t\t * Case 1: languages contains a generalization.\n\t\t\t\t * entry = zh_CN, languages = [zh]\n\t\t\t\t */\n\t\t\t\tif (in_array($entry, $languages) ||\n\t\t\t\t in_array(lang_strip_mod($entry), $languages) ||\n\t\t\t\t in_array(lang_strip_enc($entry), $languages) ||\n\t\t\t\t in_array(lang_strip_enc(lang_strip_mod($entry)), $languages) ||\n\t\t\t\t in_array(lang_strip_cc($entry), $languages) ||\n\t\t\t\t in_array(lang_strip_cc(lang_strip_mod($entry)), $languages) ||\n\t\t\t\t in_array(lang_strip_cc(lang_strip_enc($entry)), $languages) ||\n\t\t\t\t in_array(lang_strip_cc(lang_strip_enc(lang_strip_mod($entry))), $languages))\n\t\t\t\t\t$pick = 1;\n\t\t\t\t/*\n\t\t\t\t * Case 2: language contains a country\n\t\t\t\t * specialization that matches the default\n\t\t\t\t * country for a general language.\n\t\t\t\t * entry = de, language = [de_DE]\n\t\t\t\t */\n\t\t\t\tif (in_array(lang_add_cc($entry), $languages))\n\t\t\t\t\t$pick = 1;\n\t\t\t\tif (!$pick)\n\t\t\t\t\tcontinue;\n\t\t\t\tif (!is_dir(LANGUAGE_DIR.$entry.\"/LC_MESSAGES\"))\n\t\t\t\t\tcontinue;\n\t\t\t\tif (!is_file(LANGUAGE_DIR.$entry.\"/language.txt\"))\n\t\t\t\t\tcontinue;\n\t\t\t\t$fh = fopen(LANGUAGE_DIR.$entry.\"/language.txt\", \"r\");\n\t\t\t\t$lang_title = fgets($fh);\n\t\t\t\t$lang_table = fgets($fh);\n\t\t\t\tfclose($fh);\n\t\t\t\t/*\n\t\t\t\t * Always give the Preferences dialog valid\n\t\t\t\t * _gettext_ IDs (not directory names, ffs),\n\t\t\t\t * i.e. entries of the type \"lc_CC\" or\n\t\t\t\t * \"lc_CC.UTF-8\".\n\t\t\t\t */\n\t\t\t\t$entry = lang_add_enc(lang_add_cc($entry));\n\t\t\t\t$this->languages[$entry] = $lang_title;\n\t\t\t\t$this->languagetable[$entry] = $lang_table;\n\t\t\t}\n\t\t\t$this->loaded = true;\t\t\n\t\t}",
"protected static function getAppletLanguages($applet) {\n $result = ApiCall::call(\n 'system_api', 'language_api', array(\n 'system' => 'LanguageFiles',\n 'action' => 'getAppletLanguages'\n ), array('applet' => $applet)\n );\n\n try {\n ApiErrors::checkForApiErrorResult($result);\n } catch (\\Exception $e) {\n Logging::printLog(Logging::logType(\"Error generating language for applet. See Exception...\", \"ERROR\"));\n throw new \\Exception('Getting languages for applet (' . $applet . ') was unsuccessful ' . $e->getMessage());\n }\n\n return $result['data'];\n }",
"public function readLanguagesFiles()\n {\n $translates = array();\n\n $options = $this->getServiceManager()->get('playgroundtranslate_module_options');\n $pathTranslate = $options->getLanguagePath();\n\n $dir = opendir(__DIR__.$pathTranslate);\n while ($file = readdir($dir)) {\n if ($file != '.' && $file != '..' && !is_dir(__DIR__.$pathTranslate.$file)) {\n $translates[basename(__DIR__.$pathTranslate.$file, '.php')] = @include __DIR__.$pathTranslate.$file;\n }\n }\n\n return $translates;\n }",
"protected function retrive_local_translations()\n\t{\n\t\t$dir_iterator = new \\DirectoryIterator($this->language_location);\t\t\n\t\t$arr_locales = array();\n\t\t\n\t\tforeach ($dir_iterator as $file)\n\t\t{\t\n\t\t\t// skip the system files for navigation and language_backup directory\n\t\t\tif($file->getFilename() != '.' && $file->getFilename() != '..' && $file->getFilename() != 'language_backup')\n\t\t\t{\n\t\t\t\tif (! $file->isDir())\n\t\t\t\t{ \n $lang = include ($file->getRealPath());\n\n if (! isset($lang)) continue;\n \n // the name of the files in symfony is resource_group.locale_name_eng,\n // we need to explode the name and get the parts\n \n $arr_filename_parts = explode('.', $file->getFilename());\n\t\t\t\t\t$resource_group_name = $arr_filename_parts[0];\n $locale = $arr_filename_parts[1];\n \n\t\t\t\t\t$arr_locales[$locale][$resource_group_name] = $lang;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n \n return $arr_locales;\n\t}",
"private function getCacheFile(){\n return self::CACHE_DIR . $this->plugin . '.' . $this->lang . '.php';\n }",
"function GetLanguages() {\n return include GetSysResPath('languages.conf.php', 'lang');\n}",
"public function load()\n\t{\n\t\t$file = $this->appPath . '/storage/lang/languages.json';\n\n\t\tif( ! $this->filesystem->exists($file)) return array();\n\n\t\t$lastModified = $this->filesystem->get($file);\n\n\t\t$this->lastModified = json_decode($lastModified, true);\n\t}",
"private static function collectLanguageFiles(): string\n {\n $files = glob(sprintf('%s/resources/lang/%s/*.php', dirname(__DIR__, 1), config('app.locale')));\n $lines = collect();\n\n foreach ($files as $file) {\n $filename = basename($file, '.php');\n $lines->put($filename, require $file);\n }\n\n return json_encode($lines->toArray());\n }",
"function get_languages() { \n\n\t/* Open the locale directory */\n\t$handle\t= @opendir(Config::get('prefix') . '/locale');\n\n\tif (!is_resource($handle)) { \n\t\tdebug_event('language','Error unable to open locale directory','1'); \n\t}\n\n\t$results = array(); \n\n\t/* Prepend English */\n\t$results['en_US'] = 'English (US)';\n\n\twhile ($file = readdir($handle)) { \n\n\t\t$full_file = Config::get('prefix') . '/locale/' . $file;\n\n\t\t/* Check to see if it's a directory */\n\t\tif (is_dir($full_file) AND substr($file,0,1) != '.' AND $file != 'base') { \n\t\t\t\t\n\t\t\tswitch($file) {\n\t\t\t\tcase 'af_ZA'; $name = 'Afrikaans'; break; /* Afrikaans */\n\t\t\t\tcase 'ca_ES'; $name = 'Català'; break; /* Catalan */\n\t\t\t\tcase 'cs_CZ'; $name = 'Česky'; break; /* Czech */\n\t\t\t\tcase 'da_DK'; $name = 'Dansk'; break; /* Danish */\n\t\t\t\tcase 'de_DE'; $name = 'Deutsch'; break; /* German */\n\t\t\t\tcase 'en_US'; $name = 'English (US)'; break; /* English */\n\t\t\t\tcase 'en_GB'; $name = 'English (UK)'; break; /* English */\n\t\t\t\tcase 'es_ES'; $name = 'Español'; break; /* Spanish */\n\t\t\t\tcase 'es_MX'; $name = 'Español (MX)'; break; /* Spanish */\n\t\t\t\tcase 'es_AR'; $name = 'Español (AR)'; break; /* Spanish */\n\t\t\t\tcase 'et_EE'; $name = 'Eesti'; break; /* Estonian */\n\t\t\t\tcase 'eu_ES'; $name = 'Euskara'; break; /* Basque */\n\t\t\t\tcase 'fr_FR'; $name = 'Français'; break; /* French */\n\t\t\t\tcase 'ga_IE'; $name = 'Gaeilge'; break; /* Irish */\n\t\t\t\tcase 'el_GR'; $name = 'Greek'; break; /* Greek */\n\t\t\t\tcase 'is_IS'; $name = 'Icelandic'; break; /* Icelandic */\n\t\t\t\tcase 'it_IT'; $name = 'Italiano'; break; /* Italian */\n\t\t\t\tcase 'lv_LV'; $name = 'Latviešu'; break; /* Latvian */\n\t\t\t\tcase 'lt_LT'; $name = 'Lietuvių'; break; /* Lithuanian */\n\t\t\t\tcase 'hu_HU'; $name = 'Magyar'; break; /* Hungarian */\n\t\t\t\tcase 'nl_NL'; $name = 'Nederlands'; break; /* Dutch */\n\t\t\t\tcase 'no_NO'; $name = 'Norsk bokmål'; break; /* Norwegian */\n\t\t\t\tcase 'pl_PL'; $name = 'Polski'; break; /* Polish */\n\t\t\t\tcase 'pt_BR'; $name = 'Português Brasileiro'; break; /* Portuguese */\n\t\t\t\tcase 'pt_PT'; $name = 'Português'; break; /* Portuguese */\n\t\t\t\tcase 'ro_RO'; $name = 'Română'; break; /* Romanian */\n\t\t\t\tcase 'sk_SK'; $name = 'Slovenčina'; break; /* Slovak */\n\t\t\t\tcase 'sl_SI'; $name = 'Slovenščina'; break; /* Slovenian */\n\t\t\t\tcase 'sr_CS'; $name = 'Srpski'; break; /* Serbian */\n\t\t\t\tcase 'fi_FI'; $name = 'Suomi'; break; /* Finnish */\n\t\t\t\tcase 'sv_SE'; $name = 'Svenska'; break; /* Swedish */\n\t\t\t\tcase 'uk_UA'; $name = 'Українська'; break; /* Ukrainian */\n\t\t\t\tcase 'vi_VN'; $name = 'Tiếng Việt'; break; /* Vietnamese */\n\t\t\t\tcase 'tr_TR'; $name = 'Türkçe'; break; /* Turkish */\n\t\t\t\tcase 'bg_BG'; $name = 'Български'; break; /* Bulgarian */\n\t\t\t\tcase 'ru_RU'; $name = 'Русский'; break; /* Russian */\n\t\t\t\tcase 'zh_CN'; $name = '简体中文'; break; /* Chinese */\n\t\t\t\tcase 'zn_TW'; $name = '繁體中文'; break; /* Chinese */\n\t\t\t\tcase 'ko_KR'; $name = '한국말'; break; /* Korean */\n\t\t\t\tcase 'ja_JP'; $name = '日本語'; break; /* Japanese */\n\t\t\t\tcase 'nb_NO'; $name = 'Norsk'; break; /* Norwegian */\n\t\t\t\t/* These languages are right to left. */\n\t\t\t\tcase 'ar_SA'; $name = 'العربية'; break; /* Arabic */\n\t\t\t\tcase 'he_IL'; $name = 'עברית'; break; /* Hebrew */\n\t\t\t\tcase 'fa_IR'; $name = 'فارسي'; break; /* Farsi */\n\t\t\t\tdefault: $name = _('Unknown'); break;\n\t\t\t} // end switch\n\n\t\t\n\t\t\t$results[$file] = $name;\n\t\t}\n\n\t} // end while\n\n\treturn $results;\n\n}",
"public static function downloadLanguages() {\r\n return self::downloadLanguage();\r\n }",
"function get_language_list ($inc_dir)\r\n{\r\n global $user_lang;\r\n $dir_ref = opendir($inc_dir);\r\n rewinddir($dir_ref);\r\n\t$list = array();\r\n\r\n\tdo\r\n\t{\r\n\t\t$file = readdir($dir_ref); //get next file of inc directory\r\n\t\tclearstatcache();\r\n\t\t\r\n\t\tif((substr($file,0,1)!=\".\")&&(!is_dir($inc_dir.\"/\".$file))&&($file!=\"\")) //current file is really a file and no directory\r\n\t\t{\r\n\t\t\tif((stristr($file, '.php')) && (!stristr($file, 'qqq'))) //file is really a language file (qqq comes from translatewiki)\r\n\t\t\t{\r\n\t\t\t\t$list[] = str_replace('.php', '', $file); //add language of file to the list\r\n\t\t\t}\r\n\t\t}\r\n\t}while($file);\r\n\t\t\r\n\tsort($list);\r\n\tclosedir($dir_ref);\r\n\treturn $list;\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
(Inspired/copiedandmodified from siteorigin_panels plugin's siteorigin_panels_render()) Render the panels | function _dh_siteorigin_panels_render( $post_id = false, $enqueue_css = true, $panels_data = false, $layout_width = 3 ) {
if( empty($post_id) ) $post_id = get_the_ID();
global $siteorigin_panels_current_post;
$old_current_post = $siteorigin_panels_current_post;
$siteorigin_panels_current_post = $post_id;
// Try get the cached panel from in memory cache.
global $siteorigin_panels_cache;
/*if(!empty($siteorigin_panels_cache) && !empty($siteorigin_panels_cache[$post_id]))
return $siteorigin_panels_cache[$post_id];*/
if( empty($panels_data) ) {
if( strpos($post_id, 'prebuilt:') === 0) {
list($null, $prebuilt_id) = explode(':', $post_id, 2);
$layouts = apply_filters('siteorigin_panels_prebuilt_layouts', array());
$panels_data = !empty($layouts[$prebuilt_id]) ? $layouts[$prebuilt_id] : array();
}
else if($post_id == 'home'){
$panels_data = get_post_meta( get_option('siteorigin_panels_home_page_id'), 'panels_data', true );
if( is_null($panels_data) ){
// Load the default layout
$layouts = apply_filters('siteorigin_panels_prebuilt_layouts', array());
$prebuilt_id = siteorigin_panels_setting('home-page-default') ? siteorigin_panels_setting('home-page-default') : 'home';
$panels_data = !empty($layouts[$prebuilt_id]) ? $layouts[$prebuilt_id] : current($layouts);
}
}
else{
if ( post_password_required($post_id) ) return false;
$panels_data = get_post_meta( $post_id, 'panels_data', true );
}
}
$panels_data = apply_filters( 'siteorigin_panels_data', $panels_data, $post_id );
if( empty( $panels_data ) || empty( $panels_data['grids'] ) ) return '';
// Create the skeleton of the grids
$grids = array();
if( !empty( $panels_data['grids'] ) && !empty( $panels_data['grids'] ) ) {
foreach ( $panels_data['grids'] as $gi => $grid ) {
$gi = intval( $gi );
$grids[$gi] = array();
for ( $i = 0; $i < $grid['cells']; $i++ ) {
$grids[$gi][$i] = array();
}
}
}
// We need this to migrate from the old $panels_data that put widget meta into the "info" key instead of "panels_info"
if( !empty( $panels_data['widgets'] ) && is_array($panels_data['widgets']) ) {
foreach ( $panels_data['widgets'] as $i => $widget ) {
if( empty( $panels_data['widgets'][$i]['panels_info'] ) ) {
$panels_data['widgets'][$i]['panels_info'] = $panels_data['widgets'][$i]['info'];
unset($panels_data['widgets'][$i]['info']);
}
}
}
if( !empty( $panels_data['widgets'] ) && is_array($panels_data['widgets']) ){
foreach ( $panels_data['widgets'] as $widget ) {
$grids[intval( $widget['panels_info']['grid'] )][intval( $widget['panels_info']['cell'] )][] = $widget;
}
}
ob_start();
global $siteorigin_panels_inline_css;
if(empty($siteorigin_panels_inline_css)) $siteorigin_panels_inline_css = '';
echo '<div class="custom-layout-entry-content">';
$cells_count = 0;
foreach ( $grids as $gi => $cells ) {
echo '<section class="section-row">';
echo '<div class="grid-wrapper">';
foreach ( $cells as $ci => $widgets ) {
switch (count($cells)) {
case 1:
$width_in_cols = $layout_width;
break;
case 2:
// Assign the width in columns depending on which cell is set to be wider in teh layout editor
$width_in_cols = 1;
$me = $ci;
$the_other = ($ci == 0) ? 1 : 0;
$my_width = $panels_data['grid_cells'][$cells_count + $me]['weight'];
$the_other_width = $panels_data['grid_cells'][$cells_count + $the_other]['weight'];
if ($my_width > $the_other_width || ($my_width == $the_other_width && $me == 0)) {
$width_in_cols = 2;
}
// If the total row width is 2 or 1, then the width of this cell will always be 1
if ( $layout_width < 3) {
$width_in_cols = 1;
}
break;
case 3:
default:
$width_in_cols = 1;
break;
}
$cells_count += count($cells);
echo '<div class="grid-' . $width_in_cols . '-' . $layout_width . '">';
foreach ( $widgets as $pi => $widget_info ) {
$data = $widget_info;
$data['dh_width_suggestion'] = $width_in_cols;
$data['dh_visual_width'] = $width_in_cols;
$data['dh_row_width'] = $width_in_cols;
$data['dh_inside_custom_layout'] = TRUE;
unset( $data['panels_info'] );
_dh_siteorigin_panels_the_widget( $widget_info['panels_info']['class'], $data, $gi, $ci, $pi, $pi == 0, $pi == count( $widgets ) - 1, $post_id, $widget_style_wrapper );
}
echo '</div>';
}
echo '</div>';
echo '</section>';
}
echo '</div>';
$html = ob_get_clean();
// Reset the current post
$siteorigin_panels_current_post = $old_current_post;
return apply_filters( 'siteorigin_panels_render', $html, $post_id, !empty($post) ? $post : null );
} | [
"public function render_panel_templates()\n {\n }",
"function _dh_campaign_siteorigin_panels_render( $post_id = false, $enqueue_css = true, $panels_data = false, $layout_width = 3 ) {\r\n if ( empty( $post_id ) )\r\n\t$post_id = get_the_ID();\r\n\r\n global $siteorigin_panels_current_post;\r\n $old_current_post\t\t = $siteorigin_panels_current_post;\r\n $siteorigin_panels_current_post\t = $post_id;\r\n\r\n // Try get the cached panel from in memory cache.\r\n global $siteorigin_panels_cache;\r\n /* if(!empty($siteorigin_panels_cache) && !empty($siteorigin_panels_cache[$post_id]))\r\n return $siteorigin_panels_cache[$post_id]; */\r\n\r\n if ( empty( $panels_data ) ) {\r\n\tif ( strpos( $post_id, 'prebuilt:' ) === 0 ) {\r\n\t list($null, $prebuilt_id) = explode( ':', $post_id, 2 );\r\n\t $layouts\t = apply_filters( 'siteorigin_panels_prebuilt_layouts', array() );\r\n\t $panels_data\t = ! empty( $layouts[ $prebuilt_id ] ) ? $layouts[ $prebuilt_id ] : array();\r\n\t} else if ( $post_id == 'home' ) {\r\n\t $panels_data = get_post_meta( get_option( 'siteorigin_panels_home_page_id' ), 'panels_data', true );\r\n\r\n\t if ( is_null( $panels_data ) ) {\r\n\t\t// Load the default layout\r\n\t\t$layouts\t = apply_filters( 'siteorigin_panels_prebuilt_layouts', array() );\r\n\t\t$prebuilt_id\t = siteorigin_panels_setting( 'home-page-default' ) ? siteorigin_panels_setting( 'home-page-default' ) : 'home';\r\n\r\n\t\t$panels_data = ! empty( $layouts[ $prebuilt_id ] ) ? $layouts[ $prebuilt_id ] : current( $layouts );\r\n\t }\r\n\t} else {\r\n\t if ( post_password_required( $post_id ) )\r\n\t\treturn false;\r\n\t $panels_data = get_post_meta( $post_id, 'panels_data', true );\r\n\t}\r\n }\r\n\r\n $panels_data = apply_filters( 'siteorigin_panels_data', $panels_data, $post_id );\r\n if ( empty( $panels_data ) || empty( $panels_data[ 'grids' ] ) )\r\n\treturn '';\r\n\r\n // Create the skeleton of the grids\r\n $grids = array();\r\n if ( ! empty( $panels_data[ 'grids' ] ) && ! empty( $panels_data[ 'grids' ] ) ) {\r\n\tforeach ( $panels_data[ 'grids' ] as $gi => $grid ) {\r\n\t $gi\t\t = intval( $gi );\r\n\t $grids[ $gi ]\t = array();\r\n\t for ( $i = 0; $i < $grid[ 'cells' ]; $i ++ ) {\r\n\t\t$grids[ $gi ][ $i ] = array();\r\n\t }\r\n\t}\r\n }\r\n\r\n // We need this to migrate from the old $panels_data that put widget meta into the \"info\" key instead of \"panels_info\"\r\n if ( ! empty( $panels_data[ 'widgets' ] ) && is_array( $panels_data[ 'widgets' ] ) ) {\r\n\tforeach ( $panels_data[ 'widgets' ] as $i => $widget ) {\r\n\t if ( empty( $panels_data[ 'widgets' ][ $i ][ 'panels_info' ] ) ) {\r\n\t\t$panels_data[ 'widgets' ][ $i ][ 'panels_info' ] = $panels_data[ 'widgets' ][ $i ][ 'info' ];\r\n\t\tunset( $panels_data[ 'widgets' ][ $i ][ 'info' ] );\r\n\t }\r\n\t}\r\n }\r\n\r\n if ( ! empty( $panels_data[ 'widgets' ] ) && is_array( $panels_data[ 'widgets' ] ) ) {\r\n\tforeach ( $panels_data[ 'widgets' ] as $widget ) {\r\n\t $grids[ intval( $widget[ 'panels_info' ][ 'grid' ] ) ][ intval( $widget[ 'panels_info' ][ 'cell' ] ) ][] = $widget;\r\n\t}\r\n }\r\n\r\n ob_start();\r\n\r\n global $siteorigin_panels_inline_css;\r\n if ( empty( $siteorigin_panels_inline_css ) )\r\n\t$siteorigin_panels_inline_css = '';\r\n\r\n //Commenting below for correction to campaign markup\r\n //echo '<div class=\"custom-layout-entry-content\">';\r\n $cells_count = 0;\r\n foreach ( $grids as $gi => $cells ) {\r\n\r\n\t//commenting below for correction to campaign markup\r\n\t//echo '<div class=\"section\">';\r\n\techo '<div class=\"container container--wide grid\">';\r\n\techo '<div class=\"row spotlights\">';\r\n\r\n\tforeach ( $cells as $ci => $widgets ) {\r\n\t switch ( count( $cells ) ) {\r\n\t\tcase 1:\r\n\t\t $width_in_cols\t = $layout_width;\r\n\t\t break;\r\n\t\tcase 2:\r\n\t\t // Assign the width in columns depending on which cell is set to be wider in teh layout editor\r\n\t\t $width_in_cols\t = 2;\r\n\t\t $me\t\t = $ci;\r\n\t\t $the_other\t = ($ci == 0) ? 1 : 0;\r\n\r\n\t\t $my_width\t = $panels_data[ 'grid_cells' ][ $cells_count + $me ][ 'weight' ];\r\n\t\t $the_other_width = $panels_data[ 'grid_cells' ][ $cells_count + $the_other ][ 'weight' ];\r\n\r\n\t\t if ( $my_width > $the_other_width || ($my_width == $the_other_width && $me == 0) ) {\r\n\t\t\t$width_in_cols = 2;\r\n\t\t }\r\n\r\n\t\t // If the total row width is 2 or 1, then the width of this cell will always be 1\r\n\t\t if ( $layout_width < 3 ) {\r\n\t\t\t$width_in_cols = 1;\r\n\t\t }\r\n\t\t break;\r\n\t\tcase 3:\r\n\t\tdefault:\r\n\t\t $width_in_cols = 1;\r\n\t\t break;\r\n\t }\r\n\t $cells_count += count( $cells );\r\n\r\n\t //Commenting below for correction to campaign markup\r\n\t //echo '<div class=\"grid-' . $width_in_cols . '-' . $layout_width . '\">';\r\n\t foreach ( $widgets as $pi => $widget_info ) {\r\n\t\t$data\t\t\t\t\t = $widget_info;\r\n\t\t$data[ 'dh_width_suggestion' ]\t\t = $width_in_cols;\r\n\t\t$data[ 'dh_visual_width' ]\t\t = $width_in_cols;\r\n\t\t$data[ 'dh_row_width' ]\t\t\t = $width_in_cols;\r\n\t\t$data[ 'dh_inside_custom_layout' ]\t = TRUE;\r\n\t\tunset( $data[ 'panels_info' ] );\r\n\t\t_dh_siteorigin_panels_the_widget( $widget_info[ 'panels_info' ][ 'class' ], $data, $gi, $ci, $pi, $pi == 0, $pi == count( $widgets ) - 1, $post_id, $widget_style_wrapper );\r\n\t }\r\n\t //echo '</div>';\r\n\t}\r\n\r\n\techo '</div>';\r\n\techo '</div>';\r\n\t//echo '</div>';\r\n }\r\n //echo '</div>';\r\n\r\n $html = ob_get_clean();\r\n\r\n // Reset the current post\r\n $siteorigin_panels_current_post = $old_current_post;\r\n\r\n return apply_filters( 'siteorigin_panels_render', $html, $post_id, ! empty( $post ) ? $post : null );\r\n}",
"protected function _displaySubPanels()\n {\n\n if (isset($this->bean) && !empty($this->bean->id) && (file_exists('modules/' . $this->module . '/metadata/subpaneldefs.php') || file_exists('custom/modules/' . $this->module . '/metadata/subpaneldefs.php') || file_exists('custom/modules/' . $this->module . '/Ext/Layoutdefs/layoutdefs.ext.php'))) \n {\n\n $GLOBALS['focus'] = $this->bean;\n require_once ('include/SubPanel/SubPanelTiles.php');\n $subpanel = new SubPanelTiles($this->bean, $this->module);\n\n //echo \"<pre>\";print_r($subpanel->subpanel_definitions->layout_defs['subpanel_setup']);die;\n \n $hideSubpanels=array(\n 'aos_quotes_aos_contracts',\n\t\t'aos_quotes_aos_invoices',\n\t\t'aos_quotes_project',\n\t\t'aos_quotes_documents_1',\n\t\t'aos_quotes_quser_quoteuser_1',\n\t\t'aos_quotes_quser_quoteuser_2',\n \n );\n\n foreach ($hideSubpanels as $subpanelKey)\n {\n if (isset($subpanel->subpanel_definitions->layout_defs['subpanel_setup'][$subpanelKey]))\n {\n unset($subpanel->subpanel_definitions->layout_defs['subpanel_setup'][$subpanelKey]);\n }\n }\n echo $subpanel->display();\n }\n }",
"public static function panels()\n {\n $panels = Caldera_Forms_Admin_Panel::get_panels();\n if (!empty($panels)) {\n foreach ($panels as $panel) {\n if (!empty($panel['setup']['scripts'])) {\n foreach ($panel['setup']['scripts'] as $script) {\n if (filter_var($script, FILTER_VALIDATE_URL)) {\n self::enqueue_script($script);\n } else {\n wp_enqueue_script($script);\n }\n }\n\n foreach ($panel['setup']['styles'] as $style) {\n if (filter_var($style, FILTER_VALIDATE_URL)) {\n self::enqueue_style($style);\n } else {\n wp_enqueue_style($style);\n }\n }\n }\n }\n }\n }",
"protected function _displaySubPanels()\n {\n\n if (isset($this->bean) && !empty($this->bean->id) && (file_exists('modules/' . $this->module . '/metadata/subpaneldefs.php') || file_exists('custom/modules/' . $this->module . '/metadata/subpaneldefs.php') || file_exists('custom/modules/' . $this->module . '/Ext/Layoutdefs/layoutdefs.ext.php'))) \n {\n\n $GLOBALS['focus'] = $this->bean;\n require_once ('include/SubPanel/SubPanelTiles.php');\n $subpanel = new SubPanelTiles($this->bean, $this->module);\n\n //echo \"<pre>\";print_r($subpanel->subpanel_definitions->layout_defs['subpanel_setup']);die;\n \n $hideSubpanels=array(\n 'abc12_data_fp_event_locations_1',\n \n );\n\n foreach ($hideSubpanels as $subpanelKey)\n {\n if (isset($subpanel->subpanel_definitions->layout_defs['subpanel_setup'][$subpanelKey]))\n {\n unset($subpanel->subpanel_definitions->layout_defs['subpanel_setup'][$subpanelKey]);\n }\n }\n echo $subpanel->display();\n }\n }",
"function gen_panel($panel_name, $panel_icon, $panel_link, $panel_count, $panel_color)\n\t{\n\techo '<div class=\"col-lg-4 col-md-6\">';\n\t\techo '<div class=\"panel '.$panel_color.'\">';\n\t\t\techo '<div class=\"panel-heading\">';\n\t\t\t\techo '<div class=\"row\">';\n\t\t\t\t\techo '<div class=\"col-xs-3\">';\n\t\t\t\t\t\techo '<span class=\"huge-icon glyphicon '.$panel_icon.'\"></span>';\n\t\t\t\t\techo '</div>';\n\t\t\t\t\techo '<div class=\"col-xs-9 text-right\">';\n\t\t\t\t\techo '<div><h1>'.$panel_count.'</h1></div>';\n\t\t\t\t\techo '<div>'.$panel_name.'</div>';\n\t\t\t\t\techo '</div>';\n\t\t\t\techo '</div>';\n\t\t\techo '</div>';\n\t\t\techo '<a href=\"'.$panel_link.'\">';\n\t\t\t\techo '<div class=\"panel-footer\">';\n\t\t\t\t\techo '<span class=\"pull-left\">View '.$panel_name.'</span>';\n\t\t\t\t\techo '<span class=\"pull-right glyphicon glyphicon-circle-arrow-right\"></span>';\n\t\t\t\t\techo '<div class=\"clearfix\"></div>';\n\t\t\t\techo '</div>';\n\t\t\techo '</a>';\n\t\techo '</div>';\n\techo '</div>';\n\t}",
"function _govcms_parkes_render_panel_layout($variables) {\n $attributes = array('class' => 'layout__' . $variables['classes']);\n if (!empty($variables['css_id'])) {\n $attributes['id'] = $variables['css_id'];\n }\n\n $output = '';\n $output .= '<div' . drupal_attributes($attributes) . '>';\n $output .= _govcms_parkes_render_panel_layout_build_grid($variables['layout']['grid'], $variables['content']);\n $output .= '</div>';\n\n return $output;\n}",
"public function buildPanels() {\n return array($this);\n }",
"public function generateHTML()\n\t{\n\t\t$this->defaultClasses['panel'] = array(\"panel\", \"panel-$this->titleColor\");\n\t\t\n\t\t// ..:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::..\n\t\t$this->titleControls[\"dismiss\"] \t= $this->dismissButton;\n\t\t$this->titleControls[\"collapse\"] \t= $this->collapseButton;\n\t\t\n\t\t$titleControls = \"\";\n\t\tif (is_array($this->titleControls))\n\t\t{\n\t\t\t$titleControls = '<span id=\"'.$this->id.'-titleControl\" class=\"panel-titel-controls btn-group\">';\n\t\t\tforeach ($this->titleControls as $control)\n\t\t\t{\n\t\t\t\t$titleControls .= \" \".$control;\n\t\t\t}\n\t\t\t$titleControls .= '</span>';\n\t\t\t\n\t\t\tif ($titleControls != \"\"){\n\t\t\t\t$titleControls = $titleControls.' ';\n\t\t\t}\n\t\t}\n\t\t// ..:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::..\n\t\t$draggable = ($this->draggable === true ? $this->cls_draggable : '') ;\n\t\t\n\t\t// ..:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::..\n\t\t$panelHeading_cls \t= \"panel-heading\";\n\t\t$panelTitle_cls \t= \"panel-title\";\n\t\t$panelBody_cls\t\t= \"panel-body\";\n\t\t\t\t\n\t\t// ..:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::..\n\t\t$title \t= '<div class=\"'.$panelHeading_cls.$draggable.'\"><label class=\"'.$panelTitle_cls.'\">'. $this->collapseButton . $this->panelTitle . $this->dismissButton.'</label>'. $titleControls .'</div>';\n\t\t\n\t\t// ..:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::..\n\t\t$footer\t= '';\n\t\tif ($this->footer != \"\"){\n\t\t\t$footer = '<div class=\"panel-footer panel-'.$this->footerColor.'\">'.$this->footer.'</div>';\n\t\t}\n\t\t\n\t\t$com = '\n\t\t<div id=\"'.$this->id.'\" name=\"'.$this->name.'\" title=\"'.$this->title.'\" '.\n\t\t\t$this->getClassString('panel', true).' '.\n\t\t\t$this->getAttributesString().' '.\n\t\t\t$this->getStyleString().\n\t\t\t'>'.\n\t\t\t$title.'\n\t\t\t<div id=\"'.$this->id.'-body\" class=\"'.$panelBody_cls.' collapse in \">'.\n\t\t\t\t$this->content.'\n\t\t\t</div>\n\t\t\t<div class=\"clearfix\"></div>'.\n\t\t\t$footer.'\n\t\t</div>';\n\t\t\n\t\t// write2Debugfile(self::DEBUG_FILENAME, \"\\nHTML_Panel generated\\n\".$com);\n\t\treturn $com;\n\t}",
"function init_panel( $panels ) {\n\n\t\t$code = 'class ' . $this->parent->slug_ . '_Debug_Panel extends Debug_Bar_Panel {\n\t\t\tstatic $parent;\n\n\t\t\tfunction __construct( $name, &$instance ) {\n\t\t\t\t$this->parent = &$instance;\n\t\t\t\tparent::__construct( $name );\n\t\t\t}\n\n\t\t\tfunction render() {\n\t\t\t\t$this->parent->render();\n\t\t\t}\n\n\t\t\tfunction prerender() {\n\t\t\t\tif ( empty( $this->parent->history ) )\n\t\t\t\t\t$this->set_visible( false );\n\t\t\t}\n\n\t\t}';\n\n\t\t$init = create_function( '', $code );\n\t\t$init( );\n\n\t\treturn $panels;\n\n\t}",
"private function getPanelD($panelTitle, $panelContents) {\r\n\t\t/*\r\n\t\t * Panel Head\r\n\t\t */\r\n\t\t$panelHead = '';\r\n\t\t$panelHead = $panelHead . '<div class=\"panel panel-default\">' . \"\\r\\n\";\r\n\t\t$panelHead = $panelHead . ' <div class=\"panel-heading\">' . \"\\r\\n\";\r\n\t\t$panelHead = $panelHead . ' <h3 class=\"panel-title\">' . $panelTitle . '</h3>' . \"\\r\\n\";\r\n\t\t$panelHead = $panelHead . ' </div>' . \"\\r\\n\";\r\n\t\t\r\n\t\t/*\r\n\t\t * Panel Foot\r\n\t\t */\r\n\t\t$panelFoot = '';\r\n\t\t$panelFoot = $panelFoot . '</div>' . \"\\r\\n\";\r\n\t\t\r\n\t\t/*\r\n\t\t * Panel Body\r\n\t\t * Open PanelBody div tag\r\n\t\t */\r\n\t\t$panelBody = '';\r\n\t\t$panelBody = $panelBody . '<div class=\"panel-body\">' . \"\\r\\n\";\r\n\t\t\r\n\t\tif (is_array ( $panelContents )) {\r\n\t\t\t\r\n\t\t\t$rowCountNumber = count ( $panelContents, COUNT_NORMAL );\r\n\t\t\t\r\n\t\t\tfor($i = 0; $i < $rowCountNumber; $i ++) {\r\n\t\t\t\t\r\n\t\t\t\t/*\r\n\t\t\t\t * Open row div tag\r\n\t\t\t\t */\r\n\t\t\t\t$panelBody = $panelBody . '<div class=\"row\">' . \"\\r\\n\";\r\n\t\t\t\t\r\n\t\t\t\tif (is_array ( $panelContents [$i] )) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t$columnCountNumber = count ( $panelContents [$i], COUNT_NORMAL );\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ($columnCountNumber != 4) {\r\n\t\t\t\t\t\t// not four-columns\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$column0Content = $panelContents [$i] [0];\r\n\t\t\t\t\t\t$column1Content = $panelContents [$i] [1];\r\n\t\t\t\t\t\t$column2Content = $panelContents [$i] [2];\r\n\t\t\t\t\t\t$column3Content = $panelContents [$i] [3];\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$panelBody = $panelBody . '<div class=\"col-md-2 form-group\">' . \"\\r\\n\";\r\n\t\t\t\t\t\t$panelBody = $panelBody . ' <label class=\"control-label\" for=\"countryName\">' . $column0Content . '</label>' . \"\\r\\n\";\r\n\t\t\t\t\t\t$panelBody = $panelBody . '</div>' . \"\\r\\n\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$panelBody = $panelBody . '<div class=\"col-md-4 form-group\">' . \"\\r\\n\";\r\n\t\t\t\t\t\t$panelBody = $panelBody . '\t <div class=\"input-group\">' . $column1Content . '</div>' . \"\\r\\n\";\r\n\t\t\t\t\t\t$panelBody = $panelBody . '</div>' . \"\\r\\n\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$panelBody = $panelBody . '<div class=\"col-md-2 form-group\">' . \"\\r\\n\";\r\n\t\t\t\t\t\t$panelBody = $panelBody . ' <label class=\"control-label\" for=\"countryName\">' . $column2Content . '</label>' . \"\\r\\n\";\r\n\t\t\t\t\t\t$panelBody = $panelBody . '</div>' . \"\\r\\n\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$panelBody = $panelBody . '<div class=\"col-md-4 form-group\">' . \"\\r\\n\";\r\n\t\t\t\t\t\t$panelBody = $panelBody . '\t <div class=\"input-group\">' . $column3Content . '</div>' . \"\\r\\n\";\r\n\t\t\t\t\t\t$panelBody = $panelBody . '</div>' . \"\\r\\n\";\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// $panelContents [i] is not an array\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t/*\r\n\t\t\t\t * Close row div tag\r\n\t\t\t\t */\r\n\t\t\t\t$panelBody = $panelBody . '</div>' . \"\\r\\n\";\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t// $panelContents is not an array\r\n\t\t\t$panelBody = $panelBody . '<div class=\"row\">' . \"\\r\\n\";\r\n\t\t\t$panelBody = $panelBody . ' <div class=\"col-md-12 form-group\">' . \"\\r\\n\";\r\n\t\t\t$panelBody = $panelBody . ' <label class=\"control-label\" for=\"countryName\">There is not any content</label>' . \"\\r\\n\";\r\n\t\t\t$panelBody = $panelBody . ' </div>' . \"\\r\\n\";\r\n\t\t\t$panelBody = $panelBody . '</div>' . \"\\r\\n\";\r\n\t\t}\r\n\t\t\r\n\t\t/*\r\n\t\t * Close PanelBody div tag\r\n\t\t */\r\n\t\t$panelBody = $panelBody . '</div>' . \"\\r\\n\";\r\n\t\t\r\n\t\t/*\r\n\t\t * Return PanelD full HTML content.\r\n\t\t */\r\n\t\treturn $panelHead . $panelBody . $panelFoot;\r\n\t}",
"public function loadPanels()\n\t{\n\t\t//start by loading our main panel\n\t\tif ($panels = $this->getPanelsByType('panel')) {\n\t\t\tforeach ($panels as $key => $panel) {\n\t\t\t\t$this->registerPanel($key, $panel);\n\t\t\t}\n\t\t}\n\t\t//load wp sub panel\n\t\tif ($panels = $this->getPanelsByType( 'wp-sub-panel')) {\n\t\t\t$this->registerWpSubPanel($panels);\n\t\t}\n\t}",
"public function product_write_panel()\n {\n\n global $post;\n\n // Pull the field data out of the database\n $available_fields = array();\n $available_fields[] = maybe_unserialize(get_post_meta($post->ID, 'wc_productdata_options', true));\n\n if ($available_fields) {\n\n // Display fields panel\n foreach ($available_fields as $available_field) {\n\n $fields = $this->wc_fields;\n\n if ($fields == null) {\n return;\n }\n\n\n foreach ($fields as $key => $tab) {\n\n echo '<div id=\"' . $key . '\" class=\"panel woocommerce_options_panel wc_cpdf_tab atf-fields\">'.\n '<div class=\"options_group\">';\n\n foreach ($tab['items'] as $field_id=>$field) {\n if (!isset($fields['id'])) $field['id'] = $field_id;\n if (!isset($fields['label'])) $field['label'] = $field['title'];\n $this->wc_product_data_field($field);\n }\n\n echo '</div>';\n echo '</div>';\n\n }\n\n\n }\n\n }\n\n\n }",
"protected function _showPanel(){\n if(isset($this->options['direction']['showPanel']) && $this->options['direction']['showPanel']){\n return 'directionsDisplay.setPanel(document.getElementById(\"' . $this->options['direction']['panelContainer'] . '\"));';\n }\n }",
"private function tabs_panels() {\n\t\t\tforeach ( $this->tabs as $key => $tab ) {\n\t\t\t\t$active = ( $key === 0 );\n\n\t\t\t\t$panel_class = [ 'wpseo-local-meta-section' ];\n\t\t\t\tif ( $active ) {\n\t\t\t\t\t$panel_class[] = 'active';\n\t\t\t\t}\n\n\t\t\t\techo '<div role=\"tabpanel\" id=\"wpseo-local-tab-' . $tab['id'] . '\" class=\"' . implode( ' ', $panel_class ) . '\">';\n\t\t\t\techo '<div class=\"wpseo-local-metabox-content\">';\n\t\t\t\tdo_action( 'wpseo-local-panel-content-' . $tab['id'] );\n\t\t\t\techo '</div>';\n\t\t\t\techo '</div>';\n\t\t\t}\n\t\t}",
"public function update_panels() {\n return ncurses_update_panels();\n }",
"function df_customizer_get_panel(){\n\t$panels = array(\n\t\t'header' => array( 'header_panel', 'Header', 10, 'sections' => array(\n\t\t\t\t\t// Panel: Header\n\t\t\t\t\t/* Section : Topbar */\n\t\t\t\t\t'topbar' => array( 'topbar_section', _x('Topbar', 'backend customizer', 'backend_dahztheme'), 5),\n\t\t\t\t\t/* Section : Logo Setting */\n\t\t\t\t\t'logo' => array( 'logo_section', _x('Logo', 'backend customizer', 'backend_dahztheme'), 10),\n\t\t\t\t\t/* Section : Navbar */\n\t\t\t\t\t'navbar' => array( 'navbar_section', _x('Navbar', 'backend customizer', 'backend_dahztheme'), 15),\n\t\t\t\t\t/* Section : Navbar Transparency */\n\t\t\t\t\t'navbar_transparency' => array( 'navbar_transparency_section', _x('Transparency', 'backend customizer', 'backend_dahztheme'), 20),\n\t\t\t\t\t/* Section : Sticky */\n\t\t\t\t\t'navbar_sticky' => array( 'navbar_sticky_section', _x('Sticky', 'backend customizer', 'backend_dahztheme'), 25),\n\t\t\t\t\t/* Section : Miscellaneous */\n\t\t\t\t\t'navbar_miscellaneous_section' => array( 'navbar_miscellaneous_section', _x('Miscellaneous', 'backend customizer', 'backend_dahztheme'), 30),\n\t\t\t\t\t/* Section : Page Title */\n\t\t\t\t\t'pagetitle' => array( 'pagetitle_section', _x('Page Title', 'backend customizer', 'backend_dahztheme'), 35)\n\t\t\t\t\t),\n\t\t\t\t\t _x( 'Header is first impression of your website here you can customize the whole part of header area.', 'backend customizer', 'backend_dahztheme' )\n\t\t),\n\t\t'content' => array( 'content_panel', 'Content', 20, 'sections' => array(\n\t\t\t\t\t// Panel: Content\n\t\t\t\t\t/* Section : Outer Area */\n\t\t\t\t\t'outer_area' => array( 'outer_area_section', _x('Outer Area', 'backend customizer','backend_dahztheme'), 0),\n\t\t\t\t\t/* Section : Content Area */\n\t\t\t\t\t'content_area' => array( 'content_area_section', _x('Content Area', 'backend customizer','backend_dahztheme'), 10),\n\t\t\t\t\t/* Section : Typography */\n\t\t\t\t\t'typo' => array( 'typo_section', _x('Typography', 'backend customizer','backend_dahztheme'), 20)\n\t\t\t\t\t),\n\t\t\t\t\t _x( 'Customize your typography and the outer & content area which includes background image, color, and sidebar layout.', 'backend customizer', 'backend_dahztheme' )\n\t\t),\n\t\t'footer' => array( 'footer_panel', 'Footer', 30, 'sections' => array(\n\t\t\t\t\t// Panel: Footer\n\t\t\t\t\t/* Section : Widget Footer */\n\t\t\t\t\t'primary' => array( 'primary_section', _x('Primary Footer', 'backend customizer', 'backend_dahztheme'), 5),\n\t\t\t\t\t/* Section : Copyright Footer */\n\t\t\t\t\t'copyright' => array( 'copyright_section', _x('Copyright Footer', 'backend customizer', 'backend_dahztheme'), 10)\n\t\t\t\t\t),\n\t\t\t\t _x( 'Footer refers to the bottom section that contains information copyright notices, links to privacy policy, credits and widgetized area with multiple columns that you can use to add widgets.', 'backend customizer', 'backend_dahztheme' )\n\t\t),\n\t\t'blog' => array( 'blog_panel', 'Blog', 50, 'sections' => array(\n\t\t\t\t\t// Panel: Blog\n\t\t\t\t\t/* Section : Featured Slider */\n\t\t\t\t\t'featslider' => array( 'featslider_section', _x('Featured Slider', 'backend customizer', 'backend_dahztheme'), 0),\n\t\t\t\t\t/* Section : Layout */\n\t\t\t\t\t'layout' => array( 'layout_section', _x('Layout', 'backend customizer', 'backend_dahztheme'), 10),\n\t\t\t\t\t/* Section : Single Blog */\n\t\t\t\t\t'singleblog' => array( 'singleblog_section', _x('Single Blog', 'backend customizer', 'backend_dahztheme'), 20),\n\t\t\t\t\t/* Section : Archive */\n\t\t\t\t\t'archive' => array( 'archive_section', _x('Archive', 'backend customizer', 'backend_dahztheme'), 30),\n\t\t\t\t\t/* Section : Share */\n\t\t\t\t\t'share' => array( 'share_section', _x('Share', 'backend customizer', 'backend_dahztheme'), 40)\n\t\t\t\t\t),\n\t\t\t\t\t _x( 'Customize your blog appearance, including layout, pagination style, featured slider, archive and sharing options.', 'backend customizer', 'backend_dahztheme' )\n\t\t),\n\t\t'misc' => array( 'misc_panel', 'Misc', 60, 'sections' => array(\n\t\t\t\t\t// Panel: Misc\n\t\t\t\t\t/* Favicon */\n\t\t\t\t\t'site_icon' => array( 'site_icon_section', _x('Site Icon', 'backend customizer', 'backend_dahztheme'), 5),\n\t\t\t\t\t/* Google Analytics */\n\t\t\t\t\t'google_analytics' => array( 'google_analytics_section', _x('Google Analytics', 'backend customizer', 'backend_dahztheme'), 10),\n\t\t\t\t\t/* Social Connects */\n\t\t\t\t\t'social_connect' => array( 'social_connect_section', _x('Social Connect', 'backend customizer', 'backend_dahztheme'), 15),\n\t\t\t\t\t/* 404 */\n\t\t\t\t\t'404' => array( '404_section', _x('404', 'backend customizer', 'backend_dahztheme'), 20),\n\t\t\t\t\t/* Page Loader */\n\t\t\t\t\t'page_loader' => array( 'page_loader_section', _x('Page Loader', 'backend customizer', 'backend_dahztheme'), 25),\n\t\t\t\t\t/* Font Subsets */\n\t\t\t\t\t'font_subset' => array( 'font_subset_section', _x('Font Subset', 'backend customizer', 'backend_dahztheme'), 30)\n\t\t\t\t\t),\n\t\t\t\t\t _x( 'Misc is additional configuration which includes site icon, google analytics, social media URLs, 404 page, page loader and font subset.', 'backend customizer', 'backend_dahztheme' )\n\t\t)\n\t);\n\n\treturn apply_filters( 'create_customizer_panels', $panels );\n}",
"function _add_panels ()\n {\n parent::_add_panels ();\n\n $panel =& $this->panel_at ('folder');\n $panel->rows = 10;\n $panel->columns = 2;\n }",
"function theme_panels_element_style_render_pane($vars) {\n $settings = $vars['settings'];\n $settings['headline-element'] = isset($settings['headline-element']) ? $settings['headline-element'] : 'h2';\n $container_element = (isset($settings['container-element']) && !empty($settings['container-element'])) ? $settings['container-element'] : FALSE;\n $settings['container-element'] = $container_element;\n $content = $vars['content'];\n $attributes = (isset($settings['attributes']) && !empty($settings['attributes'])) ? drupal_attributes($settings['attributes']) : '';\n $settings['attributes'] = $attributes;\n\n // When content is coming from theme_panel_pane().\n if(!isset($content->content)) {\n $content = new StdClass();\n $content->content = $vars['content'];\n }\n\n return theme('panels_element', array('content' => $content, 'settings' => $settings));\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Builds path to bundle.zip archive | protected function getBundlePath()
{
$wrapperPath = $this->getWrapperPath();
$pathSegments = explode('/', $wrapperPath);
array_pop($pathSegments);
$bundlePath = implode('/', $pathSegments) . '/bundles/bundle.zip';
return $bundlePath;
} | [
"public function get_bundle_binary_path () {\n\t\treturn $this->bundle.$this->fields[\"binary\"].\"/\".$this->bundle_binary;\n\t}",
"public function getArchiveDir();",
"public static function artifact()\n {\n return getcwd().'/.vapor/build/app.zip';\n }",
"function GetZipPath() {\n\t\treturn $this->GetXmlPath() . \".gz\";\n\t}",
"public function archivePath(): string\n {\n return $this->getLocalWorkingDirectory().DIRECTORY_SEPARATOR.$this->getArchiveName();\n }",
"function fn_mobile_app_get_archive_full_path()\n{\n static $archive_path = null;\n\n if ($archive_path === null) {\n /** @var \\Tygh\\Backend\\Storage\\File $storage */\n $storage = Storage::instance('custom_files');\n $archive_path = $storage->getAbsolutePath(SETTINGS_ARCHIVE_FILE_NAME);\n }\n\n return $archive_path;\n}",
"public static function getDeliveredZipUri() {\n return Yii::app()->s3->assetsPath . 'projects/zip/';\n }",
"private function getArchiveRelativePath()\n {\n return $this->subdirectoryPath . $this->archiveName;\n }",
"public function createArchiveDirectory()\n\t{\n\t\t$dir = $this->getAdapter()->getCertificatePath() . time() . \"__\" . IL_INST_ID . \"__\" . $this->getAdapter()->getAdapterType() . \"__\" . $this->getAdapter()->getCertificateId() . \"__certificate/\";\n\t\tinclude_once \"./Services/Utilities/classes/class.ilUtil.php\";\n\t\tilUtil::makeDirParents($dir);\n\t\treturn $dir;\n\t}",
"function getArchivePath( $suffix = false ) {\n\t\treturn $this->getLocalCopy($this->repo->getZoneContainer('public'), $this->getArchiveRel( $suffix ));\n\t}",
"function generateZipArchive() {\n\t\t$files = $this->dirToArray( self::$pluginDirectory );\n\t\t$this->buildFlatFile( $files );\n\n\t\t//check and create base directory if needed\n\t\t$upload_dir = wp_upload_dir();\n\t\t$base_dir = $upload_dir['basedir'] . '/bp-generator/';\n\t\t$base_url = $upload_dir['baseurl'] . '/bp-generator/';\n\t\t$time = time();\n\t\t$zipname = $base_dir . $_POST['plugin_file_slug'] . '-' . $time . '.zip';\n\t\t$zipurl = $base_url . $_POST['plugin_file_slug'] . '-' . $time . '.zip';\n\t\tif ( ! is_dir( $base_dir ) ) {\n\t\t\tmkdir( $base_dir, 0755 );\n\t\t}\n\n\t\t$search = [\n\t\t\t'a2 Plugin Blueprint',\n\t\t\t'a2PluginBlueprint',\n\t\t\t'a2-plugin-blueprint',\n\t\t\t'0.1.0',\n\t\t\t'https://github.com/asquaredstudio/a2PluginBlueprint',\n\t\t\t'WordPress plugin template',\n\t\t\t'(a)squaredstudio',\n\t\t\t'https://asquaredstudio.com'\n\t\t];\n\n\t\t$replace = [\n\t\t\t$_POST['plugin_label'],\n\t\t\t$_POST['plugin_namespace'],\n\t\t\t$_POST['plugin_file_slug'],\n\t\t\t$_POST['plugin_version'],\n\t\t\t$_POST['plugin_url'],\n\t\t\t$_POST['plugin_description'],\n\t\t\t$_POST['plugin_author'],\n\t\t\t$_POST['plugin_author_url'],\n\t\t];\n\n\t\t// Create a new zip archive\n\t\t$zip = new \\ZipArchive();\n\t\t$zip->open( $zipname, \\ZipArchive::CREATE );\n\n\n\t\t// Loop through all the results and create the new zip\n\t\tforeach ( $this->flatFileList as $node ) {\n\t\t\tswitch ( $node['type'] ) {\n\t\t\t\tcase 'directory':\n\t\t\t\t\t$dirname = str_replace( self::$pluginDirectory, '', $node['value'] );\n\t\t\t\t\t$zip->addEmptyDir( $dirname );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'file':\n\t\t\t\t\t$contents = str_replace( $search, $replace, file_get_contents( $node['value'] ) );\n\t\t\t\t\t$file = str_replace( self::$pluginDirectory, '', $node['value'] );\n\t\t\t\t\t$file = str_replace( $search, $replace, $file );\n\t\t\t\t\t$zip->addFromString( $file, $contents );\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t$zip->close();\n\t\t$result['url'] = $zipurl;\n\t\t$result['type'] = 'success';\n\t\techo json_encode( $result );\n\t\tdie();\n\t}",
"public function getZippedfile() {\n\t\t\t$data = implode ( \"\", $this->compressedData );\n\t\t\t$controlDirectory = implode ( \"\", $this->centralDirectory );\n\t\t\t\n\t\t\treturn $data . $controlDirectory . $this->endOfCentralDirectory . pack ( \"v\", sizeof ( $this->centralDirectory ) ) . pack ( \"v\", sizeof ( $this->centralDirectory ) ) . pack ( \"V\", strlen ( $controlDirectory ) ) . pack ( \"V\", strlen ( $data ) ) . \"\\x00\\x00\";\n\t\t}",
"public function createTempZip(){\n\t\t$rel_tmp_zip = \"../\".$this->getSkin()->getId().\".zip\";\n\t\tilUtil::zip($this->getSkinDirectory(),$rel_tmp_zip,true);\n\t\treturn rtrim($this->getSkinDirectory(),\"/\").\".zip\";\n\t}",
"private function getSolutionArchivePath(Solution $solution): string\n {\n $dir = self::augmentDir(self::SOLUTIONS, $solution);\n $id = $solution->getId();\n return \"$dir/{$id}.zip\";\n }",
"function GetZipPath($forceAuto=false) {\r\n\t\treturn $this->GetXmlPath($forceAuto) . \".gz\";\t\r\n\t}",
"public function get_unpacked_path()\n {\n }",
"function getArchiveURL() {\n global $serendipity;\n return serendipity_rewriteURL(PATH_ARCHIVES);\n}",
"public function getFinalPath();",
"public function getArchivePath()\n {\n $date = date('Y-m-d_Hms');\n $workflowPath = $this->getWorkflowPath();\n $archivePath = $workflowPath . '/archive/' . $date;\n\n return $archivePath;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Constructs the Tika server URL. | public function getTikaServerUrl()
{
return $this->tikaUrl;
} | [
"private function buildURL ()\n {\n $url = new \\r8\\URL;\n\n // Get the url Scheme from the server protocol\n if ( self::hasKey($this->server, \"SERVER_PROTOCOL\") )\n $url->setScheme( strtolower( strstr( $this->server['SERVER_PROTOCOL'], \"/\", TRUE ) ) );\n\n // Pull the server host, if it is set\n if ( self::hasKey($this->server, 'HTTP_HOST') )\n $url->setHost($this->server['HTTP_HOST']);\n\n // If there is no host, pull the IP address\n else if ( self::hasKey($this->server, \"SERVER_ADDR\") )\n $url->setHost($this->server['SERVER_ADDR']);\n\n // Pull the port\n if ( self::hasKey($this->server, \"SERVER_PORT\") )\n $url->setPort( (int) $this->server['SERVER_PORT'] );\n\n // The path and file name\n if ( self::hasKey($this->server, 'SCRIPT_NAME') )\n $url->setPath( $this->server['SCRIPT_NAME'] );\n\n // The faux directories\n if ( self::hasKey( $this->server, 'PATH_INFO' ) )\n $url->setFauxDir( \\r8\\str\\head( $this->server['PATH_INFO'], \"/\" ) );\n\n // Finally, pull the the URL query\n if ( self::hasKey($this->server, 'QUERY_STRING') )\n $url->setQuery($this->server['QUERY_STRING']);\n\n return $url;\n }",
"private function setServerURL()\n {\n if ($this->config->get('config_secure')) {\n $server_url = $this->config->get('config_ssl');\n } else {\n $server_url = $this->config->get('config_url');\n }\n\n $server_name = $_SERVER['SERVER_NAME'];\n $server_port = $_SERVER['SERVER_PORT'];\n $type = substr($server_url, 0, strpos($server_url, \"//\")+2);\n $subpath = substr($server_url, strpos($server_url, \"//\")+2);\n\n if ($server_port != \"\" || $server_port != \"80\" || $server_port != \"443\") {\n $server_port = \":\" . $server_port;\n } else {\n $server_port = \"\";\n }\n\n $return_url = $type . $server_name . $server_port . substr($subpath, strpos($subpath, \"/\"));\n\n return $return_url;\n }",
"public static function serverURL()\n {\n $host = self::hostname();\n $url = '';\n if ( $host )\n {\n if ( self::isSSLNow() )\n {\n // https case\n $host = preg_replace( '/:\\d+$/', '', $host );\n\n $ini = eZINI::instance();\n $sslPort = $ini->variable( 'SiteSettings', 'SSLPort' );\n\n $sslPortString = ( $sslPort == eZSSLZone::DEFAULT_SSL_PORT ) ? '' : \":$sslPort\";\n $url = \"https://\" . $host . $sslPortString;\n }\n else\n {\n $url = \"http://\" . $host;\n }\n }\n return $url;\n }",
"private function buildUrl()\n {\n $c = $this->getConfiguration();\n return sprintf(\"http%s://%s%s\", $c->isSecure() ? 's' : '', $c->getEndPoint(), $c->getRequestURI());\n }",
"protected function getServerUri() {\n return $this->configuration['scheme'] . '://' . $this->configuration['host'] . ':' . $this->configuration['port'];\n }",
"private function createUrl(): string\n {\n return $this->url . $this->options;\n }",
"private function getServerUrl(): string\n {\n return sprintf('https://%s/cgi/MYchoix_pagepaiement.cgi', $this->serverHostName);\n }",
"private function setUrl()\n {\n curl_setopt($this->curl, CURLOPT_URL, $this->server);\n }",
"protected function buildUrl()\n {\n return $this->settings['protocol']\n . '://'\n . $this->settings['host']\n . '/api/'\n . $this->settings['version']\n . '/'\n . $this->settings['endpoint']\n ;\n }",
"function create_short_server_url()\n\t{\n\t\t// usage: $server_url = create_short_server_url();\n\t\tglobal $config;\n\n\t\tif (!empty($config['short_site_url']))\n\t\t{\n\t\t\treturn $config['short_site_url'];\n\t\t}\n\n\t\t$server_protocol = ($config['cookie_secure']) ? 'https://' : 'http://';\n\t\t$server_name = preg_replace('#^\\/?(.*?)\\/?$#', '\\1', trim($config['server_name']));\n\t\t$server_port = ($config['server_port'] <> 80) ? ':' . trim($config['server_port']) : '';\n\t\t$script_name = preg_replace('/^\\/?(.*?)\\/?$/', '\\1', trim($config['script_path']));\n\t\t$script_name = ($script_name == '') ? '' : '/' . $script_name;\n\t\t//$server_url = $server_protocol . $server_name . $server_port . $script_name;\n\t\t$server_url = $server_name . $server_port . $script_name;\n\t\twhile(substr($server_url, -1, 1) == '/')\n\t\t{\n\t\t\t$server_url = substr($server_url, 0, -1);\n\t\t}\n\t\t$server_url = $server_url . '/';\n\n\t\t//$server_url = 'icyphoenix.com/';\n\n\t\t$config['short_site_url'] = $server_url;\n\t\treturn $server_url;\n\t}",
"private static function getBaseUrl () {\n\t\t$backendUtility = GeneralUtility::makeInstance(BackendUtility::class);\n\t\t$rootLine = $backendUtility->BEgetRootline(1);\n\t\t$TemplateService = GeneralUtility::makeInstance(TemplateService::class);\n\t\t$TemplateService->tt_track = 0;\n\t\t$TemplateService->init();\n\t\t$TemplateService->runThroughTemplates($rootLine);\n\t\t$TemplateService->generateConfig();\n\n\t\t$typoScript = $TemplateService->setup;\n\n\t\t$serverName = filter_input(INPUT_SERVER, 'SERVER_NAME', FILTER_SANITIZE_URL);\n\n\t\treturn !$typoScript['config.']['baseURL'] ? self::getProtocol() . $serverName . '/' : $typoScript['config.']['baseURL'];\n\t}",
"private function _calculatedRESTfmURL() {\n $scheme = '';\n $port = '';\n\n if ($this->_isHTTPS()) {\n $scheme = 'https';\n if ($_SERVER['SERVER_PORT'] !== '443') {\n $port = ':' . $_SERVER['SERVER_PORT'];\n }\n } else {\n $scheme = 'http';\n if ($_SERVER['SERVER_PORT'] !== '80') {\n $port = ':' . $_SERVER['SERVER_PORT'];\n }\n }\n $URL = $scheme . '://' . $_SERVER['SERVER_NAME'] . $port . $this->_calculatedBaseURI();\n return($URL);\n }",
"public function getServerRoot() {\n\t\treturn \"http://{$this->host}:{$this->port}\";\n\t}",
"function subi_url()\n\t{\n\t\t$s = $_SERVER;\n\t\t$ssl = (!empty($s['HTTPS']) && $s['HTTPS'] == 'on') ? true:false;\n\t\t$sp = strtolower($s['SERVER_PROTOCOL']);\n\t\t$protocol = substr($sp, 0, strpos($sp, '/')) . (($ssl) ? 's' : '');\n\t\t$port = $s['SERVER_PORT'];\n\t\t$port = ((!$ssl && $port=='80') || ($ssl && $port=='443')) ? '' : ':'.$port;\n\t\t$host = isset($s['HTTP_X_FORWARDED_HOST']) ? $s['HTTP_X_FORWARDED_HOST'] : isset($s['HTTP_HOST']) ? $s['HTTP_HOST'] : $s['SERVER_NAME'];\n\t\t// Hack to get to proper subi on localhost\n\t\tif ($host == 'localhost' && $port == '') {\n\t\t\t$port = ':8080';\n\t\t\t$protocol = \"http\";\n\t\t}\n\t\treturn $protocol . '://' . $host . $port . '/subi';\n\t}",
"public static function get_server_url()\n {\n /* Defining the server's protocol */\n if(!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) != 'off')\n $protocol = 'https';\n else\n $protocol = 'http';\n\n /* Defining server name */\n $serverName = $_SERVER['SERVER_NAME'];\n\n /* Defining server port */\n if ($_SERVER['SERVER_PORT'] != 80 || $_SERVER['SERVER_PORT'] != 443) {\n $port = \":{$_SERVER['SERVER_PORT']}\";\n } else {\n $port = '';\n }\n\n return $protocol . '://' . $serverName . $port;\n }",
"function getRootUrl()\n\t{\n\t\t/*$aPath = (pathinfo($kutuRootDir));\n\t\t\n\t\t//$serverHttpHost = '';\n\t\t\n\t\t$serverHttpHost = $_SERVER['HTTP_HOST'];\n\t\t$serverHttpHost = str_replace(':443','',$serverHttpHost);\n\t\t\n\t\tif (isset($_SERVER[\"HTTPS\"]) && $_SERVER[\"HTTPS\"] == \"on\")\n\t\t{\n\t\t\t//$serverHttpHost .= ':443';\n\t\t\t$httpPrefix = 'https://';\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$httpPrefix = 'http://';\n\t\t}\n\t\t\n\t\t$sTmpPathUrl = $serverHttpHost .'/'.$aPath['basename'];\n\t\t//$sTmpPathUrl = strstr($this->selfURLNoPort(), $sTmpPathUrl);\n\t\t//$sTmpPathUrl = strstr($this->selfURL(), $sTmpPathUrl);\n\t\t\n\t\tif(!empty($sTmpPathUrl))\n\t\t\treturn $httpPrefix.$serverHttpHost.'/'.$aPath['basename'];\n\t\telse \n\t\t\treturn $httpPrefix.$serverHttpHost; */\n\t\t\t\n\t\t$s = empty($_SERVER[\"HTTPS\"]) ? '' \n\t\t\t\t: ($_SERVER[\"HTTPS\"] == \"on\") ? \"s\" \n\t\t\t\t: \"\"; \n\t\t$protocol = $this->strleft(strtolower($_SERVER[\"SERVER_PROTOCOL\"]), \"/\").$s; \n\t\t$port = ($_SERVER[\"SERVER_PORT\"] == \"80\") ? \"\" \n\t\t\t\t: (\":\".$_SERVER[\"SERVER_PORT\"]); \n\t\treturn $protocol.\"://\".$_SERVER['SERVER_NAME'].$port;\n\t}",
"public function buildBackendUri() {}",
"protected function prepareUrl()\n {\n //Construct the current URL\n $this->url = 'http';\n if ($this->getServerInfo('server_port') == 443\n || $this->getServerInfo('https') == 'on'\n ) {\n $this->url .= 's';\n }\n $this->url .= '://' . $this->getHeader('host');\n\n $script = $this->getServerInfo('script_name');\n $this->url .= $script;\n\n // Check for URL Rewriting\n $uri = $this->getServerInfo('request_uri');\n $path = $this->getServerInfo('path_info');\n $path = $path === '/' ? '' : $path;\n if (strlen($path) > 0 && substr($path, -1) === '/') {\n $path = substr($path, 0, strlen($path) - 1);\n }\n if (substr($uri, 0, strlen($script)) !== $script) {\n $this->url = preg_replace('|/' . basename($script) . '$|', $path, $this->url);\n } else {\n $this->url .= $path;\n }\n }",
"public function getRequestURL()\n\t\t{\n\t\t\t$url = 'http'.($this->use_ssl ? 's' : '').'://'.$this->host;\n\t\t\tif (!$this->use_ssl && $this->port != 80 || $this->use_ssl && $this->port != 443) {\n\t\t\t\t$url .= ':'.$this->port;\n\t\t\t}\n\t\t\t$url .= $this->path;\n\t\t\treturn $url;\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
============================================================================ Generates the data corresponding to a single album's information. ============================================================================ | private function generateAlbumComponentAlbumData() {
$requestedAlbumName = RequestHelpers::getRawValue("albumName");
if (is_null($requestedAlbumName)) {
ResponseHelpers::respondNotFound();
return;
}
$album = NULL;
if ($requestedAlbumName != LATEST_ALBUM_NAME) {
if ($requestedAlbumName === DEFAULT_ALBUM_NAME_QUERY) {
$requestedAlbumName = DEFAULT_ALBUM_NAME;
}
$album = GalleryAlbumList::getAlbumByName($this->db, $requestedAlbumName);
} else {
$album = $this->generateLatestAlbumInfo();
}
if ($album === NULL) {
ResponseHelpers::respondNotFound();
return;
}
$output = $this->generateAlbumInfo($album);
ResponseHelpers::outputWithJsonHeader($output);
} | [
"private function generateAlbumListAlbumData() {\n $output = array(\n $this->generateAlbumInfo($this->generateLatestAlbumInfo())\n );\n foreach ($this->galleryAlbumCache as $cachedAlbum) {\n $output[] = $this->generateAlbumInfo($cachedAlbum);\n }\n\n ResponseHelpers::outputWithJsonHeader($output);\n }",
"public static function extractInfos($album)\n {\n // create Album instance\n $albumItem = new self();\n\n // update informations\n $albumItem->setUri((string) (isset($album->href)) ? $album->href : '');\n $albumItem->setName((string) (isset($album->name)) ? $album->name : '');\n\n // is popularity available ?\n if (isset($album->popularity)) {\n\n // update popularity\n $albumItem->setPopularity((float) $album->popularity);\n }\n\n // is released date available ?\n if (isset($album->released)) {\n\n // update released dates\n $albumItem->setReleased((string) $album->released);\n }\n\n // is teritories availabality available ?\n if (isset($album->availability) && isset($album->availability->territories)) {\n\n // update territories availability\n $albumItem->setTerritories(explode(' ', $album->availability->territories));\n }\n\n // is artists available (from search service) ?\n if (isset($album->artists) && is_array($album->artists)) {\n\n // setup artists container\n $artists = array();\n\n // iterate artists\n foreach ($album->artists as $artist) {\n\n // create Artist and store on container\n $artists[] = Artist::extractInfos($artist);\n }\n\n // set artists of album\n $albumItem->setArtists($artists);\n }\n\n // is artists available (from lookup service) ?\n if (isset($album->{'artist-id'}) && isset($album->artist)) {\n\n // create and store principal artist\n $albumItem->setArtist(Artist::build($album->{'artist-id'}, $album->artist));\n }\n\n // is tracks available ?\n if (isset($album->tracks) && is_array($album->tracks)) {\n\n // setup tracks container\n $tracks = array();\n\n // iterate external ids\n foreach ($album->tracks as $track) {\n\n // create Track and store on container\n $tracks[] = Track::extractInfos($track);\n }\n\n // set albums tracks\n $albumItem->setTracks($tracks);\n }\n\n // is external ids available ?\n if (isset($album->{'external-ids'}) && is_array($album->{'external-ids'})) {\n\n // setup external ids container\n $externalIds = array();\n\n // iterate external ids\n foreach ($album->{'external-ids'} as $externalId) {\n\n // create ExternalId and store on container\n $externalIds[] = ExternalId::extractInfos($externalId);\n }\n\n // set external ids of album\n $albumItem->setExternalIds($externalIds);\n }\n\n // return album instance\n return $albumItem;\n }",
"private function buildAlbumInformation(array $albumData): array\n {\n return [\n 'url' => array_get($albumData, 'url'),\n 'image' => count($albumData['image']) > 3 ? $albumData['image'][3] : $albumData['image'][0],\n 'wiki' => [\n 'summary' => $this->formatText(array_get($albumData, 'wiki.summary', '')),\n 'full' => $this->formatText(array_get($albumData, 'wiki.content', '')),\n ],\n 'tracks' => array_map(function ($track) {\n return [\n 'title' => $track['name'],\n 'length' => (int) $track['duration'],\n 'url' => $track['url'],\n ];\n }, array_get($albumData, 'tracks.track', [])),\n ];\n }",
"function api_gallery_album_info() {\n\t/* validate data*/\n\tvalidate_fields($fields, $_POST, array(\"club_id\"), array(\"id\"), array(), $errors, false);\n\n\tif (!empty($errors)) {\n\t\taerr($errors);\n\t}\n\n\t/* Getting and returning info*/\n\t$db = new db;\n $table = (isset($fields['club_id']) && $fields['club_id'] > 0)?'albums_clubs':'albums';\n unset($fields[\"club_id\"]);\n\t$info = $db->getRow(\"SELECT * FROM \".$table.\" WHERE id = ?i;\", $fields[\"id\"]);\n\tif ($info == NULL) {\n\t\taerr(array(\"Запрашиваемый альбом не найден.\"));\n\t} else {\n\t\taok($info);\n\t}\n}",
"private function generateLatestAlbumInfo() {\n // TODO: get from settings or something.\n $latestAlbumInfo = array(\n \"id\" => LATEST_ALBUM_ID,\n \"title\" => \"Latest works\",\n \"name\" => LATEST_ALBUM_NAME,\n \"description\" => \"This album shows all images I have uploaded, latest first.\"\n );\n return new GalleryAlbum($latestAlbumInfo);\n }",
"function setup_album()\n {\n $this->ipsclass->DB->simple_construct( array( \"select\" => 'id, name, member_id, public_album', 'from' => 'gallery_albums', 'where' => \"id={$this->ipsclass->input['album']}\" ) );\n $this->ipsclass->DB->simple_exec(); \n $info = $this->ipsclass->DB->fetch_row();\n\n // Are we allowed to view this album?\n if( $info['member_id'] == $this->ipsclass->member['id'] )\n {\n $own = true;\n }\n\n if( ! $info['public_album'] && ! $own )\n {\n $this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission' ) );\n }\n\n return $info;\n }",
"private function generateAlbumComponentImageData() {\n $page = RequestHelpers::getNumericValue(\"page\", 1);\n $requestedPage = $page - 1;\n if ($requestedPage < 0) {\n $requestedPage = 0;\n }\n\n $requestedName = RequestHelpers::getRawValue(\"albumName\");\n if (is_null($requestedName)) {\n ResponseHelpers::respondNotFound();\n return;\n }\n\n $numberImagesToLoad = RequestHelpers::getNumericValue(\"count\", IMAGES_PER_PAGE);\n if ($numberImagesToLoad <= 0) {\n $numberImagesToLoad = IMAGES_PER_PAGE;\n }\n\n $requestedAlbumId = LATEST_ALBUM_ID;\n if ($requestedName !== LATEST_ALBUM_NAME) {\n if ($requestedName === DEFAULT_ALBUM_NAME_QUERY) {\n $requestedName = DEFAULT_ALBUM_NAME;\n }\n\n // Look up album - returns null if it doesn't exist.\n $currentAlbum = GalleryAlbumList::getAlbumByName($this->db, $requestedName);\n if ($currentAlbum === NULL) {\n ResponseHelpers::respondNotFound();\n return;\n }\n\n $requestedAlbumId = $currentAlbum->getId();\n }\n\n $galleryImages = new GalleryImageList($this->db, $numberImagesToLoad, $requestedPage, $requestedAlbumId);\n $output = array();\n\n foreach ($galleryImages as $image) {\n $output[] = $this->generateImageInfo($image);\n }\n\n ResponseHelpers::outputWithJsonHeader($output);\n }",
"public function getAlbums();",
"public static function loadAlbums()\n {\n // load file\n return self::loadFile('albums.json');\n }",
"function album(){\n\n\trequire('config_freamwork.php');\n\t\n\t$json = '{\"jsonrpc\": \"2.0\", \"method\": \"AudioLibrary.GetAlbums\", \"params\": { \"limits\": { \"start\": 0 }, \"fields\": [\"description\", \"theme\", \"mood\", \"style\", \"type\", \"label\", \"artist\", \"genre\", \"rating\", \"title\", \"year\", \"thumbnail\" , \"fanart\"], \"sort\": { \"method\": \"artist\" } }, \"id\": 1}';\n\t\n\t$chiamata = curl_init();\n\tcurl_setopt($chiamata, CURLOPT_RETURNTRANSFER,true);\n\tcurl_setopt($chiamata, CURLOPT_POST ,1);\n\tcurl_setopt($chiamata, CURLOPT_URL ,$hostjsonrpc);\n\tcurl_setopt($chiamata, CURLOPT_USERPWD ,\"$username:$password\");\n\tcurl_setopt($chiamata, CURLOPT_POSTFIELDS ,$json);\n\t$json = curl_exec($chiamata);\n\tcurl_close($chiamata);\t\n\treturn $json;\n\t\n\t// id = albums\n\t\n}",
"public function getAlbum($album_name) {\n $query = \"SELECT\n al.id,\n al.name,\n al.year,\n al.version,\n al.location,\n al.sport,\n al.event_type,\n al.manufacturer,\n al.url\n FROM \" . $this->__schema . \".album al\n WHERE al.name = \" . $this->db()->quote($album_name);\n $data = $this->db()->getRow($query);\n if ($data) {\n return [\n 'success' => TRUE,\n 'payload' => $data,\n ];\n }\n else {\n return [\n 'success' => FALSE,\n 'payload' => NULL,\n ];\n }\n }",
"public function addAlbum() {\n\t\t$aVals = array(\n\t\t\t'name' => $this->_oApi->get('title'),\n\t\t\t'description' => $this->_oApi->get('description'),\n\t\t\t'privacy' => $this->_oApi->get('privacy'),\n\t\t\t'privacy_comment' => $this->_oApi->get('privacy_comment'),\n\t\t);\n\n\t\t$iAlbumId = Phpfox::getService('photo.album.process')->add($aVals);\n\t\tif (is_int($iAlbumId)) {\t\t\t\n\t\t\t$aVals['album_id'] = $iAlbumId;\n\t\t\t$aVals['album_title'] = $aVals['name'];\n\t\t\t$aVals['album_total'] = 0;\n\t\t\treturn $aVals; \n\t\t}\n\t\t\n\t\t$aErrors = Phpfox_Error::get();\n\t\treturn $this->_oApi->error('accountapi.add_album_error', $aErrors[count($aErrors) - 1]);\n\t}",
"public function getSerializedAlbum() : array\n {\n return [\n 'artist' => ['token' => $this->getArtist()->getToken()->getTokenValue(), 'name' => $this->getArtist()->getName()],\n 'token' => $this->getToken()->getTokenValue(),\n 'title' => $this->getTitle(),\n 'description' => $this->getDescription(),\n 'songs' => $this->getSerializedSongs(),\n ];\n }",
"public function addAlbum ($data);",
"public function getAlbum()\n {\n return $this->album;\n }",
"public function getAlbum() {\n return db_select('cfas_albums', 'cfas')\n ->fields('cfas', array('album_url', 'created', 'images'))\n ->condition('album_url', $this->album_url)\n ->condition('created', time() - $this->time_limit, '>')\n ->execute()\n ->fetchAssoc();\n }",
"public function getAlbumId();",
"public function getAlbum() {\r\n\treturn $this->album;\r\n }",
"public function getAlbumId()\n {\n return $this->album_id;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Window upper left Y coordinate | public function windowY() { return $this->_m_windowY; } | [
"public function getTop(){\n return $this->gridPosition->getY();\n }",
"function GetMouseY(): int { return 0; }",
"public function getY() {\n return $this->pPosition->top;\n }",
"public function getPosy()\n\t{\n\t\treturn $this->posy;\n\t}",
"public function getPositionY() {\n\t\treturn $this->elements['position']['y'];\n\t}",
"public function getCurrentY() {\n\t\treturn $this->currentY;\n\t}",
"public function getPositionY()\n {\n return $this->position_y;\n }",
"public function getPositionY ()\n {\n return $this->_positionY;\n }",
"public function getCoordY() {\n \treturn $this->_coordY;\n }",
"public function getBottomMostY()\n {\n if (null == $this->_bottomMostY) {\n $this->_bottomMostY = $this->getConfig()->getBoundingBox()->getAbsY2();\n $parent = $this->getParent();\n while ($parent) {\n $padding = $parent->getStyle()->get(Style::STYLE_PADDING_BOTTOM, 0);\n $this->_bottomMostY += $padding;\n $parent = $parent->getParent();\n }\n }\n return $this->_bottomMostY;\n }",
"public function getPositionY()\n {\n return $this->positionY;\n }",
"public function getCurrentWindowPosition()\n\t{\n\t\t$command = new Commands\\GetWindowPosition($this, null, array('window_handle' => 'current'));\n\t\t$results = $command->execute(); \n\t\treturn $results['value'];\t\n\t}",
"public function getYouth()\r\n {\r\n return $this->youth;\r\n }",
"public function getPositionY()\r\n {\r\n return $this->_positionY;\r\n }",
"public function getMaxY()\n {\n return $this->_maxY;\n }",
"public function getY()\n {\n return $this->position->getY();\n }",
"public function getCurrentWindowPosition()\n\t{\n\t\t$windowHandle = $this->getCurrentWindowHandle();\n\t\treturn $this->getWindowPosition($windowHandle);\n\t}",
"public function getMinY()\n {\n return $this->getY();\n }",
"public function getSightingLocY(): float {\n\t\treturn $this->sightingLocY;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Clear tracking code session | private function clearTrackCodeStore()
{
Yii::$app->session->set(self::SESSION_NAME,[]);
} | [
"public function clearSession();",
"private function clearSession() {\n\t\t$this->session->delete(\"fb_\".FB_APP_ID.\"_code\");\n\t\t$this->session->delete(\"fb_\".FB_APP_ID.\"_access_token\");\n\t\t$this->session->delete(\"fb_\".FB_APP_ID.\"_user_id\");\n\t\t$this->session->delete(\"ot\");\n\t\t$this->session->delete(\"ots\");\n\t\t$this->session->delete(\"oauth.linkedin\");\n\t\t$this->session->delete(\"fs_access_token\");\n\t\t$this->session->delete(\"G_token\");\n\t}",
"private static function clearLocalSessionData()\n {\n self::$logger->debug('Clear Session Data');\n self::$gid_things->setAccessToken(null);\n self::$gid_things->setRefreshToken(null);\n self::$gid_things->setLoginStatus(null);\n\n OAuth::deleteStoredToken(iTokenTypes::ACCESS_TOKEN);\n OAuth::deleteStoredToken(iTokenTypes::REFRESH_TOKEN);\n\n if (isset($_SESSION)) {\n unset($_SESSION['Things']);\n foreach ($_SESSION as $key => $val) {\n if (preg_match('#^headerAuth#Ui', $key) || in_array($key, array('nickUserLogged', 'isConnected'))) {\n unset($_SESSION[$key]);\n }\n }\n }\n }",
"public static function gaCleanSession()\r\n {\r\n if( isset($_SESSION['google_trans']) ) {\r\n $_SESSION['google_trans']=null;\r\n unset($_SESSION['google_trans']);\r\n }\r\n if( isset($_SESSION['google_item']) ) {\r\n $_SESSION['google_item']=null;\r\n unset($_SESSION['google_item']);\r\n }\r\n if( isset($_SESSION['google_trackPageview']) ) {\r\n $_SESSION['google_trackPageview']=null;\r\n unset($_SESSION['google_trackPageview']);\r\n }\r\n }",
"public static function clearLoggedTrace()\n {\n databaseAPI::getInstance()->deleteData(\"sessions\", ['field'=> 'user_id', 'value' => usersAPI::getLoggedId()]);\n Session::destroy(LOGIN_SESSION_NAME);\n Cookie::delete(REM_COOKIE_NAME);\n }",
"public function deleteSession()\n {\n $this->httpSession()->delete('webiny_website_analytics');\n }",
"function clear_session_info_regard_to_this_agent($session_id){\n\t\n\t\tglobal $connection;\n\t\tAppModel::grab_db_function_class()->execute_query(\"DELETE FROM pfagos__session_data WHERE session_id = '{$session_id}'\");\t\t\n\t}",
"protected function clear()\n {\n session()->remove('steps');\n }",
"public static function Clear_Google_Login_Session(){\r\n self::delete('Guid');\r\n self::delete('email');\r\n self::delete('fname');\r\n self::delete('lname');\r\n self::delete('fullname');\r\n self::delete('picture');\r\n\r\n }",
"public static function clearSessionOfFinTsValues()\n {\n Session::remove(AppConstants::$SESSION_FINTS_OBJECT);\n Session::remove(AppConstants::$SESSION_TAN_ACTION);\n Session::remove(AppConstants::$SESSION_TAN_MEDIUM);\n Session::remove(AppConstants::$SESSION_TAN_MODE);\n Session::remove(AppConstants::$SESSION_AVAILABLE_TAN_MEDIA);\n Session::remove(AppConstants::$SESSION_SEPA_ACCOUNT);\n }",
"public function clearAllTicketCodes() {\r\n\t\t$this->ticketCodes = array();\r\n\t\t$this->saveCodesToSession();\r\n\t}",
"public function reset() {\n $this->papaya()->session->setValue($this->_sessionIdentifier, NULL);\n }",
"public function clearCache() {\n\t\t$session_key = \"simbila-\".$this->_appId.\"-\".$this->_appUser;\n\t\tif(isset($_SESSION[$session_key])) {\n\t\t\tunset($_SESSION[$session_key]);\n\t\t}\n\t}",
"function clear_token()\n\t{\n\t\t$_SESSION['sec_token'] = null;\n\t\tunset($_SESSION['sec_token']);\n\t}",
"private function _clear_session() {\n Session::instance()->delete(\"twitter_oauth_token\");\n Session::instance()->delete(\"twitter_oauth_token_secret\");\n Session::instance()->delete(\"twitter_access_token\");\n }",
"protected function clearSessionValues()\n {\n unset($_SESSION[static::PHPCAS_SESSION_PREFIX]);\n }",
"public function clearSession()\n {\n $this->clear();\n $this->fingerprint->checkSessionPrint($this);\n $this->regenerateSession();\n }",
"static function clear() {\n\t\tforeach (array_keys(Session::$_data) as $key) {\n\t\t\tunset(Session::$_data[$key]);\n\t\t}\n\t}",
"public function clear() {\n\t\tforeach ( array_keys ( $_SESSION ) as $key )\n\t\t\tunset ( $_SESSION [$key] );\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Copies required data from the PO line item to this shipment item. | public function copyFromPOItem(OrderLineItem $poItem): void
{
$this->sequenceNumber = $poItem->sequenceNumber;
$this->sequenceNumberLength = $poItem->sequenceNumberLength;
$this->buyerPartNumber = $poItem->buyerPartNumber;
$this->vendorPartNumber = $poItem->vendorPartNumber;
$this->consumerPackageCode = $poItem->consumerPackageCode;
$this->orderedQty = $poItem->orderedQty;
$this->orderedQtyUOM = $poItem->orderedQtyUOM;
} | [
"public function populateLineItem(Commerce_LineItemModel $lineItem);",
"function set_shipment_data() {\n\t\tif (!$this->check_return_shipment()) { // create an empty record if there is no shipment data\n\t\t\t$this->insert_new_shipment();\n\t\t}\n\t\t$sql = sprintf(\"SELECT * FROM %s WHERE order_id = %d\", SHIP_ADDRESS, $_SESSION['order_id']);\n\t\tif ($result = mysql_query($sql)) {\n\t\t\t$obj = mysql_fetch_object($result);\n\t\t\t$this->ship_name = $obj->FirstName;\n\t\t\t$this->ship_name2 = $obj->LastName;\n\t\t\t$this->ship_address = $obj->address;\n\t\t\t$this->ship_address2 = $obj->address2;\n\t\t\t$this->ship_zipcode = $obj->ZipCode;\n\t\t\t$this->ship_city = $obj->City;\n\t\t\t$this->ship_state = $obj->State;\n\t\t\t$this->ship_phone = $obj->phone;\n\t\t\t$this->ship_msg = $obj->message;\n\t\t} else {\n\t\t\t$this->error = $this->messages(1);\n\t\t}\n\t}",
"private function setOrderLineInit(): void\n {\n //====================================================================//\n // Read Next Order Product Line\n $this->orderItem = array_shift($this->orderItems);\n //====================================================================//\n // Empty => create New Line\n if (!$this->orderItem) {\n /** @var Mage_Sales_Model_Order_Item $model */\n $model = Mage::getModel('sales/order_item');\n //====================================================================//\n // create New Order Item\n $this->orderItem = $model\n ->setStoreId($this->object->getStore()->getStoreId())\n ->setQuoteItemId(0)\n ->setQuoteParentItemId(0)\n ->setOrder($this->object);\n //====================================================================//\n // Add Item to Order\n $this->object->addItem($this->orderItem);\n Splash::log()->deb(\"New Order Item created\");\n }\n }",
"public function assignShipmentItem(ShipmentItemInterface $item): void;",
"public function setSpecialPropertiesForShipmentLine(&$orderLine, $order)\n {\n $orderLine->setPrice($order->getShippingAmount())\n ->setNetPrice($order->getBaseShippingAmount())\n ->setQuantity(1)\n ->setDiscountAmount($order->getShippingDiscountAmount());\n }",
"public function __construct(OrderInterface $cart, LineItemInterface $line_item, LineItemInterface $original_line_item) {\n $this->cart = $cart;\n $this->lineItem = $line_item;\n $this->originalLineItem = $original_line_item;\n }",
"public function testUpdateParcelInvoiceLine()\n {\n }",
"public function set_item_shipped( $order_id, $item_id, $shipped_quantity = 0, $shipped_date = NULL )\n\t{\n\t\t$order = new WC_Order( $order_id );\n\t\t//$item = $order->get_item_meta( $item_id );\n\t\t$item = new WC_Order_Item_Product($item_id);\n\t\t\n\t\t$shippedInfo = wc_get_order_item_meta($item->get_id(), 'shipped');\n\t\t\n\t\tif( is_null( $shipped_date ) ) $shipped_date = date( 'M j, Y' ); //now\n\t\t\n\t\t$shipped_info = ( isset( $item['shipped'] ) && !empty( $item['shipped'][0] ) ) ? maybe_unserialize( $item['shipped'][0] ) : array();\n\t\t\n\t\tif( $shipped_quantity == 0 ){\n\t\t\t$total_shipped = $this->get_total_quantity_shipped( $shippedInfo ); //get remaining quantity\n\t\t\t$shipped_quantity = (int)$item->get_quantity() - $total_shipped;\n\t\t\t\n\t\t}\n\t\t\n\t\tif( $shipped_quantity > 0 ){\n\t\t\t$shippedInfo[] = array(\n\t\t\t\t'qty' => $shipped_quantity,\n\t\t\t\t'date' => $shipped_date\n\t\t\t);\t\t\n\t\t\n\t\t\twc_update_order_item_meta( $item_id, 'shipped', $shippedInfo );\n\t\t\t\n\t\t\t//save what was shipped so the email can be sent\n\t\t\t$email_info = get_post_meta( $order_id, 'partial_orders_email', TRUE ); \n\t\t\tif( !empty( $email_info ) ){\n\t\t\t\n\t\t\t\tif( array_key_exists( $item_id, $email_info ) ){ //item shipped before\n\t\t\t\t\t\n\t\t\t\t\tif( array_key_exists( $shipped_date, $email_info[$item_id] ) ){ //shipped date already exists\n\t\t\t\t\t\t\n\t\t\t\t\t\t$email_info[$item_id][$shipped_date] += (int)$shipped_quantity;\n\t\t\t\t\t\t\n\t\t\t\t\t} else{\n\t\t\t\t\t\t$email_info[$item_id][$shipped_date] = (int)$shipped_quantity;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t$email_info[$item_id] = array( $shipped_date => (int)$shipped_quantity );\n\t\t\t\t}\n\t\t\t\n\t\t\t} else {\n\t\t\t\t$email_info = array( $item_id => array( $shipped_date => (int)$shipped_quantity ) );\n\t\t\t}\n\t\t\tupdate_post_meta( $order_id, 'partial_orders_email', $email_info );\n\t\t\t\n\t\t\t$item['shipped'][0] = $shippedInfo; //save a db call and update it here\n\t\t}\n\t\t\n\t\treturn $item;\n\n\t}",
"protected function _addWarehouseShipmentItem($item)\n {\n /** @var \\Magento\\Sales\\Model\\Order\\Item $simpleItem */\n $simpleItem = $this->_getSimpleOrderItem($item);\n $shipWarehouse = $this->getShipmentWarehouse($item);\n if (!$shipWarehouse)\n return $this;\n \n $this->queryProcess->addQuery([\n 'type' => QueryProcessorInterface::QUERY_TYPE_UPDATE,\n 'values' => ['warehouse_id' => $shipWarehouse->getId()], \n 'condition' => ['entity_id=?' => $item->getId()],\n 'table' => $item->getResource()->getMainTable(),\n ], $this->process); \n \n /*\n $warehouseShipModel = $this->warehouseShipmentItemFactory->create();\n $warehouseShipData = [\n 'warehouse_id' => $shipWarehouse->getId(),\n 'shipment_id' => $item->getParentId(),\n 'item_id' => $item->getId(),\n 'order_id' => $item->getOrderItem()->getOrderId(),\n 'order_item_id' => $item->getOrderItemId(),\n 'product_id' => $simpleItem->getProductId(),\n 'qty_shipped' => $this->_getShippedQty($item),\n 'subtotal' => $item->getPrice(),\n 'created_at' => $item->getShipment()->getCreatedAt(),\n 'updated_at' => $item->getShipment()->getUpdatedAt(),\n ];\n $this->queryProcess->addQuery([\n 'type' => QueryProcessorInterface::QUERY_TYPE_INSERT,\n 'values' => [$warehouseShipData],\n 'table' => $warehouseShipModel->getResource()->getMainTable(),\n ], 'shipment');\n */\n }",
"public function saveLineItems(){\n\t\t// Insert/update new/existing items:\n\t\tif(isset($this->_lineItems)){\n\t\t\tforeach($this->_lineItems as $item){\n\t\t\t\t$item->quoteId = $this->id;\n $product = X2Model::model('Products')->findByAttributes(array(\n 'name'=>$item->name\n ));\n if (isset($product))\n $item->productId = $product->id;\n\t\t\t\t$item->save();\n\t\t\t}\n\t\t}\n\t\tif(isset($this->_deleteLineItems)) {\n\t\t\t// Delete all deleted items:\n\t\t\tforeach($this->_deleteLineItems as $item)\n\t\t\t\t$item->delete();\n\t\t\t$this->_deleteLineItems = null;\n\t\t}\n\t}",
"public function addShippingData()\n {\n $this->apiOrder->setShippingAddress($this->wcShippingAddress());\n }",
"public function copyBillingToShipping()\n {\n $this->setShippingFirstName($this->getBillingFirstName());\n $this->setShippingLastName($this->getBillingLastName());\n $this->setShippingAddress($this->getBillingAddress());\n $this->setShippingCity($this->getBillingCity());\n $this->setShippingState($this->getBillingState());\n $this->setShippingPostalCode($this->getBillingPostalCode());\n $this->setShippingCountry($this->getBillingCountry());\n }",
"public function copyFrom( \\Aimeos\\MShop\\Product\\Item\\Iface $product );",
"public function setCompleteItem() {\n\t\t$rawItems = Item::$rawItems;\n\t\tif (isset($rawItems[$this->idItem]['amount'])) {\n\t\t\t$this->amount = ($rawItems[$this->idItem]['amount']);\n\t\t}\n\t\tif (isset($rawItems[$this->idItem]['name'])) {\n\t\t\t$this->name = ($rawItems[$this->idItem]['name']);\n\t\t}\n\t\tif (isset($rawItems[$this->idItem]['price'])) {\n\t\t\t$this->price = ($rawItems[$this->idItem]['price']);\n\t\t}\n\t}",
"public function copyFrom( \\Aimeos\\MShop\\Common\\Item\\Address\\Iface $item );",
"public static function copy_unqiue_id_to_order_shipping( WC_Order_Item_Shipping $item, $package_key, $package, WC_Order $order = null ) {\n\t\t$item->add_meta_data( '_postfinancecheckout_unique_line_item_id', self::get_uuid(), true );\n\t\treturn $item;\n\t}",
"public function testGETShipmentIdShipmentLineItems()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function lineItemUpdated() {\n CommercePosGratuityService::updateOrderGratuities($this->transaction->getOrderWrapper());\n }",
"public function setShipment(LineView $line): self\n {\n $this->shipment = $line;\n\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Relation of subcategories model and part model | public function subcategories()
{
return $this->belongsTo(PartSubcategory::class);
} | [
"public function subcategories()\n {\n return $this->hasMany(PartSubcategory::class, 'categories_id');\n }",
"public function subcategories()\n {\n //define relationship between categories and subcategories\n //one location has multiple sublocations\n //so we have to specify the name of sublocation model\n return $this->hasMany('App\\Subcategory'); //this is one->many relationship\n }",
"public function subcat()\n {\n return $this->hasMany('App\\Model\\Admin\\Subcategory');\n }",
"public function subCategory()\n {\n //TODO : return the relationship based on the category_sub_id field\n }",
"public function subcategories()\n {\n return $this->hasMany('App\\SubCategory','category_id','id');\n }",
"public function category()\n {\n return $this->belongsTo(PartCategory::class, 'part_category_id');\n }",
"public function subCategories(): HasMany\n {\n return $this->hasMany(SubCategory::class);\n }",
"public function sub_category() {\n return $this->belongsTo(ProductSubCategory::class, 'product_sub_categories_id');\n }",
"public function subcategory()\n {\n return $this->belongsTo('Infogue\\Subcategory');\n }",
"public function subCategory(){\n \n return $this->belongsTo(SubCategory::class);\n }",
"public function subcategories()\n {\n return $this->morphToMany(Category::class, 'categoriable')\n ->whereNotNull('parent_id')\n ->withTimestamps();\n }",
"public function sites_subcategories() {\n return $this->belongsToMany('App\\SubCategory', 'pc_sites_subcategories', 'pc_sites_id', 'pc_subcategories_id');\n }",
"public function subCategory()\n {\n return $this->belongsTo(self::class, 'parent_id', 'id');\n }",
"public function part()\n {\n return $this->hasMany(Part::class, 'brand_id');\n }",
"public function subTechnologies()\n {\n return $this->hasMany('Technology', 'parent_id')->where('status', 'published');\n }",
"public function resturantSubcategories()\n {\n return $this->hasMany(ResturantSubcategory::class);\n }",
"public function mainCategory(){\n \treturn $this->hasMany(Category::class,'parent_id');\n }",
"public function subtemas()\n {\n return $this->belongsToMany('App\\Subtema');\n }",
"function ar_sub_category() {\n $this->layout = 'admin_layout';\n $this->loadModel('ArCategory');\n $this->loadModel('ArSubCategory');\n $this->paginate = array('limit' => 50, 'order' => 'ArSubCategory.id DESC', 'joins' => array(array('table' => 'ar_categories', 'alias' => 'ArCategory', 'type' => 'LEFT', 'conditions' => array('ArCategory.id = ArSubCategory.ar_cat_id')),), 'fields' => array('ArCategory.*', 'ArSubCategory.*'));\n $ar_sub_category_data = $this->paginate('ArSubCategory');\n $ar_category_data = $this->ArCategory->find('all', array('fields' => array('ArCategory.*')));\n $category_list = $this->ArCategory->find('list', array('fields' => array('ArCategory.id', 'ArCategory.ar_cat')));\n $this->set('ar_sub_category_data', $ar_sub_category_data);\n $this->set('ar_category_data', $ar_category_data);\n $this->set('category_list', $category_list);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the base shipping including tax for the invoice. | public function setBaseShippingInclTax($amount); | [
"public function set_shipping_to_base()\n {\n }",
"public function set_shipping_to_base() {\n\t\t$this->shipping_country = $this->get_default_country();\n\t\t$this->shipping_state = $this->get_default_state();\n\t\t$this->shipping_postcode = '';\n\t\t$this->shipping_city = '';\n\t}",
"public function setBaseShippingAmount($baseShippingAmount);",
"public function setBaseShippingAmount($amount);",
"public function setBaseShippingInvoiced($baseShippingInvoiced);",
"public function setBaseShippingDiscountAmount($baseShippingDiscountAmount);",
"public function setBaseShippingAmount($amount){\n return $this->setData(self::BASE_SHIPPING_AMOUNT, $amount);\n }",
"public function setShippingTax($value) \n {\n $this->_fields['ShippingTax']['FieldValue'] = $value;\n return;\n }",
"public function setBaseShippingRefunded($baseShippingRefunded);",
"public function getBaseShippingInclTax();",
"private function setShippingInformation()\n {\n if ($this->_checkoutSession->getLastRealOrder()->getIsVirtual()) {\n $this->_paymentRequest->setShipping()->setAddressRequired()->withParameters('false');\n } else {\n $this->_paymentRequest->setShipping()->setAddressRequired()->withParameters('true');\n $shipping = $this->_checkoutSession->getLastRealOrder()->getShippingAddress();\n if ($shipping) {\n if (count($shipping->getStreet()) === 4) {\n $this->_paymentRequest->setShipping()->setAddress()->withParameters(\n $shipping->getStreetLine(1),\n $shipping->getStreetLine(2),\n $shipping->getStreetLine(4),\n \\UOL\\PagSeguro\\Helper\\Data::fixPostalCode($shipping->getPostcode()),\n $shipping->getCity(),\n $this->getRegionAbbreviation($shipping),\n $this->getCountryName($shipping['country_id']),\n $shipping->getStreetLine(3)\n );\n } else {\n $address = \\UOL\\PagSeguro\\Helper\\Data::addressConfig($shipping['street']);\n\n $this->_paymentRequest->setShipping()->setAddress()->withParameters(\n $this->getShippingAddress($address[0], $shipping),\n $this->getShippingAddress($address[1]),\n $this->getShippingAddress($address[3]),\n \\UOL\\PagSeguro\\Helper\\Data::fixPostalCode($shipping->getPostcode()),\n $shipping->getCity(),\n $this->getRegionAbbreviation($shipping),\n $this->getCountryName($shipping['country_id']),\n $this->getShippingAddress($address[2])\n );\n }\n\n $this->_paymentRequest->setShipping()->setType()\n ->withParameters(\\PagSeguro\\Enum\\Shipping\\Type::NOT_SPECIFIED); //Shipping Type\n $this->_paymentRequest->setShipping()->setCost()\n ->withParameters(number_format($this->getShippingAmount(), 2, '.', '')); //Shipping Coast\n }\n }\n }",
"public function setBaseTax($value)\n {\n $this->_fields['BaseTax']['FieldValue'] = $value;\n return $this;\n }",
"public function setBaseShippingTaxRefunded($baseShippingTaxRefunded);",
"public function setShippingTax($value)\n {\n $this->_fields['ShippingTax']['FieldValue'] = $value;\n return $this;\n }",
"public function setShippingTaxAmount($amount);",
"public function getBaseShippingTaxAmount();",
"function setTaxes()\n {\n $this->taxes = round($this->subtotal*TAX_RATE/100, 2);\n }",
"public function setBaseTaxInvoiced($baseTaxInvoiced);",
"public function setBaseShippingInvoiced($baseShippingInvoiced){\n return $this->setData(self::BASE_SHIPPING_INVOICED, $baseShippingInvoiced);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get all the wallposts where user has commented. Also if post_update_type is provided then only those type of posts will be checked. | public static function getAllwallpostsWhereUserCommented($user_id, $post_update_type)
{
$em = \Zend_Registry::get('em');
$qb_1 = $em->createQueryBuilder();
$q_1 = $qb_1->select('wp')
->from( '\Entities\wall_post', 'wp' )
->leftJoin('wp.wall_postsComment','cmnts')
->where('cmnts.commentsIlook_user = ?1');
if($post_update_type)
{
$q_1->andWhere('wp.post_update_type = ?2');
}
$q_1->setParameter( '1', $user_id );
$q_1->setParameter( '2', $post_update_type );
$q_1 = $q_1->getQuery();
$ret = $q_1->getResult();
return $ret;
} | [
"public function get_comment_users($post_id, $module_id)\n {\n $args = array(\n 'post_type' => $this->query_type = PeepSoActivityStream::CPT_COMMENT,\n '_comment_object_id' => $post_id,\n '_comment_module_id' => $module_id\n );\n\n add_filter('posts_groupby', array(&$this, 'groupby_author_id'), 10, 1);\n add_filter('posts_join', array(&$this, 'filter_act_join'));\n add_filter('posts_clauses_request', array(&$this, 'filter_post_clauses'), 10, 2);\n add_filter('posts_clauses_request', array(&$this, 'filter_post_clauses_comments'), 20, 2);\n $query = new WP_Query($args);\n remove_filter('posts_groupby', array(&$this, 'groupby_author_id'), 10);\n remove_filter('posts_join', array(&$this, 'filter_act_join'));\n remove_filter('posts_clauses_request', array(&$this, 'filter_post_clauses'), 10);\n remove_filter('posts_clauses_request', array(&$this, 'filter_post_clauses_comments'), 20);\n\n return ($query);\n }",
"public static function search_in_comments() {\n\n\t\t//User Ip\n\t\t$ip = isset( $_SERVER['HTTP_CLIENT_IP'] ) ? $_SERVER['HTTP_CLIENT_IP'] : isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];\n\n\t\t// WP_Comment_Query arguments\n\t\t$args = array(\n\t\t\t'post_type' => Post_Type::$post_type,\n\t\t\t'orderby' => 'comment_date',\n\t\t\t'count' => true,\n\t\t);\n\n\t\t//Check Wth User id\n\t\tif ( is_user_logged_in() ) {\n\t\t\t$args['user_id'] = get_current_user_id();\n\t\t} else {\n\t\t\t//Search with IP\n\t\t\t$args['search'] = $ip;\n\t\t}\n\n\t\t$comment_query = new \\WP_Comment_Query;\n\t\t$comments = $comment_query->query( $args );\n\t\treturn $comments;\n\t}",
"public function getPosts($dashboard_type, $is_own_wall, $user_id, $friend_id, $following_ids, $personal_friend_ids, $professional_friend_ids, $is_personal, $is_professional, $shop_id, $club_id, $social_project_id, $limit, $offset, $count_needed, $last_post_id = null) {\n $personal_privacy_setting = array(Utility::getIntergerValue(self::PERSIONAL_PRIVACY), Utility::getIntergerValue(self::PUBLIC_PRIVACY));\n $professional_privacy_setting = array(Utility::getIntergerValue(self::PROFESSIONAL_PRIVACY), Utility::getIntergerValue(self::PUBLIC_PRIVACY));\n $following_privacy_setting = array(Utility::getIntergerValue(self::PUBLIC_PRIVACY));\n $public_privacy_setting = array(Utility::getIntergerValue(self::PUBLIC_PRIVACY));\n $all_privacy_setting = array(Utility::getIntergerValue(self::PERSIONAL_PRIVACY), Utility::getIntergerValue(self::PROFESSIONAL_PRIVACY), Utility::getIntergerValue(self::PUBLIC_PRIVACY));\n $dashboard_post_type = array(self::USER_POST, self::SHOP_POST, self::CLUB_POST, self::SOCIAL_PROJECT_POST);\n $wall_post_type = array(self::USER_POST, self::SHOP_POST, self::CLUB_POST);\n $shop_wall_type = array(self::SHOP_POST);\n $club_wall_type = array(self::CLUB_POST);\n $social_project_wall_type = array(self::SOCIAL_PROJECT_POST);\n $user_ids = array((int) $user_id);\n $results = array();\n\n if ($dashboard_type == Utility::getUpperCaseString(Utility::getTrimmedString(self::DASHBOARD))) { //user dashboard \n $result = $this->dashbaordposts($dashboard_post_type, $personal_friend_ids, $professional_friend_ids, $following_ids, $user_ids, $personal_privacy_setting, $professional_privacy_setting, $following_privacy_setting, $all_privacy_setting);\n } else if ($dashboard_type == Utility::getUpperCaseString(Utility::getTrimmedString(self::WALL))) { //user wall\n $result = $this->wallposts($wall_post_type, $is_own_wall, $user_ids, $friend_id, $is_personal, $is_professional, $personal_privacy_setting, $professional_privacy_setting, $public_privacy_setting);\n } else if ($dashboard_type == Utility::getUpperCaseString(Utility::getTrimmedString(self::SHOP))) { //shop wall\n $result = $this->shopposts($shop_wall_type, $user_ids, $shop_id, $all_privacy_setting);\n } else if ($dashboard_type == Utility::getUpperCaseString(Utility::getTrimmedString(self::CLUB))) { //club wall\n $result = $this->clubposts($club_wall_type, $user_ids, $club_id, $all_privacy_setting);\n } else if ($dashboard_type == Utility::getUpperCaseString(Utility::getTrimmedString(self::SOCIAL_PROJECT))) { //social project wall\n $result = $this->socialposts($social_project_wall_type, $user_ids, $social_project_id, $all_privacy_setting);\n }\n if(!empty($last_post_id)){\n\t $offset = 0;\n $result = $result->field('id')->lt($last_post_id);\n\t}\n if ($count_needed) { //if user only wants count\n $results_count = $result->count()\n ->getQuery()\n ->execute();\n return $results_count;\n }\n \n $results = $result->sort('id', 'DESC')\n ->limit($limit)\n ->skip($offset)\n ->getQuery()\n ->execute()\n ->toArray(false);\n return $results;\n }",
"function fetch_wall_comments($post_id, $db) {\n\n $wall_comments_array = array();\n \n if ($post_id) {\n $command = \"SELECT gwp.post_entry, gwc.comment_id, gwc.comment_entry, gwc.post_id, gwc.author_id, \" . \n \"date_format(gwc.comment_date, '%M %D, %Y %h:%i %p') as comment_date, mi.memberID, mi.first_name, mi.last_name \" . \n \"FROM group_wall_posts gwp, member_info mi, group_wall_comments gwc WHERE mi.memberID = gwc.author_id \" . \n \"AND gwc.post_id = gwp.post_id \" . \n \"AND gwc.post_id = '\" . $db->real_escape_string($post_id) . \"' \" . \n \"AND gwc.date_deactivated <= 0 ORDER BY gwc.comment_date ASC;\";\n \n\n $result = $db->query($command);\n \n if ($result->num_rows > 0) {\n \n while ($data_array = $result->fetch_assoc()) {\n array_push($wall_comments_array, $data_array);\n }\n }\n }\n return $wall_comments_array;\n }",
"function exclude_comment_list($clauses) {\r\n\tglobal $post_type, $wpdb;\r\n if (is_admin() || !('wpdental' == $post_type)) { \r\n\t\t//global $wpdb;\r\n\r\n\t\tif ( ! $clauses['join'] ) {\r\n\t\t\t$clauses['join'] = '';\r\n\t\t}\r\n\r\n\t\tif ( ! strstr( $clauses['join'], \"JOIN $wpdb->posts\" ) ) {\r\n\t\t\t$clauses['join'] .= \" LEFT JOIN $wpdb->posts ON comment_post_ID = $wpdb->posts.ID \";\r\n\t\t}\r\n\r\n\t\tif ( $clauses['where'] ) {\r\n\t\t\t$clauses['where'] .= ' AND ';\r\n\t\t}\r\n\r\n\t\t$clauses['where'] .= \" $wpdb->posts.post_type <> 'wpdental' \";\r\n\r\n\t}\r\n\t\treturn $clauses;\r\n\r\n\r\n}",
"public static function viewableCommentsOfPost($postId)\n {\n $post = Post::findOrFail($postId);\n if ($post->isViewable()) {\n return DB::table('comments')\n ->leftJoin('friend_requests AS sender', 'comments.user_id', '=', 'sender.sender_id')\n ->leftJoin('friend_requests AS receiver', 'comments.user_id', '=', 'receiver.receiver_id')\n ->where('comments.commentable_type', '=', 'App\\\\Post')\n ->where('comments.commentable_id', '=', $postId)\n ->where(function ($query) {\n $query->where('sender.receiver_id', '!=', Auth::id())\n ->orWhere('receiver.sender_id', '!=', Auth::id())\n ->orWhere('sender.receiver_id', '=', Auth::id())\n ->where('sender.status', '!=', 'block')\n ->orWhere('receiver.sender_id', '=', Auth::id())\n ->where('receiver.status', '!=', 'block');\n })\n ->select('comments.*')\n ->distinct()\n ->paginate(10);\n }\n }",
"function custom_get_user_posts_where() {\n global $wpdb;\n $user_id = get_current_user_id();\n $sql = '';\n $status = array( \"'publish'\" );\n if ( $user_id ) {\n $status[] = \"'private'\";\n $sql .= \" AND {$wpdb->posts}.post_author = {$user_id}\";\n }\n $sql .= \" AND {$wpdb->posts}.post_status IN( \" . implode( ',', $status ) . \" ) \";\n return $sql;\n}",
"public function get_comments($user_id=0, $page = 0)\r\n {\r\n $max_comments = 10;\r\n $max_reply = 3;\r\n $start_reply = $page * $max_reply;\r\n\r\n if ($page==1) {\r\n $start_comment = 0;\r\n } else {\r\n $start_comment = ($page-1)*$max_comments;\r\n }\r\n\r\n global $wpdb;\r\n /* get user by id and extract email */\r\n $ID = $user_id ? $user_id : $this->ID;;\r\n /* get all the comments combined with replies on the forums/meetings */\r\n\r\n /*comments table*/\r\n $commentstable = $wpdb->prefix.'comments';\r\n /* comments sql */\r\n $csql = \"SELECT * FROM `$commentstable` WHERE `user_id` = '$ID' ORDER BY `comment_date` DESC LIMIT $start_comment, $max_comments\";\r\n\r\n /* replies table */\r\n //$replytable = $wpdb->prefix.'posts';\r\n /* reply sql */\r\n //$rsql = \"SELECT * FROM `$replytable` WHERE `post_type`='reply' AND `post_author` = '$ID' ORDER BY `post_date` DESC LIMIT $start_reply, $max_reply\";\r\n\r\n //echo $csql;\r\n\r\n /* chat with user / profile member */\r\n $comments = $wpdb->get_results($csql);\r\n //$replies = $wpdb->get_results($rsql);\r\n\r\n //$total = array_merge( $comments , $replies);\r\n $total = $comments;\r\n\r\n foreach ($total as $key => $comment) {\r\n\r\n /* comments */\r\n if($comment->comment_ID > 0) :\r\n\r\n $content = $comment->comment_content;\r\n $post_comment = get_post($comment->comment_post_ID);\r\n $postTitle = $post_comment->post_title;\r\n $category = get_the_category( $post_comment->ID );\r\n $permalink = get_the_permalink($comment->comment_post_ID);\r\n\r\n $author = new user_info($post_comment->post_author);\r\n $profile = $author->get_profile_link($author->ID);\r\n $date = $comment->comment_date;\r\n \r\n $post_type = get_post_type_object( get_post_type($post_comment->ID) );\r\n $post_content = $post_comment->post_content;\r\n $categoryName = !empty($category[0]->name)?$category[0]->name:$post_type->labels->name;\r\n \r\n /* replies */\r\n else :\r\n\r\n $content = $comment->post_content;\r\n $post_comment = get_post($comment->post_parent);\r\n $postTitle = $post_comment->post_title;\r\n $permalink = get_the_permalink($comment->post_parent);\r\n\r\n $author = new user_info($post_comment->post_author);\r\n $profile = $author->get_profile_link($author->ID);\r\n $date = $comment->post_date;\r\n\r\n $post_content = $post_comment->post_content;\r\n \r\n $category = get_post_custom( $comment->ID );\r\n $parent = get_post($category['_bbp_forum_id'][0]);\r\n $ttl = get_the_title($parent->post_parent);\r\n $parent_title = !empty($ttl)?get_the_title($parent->post_parent).' <i class=\"fa fa-angle-right\"></i> ':'';\r\n $categoryName = get_post($post_comment->post_parent);\r\n $categoryName = $parent_title.$categoryName->post_title;\r\n endif;\r\n\r\n /* normalize data */\r\n $comments_[] = array(\r\n 'permalink' => $permalink,\r\n 'title'=> $postTitle,\r\n 'comment'=> $content,\r\n 'content'=> strip_tags($post_content),\r\n 'name' => $author->name,\r\n 'profile' => $profile,\r\n 'date' => $date,\r\n 'category' =>$categoryName\r\n );\r\n }\r\n\r\n /* custom sorter */\r\n if(is_array($comments_)) :\r\n usort($comments_, function($a, $b) {\r\n $ad = new DateTime($a['date']);\r\n $bd = new DateTime($b['date']);\r\n if ($ad == $bd) {\r\n return 0;\r\n }\r\n return $ad < $bd ? 1 : -1;\r\n });\r\n\r\n return $comments_;\r\n endif;\r\n }",
"public function getCommentsForWallpostAction()\n {\n $params = $this->getRequest()->getParams();\n //Get users blocked and users who have blocked logged in user.\n\t$blocked_user = \\Extended\\blocked_users::getAllBlockersAndBlockedUsers(Auth_UserAdapter::getIdentity()->getId());\n\t\n\techo Zend_Json::encode( \\Extended\\comments::getCommentsForWallpost( \\Auth_UserAdapter::getIdentity()->getId(), $params['wallpost_id'], $params['offset'], 10, $blocked_user ) );\n\t\n\n\tdie;\n }",
"function rt_unreplied_comments() {\n global $wpdb, $user_ID;\n $rt_post_sql = \"SELECT ID FROM $wpdb->posts WHERE post_author=$user_ID AND post_status != 'trash'\";\n $rt_posts = $wpdb->get_col($rt_post_sql);\n $rt_posts_ids = implode(',', $rt_posts);\n list($rt_ignore_comment_id, $ignored_total) = rt_ignored_comments();\n if ($ignored_total > 0) {\n $rt_comment_sql = \"SELECT * FROM $wpdb->comments WHERE comment_post_ID IN ($rt_posts_ids) AND comment_ID NOT IN ({$rt_ignore_comment_id}) AND comment_type NOT IN ('trackback','pingback') ORDER BY comment_post_ID, comment_date_gmt DESC\";\n }\n else {\n $rt_comment_sql = \"SELECT * FROM $wpdb->comments WHERE comment_post_ID IN ($rt_posts_ids) AND comment_type NOT IN ('trackback','pingback') ORDER BY comment_post_ID, comment_date_gmt DESC\";\n }\n $rt_comments = $wpdb->get_results($rt_comment_sql);\n $post_id = 0;\n $replied = false;\n $unreplied_comments = '';\n $unreplied_total = 0;\n\n foreach ($rt_comments as $comment) {\n if ($post_id != $comment->comment_post_ID) {\n $post_id = $comment->comment_post_ID;\n $replied = false;\n if (!($replied)) {\n if ($comment->user_id != $user_ID) {\n $unreplied_comments .= $comment->comment_ID . ', ';\n $unreplied_total++;\n }\n else {\n $replied = true;\n }\n }\n }\n }\n $rt_unreplied_comment_id = substr($unreplied_comments, 0, -2);\n return array($rt_unreplied_comment_id, $unreplied_total);\n}",
"function get_default_comment_status($post_type = 'post', $comment_type = 'comment')\n {\n }",
"function getPosts()\n { \n //sort user's posts\n $user_wall = $this->sortWall($this->user_wall, 'partnerID');\n \n //sort partner's posts\n $partner_wall = $this->sortWall($this->partner_wall, 'userID');\n \n return array_unique(array_merge($user_wall, $partner_wall));\n }",
"function get_user_posts_where() {\r\n \r\n global $wpdb;\r\n $user_id = get_current_user_id();\r\n $sql = '';\r\n $status = array( \"'publish'\" );\r\n if ( 0 !== $user_id ) {\r\n \r\n $status[] = \"'private'\";\r\n \r\n $sql .= \" AND {$wpdb->posts}.post_author = \" . absint( $user_id );\r\n \r\n }\r\n $sql .= \" AND {$wpdb->posts}.post_status IN( \" . implode( ',', $status ) . \" ) \";\r\n \r\n return $sql;\r\n \r\n}",
"function get_default_comment_status($post_type = 'post', $comment_type = 'comment')\n{\n}",
"function yz_get_wall_post_types_visibility() {\r\n\r\n\t// Get Post Types Visibility\r\n\t$post_types = array(\r\n\t\t'update_avatar' \t\t=> 'off',\r\n\t\t'activity_link' \t\t=> yz_options( 'yz_enable_wall_link' ),\r\n\t\t'activity_file' \t\t=> yz_options( 'yz_enable_wall_file' ),\r\n\t\t'activity_audio' \t\t=> yz_options( 'yz_enable_wall_audio' ),\r\n\t\t'activity_photo' \t\t=> yz_options( 'yz_enable_wall_photo' ),\r\n\t\t'activity_video' \t\t=> yz_options( 'yz_enable_wall_video' ),\r\n\t\t'activity_quote' \t\t=> yz_options( 'yz_enable_wall_quote' ),\r\n\t\t'activity_giphy' \t\t=> yz_options( 'yz_enable_wall_giphy' ),\r\n\t\t'activity_status' \t\t=> yz_options( 'yz_enable_wall_status' ),\r\n\t\t'activity_update' \t\t=> yz_options( 'yz_enable_wall_status' ),\r\n\t\t'activity_comment' \t\t=> yz_options( 'yz_enable_wall_comments' ),\r\n\t\t'new_cover' \t\t\t=> yz_options( 'yz_enable_wall_new_cover' ),\r\n\t\t'activity_slideshow'\t=> yz_options( 'yz_enable_wall_slideshow' ),\r\n\t\t'new_avatar' \t\t\t=> yz_options( 'yz_enable_wall_new_avatar' ),\r\n\t\t'new_member' \t\t\t=> yz_options( 'yz_enable_wall_new_member' ),\r\n\t\t'joined_group' \t\t\t=> yz_options( 'yz_enable_wall_joined_group' ),\r\n\t\t'new_blog_post' \t\t=> yz_options( 'yz_enable_wall_new_blog_post' ),\r\n\t\t'created_group' \t\t=> yz_options( 'yz_enable_wall_created_group' ),\r\n\t\t'updated_profile' \t\t=> yz_options( 'yz_enable_wall_updated_profile' ),\r\n\t\t'new_blog_comment' \t\t=> yz_options( 'yz_enable_wall_new_blog_comment' ),\r\n\t\t'friendship_created' \t=> yz_options( 'yz_enable_wall_friendship_created' ),\r\n\t\t'friendship_accepted' \t=> yz_options( 'yz_enable_wall_friendship_accepted' ),\r\n\t);\r\n\r\n\t// Filter Post.\r\n\t$post_types = apply_filters( 'yz_wall_post_types_visibility', $post_types );\r\n\t\r\n\treturn $post_types;\r\n}",
"function tt_get_comments_status()\n{\n\tglobal $post;\n\t//do this only in page, to force comment open for all pages in WordPress posts table,\n\t//let showing of comments template decide by our theme's custom post meta only\n\tif (is_page()) {\n\t\t$_post = get_post($post->ID);\n\t\t//if by default page comments is closed, we set to open.\n\t\tif ($_post->comment_status == 'closed') {\n\t\t\t$update_post = array();\n\t\t\t$update_post['ID'] = $post->ID;\n\t\t\t$update_post['comment_status'] = 'open';\n\t\t\t$update_post['ping_status'] = 'open';\n\t\t\twp_update_post($update_post);\n\t\t}\n\t}\n}",
"function default_comments_on( $data ) {\n if( $data['post_type'] == 'job' ) {\n $data['comment_status'] = 'open';\n }\n\n return $data;\n}",
"public function inactivePostsWithComments() {\n \n $posts = Post::where('is_active', 0)->with('comments')->get();\n \n foreach($posts as $post){\n echo 'Inactive Post: '. $post->title .'<br> ';\n foreach($post->comments as $comment){\n echo 'Commetnts: '. $comment->comment. '<br> ';\n }\n echo '<br>';\n }\n }",
"static function pi_list_of_commented($args)\n {\n $query = get_comments( $args );\n if ( $query )\n {\n foreach( $query as $comment )\n {\n $link = get_permalink($comment->comment_post_ID);\n ?>\n <div class=\"item\">\n <div class=\"item-image\">\n <div class=\"image-cover\">\n <a href=\"<?php echo esc_url( $link ); ?>\">\n <?php print get_avatar( $comment->user_id, apply_filters('pi_tab_comment', 70)); ?>\n </a>\n </div>\n </div>\n <div class=\"item-content\">\n <h3 class=\"item-title\" data-number-line=\"2\">\n <a href=\"<?php echo esc_url($link); ?>\"><?php echo esc_html($comment->comment_author); ?></a>\n </h3>\n <div class=\"font-size__14 font-style__italic\">\n <p><?php print $comment->comment_content; ?></p>\n </div>\n <span class=\"item-meta\"><?php echo pi_get_the_date($comment->comment_post_ID); ?></span>\n </div>\n </div>\n <?php\n }\n }else{\n _e('<p>There are no any comments yet</p>', 'wiloke');\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ | | Section for: Setter Methods | | | Define all setter methods for the model here | Setter for the is_popular attribute | public function makePopular()
{
$this->is_popular = true;
return $this;
} | [
"public function popular()\n {\n return $this->data(array_merge(\n $this->getData(), ['popular' => true]\n ));\n }",
"public function setOnlyMorePopular(bool $onlyMorePopular): self;",
"protected function setTagPopularity(): void\n {\n if ($this->coefficientIncreaseFont && !empty($this->tags)) {\n $tags = TagWeight::find()\n ->select(['tag_id', $this->popularityType . ' AS value'])\n ->andWhere('entity=:entity', [':entity' => $this->entity])\n ->andWhere(['tag_id' => ArrayHelper::map($this->tags, 'id', 'id')])\n ->asArray()\n ->all();\n\n if (!empty($tags)) {\n $maxValue = max(ArrayHelper::map($tags, 'tag_id', 'value'));\n foreach ($tags as $tag) {\n if ($maxValue > 0) {\n $this->tagPopularity[$tag['tag_id']] = ($tag['value'] * 100 / $maxValue * $this->coefficientIncreaseFont) + 100;\n }\n }\n }\n }\n }",
"public function setRating($rating) {$this->rating = $rating;}",
"public function setProductIsFree($productIsFree){\n $this->productIsFree = $productIsFree;\n}",
"private function setPopulated() {\n $this->is_populated = true;\n }",
"public function setFeaturedAttribute($value)\n {\n $this->attributes['featured'] = $value;\n\n if ($value == 1) {\n $all_other_articles = Article::where('id', '<>', $this->id)->get();\n foreach ($all_other_articles as $key => $article) {\n $article->featured=0;\n $article->save();\n }\n }\n }",
"public function setPublishedAttribute($value)\n {\n $this->attributes['published'] = $value == \"on\";\n }",
"public function setPopularity($popularity)\n {\n $this->popularity = $popularity;\n\n return $this;\n }",
"public function setLike($like)\n{\n$this->like = $like;\n\nreturn $this;\n}",
"public function setPopularity_status($popularity_status)\n {\n $this->popularity_status = $popularity_status;\n\n return $this;\n }",
"public function popularize(Request $request)\n {\n $car = Car::findOrFail($request->car_id);\n $car_model = $car->model;\n $car_brand = $car->brand;\n\n if($car->popular == true){\n $car->popular = false;\n $car->save();\n\n return redirect()->route('admin.index', [\n 'cars'=>$this->cars\n ])->with('car_depopularized', '<strong>'.$car_brand.' '.$car_model.'</strong> was removed from popular.');\n }else{\n $car->popular = true;\n $car->save();\n\n return redirect()->route('admin.index', [\n 'cars'=>$this->cars\n ])->with('car_popularized', '<strong>'.$car_brand.' '.$car_model.'</strong> was made popular.');\n }\n }",
"public function setModel()\n {\n }",
"public function setpublic() {\n $this->layout = \"\";\n $sessionstaff = $this->Session->read('staff');\n\n\n $Locations = $this->Promotion->find('first', array('conditions' => array('Promotion.id' => $_POST['promotion_id'])));\n\n\n if ($Locations['Promotion']['public'] == 1) {\n $like = 0;\n } else {\n $like = 1;\n }\n\n $this->Promotion->query('UPDATE promotions set public=\"' . $like . '\" where id=' . $Locations['Promotion']['id']);\n\n exit;\n }",
"public function testPopularTagsWithLimitAndModel(): void\n {\n $this->preparePopularTags();\n\n $popular = $this->service->getPopularTags(2, TestDummy::class);\n\n self::assertCount(2, $popular);\n\n $popularNames = implode(',', $popular->pluck('name')->toArray());\n self::assertEquals('Durian,Cherry', $popularNames);\n }",
"public function resetPopularity()\n {\n \\DB::table('entities')->update(array('popularity' => 0));\n }",
"public function testSetUrgent() {\n\n $obj = new AppelsEnCours();\n\n $obj->setUrgent(true);\n $this->assertEquals(true, $obj->getUrgent());\n }",
"public function setHobbies($value)\n{\n $this->hobbies = $value;\n return $this;\n}",
"function is_popular(){\n\tif ($GLOBALS['match']['name']=='popular' || $GLOBALS['match']['name']=='popularpaged'):\n\t\treturn true;\n\telse:\n\t\treturn false;\n\tendif;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Finds a film by rating | public function searchMovieByRating($ratingToSearch)
{
$conn = new mysqli($servername, $username, $password, $baseName);
if ($conn->connect_error) {
die("Connection failed.Error: " . $conn->connect_error . "<br>");
} else {
echo "Connection established.<br>";
}
$query = "SELECT * FROM Movies WHERE rating >= $ratingToSearch;";
$result = $conn->query($query6);
if ($conn->error == false) {
print "Correct query. Displaying movies now:<br><br>";
} else {
die("Query error: " . $conn->error . "<br>");
}
foreach ($result as $row) {
print("id: " . $row["id"] . ", title: " . $row["name"] . ", description: " . $row["description"] . ", rating: " . $row["rating"] . "  ");
}
$conn->close();
$conn = null;
} | [
"function get_user_movie_rating($member_id, $movie_id) {\n $sql = 'SELECT Stars FROM member_ratings WHERE MemberID=' . $member_id . ' AND MovieID=' . $movie_id;\n return query($sql);\n }",
"function rate($rating) {\n\t\t\treturn $this->API->rateVideo($this->ID,$rating);\n\t\t}",
"abstract public function getRating();",
"public function findMatchingRatingAndVoter($rating = NULL, $voter = NULL ) {\n\t\t$query = $this->createQuery();\n\t\treturn $query\n\t\t\t->matching(\n\t\t\t\t$query->logicalAnd(\n\t\t\t\t\t$query->equals('rating', $rating),\n\t\t\t\t\t$query->equals('voter', $voter)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t->execute()\n\t\t\t->getFirst();\n\t}",
"function get_rating($unique_id){\n $movie_ratings = get_ratings();\n\n return $movie_ratings[$unique_id];\n}",
"function getRestaurantSearchRating($restaurant_id)\n{\n\t$con=new dbcon;\n\t$sql=\"select rating from \".DBPREFIX.\"restaurant_rating where restaurant_id=$restaurant_id\";\n\t$con->Query($sql);\t\n\twhile($rs=$con->FetchRow())\n\t{\n\t\t$rating=$rs[\"rating\"];\n\t}\n\treturn $rating;\n}",
"static function getTopRatingMovies() {\n $selectAll = \"SELECT M.MovieID, Title, Poster, PlotSummary, Runtime, Genres, Crew, Directors, Awards, CreatedBy, \n COUNT(Review) as ReviewNumber, IFNULL(AVG(Rating), 0) as Rating \n FROM Movie as M\n LEFT JOIN Review as R ON M.MovieID = R.MovieID\n GROUP BY M.MovieID, Title, Poster, PlotSummary, Runtime, Genres, Crew, Directors, Awards, CreatedBy\n ORDER BY Rating DESC, ReviewNumber DESC\n LIMIT 4\";\n\n //Query\n self::$db->query($selectAll);\n //Execute\n self::$db->execute();\n //Return\n return self::$db->resultSet();\n }",
"function get_video_rating($id) {\n global $db;\n if (is_numeric($id)) {\n $results = $db->select(tbl(\"video\"), \"userid,allow_rating,rating,rated_by,voter_ids\", \" videoid='$id'\");\n }else\n $results = $db->select(tbl(\"video\"), \"userid,allow_rating,rating,rated_by,voter_ids\", \" videokey='$id'\");\n if ($db->num_rows > 0)\n return $results[0];\n else\n return false;\n }",
"function getMoviesAboveRating($rating)\n{\n $conn = getDB();\n\n // Create a prepared statement \n if ($stmt = $conn->prepare(\"SELECT id, name, description, rating, url \n FROM Movies \n\t WHERE round(rating,1) >= round(?,1) \n ORDER BY rating DESC\")) {\n\n // Bind parameters to the query \n $stmt->bind_param(\"s\", $rating);\n\n // Execute query\n $stmt->execute();\n\n\t // Get query results, it may contain multiple rows\n\t $res = $stmt->get_result();\n\n $return_arr = array();\n \t while ($row = $res->fetch_assoc()){\n array_push($return_arr, $row);\n }\n\t\t$stmt->close();\n }\n\n echo json_encode($return_arr);\n $conn->close();\n}",
"public function setRating($rating);",
"public function findOneByRatingAndVoter(RatingInterface $rating, UserInterface $voter);",
"function getwedding_hallSearchRating($wedding_hall_id)\n{\n\t$con=new dbcon;\n\t$sql=\"select rating from \".DBPREFIX.\"wedding_hall_rating where wedding_hall_id=$wedding_hall_id\";\n\t$con->Query($sql);\t\n\twhile($rs=$con->FetchRow())\n\t{\n\t\t$rating=$rs[\"rating\"];\n\t}\n\treturn $rating;\n}",
"static function hotelWithRating($rating){\n $query = DB::table('hotel')\n ->where('rating', $rating)\n ->get();\n\n return $query;\n }",
"public function setMovieRating($val)\n {\n $this->_propDict[\"movieRating\"] = $val;\n return $this;\n }",
"public function readRatings() {\r\n $query =\r\n 'SELECT *\r\n FROM product_reviews pr\r\n JOIN products p\r\n ON pr.movie_id = p.movie_id\r\n ORDER BY pr.movie_id';\r\n\r\n $stmt = $this->conn->prepare($query);\r\n\r\n $stmt->execute();\r\n\r\n return $stmt;\r\n }",
"function find_review_by_movieid($movie_id){\n\tglobal $connection;\n\t$query = \"SELECT review.id, name, star \";\n\t$query .= \"FROM user, review \";\n\t$query .= \" WHERE movie_id = '{$movie_id}' \";\n\t$query .= \" AND user.id = user_id \";\n\t$review_set = mysqli_query($connection, $query);\n\n confirm_query($review_set);\n\treturn $review_set;\n\t}",
"static function getTopReviewedMovies() {\n $selectAll = \"SELECT M.MovieID, Title, Poster, PlotSummary, Runtime, Genres, Crew, Directors, Awards, CreatedBy, \n COUNT(Review) as ReviewNumber, IFNULL(AVG(Rating), 0) as Rating \n FROM Movie as M\n LEFT JOIN Review as R ON M.MovieID = R.MovieID\n GROUP BY M.MovieID, Title, Poster, PlotSummary, Runtime, Genres, Crew, Directors, Awards, CreatedBy\n ORDER BY ReviewNumber DESC, Rating DESC\n LIMIT 4\";\n\n //Query\n self::$db->query($selectAll);\n //Execute\n self::$db->execute();\n //Return\n return self::$db->resultSet();\n }",
"public static function getRatingByID($id) {\n $ratingbyid = Rating::where('id', '=', $id)->first();\n return $ratingbyid;\n }",
"function getRatings() {\n $postdata = array();\n $this->html();\n foreach (htmlqp($this->html, '#csr-rating') as $item) {\n $score = $this->_score($item->attr(\"data-csr-rating\"));\n $matches = array();\n if (preg_match_all(\"/entry(\\\\d+)/is\", $item->closest('.post_block')->children('a')->attr('id'), $matches)) {\n $c1 = $matches[1][0];\n }\n $postdata[] = array($c1, $this->tid, $score);\n $this->l('Found review: ' . $c1 . ' with rating ' . $score);\n }\n $sth = $this->db->prepare('INSERT INTO post (pid, tid, rating) VALUES (?, ?, ?)');\n $this->db->extended->executeMultiple($sth, $postdata);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Rebuild the Acl based on the current controllers in the application | function buildAcl() {
$log = array();
$aco =& $this->Acl->Aco;
$root = $aco->node('controllers');
if (!$root) {
$aco->create(array('parent_id' => null, 'model' => null, 'alias' => 'controllers'));
$root = $aco->save();
$root['Aco']['id'] = $aco->id;
$log[] = 'Created Aco node for controllers';
} else {
$root = $root[0];
}
App::import('Core', 'File');
$Controllers = Configure::listObjects('controller');
$appIndex = array_search('App', $Controllers);
if ($appIndex !== false ) {
unset($Controllers[$appIndex]);
}
$baseMethods = get_class_methods('Controller');
$baseMethods[] = 'buildAcl';
$Plugins = $this->_get_plugin_controller_names();
$Controllers = array_merge($Controllers, $Plugins);
// look at each controller in app/controllers
foreach ($Controllers as $ctrlName) {
App::import('Controller', $ctrlName);
$ctrlclass = $ctrlName . 'Controller';
$methods = get_class_methods($ctrlclass);
// find / make controller node
$controllerNode = $aco->node('controllers/'.$ctrlName);
if (!$controllerNode) {
$aco->create(array('parent_id' => $root['Aco']['id'], 'model' => null, 'alias' => $ctrlName));
$controllerNode = $aco->save();
$controllerNode['Aco']['id'] = $aco->id;
$log[] = 'Created Aco node for '.$ctrlName;
} else {
$controllerNode = $controllerNode[0];
}
//clean the methods. to remove those in Controller and private actions.
foreach ($methods as $k => $method) {
if (strpos($method, '_', 0) === 0) {
unset($methods[$k]);
continue;
}
if (in_array($method, $baseMethods)) {
unset($methods[$k]);
continue;
}
$methodNode = $aco->node('controllers/'.$ctrlName.'/'.$method);
if (!$methodNode) {
$aco->create(array('parent_id' => $controllerNode['Aco']['id'], 'model' => null, 'alias' => $method));
$methodNode = $aco->save();
$log[] = 'Created Aco node for '. $method;
}
}
}
debug($log);
} | [
"function _buildAcl() {\n $log = array();\n\n $aco =& $this->Acl->Aco;\n $root = $aco->node('controllers');\n if (!$root) {\n $aco->create(array('parent_id' => null, 'model' => null, 'alias' => 'controllers'));\n $root = $aco->save();\n $root['Aco']['id'] = $aco->id;\n $log[] = 'Created Aco node for controllers';\n } else {\n $root = $root[0];\n }\n\n App::import('Core', 'File');\n $Controllers = Configure::listObjects('controller');\n $appIndex = array_search('App', $Controllers);\n if ($appIndex !== false ) {\n unset($Controllers[$appIndex]);\n }\n $baseMethods = get_class_methods('Controller');\n $baseMethods[] = 'buildAcl';\n\n\n $Plugins = $this->_get_plugin_controller_names();\n $Controllers = array_merge($Controllers, $Plugins);\n\n // look at each controller in app/controllers\n foreach ($Controllers as $ctrlName) {\n App::import('Controller', $ctrlName);\n $ctrlclass = $ctrlName . 'Controller';\n $methods = get_class_methods($ctrlclass);\n\n // find / make controller node\n $controllerNode = $aco->node('controllers/'.$ctrlName);\n if (!$controllerNode) {\n $aco->create(array('parent_id' => $root['Aco']['id'], 'model' => null, 'alias' => $ctrlName));\n $controllerNode = $aco->save();\n $controllerNode['Aco']['id'] = $aco->id;\n $log[] = 'Created Aco node for '.$ctrlName;\n } else {\n $controllerNode = $controllerNode[0];\n }\n\n //clean the methods. to remove those in Controller and private actions.\n foreach ($methods as $k => $method) {\n if (strpos($method, '_', 0) === 0) {\n unset($methods[$k]);\n continue;\n }\n if (in_array($method, $baseMethods)) {\n unset($methods[$k]);\n continue;\n }\n $methodNode = $aco->node('controllers/'.$ctrlName.'/'.$method);\n if (!$methodNode) {\n $aco->create(array('parent_id' => $controllerNode['Aco']['id'], 'model' => null, 'alias' => $method));\n $methodNode = $aco->save();\n $log[] = 'Created Aco node for '. $method;\n }\n }\n }\n // debug($log);\n }",
"public function rebuildAction(){\n $this->acl->rebuild();\n }",
"public function buildRoutes(): void\n {\n if ($this->isFromCache()) {\n return;\n }\n $this->scanRoutes(APPLICATION_ROOT . DIRECTORY_SEPARATOR . 'Controllers');\n $directory = opendir(APPLICATION_ROOT . DIRECTORY_SEPARATOR . 'Modules');\n while ($module = readdir($directory)) {\n if ($module != '.' && $module != '..' && $module != 'CLI') {\n $path = APPLICATION_ROOT . DIRECTORY_SEPARATOR . 'Modules' . DIRECTORY_SEPARATOR . $module . DIRECTORY_SEPARATOR . 'Controllers';\n if (is_dir($path)) {\n $this->scanRoutes($path, 'Modules\\\\' . $module . '\\\\', $module);\n }\n }\n }\n }",
"function _buildAcoTreeForControllers(){\n $this->_addAco('Controllers', null, null, null);\n \n $this->_addAco('Users', null, 'Controllers', null);\n $this->_addAco('index', null, 'Controllers/Users', null);\n $this->_addAco('about', null, 'Controllers/Users', null);\n $this->_addAco('contact', null, 'Controllers/Users', null);\n $this->_addAco('help', null, 'Controllers/Users', null);\n $this->_addAco('edit', null, 'Controllers/Users', null);\n $this->_addAco('logout', null, 'Controllers/Users', null);\n $this->_addAco('changePasswordOfAuthdUser', null, \n 'Controllers/Users', null);\n $this->_addAco('settings', null, 'Controllers/Users', null);\n $this->_addAco('updateTimeout', null, 'Controllers/Users', null);\n $this->_addAco('selfRegister', null, 'Controllers/Users', null);\n $this->_addAco('registerEdit', null, 'Controllers/Users', null);\n $this->_addAco('edit', null, 'Controllers/Users', null);\n $this->_addAco('login_assist', null, 'Controllers/Users', null);\n $this->_addAco('identify', null, 'Controllers/Users', null);\n \n $this->_addAco('Logs', null, 'Controllers', null);\n $this->_addAco('index', null, 'Controllers/Logs', null);\n $this->_addAco('add', null, 'Controllers/Logs', null);\n \n $this->_addAco('Admin', null, 'Controllers', null);\n $this->_addAco('index', null, 'Controllers/Admin', null);\n $this->_addAco('kiosk', null, 'Controllers/Admin', null);\n $this->_addAco('viewNonAdminUsers', null, 'Controllers/Admin', null);\n $this->_addAco('createStaff', null, 'Controllers/Admin', null);\n $this->_addAco('reloadDatabase', null, 'Controllers/Admin', null);\n $this->_addAco('saveDatabase', null, 'Controllers/Admin', null);\n $this->_addAco('viewDatabaseSnapshots', null, \n\t 'Controllers/Admin', null);\n $this->_addAco('resetPassword', null, 'Controllers/Admin', null);\n \n $this->_addAco('Surveys', null, 'Controllers', null);\n $this->_addAco('index', null, 'Controllers/Surveys', null);\n $this->_addAco('new_session', null, 'Controllers/Surveys', null);\n $this->_addAco('show', null, 'Controllers/Surveys', null);\n $this->_addAco('restart', null, 'Controllers/Surveys', null);\n $this->_addAco('answer', null, 'Controllers/Surveys', null);\n $this->_addAco('summary', null, 'Controllers/Surveys', null);\n $this->_addAco('complete', null, 'Controllers/Surveys', null);\n $this->_addAco('break_session', null, 'Controllers/Surveys', null);\n $this->_addAco('questionnaire', null, 'Controllers/Surveys', null);\n $this->_addAco('questionnaires', null, 'Controllers/Surveys', null);\n $this->_addAco('generate_se_test', null, 'Controllers/Surveys', null);\n $this->_addAco('summary_csv', null, 'Controllers/Surveys', null);\n $this->_addAco('edit', null, 'Controllers/Surveys', null);\n $this->_addAco('overview', null, 'Controllers/Surveys', null);\n $this->_addAco('edit_project', null, 'Controllers/Surveys', null);\n $this->_addAco('reopen_test_session', null, 'Controllers/Surveys', null);\n $this->_addAco('finish_test_session', null, 'Controllers/Surveys', null);\n $this->_addAco('log_click_to_external_resource', null, \n 'Controllers/Surveys', null);\n $this->_addAco('log_teaching_tip_expansion', null, \n 'Controllers/Surveys', null);\n \n $this->_addAco('Results', null, 'Controllers', null);\n $this->_addAco('index', null, 'Controllers/Results', null);\n $this->_addAco('show', null, 'Controllers/Results', null);\n $this->_addAco('showJournals', null, 'Controllers/Results', null);\n $this->_addAco('others', null, \n 'Controllers/Results', null);\n $this->_addAco('othersReportsList', null, \n 'Controllers/Results', null);\n $this->_addAco('showToOthers', null, \n 'Controllers/Results', null);\n $this->_addAco('showJournalsToOthers', null, \n 'Controllers/Results', null);\n $this->_addAco('data_export', null, 'Controllers/Results', null);\n $this->_addAco('show_activity_diary_data', null, \n 'Controllers/Results', null);\n $this->_addAco('log_click_to_external_resource', null, \n 'Controllers/Results', null);\n $this->_addAco('log_teaching_tip_expansion', null, \n 'Controllers/Results', null);\n \n $this->_addAco('MedicalRecords', null, 'Controllers', null);\n $this->_addAco('clinic_report', null, \n 'Controllers/MedicalRecords', null);\n $this->_addAco('clinic_report_pdf', null, \n 'Controllers/MedicalRecords', null);\n $this->_addAco('clinic_report_p3p', null, \n 'Controllers/MedicalRecords', null);\n $this->_addAco('clinic_report_p3p_pdf', null, \n 'Controllers/MedicalRecords', null);\n\n $this->_addAco('Images', null, 'Controllers', null);\n $this->_addAco('view', null, 'Controllers/Images', null);\n\n $this->_addAco('Teaching', null, 'Controllers', null);\n $this->_addAco('index', null, 'Controllers/Teaching', null);\n $this->_addAco('log_click_to_external_resource', null, \n 'Controllers/Teaching', null);\n $this->_addAco('log_teaching_tip_expansion', null, \n 'Controllers/Teaching', null);\n $this->_addAco('manage_fatigue', null, 'Controllers/Teaching', null);\n\n $this->_addAco('P3P', null, 'Controllers', null);\n $this->_addAco('index', null, 'Controllers/P3p', null);\n $this->_addAco('statistics', null, 'Controllers/P3p', null);\n $this->_addAco('factors', null, 'Controllers/P3p', null);\n $this->_addAco('control', null, 'Controllers/P3p', null);\n $this->_addAco('next_steps', null, 'Controllers/P3p', null);\n $this->_addAco('print_links', null, 'Controllers/P3p', null);\n $this->_addAco('log_next_step_view', null, 'Controllers/P3p', null);\n $this->_addAco('log_statistic_view', null, 'Controllers/P3p', null);\n $this->_addAco('edit', null, 'Controllers/P3p', null);\n $this->_addAco('overview', null, 'Controllers/P3p', null);\n $this->_addAco('whatdoyouthink', null, 'Controllers/P3p', null);\n \n $this->_addAco('Patients', null, 'Controllers', null);\n $this->_addAco('index', null, 'Controllers/Patients', null);\n $this->_addAco('add', null, 'Controllers/Patients', null);\n $this->_addAco('edit', null, 'Controllers/Patients', null);\n $this->_addAco('view', null, 'Controllers/Patients', null);\n $this->_addAco('viewAll', null, 'Controllers/Patients', null);\n $this->_addAco('resetPassword', null, 'Controllers/Patients', null);\n $this->_addAco('changeUsername', null, 'Controllers/Patients', null);\n $this->_addAco('calendar', null, 'Controllers/Patients', null);\n $this->_addAco('deleteNote', null, 'Controllers/Patients', null);\n $this->_addAco('editNote', null, 'Controllers/Patients', null);\n $this->_addAco('delete', null, 'Controllers/Patients', null);\n $this->_addAco('changeDates', null, 'Controllers/Patients', null);\n $this->_addAco('checkAgainCalendar', null, \n\t 'Controllers/Patients', null);\n $this->_addAco('noCheckAgain', null, 'Controllers/Patients', null);\n $this->_addAco('oneWeekFollowup', null, 'Controllers/Patients', null);\n $this->_addAco('oneMonthFollowup', null, 'Controllers/Patients', null);\n $this->_addAco('sixMonthFollowup', null, 'Controllers/Patients', null);\n $this->_addAco('accrualReport', null, 'Controllers/Patients', null);\n $this->_addAco('interested_report', null, 'Controllers/Patients', null);\n $this->_addAco('offStudy', null, 'Controllers/Patients', null);\n $this->_addAco('search', null, 'Controllers/Patients', null);\n $this->_addAco('consents', null, 'Controllers/Patients', null);\n $this->_addAco('activityDiary', null, 'Controllers/Patients', null);\n $this->_addAco('loginAs', null, 'Controllers/Patients', null);\n $this->_addAco('takeSurveyAs', null, 'Controllers/Patients', null);\n $this->_addAco('medications', null, 'Controllers/Patients', null);\n $this->_addAco('dashboard', null, 'Controllers/Patients', null);\n $this->_addAco('dashboard_pdf', null, 'Controllers/Patients', null);\n $this->_addAco('dashboardForSelf', null, 'Controllers/Patients', null);\n $this->_addAco('dashboardPdfForSelf', null, 'Controllers/Patients', null);\n $this->_addAco('createAppt', null, 'Controllers/Patients', null);\n\n $this->_addAco('Appointments', null, 'Controllers', null);\n $this->_addAco('add', null, 'Controllers/Appointments', null);\n $this->_addAco('edit', null, 'Controllers/Appointments', null);\n\n $this->_addAco('Clinicians', null, 'Controllers', null);\n $this->_addAco('add', null, 'Controllers/Clinicians', null);\n $this->_addAco('edit', null, 'Controllers/Clinicians', null);\n $this->_addAco('view', null, 'Controllers/Clinicians', null);\n $this->_addAco('viewAll', null, 'Controllers/Clinicians', null);\n $this->_addAco('changePriority', null, 'Controllers/Clinicians', null);\n $this->_addAco('generateWebkeys', null, 'Controllers/Clinicians', null);\n $this->_addAco('emailSurveyLink', null, 'Controllers/Clinicians', null);\n $this->_addAco('consents', null, 'Controllers/Clinicians', null);\n \n $this->_addAco('Journals', null, 'Controllers', null);\n $this->_addAco('index', null, 'Controllers/Journals', null);\n $this->_addAco('create', null, 'Controllers/Journals', null);\n $this->_addAco('edit', null, 'Controllers/Journals', null);\n $this->_addAco('delete', null, 'Controllers/Journals', null);\n $this->_addAco('listForReadOnly', null, 'Controllers/Journals', null);\n $this->_addAco('updateText', null, 'Controllers/Journals', null);\n \n $this->_addAco('ActivityDiaries', null, 'Controllers', null);\n $this->_addAco('index', null, 'Controllers/ActivityDiaries', null);\n $this->_addAco('edit', null, 'Controllers/ActivityDiaries', null);\n $this->_addAco('test', null, 'Controllers/ActivityDiaries', null);\n $this->_addAco('read', null, 'Controllers/ActivityDiaries', null);\n \n $this->_addAco('Associates', null, 'Controllers', null);\n $this->_addAco('create', null, 'Controllers/Associates', null);\n $this->_addAco('delete', null, 'Controllers/Associates', null);\n $this->_addAco('edit', null, 'Controllers/Associates', null);\n $this->_addAco('phraseEntry', null, 'Controllers/Associates', null);\n $this->_addAco('edit_list', null, 'Controllers/Associates', null);\n \n $this->_addAco('AudioFiles', null, 'Controllers', null);\n $this->_addAco('index', null, 'Controllers/AudioFiles', null);\n $this->_addAco('upload', null, 'Controllers/AudioFiles', null);\n $this->_addAco('download', null, 'Controllers/AudioFiles', null);\n $this->_addAco('code', null, 'Controllers/AudioFiles', null);\n $this->_addAco('review', null, 'Controllers/AudioFiles', null);\n $this->_addAco('assignCoders', null, 'Controllers/AudioFiles', null);\n $this->_addAco('viewAll', null, 'Controllers/AudioFiles', null);\n $this->_addAco('viewMine', null, 'Controllers/AudioFiles', null);\n $this->_addAco('edit', null, 'Controllers/AudioFiles', null);\n\n $this->_addAco('Medications', null, 'Controllers', null);\n $this->_addAco('index', null, 'Controllers/Medications', null);\n $this->_addAco('edit', null, 'Controllers/Medications', null);\n \n $this->_addAco('DataAccess', null, 'Controllers', null);\n $this->_addAco('index', null, 'Controllers/DataAccess', null);\n $this->_addAco('data_export', null, 'Controllers/DataAccess', null);\n $this->_addAco('scores_export', null, 'Controllers/DataAccess', null);\n $this->_addAco('non_tscores_export', null, 'Controllers/DataAccess', null);\n $this->_addAco('options_export', null, 'Controllers/DataAccess', null);\n $this->_addAco('questions_export', null, 'Controllers/DataAccess', null);\n $this->_addAco('demographics_export', null, 'Controllers/DataAccess', null);\n $this->_addAco('intervention_dose_export', null, 'Controllers/DataAccess', null);\n $this->_addAco('time_submitted_export', null, 'Controllers/DataAccess', null);\n\n $this->_addAco('Charts', null, 'Controllers', null);\n $this->_addAco('assignCoders', null, 'Controllers/Charts', null);\n $this->_addAco('viewAll', null, 'Controllers/Charts', null);\n\n $this->_addAco('ChartCodings', null, 'Controllers', null);\n $this->_addAco('code', null, 'Controllers/ChartCodings', null);\n $this->_addAco('review', null, 'Controllers/ChartCodings', null);\n\n }",
"public function rebuild()\n {\n $acl = new AclMemory();\n $acl->setDefaultAction(\\Phalcon\\Acl::DENY);\n\n // Add roles\n $roleAdmin = new AclRole('admin');\n $roleUser = new AclRole('user');\n $acl->addRole($roleUser);\n $acl->addRole($roleAdmin, $roleUser);\n\n // Add resources\n foreach ($this->protectedControllers as $role => $entry) {\n\n foreach ($entry as $controllerName => $actions) {\n\n $acl->addResource(new AclResource($controllerName), $actions);\n\n foreach ($actions as $action) {\n $acl->allow($role, $controllerName, $action);\n }\n }\n }\n\n if (touch($this->filePath) && is_writable($this->filePath)) {\n\n file_put_contents($this->filePath, serialize($acl));\n\n // Store the ACL in APC\n if (function_exists('apc_store')) {\n apc_store($this->apcName, $acl);\n }\n } else {\n throw new Exception('Unable to create the ACL list at ' . $this->filePath);\n }\n\n return $acl;\n }",
"protected function generateControllers()\n {\n self::generateName();\n self::dependencies();\n $this->functions = get_class_methods($this);\n $this->functionsCheck();\n }",
"protected function refreshControllerInfo()\n {\n // If we have already done the work, don't do it again\n if ($this->className!=null) {\n return;\n }\n\n // Break up the controller option into its parts\n $parts = preg_split('/:/', $this->options['controller']);\n\n // Build out the names of the class and function in the class\n $this->className = $parts[0].'\\\\controllers\\\\'.$parts[1];\n $this->classAction = $parts[2].'Action';\n\n // Also remember the clean names of the controller and action\n $this->action = $parts[2];\n\n // Try and remove Controller from the name...\n if (preg_match(\"/(.*)Controller/ui\", $parts[1], $regs) == 1) {\n $this->controller = $regs[1];\n } else {\n $this->controller = $parts[1];\n }\n }",
"protected function rebuildApplication()\n {\n if ($this->backupApplication) {\n $this->app = clone $this->backupApplication;\n } else {\n $this->backupApplication = clone $this->app;\n }\n\n // Reset container instance\n Container::setInstance($this->app);\n\n $this->app->rebuild();\n $this->router = $this->app->make(Router::class);\n\n foreach ($this->middlewareGroups as $key => $middleware) {\n $this->router->middlewareGroup($key, $middleware);\n }\n\n foreach ($this->routeMiddleware as $key => $middleware) {\n $this->router->middleware($key, $middleware);\n }\n }",
"private function loadAPIInfo() {\n if (!$this->apiControllers) {\n\n $this->apiControllers = array();\n $this->apiObjects = array();\n\n $applicationNamespaces = SourceBaseManager::instance()->getApplicationNamespaces();\n\n foreach ($applicationNamespaces as $applicationNamespace) {\n\n $apiControllerData = $this->readAPIControllerDataForDirectory(\"Controllers\", $applicationNamespace);\n\n /**\n * @var $controllerAnnotations ClassAnnotations\n * @var $controllerReflectionClass \\ReflectionClass\n */\n foreach ($apiControllerData as $path => list($controllerAnnotations, $controllerReflectionClass)) {\n\n // Get the short name.\n $controllerClass = $controllerReflectionClass->getShortName();\n $controllerPath = str_replace(\"Controllers/\", \"\", $path);\n\n $controllerApiNamespace = $controllerReflectionClass->getNamespaceName();\n\n $controllerComment = $controllerAnnotations->getClassAnnotationForMatchingTag(\"comment\") ?\n $controllerAnnotations->getClassAnnotationForMatchingTag(\"comment\")->getValue() : null;\n\n $controllerTitle = $controllerAnnotations->getClassAnnotationForMatchingTag(\"title\") ? $controllerAnnotations->getClassAnnotationForMatchingTag(\"title\")->getValue() : null;\n\n\n $requiredObjects = array();\n\n /**\n * Loop through the methods for the controller\n *\n * @var $reflectionMethod \\ReflectionMethod\n *\n */\n $controllerMethods = array();\n foreach ($controllerReflectionClass->getMethods() as $reflectionMethod) {\n\n if (!$reflectionMethod->isPublic() || $reflectionMethod->getDeclaringClass() != $controllerReflectionClass || $reflectionMethod->getName() == \"__construct\")\n continue;\n\n $annotations = $controllerAnnotations->getMethodAnnotations()[$reflectionMethod->getName()];\n\n $comment = isset($annotations[\"comment\"]) ? $annotations[\"comment\"][0]->getValue() : null;\n $http = isset($annotations[\"http\"]) ? $annotations[\"http\"][0]->getValue() : null;\n $segmentParams = array();\n $payloadIndex = -1;\n if ($http) {\n $exploded = explode(\" \", $http);\n $httpMethod = trim($exploded[0]);\n\n if (sizeof($exploded) > 1) {\n preg_match_all(\"/\\\\$[a-zA-Z0-9_]+/\", $exploded[1], $matchedParams);\n foreach ($matchedParams[0] as $segmentParam) {\n $segmentParams[ltrim($segmentParam, \"$\")] = 1;\n }\n\n $requestPath = trim($exploded[1], \"/ \");\n $requestPath = preg_replace(\"/\\\\$([a-zA-Z0-9_]+)/\", \"{\" . \"$1\" . \"}\", $requestPath);\n } else {\n $requestPath = \"\";\n }\n\n if ($httpMethod != \"GET\") {\n $payloadIndex = sizeof($segmentParams);\n }\n\n\n } else {\n $httpMethod = \"POST\";\n $requestPath = $reflectionMethod->getName();\n }\n\n\n $params = array();\n $extraParamIndex = 0;\n if (isset($annotations[\"param\"])) {\n foreach ($annotations[\"param\"] as $paramIndex => $parameterAnnotation) {\n\n $reflectionParam = $reflectionMethod->getParameters()[$paramIndex];\n\n $parameterLine = $parameterAnnotation->getValue();\n $parameterWords = explode(\" \", $parameterLine);\n $paramName = ltrim(is_numeric(strpos($parameterWords[0], \"$\")) ? $parameterWords[0] : (sizeof($parameterWords) > 1 ? $parameterWords[1] : null), \"$\");\n $paramType = is_numeric(strpos($parameterWords[0], \"$\")) ? (sizeof($parameterWords) > 1 ? $parameterWords[1] : null) : $parameterWords[0];\n\n $paramDescription = sizeof($parameterWords) > 2 ? join(\" \", array_slice($parameterWords, 2)) : \"\";\n\n if (is_numeric(strpos($paramType, \"\\\\\"))) {\n $paramType = $this->processAPIObject($paramType, $this->apiObjects);\n $requiredObjects[$this->stripArrayExtension($this->getClientNamespace($paramType))] = 1;\n }\n\n\n $params[] = $this->addLanguageSpecificProperties(new APIParam($paramName, $paramType, $paramDescription, isset($segmentParams[$paramName]), $paramIndex == $payloadIndex, $paramIndex, $extraParamIndex, $reflectionParam->isOptional() ? $reflectionParam->getDefaultValue() : \"_UNSET\", $this->getClientNamespace($paramType)));\n\n if (!isset($segmentParams[$paramName]) && ($paramIndex != $payloadIndex)) {\n $extraParamIndex++;\n }\n\n\n }\n\n }\n\n\n $returnType = null;\n if (isset($annotations[\"return\"])) {\n $returnType = $annotations[\"return\"][0]->getValue();\n\n $returnTypeWords = explode(\" \", $returnType);\n $returnType = $returnTypeWords[0];\n $returnDescription = sizeof($returnTypeWords) > 1 ? join(\" \", array_slice($returnTypeWords, 1)) : \"\";\n\n\n if (is_numeric(strpos($returnType, \"\\\\\"))) {\n $returnType = $this->processAPIObject($returnType, $this->apiObjects);\n $requiredObjects[$this->stripArrayExtension($this->getClientNamespace($returnType))] = 1;\n }\n\n }\n\n\n $exceptions = array();\n\n if (isset($annotations[\"throws\"])) {\n\n foreach ($annotations[\"throws\"] as $exceptionAnnotation) {\n\n $exceptionClass = trim($exceptionAnnotation->getValue());\n $exceptionClass = $this->processAPIObject($exceptionClass, $this->apiExceptions);\n $requiredObjects[$this->stripArrayExtension($this->getClientNamespace($exceptionClass))] = 1;\n\n $exceptions[] = $this->addLanguageSpecificProperties(new APIMethodException($exceptionClass, $this->getClientNamespace($exceptionClass)));\n }\n }\n\n\n list($limit, $limitMultiplier, $limitPeriod) = RateLimiterEvaluator::instance()->getRateLimitsForControllerMethod($controllerReflectionClass->getName(), $reflectionMethod->getName(), $controllerAnnotations);\n\n if ($limitPeriod !== null) {\n $exceptionClass = $this->processAPIObject(\"\\Kinikit\\MVC\\Exception\\RateLimitExceededException\", $this->apiExceptions);\n $requiredObjects[$this->stripArrayExtension($this->getClientNamespace($exceptionClass))] = 1;\n $exceptions[] = $this->addLanguageSpecificProperties(new APIMethodException($exceptionClass, $this->getClientNamespace($exceptionClass)));\n }\n\n\n $controllerMethods[] = $this->addLanguageSpecificProperties(new APIMethod($reflectionMethod->getName(), $comment, $httpMethod, $requestPath, $returnType, isset($returnDescription) ? $returnDescription : null, $params, $this->getClientNamespace($returnType), $exceptions, $limit, $limitMultiplier, $limitPeriod));\n\n }\n\n\n // Add the api controller to the stack\n $this->apiControllers[$controllerPath] = $this->addLanguageSpecificProperties(new APIController($controllerPath, $controllerApiNamespace, $controllerClass, $controllerTitle, $controllerComment, $controllerMethods, array_keys($requiredObjects), $this->getClientNamespace($controllerApiNamespace)));\n }\n\n }\n }\n }",
"private function _getControllers() {\n $contPath = Yii::app()->getControllerPath();\n\n $controllers = $this->_scanDir($contPath);\n \n \n //Scan modules\n $modules = Yii::app()->getModules();\n $modControllers = array();\n foreach ($modules as $mod_id => $mod) {\n $moduleControllersPath = Yii::app()->getModule($mod_id)->controllerPath;\n $modControllers = $this->_scanDir($moduleControllersPath, $mod_id, \"\", $modControllers);\n }\n return array_merge($controllers, $modControllers);\n }",
"private static function register_controllers() {\n $base_dir = $GLOBALS['wpatomic_base_dir:'.__DIR__];\n if( !file_exists( $base_dir.'/controllers' ) ) {\n return;\n }\n $controllers = self::get_controller_files();\n foreach( $controllers as $path ) {\n //Extract the short name of the class for each file\n $long_name = self::get_class_from_path( $path );\n try {\n //Construct a reflection class\n $ref = new \\ReflectionClass( $long_name );\n //Register the actions and filters for each controller\n self::register_hooks( $long_name );\n } catch(ReflectionException $e) {\n error_log( $e->getMessage() );\n }\n }\n }",
"public function get() {\n\n $aCtrlClasses = App::objects('controller');\n\n foreach ($aCtrlClasses as $controller) {\n if ($controller != 'AppController') {\n // Load the controller\n App::import('Controller', str_replace('Controller', '', $controller));\n\n // Load its methods / actions\n $aMethods = get_class_methods($controller);\n\n foreach ($aMethods as $idx => $method) {\n\n if ($method{0} == '_') {\n unset($aMethods[$idx]);\n }\n if(strpos($method,\"admin_\")===false){\n unset($aMethods[$idx]);\n }\n }\n\n // Load the ApplicationController (if there is one)\n App::import('Controller', 'AppController');\n $parentActions = get_class_methods('AppController');\n $controller = str_replace(\"Controller\",\"\",$controller);\n $controllers[$controller] = array_diff($aMethods, $parentActions);\n }\n }\n\n return $controllers;\n }",
"private function createRoutes(): void\n {\n foreach ( $this->controllerSet as $controllerName )\n {\n try\n {\n $contReflect = new ReflectionClass($controllerName);\n }\n catch ( ReflectionException )\n {\n continue;\n }\n\n if ( ! $contReflect->isSubclassOf($this->parentControllerName) )\n {\n continue;\n }\n\n $controllerLoader = new Controller($contReflect);\n $controllerLoader->run();\n }\n }",
"public function get() {\n\n $aCtrlClasses = App::objects('controller');\n\n foreach ($aCtrlClasses as $controller) {\n if ($controller != 'AppController') {\n // Load the controller\n App::import('Controller', str_replace('Controller', '', $controller));\n\n // Load its methods / actions\n $aMethods = get_class_methods($controller);\n if(!empty($aMethods)){\n foreach ($aMethods as $idx => $method) {\n\n if ($method{0} == '_') {\n unset($aMethods[$idx]);\n }\n }\n\n\n // Load the ApplicationController (if there is one)\n App::import('Controller', 'AppController');\n $parentActions = get_class_methods('AppController');\n\n $controllers[$controller] = array_diff($aMethods, $parentActions);\n }\n }\n }\n\n return $controllers;\n }",
"function buildAcl() {\r\n \t$this->Aclsetup->buildAcl($this);\r\n }",
"function startup() {\n\t\t$this->Acl =& new AclComponent();\n\t\t$controller = null;\n\t\t$this->Acl->startup($controller);\n\t\t$this->Aco =& $this->Acl->Aco;\n\t}",
"private function build_all(){\n $module_path = $this->cms_module_path();\n\n // parent of all navigations\n $this->add_navigation($this->cms_complete_navigation_name('index'), 'Admin Blulok',\n $module_path.'/admin_blulok', $this->PRIV_EVERYONE);\n\n // add navigations\n\n\n // create tables\n \n\n }",
"function clearbase_get_controllers() { \n global $clearbase_controllers;\n if ( !isset($clearbase_controllers) ) {\n $clearbase_controllers = array();\n $clearbase_controllers = apply_filters('clearbase_load_controllers', $clearbase_controllers);\n }\n \n return $clearbase_controllers;\n}",
"protected function generateControllers()\n {\n $controllers = [\n 'AuthenticatedSessionController',\n 'ConfirmablePasswordController',\n 'EmailVerificationNotificationController',\n 'EmailVerificationPromptController',\n 'NewPasswordController',\n 'PasswordResetLinkController',\n 'RegisteredUserController',\n 'VerifyEmailController',\n ];\n\n $this->files->ensureDirectoryExists($this->controllerPath);\n\n foreach ($controllers as $controller) {\n $stubPath = realpath(__DIR__.'/stubs/App/Http/Controllers/Auth/'.$controller.'.php');\n $savePath = $this->controllerPath.$controller.'.php';\n $this->files->put($savePath, $this->buildClass($stubPath));\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the paged list public views for given issue type. | public function getPublicViewsPage( $type, $orderBy, $limit, $offset )
{
$typeId = $type[ 'type_id' ];
$query = 'SELECT view_id, view_name, view_def'
. ' FROM {views}'
. ' WHERE type_id = %d AND user_id IS NULL';
return $this->connection->queryPage( $query, $orderBy, $limit, $offset, $typeId );
} | [
"public function getPublicViewsCount( $type )\n {\n $typeId = $type[ 'type_id' ];\n\n $query = 'SELECT COUNT(*)'\n . ' FROM {views}'\n . ' WHERE type_id = %d AND user_id IS NULL';\n\n return $this->connection->queryScalar( $query, $typeId );\n }",
"function get_page_list($type) {\n\tglobal $db;\n\t$page_data_array = array();\n\tif(trim($type)) {\n\t\t$query=mysqli_query($db,\"SELECT * FROM pages WHERE published='1' ORDER BY id ASC\");\n\t\twhile($page_data=mysqli_fetch_assoc($query)) {\n\t\t\t$exp_position=(array)json_decode($page_data['position']);\n\t\t\tif($type==$exp_position[$type]) {\n\t\t\t\t$page_data_array[] = $page_data;\n\t\t\t}\n\t\t}\n\t}\n\treturn $page_data_array;\n}",
"public function isPublicViewForIssueType( $type, $viewId )\n {\n $typeId = $type[ 'type_id' ];\n\n $query = 'SELECT view_id'\n . ' FROM {views}'\n . ' WHERE view_id = %d AND type_id = %d AND user_id IS NULL';\n\n return ( $this->connection->queryScalar( $query, $viewId, $typeId ) !== false );\n }",
"public function getViewForIssueType( $type, $viewId, $flags = 0 )\n {\n $principal = System_Api_Principal::getCurrent();\n\n $typeId = $type[ 'type_id' ];\n\n if ( $flags & self::IsPublic || !$principal->isAuthenticated() ) {\n $query = 'SELECT view_id, type_id, view_name, view_def, 1 AS is_public'\n . ' FROM {views}'\n . ' WHERE view_id = %1d AND type_id = %2d AND user_id IS NULL';\n } else {\n $query = 'SELECT view_id, type_id, view_name, view_def, ( CASE WHEN user_id IS NULL THEN 1 ELSE 0 END ) AS is_public'\n . ' FROM {views}'\n . ' WHERE view_id = %1d AND type_id = %2d AND ( user_id = %3d OR user_id IS NULL )';\n }\n\n if ( !( $view = $this->connection->queryRow( $query, $viewId, $typeId, $principal->getUserId() ) ) )\n throw new System_Api_Error( System_Api_Error::UnknownView );\n\n if ( ( $flags & self::AllowEdit ) && $view[ 'is_public' ] && !$principal->isAdministrator() )\n throw new System_Api_Error( System_Api_Error::AccessDenied );\n\n return $view;\n }",
"public function index()\n {\n // return excercisesets that are published to the public library\n $exercisesets = $exerciseset = Exerciseset::where([['publish_status', 'like', 'public']])->paginate(9);\n \n \n $ispublic = 1;\n \n // return view('exercisesets.index', compact('exercisesets'));\n return view('eduplaycloud.explore.public_library.index', compact('exercisesets', 'ispublic'))->render();\n }",
"public function index() {\n \n $this->params['page'] = empty($this->params['page']) ? 1 : $this->params['page'];\n \n $this->params['conditions'] = array('is_public' => true);\n \n $collection = $this->model->paginate($this->params);\n \n $this->set('objects', $collection['objects']);\n $this->set_pagination($collection);\n \n }",
"protected function list($type = null)\n {\n $portfolios = $this->repository\n ->pushCriteria(app('Litepie\\Repository\\Criteria\\RequestCriteria'))\n ->scopeQuery(function($query){\n return $query->orderBy('id','DESC');\n })->paginate();\n\n\n return $this->response->title(trans('portfolio::portfolio.names'))\n ->view('portfolio::public.portfolio.index')\n ->data(compact('portfolios'))\n ->output();\n }",
"protected function list($type = null)\n {\n $news = $this->repository\n ->pushCriteria(app('Litepie\\Repository\\Criteria\\RequestCriteria'))\n ->scopeQuery(function($query){\n return $query->orderBy('id','DESC');\n })->paginate();\n\n\n return $this->response->title(trans('news::news.names'))\n ->view('news::public.news.index')\n ->data(compact('news'))\n ->output();\n }",
"function getPagesPublishedTo()\n {\n $pages = [];\n foreach($this['meta']['issue']['hotspots'] as $hotspot) {\n $pages[$hotspot['page']['slug']] = $hotspot['page'];\n }\n return $pages;\n }",
"public function viewAll($type = null) {\n if($type == null){\n $inventory = \\App\\Inventory::paginate(9);\n return view('inventory.view_all', compact('inventory'));\n }\n else {\n $inventory = \\App\\Inventory::where('type', 'like', '%' . $type . '%')->paginate(9);\n return view('inventory.view_all', compact('inventory'));\n }\n }",
"public static function getApplicableViews($type) {\n // Get all display plugins which provides the type.\n $display_plugins = static::pluginManager('display')->getDefinitions();\n\n $plugin_ids = [];\n foreach ($display_plugins as $id => $definition) {\n if (!empty($definition[$type])) {\n $plugin_ids[$id] = $id;\n }\n }\n\n $entity_ids = \\Drupal::entityQuery('view')\n ->condition('status', TRUE)\n ->condition(\"display.*.display_plugin\", $plugin_ids, 'IN')\n ->execute();\n\n $result = [];\n foreach (\\Drupal::entityTypeManager()->getStorage('view')->loadMultiple($entity_ids) as $view) {\n // Check each display to see if it meets the criteria and is enabled.\n\n foreach ($view->get('display') as $id => $display) {\n // If the key doesn't exist, enabled is assumed.\n $enabled = !empty($display['display_options']['enabled']) || !array_key_exists('enabled', $display['display_options']);\n\n if ($enabled && in_array($display['display_plugin'], $plugin_ids)) {\n $result[] = [$view->id(), $id];\n }\n }\n }\n\n return $result;\n }",
"public function fetchPublishedPages()\n {\n $results = $this->fetchAllAsArray(\n array(\n 'where' => array(\n 'status = ? AND content_type = ?' => array(1, 2)\n ),\n 'order' => array (\n 'id DESC'\n ),\n 'paging' => $this->posts_per_page,\n 'page' => 1,\n 'eager' => array(\n 'comments' => array(\n 'eager' => array(\n 'commentinfo'\n )\n ),\n 'tags',\n 'postinfo',\n 'users',\n ),\n )\n );\n Foresmo::dateFilter($results);\n Foresmo::sanitize($results);\n return $results;\n }",
"public function getPublicTemplates(){\n return Template::where('public',true)->with('tagged', 'user')->get();\n }",
"private function get_needed_presenters($page_type)\n {\n }",
"public function views()\n {\n return $this->morphMany(\n config('page-view-counter.page_view_model'),\n 'visitable'\n );\n }",
"function view_list(){\n $sql = 'SELECT viewname FROM pg_views WHERE schemaname=\\'public\\' ORDER BY viewname';\n return($this->read_column($sql));\n }",
"public function user_can_only_view_public_tours()\n {\n $publicTour = Tour::factory()->public()->create();\n $draftTour = Tour::factory()->draft()->create();\n\n $response = $this->get(route('tours.index'))\n ->assertStatus(200);\n\n $response->assertSee($publicTour->name);\n $response->assertDontSee($draftTour->name);\n }",
"public function get_views() {\n global $DB, $CFG;\n\n $viewlist = array('default' => get_string('linkview', 'block_page_module'));\n\n $moduleid = $DB->get_field('course_modules', 'module', array('id' => $this->config->cmid));\n $modname = $DB->get_field('modules', 'name', array('id' => $moduleid));\n\n if (file_exists($CFG->dirroot.'/course/format/page/plugins/'.$modname.'.php')) {\n $viewlist[$modname] = get_string('pluginname', $modname);\n }\n\n if ($views = glob($CFG->dirroot.'/course/format/page/plugins/'.$modname.'_*.php')) {\n foreach ($views as $view) {\n $parts = pathinfo($view);\n $filename = $parts['filename'];\n if ($filename == 'page_item_default') {\n continue;\n }\n if ($filename == $modname) {\n $viewlist[$modname] = get_string('defaultpageview', 'block_page_module');\n } else {\n $viewname = str_replace($modname.'_', '', $filename);\n $lastdbg = $CFG->debug;\n $CFG->debug = false;\n $str = get_string('view_'.$filename, 'format_page');\n if (preg_match('/\\[\\[.*\\]\\]/', $str)) {\n $str = get_string('view_'.$viewname, $modname);\n }\n $CFG->debug = $lastdbg;\n $viewlist[\"$modname/$viewname\"] = $str;\n }\n }\n } else {\n /*\n * Last try : for non standardly handled modules, check in plugin directory.\n * We seek for page_item.php file or page_item_wviewname>.php\n */\n if ($views = glob($CFG->dirroot.'/mod/'.$modname.'/pageitem*.php')) {\n foreach ($views as $view) {\n $parts = pathinfo($view);\n $filename = $parts['filename'];\n if ($filename == 'pageitem') {\n $viewlist[$modname.'/default'] = get_string('defaultpageview', 'block_page_module');\n } else {\n $viewname = str_replace('pageitem_', '', $filename);\n $lastdbg = $CFG->debug;\n $CFG->debug = false;\n $str = get_string('view_'.$filename, $modname);\n if (preg_match('/\\[\\[.*\\]\\]/', $str)) {\n $str = get_string('view_'.$viewname, $modname);\n }\n $CFG->debug = $lastdbg;\n $viewlist[\"$modname/$viewname\"] = $str;\n }\n }\n }\n }\n\n return $viewlist;\n }",
"public function getPageTypes() {}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
set ajax validation state on all child controls | private function setAjaxValidation($ajaxValidation = true)
{
foreach( $this->controls as $childControl )
{
$childControl->ajaxValidation = (bool)$ajaxValidation;
}
} | [
"public function enableClientSideValidation();",
"public function ajaxValidation() {\n\t\t$config = $this->Brand->GetTheValidationFields();\n\t\t$this->form_validation->set_rules( $config );\n\t\tif( $this->form_validation->run() == false ) {\n\t\t\t$errors = validation_errors();\n\t\t\t\techo json_encode(['error'=>$errors]);\n\t\t} else {\n\t\t\techo json_encode(\"\");exit;\n\t\t}\n\t}",
"public function supportsClientSideValidation();",
"protected function preValidate()\n {\n $this->form->bind($this->arrFormValues);\n }",
"protected function beforeValidate()\n {\n $this->formRules();\n }",
"public function ajaxValidationAction()\n {\n if($this->_request->getPost('ajax_submit',false, Request::FILTER_INT))\n $result = 'ok_ajax';\n else\n $result = 'ok';\n $messages = array();\n\n if(!$this->validate())\n {\n $this->collectValidateErrors(); \n foreach($this->_view->getFormErrors() as $k => $v)\n {\n $messages['__data'.$k] = $v;\n }\n $result = 'error';\n }\n $tpl = '';\n if($result == 'error')\n {\n $tpl = $this->fetchElementTemplate('messages_summary');\n }\n $this->_view->sendJson( array('result'=>$result, 'messages'=>$messages, 'tpl'=>$tpl) );\n }",
"function run_ajax()\n\t{\n\t\t$result = (count($this->_field_data));\n\n\t\t// We should currently only be validating one field at a time,\n\t\t// and this POST field should have the name of it\n\t\t$field = ee()->input->post('ee_fv_field');\n\n\t\t// Remove any namespacing to run validation for the parent field\n\t\t$field = preg_replace('/\\[.+?\\]/', '', $field);\n\n\t\t// Unset any other rules that aren't for the field we want to\n\t\t// validate\n\t\tforeach ($this->_field_data as $key => $value)\n\t\t{\n\t\t\tif ($key != $field)\n\t\t\t{\n\t\t\t\tunset($this->_field_data[$key]);\n\t\t\t}\n\t\t}\n\n\t\t// Skip validation if we've emptied the field_data array,\n\t\t// can happen if we're not validating the requested field\n\t\tif (empty($this->_field_data) && $result)\n\t\t{\n\t\t\t$result = TRUE;\n\t\t}\n\n\t\t// Validate the field\n\t\tif ($result !== TRUE)\n\t\t{\n\t\t\t$result = $this->run();\n\t\t}\n\n\t\t// Send appropriate AJAX response based on validation result\n\t\tif ($result === FALSE)\n\t\t{\n\t\t\tee()->output->send_ajax_response(array('error' => form_error($field)));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tee()->output->send_ajax_response('success');\n\t\t}\n\t}",
"protected function init_ajax_post_checks() {\n\n\t\t/**\n\t\t * Registers and checks form AJAX iteration callback listeners.\n\t\t * @see class TSF_Extension_Manager\\FormGenerator\n\t\t *\n\t\t * Action is called in TSF_Extension_Manager\\LoadAdmin::_wp_ajax_tsfemForm_iterate().\n\t\t * It has already checked referrer and capability.\n\t\t * @see \\TSF_Extension_Manager\\LoadAdmin\n\t\t */\n\t\t\\add_action( 'tsfem_form_prepare_ajax_iterations', [ $this, '_init_ajax_iteration_callback' ] );\n\n\t\t/**\n\t\t * Listens to AJAX form save.\n\t\t * @see class TSF_Extension_Manager\\FormGenerator\n\t\t *\n\t\t * Action is called in TSF_Extension_Manager\\LoadAdmin::_wp_ajax_tsfemForm_save().\n\t\t * It has already checked referrer and capability.\n\t\t * @see \\TSF_Extension_Manager\\LoadAdmin\n\t\t */\n\t\t\\add_action( 'tsfem_form_do_ajax_save', [ $this, '_do_ajax_form_save' ] );\n\n\t\t/**\n\t\t * Listens to AJAX form validation\n\t\t */\n\t\t\\add_action( 'wp_ajax_tsfem_e_local_validateFormJson', [ $this, '_prepare_ajax_form_json_validation' ] );\n\t}",
"public function loadState()\n\t{\n\t\tparent::loadState();\n\t\t$this->_controlsRequiringPostData=$this->getViewState('ControlsRequiringPostBack',array());\n\t}",
"function admin_validate_edit_cms_ajax(){\r\r\n\t\t\r\r\n\t\t$this->layout = \"\";\r\r\n\t\t$this->autoRender = false;\r\r\n\t\tif($this->RequestHandler->isAjax()){\r\r\n\t\t\t$errors_msg = null;\r\r\n\t\t\tApp::import('Model','CmsPage');\r\r\n\t\t\t$this->CmsPage = new CmsPage();\r\r\n\t\t\t\r\r\n\t\t\t$data = $this->data;\r\r\n\t\t\tif(isset($data['CmsPage']['id'])){\r\r\n\t\t\t\t$data['CmsPage']['id'] = DECRYPT_DATA($data['CmsPage']['id']);\r\r\n\t\t\t}\r\r\n\t\t\t$errors = $this->CmsPage->valid_edit_cms($data);\r\r\n\t\t\tif ( is_array ( $this->data ) ){\r\r\n\t\t\t\tforeach ($this->data['CmsPage'] as $key => $value ){\r\r\n\t\t\t\t\tif( array_key_exists ( $key, $errors) ){\r\r\n\t\t\t\t\t\tforeach ( $errors [ $key ] as $k => $v ){\r\r\n\t\t\t\t\t\t\t$errors_msg .= \"error|$key|$v\";\r\r\n\t\t\t\t\t\t}\t\r\r\n\t\t\t\t\t}else {\r\r\n\t\t\t\t\t\t$errors_msg .= \"ok|$key\\n\";\r\r\n\t\t\t\t\t}\r\r\n\t\t\t\t}\r\r\n\t\t\t}\r\r\n\t\t\techo $errors_msg;\r\r\n\t\t\tdie();\r\r\n\t\t}\t\r\r\n\t}",
"function validate() {\n\t\t\tforeach ($this->fields as $name => $elems) {\n\t\t\t\tforeach ($elems as $elem) {\n\t\t\t\t\tif ($elem->hasAttribute('required'))\n\t\t\t\t\t\t$this->validateRequiredField($name);\n\t\t\t\t\tif ($elem->tagName == 'input' && $elem->getAttribute('type') == 'email')\n\t\t\t\t\t\t$this->validateEmailField($name);\n\t\t\t\t\tif ($elem->tagName == 'editor')\n\t\t\t\t\t\t$this->validateHtmlField($name);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->is_validated = true;\n\t\t}",
"public function validate() {\r\n\t\tforeach ($this->fields as $field) {\r\n\t\t\t$field->validate();\r\n\t\t}\r\n\t}",
"public function validateControlAndChildren()\n {\n // Initially Assume Validation is True\n $blnToReturn = true;\n\n // Check the Control Itself\n if (!$this->validate()) {\n $blnToReturn = false;\n }\n\n // Recursive call on Child Controls\n foreach ($this->getChildControls() as $objChildControl) {\n // Only Enabled and Visible and Rendered controls should be validated\n if (($objChildControl->Visible) && ($objChildControl->Enabled) && ($objChildControl->RenderMethod) && ($objChildControl->OnPage)) {\n if (!$objChildControl->validateControlAndChildren()) {\n $blnToReturn = false;\n }\n }\n }\n\n return $blnToReturn;\n }",
"function Control_Preload()\r\n\t{\r\n\t\t\r\n\t\t//get value from POSTBACK \r\n\t\t$value = Postback::Get($this);\r\n\t\t\r\n\t\tif ($value != null && $value != \"\")\r\n\t\t{\r\n\t\t\t$this->_PostbackData = $value;\r\n\t\t}\t\r\n\t\t\r\n\t\t//the posted data is an array\r\n\t\tfor ($i=0; $i<count($this->Children); $i++)\r\n\t\t{\r\n\t\t\t$child =& $this->Children[$i];\r\n\r\n\t\t\t//search in array if array value\r\n\t\t\tif (is_array($value) && array_search($child->Value, $value) !== false)\r\n\t\t\t{\r\n\t\t\t\t//if found from checkbox/radio, select this input\r\n\t\t\t\t$child->Selected = true;\t\r\n\t\t\t}\r\n\t\t\telse if (is_string($value) && $value == $child->Value)\r\n\t\t\t{\r\n\t\t\t\t//if found from selectbox\r\n\t\t\t\t$child->Selected = true;\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tparent::Control_Preload();\r\n\t}",
"protected function Form_Validate() {\n\t\t\t// By default, we report that Custom Validations passed\n\t\t\t$blnToReturn = true;\n\n\t\t\t// Custom validation rules goes here \n\t\t\t// Be sure to set $blnToReturn to false if any custom validation fails!\n\n\t\t\t$blnFocused = false;\n\t\t\tforeach ($this->GetErrorControls() as $objControl) {\n\t\t\t\t// Set Focus to the top-most invalid control\n\t\t\t\tif (!$blnFocused) {\n\t\t\t\t\t$objControl->Focus();\n\t\t\t\t\t$blnFocused = true;\n\t\t\t\t}\n\n\t\t\t\t// Blink on ALL invalid controls\n\t\t\t\t$objControl->Blink();\n\t\t\t}\n\n\t\t\treturn $blnToReturn;\n\t\t}",
"protected function Form_Validate() {\n\t\t\t// By default, we report that Custom Validations passed\n\t\t\t$blnToReturn = true;\n\n\t\t\t// Custom Validation Rules\n\t\t\t// TODO: Be sure to set $blnToReturn to false if any custom validation fails!\n\n\t\t\t$blnFocused = false;\n\t\t\tforeach ($this->GetErrorControls() as $objControl) {\n\t\t\t\t// Set Focus to the top-most invalid control\n\t\t\t\tif (!$blnFocused) {\n\t\t\t\t\t$objControl->Focus();\n\t\t\t\t\t$blnFocused = true;\n\t\t\t\t}\n\n\t\t\t\t// Blink on ALL invalid controls\n\t\t\t\t$objControl->Blink();\n\t\t\t}\n\n\t\t\treturn $blnToReturn;\n\t\t}",
"function validate()\n\t{\n\t\t$result = true;\n\n\t\tfor ($i = 0; isset($this->controls[$i]); $i++)\n\t\t{\n\t\t\t$result &= $this->controls[$i]->validate();\n\t\t}\n\n\t\treturn $result;\n\t}",
"public function onValidate() {\n\t\t/*\n\t\t * If the 'username' field is not empty, set the 'email' field required.\n\t\t */\n\t\tif (! $this->getElement ( 'username' )->isEmpty ()) {\n\t\t\t$this->getElement ( 'email' )->setRequired ();\n\t\t}\n\t}",
"public function __validate()\n {\n # See if the class has a __preValidate method\n if (method_exists($this, \"__preValidate\"))\n {\n $this->__preValidate();\n }\n \n # See if the class has a __postValidate method\n if (method_exists($this, \"__postValidate\"))\n {\n $this->__postValidate();\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation orderGetPositionsWithHttpInfo Get all order positions | public function orderGetPositionsWithHttpInfo($id, $with_optional = 'false', $only_chargeable = 'false', $limit = '100', $offset = '0', $embed = null)
{
$returnType = '\Swagger\Client\Model\ModelOrderPos';
$request = $this->orderGetPositionsRequest($id, $with_optional, $only_chargeable, $limit, $offset, $embed);
try {
$options = $this->createHttpClientOption();
try {
$response = $this->client->send($request, $options);
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
$e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
$e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
);
}
$statusCode = $response->getStatusCode();
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$request->getUri()
),
$statusCode,
$response->getHeaders(),
$response->getBody()
);
}
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
if ($returnType !== 'string') {
$content = json_decode($content);
}
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
} catch (ApiException $e) {
switch ($e->getCode()) {
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\Swagger\Client\Model\ModelOrderPos',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
}
throw $e;
}
} | [
"public function ordersOrderIdGetWithHttpInfo($orderId)\n {\n $returnType = '\\HappyCog\\OsborneApi\\ErpService\\Model\\Order';\n $request = $this->ordersOrderIdGetRequest($orderId);\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 '\\HappyCog\\OsborneApi\\ErpService\\Model\\Order',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n 'object',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n 'object',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"private function getOrderInfos()\n {\n $shipment = $this->xpath->query('/order/shipment')->item(0);\n $offer = $this->xpath->query('./offer', $shipment)->item(0);\n $this->order['url'] = $this->xpath->query('./url', $offer)->item(0)->nodeValue;\n $this->order['mode'] = $this->xpath->query('./mode', $offer)->item(0)->nodeValue;\n $this->order['offer']['operator']['code'] = $this->xpath->query('./operator/code', $offer)->item(0)->nodeValue;\n $this->order['offer']['operator']['label'] =\n $this->xpath->query('./operator/label', $offer)->item(0)->nodeValue;\n $this->order['offer']['operator']['logo'] = $this->xpath->query('./operator/logo', $offer)->item(0)->nodeValue;\n $this->order['service']['code'] = $this->xpath->query('./service/code', $offer)->item(0)->nodeValue;\n $this->order['service']['label'] = $this->xpath->query('./service/label', $offer)->item(0)->nodeValue;\n $this->order['price']['currency'] = $this->xpath->query('./service/code', $offer)->item(0)->nodeValue;\n $this->order['price']['tax-exclusive'] =\n $this->xpath->query('./price/tax-exclusive', $offer)->item(0)->nodeValue;\n $this->order['price']['tax-inclusive'] =\n $this->xpath->query('./price/tax-inclusive', $offer)->item(0)->nodeValue;\n $this->order['collection']['code'] = $this->xpath->query('./collection/type/code', $offer)->item(0)->nodeValue;\n $this->order['collection']['type_label'] =\n $this->xpath->query('./collection/type/label', $offer)->item(0)->nodeValue;\n $this->order['collection']['date'] = $this->xpath->query('./collection/date', $offer)->item(0)->nodeValue;\n $time = $this->xpath->query('./collection/time', $offer)->item(0);\n if ($time) {\n $this->order['collection']['time'] = $time->nodeValue;\n } else {\n $this->order['collection']['time'] = '';\n }\n $this->order['collection']['label'] = $this->xpath->query('./collection/label', $offer)->item(0)->nodeValue;\n $this->order['delivery']['code'] = $this->xpath->query('./delivery/type/code', $offer)->item(0)->nodeValue;\n $this->order['delivery']['type_label'] =\n $this->xpath->query('./delivery/type/label', $offer)->item(0)->nodeValue;\n $this->order['delivery']['date'] = $this->xpath->query('./delivery/date', $offer)->item(0)->nodeValue;\n $time = $this->xpath->query('./delivery/time', $offer)->item(0);\n if ($time) {\n $this->order['delivery']['time'] = $time->nodeValue;\n } else {\n $this->order['delivery']['time'] = '';\n }\n $this->order['delivery']['label'] = $this->xpath->query('./delivery/label', $offer)->item(0)->nodeValue;\n $proforma = $this->xpath->query('./proforma', $shipment)->item(0);\n if ($proforma) {\n $this->order['proforma'] = $proforma->nodeValue;\n } else {\n $this->order['proforma'] = '';\n }\n $this->order['alerts'] = array();\n $alerts_nodes = $this->xpath->query('./alert', $offer);\n foreach ($alerts_nodes as $a => $alert) {\n $this->order['alerts'][$a] = $alert->nodeValue;\n }\n $this->order['chars'] = array();\n $char_nodes = $this->xpath->query('./characteristics/label', $offer);\n foreach ($char_nodes as $c => $char) {\n $this->order['chars'][$c] = $char->nodeValue;\n }\n $this->order['labels'] = array();\n $label_nodes = $this->xpath->query('./labels/label', $shipment);\n foreach ($label_nodes as $l => $label) {\n $this->order['labels'][$l] = trim($label->nodeValue);\n }\n }",
"public function getOrdersAsyncWithHttpInfo($order_id = null, $payment_method = null, $company = null, $first_name = null, $last_name = null, $city = null, $state_region = null, $postal_code = null, $country_code = null, $phone = null, $email = null, $cc_email = null, $total = null, $screen_branding_theme_code = null, $storefront_host_name = null, $creation_date_begin = null, $creation_date_end = null, $payment_date_begin = null, $payment_date_end = null, $shipment_date_begin = null, $shipment_date_end = null, $rma = null, $purchase_order_number = null, $item_id = null, $current_stage = null, $channel_partner_code = null, $channel_partner_order_id = null, $_limit = '100', $_offset = '0', $_sort = null, $_expand = null)\n {\n $returnType = '\\ultracart\\v2\\models\\OrdersResponse';\n $request = $this->getOrdersRequest($order_id, $payment_method, $company, $first_name, $last_name, $city, $state_region, $postal_code, $country_code, $phone, $email, $cc_email, $total, $screen_branding_theme_code, $storefront_host_name, $creation_date_begin, $creation_date_end, $payment_date_begin, $payment_date_end, $shipment_date_begin, $shipment_date_end, $rma, $purchase_order_number, $item_id, $current_stage, $channel_partner_code, $channel_partner_order_id, $_limit, $_offset, $_sort, $_expand);\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 ordersGetAsyncWithHttpInfo()\n {\n $returnType = '\\HappyCog\\OsborneApi\\ErpService\\Model\\Order[]';\n $request = $this->ordersGetRequest();\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 placeOrderWithHttpInfo($order)\n {\n $request = $this->placeOrderRequest($order);\n\n try {\n try {\n $response = $this->httpClient->sendRequest($request);\n } catch (HttpException $e) {\n $response = $e->getResponse();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $response->getStatusCode(),\n (string) $request->getUri()\n ),\n $request,\n $response,\n $e\n );\n } catch (ClientExceptionInterface $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $request,\n null,\n $e\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n switch($statusCode) {\n case 200:\n if ('\\OpenAPI\\Client\\Model\\Order' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\Order', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\Order';\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\OpenAPI\\Client\\Model\\Order',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public static function placeOrderInfo($data=array())\n {\n if (empty($data)) {\n return new PlaceOrderInfo(null, null, null, null, null);\n } else {\n $customerPhone = empty($data['custome_phone']) ? null : $data['custome_phone'];\n $paymentType = empty($data['payment_type']) ? 'OXXO' : $data['payment_type'];\n $currency = empty($data['currency']) ? 'MXN' : $data['currency'];\n $expirationTime = empty($data['expiration_time']) ? null : $data['expiration_time'];\n $imageUrl = empty($data['image_url']) ? '': $data['image_url'];\n $appClientName = empty($data['app_client_name']) ? 'phpsdk' : $data['app_client_name'];\n $appClientVersion = empty($data['app_client_version']) ? Client::VERSION : $data['app_client_version'];\n $extras = empty($data['extras']) ? null : $data['extras'];\n\n return new PlaceOrderInfo(\n $data['order_id'],\n $data['order_name'],\n $data['order_price'],\n $data['customer_name'],\n $data['customer_email'],\n $customerPhone,\n $paymentType,\n $currency,\n $expirationTime,\n $imageUrl,\n $appClientName,\n $appClientVersion,\n $extras\n );\n }\n }",
"public function positionsGetAsyncWithHttpInfo($device_id = null, $from = null, $to = null, $id = null)\n {\n $returnType = '\\Swagger\\Client\\Model\\Position[]';\n $request = $this->positionsGetRequest($device_id, $from, $to, $id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"protected function restAccountsContactsPositionsGetRequest()\n {\n\n $resourcePath = '/rest/accounts/contacts/positions';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\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 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 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 orderNewWithHttpInfo($symbol, $side = null, $simple_order_qty = null, $order_qty = null, $price = null, $display_qty = null, $stop_px = null, $cl_ord_id = null, $cl_ord_link_id = null, $peg_offset_value = null, $peg_price_type = null, $ord_type = 'Limit', $time_in_force = null, $exec_inst = null, $contingency_type = null, $text = null)\n {\n $returnType = '\\Swagger\\Client\\Model\\Order';\n $request = $this->orderNewRequest($symbol, $side, $simple_order_qty, $order_qty, $price, $display_qty, $stop_px, $cl_ord_id, $cl_ord_link_id, $peg_offset_value, $peg_price_type, $ord_type, $time_in_force, $exec_inst, $contingency_type, $text);\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\\Order',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\Error',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\Error',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\Error',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function getPurchaseOrdersWithHttpInfo($ifModifiedSince = null, $status = null, $dateFrom = null, $dateTo = null, $order = null, $page = null)\n {\n $request = $this->getPurchaseOrdersRequest($ifModifiedSince, $status, $dateFrom, $dateTo, $order, $page);\n\n $response = $this->getSyncClient()->sendRequest($request);\n\n $statusCode = (int)$response->getStatusCode();\n\n switch($statusCode) {\n case 200:\n return [\n 'model' => ObjectSerializer::deserialize($response, '\\Consilience\\Xero\\AccountingSdk\\Model\\PurchaseOrders'),\n 'request' => $request,\n 'response' => $response\n ];\n }\n\n $returnType = '\\Consilience\\Xero\\AccountingSdk\\Model\\PurchaseOrders';\n\n return [\n 'model' => ObjectSerializer::deserialize($response, $returnType),\n 'request' => $request,\n 'response' => $response\n ];\n }",
"protected function _getRequestInfo($order)\n\t{\n\t\tif (!empty($order->getCustomerFirstname()) && !empty($order->getCustomerLastname())) {\n\t\t\t$customerName = $order->getCustomerFirstname() . ' ' . $order->getCustomerLastname();\n\t\t} else {\n\t\t\t$customerName = $order->getShippingAddress()->getName();\n\t\t}\n\n\t\t$customerTelephone = $order->getShippingAddress()->getTelephone();\n\t\tif (!$customerTelephone) $customerTelephone = \"\";\n\n\t\treturn [\n\t\t\t\"product\"\t\t=> [\n\t\t\t\t\"id\"\t\t=> \"{$order->getIncrementId()}\",\n\t\t\t\t\"price\"\t\t=> floatval($order->getGrandTotal()),\n\t\t\t\t\"name\"\t\t=> \"{$order->getIncrementId()}\",\n\t\t\t\t\"url\"\t\t=> \"\",\n\t\t\t\t\"currency\"\t=> strtoupper($order->getStoreCurrencyCode())\n\t\t\t],\n\t\t\t\"customer\"\t\t=> [\n\t\t\t\t\"name\"\t\t=> $customerName,\n\t\t\t\t\"email\"\t\t=> $order->getCustomerEmail(),\n\t\t\t\t\"phone\"\t\t=> $customerTelephone,\n\t\t\t],\n\t\t\t\"payment\"\t\t=> [\n\t\t\t\t\"type\"\t\t=> \"SPEI\"\n\t\t\t]\n\t\t];\n\t}",
"public function orderQueryWithHttpInfo($order_id = null, $symbol = null)\n {\n $returnType = 'object';\n $request = $this->orderQueryRequest($order_id, $symbol);\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 'object',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function getApiOrders()\n {\n return $this->api->QueryPrivate('OpenOrders', array('trades' => true)); \n }",
"public function getOrdersWithHttpInfo($limit = '100', $offset = '0', $embed = null)\n {\n $returnType = '\\Swagger\\Client\\Model\\ModelOrder';\n $request = $this->getOrdersRequest($limit, $offset, $embed);\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\\ModelOrder',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function getUserAccountPositionsWithHttpInfo($user_id, $user_secret, $account_id, string $contentType = self::contentTypes['getUserAccountPositions'][0], \\SnapTrade\\RequestOptions $requestOptions = new \\SnapTrade\\RequestOptions())\n {\n [\"request\" => $request, \"serializedBody\" => $serializedBody] = $this->getUserAccountPositionsRequest($user_id, $user_secret, $account_id, $contentType);\n\n // Customization hook\n $this->beforeSendHook($request, $requestOptions, $this->config);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n if (\n ($e->getCode() == 401 || $e->getCode() == 403) &&\n !empty($this->getConfig()->getAccessToken()) &&\n $requestOptions->shouldRetryOAuth()\n ) {\n return $this->getUserAccountPositionsWithHttpInfo(\n $user_id,\n $user_secret,\n $account_id,\n $contentType,\n $requestOptions->setRetryOAuth(false)\n );\n }\n\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n } catch (ConnectException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n null,\n null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n (string) $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n\n switch($statusCode) {\n case 200:\n if ('\\SnapTrade\\Model\\Position[]' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\SnapTrade\\Model\\Position[]' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\SnapTrade\\Model\\Position[]', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\SnapTrade\\Model\\Position[]';\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\SnapTrade\\Model\\Position[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function get_open_orders()\n {\n return $this->send_request(self::uri_get_orders);\n }",
"public function getOpenOrders() {\n\t\t$responseArray = $this->Comms->plazaCall('/services/rest/orders/v1/open', 'GET');\n\t\t$this->fixOpenOrdersResponse($responseArray);\n\t\treturn $responseArray;\n\t}",
"public function v1ListOrdersWithHttpInfo($location_id, $order = null, $limit = null)\n {\n // verify the required parameter 'location_id' is set\n if ($location_id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $location_id when calling v1ListOrders');\n }\n if (!is_null($limit) && ($limit > 200.0)) {\n throw new \\InvalidArgumentException('invalid value for \"$limit\" when calling VTransactionsApi.v1ListOrders, must be smaller than or equal to 200.0.');\n }\n\n // parse inputs\n $resourcePath = \"/v1/{location_id}/orders\";\n $httpBody = '';\n $queryParams = [];\n $headerParams = [];\n $formParams = [];\n $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']);\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']);\n \n // query params\n if ($order !== null) {\n $queryParams['order'] = $this->apiClient->getSerializer()->toQueryValue($order);\n }\n // query params\n if ($limit !== null) {\n $queryParams['limit'] = $this->apiClient->getSerializer()->toQueryValue($limit);\n }\n // path params\n if ($location_id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"location_id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($location_id),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires OAuth (access token)\n if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {\n $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('Authorization');\n if (strlen($apiKey) !== 0) {\n $headerParams['Authorization'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'GET',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\SquareConnect\\Model\\V1Order[]',\n '/v1/{location_id}/orders'\n );\n\n return [$this->apiClient->getSerializer()->deserialize($response, '\\SquareConnect\\Model\\V1Order[]', $httpHeader), $statusCode, $httpHeader];\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\SquareConnect\\Model\\V1Order[]', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function getOrderTrackingParams($order);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
create view to show admin_view.php | public function index()
{
$view = new View();
$view->renderAdmin('admin_view.php', 'admin_view.php');
} | [
"public function admin_page() {\n echo $this->generateView('main', []);\n }",
"public function show_admin_page() {\n\t\t$this->view->render();\n\t}",
"public function adminmenu()\n {\n\n $vue = new ViewAdmin(\"Administration\");\n $vue->generer(array());\n }",
"public function createAdminPage()\n {\n return view('vendor.installer.create-admin');\n }",
"public function loadAdmin(){\n\t\t$this->load->view('shared/_adminlayout', $this->template);\n\t}",
"public function menu_admin()\n {\n echo view('template/header');\n echo view('menuadmin');\n }",
"function showAdmin()\n {\n AuthHelper::checkAdmin();\n //llamado a la vista\n $this->view->showAdmin();\n }",
"public function getAdminView() {\r\n ob_start();\r\n\tinclude($this->module . '/blocks/' . $this->blockName . '/adminView.php');\r\n return ob_get_clean();\r\n }",
"public function hadoop_admin()\n\t{\n\t\t$data[\"page\"] = \"Page123\";\n\t\t$this->load->view($this->_hadoop_admin,$data);\n\t}",
"public function view() {\n\n // Set page's title\n md_set_the_title($this->CI->lang->line('admin'));\n\n // Set the component's slug\n md_set_component_variable('component_slug', 'admin');\n\n // Set styles\n md_set_css_urls(array('stylesheet', base_url('assets/base/admin/collection/admin/styles/css/styles.css?ver=' . MIDRUB_BASE_ADMIN_ADMIN_VERSION), 'text/css', 'all'));\n\n // Template array\n $template = array();\n\n // Get admin's pages\n $admin_pages = md_the_admin_pages();\n\n // Verify if admin pages exists\n if ($admin_pages) {\n\n // Verify if page exists\n if ( $this->CI->input->get('p', true) ) {\n\n // List all admin's pages\n foreach ($admin_pages as $admin_page) {\n\n // Get page slug\n $page_slug = array_keys($admin_page);\n\n // Verify if the admin page meets the required page\n if ( $page_slug[0] === $this->CI->input->get('p', true) ) {\n\n // Verify if the page has the css_urls array\n if (isset($admin_page[$page_slug[0]]['css_urls'])) {\n\n // Verify if the css_urls array is not empty\n if ($admin_page[$page_slug[0]]['css_urls']) {\n\n // List all css links\n foreach ($admin_page[$page_slug[0]]['css_urls'] as $css_link_array) {\n\n // Add css link in the queue\n md_set_css_urls($css_link_array);\n \n }\n\n }\n\n }\n\n // Verify if the page has the js_urls array\n if (isset($admin_page[$page_slug[0]]['js_urls'])) {\n\n // Verify if the js_urls array is not empty\n if ($admin_page[$page_slug[0]]['js_urls']) {\n\n // List all js links\n foreach ($admin_page[$page_slug[0]]['js_urls'] as $js_link_array) {\n\n // Add js link in the queue\n md_set_js_urls($js_link_array);\n\n }\n\n }\n\n }\n\n // Set the component's display\n md_set_component_variable('component_display', $page_slug[0]);\n\n // Load the editor\n $template['body'] = $this->CI->load->ext_view(MIDRUB_BASE_ADMIN_ADMIN . 'views', 'main', array(), true);\n break;\n\n }\n\n }\n\n } else {\n\n // List all admin's pages\n foreach ($admin_pages as $admin_page) {\n\n // Get page slug\n $page_slug = array_keys($admin_page);\n\n // Verify if the page has the css_urls array\n if (isset($admin_page[$page_slug[0]]['css_urls'])) {\n\n // Verify if the css_urls array is not empty\n if ($admin_page[$page_slug[0]]['css_urls']) {\n\n // List all css links\n foreach ($admin_page[$page_slug[0]]['css_urls'] as $css_link_array) {\n\n // Add css link in the queue\n md_set_css_urls($css_link_array);\n\n }\n\n }\n\n }\n\n // Verify if the page has the js_urls array\n if (isset($admin_page[$page_slug[0]]['js_urls'])) {\n\n // Verify if the js_urls array is not empty\n if ($admin_page[$page_slug[0]]['js_urls']) {\n\n // List all js links\n foreach ($admin_page[$page_slug[0]]['js_urls'] as $js_link_array) {\n\n // Add js link in the queue\n md_set_js_urls($js_link_array);\n\n }\n\n }\n\n }\n\n // Set the component's display\n md_set_component_variable('component_display', $page_slug[0]);\n\n // Load the editor\n $template['body'] = $this->CI->load->ext_view(MIDRUB_BASE_ADMIN_ADMIN . 'views', 'main', array(), true);\n break;\n\n }\n\n }\n\n }\n\n // Verify if body was setup\n if ( !isset($template['body']) ) {\n show_404();\n }\n\n // Making temlate and send data to view.\n $template['header'] = $this->CI->load->view('admin/layout/header2', array('admin_header' => admin_header()), true);\n $template['left'] = $this->CI->load->view('admin/layout/left', array(), true);\n $template['footer'] = $this->CI->load->view('admin/layout/footer', array(), true);\n $this->CI->load->ext_view(MIDRUB_BASE_ADMIN_ADMIN . 'views/layout', 'index', $template);\n \n }",
"public function NewAdmin(){\n return view('admin.new_admin');\n }",
"public function render_admin_page() {\r\n\t\r\n\t\tinclude_once LITEBOX_PATH . '/views/litebox.admin.layout.php';\r\n\t\tinclude_once LITEBOX_PATH . '/views/help.php';\r\n\t\tinclude_once LITEBOX_PATH . '/views/shortcode.php';\r\n\t\t\r\n\t}",
"public function admin_view_controller() {\n\t\tglobal $plugin_page, $wpdb;\n\t\t$page_title = get_admin_page_title();\n\n\t\t/// https://digwp.com/2016/05/wordpress-admin-notices/\n\n\t\tswitch ($plugin_page) {\n\t\t\tcase 'iflpm_dashboard':\n\t\t\t\tinclude IFLPM_VIEWS_PATH . 'dashboard.inc.php';\n\t\t\t\tbreak;\n\t\t\tcase 'iflpm_events':\n\t\t\t\tinclude IFLPM_VIEWS_PATH . 'events-manager.inc.php';\n\t\t\t\tbreak;\n\t\t\tcase 'iflpm_members':\n\t\t\t\tinclude IFLPM_VIEWS_PATH . 'member-manager.inc.php';\n\t\t\t\tbreak;\n\t\t\tcase 'iflpm_readers':\n\t\t\t\tinclude IFLPM_VIEWS_PATH . 'reader-manager.inc.php';\n\t\t\t\tbreak;\n\t\t\tcase 'iflpm_settings':\n\t\t\t\tinclude IFLPM_VIEWS_PATH . 'settings.inc.php';\n\t\t\t\tbreak;\t\n\t\t\tdefault:\n\t\t\t\t# code...\n\t\t\t\tbreak;\n\t\t}\n\n\t}",
"public function adminpage(){\n\t\t$content = \"ademik/useraccess/useraccess/adminpage\";\n\t\t$this->load->view('temp/head');\n\t\t$this->load->view($content);\n\t\t$this->load->view('temp/footers');\n\t\t//echo \"123\";\n\t\t//$a['tab'] = $this->app->all_val('groupmodul')->result();\n\t\t//$this->load->view('dashbord',$a);\n\t}",
"public function adminlogs()\n {\n // Make sure the user can view this page\n if( !$this->check_permission('view_admin_logs')) return;\n\n // Build our page title / desc, then load the view\n $data = array(\n 'page_title' => \"View Admin Logs\",\n 'page_desc' => \"Here you can view what actions each member of your admin group have preformed.\",\n );\n $this->load->view('adminlogs', $data);\n }",
"public function _adminPage()\n\t{\t\t\n\t\t// Render notice\n\t\tif($error = $this->error)\n\t\t{\t\n\t\t\t$this->notice = is_array($error) ? implode('<br />', array_unique($error)) : $error;\n\t\t\t$this->notice = '<div class = \"error\"><p>' . $this->notice . '</p></div>';\n\t\t}\n\t\t\n\t\tif($note = $this->notice)\n\t\t\techo $note[0] != '<' ? '<div class = \"updated\"><p>' . $note . '</p></div>' : $note;\n\t\t\n\t\trequire_once dirname(dirname(__FILE__)) . '/resource/view.admin.phtml';\n\t}",
"function admin_view($id) {\n\t\t$conditions = array('Page.id' => $id);\n\t\t$page = $this->Page->find('first', compact('conditions'));\n\t\tif(empty($page))\n\t\t{\n\t\t\tif('users' == $this->Session->read('Auth.User.usergroup_slug'))\n\t\t\t{\n\t\t\t\t$this->action = 'add';\n\t\t\t} else {\n\t\t\t\t$this->cakeError('404', array('code' => '404', 'name' => __('Page not found', true), 'message' => $this->here));\n\t\t\t}\n\t\t}\n\t\tConfigure::write('cms.current.page', $page); //write that down, so we can use it everywhere\n\t\t\n\t\t//TODO: check here, if that is all there\n\t\t$this->viewPath = 'templates';\n\n\n\t\t//$this->theme = 'bruensicke';\n\t\t$this->autoRender = 0;\n\t\t$this->autoLayout = 1;\n\t\t//debug($this);\n\t\t\n\t\t$output = $this->render($page['Page']['template'], $page['Page']['layout']);\n\t\t$this->set('output', $this->output);\n\t}",
"function ts_create_admin_page(){ require_once( get_template_directory().'/inc/templates/ts-admin.php' ); }",
"public function adminView(){\n\t\t$categories = $this->__getAllCategories(); // for the navigation menu\n\t\tif( Auth::isAdmin() ){ // We checks that the user is an admin\n\t\t\treturn view('forumAdminView', $categories);\n\t\t} else { // If not we return the index\n\t\t\treturn $this->index();\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Normalizes provided value according to selected format. | final public static function normalize( $value, $format = null )
{
return static::current()->convertValue( $value, $format );
} | [
"public function normalize($value);",
"public function normalize($value) {\n return $value;\n }",
"function scaleup_normalize_value( $value, $format = 'string' ) {\n switch ( $format ):\n case 'args_string':\n $value = wp_parse_args( $value );\n break;\n default:\n $value = array( 'value' => $value );\n endswitch;\n return $value;\n}",
"private function normalizeValue($value)\n {\n // Controlls the way things are converted to a string.\n // Otherwise localization settings impact float to string conversion (e.x 1.3 -> 1,3 and 10000 => 10,000)\n\n return rtrim(rtrim(number_format((float) $value, $this->decimalPrecision, '.', ''), \"0\"), \".\");\n }",
"protected function normalize()\r\n\t{\r\n\t\tif ($this->isFetched())\r\n\t\t{\r\n\t\t\tif ($this->validationInfo)\r\n\t\t\t{\r\n\t\t\t\t$this->normalizedValue = $this->validationInfo->normalize($this->taintValue);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$this->normalizedValue = $this->taintValue;\r\n\t\t\t}\t\r\n\t\t}\r\n\t}",
"private function filter_format( $value ) {\n\t\tif ( empty( $this->format ) ) {\n\t\t\treturn $value;\n\t\t}\n\n\t\tif ( empty( $value ) ) {\n\t\t\treturn $value;\n\t\t}\n\n\t\tswitch ( $this->format->case() ) {\n\t\t\tcase Schema_Format::URI:\n\t\t\t\t$value = filter_var( $value, FILTER_VALIDATE_URL );\n\t\t\t\tbreak;\n\t\t\tcase Schema_Format::DATE:\n\t\t\t\t$value = date( 'Y-m-d', strtotime( $value ) );\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $value;\n\t}",
"function wp_review_normalize_rating_value( $value, $type ) {\n\t$rating_type = wp_review_get_rating_type_data( $type );\n\tif ( ! $rating_type ) {\n\t\treturn $value;\n\t}\n\t$value = floatval( $value );\n\t$num = pow( 10, $rating_type['decimals'] );\n\treturn round( $value * $num ) / $num;\n}",
"function normalizer_normalize($input, $form = Normalizer::FORM_C) {}",
"public function formatValue($value);",
"public static function normalize_if_numeric($value)\n {\n if (is_numeric($value)) {\n $value = false !== strpos($value, '.') ? floatval($value) : intval($value);\n }\n\n return $value;\n }",
"abstract protected function _normalizeInt($value);",
"public static function normalize($value)\n {\n return is_array($value) ? self::sort($value) : $value;\n }",
"function unformatValue($value) {\n\t$value = str_replace(['$',','],'',$value);\n\t\n\tif (is_numeric($value)) $value *= 1; //Convert to a number\n\t\n\treturn $value; \n}",
"public function normalizeNumber(string $number) : string;",
"abstract public function format($value);",
"public function setNormalizeMin($value) {\n\n $this->normalizeMin = (int) $value;\n\n }",
"public function setEmolumentNormalAttribute($value)\n {\n $this->attributes['emolument_normal'] = unFormatMoney($value);\n }",
"protected function normalizeVal($val){\n \n if(is_numeric($val)){\n \n if(ctype_digit((string)$val)){\n \n $val = (int)$val;\n \n }else{\n \n $val = (float)$val;\n \n }//if/else\n \n }else{\n \n // convert literal true or false into actual booleans...\n switch(mb_strtoupper($val)){\n \n case 'TRUE':\n $val = true;\n break;\n \n case 'FALSE':\n $val = false;\n break;\n \n }//switch\n \n }//if\n \n return $val;\n \n }",
"public function getValueFormat($value);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
CENTRAL SETTING Define relation USER CENTRAL SETTING | public function settings() {
return $this->hasMany('\App\CentralSetting', 'userId', 'id');
} | [
"public function settings()\n\t{\n\t\treturn $this->hasOne(config('core.acl.user_setting_model'), 'user_id');\n\t}",
"private function user_settings() {\n\n\t\t$controller = new Mlp_Redirect_User_Settings();\n\t\t$controller->setup();\n\t}",
"private function migrateKnowledgeGraphSettings() {\n\t\tif ( ! empty( $this->options['company_or_person'] ) ) {\n\t\t\taioseo()->options->searchAppearance->global->schema->siteRepresents =\n\t\t\t\t'company' === $this->options['company_or_person'] ? 'organization' : 'person';\n\t\t}\n\n\t\t$settings = [\n\t\t\t'company_or_person_user_id' => [ 'type' => 'string', 'newOption' => [ 'searchAppearance', 'global', 'schema', 'person' ] ],\n\t\t\t'person_logo' => [ 'type' => 'string', 'newOption' => [ 'searchAppearance', 'global', 'schema', 'personLogo' ] ],\n\t\t\t'person_name' => [ 'type' => 'string', 'newOption' => [ 'searchAppearance', 'global', 'schema', 'personName' ] ],\n\t\t\t'company_name' => [ 'type' => 'string', 'newOption' => [ 'searchAppearance', 'global', 'schema', 'organizationName' ] ],\n\t\t\t'company_logo' => [ 'type' => 'string', 'newOption' => [ 'searchAppearance', 'global', 'schema', 'organizationLogo' ] ],\n\t\t];\n\n\t\taioseo()->importExport->yoastSeo->helpers->mapOldToNew( $settings, $this->options );\n\t}",
"private function set_settings_capability_user() {\n\t\t// Can subsites overwrite?.\n\t\t$can_overwrite = Permission::can_overwrite( 'settings' );\n\n\t\t// Get enabled and disabled users.\n\t\t$included_users = (array) shush_toolkit()->settings->get( 'settings_include_users', 'permissions', ! $can_overwrite, array() );\n\t\t$excluded_users = (array) shush_toolkit()->settings->get( 'settings_exclude_users', 'permissions', ! $can_overwrite, array() );\n\n\t\t// Loop through all allowed users.\n\t\tforeach ( $included_users as $user_id ) {\n\t\t\t$user = get_userdata( $user_id );\n\n\t\t\t// Grant settings capability to the user.\n\t\t\tif ( $user instanceof WP_User ) {\n\t\t\t\t$user->add_cap( self::SETTINGS_CAP, true );\n\t\t\t}\n\t\t}\n\n\t\t// Loop through all denied users.\n\t\tforeach ( $excluded_users as $user_id ) {\n\t\t\t$user = get_userdata( $user_id );\n\n\t\t\t// Deny settings capability to the user.\n\t\t\tif ( $user instanceof WP_User ) {\n\t\t\t\t$user->add_cap( self::SETTINGS_CAP, false );\n\t\t\t}\n\t\t}\n\t}",
"function get_user_settings() {\n\n $settings = new Settings();\n // when using Service Provider Initiated SSO (starting at index.php), this URL asks the IdP to authenticate the user. \n $settings->idp_sso_target_url = variable_get('onelogin_saml_login_url'); //\"https://app.onelogin.com/saml/signon/6171\";\n // the certificate for the users account in the IdP\n $settings->x509certificate = variable_get('onelogin_saml_cert');\n return $settings;\n }",
"public function setCredentials()\n\t{\n\t\t$settings_repo = new \\Kickapoo\\Repositories\\SettingRepository;\n\t\t$this->credentials = $settings_repo->socialCreds();\n\t}",
"public function userSetting()\n {\n return $this->hasOne(UserSetting::class);\n }",
"function set_al_user_settings($user_id)\n{\n\tglobal $db;\n\t$sql = 'UPDATE ' . AL_USER_DATA .\n\t\t\t\" SET al_user_settings = '$settings'\n\t\t\t WHERE user_id = '$user_id'\";\n\t\t\t\n\t$result = $db->sql_query($sql);\n\t\n\tif(!$result)\n\t{\n\t\treturn false;\n\t}\n\telse\n\t{\n\t\treturn true;\n\t}\n}",
"public function getConnectionSettings();",
"public function getUserSettings()\n {\n return $this->hasMany(UserSettings::className(), ['user_id' => 'id']);\n }",
"function GetSettings($user_info)\r\n\t{\r\n\t\t$userId = GetUserID($user_info);\r\n\t\t\r\n\t\t$strSQL = \"\r\n\t\t\tSELECT\r\n\t\t\t\t*\r\n\t\t\tFROM\r\n\t\t\t\ttblUser\r\n\t\t\t\tLEFT JOIN tblOrganization ON tblUser.org_ID = tblOrganization.org_ID\r\n\t\t\tWHERE\r\n\t\t\t\tuser_ID = $userId\";\r\n\t\t\t\t\r\n\t\tOutputXMLList($strSQL, \"userSettings\", \"settings\");\r\n\t}",
"function cubic_get_user_settings() {\n\tglobal $CFG, $USER, $OUTPUT;\n\t\n\t$title = get_string('menu-settings','theme_cubic');\n\t$html = '<div class=\"title\">'.$title.'</div>';\n\tif(isloggedin() && !isguestuser()) {\n\t\t$html.= \n\t\t\t'<div class=\"container\">'.\n\t\t\t\t'<div class=\"setting\">'.\n\t\t\t\t\t'<a href=\"'.$CFG->wwwroot.'/user/edit.php?id='.$USER->id.'\">'.\n\t\t\t\t\t\tget_string('settings-edit','theme_cubic').\n\t\t\t\t\t\t'<img src=\"'.$OUTPUT->pix_url('t/edit').'\" class=\"icon\" />'.\n\t\t\t\t\t'</a>'.\n\t\t\t\t'</div>'.\n\t\t\t\t'<div class=\"setting\">'.\n\t\t\t\t\t'<a href=\"'.$CFG->wwwroot.'/login/change_password.php?id=1\">'.\n\t\t\t\t\t\tget_string('settings-password','theme_cubic').\n\t\t\t\t\t\t'<img src=\"'.$OUTPUT->pix_url('i/key').'\" class=\"icon\" />'.\n\t\t\t\t\t'</a>'.\n\t\t\t\t'</div>'.\n\t\t\t\t'<div class=\"setting\">'.\n\t\t\t\t\t'<a href=\"'.$CFG->wwwroot.'/message/edit.php?id='.$USER->id.'\">'.\n\t\t\t\t\t\tget_string('settings-msg','theme_cubic').\n\t\t\t\t\t\t'<img src=\"'.$OUTPUT->pix_url('t/email').'\" class=\"icon\" />'.\n\t\t\t\t\t'</a>'.\n\t\t\t\t'</div>'.\n\t\t\t\t'<div class=\"setting\">'.\n\t\t\t\t\t'<a href=\"'.$CFG->wwwroot.'/login/logout.php?sesskey='.sesskey().'\">'.\n\t\t\t\t\t\tget_string('settings-logout','theme_cubic').\n\t\t\t\t\t\t'<img src=\"'.$OUTPUT->pix_url('a/logout').'\" class=\"icon\" />'.\n\t\t\t\t\t'</a>'.\n\t\t\t\t'</div>'.\n\t\t\t'</div>';\n\t}\n\telse {\n\t\t$html.=\n\t\t\t'<div class=\"container\">'.\n\t\t\t\t'<div class=\"setting\">'.\n\t\t\t\t\t'<a href=\"'.$CFG->wwwroot.'/login/index.php\">'.\n\t\t\t\t\t\tget_string('settings-login','theme_cubic').\n\t\t\t\t\t\t'<img src=\"'.$OUTPUT->pix_url('a/login').'\" class=\"icon\" />'.\n\t\t\t\t\t'</a>'.\n\t\t\t\t'</div>'.\n\t\t\t\t'<div class=\"setting\">'.\n\t\t\t\t\t'<a href=\"'.$CFG->wwwroot.'/login/forgot_password.php\">'.\n\t\t\t\t\t\tget_string('settings-reset','theme_cubic').\n\t\t\t\t\t\t'<img src=\"'.$OUTPUT->pix_url('i/key').'\" class=\"icon\" />'.\n\t\t\t\t\t'</a>'.\n\t\t\t\t'</div>'.\n\t\t\t'</div>';\n\t}\n\t\n\treturn $html;\n}",
"public function set_user_role(){\n\t\t$this->user_role = $this->get_val($this->global_settings, 'permission', 'administrator');\n\t\tif($this->user_role === 'admin') $this->user_role = 'administrator';\n\t\tif(!in_array($this->user_role, array('author', 'editor', 'administrator'))) $this->user_role = 'administrator';\n\t\t\n\t\tswitch($this->user_role){\n\t\t\tcase 'author':\n\t\t\t\t$this->user_role = 'edit_published_posts';\n\t\t\tbreak;\n\t\t\tcase 'editor':\n\t\t\t\t$this->user_role = 'edit_pages';\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\tcase 'admin':\n\t\t\tcase 'administrator':\n\t\t\t\t$this->user_role = 'manage_options';\n\t\t\tbreak;\n\t\t}\n\t}",
"private function preferenciassUser() {\r\n }",
"function local_accessibilitytool_extend_navigation_user_settings(navigation_node $useraccount,\n stdClass $user,\n context_user $usercontext,\n stdClass $course,\n context_course $coursecontext) {\n global $PAGE;\n // Don't bother doing needless calculations unless we are on the relevant pages.\n $onpreferencepage = $PAGE->url->compare(new moodle_url('/user/preferences.php'), URL_MATCH_BASE);\n if (!$onpreferencepage) {\n return null;\n }\n\n $parent = $useraccount->parent->find(\"useraccount\",\n navigation_node::TYPE_CONTAINER);\n $parent->add(get_string(\"accessibilitytoolpreferences\", \"local_accessibilitytool\"),\n new moodle_url(\"/local/accessibilitytool/manage.php\"));\n\n}",
"public function users_settings(){\n return $this->hasMany('App\\users_settings','username','username');\n }",
"function set_user_settings_options($args) {\n\n require_once MIDRUB_BASE_PATH . 'inc/components/user_options.php';\n\n md_set_user_component_options($args);\n \n }",
"public function set_custom_variables() {\n\t\t/**\n\t\t * Set the user\n\t\t */\n\t\tif ( is_user_logged_in() ) {\n\t\t\t$user = wp_get_current_user();\n\t\t\tnewrelic_set_user_attributes( $user->ID, '', implode( ', ', $user->roles ) );\n\t\t} else {\n\t\t\tnewrelic_set_user_attributes( 'not-logged-in', '', 'no-role' );\n\t\t}\n\n\t\t/**\n\t\t * Set the theme used\n\t\t */\n\t\t$theme = wp_get_theme();\n\t\tnewrelic_add_custom_parameter( 'Theme Name', $theme->get( 'Name' ) );\n\t\tnewrelic_add_custom_parameter( 'Theme Files', $theme->get_stylesheet() );\n\t}",
"public function updateUserSettings() {\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
compare records of two tables with same id (e.g. tb_entity_thing & tb_index_thing), return the ids listed in source_table but not in target_table if $parameter['include_update'] === true, return ids in source_table with newer update_time as well | function db_compare_records($parameter)
{
$result = array();
$sql = 'SELECT ' . $parameter['source_primary_key'] . '
FROM ' . $parameter['source_table'] . '
WHERE 1';
if (isset($parameter['id_group']))
{
$sql .= ' AND ' . $parameter['source_primary_key'] . ' IN ('.implode(',',$parameter['id_group']).') ';
}
$sql .= ' AND ' . $parameter['source_primary_key'] . ' NOT IN
(SELECT ' . $parameter['target_primary_key'] .' FROM ' . $parameter['target_table'] . ' WHERE 1';
if (isset($parameter['id_group']))
{
$sql .= ' AND ' . $parameter['target_primary_key'] . ' IN ('.implode(',',$parameter['id_group']).') ';
}
$sql .= ')';
if (!empty($parameter['where'])) $sql .= ' AND (' . implode(' AND ', $parameter['where']) . ')';
$pdo_statement_obj = self::$_conn->query($sql);
if (self::$_conn->errorCode() == '00000')
{
$id_group = array();
foreach ($pdo_statement_obj as $row_index => $row_value)
{
$id_group[] = $row_value[$parameter['source_primary_key']];
}
$result['insert'] = $id_group;
unset($id_group);
}
else
{
$query_errorInfo = self::$_conn->errorInfo();
$GLOBALS['global_message']->error = __FILE__.'(line '.__LINE__.'): SQL Error - '.$query_errorInfo[2];
return false;
}
$sql = 'SELECT ' . $parameter['target_primary_key'] . '
FROM ' . $parameter['target_table'] . '
WHERE 1';
if (isset($parameter['id_group']))
{
$sql .= ' AND ' . $parameter['target_primary_key'] . ' IN ('.implode(',',$parameter['id_group']).') ';
}
$sql .= ' AND ' . $parameter['target_primary_key'] . ' NOT IN
(SELECT ' . $parameter['source_primary_key'] .' FROM ' . $parameter['source_table'] . ' WHERE 1';
if (isset($parameter['id_group']))
{
$sql .= ' AND ' . $parameter['source_primary_key'] . ' IN ('.implode(',',$parameter['id_group']).') ';
}
if (!empty($parameter['where']))
{
$sql .= ' AND (' . implode(' AND ', $parameter['where']) . ')';
}
$sql .= ')';
$pdo_statement_obj = self::$_conn->query($sql);
if (self::$_conn->errorCode() == '00000')
{
$id_group = array();
foreach ($pdo_statement_obj as $row_index => $row_value)
{
$id_group[] = $row_value[$parameter['source_primary_key']];
}
$result['delete'] = $id_group;
unset($id_group);
}
else
{
$query_errorInfo = self::$_conn->errorInfo();
$GLOBALS['global_message']->error = __FILE__.'(line '.__LINE__.'): SQL Error - '.$query_errorInfo[2];
return false;
}
$sql = 'SELECT ' . $parameter['source_table'] . '.' . $parameter['source_primary_key'] . '
FROM ' . $parameter['source_table'] . '
JOIN ' . $parameter['target_table'] . ' ON ' . $parameter['source_table'] . '.' . $parameter['source_primary_key'] . '=' . $parameter['target_table'] . '.' . $parameter['target_primary_key'] . '
WHERE '.$parameter['source_table'].'.update_time > '.$parameter['target_table'].'.update_time';
if (isset($parameter['id_group']))
{
$sql .= ' AND ' . $parameter['source_table'] . '.' . $parameter['source_primary_key'] . ' IN ('.implode(',',$parameter['id_group']).') ';
}
if (!empty($parameter['where'])) $sql .= ' AND (' . implode(' AND ', $parameter['where']) . ')';
$pdo_statement_obj = self::$_conn->query($sql);
if (self::$_conn->errorCode() == '00000')
{
$id_group = array();
foreach ($pdo_statement_obj as $row_index => $row_value)
{
$id_group[] = $row_value[$parameter['source_primary_key']];
}
$result['update'] = $id_group;
unset($id_group);
}
else
{
$query_errorInfo = self::$_conn->errorInfo();
$GLOBALS['global_message']->error = __FILE__.'(line '.__LINE__.'): SQL Error - '.$query_errorInfo[2];
return false;
}
return $result;
} | [
"protected function getChangeListFromArchive() {\n // We don't bother with $lastStart and $curStart because we're doing a diff\n\n // Start with the primary table\n $ArchiveTable = $this->getRecordModel(null, true);\n\n try {\n // Cake will construct $ArchiveTable regardless of whether or not there is a\n // corresponding Model _or_ table defined, so we need to actually introspect\n // the table to determine if it exists.\n $ArchiveTable->getColumnTypes();\n }\n catch(MissingTableException $e) {\n // There is no archive table, so this changelist via archive is not supported\n return false;\n }\n\n // Figure out which rows were changed - it's unclear how efficient this query is,\n // the modified column approach is almost certainly better. This is the full set\n // of row IDs that need to be (re)processed - do we need to have sorid indexed?\n // XXX if so document?\n\n $changedSorids = [];\n\n // The source_table name is \"trusted\" input from the administrator, but also the \n // entry of table names is constrained.\n\n // In flat mode, there's only one table\n $this->tableList = array($this->pluginCfg['source_table']);\n\n // In relational mode, we also have to check each of the related tables\n if($this->pluginCfg['table_mode'] == SqlSourceTableModeEnum::Relational) {\n foreach($this->relatedModels as $rm) {\n $RelatedModel = $this->getRecordModel($rm);\n\n $this->tableList[] = $RelatedModel->table;\n }\n }\n\n foreach($this->tableList as $sourceTableName) {\n $archiveTableName = $sourceTableName . \"_archive\";\n\n // This query will calculate UPDATEs and DELETEs but _not_ INSERTs, however the\n // getChangeList() interface is only intended to optimize updates, not INSERTs,\n // and in Full Mode OrgIdentitySource::syncOrgIdentitySource will separately\n // calculate the list of new IDs. Note order is important, if $archiveTableName\n // and $sourceTableName are swapped, the query will generate INSERTs but not DELETEs.\n\n // Note that because we can't return new rows here bootstrapping an existing\n // instannce gets a bit complicated. Basically we won't be able to detect any \n // changes until the archive tables are populated, and we need an external event\n // to make that happen. In FULL mode, a new record will trigger a call to updateCache(),\n // but that might happen after several updates get ignored. In UPDATE mode\n // new records won't get processed so we never have the cache updated. The\n // solution (for now) is for the deployer to prepopulate the tables.\n $diffQuery = \"SELECT * FROM \" . $archiveTableName . \" EXCEPT\n SELECT * FROM \" . $sourceTableName;\n\n // For potential future reference, here's how to union the INSERTs into\n // the query: We UNION to queries together, the first calculates INSERTs\n // and UPDATEs, the second calculates DELETEs.\n /*\n $diffQuery = \"(SELECT diff.sorid FROM \n (SELECT * FROM \" . $sourceTableName . \" EXCEPT\n SELECT * FROM \" . $archiveTableName . \") AS diff)\n UNION\n (SELECT sorid FROM \" . $archiveTableName . \"\n WHERE sorid NOT IN (SELECT sorid FROM \" . $sourceTableName . \"))\";*/\n\n $sorids = Hash::extract($ArchiveTable->query($diffQuery), '{n}.{n}.sorid');\n\n if(!empty($sorids)) {\n $changedSorids = array_merge($changedSorids, $sorids);\n }\n }\n\n // We perform an array_unique here once rather than after each merge\n return !empty($changedSorids) ? array_unique($changedSorids) : array();\n }",
"public function compareColumnsIndex()\n {\n $return = [];\n foreach ($this->tables as $tableName) {\n if (!isset($this->schema1[$tableName]) || !isset($this->schema2[$tableName])) {\n continue;\n }\n\n $fields = array_merge($this->schema1[$tableName], $this->schema2[$tableName]);\n\n foreach ($fields as $fieldName => $field) {\n if (!isset($this->schema1[$tableName][$fieldName]['index']) && !isset($this->schema2[$tableName][$fieldName]['index'])) {\n continue;\n } elseif (!isset($this->schema1[$tableName][$fieldName]['index']) || isset($this->schema2[$tableName][$fieldName]['index'])) {\n $this->updateComponentIndex($this->db1->getDbName(), $tableName, $fieldName, true, $this->schema2[$tableName][$fieldName]['index']);\n continue;\n } elseif (isset($this->schema1[$tableName][$fieldName]['index']) || !isset($this->schema2[$tableName][$fieldName]['index'])) {\n $this->updateComponentIndex($this->db2->getDbName(), $tableName, $fieldName, true, $this->schema1[$tableName][$fieldName]['index']);\n continue;\n }\n\n $s1Params = $this->schema1[$tableName][$fieldName]['index'];\n $s2Params = $this->schema2[$tableName][$fieldName]['index'];\n\n $indexes = array_unique(array_merge(array_keys($s1Params), array_keys($s2Params)));\n foreach ($indexes as $index) {\n if (empty($s1Params[$index])) {\n $this->updateComponentIndex($this->db1->getDbName(), $tableName, $fieldName, true, $this->schema2[$tableName][$fieldName]['index'][$index]);\n continue;\n }\n if (empty($s2Params[$index])) {\n $this->updateComponentIndex($this->db2->getDbName(), $tableName, $fieldName, true, $this->schema2[$tableName][$fieldName]['index'][$index]);\n continue;\n }\n\n foreach ($s1Params[$index] as $k => $v) {\n if ($s1Params[$index][$k] !== $s2Params[$index][$k]) {\n $this->updateComponentIndex($this->db1->getDbName(), $tableName, $fieldName, null, [$k => $s2Params[$k]]);\n $this->updateComponentIndex($this->db2->getDbName(), $tableName, $fieldName, null, [$k => $s1Params[$k]]);\n }\n }\n }\n }\n }\n\n return $return;\n }",
"function fun_Mysql_compareRecords($DB1, $Table1, $Table1ID, $ID_Name1, $DB2, $Table2, $Table2ID, $ID_Name2, $OtherDBConn=\"\")\n{\n\t//debug\n\t//echo \"\\nfun_Mysql_compareRecords:[[DB1($DB1), Table1($Table1), Table1ID($Table1ID), IDName1($ID_Name1) - DB2($DB2), Table1($Table2), Table1ID($Table2ID), IDName2($ID_Name2)\\n \";\n\n\t$arData1 = fun_SQLQuery_InArray($DB1, $Table1, $Table1ID, $OtherDBConn, $ID_Name1); //NwmlsData\n\t$arData2 = fun_SQLQuery_InArray($DB2, $Table2, $Table2ID, $OtherDBConn, $ID_Name2); //MyData\n\n\t//debug\n\t//print_r($arData1);\n\t//print_r($arData2);\n\t//die(\"\\n\\nWORKY????\\n\");\n\n\tforeach ($arData1 as $Field => $Value)\n\t{\n\t\t//debug\n\t\t//echo \"checking arData2[$Field]({$arData2[$Field]}) = $Value\\n\";\n\n\t\t//is it different\n\t\tif ($arData2[$Field] != $Value) //value has changed in Table 2\n\t\t{\n\t\t\t$arData3[$Field] = $Value;\n\t\t\t\n\t\t\t//debug\n\t\t\t//echo \"value1({$arData2[$Field]}) != value2($Value)\\n\";\n\t\t}\n\n\n\t\tunset($arData1[$Field]);\n\t\tunset($arData2[$Field]);\n\t}\n\n\t//?? (backwards) compare the keys to see if any exists in my table that don't exist in table1?\n\n\t//debug\n\t//die(\"\\nfun_Mysql_compareRecords: early death\\n\");\n\n\treturn $arData3;\n}",
"function PMA_findDeleteRowsFromTargetTables(&$delete_array, $matching_table, $matching_table_index, $trg_keys, $src_keys, $trg_db, $trg_link,$src_db, $src_link)\n{\n if (isset($trg_keys[$matching_table_index])) {\n $target_key_values = PMA_DBI_get_column_values($trg_db, $matching_table[$matching_table_index], $trg_keys[$matching_table_index], $trg_link);\n $target_row_size = sizeof($target_key_values);\n }\n if (isset($src_keys[$matching_table_index])) {\n $source_key_values = PMA_DBI_get_column_values($src_db, $matching_table[$matching_table_index], $src_keys[$matching_table_index], $src_link);\n $source_size = sizeof($source_key_values);\n }\n $all_keys_match = 1;\n for ($a = 0; $a < sizeof($trg_keys[$matching_table_index]); $a++) {\n if (isset($trg_keys[$matching_table_index][$a])) {\n if (! (in_array($trg_keys[$matching_table_index][$a], $src_keys[$matching_table_index]))) {\n $all_keys_match = 0;\n }\n }\n }\n if (! ($all_keys_match)) {\n if (isset($target_key_values)) {\n $delete_array[$matching_table_index] = $target_key_values;\n }\n }\n if (isset($trg_keys[$matching_table_index])) {\n if ((sizeof($trg_keys[$matching_table_index]) == 1) && $all_keys_match) {\n $row = 0;\n if (isset($target_key_values)) {\n for ($i = 0; $i < sizeof($target_key_values); $i++) {\n if (! (in_array($target_key_values[$i], $source_key_values))) {\n $delete_array[$matching_table_index][$row] = $target_key_values[$i];\n $row++;\n }\n }\n }\n } elseif ((sizeof($trg_keys[$matching_table_index]) > 1) && $all_keys_match) {\n $row = 0;\n if (isset($target_key_values)) {\n for ($i = 0; $i < sizeof($target_key_values); $i++) {\n $is_present = false;\n for ($j = 0; $j < sizeof($source_key_values) && ($is_present == false) ; $j++) {\n $check = true;\n for ($k = 0; $k < sizeof($trg_keys[$matching_table_index]); $k++) {\n if ($target_key_values[$i][$trg_keys[$matching_table_index][$k]] != $source_key_values[$j][$trg_keys[$matching_table_index][$k]]) {\n $check = false;\n }\n }\n if ($check) {\n $is_present = true;\n }\n }\n if (! ($is_present)) {\n for ($l = 0; $l < sizeof($trg_keys[$matching_table_index]); $l++) {\n $delete_array[$matching_table_index][$row][$trg_keys[$matching_table_index][$l]] = $target_key_values[$i][$trg_keys[$matching_table_index][$l]];\n }\n $row++;\n }\n }\n }\n }\n }\n}",
"function compareTable($tb1,$tb2) {\n $sql = \"select * from $tb1 tb1 where not exists (select 1 from $tb2 tb2 where tb1.name3 = tb2.name3);\";\n // $sql = \"select count(*) from $tb1 left join $tb2 on $tb1.name3 = $tb2.name3;\";\n // $sql = \"select count(*) from $tb1;\";\n // $sql = \"select * from $tb1 join $tb2 on ifnull($tb1.name3,'1') = ifnull($tb2.name3,'1');\";\n // $sql = \"select * from $tb1 where name3 = 'secondchange';\";\n return $sql;\n }",
"public function test_get_duplicate_list_sql_with_none_found() {\n global $DB;\n $record1 = $this->create_test_record(['blockeduri' => 'test-extension-1']);\n $record2 = $this->create_test_record(['blockeduri' => 'test-extension-2']);\n $record3 = $this->create_test_record(['blockeduri' => 'test-extension-3']);\n $task = new merge_duplicate_records_task();\n $records = $DB->get_records_sql($task->get_duplicate_list_sql());\n // There are two sets of two duplicate records.\n $this->assertCount(0, $records);\n $ids = array_map(function($record) {\n return $record->id;\n }, $records);\n $this->assertFalse(in_array($record1->id, $ids));\n $this->assertFalse(in_array($record2->id, $ids));\n $this->assertFalse(in_array($record3->id, $ids));\n }",
"function sync_data($table, $db1_con, $db2_con) {\n\t$db1_data = fetch_data($table, $db1_con);\n\t$db2_data = fetch_data($table, $db2_con);\n\t$i = 0; \n\tforeach ($db1_data as $db1_row) {\n\t\t$db2_row = $db2_data[$i];\n\t\tif ($db2_row !== $db1_row) {\n\t\t\tsync_row($db1_row, $db2_row, $table, $db1_con, $db2_con);\t\n\t\t}\n\t\t$i++;\t\n\t}\n\t\n}",
"public static function updateJoiningTable($table,$intended,$where){\r\n\t\tif (is_string($table)){\r\n\t\t\t$table = SQLTable::get($table);\r\n\t\t}\r\n\t\t\r\n\t\t$where_sql = $table->generateQuerySQL($where);\r\n\t\t\r\n\t\tif (empty($intended)){\r\n\t\t\tself::query('DELETE FROM '.$table->getFullName().' WHERE '.$where_sql);\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t$intended = array_values($intended);\r\n\t\t\t\t\r\n\t\t$columns = array_keys($intended[0]);\r\n\t\tsort($columns); // just in case one of the entires specifies the keys in a different order.\r\n\t\tif (sizeof($intended)>1){\r\n\t\t\t// Check that the same columns have been specified for each entry\r\n\t\t\tfor ($i=1; $i<sizeof($intended); $i++){\r\n\t\t\t\t$i_columns = array_keys($intended[$i]);\r\n\t\t\t\tsort($i_columns);\r\n\t\t\t\tif ($i_columns!=$columns){\r\n\t\t\t\t\tMessages::msg('The columns specified for entry '.$i.' in the intended list for self::updateJoiningTable() do not match those specified for the preceeding entry/entries. All entries must specify the same column names.',Messages::_M_CODE_ERROR);\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\t\t \r\n\t\t$res = self::query('SELECT '.implode(', ',$columns).\r\n\t \t\t\t\t\t ' FROM '.$table->getFullName().\r\n\t \t\t\t\t\t ' WHERE '.$where_sql);\r\n\t\t\r\n\t\t// Assume we need to insert all of them, then remove them from this list as we find matches in the database\r\n\t\t$insert_list = $intended;\r\n\t\t$delete_list = array();\r\n\t\t\r\n\t\t// Compare $res and $insert list (remove matches from $insert_list, add non-matches from $res to $delete_list)\r\n\t\tforeach ($res as $row){\r\n\t\t\tforeach ($insert_list as $i=>$value_set){\r\n\t\t\t\tforeach ($value_set as $column=>$value){\r\n\t\t\t\t\tif ($value != $row[$column]){\r\n\t\t\t\t\t\t// There is a value in $insert_list[$i] that doesn't match the relevant column in $row,\r\n\t\t\t\t\t\t// so we can move on to the next item in $insert_list\r\n\t\t\t\t\t\tcontinue 2;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// The record, $row, matches item $i in the 'intended' list. Since we have found a match for $row,\r\n\t\t\t\t// we can move on through $res.\r\n\t\t\t\tunset($insert_list[$i]);\r\n\t\t\t\tcontinue 2;\r\n\t\t\t}\r\n\t\t\t// The record, $row, does not match any in the 'intended' list, so we add it to the delete list\r\n\t\t\t$to_delete = array();\r\n\t\t\tforeach ($columns as $column){\r\n\t\t\t\t$to_delete[$column] = $row[$column];\r\n\t\t\t}\r\n\t\t\t$delete_list[] = $to_delete;\r\n\t\t}\r\n\t\t\r\n\t\t// Process the INSERT list\r\n\t\tif (!empty($insert_list)){\r\n\t\t\t$values = array();\r\n\t\t\t$all_columns = array_merge($columns,array_keys($where));\r\n\t\t\tforeach ($insert_list as $insert){\r\n\t\t\t\t$sub_values = array();\r\n\t\t\t\tforeach ($all_columns as $column){\r\n\t\t\t\t\tif (in_array($column,$columns)){\r\n\t\t\t\t\t\t$sub_values[] = $table->$column->valueAsSQL($insert[$column]);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$sub_values[] = $table->$column->valueAsSQL($where[$column]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$values[] = '('.implode(', ',$sub_values).')';\r\n\t\t\t}\r\n\t\t\t$sql = 'INSERT INTO '.$table->getFullName().' '.\r\n\t\t\t\t\t\t'('.TextUtils::implodePairs($all_columns,',','`$value`').') '.\r\n\t\t\t\t\t'VALUES '.implode(', ',$values);\r\n\t\t\tself::query($sql);\r\n\t\t}\r\n\t\t\r\n\t\t// Process the DELETE list\r\n\t\tif (!empty($delete_list)){\r\n\t\t$values = array();\r\n\t\t\t$values = array();\r\n\t\t\tforeach ($delete_list as $delete){\r\n\t\t\t\t$sub_values = array();\r\n\t\t\t\tforeach ($columns as $column){\r\n\t\t\t\t\t$sub_values[] = $table->$column->valueAsSQL($delete[$column]);\r\n\t\t\t\t}\r\n\t\t\t\t$values[] = '('.implode(', ',$sub_values).')';\r\n\t\t\t}\r\n\t\t\t$sql = 'DELETE FROM '.$table->getFullName().' '.\r\n\t\t\t\t\t'WHERE ('.implode(', ',$columns).') IN ('.implode(', ',$values).') '.\r\n\t\t\t\t\t 'AND '.$where_sql;\r\n\t\t\tself::query($sql);\r\n\t\t}\r\n\t\t \r\n\t\treturn true;\r\n\t}",
"public function auto_ins_upd($ins_data, $table_name, $match_keys) {\n\t\t\t// names of the keys to match on... possible outcomes:\n\t\t\t// \t\t- matching record & no differences between values : no action\n\t\t\t//\t\t- matching record & differences : update\n\t\t\t//\t\t- no match : insert\n\t\t\t$wterms = array();\n\t\t\tforeach($match_keys as $mk) {\n\t\t\t\t$wterms[] = $mk .\" = '\". $ins_data[$mk].\"'\";\n\t\t\t}\n\t\t\t$query = 'SELECT COUNT(*) FROM ' . $table_name .' WHERE ' . implode(' AND ', $wterms);\n\t\t\t$fnd = $this->return_scalar($query);\n\t\t\tif ($fnd == \"\") {\n\t\t\t\tdebug_print(sprintf('Query Text: %s',$query));\n\t\t\t\tdebug_print(sprintf('MySQLi error (%s): %s',mysqli_errno($this),mysqli_error($this)));\n\t\t\t\tdebug_print('AIU array: ');\n\t\t\t\tdebug_print(var_dump($ins_data));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (!$fnd > 0) {\n\t\t\t\treturn $this->insert_data($ins_data,$table_name);\n\t\t\t}\n\t\t\t$keys = array();\n\t\t\t$values = array();\n\t\t\tforeach($ins_data as $k=>$v) {\n\t\t\t\t$keys[] = $k;\n\t\t\t\t$values[] = (!empty($v))?$v:null;\n\t\t\t}\n\t\t\t$old = array('SELECT COUNT(*) FROM ');\n\t\t\t$new = array('SELECT '.implode(', ',$keys).' FROM ');\n\t\t\t$query = str_replace($old,$new,$query);\n\t\t\t\n\t\t\tif(!$cur_rec = $this->return_assoc($query)) { \n\t\t\t\tdebug_print('AIU array: '.var_dump($ins_data));\n\t\t\t\treturn false; \n\t\t\t}\n\t\t\t$to_update = (is_array($cur_rec[0]))? array_diff_assoc($ins_data,$cur_rec[0]) : array();\n\t\t\tif (count($to_update) == 0) { return true; }\t\t\n\t\t\t$keys = array_keys($to_update);\n\t\t\t$values = array();\n\t\t\tforeach($to_update as $k=>$v) { $values[] = (!empty($v))?$v:null; }\n\t\t\t$old = $new;\n\t\t\t$old[] = ' WHERE ';\n\t\t\t$new = array('UPDATE ',' SET '. implode(' = ? , ',$keys) . ' = ? WHERE ');\n\t\t\t$query = str_replace($old,$new,$query);\n\t\t\t$stmt = $this->prepare($query);\n\t\t\t$params = array(); \n\t\t\tforeach ($to_update as &$value) { \n\t\t\t $params[] = &$value;\n\t\t\t}\n\t\t\t$types = array(str_repeat('s', count($params))); \n\t\t\t$values = array_merge($types, $params); \n\t\t\t\n\t\t\tcall_user_func_array(array($stmt, 'bind_param'), $values); \n\n\t\t\tif(!$success = $stmt->execute()) { \n\t\t\t\tdebug_print('Query failed with error (' . mysqli_errno($this) . ') ' . mysqli_error($this));\n\t\t\t\tdebug_print(sprintf('Query Text: %s',$query));\n\t\t\t\tdebug_print('AIU array: '.var_dump($ins_data));\n\t\t\t\treturn false;\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// do {\n\t\t\t\t// $result = mysqli_store_result($this);\n\t\t\t\t// if(!(!$result)) {mysqli_free_result($result);}\n\t\t\t// } while (mysqli_next_result($result));\n\t\t\t// $result = NULL;\n\t\t\t$stmt = NULL;\t\t\t\n\t\t}",
"function PMA_structureDiffInTables($src_db, $trg_db, $src_link, $trg_link, $matching_tables, &$source_columns, &$target_columns, &$alter_str_array,\n &$add_column_array, &$uncommon_columns, $criteria, &$target_tables_keys, $matching_table_index)\n{\n //Gets column information for source and target table\n $source_columns[$matching_table_index] = PMA_DBI_get_columns_full($src_db, $matching_tables[$matching_table_index], null, $src_link);\n $target_columns[$matching_table_index] = PMA_DBI_get_columns_full($trg_db, $matching_tables[$matching_table_index], null, $trg_link);\n foreach ($source_columns[$matching_table_index] as $column_name => $each_column) {\n if (isset($target_columns[$matching_table_index][$column_name]['Field'])) {\n //If column exists in target table then matches criterias like type, null, collation, key, default, comment of the column\n for ($i = 0; $i < sizeof($criteria); $i++) {\n if ($source_columns[$matching_table_index][$column_name][$criteria[$i]] != $target_columns[$matching_table_index][$column_name][$criteria[$i]]) {\n if (($criteria[$i] == 'Default') && ($source_columns[$matching_table_index][$column_name][$criteria[$i]] == '' )) {\n $alter_str_array[$matching_table_index][$column_name][$criteria[$i]] = 'None';\n } else {\n if (! (($criteria[$i] == 'Key') && (($source_columns[$matching_table_index][$column_name][$criteria[$i]] == 'MUL')\n || ($target_columns[$matching_table_index][$column_name][$criteria[$i]] == 'MUL')\n || ($source_columns[$matching_table_index][$column_name][$criteria[$i]] == 'UNI')\n || ($target_columns[$matching_table_index][$column_name][$criteria[$i]] == 'UNI')))) {\n $alter_str_array[$matching_table_index][$column_name][$criteria[$i]] = $source_columns[$matching_table_index][$column_name][$criteria[$i]];\n }\n }\n }\n }\n } else {\n $add_column_array[$matching_table_index][$column_name]= $column_name;\n }\n }\n //Finds column names that are present in target table but not in source table\n foreach ($target_columns[$matching_table_index] as $fld_name => $each_column) {\n if (! (isset($source_columns[$matching_table_index][$fld_name]['Field']))) {\n $fields_uncommon[] = $fld_name;\n }\n if ($target_columns[$matching_table_index][$fld_name]['Key'] == 'PRI') {\n $keys[] = $fld_name;\n }\n }\n if (isset($fields_uncommon)) {\n $uncommon_columns[$matching_table_index] = $fields_uncommon;\n }\n if (isset($keys)) {\n $target_tables_keys[$matching_table_index] = $keys;\n }\n}",
"public function getUpdates () {\n $allUpdates = array();\n $this->lastAffectedProps = array();\n foreach ($this->diffList as $uid => $row) {\n\n $subWhere = new WhereSet();\n $updates = array();\n $sql = \"UPDATE \"\n . $this->table->getTableName()\n . ' SET ';\n foreach ($row as $fields) {\n $updates[] = $this->getStatement( $fields );\n }\n $this->lastAffectedProps[$uid] = $fields->originSet;\n $this->applyWhereByProps( $fields->originSet, $subWhere );\n\n $sql .= implode( ',', $updates );\n $allUpdates[$uid] = $this->composeWhere( $sql, $subWhere );\n }\n return $allUpdates;\n }",
"public function getDifferringRevisionIdsOnSource();",
"public function testMergeUpdateWithoutUpdate() {\n $num_records_before = $this->connection->query('SELECT COUNT(*) FROM {test_people}')->fetchField();\n\n $this->connection->merge('test_people')\n ->key('job', 'Speaker')\n ->execute();\n\n $num_records_after = $this->connection->query('SELECT COUNT(*) FROM {test_people}')->fetchField();\n $this->assertEquals($num_records_before, $num_records_after, 'Merge skipped properly.');\n\n $person = $this->connection->query('SELECT * FROM {test_people} WHERE [job] = :job', [':job' => 'Speaker'])->fetch();\n $this->assertEquals('Meredith', $person->name, 'Name skipped correctly.');\n $this->assertEquals(30, $person->age, 'Age skipped correctly.');\n $this->assertEquals('Speaker', $person->job, 'Job skipped correctly.');\n\n $this->connection->merge('test_people')\n ->key('job', 'Speaker')\n ->insertFields(['age' => 31])\n ->execute();\n\n $num_records_after = $this->connection->query('SELECT COUNT(*) FROM {test_people}')->fetchField();\n $this->assertEquals($num_records_before, $num_records_after, 'Merge skipped properly.');\n\n $person = $this->connection->query('SELECT * FROM {test_people} WHERE [job] = :job', [':job' => 'Speaker'])->fetch();\n $this->assertEquals('Meredith', $person->name, 'Name skipped correctly.');\n $this->assertEquals(30, $person->age, 'Age skipped correctly.');\n $this->assertEquals('Speaker', $person->job, 'Job skipped correctly.');\n }",
"private function matchSuites()\n\t{\n\t\tforeach ($this->sourceSuites as &$sourceSuite) {\n\t\t\tforeach ($this->destinationSuites as $destinationSuite) {\n\t\t\t\tif ($this->equalSuites($sourceSuite, $destinationSuite)) {\n\t\t\t\t\t$sourceSuite['destination_id'] = $destinationSuite['id'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"function updateRelatedJoins($DBH, $innoDBH, $table, $id, $vst, $debug = false){\n\ttry{\n\t\t\n\t\t$tableInfo = array();\n\t\t$parsedTableInfo = array();\n\t\t$i = 0;\n\t\t$statement = \"SELECT \n\t\t\t\t\t\t*\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\tKEY_COLUMN_USAGE \n\t\t\t\t\t\tWHERE REFERENCED_TABLE_NAME = '$table'\";\n\t\t\n\t\t$innoSTH = $innoDBH->query($statement);\n\t\t$innoSTH->setFetchMode(PDO::FETCH_ASSOC);\n\t\t\n\t\twhile($row = $innoSTH->fetch()){\n\t\t\t$tableInfo[$row['TABLE_NAME']][$i] = $row;\n\t\t\t$i++;\t\n\t\t\t\n\t\t}\n\t\t\n\t\t$statement = '';\n\t\t\n\t\tforeach($tableInfo as $table){\n\t\t\tforeach($table as $row){\n\t\t\t\tif($row['REFERENCED_COLUMN_NAME'] == 'id'){\n\t\t\t\t\t$parsedTableInfo[$row['TABLE_NAME']]['id'] = $row['COLUMN_NAME'];\n\t\t\t\t\t$parsedTableInfo[$row['TABLE_NAME']]['table'] = $row['TABLE_NAME'];\n\t\t\t\t}elseif($row['REFERENCED_COLUMN_NAME'] == 'valid_starttime'){\n\t\t\t\t\t$parsedTableInfo[$row['TABLE_NAME']]['vst'] = $row['COLUMN_NAME'];\n\t\t\t\t\t$parsedTableInfo[$row['TABLE_NAME']]['table'] = $row['TABLE_NAME'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tforeach($parsedTableInfo as $table){\n\t\t\t$statement .= \"UPDATE\n\t\t\t\t\t\t\t\". $table['table'] .\"\n\t\t\t\t\t\t\tSET\n\t\t\t\t\t\t\t\" . $table['vst'] . \" = '$vst'\n\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\" . $table['id'] . \" = $id;\";\n\t\t}\n\t\t\n\t\tif($debug){\n\t\t\treturn $statement;\n\t\t}else{\n\t\t\t$STH = $DBH->exec($statement);\n\t\t\t$log = new Log();\n\t\t\t$log->log($statement);\n\t\t\treturn true;\n\t\t}\n\t}catch(Exception $e){\n\t\t$log = new Log();\n\t\t$log->error($e);\n\t\treturn false;\n\t}\n}",
"private function interleaveSearches($a, $b)\n {\n if ($this->debugMode) {\n error_log('--- Interleave method invoked ---');\n }\n\n $aRecords = array();\n $bRecords = array();\n\n // Key records by reference application UUID (to de-duplicate during merge)\n foreach ($a as $key => $val) {\n $aRecords[$val->getReferencingApplicationUuId()] = $val;\n }\n foreach ($b as $key => $val) {\n $bRecords[$val->getReferencingApplicationUuId()] = $val;\n }\n\n // Merge records from A and B\n $records = array_merge($aRecords, $bRecords);\n\n // Sort records by descending creation date\n usort($records, function ($x, $y) {\n if ($x->getCreatedAt() == $y->getCreatedAt()) {\n return 0;\n }\n return ($x->getCreatedAt() < $y->getCreatedAt()) ? 1 : -1;\n });\n\n return $records;\n }",
"public function DbDiffRow (array $ar_new, array $ar_old = NULL\n\t\t, array $ar_pk = NULL) {\n\t\t// Check param\n\t\tif (is_null($ar_pk)) {\n\t\t\t$ar_pk = array_keys($ar_new);\n\t\t\t$ar_pk = array($ar_pk[0]);\n\t\t}\n\n\t\t$ar_diff = array();\n\n\t\t// Detect mode: INSERT/UPDATE/DELETE\n\t\t$b_new_null = false;\n\t\t$b_old_null = false;\n\t\tforeach ($ar_pk as $s_pk) {\n\t\t\tif (is_null($ar_new[$s_pk]))\n\t\t\t\t$b_new_null = true;\n\t\t\telseif ($b_new_null)\n\t\t\t\t// Mixed NULL with non-NULL PK value\n\t\t\t\t$this->Log('New array PK ' . $s_pk . ' got value and mixed'\n\t\t\t\t\t. ' with other NULL PK.', 4);\n\n\t\t\tif (!isset($ar_old[$s_pk]) || is_null($ar_old[$s_pk]))\n\t\t\t\t$b_old_null = true;\n\t\t\telseif ($b_old_null)\n\t\t\t\t// Mixed NULL with non-NULL PK value\n\t\t\t\t$this->Log('Old array PK ' . $s_pk . ' got value and mixed'\n\t\t\t\t\t. ' with other NULL PK.', 4);\n\t\t}\n\t\tif (true == $b_new_null && false == $b_old_null) {\n\t\t\t$ar_diff['mode'] = 'DELETE';\n\t\t}\n\t\telseif (false == $b_new_null && true == $b_old_null) {\n\t\t\t$ar_diff['mode'] = 'INSERT';\n\t\t}\n\t\telseif (false == $b_new_null && false == $b_old_null) {\n\t\t\t$ar_diff['mode'] = 'UPDATE';\n\t\t}\n\t\telse {\n\t\t\t// New, old are all NULL PK, should not occur\n\t\t\t$this->Log('New and old array\\'s PK are all NULL, nothing to do.', 4);\n\t\t\treturn array();\n\t\t}\n\n\t\t// PK, include even new same with old\n\t\tforeach ($ar_pk as $s_pk) {\n\t\t\t$ar_diff['pk'][$s_pk] = array(\n\t\t\t\t'new'\t=> $ar_new[$s_pk],\n\t\t\t\t'old'\t=> isset($ar_old[$s_pk]) ? $ar_old[$s_pk] : NULL,\n\t\t\t);\n\t\t\t// Remove it in normal column\n\t\t\tunset($ar_new[$s_pk]);\n\t\t\tunset($ar_old[$s_pk]);\n\t\t}\n\n\t\t// Other column, skip same value\n\t\t$ar_diff['col'] = array();\n\t\t$ar_col = array();\n\t\tif (!empty($ar_new))\n\t\t\t$ar_col += array_keys($ar_new);\n\t\tif (!empty($ar_old))\n\t\t\t$ar_col += array_keys($ar_old);\n\t\tif (!empty($ar_col)) {\n\t\t\tforeach ($ar_col as $col) {\n\t\t\t\t$v_new = isset($ar_new[$col]) ? $ar_new[$col] : NULL;\n\t\t\t\t$v_old = isset($ar_old[$col]) ? $ar_old[$col] : NULL;\n\n\t\t\t\t// Manual set useless column data to NULL, avoid necessary\n\t\t\t\t// column been skipped by equal check later, to keep diff\n\t\t\t\t// result include necessary column, they maybe used in\n\t\t\t\t// rollback.\n\t\t\t\t// Force new value of DELETE mode to NULL\n\t\t\t\tif ('DELETE' == $ar_diff['mode'])\n\t\t\t\t\t$v_new = NULL;\n\t\t\t\t// Force old value of INSERT mode to NULL\n\t\t\t\tif ('INSERT' == $ar_diff['mode'])\n\t\t\t\t\t$v_old = NULL;\n\n\t\t\t\tif (is_null($v_new) && is_null($v_old))\n\t\t\t\t\tcontinue;\n\t\t\t\tif (!is_null($v_new) && !is_null($v_old) && $v_new == $v_old)\n\t\t\t\t\tcontinue;\n\n\t\t\t\t$ar_diff['col'][$col] = array(\n\t\t\t\t\t'new'\t=> $v_new,\n\t\t\t\t\t'old'\t=> $v_old,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Skip UPDATE with no col change\n\t\tif ('UPDATE' == $ar_diff['mode'] && empty($ar_diff['col']))\n\t\t\t$ar_diff = array();\n\n\t\treturn $ar_diff;\n\t}",
"public function importOrdersStatusHistory($switch = null) {\n \n $s_db = $this->_sDB;\n $t_db = $this->_tDB;\n \n if (!defined('DB_TABLE_PREFIX')) define('DB_TABLE_PREFIX', $t_db['DB_PREFIX']);\n\n // CONNNECT TO SOURCE DB\n \n require_once('../includes/database_tables.php');\n \n require_once('../includes/classes/database/mysqli.php');\n $class = 'lC_Database_mysqli'; // . $s_db['DB_DATABASE_CLASS'];\n $source_db = new $class($s_db['DB_SERVER'], $s_db['DB_SERVER_USERNAME'], $s_db['DB_SERVER_PASSWORD']);\n \n if ($source_db->isError() === false) {\n $source_db->selectDatabase($s_db['DB_DATABASE']);\n }\n \n if ($source_db->isError()) {\n $this->_msg = $source_db->getError();\n return false;\n }\n \n // END CONNNECT TO SOURCE DB\n \n // CONNNECT TO TARGET DB\n\n $class = 'lC_Database_' . $t_db['DB_CLASS'];\n $target_db = new $class($t_db['DB_SERVER'], $t_db['DB_SERVER_USERNAME'], $t_db['DB_SERVER_PASSWORD']);\n \n if ($target_db->isError() === false) {\n $target_db->selectDatabase($t_db['DB_DATABASE']);\n }\n \n if ($target_db->isError()) {\n $this->_msg = $target_db->getError();\n return false;\n }\n\n // END CONNNECT TO TARGET DB\n\n // ##########\n \n // DISABLE AUTO INCREMENT WHEN PRIMARY KEY = 0\n $tQry = $target_db->query('SET GLOBAL sql_mode = \"NO_AUTO_VALUE_ON_ZERO\"');\n $tQry->execute();\n\n // ##########\n \n // TRUNCATE ORDERS STATUS HISTORY TABLE IN TARGET DB\n\n $tQry = $target_db->query('truncate table ' . TABLE_ORDERS_STATUS_HISTORY);\n $tQry->execute();\n \n // END TRUNCATE ORDERS STATUS HISTORY TABLE IN TARGET DB \n \n // ##########\n\n // LOAD ORDERS STATUS HISTORY FROM SOURCE DB\n \n $map = $this->_data_mapping['orders_status_history'];\n $orders_status_histories = array();\n\n $sQry = $source_db->query('SELECT * FROM orders_status_history');\n $sQry->execute();\n \n $numrows = $sQry->numberOfRows();\n if ($numrows > 0) { \n $cnt = 0;\n while ($sQry->next()) {\n $orders_status_history = array(\n 'orders_status_history_id' => $sQry->value($map['orders_status_history_id'])\n , 'orders_id' => $sQry->value($map['orders_id'])\n , 'orders_status_id' => $sQry->value($map['orders_status_id'])\n , 'date_added' => $sQry->value($map['date_added'])\n , 'customer_notified' => $sQry->value($map['customer_notified'])\n , 'comments' => $sQry->value($map['comments'])\n ); \n \n $tQry = $target_db->query('INSERT INTO :table_orders_status_history (orders_status_history_id, \n orders_id, \n orders_status_id, \n date_added, \n customer_notified, \n comments) \n VALUES (:orders_status_history_id, \n :orders_id, \n :orders_status_id, \n :date_added, \n :customer_notified, \n :comments)');\n \n $tQry->bindTable(':table_orders_status_history', TABLE_ORDERS_STATUS_HISTORY);\n $tQry->bindInt (':orders_status_history_id' , $orders_status_history['orders_status_history_id']);\n $tQry->bindInt (':orders_id' , $orders_status_history['orders_id']);\n $tQry->bindInt (':orders_status_id' , $orders_status_history['orders_status_id']);\n $tQry->bindValue(':date_added' , $orders_status_history['date_added']);\n $tQry->bindInt (':customer_notified' , $orders_status_history['customer_notified']);\n $tQry->bindValue(':comments' , $orders_status_history['comments']);\n $tQry->execute();\n\n $cnt++;\n \n if ($target_db->isError()) {\n $this->_msg = $target_db->getError();\n return false;\n }\n }\n \n $sQry->freeResult();\n }\n \n // END LOAD ORDERS STATUS HISTORY FROM SOURCE DB\n\n $orders_status_history = null;\n \n // ########## \n\n // END DISABLE AUTO INCREMENT WHEN PRIMARY KEY = 0\n $tQry = $target_db->query('SET GLOBAL sql_mode = \"\"');\n $tQry->execute();\n \n // ##########\n \n $source_db->disconnect(); \n $target_db->disconnect(); \n \n return true;\n \n }",
"function getTablesOutOfSync($source, $dest)\n{\n $sSum = getTablesChecksum($source);\n $dSum = getTablesChecksum($dest);\n\n $ret = array();\n foreach (getTables($source) as $name)\n {\n if ($sSum[$name] !== $dSum[$name])\n {\n $ret[] = $name;\n }\n }\n\n return $ret;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function name: getEventDetails arguments:$eventDetail returned data: all information from one record in events_evt table. description: returns information from events_evt table based on selected event name. Dependencies: | function getEventDetails($eventDetail)
{
global $db;
$query = $sql = "Select e.name_evt, e.location_evt, s.name_sre,e.description_evt, c.country_cou, e.dateTime_evt
FROM events_evt e JOIN subregions_sre s
ON e.subregions_sre_id_sre = s.id_sre
JOIN regions_cou c on s.region_id_sre = c.id_cou
WHERE e.name_evt = '$eventDetail'";
$result = $db->query($query);
return $result;
} | [
"public function getEventDetail($eventId){\n \n $query=\"SELECT e.eventId,e.eventTitle,e.shortDescription,e.longDescription,e.startDate,e.endDate\n FROM event e\n WHERE e.eventId=\".$eventId;\n\n return SystemDatabaseManager::getInstance()->executeQuery($query,\"Query: $query\"); \n}",
"function get_event_details($userId, $eventId)\n {\n\t\tlog_message('debug', '_event/get_event_list');\n\t\tlog_message('debug', '_event/get_event_list:: [1] userId='.$userId.' eventId='.$eventId);\n\n $result = $this->_query_reader->get_list('get_event_details',array(\n\t\t\t'user_id'=>$userId,\n\t\t\t'event_id'=>$eventId\n\t\t\t));\n\n log_message('debug', '_event/get_event_list:: [2] result='.json_encode($result));\n return $result;\n }",
"public function getEventDetail()\n {\n return $this->event_detail;\n }",
"public function getAllDetailsForEvent($eid){\n\t\t$this->eventDetails = $this->qrticketsDAO->getAllDetailsForEvent($eid);\n\t}",
"function getEventInfo($eventId){\n\t\tglobal $db;\n\t\t//Select relevant fields from database given the event ID\n $sql = \"SELECT s_title, s_game, i_time, e_day, id_room, s_table, s_desc, i_maxplayers, e_exper, e_complex, i_length, id_gm FROM ucon_event WHERE id_event = ?\";\n $result = $db->execute($sql, $eventId);\n\n\t\t//Create a basic object to store the data\n\t\t$eventObj = new stdClass();\n\n\n\t\t\t//Bind each of the values from the result into a single object\n\t\t\t$row = $result->fetchRow();\n\t\t\t\t$eventObj->eventId = $eventId;\n\t\t\t\t$eventObj->title = $row[\"s_title\"];\n\n\t\t\t\t$eventObj->game = $row[\"s_game\"];\n\n\t\t\t\t$eventObj->day = $row[\"e_day\"];\n\t\t\t\t$eventObj->time = $row[\"i_time\"];\n\t\t\t\t$eventObj->length = $row[\"i_length\"];\n\n\t\t\t\t$eventObj->complex = $row[\"e_complex\"];\n\t\t\t\t$eventObj->room = $row[\"id_room\"];\n\t\t\t\t$eventObj->table = $row[\"s_table\"];\n\t\t\t\t$eventObj->maxPlayers = $row[\"i_maxplayers\"];\n\t\t\t\t$eventObj->experience = $row[\"e_exper\"];\n\t\t\t\t$eventObj->descLong = $row[\"s_desc\"];\n\t\t\t\t$eventObj->gmName = getGameMasterName($row[\"id_gm\"]);\n\n\t\t\t\t// make sure its not table\n\n\n\t\treturn $eventObj;\n\t}",
"public function viewEventDetails($eventID)\n {\n //instantiates connection object from credentials.php\n $conn = new Credentials;\n $this->connection = $conn->conn;\n \n //if $eventID is null, it will display data of the first row\n //that exists in event table\n if (empty($eventID))\n {\n $query = \"SELECT MIN(eventID) as eventID FROM event\";\n $this->result = mysqli_query($this->connection, $query);\n \n while (($row = mysqli_fetch_assoc($this->result)) != false)\n {\n $ids[] = $row;\n }\n \n //if no event exists in event table, it will redirect to creat event page\n $eventID = $ids[0][\"eventID\"] or die(header(\"location: index.php?url=home/createEvent\"));\n \n mysqli_free_result($this->result);\n }\n \n //gets all the info related to provided event id\n $query = \"SELECT a.*, b.typeDescription FROM event a INNER JOIN eventtype b ON a.type = b.typeID WHERE a.eventID = $eventID\";\n \n $this->result = mysqli_query($this->connection, $query);\n \n while (($row = mysqli_fetch_assoc($this->result)) != false)\n {\n $this->events[] = $row;\n }\n \n mysqli_free_result($this->result);\n mysqli_close($this->connection);\n }",
"function eventdetail()\n\t{\n\t\tif(isset($_SESSION['user']))\n\t\t\t$userInfo = $_SESSION['user'];\n\t\telse\n\t\t\t$userInfo = array();\n\t\t$this->load->model('events');\n\t\t$param = $this->uri->uri_to_assoc(3);\n\t\t$id = \"\";\n\t\tif(isset($param['id']))\n\t\t\t$id = $param['id'];\n\t\t$r = $this->events->getEvent($id);\n\t\tif('OK'==$r['status'] && isset($r['event']['date']))\n\t\t{\n\t\t\t$event = $r['event'];\n\t\t\t$parms = array('event'=>$event);\n\t\t\t$content = $this->load->view('hcdec_event_detail', $parms, true);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$content = \"<div class='contentBox'><b>No such event</b></div>\";\n\t\t}\n\t\t$p = array('user'=>$userInfo, 'content'=>$content);\n\t\t$this->load->view('public_template', $p);\n\t}",
"public function getEventDetails()\n {\n\t\treturn $this->_devToolHelper->getEventDetails();\n }",
"function getEventInfo($eventid)\n\t{\n\t\t$q = \"SELECT * FROM `\" . TBL_EVENTS . \"` WHERE `ID` = $eventid\";\n\t\t$result = mysql_query($q, $this->connection);\n\t\t/* Error occurred, return given name by default */\n\t\tif (!$result || (mysql_numrows($result) < 1)) {\n\t\t\treturn NULL;\n\t\t}\n\t\t/* Return result array */\n\t\t$dbarray = mysql_fetch_array($result);\n\t\treturn $dbarray;\n\t}",
"public function showEvent($eventId) {\n $api_response = $this->untEventsClient->getEvent($eventId);\n $image = $api_response[0]['eventImage'] != '' ? $api_response[0]['eventImage'] : NULL;\n return [\n '#theme' => 'unt_events_event_detail',\n '#name' => 'Event Detail',\n '#type' => 'markup',\n '#title' => $api_response[0]['eventTitle'],\n '#date' => ['#markup' => $api_response[0]['eventDate']],\n '#location' => ['#markup' => $api_response[0]['eventLocation']],\n '#contact_name' => ['#markup' => $api_response[0]['eventContact']],\n '#contact_phone' => ['#markup' => $api_response[0]['eventContactPhone']],\n '#contact_email' => ['#markup' => $api_response[0]['eventContactMail']],\n '#department' => ['#markup' => $api_response[0]['eventDept']],\n '#details' => ['#markup' => $api_response[0]['eventDetails']],\n '#image' => $image,\n ];\n }",
"function showEventDetail($eventId)\n {\n $eventDetail = $this->event_model->getEventDetailById($eventId);\n $data['eventDetail'] = $eventDetail;\n $result = $eventDetail;\n\n $userId = $this->event_model->getOrganizerId($eventId);\n $this->load->model('user_model');\n $userRole = $this->user_model->getRoleById($userId[0]->organizer_id);\n if ($userRole->role == 2) {\n $this->load->model('member_state_model');\n $data['member_state'] = $this->member_state_model->getStateById($userId[0]->organizer_id);\n }\n $this->load->model('booking_model');\n $data['booking'] = $this->booking_model->getBookingDetailByEvent($eventId);\n $favourite = $this->db->query(\"select count(no) as favourite_amount from favourite_event where event_id=\" . $eventId)->result();\n $data['favourite_amount'] = $favourite[0]->favourite_amount;\n $data['shared_amount'] = $this->db->query('select sum(count) as count from event_share where event_id = ' . $eventId)->row()->count;\n $this->global['pageTitle'] = '活动详情';\n $this->loadViews(\"eventdetail\", $this->global, $data, NULL);\n }",
"function showEventDetail($eventId)\n {\n $eventDetail = $this->event_model->getEventDetailById($eventId);\n $data['eventDetail'] = $eventDetail;\n\n $userId = $this->event_model->getOrganizerId($eventId);\n $this->load->model('user_model');\n $userRole = $this->user_model->getRoleById($userId[0]->organizer_id);\n if($userRole->role == 2){\n $this->load->model('member_state_model');\n $data['member_state'] = $this->member_state_model->getStateById($userId[0]->organizer_id);\n }\n $this->load->model('booking_model');\n $data['booking'] = $this->booking_model->getBookingDetailByEvent($eventId);\n $favourite = $this->db->query(\"select count(no) as favourite_amount from favourite_event where event_id=\".$eventId)->result();\n $data['favourite_amount'] = $favourite[0]->favourite_amount;\n $this->global['pageTitle'] = '活动详情';\n $this->loadViews(\"eventdetail\", $this->global, $data, NULL);\n }",
"public function getEventDetail()\n {\n if (array_key_exists(\"eventDetail\", $this->_propDict)) {\n if (is_a($this->_propDict[\"eventDetail\"], \"\\Microsoft\\Graph\\Model\\EventMessageDetail\") || is_null($this->_propDict[\"eventDetail\"])) {\n return $this->_propDict[\"eventDetail\"];\n } else {\n $this->_propDict[\"eventDetail\"] = new EventMessageDetail($this->_propDict[\"eventDetail\"]);\n return $this->_propDict[\"eventDetail\"];\n }\n }\n return null;\n }",
"public function getEventDetail(string $eventId)\n {\n $response = $this->makeRequest('GET', static::ENDPOINT.'/'.$eventId);\n\n if (isset($response['id'])) {\n return $response;\n }\n\n return false;\n }",
"public function getEventInfoById($id)\n {\n // connect to unitmanagment db and pull event info from event table with provided id\n $sql = \"SELECT *\n FROM unitmanagement.event\n WHERE event_id = ?\n LIMIT 1\";\n\n $data = $this->db_read->fetchAssoc($sql, array($id));\n return $data;\n }",
"function getEvent() {\n\tglobal $db;\n\n\t$query = \"SELECT idEvent, name, date, description, EventType.type, address, private, eventPhoto, idUserCreator, firstName AS userFirstName, lastName AS userLastName FROM Event, EventType, User WHERE Event.type = idEventType AND idUserCreator = idUser AND Event.active = 1\";\n\tif (isset($_GET['idEvent']))\n\t\t$query .= \" AND idEvent = \" . $_GET['idEvent'];\n\tif (isset($_GET['name']))\n\t\t$query .= \" AND name LIKE '%\" . $_GET['name'] . \"%'\";\n\tif (isset($_GET['type']))\n\t\t$query .= \" AND type = \" . $_GET['type'];\n\tif (isset($_GET['address']))\n\t\t$query .= \" AND address LIKE '%\" . $_GET['address'] . \"%'\";\n\tif (isset($_GET['private_event']))\n\t\t$query .= \" AND private = \" . $_GET['private_event'];\n\tif (isset($_GET['type_name']))\n\t\t$query .= \" AND EventType.type LIKE '%\" . $_GET['type_name'] . \"%'\";\n\tif (isset($_GET['dateBegin']))\n\t\t$query .= \" AND date >= '\" . $_GET['dateBegin'] . \"' AND date <= '\" . $_GET['dateEnd'] . \"'\";\n\tif (isset($_GET['idUserCreator']))\n\t\t$query .= \" AND idUserCreator = \" . $_GET['idUserCreator'];\n\n\t\t\t\t\n\t$stmt = $db->prepare($query);\n\t$stmt->execute(); \n\t$events = $stmt->fetchAll();\n\t\n\t/* Content-Type must be defined, otherwise the output is seen as plain text */\n\theader(\"Content-Type: application/json\");\n\techo json_encode($events);\n}",
"function eventDetails($conn, $id){\r\n\t$stmt = $conn->prepare(\"SELECT * FROM scheduleit_Event WHERE id = ?\");\r\n\t$stmt->bind_param(\"i\", $id);\r\n\tif ($stmt->execute()){\r\n\t\t$result = $stmt->get_result();\r\n\t\t$data = $result->fetch_all(MYSQLI_ASSOC);\r\n\t\treturn $data[0];\r\n\t}\r\n\telse{\r\n\t\treturn NULL;\r\n\t}\r\n}",
"function event_details($obj) {\n \n // $fields[phrase('id', CAPITALIZE)] = $obj->id;\n $fields[phrase('type', CAPITALIZE)] = get_object('event_type', $obj->type, 'name');\n // $fields[phrase('status', CAPITALIZE)] = get_object('event_status', $obj->status, 'name'). \" (\".sql2human($obj->status_change_timestamp).\")\";\n // if($obj->status_change_timestamp > 1) $status_str .= \" (\".sql2human($enqObj->status_change_timestamp).\")\";\n\n $fields[phrase('start_time', CAPITALIZE)] = sql2human($obj->start_time, array('show_weekday' => true, 'show_time' => true));\n // $fields[phrase('end_time', CAPITALIZE)] = sql2human($obj->end_time, true, true);\n\n $fields[phrase('address', CAPITALIZE)] = $obj->start_address;\n $fields[phrase('to_address', CAPITALIZE)] = $obj->end_address;\n\n $fields[phrase('reservation', CAPITALIZE)] = $obj->res_id;\n if($obj->apt_id) $fields[phrase('property', CAPITALIZE)] = get_object('property', $obj->apt_id, 'name');\n\n $fields[phrase('customer_name', CAPITALIZE)] = $obj->customer_name;\n $fields[phrase('customer_count', CAPITALIZE)] = $obj->customer_count;\n $fields[phrase('customer_notes', CAPITALIZE)] = $obj->customer_notes;\n\n $fields[phrase('contractor_name', CAPITALIZE)] = $obj->contractor_name;\n $fields[phrase('contractor_notes', CAPITALIZE)] = $obj->contractor_notes;\n\n $fields[phrase('alert', CAPITALIZE)] = $obj->alert;\n $fields[phrase('notes', CAPITALIZE)] = $obj->notes;\n \n return array_filter($fields);\n}",
"public function eventDetails()\n {\n return [\n 'name' => 'Event',\n 'description' => 'Event description',\n 'group' => 'groupcode',\n ];\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
testInvalidDefinitionWithShortNameNotSingleChar() test that the you cannot redeclare a long name | public function testInvalidDefinitionDuplicateLongName() {
$def = new TestCommandLineArgumentDefinition(array(
'help|h' => 'help',
'help|v' => 'help2',
));
$def->parseDefinitions();
} | [
"public function testInvalidDefinitionDuplicateShortName() {\n $def = new TestCommandLineArgumentDefinition(array(\n 'help|h' => 'help',\n 'verbose|h' => 'verbose',\n ));\n\n $def->parseDefinitions();\n }",
"function test_check_shortnames_new()\n\t{\n\t\t$result = $this->takeaway->checkShortNames('anewshortnamethatdoesnotexist');\n\t\t\n\t\t$this->_assert_false($result);\n\t}",
"public function testInvalidDefinitionWithNoShortName() {\n $def = new TestCommandLineArgumentDefinition(array(\n 'help' => 'help'\n ));\n\n $def->parseDefinitions();\n }",
"public function testGetLongNameUsingShortName() {\n $def = new \\Clapp\\CommandLineArgumentDefinition($this->defaultOptions);\n\n $this->assertEquals($def->getLongName('h'), 'help');\n $this->assertEquals($def->getLongName('v'), 'verbose');\n $this->assertEquals($def->getLongName('c'), 'count');\n $this->assertEquals($def->getLongName('y'), 'year');\n $this->assertEquals($def->getLongName('d'), 'day');\n $this->assertEquals($def->getLongName('k'), 'keyword');\n $this->assertEquals($def->getLongName('x'), 'exclude');\n $this->assertEquals($def->getLongName('m'), 'month');\n $this->assertEquals($def->getLongName('i'), 'include');\n\n $this->assertNull($def->getLongName('z'));\n }",
"public function testIllegalLongNameWithIsNotAllowed() {\n $argv = explode(\" \", './test.php --work --verbose');\n\n $argFilter = new TestCommandArgumentFilter($this->defaultDefinition, $argv);\n\n $argFilter->parseParams();\n\n }",
"public function test_course_shortname_check() {\n $this->resetAfterTest();\n\n $courseid = $this->generate_course();\n $course = \\local_connect\\course::get($courseid);\n $course->set_shortname_ext(\"TEST\");\n $this->assertTrue($course->create_in_moodle());\n\n $courseid = $this->generate_course();\n $course2 = \\local_connect\\course::get($courseid);\n $course2->set_shortname_ext(\"TEST\");\n\n $this->assertTrue($course2->is_unique_shortname($course2->shortname));\n $course2->module_code = $course->module_code;\n $this->assertFalse($course2->is_unique_shortname($course2->shortname));\n }",
"public function test_regex_shortnames() {\n\n $this->_create_rich_site();\n\n // Use regex for shortname matches.\n $filterconfig = <<<EOF\nregex | exp | All but default | ^[a-zø]{2}\nEOF;\n set_config('filters', $filterconfig, 'block_filtered_course_list');\n\n // This new rubric should exclude courses with a shortname like 'c_1'.\n // It does not begin with two lowercase letters.\n $this->_courseunderrubric ( array (\n 'user1' => array (\n 'c_1' => 'All but default',\n )\n ), 'not');\n\n // Courses under any other category should be listed.\n $this->_courseunderrubric ( array (\n 'user1' => array (\n 'cc1_1' => 'All but default',\n 'cc2_1' => 'All but default',\n 'gc1_1' => 'All but default',\n 'sc_1' => 'All but default',\n 'øthér' => 'All but default',\n ),\n ));\n }",
"public static function notifyCheckModuleNameInvalid()\n {\n return 'The module name may only contain letters and \"_\" .';\n }",
"public function testConstructWithTooShortValue()\n {\n new Name('');\n }",
"public function testIfTooLongEntityTypeNamesAreCaughtInTime() {\n $this->createEntityType([], 'a27CharacterLongNameIssLong');\n $label = 'a28CharacterLongNameIsLonger';\n $edit = [\n 'label' => $label,\n 'id' => $id = strtolower($label),\n ];\n\n $this->drupalPostForm(Url::fromRoute('eck.entity_type.add'), $edit, $this->t('Create entity type'));\n $this->assertSession()->statusCodeEquals(200);\n $this->assertSession()->responseContains(\"Machine name cannot be longer than <em class=\\\"placeholder\\\">27</em> characters but is currently <em class=\\\"placeholder\\\">28</em> characters long.\");\n }",
"public function testCreateBankWithLongName(){\n //WxAppException expected\n $userId = TestIdGenerator::getUserId('uId06');\n $newBankName = 'TheLongestName(more than fifty 字数)Should not be Used';\n\n $this->setExpectedException('WxAppException', BankMessages::ERR_BANK_NAME_TOO_LONG);\n Bank::createBank($userId, $newBankName);\n }",
"public function testEntryValidationTokenNameTooLong()\n {\n // stops notification being physically sent when a user is created\n Notification::fake();\n\n $user = $this->loginAsFakeUser(true, 'reader');\n\n // stops events being fired\n Event::fake();\n\n $token_name = str::random(41);\n $this->followingRedirects()\n ->from('tokens/create')\n ->post('tokens', [\n 'name' => $token_name\n ])\n ->assertSee('Name must be between 3 and 40 characters.');\n }",
"public function testConstructWithTooLongValue()\n {\n new Name('01234567890123456789012345678901234567890123456789012345678901234');\n }",
"public function testValidateValidName($name)\n {\n BuiltinRecordUtil::validateName($name);\n }",
"public function testPluralizeEndingWithX() {\n $this->markTestIncomplete();\n }",
"public function testLexReportsUsefulInformationForDashesInNames()\n {\n $lexer = $this->getLexer('a-b');\n $firstToken = $lexer->advance();\n\n $this->assertTokenPropertiesEqual($firstToken, TokenKindEnum::NAME, [0, 1], 'a');\n\n $caughtError = null;\n\n try {\n $lexer->advance();\n } catch (SyntaxErrorException $e) {\n $caughtError = $e;\n }\n\n $this->assertEquals('Syntax Error: Invalid number, expected digit but got: \"b\".', $caughtError->getMessage());\n $this->assertEquals([['line' => 1, 'column' => 3]], $caughtError->getLocationsAsArray());\n }",
"public function testFunctionIsNameValid()\n {\n $this->assertTrue($this->app->isNameValid('task'));\n $this->assertTrue($this->app->isNameValid('task-one'));\n $this->assertTrue($this->app->isNameValid('task-123'));\n $this->assertFalse($this->app->isNameValid(''));\n $this->assertFalse($this->app->isNameValid('am'));\n $this->assertFalse($this->app->isNameValid('Task-one'));\n $this->assertFalse($this->app->isNameValid('task_one'));\n }",
"public function test_filter_concatenated_name_in_function() {\n\t\t$this->assertContainsSubstring( \"Invalid concatenated hook name for filter ''invalid_concatenated_name' . \" . '$filter' . \"' in function 'invalid_hooks_function'\", $this->logs );\n\t}",
"public function test_version1importlogsinvalidshortnameoncourseupdate() {\n // Create mapping record.\n $this->create_mapping_record('course', 'shortname', 'customshortname');\n\n $data = array('action' => 'update', 'customshortname' => 'rlipshortname');\n\n $expectederror = \"[course.csv line 2] Course with shortname \\\"rlipshortname\\\" could not be updated. customshortname\";\n $expectederror .= \" value of \\\"rlipshortname\\\" does not refer to a valid course.\\n\";\n $this->assert_data_produces_error($data, $expectederror, 'course');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Same as getNextPlayerTable, but the associative array associate the previous player around the table. | protected function getPrevPlayerTable()
{
} | [
"private function getPreviousTimeTableId(){\n\t\t\t$uId = $_SESSION['id'];\n\t\t\t$query = DB::getInstance()->prep(\"SELECT * FROM timetable WHERE SetDate='$this->_lastPerformed' AND UserId ='$uId' AND RoutineId='$this->_rId' \");\n\n\t\t\t$query -> execute();\n\t\t\t$results = $query->fetchAll(PDO::FETCH_OBJ);\n\n\t\t\t//print_r($results);\n\n\t\t\treturn $results[0]->TimeTableId;\n\t\t\t\n\t\t}",
"public function getPreviousTiers();",
"function getPrevious();",
"public function fetchPrevious();",
"private function get_prev_next($array, $current) {\n $pn = new stdClass();\n\n $hascurrent = $pn->next = $pn->prev = false;\n\n foreach ($array as $a) {\n if ($hascurrent) {\n $pn->next = $a;\n break;\n }\n if ($a == $current) {\n $hascurrent = true;\n } else {\n if (!$hascurrent) {\n $pn->prev = $a;\n }\n }\n }\n return $pn;\n }",
"public function getPreviousPlays():? array;",
"private function initNextPlayers(): void\n {\n $this->nextPlayers = [];\n\n /** @var Player|null */\n $prev = null;\n\n foreach ($this->players() as $player) {\n if ($prev) {\n $this->nextPlayers[$prev->id()] = $player;\n }\n\n $prev = $player;\n }\n\n $this->nextPlayers[$prev->id()] = $this->players()->first();\n }",
"protected function activePrevPlayer() {\n }",
"public function prevRow() {\n\t\t$this->index--;\n\t}",
"public function previous()\n\t{\n\t\t--$this->row;\n\t}",
"public function previous_row($type = 'object')\n\t{\n\t\t$n = ($this->current_row !== 0) ? $this->current_row - 1 : 0;\n\t\treturn $this->row($n, $type);\n\t}",
"public function previous_row($type = 'object'){\n\t\t$result = $this->result($type);\n\t\n\t\tif (count($result) == 0){\n\t\t\treturn $result;\n\t\t}\n\t\n\t\tif (isset($result[$this->current_row - 1])){\n\t\t\t--$this->current_row;\n\t\t}\n\t\treturn $result[$this->current_row];\n\t}",
"function generateTradingActivityTable($player) {\n $this->table->set_heading('Stock Code', 'Transaction', 'Date');\n foreach ($player as $row) {\n $this->table->add_row($row);\n }\n\n return $this->table->generate();\n }",
"public function prevNext(): array\n {\n $user = $this->model;\n\n return [\n 'next' => function () use ($user) {\n $next = $user->next();\n return $next ? $next->panel()->toLink('username') : null;\n },\n 'prev' => function () use ($user) {\n $prev = $user->prev();\n return $prev ? $prev->panel()->toLink('username') : null;\n }\n ];\n }",
"public function previousRecord();",
"public function prev(){\n\t\t$this->nextRow(-1,'min');\n\t}",
"public function prevNext(): array\n {\n $file = $this->model;\n $siblings = $file->templateSiblings()->sortBy(\n 'sort',\n 'asc',\n 'filename',\n 'asc'\n );\n\n return [\n 'next' => function () use ($file, $siblings): ?array {\n $next = $siblings->nth($siblings->indexOf($file) + 1);\n return $next ? $next->panel()->toLink('filename') : null;\n },\n 'prev' => function () use ($file, $siblings): ?array {\n $prev = $siblings->nth($siblings->indexOf($file) - 1);\n return $prev ? $prev->panel()->toLink('filename') : null;\n }\n ];\n }",
"public function prev(){\n if(!$this->keys || (int)$this->currentKeyIndex === 0){\n return null;\n }\n\n $this->currentKeyIndex -=1;\n $key = $this->keys[$this->currentKeyIndex];\n\n return $this->get($key);\n }",
"function db_get_previous_team_id() {\n\tglobal $link, $sql_table_team;\n\n\t$sql = \"SELECT team_id from $sql_table_team ORDER BY timestamp DESC LIMIT 1,1\";\n\n\t// Figure out the current bid\n\t$result = mysqli_query($link, $sql) or die('{\"status\": 0, \"msg\":\"Error getting the previous team id. ('.mysqli_error($link).'\"}');\n\n\tif (mysqli_num_rows($result) == 0) {\n\t\treturn -1;\n\t}\n\t// extract our results\n\t$row = mysqli_fetch_array($result);\n\treturn intval($row['team_id']);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the alias for the given name. | public function getAlias($name)
{
return isset($this->_aliases[$name]) ? $this->_aliases[$name] : null;
} | [
"public function getAlias($name)\n\t{\n\t\tif (isset($this->_aliases[$name])) {\n\t\t\treturn $this->_aliases[$name];\n\t\t}\n\n\t\treturn null;\n\t}",
"private function findAlias($name)\n {\n if(preg_match_all('/aka\\s*(.+)/', $name, $matches)) {\n \n if ($matches[1]) {\n \n preg_match_all('/[^&|,\\s][^&|,]*[^&|,\\s]*/', $matches[1][0], $aliases);\n \n return json_encode(array_map('trim',$aliases[0]));\n }\n }\n \n return '';\n }",
"public function getAliasName() : string;",
"public function getAlias($alias);",
"public function getAlias(): string\n {\n return $this->alias;\n }",
"function alias($name = '')\n {\n }",
"function get_alias_description($name)\n{\n return OPNsense\\Firewall\\Util::aliasDescription($name);\n}",
"function alias ($name) {\n if ($name) $this->alias = DB::nameEscape($name);\n return $this; // enable chaining\n }",
"public static function getAliases($name){}",
"protected function _resolveMarkupName($name)\n {\n while (($type = $this->_getMarkupType($name))\n && ($type & self::TYPE_ALIAS)\n ) {\n $name = $this->_markups[$name]['name'];\n }\n\n return $name;\n }",
"public function getAlias();",
"function alias_expand($name) {\n\t\n\tglobal $aliastable;\n\t\n\tif (isset($aliastable[$name]))\n\t\treturn $aliastable[$name];\n\telse if (is_ipaddr($name) || is_subnet($name) || is_ipaddr6($name))\n\t\treturn $name;\n\telse\n\t\treturn null;\n}",
"function alias_expand($name) {\n\n\tglobal $aliastable;\n\n\tif (isset($aliastable[$name]))\n\treturn $aliastable[$name];\n\telse if (is_ipaddr($name) || is_subnet($name))\n\treturn $name;\n\telse\n\treturn null;\n}",
"public function getAlias()\n {\n return $this->alias;\n }",
"function xarModGetAlias($alias) { return xarModAlias::resolve($alias);}",
"protected function getAlias()\n {\n if (empty($this->alias)) {\n return '';\n }\n\n if (strpos($this->alias, '.') !== false) {\n return $this->alias;\n }\n\n return $this->alias . '.';\n }",
"function get_alias($alias, $compared = null) {\n return $alias != $compared ? $alias : null;\n}",
"public function resolveAlias(string $alias);",
"function alias($name,$params=array()) {\n\t\tif (!is_array($params))\n\t\t\t$params=$this->parse($params);\n\t\tif (empty($this->hive['ALIASES'][$name]))\n\t\t\tuser_error(sprintf(self::E_Named,$name),E_USER_ERROR);\n\t\t$url=$this->build($this->hive['ALIASES'][$name],$params);\n\t\treturn $url;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Utility Functions Checks if needle $str is in haystack $arr but ignores case. | function in_array_case($str, $arr)
{
foreach ($arr as $s) {
if (strcasecmp($str, $s) == 0) {
return true;
}
}
return false;
} | [
"public static function in_array_case($_arr, $_str)\n {\n if (! is_array($_arr)) {\n return false;\n }\n \n foreach ($_arr as $s) {\n if (strcasecmp($_str, $s) == 0) {\n return true;\n }\n }\n return false;\n }",
"function in_array_nocase($needle, $haystack)\n{\n // use much faster method for ascii\n if (is_ascii($needle)) {\n foreach ((array) $haystack as $value) {\n if (strcasecmp($value, $needle) === 0) {\n return true;\n }\n }\n }\n else {\n $needle = mb_strtolower($needle);\n foreach ((array) $haystack as $value) {\n if ($needle === mb_strtolower($value)) {\n return true;\n }\n }\n }\n\n return false;\n}",
"function in_array_ci(string $needle, array $haystack): bool\n {\n return in_array(strtolower($needle), array_map('strtolower', $haystack));\n }",
"function in_arrayi($needle, $haystack) {\n foreach ($haystack as $value) {\n if (strtolower($value) == strtolower($needle)) return true;\n }\n unset($value);\n return false;\n }",
"public static function in_iarray($str, $a){\r\r\n\t\tforeach($a as $v){\r\r\n\t\t\t\r\r\n\t\t\tif(strcasecmp($str, $v)==0){return true;}\r\r\n\t\t\t\r\r\n\t\t}\r\r\n\t\t\r\r\n\t\treturn false;\r\r\n\t}",
"private function _arrayLsearch( $str, $array ) {\n\t\t\tforeach($array as $k=>$v){\n\t\t\t\tif(strtolower($v)===strtolower($str)){\n\t\t\t\t\treturn $v;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthrow new \\System\\Base\\InvalidOperationException(\"{$str} does not exist in array\");\n\t\t}",
"function str_has(string $string, string|array $search, bool $icase = false): bool\n{\n if (is_array($search)) {\n foreach ($search as $search) {\n if (str_has($string, (string) $search, $icase)) {\n return true;\n }\n }\n return false;\n }\n\n return !$icase ? str_contains($string, $search) : (\n mb_stripos($string, $search) !== false\n );\n}",
"function search_array($array, $str) {\n for ($i = 0; $i < count($array); $i++) {\n if (in_array($str, $array[$i])) {\n return true;\n break;\n }\n }\n return false;\n }",
"public function testStringIsFoundIfCaseInsensitive()\n {\n $needle = \"foo\";\n $haystack = ucfirst($needle) . \" Bar\";\n $this->assertTrue(Strings::contains($haystack, $needle, false));\n }",
"function checkArray($arr,$str)\r\n{\r\n\t$array_size=sizeof($arr);\r\n\t//$flag=0;\r\n\tfor($i=0;$i<$array_size;$i++)\r\n\t{\r\n\t\r\n\t\tif(strcmp($str,$arr[$i])==0)\r\n\t\t{\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t\t\r\n\t}\r\n\treturn 0;\r\n}",
"function SearchArray($str, $arr)\n{\n\n foreach ($arr as $item) {\n $pattern = '/\\W' . $item . '\\W/i';\n $result = preg_match($pattern, $str);\n if ($result == 1) return true;\n }\n return false;\n}",
"public static function inArrayNoCase($search, &$array)\n {\n if (!Arrays::isArray($array, false)) {\n return false;\n }\n $search = strtolower($search);\n foreach ($array as $item) {\n if (strtolower($item) == $search) {\n return true;\n } else {\n return false;\n }\n }\n }",
"function cs_in_array($string,$object) {\n\n\t$string = strtolower($string);\n\n\t$returnValue = null;\n\n\tfor ($row=0;$row<count($object);$row++) {\n\n\t\t$tempValue = strtolower($object[$row]);\n\n\t\tif ($tempValue == $string) {\n\t\t $returnValue = $tempValue; \n\t\t break;\n }\n \n\t}\n\n\tif ($returnValue) return $returnValue;\n\telse return false;\n\n}",
"function iin_array( $needle, $haystack, $strict = false ) {\n\t\t\n\t\t$strtoupper_safe = function( $str ) {\n\t\t\tif( is_string( $str ) ) return strtoupper($str);\n\t\t\tif( is_array( $str ) ) $str = array_map( $strtoupper_safe, $str );\n\t\t\treturn $str;\n\t\t};\n\t\t\n\t\treturn in_array_recursive( $strtoupper_safe( $needle ), array_map( $strtoupper_safe, $haystack ), $strict );\n\t}",
"function isstr($array, $text)\n{\nif(strpos($text, $array) === false) {\nreturn false;\n} else {\nreturn true;\n}\n}",
"function substr_in_array($haystack, $needle) {\n for($i = 0; $i < count($haystack); $i++) {\n $string_pos = strpos($needle, $haystack[$i]);\n \n if ($string_pos !== false) {\n return true;\n }\n }\n \n return false;\n }",
"function arraySearchI($needle, array $haystack)\n{\n return array_search(strtolower($needle), array_map('strtolower', $haystack));\n\n}",
"final public static function containsAny(string $str, array $needles, bool $caseSensitive = true): bool\n {\n if (empty($needles)) { return false; }\n\n foreach ($needles as $needle) {\n if (self::contains($str, $needle, $caseSensitive)) { return true; }\n }\n\n return false;\n }",
"function strpos_array($haystack, $needles) {\n foreach ($needles as $str) {\n if(($pos = stripos($haystack, $str, 0) !== false ) ) return $pos; // works case-insensitive\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the public 'C' service. | protected function getCService()
{
return new \C(new \B(new \A()));
} | [
"public function get_c_services(){ return $this->c_services; }",
"abstract public function getCloudService();",
"function getCloudmunchService() {\r\n\t\t$cloudmunchService = new CloudmunchService($this->appContext);\r\n\t\treturn $cloudmunchService;\r\n\t}",
"public function getCharityService() \n\t{\n\t\tif(!$this->_charityService)\n\t\t\t$this->_charityService = GTW_Service_Charity::getInstance();\n\n\t\treturn $this->_charityService;\n\t}",
"public function get_service(){\n\t\t\t\n\t\t\treturn $this->data_map->get_service();\n\t\t\t\n\t\t}",
"public function getServiceCpta() {\n return $this->serviceCpta;\n }",
"public function getSpecialService() {\n return $this->get(self::SPECIAL_SERVICE);\n }",
"public function serviceCatalog()\n {\n return self::$serviceCatalogCache[$this->token()];\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}",
"function gi()\n{\n return Service::getInstance();\n}",
"function companyToCredzu(){\n return companyToCredzu::getInstance();\n }",
"protected static function getServicesClass()\n {\n return Services::class;\n }",
"protected function getCacheClearerService()\n {\n trigger_deprecation('symfony/framework-bundle', '5.2', 'Accessing the \"cache_clearer\" service directly from the container is deprecated, use dependency injection instead.');\n\n return $this->get('.container.private.cache_clearer');\n }",
"public function getService()\n {\n\n if (preg_match('/^2\\./', $this->getVersion())) {\n $service = 'get';\n } else {\n $service = 'objects';\n }\n\n return $service;\n\n }",
"public function getService ()\n {\n if (null === $this->_service) {\n $this->setService('Default_Service_Spirit');\n }\n return $this->_service;\n }",
"public function getCategoryService()\n {\n return $this->_categoryService;\n }",
"function getCloudServices(){\n \treturn $this->azurerestclient->getCLoudServices();\n }",
"protected function getPrimaryCategoryService()\n {\n }",
"function cmnGetServiceNameByID($id)\n\t{\n\t\t$serv = new Services();\n\t\treturn $serv->GetServiceNameByID($id);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Registers shortcodes buttons styles for editor | function pt_buttons_css() {
wp_register_style ( 'shortcodes-buttons', PublishThis_Shortcodes::shortcodes_base_dir () . 'assets/css/shortcodes-buttons.css', false, '1.0.0' );
wp_enqueue_style ( 'shortcodes-buttons' );
} | [
"function adjust_editor_buttons($buttons) {\n $buttons = f\\merge_at('styleselect', 1, $buttons);\n\treturn $buttons;\n}",
"function custom_mce_buttons_2( $buttons ) {\n array_unshift( $buttons, 'styleselect' );\n return $buttons;\n}",
"function eskript_mcebuttons() {\n add_filter( \"mce_external_plugins\", \"eskript_add_buttons\" );\n add_filter( 'mce_buttons_3', 'eskript_register_buttons' );\n\twp_register_style( 'eskript-mce-buttons', plugin_dir_url( __FILE__ ) . 'assets/css/eskript-mce-buttons.css' );\n wp_enqueue_style( 'eskript-mce-buttons' );\n}",
"function vw_shortcode_editor_init() {\r\n\t$button_style_options = array(\r\n\t\t'primary' => 'Primary',\r\n\t\t'black' => 'Black',\r\n\t\t'orange' => 'Orange',\r\n\t\t'red' => 'Red',\r\n\t\t'yellow' => 'Yellow',\r\n\t\t'blue' => 'Blue',\r\n\t\t'green' => 'Green',\r\n\t\t'purple' => 'Purple',\r\n\t\t'pink' => 'Pink',\r\n\t);\r\n\r\n\t$shortcodes = array();\r\n\r\n\t$shortcodes[ 'accordion' ] = array(\r\n\t\t'atts' => array(\r\n\t\t\t'title' => array(\r\n\t\t\t\t'title' => 'Title',\r\n\t\t\t\t'desc' => '',\r\n\t\t\t\t'default' => '',\r\n\t\t\t\t'type' => 'text',\r\n\t\t\t),\r\n\t\t\t'open' => array(\r\n\t\t\t\t'title' => 'Open',\r\n\t\t\t\t'desc' => 'Open this toggle by default',\r\n\t\t\t\t'default' => 'false',\r\n\t\t\t\t'type' => 'dropdown',\r\n\t\t\t\t'options' => array(\r\n\t\t\t\t\t'false' => 'False',\r\n\t\t\t\t\t'true' => 'True',\r\n\t\t\t\t),\r\n\t\t\t),\r\n\t\t\t'content' => array(\r\n\t\t\t\t'title' => 'Content',\r\n\t\t\t\t'desc' => '',\r\n\t\t\t\t'default' => 'Lorem ipsum',\r\n\t\t\t\t'type' => 'html',\r\n\t\t\t\t'render_as' => 'content',\r\n\t\t\t),\r\n\t\t),\r\n\t);\r\n\r\n\t$shortcodes[ 'posts' ] = array(\r\n\t\t'atts' => array(\r\n\t\t\t'title' => array(\r\n\t\t\t\t'title' => 'Title',\r\n\t\t\t\t'desc' => '',\r\n\t\t\t\t'default' => '',\r\n\t\t\t\t'type' => 'text',\r\n\t\t\t),\r\n\t\t\t'count' => array(\r\n\t\t\t\t'title' => 'Post Counts',\r\n\t\t\t\t'desc' => 'Number of post to be shown',\r\n\t\t\t\t'default' => '6',\r\n\t\t\t\t'type' => 'text',\r\n\t\t\t),\r\n\t\t\t'offset' => array(\r\n\t\t\t\t'title' => 'Skip posts',\r\n\t\t\t\t'desc' => 'Number of post to displace or pass over',\r\n\t\t\t\t'default' => '6',\r\n\t\t\t\t'type' => 'text',\r\n\t\t\t),\r\n\t\t\t'cat_name' => array(\r\n\t\t\t\t'title' => 'Post Category',\r\n\t\t\t\t'desc' => 'Slug of category',\r\n\t\t\t\t'default' => '',\r\n\t\t\t\t'type' => 'text',\r\n\t\t\t),\r\n\t\t\t'cat_exclude' => array(\r\n\t\t\t\t'title' => 'Exclude Categories',\r\n\t\t\t\t'desc' => 'ID of categories to be excluded. Separated by comma',\r\n\t\t\t\t'default' => '',\r\n\t\t\t\t'type' => 'text',\r\n\t\t\t),\r\n\t\t\t'tag' => array(\r\n\t\t\t\t'title' => 'Post Tagged',\r\n\t\t\t\t'desc' => 'Slug of tags. Separated by comma',\r\n\t\t\t\t'default' => '',\r\n\t\t\t\t'type' => 'text',\r\n\t\t\t),\r\n\t\t\t'layout' => array(\r\n\t\t\t\t'title' => 'Layout',\r\n\t\t\t\t'desc' => 'Layout of posts',\r\n\t\t\t\t'default' => 'medium-1-col-2',\r\n\t\t\t\t'type' => 'dropdown',\r\n\t\t\t\t'options' => array(\r\n\t\t\t\t\t'small-left-thumbnail-col-3' => 'Small-left Thumbnail',\r\n\t\t\t\t\t'small-top-thumbnail-col-4' => 'Small-top Thumbnail',\r\n\t\t\t\t\t'medium-1-col-2' => 'Medium Thumbnail 1 (2 Cols)',\r\n\t\t\t\t\t'medium-1-col-3' => 'Medium Thumbnail 1 (3 Cols)',\r\n\t\t\t\t\t'medium-2-col-2' => 'Medium Thumbnail 2 (2 Cols)',\r\n\t\t\t\t\t'medium-2-col-3' => 'Medium Thumbnail 2 (3 Cols)',\r\n\t\t\t\t\t'medium-3-col-2' => 'Medium Thumbnail 3 (2 Cols)',\r\n\t\t\t\t\t'medium-3-col-3' => 'Medium Thumbnail 3 (3 Cols)',\r\n\t\t\t\t\t'medium-4-col-2' => 'Medium Thumbnail 4 (2 Cols)',\r\n\t\t\t\t\t'medium-4-col-3' => 'Medium Thumbnail 4 (3 Cols)',\r\n\t\t\t\t\t'medium-5-col-2' => 'Medium Thumbnail 5 (2 Cols)',\r\n\t\t\t\t\t'medium-5-col-3' => 'Medium Thumbnail 5 (3 Cols)',\r\n\t\t\t\t\t'medium-6-col-1' => 'Medium Thumbnail 6 (1 Col)',\r\n\t\t\t\t\t'mix-1-col-2' => 'Mixed Layout 1 (2 Cols)',\r\n\t\t\t\t\t'mix-1-col-3' => 'Mixed Layout 1 (3 Cols)',\r\n\t\t\t\t\t'mix-2-col-2' => 'Mixed Layout 2 (2 Cols)',\r\n\t\t\t\t\t'mix-2-col-3' => 'Mixed Layout 2 (3 Cols)',\r\n\t\t\t\t\t'mix-3-col-2' => 'Mixed Layout 3 (2 Cols)',\r\n\t\t\t\t\t'mix-3-col-3' => 'Mixed Layout 3 (3 Cols)',\r\n\t\t\t\t\t'large' => 'Large Thumbnail',\r\n\t\t\t\t\t'slider-large-carousel' => 'Large Carousel',\r\n\t\t\t\t\t'slider-medium' => 'Medium Slider',\r\n\t\t\t\t\t'custom-1' => 'Custom 1',\r\n\t\t\t\t\t'custom-2' => 'Custom 2',\r\n\t\t\t\t\t'custom-3' => 'Custom 3',\r\n\t\t\t\t\t'custom-4' => 'Custom 4',\r\n\t\t\t\t),\r\n\t\t\t),\r\n\t\t\t'order' => array(\r\n\t\t\t\t'title' => 'Order',\r\n\t\t\t\t'desc' => 'Ordering of posts',\r\n\t\t\t\t'default' => 'latest',\r\n\t\t\t\t'type' => 'dropdown',\r\n\t\t\t\t'options' => array(\r\n\t\t\t\t\t'latest' => 'Latest Posts',\r\n\t\t\t\t\t'random' => 'Random Posts',\r\n\t\t\t\t\t'featured' => 'Featured Posts',\r\n\t\t\t\t\t'latest_gallery' => 'Latest Gallery Posts',\r\n\t\t\t\t\t'latest_video' => 'Latest Video Posts',\r\n\t\t\t\t\t'latest_audio' => 'Latest Audio Posts',\r\n\t\t\t\t\t'latest_reviews' => 'Latest Reviews',\r\n\t\t\t\t\t'most_viewed' => 'Most Viewed',\r\n\t\t\t\t\t'most_review_score' => 'Most Review Score',\r\n\t\t\t\t),\r\n\t\t\t),\r\n\t\t\t'pagination' => array(\r\n\t\t\t\t'title' => 'Pagination',\r\n\t\t\t\t'desc' => 'Show pagination',\r\n\t\t\t\t'default' => 'hide',\r\n\t\t\t\t'type' => 'dropdown',\r\n\t\t\t\t'options' => array(\r\n\t\t\t\t\t'show' => 'Show',\r\n\t\t\t\t\t'hide' => 'Hide',\r\n\t\t\t\t),\r\n\t\t\t),\r\n\t\t),\r\n\t);\r\n\r\n\t$shortcodes[ 'button' ] = array(\r\n\t\t'atts' => array(\r\n\t\t\t'label' => array(\r\n\t\t\t\t'title' => 'Label',\r\n\t\t\t\t'desc' => '',\r\n\t\t\t\t'default' => '',\r\n\t\t\t\t'type' => 'text',\r\n\t\t\t\t'render_as' => 'content',\r\n\t\t\t),\r\n\t\t\t'style' => array(\r\n\t\t\t\t'title' => 'Style',\r\n\t\t\t\t'desc' => '',\r\n\t\t\t\t'default' => 'primary',\r\n\t\t\t\t'type' => 'dropdown',\r\n\t\t\t\t'options' => $button_style_options,\r\n\t\t\t),\r\n\t\t\t'url' => array(\r\n\t\t\t\t'title' => 'Link to Url',\r\n\t\t\t\t'desc' => '',\r\n\t\t\t\t'default' => '',\r\n\t\t\t\t'type' => 'text',\r\n\t\t\t),\r\n\t\t\t'target' => array(\r\n\t\t\t\t'title' => 'Link Target',\r\n\t\t\t\t'desc' => 'The location to open link, enter \"_blank\" for open the link in new window',\r\n\t\t\t\t'default' => '_self',\r\n\t\t\t\t'type' => 'text',\r\n\t\t\t),\r\n\t\t\t'icon' => array(\r\n\t\t\t\t'title' => 'Icon',\r\n\t\t\t\t'desc' => '',\r\n\t\t\t\t'default' => '',\r\n\t\t\t\t'type' => 'icon',\r\n\t\t\t),\r\n\t\t\t'fullwidth' => array(\r\n\t\t\t\t'title' => 'Full Width',\r\n\t\t\t\t'desc' => 'Expand button to fit the container',\r\n\t\t\t\t'default' => 'false',\r\n\t\t\t\t'type' => 'dropdown',\r\n\t\t\t\t'options' => array(\r\n\t\t\t\t\t'false' => 'False',\r\n\t\t\t\t\t'true' => 'True',\r\n\t\t\t\t),\r\n\t\t\t),\r\n\t\t),\r\n\t);\r\n\r\n\t$shortcodes[ 'dropcap' ] = array(\r\n\t\t'atts' => array(\r\n\t\t\t'text' => array(\r\n\t\t\t\t'title' => 'Character',\r\n\t\t\t\t'desc' => 'The character to be a dropcap',\r\n\t\t\t\t'default' => '',\r\n\t\t\t\t'type' => 'text',\r\n\t\t\t\t'render_as' => 'content',\r\n\t\t\t),\r\n\t\t),\r\n\t);\r\n\r\n\t$shortcodes[ 'infobox' ] = array(\r\n\t\t'atts' => array(\r\n\t\t\t'title' => array(\r\n\t\t\t\t'title' => 'Title',\r\n\t\t\t\t'desc' => '',\r\n\t\t\t\t'default' => '',\r\n\t\t\t\t'type' => 'text',\r\n\t\t\t),\r\n\t\t\t'text' => array(\r\n\t\t\t\t'title' => 'Content',\r\n\t\t\t\t'desc' => '',\r\n\t\t\t\t'default' => '',\r\n\t\t\t\t'type' => 'html',\r\n\t\t\t\t'render_as' => 'content',\r\n\t\t\t),\r\n\t\t),\r\n\t);\r\n\r\n\t$shortcodes[ 'mark' ] = array(\r\n\t\t'atts' => array(\r\n\t\t\t'text' => array(\r\n\t\t\t\t'title' => 'Text',\r\n\t\t\t\t'desc' => 'the text to be marked',\r\n\t\t\t\t'default' => '',\r\n\t\t\t\t'type' => 'text',\r\n\t\t\t\t'render_as' => 'content',\r\n\t\t\t),\r\n\t\t),\r\n\t);\r\n\r\n\t$shortcodes[ 'quote' ] = array(\r\n\t\t'atts' => array(\r\n\t\t\t'text' => array(\r\n\t\t\t\t'title' => 'Text',\r\n\t\t\t\t'desc' => '',\r\n\t\t\t\t'default' => '',\r\n\t\t\t\t'type' => 'text',\r\n\t\t\t\t'render_as' => 'content',\r\n\t\t\t),\r\n\t\t\t'cite' => array(\r\n\t\t\t\t'title' => 'Cite',\r\n\t\t\t\t'desc' => '',\r\n\t\t\t\t'default' => '',\r\n\t\t\t\t'type' => 'text',\r\n\t\t\t),\r\n\t\t\t'align' => array(\r\n\t\t\t\t'title' => 'Align',\r\n\t\t\t\t'desc' => '',\r\n\t\t\t\t'default' => 'none',\r\n\t\t\t\t'type' => 'dropdown',\r\n\t\t\t\t'options' => array(\r\n\t\t\t\t\t'none' => 'None',\r\n\t\t\t\t\t'left' => 'Left',\r\n\t\t\t\t\t'right' => 'Right',\r\n\t\t\t\t),\r\n\t\t\t),\r\n\t\t),\r\n\t);\r\n\r\n\t$shortcodes[ 'title' ] = array(\r\n\t\t'atts' => array(\r\n\t\t\t'text' => array(\r\n\t\t\t\t'title' => 'Title',\r\n\t\t\t\t'desc' => 'The title text',\r\n\t\t\t\t'default' => '',\r\n\t\t\t\t'type' => 'text',\r\n\t\t\t\t'render_as' => 'content',\r\n\t\t\t),\r\n\t\t),\r\n\t);\r\n\r\n\tglobal $vwsce;\r\n\t$vwsce->register_shortcodes( $shortcodes );\r\n}",
"function ewd_add_shortcode_button() {\n add_filter('mce_external_plugins', 'ewd_add_tinymce_plugin');\n add_filter('mce_buttons', 'ewd_register_shortcode_button');\n}",
"function add_shortcode_button() {\n\t\t\tif ( ! current_user_can( 'edit_posts' ) && ! current_user_can( 'edit_pages' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( 'true' == get_user_option( 'rich_editing' ) && isset( $this->opt['psforum_shortcodes_posts'] ) && ! empty( $this->opt['psforum_shortcodes_posts'] ) ) {\n\t\t\t\tglobal $current_screen;\n\t\t\t\tif ( ! empty( $current_screen->post_type ) && in_array( $current_screen->post_type, $this->opt['psforum_shortcodes_posts'] ) ) {\n\t\t\t\t\tadd_filter( 'mce_external_plugins', array( $this, 'add_shortcode_tinymce_plugin' ) );\n\t\t\t\t\tadd_filter( 'mce_buttons', array( $this, 'register_shortcode_button' ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"public function add_styling_to_admin_bar_button() {\n echo \"<style type='text/css'> #wpadminbar #wp-admin-bar-trp_edit_translation .ab-icon:before { content: '\\\\f326'; top: 3px;}\n\t\t#wpadminbar #wp-admin-bar-trp_edit_translation > .ab-item {\n\t\t\ttext-indent: 0;\n\t\t}\n\n\t\t#wpadminbar li#wp-admin-bar-trp_edit_translation {\n\t\t\tdisplay: block;\n\t\t}</style>\";\n }",
"public function _shortcode_editor_button() {\r\n echo '<a href=\"#\" class=\"shortcode-trigger\" title=\"' . __('Insert shortcode', 'atom') . '\"><img src=\"' . $this['path']->url('atomicpress:images/media-icon.png') . '\" alt=\"\" /></a>';\r\n }",
"function pg_my_editor_background_color_button( $buttons, $id ){\n\n /* Only add this for content editor, you can remove this line to activate in all editor instance */\n if ( 'content' != $id ) return $buttons;\n\n /* Add the button/option after 4th item */\n array_splice( $buttons, 4, 0, 'backcolor' );\n\n return $buttons;\n}",
"function dfd_native_add_editor_styles() {\n\tadd_editor_style( 'mce-editor-style.css' );\n}",
"function my_mce_buttons_2( $buttons ) {\t\n\t$buttons[] = 'superscript';\n\t$buttons[] = 'subscript';\n\n\treturn $buttons;\n}",
"function hh_register_tinymce_shortcode_buttons( $buttons ) {\n array_push( $buttons, \"|\", \"hh_image\" );\n return $buttons;\n}",
"function add_style_select_buttons( $buttons ) {\n array_unshift( $buttons, 'styleselect' );\n return $buttons;\n}",
"function register_mce_button( $buttons ) {\n array_push( $buttons, 'custom_mce_button' );\n return $buttons;\n}",
"function register_short_code(){\n\t\twp_enqueue_style('cp-shortcode',CP_PATH_URL.'/frontend/shortcodes/css/shortcode.css');\n\t}",
"function my_register_mce_button( $buttons ) {\n\tarray_push( $buttons, 'my_mce_button' );\n\treturn $buttons;\n}",
"function media_buttons( $editor ) {\n\n\t\tprintf( '<span class=\"ra-document-library-%s\">%s</span>', sanitize_html_class( $editor ), self::media_buttons_context( '' ) );\n\n\t}",
"public function svnx_addBtnStyle() {\n\t\t$inlineStyle = \"<style>#wpadminbar .stage-mode-style {background-color:\" . $this->_stageBGColor . \" !important; min-width:160px};</style>\";\n\t\techo $inlineStyle;\n\t}",
"function mayflower_add_editor_styles() {\n add_editor_style( 'css/custom-editor-style.css' );\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test that we can retrieve an instance of \MphpMusicBrainz\Result\Recording when we call current | public function testCurrent()
{
$recordingResultSetAdapter = new \MphpMusicBrainz\Adapter\Xml\ResultSet\RecordingResultSetAdapter($this->xml);
$recording = $recordingResultSetAdapter->current();
$this->assertInstanceOf('MphpMusicBrainz\Result\Recording', $recording);
$this->assertEquals('b4ee83d8-3b33-47cc-b154-e498df2e6c08', $recording->getId());
$this->assertEquals('100', $recording->getScore());
$this->assertEquals('Metal', $recording->getTitle());
} | [
"public function testGetARecording()\n {\n $config = Configuration::getDefaultConfiguration()\n ->setHost('http://127.0.0.1:4010')\n ->setUsername('YOUR_ACCOUNT_ID')\n ->setPassword('YOUR_API_KEY');\n\n\n $apiInstance = new DefaultApi(\n new Client(),\n $config\n );\n\n //$account_id = $account_id_test_value;\n //$recording_id = $recording_id_test_value;\n \n $response = $apiInstance->getARecording($this->recording_id_getARecording_test_value());\n \n \n $this->assertInstanceOf('\\FreeClimb\\Api\\Model\\RecordingResult',$response);\n }",
"function is_recording()\n {\n return is_recording();\n }",
"public function testGetUserrecordingMedia()\n {\n }",
"public function testGetRecordReturnsRecord()\n {\n $retVal = simplexml_load_file($this->getSampleXML('GoodResponseSingleRecord.xml'));\n $client = $this->getMockClient($retVal);\n\n $obj = new Endpoint($client);\n\n $response = $obj->getRecord(\"recordId\", \"metadataPrefix\");\n\n //Check results\n $this->assertInstanceof('SimpleXMLElement', $response);\n $this->assertObjectHasAttribute('GetRecord', $response);\n }",
"public function testGetUserrecording()\n {\n }",
"public function getSoundRecording()\n {\n return $this->soundRecording;\n }",
"public function getRecord()\n {\n return $this->record;\n }",
"public function testGetTitle()\n {\n $recording = new \\MphpMusicBrainz\\Result\\Recording($this->getAdapter());\n\n $this->assertEquals(\"We Will Rock You\", $recording->getTitle());\n }",
"public function setRecording($val)\n {\n $this->_propDict[\"recording\"] = $val;\n return $this;\n }",
"public function testRecordingsGet()\n {\n }",
"public function getRecordingId()\n {\n return $this->recordingId;\n }",
"public function testGetRecordingMediaretentionpolicies()\n {\n }",
"public function testCanConstructInstance()\n {\n $work = new \\MphpMusicBrainz\\Result\\Work($this->getAdapter());\n \n $this->assertInstanceOf('MphpMusicBrainz\\Result\\Work', $work);\n }",
"public function getCurrent()\n {\n }",
"public function get_record()\n {\n //$this->log(__FUNCTION__ . \" called with type {$this->type} = \" . json_encode($this->db->Record), __LINE__, __FILE__, 'debug');\n if ($this->type == 'function') {\n return $this->queries->Record;\n } else {\n return $this->db->Record;\n }\n }",
"public function getRecord();",
"public function testStreamSetGetRecorded()\r\n {\r\n\r\n }",
"public function getRecordInstance()\n {\n if ( ! $this->record) {\n $this->record = new $this->_options['name'];\n }\n return $this->record;\n }",
"public function current() {\n return $this->record;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Getter of Pathophysiology Changes in the normal mechanical, physical, and biochemical functions that are associated with this activity or condition. | public function getPathophysiology()
{
return $this->pathophysiology;
} | [
"public function getAssociatedPathophysiology();",
"public function getChangeConditions()\n {\n return $this->changeConditions;\n }",
"public function getChange(): array\n {\n return $this->change;\n }",
"public function getChanges()\n {\n return $this->changes;\n }",
"function getPriceChanges()\n\t{\n\t\treturn $this->changes;\n\t}",
"public function getPricingComponentValueChanges() {\n\t\treturn $this->pricingComponentValueChanges;\n\t}",
"public function getChangePath()\n {\n return $this->change_path;\n }",
"public function getModifiedPaths()\n {\n return $this->modifiedPaths;\n }",
"public function getFlightChange()\n {\n return $this->flightChange;\n }",
"public function changes()\n {\n $changes = array();\n foreach(array_unique($this->_changed) as $key)\n $changes[$key] = $this->get($key, false);\n\n return $changes;\n }",
"public function getChangedProperties(): array\n {\n return $this->changes;\n }",
"public function getOldChanges()\n {\n return $this->oldChanges;\n }",
"public function getChangeFreq(): string;",
"public function getChange()\n {\n return $this->get(self::_CHANGE);\n }",
"public function getChangeFrequency()\r\n\t{\r\n\t\treturn $this->changeFrequency;\r\n\t}",
"public function getChangedProperties()\n {\n return $this->aChangedProperties;\n }",
"public function getChanged()\n {\n return $this->changed;\n }",
"public function getChangeFrequency()\n {\n return $this->_changeFrequency;\n }",
"public function getNewRelativity()\n\t{\n\t\treturn $this->new_relativity;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get producer information using the producer ID | public function getProducerByID($id) {
$args = func_get_args();
$response = $this->makeRequest('GetProducerByID', $args);
if ($response !== false) {
return $response->response->aml->producers->producer[0];
}
return false;
} | [
"public function getProducerId()\n {\n return $this->producer_id;\n }",
"function getProducerName($conn, $producerID) {\n $query = \"SELECT producer_name FROM producer WHERE producer_id = ${producerID}\";\n $result = mysqli_query($conn, $query);\n if ($result) {\n return mysqli_fetch_assoc($result)['producer_name'];\n } else {\n // error\n return NULL;\n }\n }",
"public function getProducerProductID()\n {\n return $this->producerProductID;\n }",
"public function getProducer(): string\n {\n return \"{$this->producerFirstName} {$this->producerMainName}\";\n }",
"public function getProducer(){\r\n\t\treturn \"{$this->producerFirstName}\".\r\n\t\t\t\t\"{$this->producerMainName}\";\t\r\n\t}",
"public function producerRelationship()\n {\n return $this->hasOne('App\\Producer\\Producer', 'id', 'producer_id');\n }",
"public function getProducerRef()\n {\n return $this->producerRef;\n }",
"public function producer()\n {\n return $this->belongsTo(Producer::class);\n }",
"public function show($id)\n\t{\n\t\t$producer = Producer::findOrFail($id);\n\n\t\treturn View::make('producers.show', compact('producer'));\n\t}",
"public function getProducer() : Producer\n\t{\n\t\tif (!$this->producer)\n\t\t{\n\t\t\t$this->producer = $this->context->createProducer();\n\t\t}\n\n\t\treturn $this->producer;\n\t}",
"public function getProducerProjectId()\n {\n return $this->producer_project_id;\n }",
"function addProducer() {\n // This line may only be changed by Bruno Lowagie, Mills Staylor or Paulo Soares\n put(PdfName::$PRODUCER, new PdfString(getVersion()));\n // Do not edit the line above!\n }",
"public function setProducer($var)\n {\n GPBUtil::checkString($var, True);\n $this->producer = $var;\n\n return $this;\n }",
"public function producer()\n {\n $this->belongsTo('App\\Producer');\n }",
"public function getProducer(Movie $movie)\n {\n $people = $movie->producer()->get();\n return $this->showAll($people);\n }",
"function prepare_movie_producer( $producer, $context = 'edit' ) {\n\n\treturn prepare_movie_meta_values( 'producer', $producer, $context );\n}",
"public function setProducerId($producer_id)\n {\n $this->producer_id = $producer_id;\n\n return $this;\n }",
"public function getAssociationHasProducerByProducer(Producer $producer)\n {\n foreach($this->getAssociationHasProducer() as $associationHasProducer) {\n if (null !== $producer->getId()) {\n if ($associationHasProducer->getProducer()->getId() === $producer->getId()) {\n return $associationHasProducer;\n }\n }\n elseif ($associationHasProducer->getProducer() === $producer) {\n return $associationHasProducer;\n }\n }\n\n return null;\n }",
"public function fetch($printer_id) {\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests the exposed filter works. There is an exposed filter on the title field which takes a title query parameter. This is set to filter nodes by those whose title starts with the value provided. | public function testRestViewExposedFilter() {
$this->drupalCreateContentType(['type' => 'page']);
$node0 = $this->drupalCreateNode(['title' => 'Node 1']);
$node1 = $this->drupalCreateNode(['title' => 'Node 11']);
$node2 = $this->drupalCreateNode(['title' => 'Node 111']);
// Test that no filter brings back all three nodes.
$result = Json::decode($this->drupalGet('test/serialize/node-exposed-filter', ['query' => ['_format' => 'json']]));
$expected = [
0 => [
'nid' => $node0->id(),
'body' => $node0->body->processed,
],
1 => [
'nid' => $node1->id(),
'body' => $node1->body->processed,
],
2 => [
'nid' => $node2->id(),
'body' => $node2->body->processed,
],
];
$this->assertEquals($expected, $result, 'Querying a view with no exposed filter returns all nodes.');
// Test that title starts with 'Node 11' query finds 2 of the 3 nodes.
$result = Json::decode($this->drupalGet('test/serialize/node-exposed-filter', ['query' => ['_format' => 'json', 'title' => 'Node 11']]));
$expected = [
0 => [
'nid' => $node1->id(),
'body' => $node1->body->processed,
],
1 => [
'nid' => $node2->id(),
'body' => $node2->body->processed,
],
];
$cache_contexts = [
'languages:language_content',
'languages:language_interface',
'theme',
'request_format',
'user.node_grants:view',
'url',
];
$this->assertEquals($expected, $result, 'Querying a view with a starts with exposed filter on the title returns nodes whose title starts with value provided.');
$this->assertCacheContexts($cache_contexts);
} | [
"public function filter_title()\n {\n }",
"public function testQueryByTitle()\n {\n //Given we have books in the database\n $book = factory('App\\Book')->create();\n $bookTwo = factory('App\\Book')->create();\n $bookThree = factory('App\\Book')->create();\n // When the user searches an author of one book\n $response = $this->get('/api/books/query?search=' . $book -> title);\n //Then I should see only the searche author\n $response\n ->assertStatus(200) \n ->assertSee($book->title)\n ->assertSee($book->author)\n ->assertDontSee($bookTwo->title)\n ->assertDontSee($bookTwo->author)\n ->assertDontSee($bookThree->title)\n ->assertDontSee($bookThree->author);\n \n }",
"public function testSelectByTitle() {\n $_GET['s'] = 'First test';\n $result = campaignion_wizard_search_nodes();\n $this->assertEqual([\n [\n 'value' => \"node/{$this->nodes[0]->nid}\",\n 'label' => \"First test node [{$this->nodes[0]->nid}]\",\n ],\n ], $result['values']);\n }",
"public function test_that_api_will_search_in_title()\n {\n $title = Movie::value('title');\n\n $response = $this->json('GET', '/api/movies/list-of-movies', ['q' => $title]);\n\n $response->assertStatus(Response::HTTP_OK);\n $response->assertJsonFragment(['title' => $title]);\n }",
"public function setTitleFilter($titleFilter) {\n $this->titleFilter = \"%\" . $titleFilter . \"%\"; // add percent signs because this is used in LIKE in MySQL queries\n }",
"public function test_searching_title() {\n\t\t$results = new \\SWP_Query( [\n\t\t\t's' => 'attributetitle',\n\t\t\t'fields' => 'ids',\n\t\t] );\n\n\t\t$this->assertEquals( 1, count( $results->posts ) );\n\t\t$this->assertArrayHasKey( 0, $results->posts );\n\t\t$this->assertContains( $results->posts[0], self::$post_ids );\n\n\t\t// Test that a title search returns no results.\n\t\t$results = new \\SWP_Query( [\n\t\t\t's' => 'noattributetitle',\n\t\t\t'fields' => 'ids',\n\t\t] );\n\n\t\t$this->assertEquals( 0, count( $results->posts ) );\n\n\t\t// Test that an engine with no Title attribute returns no results.\n\t\t$query = new \\SearchWP\\Query( 'attributetitle', [\n\t\t\t'engine' => 'postsnotitle',\n\t\t\t'fields' => 'ids',\n\t\t] );\n\n\t\t$this->assertEquals( 0, count( $query->results ) );\n\n\t\t// Test that an engine with no Posts Source returns no results.\n\t\t$query = new \\SearchWP\\Query( 'attributetitle', [\n\t\t\t'engine' => 'noposts',\n\t\t\t'fields' => 'ids',\n\t\t] );\n\n\t\t$this->assertEquals( 0, count( $query->results ) );\n\t}",
"function test_unique_filter_on_post_title() {\n\t\tself::clear_get_values();\n\t\t$post_view = self::get_view_by_key( 'create-a-post-view' );\n\n\t\t$filter_args = array(\n\t\t\tarray( 'type' => 'field',\n\t\t\t\t'col' => 'yi6yvm',\n\t\t\t\t'op' => 'group_by',\n\t\t\t\t'val' => '',\n\t\t\t),\n\t\t);\n\t\tself::add_filter_to_view( $post_view, $filter_args );\n\n\t\t$d = self::get_default_args( $post_view, array( 'Jamie', 'Dragon' ), array() );\n\n\t\tself::run_get_display_data_tests( $d, 'unique filter with post title' );\n\t}",
"public function testExposedFilter() {\n $node_type = $this->drupalCreateContentType(['type' => 'page']);\n\n // Create the tag field itself.\n $field_name = 'taxonomy_tags';\n $this->createEntityReferenceField('node', $node_type->id(), $field_name, NULL, 'taxonomy_term');\n\n // Create 4 nodes: 1 without a term, 2 with the same term, and 1 with a\n // different term.\n $node1 = $this->drupalCreateNode();\n $node2 = $this->drupalCreateNode([\n $field_name => [['target_id' => $this->terms[1][0]->id()]],\n ]);\n $node3 = $this->drupalCreateNode([\n $field_name => [['target_id' => $this->terms[1][0]->id()]],\n ]);\n $node4 = $this->drupalCreateNode([\n $field_name => [['target_id' => $this->terms[2][0]->id()]],\n ]);\n\n // Only the nodes with the selected term should be shown.\n $this->drupalGet('test-filter-taxonomy-index-tid');\n $this->assertSession()->pageTextNotContains($node1->getTitle());\n $this->assertSession()->linkByHrefNotExists($node1->toUrl()->toString());\n $xpath_node2_link = $this->assertSession()->buildXPathQuery('//div[@class=\"views-row\"]//a[@href=:url and text()=:label]', [\n ':url' => $node2->toUrl()->toString(),\n ':label' => $node2->label(),\n ]);\n $this->assertSession()->elementsCount('xpath', $xpath_node2_link, 1);\n $xpath_node3_link = $this->assertSession()->buildXPathQuery('//div[@class=\"views-row\"]//a[@href=:url and text()=:label]', [\n ':url' => $node3->toUrl()->toString(),\n ':label' => $node3->label(),\n ]);\n $this->assertSession()->elementsCount('xpath', $xpath_node3_link, 1);\n $this->assertSession()->pageTextNotContains($node4->getTitle());\n $this->assertSession()->linkByHrefNotExists($node4->toUrl()->toString());\n\n // Expose the filter.\n $this->drupalGet('admin/structure/views/nojs/handler/test_filter_taxonomy_index_tid/default/filter/tid');\n $this->submitForm([], 'Expose filter');\n // Set the operator to 'empty' and remove the default term ID.\n $this->submitForm([\n 'options[operator]' => 'empty',\n 'options[value][]' => [],\n ], 'Apply');\n // Save the view.\n $this->submitForm([], 'Save');\n\n // After switching to 'empty' operator, the node without a term should be\n // shown.\n $this->drupalGet('test-filter-taxonomy-index-tid');\n $xpath_node1_link = $this->assertSession()->buildXPathQuery('//div[@class=\"views-row\"]//a[@href=:url and text()=:label]', [\n ':url' => $node1->toUrl()->toString(),\n ':label' => $node1->label(),\n ]);\n $this->assertSession()->elementsCount('xpath', $xpath_node1_link, 1);\n $this->assertSession()->pageTextNotContains($node2->getTitle());\n $this->assertSession()->linkByHrefNotExists($node2->toUrl()->toString());\n $this->assertSession()->pageTextNotContains($node3->getTitle());\n $this->assertSession()->linkByHrefNotExists($node3->toUrl()->toString());\n $this->assertSession()->pageTextNotContains($node4->getTitle());\n $this->assertSession()->linkByHrefNotExists($node4->toUrl()->toString());\n\n // Set the operator to 'not empty'.\n $this->drupalGet('admin/structure/views/nojs/handler/test_filter_taxonomy_index_tid/default/filter/tid');\n $this->submitForm(['options[operator]' => 'not empty'], 'Apply');\n // Save the view.\n $this->submitForm([], 'Save');\n\n // After switching to 'not empty' operator, all nodes with terms should be\n // shown.\n $this->drupalGet('test-filter-taxonomy-index-tid');\n $this->assertSession()->pageTextNotContains($node1->getTitle());\n $this->assertSession()->linkByHrefNotExists($node1->toUrl()->toString());\n $xpath_node2_link = $this->assertSession()->buildXPathQuery('//div[@class=\"views-row\"]//a[@href=:url and text()=:label]', [\n ':url' => $node2->toUrl()->toString(),\n ':label' => $node2->label(),\n ]);\n $this->assertSession()->elementsCount('xpath', $xpath_node2_link, 1);\n $xpath_node3_link = $this->assertSession()->buildXPathQuery('//div[@class=\"views-row\"]//a[@href=:url and text()=:label]', [\n ':url' => $node3->toUrl()->toString(),\n ':label' => $node3->label(),\n ]);\n $this->assertSession()->elementsCount('xpath', $xpath_node3_link, 1);\n $xpath_node4_link = $this->assertSession()->buildXPathQuery('//div[@class=\"views-row\"]//a[@href=:url and text()=:label]', [\n ':url' => $node4->toUrl()->toString(),\n ':label' => $node4->label(),\n ]);\n $this->assertSession()->elementsCount('xpath', $xpath_node4_link, 1);\n\n // Select 'Term ID' as the field to be displayed.\n $edit = ['name[taxonomy_term_field_data.tid]' => TRUE];\n $this->drupalGet('admin/structure/views/nojs/add-handler/test_taxonomy_term_name/default/field');\n $this->submitForm($edit, 'Add and configure fields');\n // Select 'Term' and 'Vocabulary' as filters.\n $edit = [\n 'name[taxonomy_term_field_data.tid]' => TRUE,\n 'name[taxonomy_term_field_data.vid]' => TRUE,\n ];\n $this->drupalGet('admin/structure/views/nojs/add-handler/test_taxonomy_term_name/default/filter');\n $this->submitForm($edit, 'Add and configure filter criteria');\n // Select 'Empty Vocabulary' and 'Autocomplete' from the list of options.\n $this->drupalGet('admin/structure/views/nojs/handler-extra/test_taxonomy_term_name/default/filter/tid');\n $this->submitForm([], 'Apply and continue');\n // Expose the filter.\n $edit = ['options[expose_button][checkbox][checkbox]' => TRUE];\n $this->drupalGet('admin/structure/views/nojs/handler/test_taxonomy_term_name/default/filter/tid');\n $this->submitForm($edit, 'Expose filter');\n $this->drupalGet('admin/structure/views/nojs/handler/test_taxonomy_term_name/default/filter/tid');\n $this->submitForm($edit, 'Apply');\n // Filter 'Taxonomy terms' belonging to 'Empty Vocabulary'.\n $edit = ['options[value][empty_vocabulary]' => TRUE];\n $this->drupalGet('admin/structure/views/nojs/handler/test_taxonomy_term_name/default/filter/vid');\n $this->submitForm($edit, 'Apply');\n $this->drupalGet('admin/structure/views/view/test_taxonomy_term_name/edit/default');\n $this->submitForm([], 'Save');\n $this->submitForm([], 'Update preview');\n $this->assertSession()->pageTextNotContains($node1->getTitle());\n $this->assertSession()->linkByHrefNotExists($node1->toUrl()->toString());\n $this->assertSession()->pageTextNotContains($node2->getTitle());\n $this->assertSession()->linkByHrefNotExists($node2->toUrl()->toString());\n $this->assertSession()->pageTextNotContains($node3->getTitle());\n $this->assertSession()->linkByHrefNotExists($node3->toUrl()->toString());\n $this->assertSession()->pageTextNotContains($node4->getTitle());\n $this->assertSession()->linkByHrefNotExists($node4->toUrl()->toString());\n $this->assertSession()->elementNotExists('xpath', \"//div[@class='views-row']\");\n }",
"public function testTitles() {\n\t\t$this->assertTrue($this->get($this->testhost.'titleslist/0/'));\n\t\t$this->assertTitle('BicBucStriim :: Books');\n\t}",
"public function testFilters() {\n // Test the title filter page, which filters for title contains 'Comida'.\n // Should show just the Spanish translation, once.\n $this->assertPageCounts('test-title-filter', ['es' => 1, 'fr' => 0, 'en' => 0], 'Comida title filter');\n\n // Test the body filter page, which filters for body contains 'Comida'.\n // Should show just the Spanish translation, once.\n $this->assertPageCounts('test-body-filter', ['es' => 1, 'fr' => 0, 'en' => 0], 'Comida body filter');\n\n // Test the title Paris filter page, which filters for title contains\n // 'Paris'. Should show each translation once.\n $this->assertPageCounts('test-title-paris', ['es' => 1, 'fr' => 1, 'en' => 1], 'Paris title filter');\n\n // Test the body Paris filter page, which filters for body contains\n // 'Paris'. Should show each translation once.\n $this->assertPageCounts('test-body-paris', ['es' => 1, 'fr' => 1, 'en' => 1], 'Paris body filter');\n }",
"public function testWPQuerySearchTitle() {\n\t\t$post_ids = array();\n\n\t\t$post_ids[0] = ep_create_and_sync_post();\n\t\t$post_ids[1] = ep_create_and_sync_post();\n\t\t$post_ids[2] = ep_create_and_sync_post( array( 'post_title' => 'findme test' ) );\n\t\t$post_ids[3] = ep_create_and_sync_post( array( 'post_title' => 'findme test2' ) );\n\t\t$post_ids[4] = ep_create_and_sync_post( array( 'post_title' => 'findme test2' ) );\n\n\t\tep_refresh_index();\n\n\t\t$args = array(\n\t\t\t's' => 'findme',\n\t\t);\n\n\t\tadd_action( 'ep_wp_query_search', array( $this, 'action_wp_query_search' ), 10, 0 );\n\n\t\t$query = new WP_Query( $args );\n\n\t\t$this->assertTrue( ! empty( $this->fired_actions['ep_wp_query_search'] ) );\n\n\t\t$this->assertEquals( $query->post_count, 3 );\n\t\t$this->assertEquals( $query->found_posts, 3 );\n\t}",
"public function testShowTitle() {\n $this->createFacet('Llama', 'llama', 'type', static::VIEW_DISPLAY);\n $this->drupalGet(static::VIEW_URL);\n $this->assertSession()->pageTextNotContains('Llama');\n\n $this->updateFacet('llama', ['show_title' => TRUE]);\n\n $this->drupalGet(static::VIEW_URL);\n $this->assertSession()->responseContains('<h3>Llama</h3>');\n $this->assertSession()->pageTextContains('Llama');\n }",
"public function testIndexTitle()\n {\n\n // Add a public exhibit.\n $exhibit = $this->_exhibit(true);\n\n // Add a page with a title.\n $page = $this->_exhibitPage($exhibit, 'title');\n\n // Get the Solr document for the page.\n $document = $this->_getRecordDocument($page);\n\n // Should index the URL.\n $this->assertEquals('title', $document->title);\n\n }",
"public function testLinksWithExposedFilter() {\n $view = View::load('search_api_test_view');\n $display = $view->getDisplay('page_1');\n $display['display_options']['filters']['search_api_fulltext']['expose']['required'] = TRUE;\n $view->save();\n\n $this->createFacet('owl');\n $this->drupalGet('search-api-test-fulltext');\n\n $page = $this->getSession()->getPage();\n $block_owl = $page->findById('block-owl-block');\n $block_owl->isVisible();\n\n $this->assertSession()->fieldExists('edit-search-api-fulltext')->setValue('baz');\n $this->click('.form-submit');\n $this->assertSession()->assertWaitOnAjaxRequest();\n $this->assertSession()->pageTextContains('Displaying 3 search results');\n\n $this->clickLink('item');\n $this->assertSession()->assertWaitOnAjaxRequest();\n $this->assertSession()->pageTextContains('Displaying 1 search results');\n }",
"function test_general_entries_search_on_post_title() {\n\t\t$search_string = \"Jamie's\";\n\t\t$items = self::generate_and_run_search_query( 'create-a-post', $search_string );\n\t\t$msg = 'A general search for ' . $search_string . ' in posts table';\n\t\tself::run_entries_found_tests( $msg, $items, 2, array( 'post-entry-1', 'post-entry-3' ) );\n\t}",
"public function testNameFilter(){\n $this->item->setName('<p>abc</p>');\n \n $this->assertEquals($this->item->getName(), 'abc');\n }",
"public function testCidadeWithTitleFilter()\n {\n $res = $this->dm->loadWithParams(\n $filters = [\n 'title' => 'Recepcionista',\n 'description' => '',\n 'cidade' => 'Joinville',\n ],\n $order = [\n 'order' => '',\n 'field' => '',\n ]\n );\n\n $this->assertEquals(2, count($res));\n }",
"public function testSearchTitles()\n {\n\n $exhibit1 = $this->_exhibit(true, 'exhibit1', 'e1');\n $exhibit2 = $this->_exhibit(true, 'exhibit2', 'e2');\n\n $_GET['q'] = 'exhibit1';\n $this->dispatch('solr-search');\n\n // Should match exhibit 1, but not exhibit 2.\n $this->_assertResultLink(record_url($exhibit1), 'exhibit1');\n $this->_assertNotResultLink(record_url($exhibit2));\n\n }",
"public function testSearchBookHasInputValueSelectTitle()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs($this->user)\n ->visit('/admin/books')\n ->resize(1200,1600)\n ->assertSee('List Books')\n ->type('search', 'Java')\n ->select('filter', 'title')\n ->click('#btn-search')\n ->visit('/admin/books?search=Java&filter=title')\n ->assertQueryStringHas('search', 'Java')\n ->assertQueryStringHas('filter', 'title');\n $elements = $browser->elements('#list-books tbody tr');\n $this->assertCount(1, $elements);\n });\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get EmpService list by servicr type, you can set service_type to "All" to get all type of sercive | public function getEmpServiceList(Request $request){
//parameter verify
$validator = Validator::make($request->all(),
[
'service_type' => 'required',
],
[
'required' => ResultCode::_999001_requestParameterLostOrIncorrect
]
);
if ($validator->fails()) {
return response()->json(['result_code'=>$validator->errors()->first(),
'message'=>CommonUtil::getMessageContentByCode($validator->errors()->first())], 200);
}
$serviceType = $request->service_type;
$serviceList = $this->empService->getEmpServiceList($serviceType);
return $serviceList;
} | [
"public function getServiceByServiceType($serviceType){\n $query = $this->serviceId->where('active','Y');\n if(strtolower($serviceType) == 'all'){\n $query = $query->orderby('type');\n }else{\n $query = $query->where('type',$serviceType);\n }\n return $query->select('row_id', 'service_id', 'type', 'active')->get();\n }",
"public function getAllServiceTypes() {\n return $this->getAdapter()->fetchAll(\"SELECT servicetypeId FROM restaurant_servicetype WHERE restaurantId = \" . $this->getId());\n }",
"public static function getListServices(){\n $sql = new Sql();\n $res = $sql->select('SELECT * FROM servicos WHERE id_empresa = :id_empresa',array(':id_empresa'=> UIDEMPRESA ));\n if(count($res)>0){\n return $res;\n }else{\n return 0;\n }\n }",
"public function getStaffServices( $type = Service::TYPE_SIMPLE )\n {\n $result = array();\n\n if ( $this->getId() ) {\n $staff_services = StaffService::query( 'ss' )\n ->select( 'ss.*, s.title, s.duration, s.price AS service_price, s.color, s.capacity_min AS service_capacity_min, s.capacity_max AS service_capacity_max' )\n ->leftJoin( 'Service', 's', 's.id = ss.service_id' )\n ->where( 'ss.staff_id', $this->getId() )\n ->where( 's.type', $type )\n ->fetchArray();\n\n foreach ( $staff_services as $data ) {\n $ss = new StaffService( $data );\n\n // Inject Service entity.\n $ss->service = new Service();\n $ss->service\n ->setId( $data['service_id'] )\n ->setTitle( $data['title'] )\n ->setColor( $data['color'] )\n ->setDuration( $data['duration'] )\n ->setPrice( $data['service_price'] )\n ->setCapacityMin( $data['service_capacity_min'] )\n ->setCapacityMax( $data['service_capacity_max'] );\n\n $result[] = $ss;\n }\n }\n\n return $result;\n }",
"public function getServicesByCompany($company){\n\t\n\t\t$em = $this->getEntityManager();\n\t\t\n\t\t$dql = \"select a from MDWDemoBundle:servicestocompanies a where a.idCompany=:idcompany\";\t\t\n\t\t\n\t\t$query = $em->createQuery($dql);\n\t\t$query->setParameter('idcompany', $company);\n\n\t\t$services = $query->getResult();\n\t\t\n\t\treturn $services;\n\t\n\t}",
"public static function service_type_list()\r\n {\r\n $result = db::sql(\"SELECT id, type FROM `tl_services_type`;\", DB_NAME);\r\n $service_type_list = null;\r\n if (mysqli_num_rows($result)){\r\n while(list($id, $type)=mysqli_fetch_array($result)){\r\n $service_type_list[] = array('id'=>$id, 'type'=>$type);\r\n }\r\n } return $service_type_list;\r\n }",
"function discovery_get_service_by_type($services, $type) {\n $matches = array();\n \n foreach ($services as $service) {\n foreach ($service['type'] as $service_type) {\n if ($service_type == $type) $matches[] = $service;\n }\n }\n return $matches;\n}",
"public function getServiceEscalations()\n {\n $l_return = [];\n $l_result = $this->retrieve('SELECT isys_nagios_service_escalations__id AS id, isys_nagios_service_escalations__title AS title FROM isys_nagios_service_escalations;');\n\n if (count($l_result) > 0)\n {\n while ($l_row = $l_result->get_row())\n {\n $l_return[] = $l_row;\n } // while\n } // if\n\n return $l_return;\n }",
"public function getServiceListByType($serviceType){\n return $this->serviceIDRepository->getServiceListByType($serviceType);\n }",
"public function list_service_empleados($idService,$idsede) {\n \n /*Recupera los empleados que atienden el servicio*/\n $query = $this->db->query(\"SELECT\n e.idEmpleadoServicio,\n e.idEmpleado,\n concat(a.nombre,' ',a.apellido) as nombreEmpleado,\n e.idServicio\n FROM\n empleados_servicio e\n JOIN app_usuarios a ON a.idUsuario = e.idEmpleado\n WHERE e.idServicio = \".$idService.\"\n AND a.idTipoUsuario = 1\n AND a.idSede = \".$idsede.\"\n ORDER BY 2\");\n \n if ($query->num_rows() == 0) {\n \n return false;\n \n } else {\n \n return $query->result_array();\n \n }\n \n }",
"public function getEmployeeService(){\n\t\tif(! empty($_SESSION['user_id'])) $uid = $_SESSION['user_id'];\n\t\telse $uid = \"\";\n\t\treturn($this->employeesDAO->getEmployeeService($uid));\n\t}",
"public function listServices();",
"function getServicesByFilter($filter) {\n\t\tif (!count($filter)) { \n\t\t\treturn NULL;\t\n\t\t}\n\t\t\n\t\t$appEntPropIDs = $this->get_propertyIDs(SERVICE_STATUS);\n\t\n\t\t// TODO: move this into a utility function?\n\t\t// Get all of the properties from the property table that match this ent/app type.\n\t\t$query = \"SELECT * FROM PropertyType WHERE (\";\n\t\t$size = count($appEntPropIDs);\n\t\tfor ($counter = 0; $counter < $size; $counter++) {\n\t\t\t$query .= \"PropertyTypeID = '\".$appEntPropIDs[$counter].\"'\";\n\t\t\tif ($counter < $size - 1)\n\t\t\t\t$query .= \" OR \";\n\t\t\telse \n\t\t\t\t$query .= \")\";\n\t\t}\n\t\t\n\t\t$propList = $this->dbInstance->selectQuery($query);\n\t\t$targetProps = $this->getTargetProperties($propList);\n\n\t\t$svcStatusFields = array(\"StateTypeID\",\"CheckTypeID\",\"LastHardStateID\",\"MonitorStatusID\",\"HostID\",\"ApplicationTypeID\",\"ServiceDescription\");\n\t\t\n\t\t/* Let's call our new filter method */\n\t\t$querySubset = $filter->createQuery(\"ServiceStatus\", $svcStatusFields, \"ServiceStatusProperty\", $targetProps);\n\t\t\n\t\t// only fields from the ServiceStatus table, no ServiceStatusProperty fields requested\n\t\tif (stripos($querySubset, \"ServiceStatusProperty\") === false)\n\t\t\t$query = \"SELECT DISTINCT ServiceStatus.ServiceStatusID FROM ServiceStatus WHERE \" . $querySubset;\n\t\t// only fields from the ServiceStatusProperty table, no ServiceStatus fields requested\n\t\telse if (stripos($querySubset, \"ServiceStatus\") === false)\n\t\t\t$query = \"SELECT DISTINCT ServiceStatusProperty.ServiceStatusID FROM ServiceStatusProperty WHERE \" . $querySubset;\n\t\t// fields from both ServiceStatusProperty and ServiceStatus were requested\n\t\telse\n\t\t\t$query = \"SELECT DISTINCT ServiceStatusProperty.ServiceStatusID FROM ServiceStatus, ServiceStatusProperty WHERE ServiceStatus.ServiceStatusID = ServiceStatusProperty.ServiceStatusID AND \" . $querySubset;\n\t\t//print(\"<br/>FINAL QUERY\" . $query);\n\t\t\n\t\t$services = $this->dbInstance->selectQuery($query);\n\t\t// return the serviceStatus's.\n\t\treturn $services;\n\t}",
"public function getServices(string $type): array\n {\n return $this->services[$type] ?? [];\n }",
"public function getServices($id) {\n $dql = \"SELECT se FROM Service se\n JOIN se.serviceType st\n WHERE st.id = :id\";\n $services = $this->em->createQuery($dql)\n ->setParameter('id', $id)\n ->getResult();\n return $services;\n }",
"public function getServicesList() {\n\t\t$query = \"SELECT * FROM services\";\n\t\t$results = $this->link->query($query) or die($this->link->error.__LINE__);\n\t\tif($results->num_rows > 0) {\n \t\treturn $results;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public static function getServices()\n {\n \t$results = array();\n \t$services = auth()->user()->accounts()->select('service_id')->groupBy('service_id')->get();\n\n\t\tforeach($services as $service) {\n\t\t\tarray_push($results, Service::find($service->service_id));\n\t\t}\n\n\t\treturn $results;\n }",
"protected function getAllServices()\n {\n \tif (is_null($this->_services))\n \t{\n \t\t$this->_services = array();\n \t\t/* @var $serviceCollection Gareth_RoyalMail2_Model_Mysql4_Service_Collection */\n\t \t$serviceCollection = Mage::getModel('gareth_royalmail2/service')->getCollection();\n\t \t/* @var $service Gareth_RoyalMail2_Model_Service */\n\t \tforeach ($serviceCollection as $service)\n\t \t{\n\t \t\t$this->_services[$service->getId()] = $service;\n\t \t}\n \t}\n \treturn $this->_services;\n }",
"public function findServices(): array;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fetch the valUrl of a news for the language switcher. | public function getValUrl($id, $lang = 1){
$select = $this->_db->select();
$select->from('NewsIndex','NI_ValUrl')
->where("NI_NewsDataID = ?", $id)
->where("NI_LanguageID = ?", $lang);
$valUrl = $this->_db->fetchOne($select);
return $valUrl;
} | [
"abstract public function get_language_url($language = null, $url = null);",
"function getMultiUrls(){\n $multiUrls = NULL;\n $SysLang = check_init('SysLang', 'SysLang', 'NULL, \"front\"');\n $mas_lang = $SysLang->GetLangData($this->lang_id, 'front');\n foreach($mas_lang as $k=>$v){\n if($v['cod']==$this->lang_id){\n $multiUrls[$SysLang->GetLangShortName($v['cod'])] = $this->Link($this->id_cat, $this->id);\n }else{\n //создавать нужно именно новый обьект, чтобы сформировать в нем новые массивы с данными на нужной языковой версии.\n $News = new News($v['cod']);\n $multiUrls[$SysLang->GetLangShortName($v['cod'])] = $News->Link($this->id_cat, $this->id, $v['cod']);\n unset($News);\n }\n }\n //var_dump($multiUrls);\n return $multiUrls;\n }",
"private function extractNewsLanguages()\n {\n $html = getSimpleHTMLDOMCached('https://www.desouttertools.com/about-desoutter/news-events');\n\n $html = defaultLinkTo($html, static::URI);\n\n $items = $html->find('ul[class=\"dropdown-menu\"] li');\n\n $list = \"\\t'Corporate'\\n\\t=> 'https://www.desouttertools.com/about-desoutter/news-events',\\n\";\n\n foreach ($items as $item) {\n $lang = trim($item->plaintext);\n $uri = $item->find('a', 0)->href;\n\n $list .= \"\\t'{$lang}'\\n\\t=> '{$uri}',\\n\";\n }\n\n echo $list;\n }",
"function get_url(){\n\t\treturn $this->url;\n\t}",
"function get_feed_url(){\n $product = $this->options['brafton_domain'];\n $key = $this->options['brafton_api_key'];\n\n $feed_url = \"http://\" . $product . $key . '/news';\n return $feed_url;\n }",
"private function getVoUrl()\r\n\t{ \r\n\t\treturn ( $this->hasVo )\r\n\t\t\t? \"http://www.servcorp.co.jp/$this->lang/virtual-offices/locations/$this->city/$this->url/\"\r\n\t\t\t: \"http://www.coworking-ikebukuro.jp/\";\r\n\t}",
"abstract public function getListeUrl();",
"public function getTopic_Url(){\r\n $this->initDb();\r\n if($this->topic_id != \"\"){\r\n $this->topic_url = urldecode(getValue(\"SELECT topic_url FROM tbl_topics WHERE topic_id = \" . $this->topic_id));\r\n }\r\n return $this->topic_url;\r\n }",
"function cai_2012_get_url($nid_en) {\n global $language;\n $lang_code = $language->language;\n $nid_local = $nid_en;\n $url = '/';\n if ($lang_code == 'en') {\n $url .= drupal_get_path_alias(\"node/$nid_local\", $lang_code);\n } else {\n $translations = translation_node_get_translations($nid_en);\n if (array_key_exists($lang_code, $translations)) {\n $nid_local = $translations[$lang_code]->nid;\n $url .= \"$lang_code/\";\n $url .= drupal_get_path_alias(\"node/$nid_local\", $lang_code);\n } else {\n $url = '#';\n }\n }\n return $url;\n}",
"public function downloadnl()\n {\n return $this->getUrl('*/*/downloadnl');\n }",
"function local_mediacore_fetch_lti_baseurl() {\n global $DB;\n $record = $DB->get_record('config_plugins', array(\n 'plugin' => MEDIACORE_LOCAL_COURSELTI_SETTING_NAME,\n 'name' => 'mediacore_url',\n ));\n if (empty($record) || empty($record->value)) {\n return 'http://demo.mediacore.tv'; //default\n }\n return $record->value;\n}",
"function getURL()\n {\n return $this->newsroom->getURL().'/'.$this->id;\n }",
"protected function _detectViewAllUrl() {\n\n\n $allUrl = null;\n if (isset($this->params[PARM_NewsPlus_Topic_ID])\n && defined('NEWSPLUS_USE_TOPIC_DEPENDENT_URLS')\n && NEWSPLUS_USE_TOPIC_DEPENDENT_URLS\n )\n $allUrl = $this->manager->getUrlForAllInTopic($this->params[PARM_NewsPlus_Topic_ID]);\n\n $setOptions = array(\n PARM_lang => cLangEssentials::getInstance()->getLang(),\n );\n\n if (empty($allUrl)) {\n $resetOptions = array(PARM_all);\n if (defined('NEWS_PLUS_MOUNTPOINT')) {\n $setOptions[PARM_structure_location] = NEWS_PLUS_MOUNTPOINT;\n $setOptions[PARM_structure_version] = PARMVAL_structure_version_default;\n if (isset($this->params[PARM_NewsPlus_Topic_ID])\n && defined(NEWSPLUS_USE_TOPICS) && NEWSPLUS_USE_TOPICS)\n $setOptions[PARM_NewsPlus_Topic_ID] = $this->params[PARM_NewsPlus_Topic_ID];\n } else {\n $setOptions[PARM_structure_location] = NEWSPLUS_SISTESPEC_VIEWALL_LOCATION;\n $setOptions[PARM_structure_version] = NEWSPLUS_SISTESPEC_VIEWALL_VERSION;\n }\n $allUrl = new cURLWithOptions(\n PATH_APPLICATION,\n $setOptions,\n $resetOptions\n );\n }\n\n return $allUrl;\n }",
"public function getCataloguePageUrl();",
"function getLanguageLinks() {\r\n\t\t$url = $_SERVER ['PHP_SELF'];\r\n\t\t\r\n\t\tif (Input::get('categoryid') != '') {\r\n\t\t\t$url = $url . \"?categoryid=\" . Input::get('categoryid') . \"&lan=\";\r\n\t\t\t\r\n\t\t}elseif (Input::get('todo') != ''){\r\n\t\t\t\r\n\t\t\tif(Input::get('step') != ''){\r\n\t\t\t\t$url = $url . \"?todo=\" . Input::get('todo') . \"&step=\" . Input::get('step') . \"&lan=\";\r\n\t\t\t}else{\r\n\t\t\t\t$url = $url . \"?todo=\" . Input::get('todo') . \"&lan=\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\t$url = $url . \"?lan=\";\r\n\t\t}\r\n\t\t\r\n\t\techo '<a href=\"' . $url . 'de\">DE</a>';\r\n\t\techo ' | ';\r\n\t\techo '<a href=\"' . $url . 'en\">EN</a>';\r\n\t\t\r\n\t\t$this->importLangFile ();\r\n\t}",
"public function getLanguageUrl()\n {\n // extract the request parameters\n parse_str($this->getRequest()->getQueryString(), $params);\n // load the default system locale\n $defaultLocale = $this->getApp()->getDefaultLocale();\n // initialize the new locale with the default locale\n $newLocale = $defaultLocale->__toString();\n // if the default is active, set the GERMANY\n if ($this->getSystemLocale()->equals($defaultLocale)) {\n $newLocale = TechDivision_Util_SystemLocale::GERMANY;\n }\n // replace/append the one from the Request\n $params[TDProject_Application::LOCALE] = $newLocale;\n // return the URL to switch the system locale\n return $this->getUrl($params);\n }",
"private function collectUrlFromProduct() {\n\t\t\t$urlArray = array();\n\t\t\t\n\t\t\t$sql = \"select p.productid, pd.languageid\n\t\t\t\tFROM \t`product` p INNER JOIN `product_description` pd ON p.productid = pd.productid\n\t\t\t\tWHERE\tp.status = 0 AND seo_url = ''\n\t\t\t\";\n\t\t\t$products = $this->db->query($sql)->rows;\n\t\t\t\n\t\t\tforeach($products as $product) {\n\t\t\t\tif($product['languageid'] == \"vn\") {\n\t\t\t\t\t$product['languageid'] = \"vi\";\n\t\t\t\t}\n\t\t\t\t$urlArray[] = (ROOT_HTTP_SERVER.$product['languageid'].\"/\").htmlentities(\"?obj=product&id=\".$product['productid']);\n\t\t\t}\n\t\t\t\n\t\t\treturn $urlArray;\n\t\t}",
"public function getUrl()\n {\n $value = $this->get(self::url);\n return $value === null ? (string)$value : $value;\n }",
"function get_feed_url()\r\n\t{\r\n\t\t$out = $this->feed_url;\t\t\r\n\t\treturn $out;\t\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Trains a single net by letting it play against its own population randomly | function trainNet($pairs, $minAvg)
{
$stats = array();
/** @var Genome[] $population */
$population = $this->getPopulation(0);
if (!$population) {
return false;
}
foreach ($this->players as $pairId => $playerPair) {
/** @var Player[] $playerPair */
$playerPair[0]->putWeights($population[$pairId]->getWeights());
$playerPair[1]->putWeights($population[$pairId % $pairs]->getWeights());
}
$results = array(
'draw' => 0,
'X' => 0,
'O' => 0
);
$bestPopulationAvg = $this->genetics[0]->averageFitness();
for ($i = 0; $bestPopulationAvg < $minAvg; $i++) {
foreach ($this->players as $pairId => $playerPair) {
$board = new XandO(BOARD_SIZE, $playerPair);
$board->letPlay();
$population[$pairId]->setFitness($this->players[$pairId][0]->getFitness());
$population[$pairId % $pairs]->setFitness($this->players[$pairId][1]->getFitness());
$result = $board->getGameResult();
$results[$result['winner']]++;
unset($board);
}
$stats[$i]['trained']['averageFitness'] = $this->genetics[0]->averageFitness();
$stats[$i]['trained']['bestFitness'] = $this->genetics[0]->bestFitness();
if ($stats[$i]['trained']['averageFitness'] > $bestPopulationAvg) {
$this->saveGenes(0, $bestPopulationAvg, $stats[$i]['trained']['averageFitness']);
}
$population = $this->genetics[0]->epoch($population);
shuffle($population);
foreach ($this->players as $pairId => $playerPair) {
$playerPair[0]->putWeights($population[$pairId]->getWeights());
$playerPair[0]->reset();
$playerPair[1]->putWeights($population[$pairId % $pairs]->getWeights());
$playerPair[1]->reset();
}
echo "Generation: " . $this->genetics[0]->getGeneration() . ". Best: " . $stats[$i]['trained']['bestFitness'] . " Average: " . $stats[$i]['trained']['averageFitness'] . "\n";
}
return $results;
} | [
"function newGeneration() {\n if($this->d) echo time().\" - GeneLIB : Initial pop = \". count($this->population) . \"\\n\";\n /* Select population */\n $this->population = $this->selector->selectNextGeneration($this->population);\n if($this->d) echo time().\" - GeneLIB : Population after tournament =\".count($this->population) . \"\\n\";\n /* Now do crossover */\n// $this->crossover_strategy->\n if($this->d) echo time(). \" - GeneLIB: Final pop = \". count($this->population) . \"\\n\";\n //Do mating, do mutation\n return $this->population;\n}",
"public function attackBotToPlayer1()\n {\n $available_skills = $this -> getPlayer2AvailableSkills();\n $this -> attackPlayer2ToPlayer1($available_skills[array_rand($available_skills)]);\n }",
"public function shuffle()\n {\n shuffle($this->population);\n }",
"function toss_it(){\n\t\t\t\t$outcome = mt_rand(0,1);\n\t\t\t\treturn $outcome;\n\t\t\t}",
"function coinToss(){\r\n\t$num = rand(0,1);\r\n\tif ($num > 1)\r\n\t\t$num = $num -1;\r\n\t\t\r\n\tif ($num == 1)\r\n\t\techo (\"Heads, your opponent goes first in battle!\");\r\n\telseif ($num == 0)\r\n\t\techo(\"Tails, your creature attacks first in battle!\");\r\n}",
"public function simulateComputerTurn()\n {\n \n if ($this->players()[0]->points() >= ($this->players()[1]->points() + array_sum($this->dicePot())) && !in_array(1, $this->dicePot())) {\n ;\n } else {\n $this->players()[1]->setPoints($this->dicePot());\n $this->isDone();\n $this->changeCurrentPlayer();\n }\n }",
"function coinToss(){\n\treturn rand(3, 10000)%2;\n}",
"private function initAttack(){ \n \n if($this->hero->getSpeed() > $this->beast->getSpeed()){\n $this->attacker = $this->hero;\n }else if($this->hero->getSpeed() < $this->beast->getSpeed()){\n $this->attacker = $this->beast;\n }else if($this->hero->getLuck() > $this->beast->getLuck()){\n $this->attacker = $this->hero;\n }else if($this->hero->getLuck() < $this->beast->getLuck()){\n $this->attacker = $this->beast;\n }else{\n /**daca si Luck sunt egale retrimit la initGame pentru a genera iar random valorile */\n $this->initGame();\n }\n $this->log( 'Battle : '.$this->hero->getPlayerName().' contra '. $this->beast->getPlayerName());\n \n }",
"function testGame()\n {\n \n dbg(\"+\".__METHOD__.\"\");\n # id, date\n $this->getNew();\n # get highest player_id\n $testPlay = new Player();\n $testPlay->get_next_id();\n $high = $testPlay->get_member_id();\n $this->member_snack = rand(1,$high);\n $this->member_host = rand(1,$high);\n $this->member_gear = rand(1,$high);\n $this->member_caller = rand(1,$high);\n// $this->game_date = rand(1,$high);\n dbg(\"=\".__METHOD__.\":high=$high:{$this->game_id}:{$this->game_date}:{$this->member_snack}:{$this->member_host}:{$this->member_gear}:{$this->member_caller}\");\n unset($testPlay);\n dbg(\"-\".__METHOD__.\"\");\n }",
"function roll_choke() {\n\t// in order to give everyone his chance. It is called \"optimistic choking\"\n\t// \n\t// ... or something like that.\n\t// send_packet_0($sockid) <-- choke\n\t// send_packet_0($sockid) <-- unchoke\n\t$peers=array();\n\t$choked=array();\n\t$unchoked=array();\n\t$chokeme=array();\n\t$unchokeme=array();\n\tforeach($GLOBALS['PEERS'] as $key=>$peer) $peers[]=$key;\n\t// first, list unchoked peers...\n\t$k=0;\n\tforeach($peers as $key) {\n\t\tif ($GLOBALS['PEERS'][$key]['state'] & STATE_INTERESTED) {\n\t\t\tif (!($GLOBALS['PEERS'][$key]['state'] & STATE_I_CHOKE)) {\n\t\t\t\t// this peer isn't choked\n\t\t\t\t$k++;\n\t\t\t\tif ($k>=4) {\n\t\t\t\t\t$chokeme[]=$key;\n\t\t\t\t} else {\n\t\t\t\t\t$unchoked[]=$key;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$choked[]=$key;\n\t\t\t}\n\t\t} else {\n\t\t\t// not interested - should be shoked\n\t\t\tif (!($GLOBALS['PEERS'][$key]['state'] & STATE_I_CHOKE)) $chokeme[]=$key;\n\t\t}\n\t}\n\tif ( (sizeof($choked)+sizeof($unchoked)) <= 4) {\n\t\t// less than 4 leeches, serve them all !\n\t\t$unchokeme=$choked;\n\t} else {\n\t\tif (sizeof($unchoked)<4) {\n\t\t\twhile (sizeof($unchoked)<4) {\n\t\t\t\t$n=rand(0,sizeof($choked)-1);\n\t\t\t\t$unchokeme[]=$choked[$n];\n\t\t\t\t$unchoked[]=$choked[$n]; // for counter\n\t\t\t\tunset($choked[$n]);\n\t\t\t\tsort($choked); // sort will drop keys\n\t\t\t}\n\t\t} else {\n\t\t\t$unchokeme[]=$choked[rand(0,sizeof($choked)-1)];\n\t\t\t$chokeme[]=$unchoked[rand(0,sizeof($unchoked)-1)];\n\t\t}\n\t}\n\t// now, do the work !\n\tforeach($unchokeme as $key) {\n\t\tsend_packet_1($GLOBALS['PEERS'][$key]['sockid']);\n\t\t$GLOBALS['PEERS'][$key]['state'] = $GLOBALS['PEERS'][$key]['state'] & (~STATE_I_CHOKE);\n\t}\n\tforeach($chokeme as $key) {\n\t\tsend_packet_0($GLOBALS['PEERS'][$key]['sockid']);\n\t\t$GLOBALS['PEERS'][$key]['state'] = $GLOBALS['PEERS'][$key]['state'] | STATE_I_CHOKE;\n\t}\n\treturn true;\n}",
"public static function poolSelection($pop) {\r\n\t\r\n\t for ($i=0; $i < Population::$poolSize; $i++) {\r\n\t $randomId = rand(0, $pop->size()-1 ); //Get a random individual from anywhere in the population\r\n\t\t\t//$pool->saveIndividual($i, $pop->getIndividual( $randomId));\r\n\t $random = array_rand($pop->slot_waktu);\r\n\t $a = $pop->slot_waktu;\r\n\t \t\r\n }\r\n var_dump($random);\r\n return $random;\r\n // Get the fittest\r\n //$fittest = $pool->getFittest();\r\n //return $fittest;\r\n }",
"public function hit(){\n array_push($this->hand,mt_rand(1,11));\n $this->score = array_sum($this->hand);\n }",
"public function swatRandomWasp()\n {\n $ramainingSwarm = $this->remaining_swarm();\n $swarmIndex = array_rand($ramainingSwarm);\n $ramainingSwarm[$swarmIndex]->swat();\n if($ramainingSwarm[$swarmIndex]->get_type() == \"QUEEN\"){\n if ($ramainingSwarm[$swarmIndex]->get_life() <= 0)\n {\n $_SESSION[\"queen_dead\"] = true;\n }\n }\n }",
"public function Play()\r\n\t{\r\n\t\t$this->GetGameModel();\r\n\t\tif($this->GameModel['gameOver'] == 0) {\r\n\t\t\t$current_turn = ++$this->GameModel['turns'];\r\n\t\t\t$ent_array = [];\r\n\r\n\r\n\t\t\t// get entities \r\n\t\t\tforeach ($this->GameModel['entities'] as $key => $entity) {\r\n\t\t\t\tif($entity->GetIsAlive() == 1) {\r\n\t\t\t\t\t$ent_array[] = $key;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// feed\r\n\t\t\t$r = mt_rand(0, count($ent_array) - 1);\r\n\t\t\t$i = $ent_array[$r];\r\n\t\t\t$this->GameModel['entities'][$i]->Feed($current_turn);\r\n\r\n\t\t\t// check if anyone dead\r\n\t\t\tfor($i = 0; $i < count($this->GameModel['entities']); $i++) {\r\n\t\t\t\t$entity = $this->GameModel['entities'][$i];\r\n\t\t\t\t$entity->SetCurrentTurn($current_turn);\r\n\t\t\t\t$entity->GetIsAlive(true);\r\n\t\t\t}\r\n\r\n\t\t\t// check if game is over\r\n\t\t\t$this->IsGameOver();\r\n\r\n\t\t\t// save game\r\n\t\t\t$this->SaveGameModel();\r\n\t\t}\r\n\t}",
"public function copyIndividual()\n {\n $individual = $this->getRandomIndividual();\n if ($individual !== false) {\n $this->individuals[] = clone $individual;\n }\n }",
"private function playTurn(){\n echo(PHP_EOL.\"New turn!\".PHP_EOL);\n $punchNumber = random_int(0, 100);\n if($this->isPlayerOnesTurn){\n $this->applyTurnsEffects($punchNumber, $this->playerOne, $this->playerTwo);\n }else{\n $this->applyTurnsEffects($punchNumber, $this->playerTwo, $this->playerOne);\n }\n $this->isPlayerOnesTurn = !$this->isPlayerOnesTurn;\n echo(\"\\t- \".$this->playerOne->toString().PHP_EOL);\n echo(\"\\t- \".$this->playerTwo->toString().PHP_EOL);\n }",
"function start() {\n\t# Global Variables\n\tglobal $world, $size, $rand_sample, $rand_alpha;\n\t\n\t# CInitialize the World 2D array with cells that are randomly dead or alive\n\tfor ($x = 0; $x < $size; $x++) {\n\t\tfor ($y = 0; $y < $size; $y++) {\n\t\t\t$world[$x][$y] = (rand(0,$rand_sample) > $rand_alpha)? 1 : 0;\n\t\t}\n\t}\n}",
"private function chooseBee() {\r\n $target['bee'] = array_rand($_SESSION['bees']);\r\n $target['attackValue'] = $_SESSION['bees'][$target['bee']]['attack'];\r\n if($_SESSION['bees'][$target['bee']]['status']=='dead') {$target = $this->chooseBee();}\r\n return $target;\r\n }",
"public function performTrain() {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Clears out the collAdminUsers collection (array). This does not modify the database; however, it will remove any associated objects, causing them to be refetched by subsequent calls to accessor method. | public function clearAdminUsers()
{
$this->collAdminUsers = null; // important to set this to NULL since that means it is uninitialized
} | [
"public function clearUsers()\n {\n $this->collUsers = null; // important to set this to null since that means it is uninitialized\n $this->collUsersPartial = null;\n }",
"public function clearUsers()\n {\n $this->collUsers = null; // important to set this to NULL since that means it is uninitialized\n $this->collUsersPartial = null;\n }",
"public function clearUsers()\n\t{\n\t\t$this->collUsers = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function clearUsers()\n {\n $this->users = [];\n }",
"public function clearUsuarios()\n\t{\n\t\t$this->collUsuarios = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function clearUserGroups()\n {\n $this->collUserGroups = null; // important to set this to NULL since that means it is uninitialized\n }",
"public function clearUserss()\n {\n $this->collUserss = null; // important to set this to NULL since that means it is uninitialized\n }",
"public function clearTeamUsers()\n\t{\n\t\t$this->collTeamUsers = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function clearUserDemoss()\n {\n $this->collUserDemoss = null; // important to set this to NULL since that means it is uninitialized\n }",
"public function clearprUsers()\n\t{\n\t\t$this->collprUsers = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function delete_users_collection()\n\t{\n\t\t$this->mongo_db->drop_collection('users');\n\t}",
"public function clearUsers()\n {\n $this->collUsers = null; // important to set this to null since that means it is uninitialized\n $this->collUsersPartial = null;\n\n return $this;\n }",
"function clearAdmin() {\r\n\t\tunset($_SESSION['adminAccount']);\r\n\t\tunset($_SESSION['adminID']);\r\n\t}",
"protected function _resetUsers()\n\t{\n\t\t$this->out(' Resetting Users...');\n\t\t$this->User->deleteAll('1=1');\n\t}",
"public function clearOldLdapUsers()\n {\n $oldUsers = $this->createQueryBuilder('u')\n ->where('u.useLdap = true AND u.delLdap = true')\n ->getQuery()\n ->getResult();\n\n if (is_array($oldUsers)) {\n foreach ($oldUsers as $user) {\n $this->_em->remove($user);\n $this->_em->flush();\n }\n }\n }",
"public function clearUserGroupss()\n {\n $this->collUserGroupss = null; // important to set this to NULL since that means it is uninitialized\n }",
"public function clearLocalUsuarios()\n\t{\n\t\t$this->collLocalUsuarios = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function destroyAll()\n {\n if ( ! Input::has('users') || ! Auth::user()->isAdmin) return;\n\n $ids = [];\n\n foreach(Input::get('users') as $k => $user) {\n if ($user['isAdmin'] || Auth::user()->id == $user['id']) continue;\n $ids[] = $user['id'];\n }\n\n if ($deleted = User::destroy($ids)) {\n return response(trans('app.deleted', ['number' => $deleted]));\n }\n }",
"public function clearSettingHasUsers()\n\t{\n\t\t$this->collSettingHasUsers = null; // important to set this to NULL since that means it is uninitialized\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Show the form for creating a new P3aulac1m1. | public function create()
{
return view('p3aulac1m1s.create');
} | [
"public function create()\n {\n return view('p2aulac3m1s.create');\n }",
"public function create()\n {\n return view('ap2aulac3m1s.create');\n }",
"public function create()\n {\n return view('e3aulac3m1s.create');\n }",
"public function create()\n {\n return view('e2aulac1m1s.create');\n }",
"public function create()\n {\n return view('ap2aulac1m1s.create');\n }",
"public function create()\n {\n return view('f2aulac3m1s.create');\n }",
"public function actionCreate()\n {\n $model = new Tb_akun1();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->kd_akun1]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function create()\n {\n return view('p2exercicioc3m1s.create');\n }",
"public function create()\n {\n return view('f2aulac2m1s.create');\n }",
"public function actionCreate()\n {\n $model = new Peminjaman();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function create()\n {\n return view('ap1exercicioc3m1s.create');\n }",
"public function actionCreate()\n {\n $model = new Pengguna();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function create()\n {\n return view('ap3exercicioc3m1s.create');\n }",
"public function create()\n {\n return view('ap4aulac2m1s.create');\n }",
"public function create()\n {\n return view('f4aulac2m1s.create');\n }",
"public function create()\n {\n return view('ap1aulac1m1s.create');\n }",
"public function actionCreate()\n {\n if(Yii::$app->user->can('admin')) {\n $model = new Penilaian();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }else{\n return $this->redirect(['error/forbidden-error']);\n }\n\n }",
"public function actionCreate()\n {\n $model = new PersetujuanTindak();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->tpt_id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new PresensiDetail();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_presensi]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get variable value from script get query string Parses $_SERVER['QUERY_STRING'] | function querystring_get($variable,$default=0) {
$querystring = $_SERVER['QUERY_STRING'];
parse_str($querystring,$values);
if(!isset($values[$variable])) return $default;
else return $values[$variable];
} | [
"private function get_query_string() \n {\n $res = \"\";\n if(isset($_SERVER['QUERY_STRING'])) // Apache\n {\n $res = $_SERVER['QUERY_STRING'];\n } elseif(isset($_SERVER['REQUEST_URI'])) { // PHP Dev Server\n $res = $_SERVER['REQUEST_URI'];\n }\n return($res);\n }",
"function get_query_string($key) {\n $val = null;\n if (!empty($_GET[$key])) {\n $val = $_GET[$key];\n }\n return $val;\n}",
"public function getQueryString()\n\t{\n\t\treturn $_SERVER['QUERY_STRING'];\n\t}",
"public function getPageVar()\n {\n return sanitize_key( $_GET['page'] );\n }",
"function getURLVar($str) {\n\treturn isset($_GET[$str]) ? $_GET[$str] : null;\n}",
"function getQSValueLocal( $nameToLookup , $qs )\n\t{\n\t $retValue = '';\n // find the ?\n $variablesPart = substr ( $qs, strpos( $qs, '?' ) + 1 );\n $pairArray = explode('&', $variablesPart);\n foreach( $pairArray as $key=>$value )\n {\n // value is of the form SV10=5\n $pieces = explode( '=', $value );\n $varName = $pieces[0];\n $varValue = $pieces[1];\n if ( $varName == $nameToLookup )\n {\n $retValue = $varValue;\n break;\n }\n }\n return $retValue;\n\t}",
"public static function getPageQueryString()\n\t\t\t{\n\t\t\t\t$queryString\t\t=\t$_SERVER[\"QUERY_STRING\"];\n\t\t\t\treturn $queryString;\n\t\t\t}",
"function getVariable($string) {\n\t//return\n\treturn ($_POST[\"$string\"]?$_POST[\"$string\"]:$_GET[\"$string\"]);\n}",
"function GET($key)\n {\n if (isset($_GET[$key]))\n $value = $_GET[$key];\n elseif (isset($GLOBALS['HTTP_GET_VARS'][$key]))\n $value = $GLOBALS['HTTP_GET_VARS'][$key];\n elseif (isset($_POST[$key]))\n $value = $_POST[$key];\n elseif (isset($GLOBALS['HTTP_POST_VARS'][$key]))\n $value = $GLOBALS['HTTP_POST_VARS'][$key];\n else\n return \"\";\n if (get_magic_quotes_gpc())\n return stripslashes($value);\n return $value;\n }",
"function param_value($param_name){\n $qs = self::query_string();\n if(!empty($qs)){\n parse_str($qs, $params);\n $param_value = $params[$param_name];\n } else {\n $param_value = NULL;\n }\n \n return($param_value);\n }",
"function getParameter(){\n $url = $_SERVER['REQUEST_URI'];\n $url = explode('/', $url);\n $parameter = array_pop($url);\n if(preg_match('#scores#', $parameter) || $parameter == \"\"){\n return false;\n }\n\n return $parameter;\n }",
"public function getQueryVariables()\n {\n parse_str($this->query, $result);\n return $result;\n }",
"public function getQueryString()\n {\n return $this->server->get('QUERY_STRING');\n }",
"function cc_get( $var ) {\n\tcc_get_fail_if_not_valid( $var );\n\n\tif ( cc_get_isset( $var ) )\n\t\treturn $_GET[$var];\n\telse\n\t\treturn \"\";\n}",
"private static function getQueryStringValue($url, $key){\n\t\t$array = array();\n\t\tparse_str( parse_url( $url, PHP_URL_QUERY), $array );\n\t\tif(array_key_exists($key, $array)){\n\t\t\treturn $array[$key];\n\t\t}\n\t\treturn null;\n\t}",
"function get_param($var_name, $default = '', $mode = '')\n{\n if (is_integer($var_name)) {\n if (!isset($_SERVER['QUERY_STRING'])) {\n return $default;\n }\n $p = $_SERVER['QUERY_STRING'];\n $g = explode(',', $p);\n array_unshift($g, $p);\n\n if (empty($g[$var_name])) {\n return $default;\n }\n $v = trim($g[$var_name]);\n } else {\n if (!isset($_GET[$var_name])) {\n return $default;\n }\n $v = $_GET[$var_name];\n }\n\n $v = filter_param($v, $mode);\n return trim($v);\n}",
"public function getServerParam()\n {\n return $this->server->getParam();\n }",
"function getDataQuery(string $url, string $variable)\n {\n $parts = parse_url($url);\n parse_str($parts['query'], $query);\n return $query[$variable] ?? null;\n }",
"public function getVar() {\r\n return $this->_filter->getRequestVar();\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Default constructor sets backend name | public function __construct() {
$this->name = str_replace('tx_enetcacheanalytics_performance_backend_', '', get_class($this));
} | [
"public function getBackendName() {\n\t\treturn 'Dummy';\n\t}",
"static public function setDefault($backend)\n\t{\n\t\tif (is_string($backend)) {\n\t\t\t\n\t\t\tself::$_default = $backend;\n\t\t}\n\t}",
"public function getBackendName()\n {\n return $this->backendName;\n }",
"public function getBackendName()\n {\n return 'Authserver';\n }",
"function __construct(){\n\t\t\t$this->_name = \"htdb_services\";\n\t\t\tparent::__construct(array());\n\t\t}",
"public function setBackend($backend)\n {\n if( $backend instanceof Engine_ServiceLocator_Backend_Abstract ) {\n $this->_backend = $backend;\n } else if( is_array($backend) ) {\n if( isset($backend['class']) ) {\n $class = $backend['class'];\n } else if( isset($backend['type']) ) {\n $class = 'Engine_ServiceLocator_Backend_' . ucfirst($backend['type']);\n } else {\n throw new Engine_ServiceLocator_Exception('No backend specified');\n }\n if( isset($backend['options']) && is_array($backend['options']) ) {\n $options = $backend['options'];\n } else {\n $options = $backend;\n unset($backend['class']);\n unset($backend['type']);\n }\n \n $this->_backend = new $class($options);\n } else {\n throw new Engine_ServiceLocator_Exception('Unknown backend specifier');\n }\n\n return $this;\n }",
"abstract protected function connectBackend();",
"protected function setHttpBackend($backend = null) {\n $backend = strtolower((string)$backend);\n if ($backend) {\n if ($this->hasHttpBackend($backend)) {\n $this->httpbackend = $backend;\n } else {\n throw new \\Exception($backend . \" backend not available\");\n }\n } else {\n if ($this->hasHttpBackend('curl')) {\n $this->httpbackend = 'curl';\n } else if ($this->hasHttpBackend('zend')) {\n $this->httpbackend = 'zend';\n } else {\n throw new \\Exception(\"no http backend available\");\n }\n }\n }",
"function __construct($inBackend, $inCompiler, array $inOptions = array()) {\r\n\t\t$this->reset();\r\n\t\tif ( count($inOptions) > 0 ) {\r\n\t\t\t$this->setOptions($inOptions);\r\n\t\t}\r\n\t\t$this->setBackend($inBackend, $this->getOptions(self::OPTIONS_BACKEND));\r\n\t\t$this->setCompiler($inCompiler, $this->getOptions(self::OPTIONS_COMPILER));\r\n\t}",
"function __construct()\n {\n $this->name = \"philipshue\";\n $this->title = \"Philips Hue\";\n $this->module_category = \"<#LANG_SECTION_DEVICES#>\";\n $this->checkInstalled();\n }",
"public function __construct(){\n // load the app, module and component name to object params\n $this->app = 'Core';\n $this->module = 'Client';\n $this->componentName = componentName('agency');\n }",
"function __construct($name) {\n $this->_addon = PATH_APPLICATIONS . $name . \"/\";\n $this->_name = $name;\n }",
"public static function set_backend(Requirements_Backend $backend)\n {\n self::$backend = $backend;\n }",
"public function __construct(){\n // load the app, module and component name to object params\n $this->app = 'Blog';\n $this->module = 'Category';\n $theme = session()->get('theme');\n $this->componentName = 'themes.'.$theme.'.layouts.app';\n }",
"public function getBackend()\n {\n return $this->backend;\n }",
"protected function _construct() {\n $this->setUsedModuleName('Altima_Payboard');\n }",
"private function setUpBackend() {}",
"public function setBackend(AbstractBackend $backend) {\n\t\t$this->backend = $backend;\n\t}",
"public function __construct(){\n\t\tparent::__construct();\n\t\t$this->import('BackendUser', 'User');\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ creates a more JSON friendly representation of this folder | public function serialize() {
return [
'id' => $this->getFolderId(),
'name' => $this->getFolderName(),
'parent' => $this->getParentId(),
'user' => $this->getUserId(),
'organization' => $this->getOrgId(),
'type' => $this->getType()
];
} | [
"function generateTreeJson() {\n\n return json_encode(addChildFolders(getRootFolders()));\n}",
"public function Create_student_folder_file()\n {\n $get_first_second_number = substr($this->id,0,2);\n @$folder_name .= $get_first_second_number. \"/\";\n\n\n if (!file_exists($folder_name))\n {\n mkdir($folder_name);\n \n $array = array('id' => $this->id,'name' => $this->name,'surname' => $this->surname,'age'=>$this->age,'curriculum'=>$this->curriculum);\n $fp = fopen($folder_name.'/'.\"$this->id.json\", 'w'); // creating student Json file name\n fwrite($fp, json_encode($array, JSON_PRETTY_PRINT)); // here it will print the array pretty\n fclose($fp);\n die(\"Student Record Created Successfully\");\n }\n else\n {\n echo \"Folder name Already Exist\\n\";\n } \n\n }",
"public function files()\n {\n $this->treeData = new DirTree(config('folder.defaultFolder'));\n\n return json_encode($this->treeData, JSON_PRETTY_PRINT);\n }",
"public function maybeCreateJsonFolder()\n {\n $path = $this->getJsonFolder();\n\n if (!file_exists($path)) {\n mkdir($path, 0777, true);\n }\n if (!file_exists($path . DIRECTORY_SEPARATOR . $this->type)) {\n mkdir($path . DIRECTORY_SEPARATOR . $this->type, 0777, true);\n }\n }",
"private static function folders_path(){\n\t\treturn dirname(__DIR__) . '/content/folders.json';\n\t}",
"public static function createFolder() {\r\n\t\t$timecode = md5(microtime()); // unique id based on time in microseconds (used to create temporary resources)\r\n\t\t// ResourceDescriptor Object for a folder resource\r\n\t\t$result = new ResourceDescriptor('test_' . $timecode, 'folder', '/test_' . $timecode, 'false');\r\n\t\t$result->setLabel('test_' . $timecode);\r\n\t\t$result->setDescription('REST Test Folder');\r\n\t\t$result->addProperty(new ResourceProperty('PROP_PARENT_FOLDER', '/'));\r\n\t\treturn $result;\r\n\t}",
"public function generateFolder(){\n\t\tif ( ! \\File::exists($this->modulePath))\n\t\t{\n\t\t\t\\File::makeDirectory($this->modulePath, 0755);\n\t\t}\n\n\t\t// Create some resource directories\n\t\t//\\File::makeDirectory($this->modulePath . '/Assets', 0755);\n\t\t//\\File::makeDirectory($this->modulePath . '/Config', 0755);\n\t\t\\File::makeDirectory($this->modulePath . '/Controllers', 0755);\n\t\t//\\File::makeDirectory($this->modulePath . '/Lang', 0755);\n\t\t\\File::makeDirectory($this->modulePath . '/Models', 0755);\n\t\t\\File::makeDirectory($this->modulePath . '/Migrations', 0755);\n\t\t\\File::makeDirectory($this->modulePath . '/Views', 0755);\n\t\t\n\t}",
"protected function get_cms_folders()\n\t{\n\t\t$json = <<<EOF\n{\n \"name\": \"cms_folders\",\n \"columns\": {\n \"folder_path\": {\n \"allow_null\": true,\n \"auto_increment\": false,\n \"binary\": false,\n \"comment\": \"\",\n \"decimals\": null,\n \"default\": null,\n \"length\": 0,\n \"name\": \"folder_path\",\n \"type\": \"TEXT\",\n \"unsigned\": false,\n \"values\": [\n\n ],\n \"zerofill\": false\n },\n \"folder_last_modified\": {\n \"allow_null\": false,\n \"auto_increment\": false,\n \"binary\": false,\n \"comment\": \"\",\n \"decimals\": null,\n \"default\": \"0\",\n \"length\": 11,\n \"name\": \"folder_last_modified\",\n \"type\": \"INT\",\n \"unsigned\": false,\n \"values\": [\n\n ],\n \"zerofill\": false\n },\n \"folder_id\": {\n \"allow_null\": false,\n \"auto_increment\": true,\n \"binary\": false,\n \"comment\": \"\",\n \"decimals\": null,\n \"default\": null,\n \"length\": 10,\n \"name\": \"folder_id\",\n \"type\": \"INT\",\n \"unsigned\": true,\n \"values\": [\n\n ],\n \"zerofill\": false\n },\n \"folder_parent_id\": {\n \"allow_null\": false,\n \"auto_increment\": false,\n \"binary\": false,\n \"comment\": \"\",\n \"decimals\": null,\n \"default\": \"0\",\n \"length\": 10,\n \"name\": \"folder_parent_id\",\n \"type\": \"INT\",\n \"unsigned\": true,\n \"values\": [\n\n ],\n \"zerofill\": false\n },\n \"folder_name\": {\n \"allow_null\": true,\n \"auto_increment\": false,\n \"binary\": false,\n \"comment\": \"\",\n \"decimals\": null,\n \"default\": null,\n \"length\": 250,\n \"name\": \"folder_name\",\n \"type\": \"VARCHAR\",\n \"unsigned\": false,\n \"values\": [\n\n ],\n \"zerofill\": false\n }\n },\n \"indexes\": {\n \"PRIMARY\": {\n \"type\": \"primary\",\n \"name\": \"PRIMARY\",\n \"length\": [\n null\n ],\n \"columns\": [\n \"folder_id\"\n ]\n }\n },\n \"comment\": \"\"\n}\nEOF;\n\n\t\treturn json_decode( trim( $json ), TRUE );\n\t}",
"public function set_folder_data()\r\n\t{\r\n\t\t$folder = new Plugin\\Folder($this->folder_id);\r\n\t\t\r\n\t\t$this->folders_list = $folder->get_folders();\r\n\t\t$this->folder_list = $folder->get_paths($this->folder_id, false);\r\n\t\t$this->folder_hidden = $folder->get_hidden($this->folder_id, $this->per_page, $this->page_num);\r\n\t\t$this->folder_tree = $folder->view_tree();\r\n\t}",
"function myfiles_getRootJSON($rootid=\"-1\",$subfoldercount=0) {\r\n\tglobal $L;\r\n\t$curfjson = '{\"pff_id\":\"'.$rootid.'\",'.\r\n\t\t\t\t\t'\"pff_path\":\"\",'.\r\n\t\t\t\t\t'\"pff_title\":\"'.$L['myfiles_root'].'\",'.\r\n\t\t\t\t\t'\"pff_desc\":\"'.$L['myfiles_rootdesc'].'\",'.\r\n\t\t\t\t\t'\"pff_ispublic\":\"0\",'.\r\n\t\t\t\t\t'\"pff_isgallery\":\"0\",'.\r\n\t\t\t\t\t'\"subfoldercount\":'.$subfoldercount.','.\r\n\t\t\t\t\t'\"pff_count\":\"0\"}';\t\r\n\treturn $curfjson;\r\n}",
"public function dirs() {\r\n\t\t$dirs = array();\r\n\t\t$path = $this->app->request->get('path', 'string');\r\n\t\tforeach ($this->app->path->dirs('root:'.$this->getDirectory().$path) as $dir) {\r\n\t\t\t$count = count($this->app->path->files('root:'.$this->getDirectory().$path.'/'.$dir, false, $this->filter));\r\n\t\t\t$dirs[] = array('name' => basename($dir) . \" ($count)\", 'path' => $path.'/'.$dir, 'type' => 'folder');\r\n\t\t}\r\n\r\n\t\treturn json_encode($dirs);\r\n\t}",
"public function getBaseFolders ()\n\t{\n\t\t$list = [];\n\t\t$results = $this->getFolders ('root');\n\t\t\n\t\t// Iterate the base folders\n\t\tforeach ($results as $file)\n\t\t\n\t\t\t$list[$file->getId ()] = $file->getTitle();\n\t\t\t\n\t\techo json_encode ($list);\n\t\t\n\t\t# WP crap\n\t\twp_die();\n\t}",
"function kulam_save_folder_settings() {\n\n\t/**\n\t * Variables\n\t */\n\t$user_id\t\t= isset( $_POST[ 'user_id' ] )\t\t\t? $_POST[ 'user_id' ]\t\t\t: '';\n\t$folder\t\t\t= isset( $_POST[ 'folder' ] )\t\t\t? $_POST[ 'folder' ]\t\t\t: '';\n\t$folder_new\t\t= isset( $_POST[ 'folder_new' ] )\t\t? $_POST[ 'folder_new' ]\t\t: '';\n\t$folder_desc\t= isset( $_POST[ 'folder_desc' ] )\t\t? $_POST[ 'folder_desc' ]\t\t: '';\n\t$delete_folder\t= isset( $_POST[ 'delete_folder' ] )\t? $_POST[ 'delete_folder' ]\t\t: '';\n\t$public_folder\t= isset( $_POST[ 'public_folder' ] )\t? $_POST[ 'public_folder' ]\t\t: '';\n\t$result\t\t\t= [];\n\n\tif ( ! $user_id || ! $folder ) {\n\t\techo '-1';\n\t\twp_die();\n\t}\n\n\t// delete folder\n\tif ( $delete_folder == 'true' ) {\n\t\t$result[2] = kulam_delete_folder( $folder );\n\t}\n\telse {\n\n\t\t// update folder public status\n\t\t$result[3] = kulam_public_folder( $folder, $public_folder );\n\n\t\t$result[1] = array();\n\n\t\t// update folder name\n\t\tif ( $folder_new && $folder != $folder_new ) {\n\t\t\t$result[1][ 'name' ] = kulam_update_folder_name( $folder, $folder_new );\n\t\t}\n\t\telse {\n\t\t\t$result[1][ 'name' ] = $folder;\n\t\t}\n\n\t\t// update folder description\n\t\t$result[1][ 'description' ] = kulam_update_folder_description( $result[1][ 'name' ], $folder_desc );\n\n\t}\n\n\techo json_encode( $result );\n\n\twp_die();\n\n}",
"private function nameFolder()\n {\n if ($this->table === 'experiments') {\n $this->folder = $this->zipped['date'] . \"-\" . $this->cleanTitle;\n } else { // items\n $this->folder = $this->zipped['items_typesname'] . \" - \" . $this->cleanTitle;\n }\n }",
"protected function initFolderStructure() {\n\n\n $codePool = $this->getCodepool();\n $ns = $this->getUserExtensionNameSpace();\n $extName = $this->getExtname();\n\n $appPrefix = array('app', 'code', $codePool, $ns, $extName);\n\n // user must provide here the design path ...\n // $designFePrefix = array('app','design', strtolower($ns), strtolower($extName) );\n\n $this->folderStructure = array(\n 'codePool' => array('app', 'code', $codePool),\n 'base' => $appPrefix,\n 'etc' => array_merge($appPrefix, array('etc')),\n );\n\n if (isset($this->extConfig['magenerator_gmodel']) && is_array($this->extConfig['magenerator_gmodel'])) {\n $this->folderStructure['model'] = array_merge($appPrefix, array('Model'));\n\n // if theres a model with a entity then create sql folder and subfolders\n if( isset($this->extConfig['magenerator_gmodel']['sql']) ){\n $this->folderStructure['sql'] = array_merge($appPrefix, array('sql',$this->getExtensionKey(true).'_sql'));\n }\n\n }\n\n // and so on ...\n// 'block'=> array_merge($appPrefix, array('Block') ),\n// 'controllers'=> array_merge($appPrefix, array('controllers') ),\n// 'helper'=> array_merge($appPrefix, array('Helper') ),\n// 'resource'=> array_merge($appPrefix, array('Model') ),\n }",
"function add_folder($id,$path) {\n global $oldPath;\n global $oldSite, $newSite;\n global $readClient, $writeClient;\n global $folderStack;\n global $pageStack;\n global $refStack;\n global $genericStack;\n global $templateStack;\n global $skipPattern;\n global $added;\n global $exit_on_error;\n global $structuredPages;\n global $firstPass;\n\n $type = 'folder';\n #\n # have we already checked folder *and* children?\n #\n if (isset($added[\"$type.$path\"])) {\n return;\n } else {\n $added[\"$type.$path\"] = 1;\n }\n\n if (isset($skipPattern) && preg_match(\"#$skipPattern#i\",$path)) {\n echo \"*** Skipping $type $path\\n\";\n return;\n }\n\n #\n # create the folder itself\n #\n checkFolder($id, $path);\n\n #\n # and its children\n #\n if (isset($id)) {\n $ident->id = $id;\n }\n $ident->path = $path;\n $ident->siteName = $oldSite;\n $ident->type = \"folder\";\n $readClient->read($ident);\n if (!$readClient->success) {\n echo \"Failed reading: $type \" . $path . \"\\n\";\n echo print_r($ident);\n echo cleanup($readClient->response);\n if ($exit_on_error) cleanexit(); else return;\n }\n $asset = $readClient->asset;\n if (isset($asset->$type->children)\n\t&& isset($asset->$type->children->child)) {\n\t$children = $asset->$type->children->child;\n\tif (!is_array($children)) {\n\t $children = array( $children );\n\t}\n } else {\n\t$children = \"\";\n }\n if (is_array($children)) {\n while ($cur = array_pop($children)) {\n\tif ($cur->type == \"folder\") {\n\t $folderStack[] = $cur;\n\t} else if ($cur->type == \"page\") {\n\t $pageStack[] = $cur;\n\t} else if ($cur->type == \"reference\") {\n\t $refStack[] = $cur;\n\t} else if ($cur->type == \"template\") {\n\t $templateStack[] = $cur;\n\t} else {\n\t $genericStack[] = $cur;\n\t}\n }\n }\n if (is_array($folderStack)) {\n while ($cur = array_pop($folderStack)) {\n\tadd_folder($cur->id,$cur->path->path);\n }\n }\n if (is_array($genericStack)) {\n while ($cur = array_pop($genericStack)) {\n\tcheckAsset($cur->id,$cur->path->path, $cur->type);\n }\n }\n if (is_array($templateStack)) {\n while ($cur = array_pop($templateStack)) {\n\tcheckAsset($cur->id,$cur->path->path, $cur->type);\n }\n }\n if (is_array($pageStack)) {\n while ($cur = array_pop($pageStack)) {\n\tcheckAsset($cur->id,$cur->path->path, $cur->type);\n }\n }\n if (is_array($refStack)) {\n while ($cur = array_pop($refStack)) {\n\tcheckAsset($cur->id,$cur->path->path, $cur->type);\n }\n }\n}",
"public function newfolderAction()\n {\n $params = $this->initParams();\n $makeDirParams = $this->getRequest()->getPost();\n if (isset($makeDirParams['nf'])) {\n try {\n $fs = new \\Mcwork\\Model\\Fs\\Directory($this->worker->getStorage(), $this->initFsEntity(), $this->area);\n $fs->setFsCurrent($makeDirParams['cd']);\n $fs->setNewDirectory($makeDirParams['nf']);\n $message = $fs->mkdir();\n echo Json::encode(array(\n 'messages' => $message\n ));\n } catch (\\Exception $e) {\n echo Json::encode(array(\n 'error' => $e->getMessage()\n ));\n }\n } else {\n echo Json::encode(array(\n 'error' => 'wrong_param_to_create_folder'\n ));\n }\n exit();\n }",
"public function saveTree() {\n mkdir($this->run_dir, 0777, true);\n $this->write_to_file($this->run_dir.'/'. 'yield.json', json_encode($this->store, JSON_PRETTY_PRINT)); // TODO: JSON_UNESCAPED_UNICODE to save space\n }",
"protected static function getJsonFolder(): string\n {\n return apply_filters('wpgb_extended/sync/json_folder', get_stylesheet_directory() . DIRECTORY_SEPARATOR . 'wpgb-json');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function acts like the 'qtrans_insertDropDownElement' function from qTranslate but using language codes (ie: EN), not language names (ie: English) | function qtrans_insertDropDownElementCode($language, $url, $id){
global $q_config;
$html ="
var sb = document.getElementById('qtrans_select_".$id."');
var o = document.createElement('option');
var l = document.createTextNode('" . $language . "');
";
if($q_config['language']==$language)
$html .= "o.selected = 'selected';";
$html .= "
o.value = '".addslashes(htmlspecialchars_decode($url, ENT_NOQUOTES))."';
o.appendChild(l);
sb.appendChild(o);
";
return $html;
} | [
"function outputNewLanguage()\n {\n $values = '';\n foreach($this -> _all_languages as $v)\n $values[] = array('value' => $v['lng'],\n 'contents' => $v['lng_name']);\n\n return HtmlForm::genDropdownSingleChoice(array(\n \"select_name\" => 'new_lng[lng]',\n \"selected_value\" => $this -> _all_languages[0]['lng'],\n \"onChange\" => 'document.getElementById(\\'new_lng_code\\').innerHTML = this.value;',\n \"values\" => $values\n ), 'style=\"width: 95%;\"');\n }",
"private function language_dropdown($qa) {\n $question = $qa->get_question();\n list($languages, $default) = qtype_coderunner_util::extract_languages($question->acelang);\n $currentlanguage = $qa->get_last_qt_var('language');\n if (empty($currentlanguage) && $default !== '') {\n $currentlanguage = $default;\n }\n $selectname = $qa->get_qt_field_name('language');\n $selectid = 'id_' . $selectname;\n $html = html_writer::start_tag('div', array('class' => 'coderunner-lang-select-div'));\n $html .= html_writer::tag('label',\n get_string('languageselectlabel', 'qtype_coderunner'),\n array('for' => $selectid));\n $html .= html_writer::start_tag('select',\n array('id' => $selectid, 'name' => $selectname,\n 'class' => 'coderunner-lang-select', 'required' => ''));\n if (empty($currentlanguage)) {\n $html .= html_writer::tag('option', '', array('value' => ''));\n }\n foreach ($languages as $lang) {\n $attributes = array('value' => $lang);\n if ($lang === $currentlanguage) {\n $attributes['selected'] = 'selected';\n }\n $html .= html_writer::tag('option', $lang, $attributes);\n }\n $html .= html_writer::end_tag('select');\n $html .= html_writer::end_tag('div');\n return $html;\n }",
"function lt_add_languages() {\n \n if( !empty( $_POST['tran_from'] ) && !empty( $_POST['tran_to'] ) ) {\n \n $prefix = LT_META_PREFIX;\n\n //get order id\n $order_id = lt_get_order_cookie();\n\n //selected languages\n $tran_to = explode(',', trim($_POST['tran_to'], ','));\n \n //update meta for translate from\n update_post_meta( $order_id, $prefix . 'tran_from', $_POST['tran_from'] );\n \n //update meta for translate to\n update_post_meta( $order_id, $prefix . 'tran_to', $tran_to );\n }\n exit;\n}",
"function generateNormalTranslatedSelectOption($data) {\n\t$options = array();\n\tforeach ($data as $key => $value) {\n\t\t$options[] = ['text' => trans('list.' . $value), 'value' => $value];\n\t}\n\treturn $options;\n}",
"function make_language_dropdown($selection) {\n\t\tglobal $menuvar, $LANGUAGES;\n\t\t\n\t\t$content = \"\\n\t\t\t\t\t\t<form name=\\\"languagechange\\\" method=\\\"get\\\" action=\\\"\" . $menuvar['SWITCHER'] . \"\\\">\n\t\t\t\t\t\t\t\t\t\t\t\t<select name=\\\"languagechanger\\\" onChange=\\\"ajaxChangeLanguage('languageSpinner', 'ajax.php?action=updateitem&table=users&item=language&value=' + this.options[this.selectedIndex].value + '&id=\" . $_SESSION['userid']. \"', 'http://\" . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), '/\\\\') . \"/\" . $menuvar['HOME'] . \"');\\\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<option>--Select One</option>\";\n\t\t\n\t\tksort($LANGUAGES);\n\t\t\n\t\tforeach ($LANGUAGES as $abbrev => $long) {\n\t\t\t$content .= \"\\n\t\t\t\t\t\t\t\t<option value=\\\"\" . $abbrev . \"\\\"\" . testSelected($selection, $abbrev) . \">\" . $long . \"</option>\";\n\t\t}\n\t\t\n\t\t$content .= \"\\n\t\t\t\t\t\t\t</select><span id=\\\"languageSpinner\\\" style=\\\"display: none;\\\"><img src=\\\"themes/\" . $tts_config['ftstts_theme'] . \"/icons/indicator.gif\\\" alt=\\\"spinner\\\" /></span>\n\t\t\t\t\t\t\t\t\t\t</form>\";\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\treturn $content;\n\t}",
"function generateTranslatedSelectOption($data)\n{\n $options = array();\n foreach ($data as $key => $value) {\n $options[] = ['name' => trans('list.'.$value), 'id' => $value];\n }\n return $options;\n}",
"public function addLanguages(): void\n {\n\t$languages = $this->recFindLanguages($this->dom->documentElement);\n\tif(!empty($languages)) $this->setXmpBag('dc:language', $languages);\n }",
"public function positionen_dropdown() \r\n {\r\n \tglobal $tpl;\r\n \tglobal $redirect, $general;\r\n \tglobal $unav_array;\r\n \tglobal $eintrag;\r\n \tglobal $tempid;\r\n \t\r\n \t$tpl->setVariable('ul_unavi_h_start', '<ul class=\"ebene02\">');\r\n \t// alle Unterpositionen pro Servicenavigationspunkt\r\n\t\tforeach ($unav_array as $subid => $value)\r\n\t\t{\r\n\t\t\tlist($kap, $ukap, $label) = explode('|',$value);\r\n\t\t\tif ($eintrag['kap'] != $kap) { continue; }\r\n\t\t\t$nav_url = $redirect->set_navlink($tempid, $subid);\r\n\t\t\t$link = '<a href=\"'.urldecode($nav_url).'\">'.$label.'</a>';\r\n \t$tpl->setCurrentBlock('unavi_horiz');\r\n\t\t\t$tpl->setVariable('unavi_h_link',$link);\r\n\t\t\t$tpl->parseCurrentBlock();\r\n\t\t}\r\n\t\t$tpl->setCurrentBlock('navi_horiz');\r\n\t\t$tpl->setVariable('ul_unavi_h_ende', \"</ul>\");\r\n\t\t$tpl->parseCurrentBlock();\r\n }",
"function LANGSEL_buildSelector(array $options = array())\n{\n global $_CONF, $LANG_LANGSEL_1, $_LANGSEL_langList;\n\n $currentLanguage = str_replace('_utf-8', '', COM_getLanguage());\n $allLanguages = array_keys($_LANGSEL_langList);\n $target = COM_getCurrentURL();\n\n // If the $options array is empty, then fill the array automatically based\n // on whether the muiti-language mode is enabled\n if (count($options) === 0) {\n if (isset($_CONF['languages'], $_CONF['language_files']) &&\n is_array($_CONF['languages']) && is_array($_CONF['language_files'])) {\n foreach ($_CONF['language_files'] as $langId => $langFile) {\n $options[] = str_replace('_utf-8', '', $langFile);\n }\n } else {\n $options = $allLanguages;\n }\n }\n\n $T = COM_newTemplate(CTL_plugin_templatePath('langsel'));\n $T->set_file(array('menu' => 'menu.thtml'));\n\n $T->set_var('lang_title', $LANG_LANGSEL_1['title']);\n $T->set_block('menu', 'item');\n\n foreach ($options as $option) {\n $option = strtolower($option);\n\n if (in_array($option, $allLanguages)) {\n $text = htmlspecialchars($_LANGSEL_langList[$option][1], ENT_QUOTES, 'utf-8');\n $dir = $_LANGSEL_langList[$option][0];\n $active = ($option === $currentLanguage);\n\n if ($active) {\n $url = '';\n } else {\n $url = $_CONF['site_url'] . '/langsel/index.php?'\n . http_build_query(array(\n 'langsel' => $option . '_utf-8',\n 'target' => $target,\n ));\n }\n }\n\n $T->set_var(array(\n 'text' => $text,\n 'dir' => $dir,\n 'active' => $active,\n 'url' => $url,\n ));\n $T->parse('items', 'item', true);\n }\n\n $T->parse('output', 'menu');\n $retval = $T->finish($T->get_var('output'));\n\n return $retval;\n}",
"function populateDropDownItems($dropDownSql, $onClick, $parent) {\n\n $html = \"\";\n $lookuplist = [];\n $lookuprow = $this->DEB->getRows($dropDownSql, DEB_ARRAY);\n foreach ($lookuprow as $irow => $row) {\n $lookuplist[$irow] = $row[0] . \",\" . $row[1];\n }\n\n foreach ($lookuplist as $lid => $option) {\n $option = explode(\",\", $option);\n $option[0] = trim($option[0]);\n $html .= li([\"role\" => \"presentation\"], area([\"role\" => \"menuitem\",\n \"tabindex\" => \"-1\",\n \"href\" => \"javascript:void(0);\",\n \"onclick\" => \" $('#{$parent}').text($(this).text()); $('#{$parent}').append(' <span class=\\'caret\\'></span>'); {$onClick}\",\n \"optionId\" => \"{$option[0]}\"\n ], \"{$option[1]}\")\n );\n }\n\n return $html;\n }",
"function wpml_language_switch() {\n\t$lang = icl_get_languages('skip_missing=N');\n\t$ret = '';\n\tif(count($lang) > 0) {\n\tforeach($lang as $value) {\n\t\t$ret .= ($value['active'] == 0) ? '<li class=\"language dropdown menu-item\"><a href=\"' . $value['url'] . '\">' .\n\t\t\t$value['native_name'] . '</a></li>' : '';\n\t}\n\t}\n\treturn $ret;\n}",
"function update_new_dropdown()\n {\n $information = $_REQUEST[\"b\"];\n if ($information) {\n if (strlen(trim($information[\"dropdown_label\"])) > 0) {\n $this->sql_query = \"insert into \" . $this->db->geoTables->sell_choices_types_table . \"\n\t\t\t\t\t(type_name)\n\t\t\t\t\tvalues\n\t\t\t\t\t(\\\"\" . $information[\"dropdown_label\"] . \"\\\")\";\n $result = $this->db->Execute($this->sql_query);\n if (!$result) {\n //echo $this->sql_query.\"<br>\\n\";\n return false;\n }\n $id = $this->db->Insert_ID();\n return true;\n } else {\n return false;\n }\n } else {\n return false;\n }\n }",
"function setLanguage(/*...*/);",
"function newzackdropdownelement($definitionArray) {\n \n $addStyle = (trim($definitionArray['fieldAddStyle']) !== \"\" ) ? \" style=\\\"{$definitionArray['fieldAddStyle']}\\\" \" : \"\";\n $RDOnly = ((int)$definitionArray['readOnlyInd'] === 1) ? \" READONLY \" : \"\";\n $plcHld = (trim($definitionArray['fieldPlaceHolder']) !== \"\") ? \" placeholder = '{$definitionArray['fieldPlaceHolder']}' \" : \"\";\n $divValues = (trim($definitionArray['divValueTbl']) !== \"\") ? $definitionArray['divValueTbl'] : \"\";\n $dftVal = (trim($definitionArray['defaultValue']) !== \"\") ? \" value=\\\"{$definitionArray['defaultValue']}\\\" \" : \"\";\n $clickAction = (trim($definitionArray['clickAction']) !== \"\") ? $definitionArray['clickAction'] : \" dspDropMenu('{$definitionArray['dropDivId']}'); \";\n\n $elementRtn = \"<div class=zackdropmenuholder><div class=zackdspvalue><table><tr><td><span class=inputwrapper onclick=\\\"byId('{$definitionArray['fieldId']}').value = '';{$clickAction}\\\"><input type=text name='{$definitionArray['fieldName']}' id='{$definitionArray['fieldId']}' class='{$definitionArray['fieldClassName']}' {$addStyle} {$RDOnly} {$plcHld} {$dftVal}></span></td></tr></table></div><div class=\\\"{$definitionArray['divClassName']}\\\" id=\\\"{$definitionArray['dropDivId']}\\\">{$divValues}</div></div>\";\n return $elementRtn;\n}",
"public function testLanguageStringSelector() {\n // Add another language.\n $edit = ['predefined_langcode' => 'es'];\n $this->drupalGet('admin/config/regional/language/add');\n $this->submitForm($edit, 'Add language');\n\n // Translate the string English in Spanish (Inglés). Override config entity.\n $name_translation = 'Inglés';\n \\Drupal::languageManager()\n ->getLanguageConfigOverride('es', 'language.entity.en')\n ->set('label', $name_translation)\n ->save();\n\n // Check content translation overview selector.\n $path = 'es/admin/config/regional/content-language';\n $this->drupalGet($path);\n\n // Get en language from selector.\n $option = $this->assertSession()->optionExists('edit-settings-user-user-settings-language-langcode', 'en');\n\n // Check that the language text is translated.\n $this->assertSame($name_translation, $option->getText());\n }",
"function custom_dropdown($name = '', $elements = array(), $preselected = array(), $extras = '', $with_label = false, $label_text = '') {\n\t\t$dropdown = '';\n\t\t$label = '';\n\t\tif ($with_label) {\n\t\t\t$label .= '<label for=\"'.$name.'\">'.$label_text.'</label>';\n\t\t}\n\t\t$dropdown .= $label;\n\t\t$dropdown .= form_dropdown($name,$elements,$preselected,$extras);\n\t\treturn $dropdown;\n\t}",
"function sidebar_renderItem_renderLanguageSelectorbox() {\n\t\tglobal $LANG, $BE_USER, $BACK_PATH;\n\n\t\t$availableLanguagesArr = $this->pObj->translatedLanguagesArr;\n\t\t$availableTranslationsFlags = '';\n\t\t$newLanguagesArr = $this->pObj->getAvailableLanguages(0, true, false);\n\t\tif (count($availableLanguagesArr) <= 1) return FALSE;\n\n\t\t$optionsArr = array ();\n\t\tforeach ($availableLanguagesArr as $languageArr) {\n\t\t\tunset($newLanguagesArr[$languageArr['uid']]);\t// Remove this language from possible new translation languages array (PNTLA ;-)\n\n\t\t\tif ($languageArr['uid']<=0 || $BE_USER->checkLanguageAccess($languageArr['uid']))\t{\n\t\t\t\t$grayedOut = $languageArr['PLO_hidden'] ? ' style=\"Filter: alpha(opacity=25); -moz-opacity: 0.25; opacity: 0.25\"' : '';\n\n\t\t\t\t$flag = tx_templavoila_icons::getFlagIconFileForLanguage($languageArr['flagIcon']);\n\t\t\t\t$style = isset ($languageArr['flagIcon']) ? 'background-image: url(' . $flag . '); background-repeat: no-repeat; padding-left: 22px;' : '';\n\t\t\t\t$optionsArr [] = '<option style=\"'.$style.'\" value=\"'.$languageArr['uid'].'\"'.($this->pObj->MOD_SETTINGS['language'] == $languageArr['uid'] ? ' selected=\"selected\"' : '').'>'.htmlspecialchars($languageArr['title']).'</option>';\n\n\t\t\t\t\t// Link to editing of language header:\n\t\t\t\t$availableTranslationsFlags .= '<a href=\"index.php?' .\n\t\t\t\t\thtmlspecialchars($this->pObj->link_getParameters() . '&editPageLanguageOverlay=' . $languageArr['uid']) . '\">' .\n\t\t\t\t\t'<span ' . $grayedOut . '>' .\n\t\t \t\t\ttx_templavoila_icons::getFlagIconForLanguage($languageArr['flagIcon'], array('title' => $languageArr['title'], 'alt' => $languageArr['title'])) .\n\t\t\t\t\t'</span></a>';\n\t\t\t}\n\t\t}\n\n\t\t$link = '\\'index.php?' . $this->pObj->link_getParameters() . '&SET[language]=\\'+this.options[this.selectedIndex].value';\n\n\t\t$output = '\n\t\t\t<tr class=\"bgColor4\">\n\t\t\t\t<td width=\"20\">\n\t\t\t\t\t'. t3lib_BEfunc::cshItem('_MOD_web_txtemplavoilaM1', 'selectlanguageversion', $this->doc->backPath) .'\n\t\t\t\t</td><td width=\"200\" style=\"vertical-align:middle;\">\n\t\t\t\t\t'.$LANG->getLL ('selectlanguageversion', 1).':\n\t\t\t\t</td>\n\t\t\t\t<td style=\"vertical-align:middle;\"><select onchange=\"document.location=' . htmlspecialchars($link) . '\">' . implode ('', $optionsArr) . '</select></td>\n\t\t\t</tr>\n\t\t';\n\n\t\tif ($this->pObj->currentLanguageUid>=0 && (($this->pObj->rootElementLangMode === 'disable') || ($this->pObj->rootElementLangParadigm === 'bound'))) {\n\t\t\t$options = array();\n\t\t\t$options[] = t3lib_div::inList($this->pObj->modTSconfig['properties']['disableDisplayMode'], 'default')?'':'<option value=\"\"'.($this->pObj->MOD_SETTINGS['langDisplayMode']===''?' selected=\"selected\"':'').'>'.$LANG->sL('LLL:EXT:lang/locallang_general.xml:LGL.default_value').'</option>';\n\t\t\t$options[] = t3lib_div::inList($this->pObj->modTSconfig['properties']['disableDisplayMode'], 'selectedLanguage')?'':'<option value=\"selectedLanguage\"'.($this->pObj->MOD_SETTINGS['langDisplayMode']==='selectedLanguage'?' selected=\"selected\"':'').'>'.$LANG->getLL('pageLocalizationDisplayMode_selectedLanguage').'</option>';\n\t\t\t$options[] = t3lib_div::inList($this->pObj->modTSconfig['properties']['disableDisplayMode'], 'onlyLocalized')?'':'<option value=\"onlyLocalized\"'.($this->pObj->MOD_SETTINGS['langDisplayMode']==='onlyLocalized'?' selected=\"selected\"':'').'>'.$LANG->getLL('pageLocalizationDisplayMode_onlyLocalized').'</option>';\n\t\t\t$link = '\\'index.php?' . $this->pObj->link_getParameters() . '&SET[langDisplayMode]=\\'+this.options[this.selectedIndex].value';\n\t\t\tif (count($options))\t{\n\t\t\t\t$output.= '\n\t\t\t\t\t<tr class=\"bgColor4\">\n\t\t\t\t\t\t<td width=\"20\">\n\t\t\t\t\t\t\t'. t3lib_BEfunc::cshItem('_MOD_web_txtemplavoilaM1', 'pagelocalizationdisplaymode', $this->doc->backPath) .'\n\t\t\t\t\t\t</td><td width=\"200\" style=\"vertical-align:middle;\">\n\t\t\t\t\t\t\t'.$LANG->getLL('pageLocalizationDisplayMode', 1).':\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td style=\"vertical-align:middle;\">\n\t\t\t\t\t\t\t<select onchange=\"document.location=' . htmlspecialchars($link) . '\">\n\t\t\t\t\t\t\t\t'.implode(chr(10), $options).'\n\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t';\n\t\t\t}\n\t\t}\n\n\t\tif ($this->pObj->rootElementLangMode !== 'disable') {\n\t\t\t$output.= '\n\t\t\t\t<tr class=\"bgColor4\">\n\t\t\t\t\t<td width=\"20\">\n\t\t\t\t\t\t'. t3lib_BEfunc::cshItem('_MOD_web_txtemplavoilaM1', 'pagelocalizationmode', $this->doc->backPath) .'\n\t\t\t\t\t</td><td width=\"200\" style=\"vertical-align:middle;\">\n\t\t\t\t\t\t'.$LANG->getLL('pageLocalizationMode', 1).':\n\t\t\t\t\t</td>\n\t\t\t\t\t<td style=\"vertical-align:middle;\"><em>'.$LANG->getLL('pageLocalizationMode_'.$this->pObj->rootElementLangMode, 1).($this->pObj->rootElementLangParadigm!='free'?(' / '.$LANG->getLL('pageLocalizationParadigm_'.$this->pObj->rootElementLangParadigm)):'').'</em></td>\n\t\t\t\t</tr>\n\t\t\t';\n\t\t}\n\n\t\t\t// enable/disable structure inheritance - see #7082 for details\n\t\t$adminOnlySetting = isset($this->pObj->modTSconfig['properties']['adminOnlyPageStructureInheritance']) ? $this->pObj->modTSconfig['properties']['adminOnlyPageStructureInheritance'] : 'strict';\n\t\tif (($GLOBALS['BE_USER']->isAdmin() || $adminOnlySetting === 'false') && $this->pObj->rootElementLangMode=='inheritance') {\n\t\t\t$link = '\\'index.php?'.$this->pObj->link_getParameters().'&SET[disablePageStructureInheritance]='.($this->pObj->MOD_SETTINGS['disablePageStructureInheritance']=='1'?'0':'1').'\\'';\n\t\t\t$output.= '\n\t\t\t\t<tr class=\"bgColor4\">\n\t\t\t\t\t<td width=\"20\">\n\t\t\t\t\t\t'. t3lib_BEfunc::cshItem('_MOD_web_txtemplavoilaM1', 'disablePageStructureInheritance', $this->doc->backPath) .'\n\t\t\t\t\t</td><td width=\"200\" style=\"vertical-align:middle;\">\n\t\t\t\t\t\t'.$LANG->getLL ('pageLocalizationMode_inheritance.disableInheritance', 1).':\n\t\t\t\t\t</td>\n\t\t\t\t\t<td style=\"vertical-align:middle;\">\n\t\t\t\t\t\t<input type=\"checkbox\" onchange=\"document.location='.$link.'\" '.($this->pObj->MOD_SETTINGS['disablePageStructureInheritance']=='1'?' checked=\"checked\"':'').'/>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t';\n\t\t}\n\n\t\t$output .= '\n\t\t\t<tr class=\"bgColor4\">\n\t\t\t\t<td width=\"20\">\n\t\t\t\t\t'. t3lib_BEfunc::cshItem('_MOD_web_txtemplavoilaM1', 'editlanguageversion', $this->doc->backPath) .'\n\t\t\t\t</td><td width=\"200\" style=\"vertical-align:middle;\">\n\t\t\t\t\t'.$LANG->getLL ('editlanguageversion', 1).':\n\t\t\t\t</td>\n\t\t\t\t<td style=\"vertical-align:middle;\">\n\t\t\t\t\t'.$availableTranslationsFlags.'\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t';\n\n\t\treturn $output;\n\t}",
"public function run()\n {\n $languages = isset(Yii::$app->getUrlManager()->languages) ? Yii::$app->getUrlManager()->languages : [];\n if (count($languages) > 1) {\n $items = [];\n $currentUrl = preg_replace('/' . Yii::$app->language . '\\//', '', Yii::$app->getRequest()->getUrl(), 1);\n $isAssociative = ArrayHelper::isAssociative($languages);\n foreach ($languages as $language => $code) {\n $url = $code . $currentUrl;\n if ($isAssociative) {\n $item = ['label' => $language, 'url' => $url];\n } else {\n $item = ['label' => $code, 'url' => $url];\n }\n if ($code === Yii::$app->language) {\n $item['options']['class'] = 'disabled';\n }\n $items[] = $item;\n }\n $this->dropdown['items'] = $items;\n parent::run();\n }\n }",
"function getDbDropdown()\n {\n global $objDatabase, $objTemplate, $_ARRAYLANG;\n if ($this->tableExists == \"tblexists\") {\n $tdm = \"<select name='fromDB' onchange='existingdirNameValue2()' size='1' style='WIDTH: 150px'>\";\n $tdm .=\"<option value=''>--- Aus Datenbank ----------</option>\";\n $objResult = $objDatabase->query(\"SELECT id,themesname FROM \".$this->oldTable.\" ORDER BY id\");\n $defaultThemeId = $this->selectDefaultTheme();\n $default = '';\n if ($objResult !== false) {\n while (!$objResult->EOF) {\n if ($objResult->fields['id'] == $defaultThemeId){\n $default = \"(\".$_ARRAYLANG['TXT_DEFAULT'].\")\";\n }\n $tdm .=\"<option value='\".$objResult->fields['id'].\"'>\".$objResult->fields['themesname'].\" \".$default.\"</option>\\n\";\n $default='';\n $objResult->MoveNext();\n }\n }\n $tdm .=\"</select>\";\n $objTemplate->setVariable('TXT_FROM_DB',$tdm);\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ getDownlineAgency is used to get all downline agency information according to parent agency | public function getDownlineAgency($id)
{
$this->db->select('a.id,a.name,u.created_at,a.resident_license_number,a.non_resident_license_state_ids,rs.name as resident_state');
$this->db->from('agencies a');
$this->db->where('a.parent_agency',$id);
$this->db->join('users u','u.id = a.user_id');
$this->db->join('state rs','rs.id = a.resident_license_state_id','left');
$agencies = $this->db->get()->result_array();
foreach ($agencies as $key => $value)
{
$arrayvalue = array();
if($value['non_resident_license_state_ids'] != "")
{
foreach (explode(',',$value['non_resident_license_state_ids']) as $key1 => $value1)
{
$arrayvalue[] = $this->db->query("SELECT id as state_id,name FROM state WHERE id = $value1")->row_array();
}
}
$agencies[$key]['non_resident_state'] = $arrayvalue;
}
/*for($i = 0;$i < count($agencies); ++$i)
{
$this->db->select('a.state_id,s.name');
$this->db->where('a.agency_id',$agencies[$i]['id']);
$this->db->join('state s','a.state_id = s.id');
$agencies[$i]['non_resident_state'] = $this->db->get('agency_non_resident_licensed_state a')->result_array();
}
echo '<pre>';
print_r($agencies);
echo '</pre>';
die;*/
return $agencies;
} | [
"public function getAgencyOffers($agency_id){\r\n return Property::find()->where(['user_id' => $agency_id])->orderBy(['id' => SORT_DESC])->all();\r\n }",
"function getAgencyList()\n {\n $dataAgencyList = $this->_sendWithSession('ox.getAgencyList');\n $returnData = [];\n foreach ($dataAgencyList as $dataAgency) {\n $oAgencyInfo = new AgencyInfo();\n $oAgencyInfo->readDataFromArray($dataAgency);\n $returnData[] = $oAgencyInfo;\n }\n\n return $returnData;\n }",
"public function getAgencyList()\n {\n $dataAgencyList = $this->sendWithSession('ox.getAgencyList');\n $returnData = array();\n foreach ($dataAgencyList as $dataAgency) {\n $agencyInfo = new AgencyInfo();\n $agencyInfo->readDataFromArray($dataAgency);\n $returnData[] = $agencyInfo;\n }\n\n return $returnData;\n }",
"public function getAgencyId()\n\t{\n\t\treturn $this->agency_id;\n\t}",
"protected function getBankAgencyId()\r\n {\r\n return YODLEE_AGENCY_ID;\r\n }",
"public function getAgencyID(){\n\t\t\treturn $this->agency_id;\n\t\t}",
"public function agency()\n {\n return $this->belongsTo(Agency::class);\n }",
"public function getAllSubAgencyByParentAgency($id)\n {\n try\n {\n \t$this->db->where('parent_agency',$id);\n \t$this->db->or_where('id',$id);\n return $this->db->get('agencies')->result_array();\n }\n catch(Exception $e)\n {\n return false;\n }\n }",
"public function getAgencyId()\n {\n return $this->agencyId;\n }",
"public function agency()\n {\n return $this->belongsTo('App\\Models\\Api\\v1\\Person', 'n_AgencyPersoninfoId_FK')->withDefault();\n }",
"public function getAgency() {\r\n if($this->hasCustomAgency() == true) {\r\n return $this->agency_name;\r\n } else {\r\n return $this->getAgencyName($this->agency_id);\r\n }\r\n }",
"public function getAgencySubDomains()\n {\n return $this->domains['agency'];\n }",
"public function prepareDownlineOverview() {\n\t\t\n\t\treturn $this->_sendRequest($this->_domain.'Downline/downlineOverview', 'GET');\n\t\t}",
"function getAdvertiserListByAgencyId($agencyId)\n {\n $dataAdvertiserList = $this->_sendWithSession('ox.getAdvertiserListByAgencyId', [(int)$agencyId]);\n $returnData = [];\n foreach ($dataAdvertiserList as $dataAdvertiser) {\n $oAdvertiserInfo = new AdvertiserInfo();\n $oAdvertiserInfo->readDataFromArray($dataAdvertiser);\n $returnData[] = $oAdvertiserInfo;\n }\n\n return $returnData;\n }",
"public function getAgencyDivision()\n\t{\n\t\treturn $this->agency_division;\n\t}",
"public function getAgency(PropelPDO $con = null)\n\t{\n\t\tif ($this->aAgency === null && ($this->agency_id !== null)) {\n\t\t\t$c = new Criteria(AgencyPeer::DATABASE_NAME);\n\t\t\t$c->add(AgencyPeer::ID, $this->agency_id);\n\t\t\t$this->aAgency = AgencyPeer::doSelectOne($c, $con);\n\t\t\t/* The following can be used additionally to\n\t\t\t guarantee the related object contains a reference\n\t\t\t to this object. This level of coupling may, however, be\n\t\t\t undesirable since it could result in an only partially populated collection\n\t\t\t in the referenced object.\n\t\t\t $this->aAgency->addRequesters($this);\n\t\t\t */\n\t\t}\n\t\treturn $this->aAgency;\n\t}",
"function showAgency()\n{\n // connect and check connection with a database\n $con = @mysqli_connect(\"localhost\",\"root\",\"\",\"travelexperts\") or die (\"Database Connection failed!<br>\");\n // select all the agencies from the database\n $sql = \"SELECT * FROM agencies\";\n $result = mysqli_query($con,$sql);\n if (mysqli_num_rows($result) > 0)\n {\n // loop to get information of each agency from the database\n while($row = mysqli_fetch_assoc($result))\n {\n $id=$row['AgencyId'];\n $adr=$row['AgncyAddress'];\n $city=$row[\"AgncyCity\"];\n //format the post code to a common style\n $postal=chunk_split($row[\"AgncyPostal\"],3,\" \");\n $p=$row[\"AgncyPhone\"];\n //format the phone number to a common style. E.g. (403)111-1111\n $phone='('.substr($p,0,3).')'.substr($p,3,3).'-'.substr($p,6,4);\n //output data of each agency\n $str=\"<section> \n <div class='row'>\n <div class='col-sm-12 col-md-6'>\n <div class='card bg-white' style='border:0;'>\n <div class='card-body'>\n <h4 class='card-title' style='color:DarkBlue;'>Travel Experts-\".$city.\"</h4>\n <p class='card-text' style='color:grey;'>\";\n $str.=$adr.\"<br>\".$city.\", \".$postal.\"</p>\";\n $str.=\"<p class='card-text' style='color:DarkBlue;font-size:110%'><i class='fas fa-phone'></i> \";\n $str.=$phone.\"</p></div></div></div></section>\";\n echo $str;\n echo showAgent($id);\n }\n }\n}",
"public function getAgencyName()\n\t{\n\t\treturn $this->agency_name;\n\t}",
"public function getTestKitApprovalAgency($TestKitName_ID) {\n\t\t$columns = array ('TestKitName_ID');\n\t\t$records = array ($TestKitName_ID);\n\t\t$TestKit_ApprovalAgency_ = $this->query_from_r_testkitname_dts ( $columns, $records );\n\t\treturn sizeof($TestKit_ApprovalAgency_)>0 ? $TestKit_ApprovalAgency_ [0] ['TestKit_ApprovalAgency'] : null;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function is used to lookup the current snapshot for given domain | function libvirt_domain_snapshot_current($res, int $flags = 0)
{
} | [
"function libvirt_list_domain_snapshots($res, int $flags = 0) : array\n{\n}",
"public function snapshot();",
"public function snapshot() {}",
"protected function snapshot() {\n if ($this->snapshot) {\n return $this->snapshot;\n } else {\n if ($this->snapshot_version == \"preview\") {\n $snapshot = $this->current_preview_snapshot();\n } else if ($this->snapshot_version == \"current\") {\n $snapshot = $this->current_snapshot();\n } else {\n $snapshot = $this->snapshots->findOne(['published_at' => $this->snapshot_version]);\n if (!$snapshot) {\n throw new Exception(\"No snapshot found with version \".$this->snapshot_version.\"\\n\");\n }\n }\n return $snapshot; \n }\n }",
"public function get_vid_by_domain( $domain ) {\n\t\treturn $this->institution_vid_mapping[ $domain ];\n\t}",
"public function getSnapshot()\n\t{\n\t\t$snapshot = NULL;\n\n\t\tif ($this->blackbox instanceof Blackbox)\n\t\t{\n\t\t\t$snapshot = $this->blackbox->getStateData()->snapshot;\n\t\t}\n\n\t\treturn $snapshot;\n\t}",
"function get_snapshots() {\n \n $view = \\Drupal\\views\\Views::getView('home_page_snapshots');\n $view->execute();\n $rendered = $view->render();\n $rendered = \\Drupal::service('renderer')->render($rendered);\n return (string)$rendered;\n \n}",
"public function getLockToDomain() {}",
"public function getSnapshotDirectory()\n {\n return $this->snapshot_directory;\n }",
"public function snapshot()\n {\n }",
"function GetSnapshotById ($id) \n\t{\n $snapshotArray = $this->dao->GetItem($id);\n\t\treturn (object)$snapshotArray[0];\n }",
"private static function get_db_snapshot() {\n\t\t$snapshot = get_option( Synthesis_DB_Backup::DB_SNAPSHOT_OPTION_NAME, false );\n\t\treturn $snapshot;\n\t}",
"public static function GetByDomain($domain){\n\t\t \n try{\n \n \t\t$db = DB::get();\n \n $q = \"SELECT SiteId, FriendlyId, Domain, Bucket, Name, LogoUrl, IconUrl, IconBg, Theme,\n \t\t\t\t\t\tPrimaryEmail, TimeZone, Language, Direction, Currency, \n \t\t\t\t\t\tShowCart, ShowSettings, ShowLanguages, ShowLogin, UrlMode,\n \t\t\t\t\t\tWeightUnit, ShippingCalculation, ShippingRate, ShippingTiers, TaxRate, \n\t\t\t\t\t\t\tPayPalId, PayPalUseSandbox,\n\t\t\t\t\t\t\tWelcomeEmail, ReceiptEmail,\n\t\t\t\t\t\t\tIsSMTP, SMTPHost, SMTPAuth, SMTPUsername, SMTPPassword, SMTPPasswordIV, SMTPSecure,\n\t\t\t\t\t\t\tFormPublicId, FormPrivateId,\n\t\t\t\t\t\t\tStatus, Plan, Provider, SubscriptionId, CustomerId,\n\t\t\t\t\t\t\tCanDeploy, UserLimit, FileLimit,\n\t\t\t\t\t\t\tLastLogin, Created\t\n \t\t\t\t\t\tFROM Sites WHERE Domain = ?\";\n \n $s = $db->prepare($q);\n $s->bindParam(1, $domain);\n \n $s->execute();\n \n $row = $s->fetch(PDO::FETCH_ASSOC); \n \n \t\tif($row){\n \t\t\treturn $row;\n \t\t}\n \n } catch(PDOException $e){\n die('[Site::GetByDomain] PDO Error: '.$e->getMessage());\n }\n \n\t}",
"public static function getCurrentDomain() { }",
"public function snapshot()\n {\n return $this->snapshot;\n }",
"function getSubscriberDetailsByDomain($domain)\n\t{\n\t\t\n\t\t$this->db_subscription->select('md_tb_Subscriber.SubscriberID, md_tb_Subscriber.username, md_tb_Subscriber.address, md_tb_Subscriber.PhoneNumber, md_tb_Subscriber.email, md_tb_Subscriber.expiryDate,,md_tb_SubscriptionDetails.RecurringCost,md_tb_SubscriptionDetails.DomainName');\n\t\t$this->db_subscription->from('md_tb_Subscriber');\n\t\t$this->db_subscription->join('md_tb_SubscriptionDetails', 'md_tb_SubscriptionDetails.SubscriberID = md_tb_Subscriber.SubscriberID'); \n\t\t$this->db_subscription->where(array('DomainName' => $domain));\n\t\t$query = $this->db_subscription->get();\n\t\treturn $query->row_array();\n\t}",
"public function get_snapshot_of_latest_images();",
"function displaySnapshotList($infoData, $instid, $repository_name)\n{\n global $query_string;\n $target_connection_string = array();\n $format_list = array(\"%6s \", \"%6s \", \"%-32s \", \"%5s \", \"%-19s \", \"%-20s\\n\");\n\n /* Prepare list of connection info to repositorydb */\n if (isset($repository_name)) {\n /* if connection could not be established already, do not input target connection list */\n if (count($infoData[$repository_name]) == 0)\n exit(1);\n $target_connection_string[$repository_name] = $infoData[$repository_name]['connect_str'];\n } else {\n foreach ($infoData as $key => $val) {\n /* if connection could not be established already, do not input target connection list */\n if (count($val) == 0)\n continue;\n $target_connection_string[$key] = $val['connect_str'];\n }\n }\n\n /* If instid specified, add the string that specifies the ID */\n if (isset($instid)) {\n $query_string['snapshotlist'] .= \" WHERE s.instid = $instid\";\n }\n $query_string['snapshotlist'] .= \" ORDER BY s.snapid ASC\";\n\n /* Display title */\n echo str_repeat(\"-\", 40) . \"\\n\";\n echo \"Snapshot List\\n\";\n echo str_repeat(\"-\", 40) . \"\\n\";\n\n /* Get and display the snapshot for each repositorydb */\n foreach ($target_connection_string as $key => $val) {\n\n if (!($conn = @pg_connect($val))) {\n elog(WARNING, \"Connection error.(repository database = %s)\", $key);\n continue;\n }\n\n /* Display repositorydb name */\n echo \"\\n[\" . $key . \"]\\n\\n\";\n\n $result = pg_query($conn, $query_string['snapshotlist']);\n\n for ($i = 0; $i < pg_num_fields($result); $i++) {\n printf($format_list[$i], pg_field_name($result, $i));\n }\n\n echo str_repeat(\"-\", 99) . \"\\n\";\n\n for ($i = 0; $i < pg_num_rows($result); $i++) {\n for ($j = 0; $j < pg_num_fields($result); $j++) {\n printf($format_list[$j], pg_fetch_result($result, $i, $j));\n }\n }\n\n pg_free_result($result);\n pg_close($conn);\n }\n}",
"public function get_blog_by_domain($domain)\r\n\t\t{\r\n\t\t\t$qry = \"SELECT id, domain, create_date, mod_date FROM \" . $this->tbl('blog') . \" WHERE domain = ?\";\r\n\t\t\treturn $this->db->row($qry, array($domain));\r\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation checkoutsBillingAddressByCheckoutIdAndAddressIdPutWithHttpInfo Update Checkout Billing Address | public function checkoutsBillingAddressByCheckoutIdAndAddressIdPutWithHttpInfo($checkout_id, $accept, $content_type, $address_id, $body)
{
$returnType = '\BigCommerce\Api\V3\Model\Checkout\Checkout1';
$request = $this->checkoutsBillingAddressByCheckoutIdAndAddressIdPutRequest($checkout_id, $accept, $content_type, $address_id, $body);
try {
$options = $this->createHttpClientOption();
try {
$response = $this->client->send($request, $options);
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
$e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
$e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
);
}
$statusCode = $response->getStatusCode();
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$request->getUri()
),
$statusCode,
$response->getHeaders(),
$response->getBody()
);
}
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
if ($returnType !== 'string') {
$content = json_decode($content);
}
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
} catch (ApiException $e) {
switch ($e->getCode()) {
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\BigCommerce\Api\V3\Model\Checkout\Checkout1',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
}
throw $e;
}
} | [
"public function putAddressCheckoutItem($id, $checkout = null)\n {\n list($response) = $this->putAddressCheckoutItemWithHttpInfo($id, $checkout);\n return $response;\n }",
"public function restAccountsAddressesAddressIdPutWithHttpInfo($address_id, $_rest_accounts_addresses_address_id = null)\n {\n $request = $this->restAccountsAddressesAddressIdPutRequest($address_id, $_rest_accounts_addresses_address_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 ('\\OpenAPI\\Client\\Model\\Address' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\Address', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\Address';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\OpenAPI\\Client\\Model\\Address',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function updateBillingAddress(Customweb_Payment_ExternalCheckout_IContext $context, Customweb_Payment_Authorization_OrderContext_IAddress $address);",
"public function setBillingAddressId($id);",
"public function testUpdateCompanyAddressExample()\n {\n $response = $this->withHeaders([\n 'Content-Type' => 'application/json',\n ])->json('PUT', '/api/company.address', [\n \"company_address\" => \"updated company address1\",\n \"company_id\" => 1\n ]\n );\n\n $response\n ->assertStatus(200)\n ->assertJson([\n 'status' => 'success',\n 'result' => [\n \"id\" => 1,\n \"company_address\" => \"updated company address1\"\n ]\n ]);\n }",
"public function getContactBillingAddressWithHttpInfo($id)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling getContactBillingAddress');\n }\n // parse inputs\n $resourcePath = \"/Contact/{id}/getBillingAddress\";\n $httpBody = '';\n $queryParams = [];\n $headerParams = [];\n $formParams = [];\n $_header_accept = $this->apiClient->selectHeaderAccept(['application/xml', 'application/json']);\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/text']);\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\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('token');\n if (strlen($apiKey) !== 0) {\n $queryParams['token'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'GET',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\ispserverfarm\\sevdesk\\phpclient\\Model\\ModelContactAddress',\n '/Contact/{id}/getBillingAddress'\n );\n\n return [$this->apiClient->getSerializer()->deserialize($response, '\\ispserverfarm\\sevdesk\\phpclient\\Model\\ModelContactAddress', $httpHeader), $statusCode, $httpHeader];\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\ispserverfarm\\sevdesk\\phpclient\\Model\\ModelContactAddress', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function createUpdateAddress(Address $object);",
"public function update(AddressRequest $request, $id) {\n # Find and update model using long syntax.\n # (See store for short version.)\n $address = Address::where('id', $id)->firstOrFail();\n $address->street = $request->street;\n $address->city = $request->city;\n $address->region = $request->region;\n $address->zip = $request->zip;\n $address->country = $request->country;\n $address->save();\n\n # Redirect to next page.\n return Redirect::action('AddressController@index');\n }",
"public function updateBillingAddress() {\n Log::debug(\"Entering updateBillingAddress\");\n DB::transaction(function () {\n $order = $this->getOrderData();\n if (isset($order)) {\n // update the existing billing adress or create a new one\n $address = $order->billingAddress;\n if (!isset($address))\n $address = new Address();\n $address = $this->fillOrderAddress($address);\n $address->save();\n $order->billing_address = $address->id;\n $order->save();\n }\n });\n }",
"protected function putAddressCheckoutItemRequest($id, $checkout = null)\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 putAddressCheckoutItem'\n );\n }\n\n $resourcePath = '/checkouts/{id}/step_address';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($checkout)) {\n $_tempBody = $checkout;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/ld+json', 'application/json', 'text/csv', 'text/html']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/ld+json', 'application/json', 'text/csv', 'text/html'],\n ['application/ld+json', 'application/json', 'text/csv', 'text/html']\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 $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function setBillingAddress(Address $address)\n {\n $this->billingAddress = $address;\n }",
"public function actionUpdateAddress()\n {\n $this->requireAjaxRequest();\n $orderId = craft()->request->getParam('orderId');\n $addressType = craft()->request->getParam('addressType');\n $address = craft()->request->getParam('address');\n\n $order = craft()->commerce_orders->getOrderById($orderId);\n\n if ($addressType == 'billing') {\n $billingAddress = Commerce_AddressModel::populateModel($address);\n $order->setBillingAddress($billingAddress);\n } else {\n $shippingAddress = Commerce_AddressModel::populateModel($address);\n $order->setShippingAddress($shippingAddress);\n }\n\n $order->billingAddressId = null;\n $order->shippingAddressId = null;\n\n\n if ($order->hasErrors()) {\n $this->returnErrorJson(Craft::t('Error saving address.'));\n }\n\n if (craft()->commerce_orders->saveOrder($order)) {\n $this->returnJson(['success' => true]);\n }\n }",
"public function gETOrderIdBillingAddress($order_id)\n {\n $this->gETOrderIdBillingAddressWithHttpInfo($order_id);\n }",
"public function checkoutsBillingAddressByCheckoutIdAndAddressIdPutAsyncWithHttpInfo($checkout_id, $accept, $content_type, $address_id, $body)\n {\n $returnType = '\\BigCommerce\\Api\\V3\\Model\\Checkout\\Checkout1';\n $request = $this->checkoutsBillingAddressByCheckoutIdAndAddressIdPutRequest($checkout_id, $accept, $content_type, $address_id, $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 setAddressInfo($var)\n {\n GPBUtil::checkString($var, True);\n $this->addressInfo = $var;\n\n return $this;\n }",
"public function set_billing_address_id( $value ) {\n\t\t$this->set_prop( 'billing_address_id', $value );\n\t}",
"public function findOrganizationBillingAddressWithHttpInfo($organization_id)\n {\n $returnType = '\\Bluerain\\ID4iClient\\Model\\OrganizationAddress';\n $request = $this->findOrganizationBillingAddressRequest($organization_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Bluerain\\ID4iClient\\Model\\OrganizationAddress',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Bluerain\\ID4iClient\\Model\\ApiError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Bluerain\\ID4iClient\\Model\\ApiError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Bluerain\\ID4iClient\\Model\\ApiError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 405:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Bluerain\\ID4iClient\\Model\\ApiError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 406:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Bluerain\\ID4iClient\\Model\\ApiError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 415:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Bluerain\\ID4iClient\\Model\\ApiError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Bluerain\\ID4iClient\\Model\\ApiError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function setAddress($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Talent\\V4beta1\\Address::class);\n $this->address = $var;\n\n return $this;\n }",
"public function updateAddress(Request $request){\n\t\t$v = Validator::make($request->all(), [\n \"phone\" => \"nullable|integer\",\n \"address\" => ['required',new StringSymbol()],\n \"city\" => ['required',new StringSymbol()],\n \"state\" => ['nullable',new StringSymbol()],\n \"country\" => ['required',new StringSymbol()],\n \"postal_code\" => \"required|integer\"\n ]);\n\n\t\tif ($v->fails()) {\n\t\t\treturn response()->json($v->errors(),422);\n\t\t}\n\n\t\t$user = $request->user();\n\n\t\t$request['name'] = $user->name;\n\t\t$request['email'] = $user->email;\n\t\n\t\t$user->address()->updateOrCreate(\n\t\t\t['user_id'=>$user->id],\n\t\t\t$request->all(),\n\t\t);\n\n\t\treturn response()->json($user->address);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTION: daysInMonth Find the number of days in the $month. | function daysInMonth ($month="", $year="") {
if (mb_strlen($month) > 2) { // timestamp has bee parsed
list ($day, $month, $year) = array_values($this->_breakTimestamp($month));
}
else {
if (empty($year)) $year = $this->_dateNow("%Y");
if (empty($month)) $month = $this->_dateNow("%m");
}
$months = array (31,28,31,30,31,30,31,31,30,31,30,31);
$days = $months[($month-1)];
return (($month == 2 && $this->isLeapYear($year)) ? ($days+1) : $days);
} | [
"public function GetDaysInMonth( $month = false )\r\n\t{\r\n\t\t$total_days = 0;\r\n\r\n\t\tif( !$month )\r\n\t\t\t$month = $this->tm_month;\r\n\r\n\t\t$total_days = self::$_nDaysMonth[$month];\r\n\r\n\t\tif( $month == 2 && $this->IsLeapYear() )\r\n\t\t\t$total_days++;\r\n\r\n\t\treturn( $total_days );\r\n\t}",
"function DaysCount ($month, $year) {\n return cal_days_in_month(CAL_GREGORIAN, $month, $year);\n}",
"function getDaysInMonth() {\n\t\treturn Date_Calc::daysInMonth ( $this->month, $this->year );\n\t}",
"public function daysInMonth(): int;",
"function determineDays($month){\n\tif($month == 9 || $month == 4 || $month == 6 || $month == 11){\n\t\t$days = 30;\n\t}\n\telse if($month == 2){\n\t\t$days = 28;\n\t}\n\telse{\n\t\t$days = 31;\n\t}\n\treturn $days;\n}",
"Function iDaysInMonth($month, $year)\n{\n switch($month) {\n case 4:\n case 6:\n case 9:\n case 11:\n return(30);\n break;\n case 2:\n // --- February - need to check for leapyear\n if(IsLeapYear($year))\n {\n return(29);\n }\n else\n {\n return(28);\n }\n break;\n default:\n return(31);\n break;\n }\n}",
"function days_in_month($year = null, $month = null) {\n\t\tif (is_null($year)) {\n\t\t\t$year = $this->year;\n\t\t}\n\t\t\n\t\tif (is_null($month)) {\n\t\t\t$month = $this->month;\n\t\t}\n\n\t\treturn strftime('%d', mktime(12, 0, 0, $month + 1, 0, $year)); \n\t\t\n\t}",
"static function days_in_month($m,$is_leapyear=0) {\n\t\tif ($is_leapyear>1) $is_leapyear=static::is_leapyear($is_leapyear); // passed year rather than bool\n\t\tif (is_array($m)) return static::days_in_month($m[1],static::is_leapyear($m[0]));\n\t\treturn ($m==2?28+$is_leapyear:($m<8?30+($m&1):31-($m&1))); // neat days in month algorithm\n\t}",
"public function get_days_for_month($m)\n{\n $m = intval($m);\n if ($m == 4 || $m == 6 || $m == 9 || $m == 11) {\n return 30;\n }\n elseif ($m == 02) { return 28; }\n return 31;\n}",
"function cal_days_in_month ($calendar, $month, $year) {}",
"function get_days_for_month($m)\r\n{\r\n $m = intval($m);\r\n if ($m == 4 || $m == 6 || $m == 9 || $m == 11) {\r\n return 30;\r\n }\r\n elseif ($m == 02) { return 28; }\r\n return 31;\r\n}",
"public static function days($month, $year=null){ }",
"public function getDaysInMonth()\n {\n $this->controlTimestamp();\n return date('t', $this->timestamp);\n }",
"function total_days($month,$year){\n \t$days = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);\n\t\tif($month > 0 && $year > 0){\n\t \treturn ($month == 2 && $this->is_leapYear($year)) ? 29 : $days[$month-1];\n\t\t}else return 31;\n }",
"function DaysPerMonth($year, $month) {\r\n if ($month == 1) $days = 31;\r\n else if ($month == 2) {\r\n if ($year % 400 == 0) $days = 29;\r\n else if ($year % 100 == 0) $days = 28;\r\n else if ($year % 4 == 0) $days = 29;\r\n else $days = 28;\r\n }\r\n else if ($month == 3) $days = 31;\r\n else if ($month == 4) $days = 30;\r\n else if ($month == 5) $days = 31;\r\n else if ($month == 6) $days = 30;\r\n else if ($month == 7) $days = 31;\r\n else if ($month == 8) $days = 31;\r\n else if ($month == 9) $days = 30;\r\n else if ($month == 10) $days = 31;\r\n else if ($month == 11) $days = 30;\r\n else if ($month == 12) $days = 31;\r\n return $days;\r\n}",
"public function daysInMonth() : int\n {\n return $this->format('t');\n }",
"function daysInMonth($date, $months) {\n $days = 0;\n\n for($i=0;$i<$months;$i++) {\n $days += date(\"t\", $date + $days * 24 * 60 * 60);\n }\n\n return $days;\n }",
"function dateGetNrDaysInMonth($date) {\n\treturn round(substr(dateGetEndOfMonth($date), 8,2));\n}",
"function calDaysInMonth($cal=CAL_GREGORIAN, $month, $year)\n {\n if (function_exists('cal_days_in_month')) {\n return cal_days_in_month($cal,$month,$year);\n } else {\n return date('t', mktime(0, 0, 0, $month+1, 0, $year));\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.