query
stringlengths
9
43.3k
document
stringlengths
17
1.17M
metadata
dict
negatives
sequencelengths
0
30
negative_scores
sequencelengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
Return TRUE if OpenID verification was successful
function verified($proxy=NULL) { preg_match_all('/(?<=^|&)openid\.([^=]+)=([^&]+)/', $_SERVER['QUERY_STRING'],$matches,PREG_SET_ORDER); foreach ($matches as $match) $this->args[$match[1]]=urldecode($match[2]); if (isset($this->args['mode']) && $this->args['mode']!='error' && $this->url=$this->discover($proxy)) { $this->args['mode']='check_authentication'; $var=[]; foreach ($this->args as $key=>$val) $var['openid.'.$key]=$val; $req=\Web::instance()->request( $this->url, [ 'method'=>'POST', 'content'=>http_build_query($var), 'proxy'=>$proxy ] ); return (bool)preg_match('/is_valid:true/i',$req['body']); } return FALSE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function simpleid_checkid_ok($request) {\n global $version;\n \n $message = array(\n 'openid.mode' => 'id_res',\n 'openid.op_endpoint' => simpleid_url(),\n 'openid.response_nonce' => openid_nonce()\n );\n \n if (isset($request['openid.assoc_handle'])) $message['openid.assoc_handle'] = $request['openid.assoc_handle'];\n if (isset($request['openid.identity'])) $message['openid.identity'] = $request['openid.identity'];\n if (isset($request['openid.return_to'])) $message['openid.return_to'] = $request['openid.return_to'];\n \n if (($version >= OPENID_VERSION_2) && isset($request['openid.claimed_id'])) {\n $message['openid.claimed_id'] = $request['openid.claimed_id'];\n }\n \n $message = array_merge($message, extension_invoke_all('response', TRUE, $request));\n \n log_info('OpenID authentication response: ' . log_array($message));\n return openid_indirect_message($message, $version);\n}", "function simpleid_check_authentication($request) {\n global $version;\n \n log_info('OpenID direct verification: ' . log_array($request));\n \n $is_valid = simpleid_verify_signatures($request);\n\n if ($is_valid) {\n $response = array('is_valid' => 'true');\n } else {\n $response = array('is_valid' => 'false');\n }\n \n // RP wants to check whether a handle is invalid\n if (isset($request['openid.invalidate_handle'])) {\n $invalid_assoc = cache_get('association', $request['openid.invalidate_handle']);\n \n if (!$invalid_assoc || ($invalid_assoc['created'] + SIMPLEID_ASSOC_EXPIRES_IN < time())) {\n // Yes, it's invalid\n $response['invalidate_handle'] = $request['openid.invalidate_handle'];\n }\n }\n\n log_info('OpenID direct verification response: ' . log_array($response));\n \n openid_direct_response(openid_direct_message($response, $version));\n}", "public function isVerified();", "protected function Validate() : Bool\n {\n $params = [];\n\n foreach ($this->verifyWhitelist as $k => $v) {\n if( isset($_GET[$v]) ){\n $params[$k] = $_GET[$v];\n }\n }\n\n $params[\"openid.mode\"] = \"check_authentication\"; \n \n if ( !isset($params[\"openid.return_to\"]) || $params[\"openid.return_to\"] != $this->redirectParams[\"openid.return_to\"] ){\n return false;\n } \n\n $client = $this->Client();\n\n $response = $client->request(\"POST\", $this->urlAuthorize, [ \n \"form_params\" => $params, \n \"headers\" => [ \"Accept\" => \"application/json\" ] \n ]);\n\n $response = (string) $response->getBody(); \n\n if( strpos($response, \"is_valid:true\") === false ){\n return false;\n } \n\n return true;\n }", "public function isVerified(): bool;", "function processopenidresponse() {\n\t\t$consumer = new Auth_OpenID_Consumer(new OpenIDStorage(), new SessionWrapper());\n\n\t\t$trust_root = Director::absoluteBaseURL();\n\t\t$return_to_url = $trust_root . $this->Link('ProcessOpenIDResponse');\n\n\t\t// Complete the authentication process using the server's response.\n\t\t$response = $consumer->complete($return_to_url);\n\n\t\tif($response->status == Auth_OpenID_SUCCESS) {\n\t\t\tSession::clear(\"FormInfo.Form_RegistrationWithOpenIDForm.data\");\n\t\t\t$openid = $response->identity_url;\n\n\t\t\tif($response->endpoint->canonicalID) {\n\t\t\t\t$openid = $response->endpoint->canonicalID;\n\t\t\t}\n\n\t\t\t$sreg_resp = Auth_OpenID_SRegResponse::fromSuccessResponse($response);\n\t\t\t$sreg = $sreg_resp->contents();\n\n\t\t\t// Convert the simple registration data to the needed format\n\t\t\t// try to split fullname to get firstname and surname\n\t\t\t$data = array('IdentityURL' => $openid);\n\t\t\tif(isset($sreg['nickname']))\n\t\t\t\t$data['Nickname'] = $sreg['nickname'];\n\t\t\tif(isset($sreg['fullname'])) {\n\t\t\t\t$fullname = explode(' ', $sreg['fullname'], 2);\n\t\t\t\tif(count($fullname) == 2) {\n\t\t\t\t\t$data['FirstName'] = $fullname[0];\n\t\t\t\t\t$data['Surname'] = $fullname[1];\n\t\t\t\t} else {\n\t\t\t\t\t$data['Surname'] = $fullname[0];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(isset($sreg['country']))\n\t\t\t\t$data['Country'] = $sreg['country'];\n\t\t\tif(isset($sreg['email']))\n\t\t\t\t$data['Email'] = $sreg['email'];\n\n\t\t\tSession::set(\"FormInfo.Form_RegistrationForm.data\", $data);\n\t\t\treturn $this->redirect($this->Link('register'));\n\t\t}\n\n\n\t\t// The server returned an error message, handle it!\n\t\tif($response->status == Auth_OpenID_CANCEL) {\n\t\t\t$error_message = _t('ForumMemberProfile.CANCELLEDVERIFICATION','The verification was cancelled. Please try again.');\n\t\t} else if($response->status == Auth_OpenID_FAILURE) {\n\t\t\t$error_message = _t('ForumMemberProfile.AUTHENTICATIONFAILED','The OpenID/i-name authentication failed.');\n\t\t} else {\n\t\t\t$error_message = _t('ForumMemberProfile.UNEXPECTEDERROR','An unexpected error occured. Please try again or register without OpenID');\n\t\t}\n\n\t\t$this->RegistrationWithOpenIDForm()->addErrorMessage(\"Blurb\",\n\t\t\t$error_message, 'bad');\n\n\t\treturn $this->redirect($this->Link('registerwithopenid'));\n\t}", "function isVerified(){\n\n}", "function verify () {\n// $aop->alipayrsaPublicKey='MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjUzhXrdJ7GDsgJ59fMLlk7hyYrXkkeGwnYD/eO2HBZh39Y9gTfLJ61Yogc7keOn2uAnZY/zBlw3n+T6mb6/5JYFgvXQi8Qzeh6BkBrNnROu+k4PjhmSbORJFoLrrIxDnsYkQ995kYYhpbS0yf2Al++55v4SrD3/YoVBhWPcRg4xI0QD94FLwhCmcCkft/ILRtUxQk2QeVPLSesvMx2mmUK2L2x2hFA8ewRoGmUdG2Fu9YFIxk//16RI+H7KI8LaoXoVDqHobPae9p0ACE7k9G5vs/cYuikSMKu+lnxghte1jNO+CqrvTP4Pes/mW4e7CEMCTAmEnsXLUrQ6FpfKMcQIDAQAB';\n return $this->aop->rsaCheckV1($_POST, NULL, \"RSA2\");\n }", "function is_verified()\n {\n return false;\n }", "public function verify()\n {\n if (!$this->user->validateOtpByIdentityLoggedIn($this->otp)) {\n $this->addError('otp', Yii::t('app', 'Otp is invalid!'));\n\n return false;\n } else {\n return true;\n }\n }", "function simpleid_verify_signatures($request) {\n global $version;\n \n log_info('simpleid_verify_signatures');\n \n $is_valid = TRUE;\n \n $assoc = (isset($request['openid.assoc_handle'])) ? cache_get('association', $request['openid.assoc_handle']) : NULL;\n $stateless = (isset($request['openid.response_nonce'])) ? cache_get('stateless', $request['openid.response_nonce']) : NULL;\n \n if (!$assoc) {\n log_notice('simpleid_verify_signatures: Association not found.');\n $is_valid = FALSE;\n } elseif (!$assoc['assoc_type']) {\n log_error('simpleid_verify_signatures: Association does not contain valid assoc_type.');\n $is_valid = FALSE;\n } elseif (!isset($assoc['private']) || ($assoc['private'] != 1)) {\n log_warn('simpleid_verify_signatures: Attempting to verify an association with a shared key.');\n $is_valid = FALSE;\n } elseif (!$stateless || ($stateless['assoc_handle'] != $request['openid.assoc_handle'])) {\n log_warn('simpleid_verify_signatures: Attempting to verify a response_nonce more than once, or private association expired.');\n $is_valid = FALSE;\n } else {\n $mac_key = $assoc['mac_key'];\n $assoc_types = openid_association_types();\n $hmac_func = $assoc_types[$assoc['assoc_type']]['hmac_func'];\n \n $signed_keys = explode(',', $request['openid.signed']);\n $signature = openid_sign($request, $signed_keys, $mac_key, $hmac_func, $version);\n log_debug('***** Signature: ' . $signature);\n \n if ($signature != $request['openid.sig']) {\n log_warn('simpleid_verify_signatures: Signature supplied in request does not match the signatured generated.');\n $is_valid = FALSE;\n }\n \n cache_delete('stateless', $request['openid.response_nonce']);\n }\n \n return $is_valid;\n}", "public function verify();", "public function verified()\n {\n return $this->verifyToken === null;\n }", "protected function IsReturned() : bool\n {\n return isset($_GET[\"openid_mode\"]) && !empty($_GET[\"openid_mode\"]); \n }", "public function authIsOk() {\n return $this->userID !== 0;\n }", "function simpleid_checkid_approval_required($request) {\n global $version;\n \n if ($version >= OPENID_VERSION_2) {\n $message = array('openid.mode' => 'setup_needed');\n } else {\n $request['openid.mode'] = 'checkid_setup';\n $message = array(\n 'openid.mode' => 'id_res', \n 'openid.user_setup_url' => simpleid_url('continue', 's=' . rawurlencode(pickle($request)))\n );\n }\n \n $message = array_merge($message, extension_invoke_all('response', FALSE, $request));\n \n log_info('OpenID authentication response: ' . log_array($message));\n return openid_indirect_message($message, $version);\n}", "private static function verify() {\r\n\t\t// create code object for the given code we will be verifying\r\n\t\tif (!isset($_SESSION['user'])) {\r\n\t\t\tself::alertMessage('danger', 'Unable to find session user data. Try logging out and logging in again.');\r\n\t\t\tVerificationView::show();\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t$userID = $_POST['userID'] = $_SESSION['user']->getUserID();\r\n\t\t$code = new VerificationCode($_POST);\r\n\r\n\t\t// load and validate expected code from database\r\n\t\t$codeInDatabase = VerificationCodesDB::get($userID);\r\n\t\tif (is_null($codeInDatabase)) {\r\n\t\t\tself::alertMessage('danger', 'No active verification code found. Your code may have expired. Click \"Resend Code\" to send a new code to your phone.');\r\n\t\t\tVerificationView::show();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// compare given/expected codes\r\n\t\tif ($code->getCode() !== $codeInDatabase->getCode()) {\r\n\t\t\tself::alertMessage('danger', 'The code you entered is incorrect. Please check your code and try again.');\r\n\t\t\tVerificationView::show();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// verification successful. mark phone number as verified\r\n\t\t$user = UsersDB::getUser($userID);\r\n\t\t$user->setIsPhoneVerified(true);\r\n\t\tUsersDB::edit($user);\r\n\t\t$_SESSION['user'] = $user;\r\n\r\n\t\t// clean up and show dashboard\r\n\t\tVerificationCodesDB::clear($userID);\r\n\t\tDashboardView::show();\r\n\t}", "public function doVerification() {\n $this->validate ( $this->request, $this->getRules () );\n $user = $this->_user->where ( StringLiterals::EMAIL, $this->decodeParam ( $this->request->user ) )->where ( 'otp', $this->request->otp )->first ();\n if (count ( $user ) > 0) {\n Auth::loginUsingId ( $user->id );\n return true;\n } else {\n return false;\n }\n }", "function verify_person () {\n $bh=new gs_base_handler($this->data,$this->params);\n $f=$bh->validate();\n if (!is_object($f) || !is_a($f,'g_forms')) return $f;\n $d=$f->clean();\n\n $rec=person($this->params['role']);\n if (!$rec) {\n $f->trigger_error('FORM_ERROR','REC_NOTFOUND');\n return $bh->showform($f);\n }\n\n $fname=$this->params['field_name'].'_secret';\n $ga=new GoogleAuthenticator;\n $code=$ga->getCode($rec->$fname);\n\n\n if ($code!=$d['ga_code']) {\n $f->trigger_error('FORM_ERROR','GA_INCORRECT_CODE');\n return $bh->showform($f);\n }\n\n $person=person();\n $fname=$this->params['field_name'].'_verified';\n $person->$fname=TRUE;\n return true;\n }", "public function check()\n {\n if($this->user_provider->retrieveById($this->user_provider->getAuthIdentifier()))\n return true;\n\n return false;\n }", "public function verifyIdToken( $token ) {\n\n\t\t$config = $this->getConfig();\n\t\t$jwk = Security::getOpenIdJWK( $token, $config );\n\t\t$verifiedTokenData = Security::openIdVerifyToken( $token, $jwk );\n\n\t\tif( !$verifiedTokenData ) \n\t\t\treturn false;\n\t\t\n\t\treturn $verifiedTokenData[\"payload\"];\n\t}", "function simpleid_checkid_identity(&$request, $immediate) {\n global $user, $version;\n \n $realm = openid_get_realm($request, $version);\n \n // Check 1: Is the user logged into SimpleID as any user?\n if ($user == NULL) {\n return CHECKID_LOGIN_REQUIRED;\n } else {\n $uid = $user['uid'];\n }\n \n // Check 2: Is the user logged in as the same identity as the identity requested?\n // Choose the identity URL for the user automatically\n if ($request['openid.identity'] == OPENID_IDENTIFIER_SELECT) {\n $test_user = user_load($uid);\n $identity = $test_user['identity'];\n \n log_info('OpenID identifier selection: Selected ' . $uid . ' [' . $identity . ']');\n } else {\n $identity = $request['openid.identity'];\n $test_user = user_load_from_identity($identity);\n }\n if ($test_user == NULL) return CHECKID_IDENTITY_NOT_EXIST;\n if ($test_user['uid'] != $user['uid']) {\n log_notice('Requested user ' . $test_user['uid'] . ' does not match logged in user ' . $user['uid']);\n return CHECKID_IDENTITIES_NOT_MATCHING;\n }\n \n // Pass the assertion to extensions\n $assertion_results = extension_invoke_all('checkid_identity', $request, $identity, $immediate);\n $assertion_results = array_merge(array_diff($assertion_results, array(NULL)));\n \n // Populate the request with the selected identity\n if ($request['openid.identity'] == OPENID_IDENTIFIER_SELECT) {\n $request['openid.claimed_id'] = $identity;\n $request['openid.identity'] = $identity;\n }\n \n // Check 3: Discover the realm and match its return_to\n $user_rp = (isset($user['rp'][$realm])) ? $user['rp'][$realm] : NULL;\n\n if (($version >= OPENID_VERSION_2) && SIMPLEID_VERIFY_RETURN_URL_USING_REALM) {\n $verified = FALSE;\n \n $rp_info = simpleid_get_rp_info($realm);\n $services = discovery_get_service_by_type($rp_info['services'], OPENID_RETURN_TO);\n \n log_info('OpenID 2 discovery: ' . count($services) . ' matching services');\n \n if ($services) {\n $return_to_uris = array();\n \n foreach ($services as $service) {\n $return_to_uris = array_merge($return_to_uris, $service['uri']);\n }\n foreach ($return_to_uris as $return_to) {\n if (openid_url_matches_realm($request['openid.return_to'], $return_to)) {\n log_info('OpenID 2 discovery: verified');\n $verified = TRUE;\n break;\n }\n }\n }\n \n $rp_info['return_to_verified'] = $verified;\n simpleid_set_rp_info($realm, $rp_info);\n \n if (!$verified) {\n if (($user_rp != NULL) && ($user_rp['auto_release'] == 1)) {\n log_notice('OpenID 2 discovery: not verified, but overridden by user preference');\n } else {\n log_notice('OpenID 2 discovery: not verified');\n $assertion_results[] = CHECKID_RETURN_TO_SUSPECT;\n }\n }\n }\n \n // Check 4: For checkid_immediate, the user must already have given\n // permission to log in automatically. \n if (($user_rp != NULL) && ($user_rp['auto_release'] == 1)) {\n log_info('Automatic set for realm ' . $realm);\n $assertion_results[] = CHECKID_OK;\n return min($assertion_results);\n } else {\n $assertion_results[] = CHECKID_APPROVAL_REQUIRED;\n return min($assertion_results);\n }\n}", "public function verify($token):bool;", "public function isAuthenticatedSuccessfully(): bool;", "private function _checkIdent()\n {\n $auth = Zend_Auth::getInstance();\n $auth->setStorage(new Zend_Auth_Storage_Session('hl_connect'));\n \n if ($auth->hasIdentity())\n $this->_agentSchemeNumber = $auth->getStorage()->read()->agentschemeno;\n \n return $auth->hasIdentity();\n }", "public function isVerified()\n\t{\n\t\tif (($record=$this->getActiveRecord())===null) {\n\t\t\treturn false;\n\t\t}\n\t\treturn (bool)$record->correo_verificado;\n\t}", "public function isVerified()\n\t{\n\t\tif($this->test_status_id == Test::VERIFIED)\n\t\t\treturn true;\n\t\telse \n\t\t\treturn false;\n\t}", "function is_verified()\n {\n if( ereg(\"VERIFIED\", $this->paypal_response) )\n {\n return true;\n }\n else\n {\n return false;\n }\n\n }", "public function verify() {\r\n $stmp = $this->_db->prepare(\"SELECT `id`,`email` FROM `anope_db_NickCore` WHERE `display`= ? AND `pass` = ?;\");\r\n $stmp->execute(array($this->_username,$this->_password));\r\n \r\n if ($stmp->rowCount() == \"1\") {\r\n $row = $stmp->fetch(PDO::FETCH_ASSOC);\r\n $this->_id = $row['id'];\r\n $this->_email = $row['email'];\r\n return $this->_id;\r\n }\r\n else {\r\n return false;\r\n }\r\n }", "function checkAuth($doRedirect) {\n\t\tif (isset($_SESSION[\"onidid\"]) && $_SESSION[\"onidid\"] != \"\") return $_SESSION[\"onidid\"];\n\n\t\t// create URL as callback\n\t\t$pageURL = 'http';\n\t\tif (isset($_SERVER[\"HTTP\"]) && $_SERVER[\"HTTP\"] == \"on\") {$pageURL .= \"s\";}\n\t\t$pageURL .= \"://\";\n\t\tif ($_SERVER[\"SERVER_PORT\"] != \"80\") {\n\t\t\t$pageURL .= $_SERVER[\"SERVER_NAME\"].\":\".$_SERVER[\"SERVER_PORT\"].$_SERVER[\"SCRIPT_NAME\"];\n\t\t} else {\n\t\t\t$pageURL .= $_SERVER[\"SERVER_NAME\"].$_SERVER[\"SCRIPT_NAME\"];\n\t\t}\n\n\t\t// check for ticket\n\t\t$ticket = isset($_REQUEST[\"ticket\"]) ? $_REQUEST[\"ticket\"] : \"\";\n\n\t\t// if ticket then set ONID session, else send to login\n\t\tif ($ticket != \"\") {\n\t\t\t$url = \"https://login.oregonstate.edu/cas/serviceValidate?ticket=\".$ticket.\"&service=\".$pageURL;\n\t\t\t$html = file_get_contents($url);\n\t\t\t$onididPattern = '/\\\\<cas\\\\:user\\\\>([a-zA-Z0-9]+)\\\\<\\\\/cas\\\\:user\\\\>/';\n\t\t\t$firstnamePattern = '/\\\\<cas\\\\:firstname\\\\>([a-zA-Z0-9]+)\\\\<\\\\/cas\\\\:firstname\\\\>/';\n\t\t\t$lastnamePattern = '/\\\\<cas\\\\:lastname\\\\>([a-zA-Z0-9]+)\\\\<\\\\/cas\\\\:lastname\\\\>/';\n\t\t\tpreg_match($onididPattern, $html, $onididMatches);\n\t\t\tpreg_match($firstnamePattern, $html, $firstnameMatches);\n\t\t\tpreg_match($lastnamePattern, $html, $lastnameMatches);\n\t\t\tif ($onididMatches && count($onididMatches) > 0 && $firstnameMatches && count($firstnameMatches) > 0 && $lastnameMatches && count($lastnameMatches) > 0) {\n\t\t\t\t$onidid = $onididMatches[1];\n\t\t\t\t$_SESSION[\"onidid\"] = $onidid;\n\n\t\t\t\t$firstname = $firstnameMatches[1];\n\t\t\t\t$_SESSION['firstname'] = $firstname;\n\n\t\t\t\t$lastname = $lastnameMatches[1];\n\t\t\t\t$_SESSION['lastname'] = $lastname;\n\n\t\t\t\t$_SESSION[\"ticket\"] = $ticket;\n\t\t\t\treturn $onidid;\n\t\t\t}\n\t\t} else if ($doRedirect) {\n\t\t\t$url = \"https://login.oregonstate.edu/cas/login?service=\".$pageURL;\n\t\t\techo \"<script>location.replace('\" . $url . \"');</script>\";\n\t\t}\n\n\t\treturn \"\";\n\t}" ]
[ "0.73925734", "0.69684803", "0.67869836", "0.6735506", "0.6664794", "0.66517764", "0.6561427", "0.65513575", "0.65010786", "0.6498432", "0.6449355", "0.6417599", "0.6397924", "0.6354561", "0.63356715", "0.63136905", "0.6278225", "0.6266145", "0.62433296", "0.62351215", "0.6223248", "0.6144716", "0.60977703", "0.6093364", "0.60889596", "0.6087161", "0.6081175", "0.6065847", "0.60590553", "0.6057337" ]
0.76412565
0
/ This PHP file contains Cookie Ultilities Accessing Cookies with PHP
function getCookiesInfo(){ echo "Cookies information: <br>"; if( isset($_COOKIE["name"])){ echo "_COOKIE[\"name\"]: " . $_COOKIE["name"] . "<br />"; } else{ echo "Sorry... _COOKIE[\"name\"] is not set yet !" . "<br />"; } //echo "HTTP_COOKIE_VARS[\"name\"]: " . $HTTP_COOKIE_VARS["name"]. "<br />"; //echo "_COOKIE[\"age\"]: " . $_COOKIE["age"] . "<br />"; //echo "HTTP_COOKIE_VARS[\"name\"]: " . $HTTP_COOKIE_VARS["name"] . "<br />"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_cookies()\n {\n }", "function doCookies() {\r\n setcookie(\"cli_num\", 123456789, time() + (86400 * 1), \"/\");\r\n setcookie(\"cli_fname\", $_POST['first_name'], time() + (86400 * 1), \"/\");\r\n setcookie(\"cli_lname\", $_POST['last_name'], time() + (86400 * 1), \"/\");\r\n setcookie(\"cli_dob\", $_POST['dob'], time() + (86400 * 1), \"/\");\r\n setcookie(\"cli_email\", $_POST['email'], time() + (86400 * 1), \"/\");\r\n setcookie(\"cli_phone\", $_POST['phone'], time() + (86400 * 1), \"/\");\r\n setcookie(\"cli_add\", $_POST['address'], time() + (86400 * 1), \"/\");\r\n \r\n /* //print the cookies\r\n echo \"Value is: \" . $_COOKIE[\"cli_num\"];\r\n echo \"Value is: \" . $_COOKIE[\"cli_fname\"];\r\n echo \"Value is: \" . $_COOKIE[\"cli_lname\"];\r\n echo \"Value is: \" . $_COOKIE[\"cli_dob\"];\r\n echo \"Value is: \" . $_COOKIE[\"cli_email\"];\r\n echo \"Value is: \" . $_COOKIE[\"cli_phone\"];\r\n echo \"Value is: \" . $_COOKIE[\"cli_add\"];*/\r\n \r\n}", "public function getCookies()\n {\n\n }", "function Cookies()\n{\n //en bewaar zijn antwoord in een sessievariabele\n\n\n //check of eerder al een antwoord ivm de cookies opgeslagen werd in de sessievariabele,\n //zoniet toon dan de cookies-tekst en stop de PHP code uitvoering\n\n //toon in een hidden div waarop de gebruiker geklikt heeft (cookies geaccepteerd of niet)\n\n}", "function setcookies()\n\t{\n\t\tfor($x=0; $x<count($this->headers); $x++)\n\t\t{\n\t\tif(preg_match('/^set-cookie:[\\s]+([^=]+)=([^;]+)/i', $this->headers[$x],$match))\n\t\t\t$this->cookies[$match[1]] = urldecode($match[2]);\n\t\t}\n\t}", "public function getCookieVariables();", "function ms_cookie_constants()\n {\n }", "public function getCookie(): array;", "function getCookie($username, $pass) {\n\t\t\t\tglobal $botinfo, $clientinfo, $Crono;\n\t\tconsole( \"Attempting to get Certificate.. \", \"Core\");\n\t\t// Method to get the cookie! Yeah! :D\n\t\t// Our first job is to open an SSL connection with our host.\n\t\t$this->socket = fsockopen(\"ssl://www.deviantart.com\", 443);\n\t\tconsole( \"[Cookie] - Opened socket!\", \"Core\");\n\t\t// If we didn't manage that, we need to exit!\n\t\tif($this->socket === false) {\n\t\tconsole( \"Error: Please check your internet connection!\", \"Core\");\n\t\t}\n\t\t// Fill up the form payload\n\t\t$POST = '&username='.urlencode($username);\n\t\t$POST.= '&password='.urlencode($pass);\n\t\t$POST.= '&remember_me=1';\n\t\t// And now we send our header and post data and retrieve the response.\n\t\t$response = $this->send_headers(\n\t\t\t$this->socket,\n\t\t\t\"www.deviantart.com\",\n\t\t\t\"/users/login\",\n\t\t\t\"http://www.deviantart.com/users/rockedout\",\n\t\t\t$POST\n\t\t);\n\t \n\t\t// Now that we have our data, we can close the socket.\n\t\tfclose ($this->socket);\n\t\t// And now we do the normal stuff, like checking if the response was empty or not.\n\t\tif(empty($response))\n\t\treturn 'No response returned from the server';\n\t\tif(stripos($response, 'set-cookie') === false)\n\t\treturn 'No cookie returned';\n\t\t// Grab the cookies from the header\n\t\t$response=explode(\"\\r\\n\", $response);\n\t\t$cookie_jar = array();\n\t\tforeach ($response as $line)\n\t\t\tif (strpos($line, \"Set-Cookie:\")!== false)\n\t\t\t\t$cookie_jar[] = substr($line, 12, strpos($line, \"; \")-12);\n\n\t\t// Using these cookies, we're gonna go to chat.deviantart.com and get\n\t\t// our authtoken from the dAmn client.\n\t\tif (($this->socket = @fsockopen(\"ssl://www.deviantart.com\", 443)) == false)\n\t\t return 'Could not open an internet connection';\n\n\t\t$response = $this->send_headers(\n\t\t\t$this->socket,\n\t\t\t\"chat.deviantart.com\",\n\t\t\t\"/chat/\",\n\t\t\t\"http://chat.deviantart.com\",\n\t\t\tnull,\n\t\t\t$cookie_jar\n\t\t);\n\n\t\t// Now search for the authtoken in the response\n\t\t$cookie = null;\n\t\tif (($pos = strpos($response, \"dAmn_Login( \")) !== false)\n\t\t{\n\t\t\t$response = substr($response, $pos+12);\n\t\t\t$cookie = substr($response, strpos($response, \"\\\", \")+4, 32);\n\t\t}\n\t\telse return 'No authtoken found in dAmn client';\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t// Because errors still happen, we need to make sure we now have an array!\n\t\tif(!$cookie)\n\t\treturn 'Malformed cookie returned';\n\t\t// We got a valid cookie!\n\t\tglobal $dAmn, $running;\n\t\t$running = true;\n\t\t$dAmn->cookie = $cookie;\n\t\treturn $cookie;\n\t\tconsole( \"Cookie: \".$cookie, \"Connection\"\t\t);\n\t}", "protected function __setCookie()\n\t{\n\t\t$this->Cookie->type('cipher');\n\t\t$this->Cookie->name = 'Stats';\n\t\t$this->Cookie->time = '90 days';\n\t\t$this->Cookie->path = '/';\n\n\t\t# Dev or production server\n\t\tif (empty($_SERVER['APPLICATION_ENV'])) {\n\t\t\t$domain = get_domain(env('HTTP_HOST'));\n\t\t\t$domain = \"cms.muoriginfree.com\";\n\t\t\t#$domain = '45.117.77.125';\n\t\t} else {\n\t\t\t$domain = env('HTTP_HOST');\n\t\t}\n\t\t$this->Cookie->domain = $domain;\n\t\t\n\t\t$this->Cookie->key = 'quanvh_qSdd%ddId2121232xdddddxqADYhG93b0qyJfIxfs1232guVoUubWwvaniR2G0FgaC9mis*&saX6Owsd121!';\n\t}", "protected function handle_cookie()\n {\n }", "function verifyCookies()\n\t{\n\t\tif (isset($_COOKIE['cookieUserName']))\n\t\t{\n\t\t\techo json_encode(array('cookieUserName' => $_COOKIE['cookieUserName']));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t# Cookie not set yet\n\t\t die(json_encode(errors(417)));\n\t\t}\n\t}", "function wp_cookie_constants()\n {\n }", "protected function _setCookies() {\n\t\tforeach ($this->_cookies as $name => $c) {\n\t\t\tsetcookie(\n\t\t\t\t$name, $c['value'], $c['expire'], $c['path'],\n\t\t\t\t$c['domain'], $c['secure'], $c['httpOnly']\n\t\t\t);\n\t\t}\n\t}", "public function loadCookies($username = '');", "function check_cookie($value){\n \n}", "public function set_cookie()\n {\n }", "function get_cookie($name)\n{\n if (isset($_COOKIE[$name])) {\n return json_decode(base64_decode(stripslashes($_COOKIE[$name])), true);\n }\n\n return array();\n}", "function testCookies() {\n\t$config = getConfig();\n\t$root = getRootPath();\n\t\n\t// Get the test page.\n\t$http = new \\AutoHttp\\Http($config);\n\t$page = $http->getPage($root . '/test/pages/http/cookie.php');\n\t\n\t// Verify we didn't send a cookie.\n\tif (strpos($page['body'], \"Cookie named 'user' is not set!\") === false)\n\t\treturn 'The cookie shouldn\\'t be set on our first page access.';\n\t\t\n\t// Get the page again.\n\t$page = $http->getPage($root . '/test/pages/http/cookie.php');\n\t\n\t// Verify we sent a cookie this time.\t\t\n\tif (strpos($page['body'], \"Cookie 'user' is set!\") === false ||\n\t\tstrpos($page['body'], \"Value is: John Doe\") === false)\n\t\treturn 'The cookie should be set on our second page access.';\n\t\t\n\treturn true;\n}", "function getCookies(){\n\t\treturn $this->_HTTPCookies;\n\t}", "public function enableCookies() {}", "public function cookies() {\n $cookies = $this->command('cookies');\n $objCookies = array();\n foreach ($cookies as $cookie) {\n $objCookies[$cookie[\"name\"]] = new Cookie($cookie);\n }\n return $objCookies;\n }", "function get_cookie() {\n\tglobal $_COOKIE;\n\t// $_COOKIE['main_user_id_1'] = '22760600|2c3a1c1487520d9aaf15917189d5864';\n\t$hid = explode ( \"|\", $_COOKIE ['main_tcsso_1'] );\n\t$handleName = $_COOKIE ['handleName'];\n\t// print_r($hid);\n\t$hname = explode ( \"|\", $_COOKIE ['direct_sso_user_id_1'] );\n\t$meta = new stdclass ();\n\t$meta->handle_id = $hid [0];\n\t$meta->handle_name = $handleName;\n\treturn $meta;\n}", "function store_cookies($cookie_file)\n\t{\n\t\t//连接关闭以后,存放cookie信息的文件名称 (cookies stored in $cookie_file)\n\t\tcurl_setopt ($this->ch, CURLOPT_COOKIEJAR, $cookie_file);\n\t\t//包含cookie信息的文件名称,这个cookie文件可以是Netscape格式或者HTTP风格的header信息\n\t\tcurl_setopt ($this->ch, CURLOPT_COOKIEFILE, $cookie_file);\n\t}", "function define_settings_cookie()\n\t{\n\t\t\n\t\t$settings = json_decode($_COOKIE['doctor'], TRUE);\n\t\t\n\t\t//Did the user change the theme?\n\t\tif ( isset($_POST['theme']) && ($settings['theme'] != $_POST['theme']) ) $settings = define_theme_colors($_POST['theme'], $settings);\n\n\t\t//Were the .htpasswd credentials changed?\n\t\tif (isset($_POST['enableHtaccess']))\n\t\t{\n\t\t\tif ( update_htacess_protection($_POST['htaccess']) ) \n\t\t\t{\n\t\t\t\tif ($_POST['enableHtaccess'] == 'true') $settings['htpasswd'] = TRUE;\n\t\t\t\telse $settings['htpasswd'] = FALSE;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$settings = json_encode($settings);\n\t\tsetcookie( 'doctor', $settings, time()+(3600*24)*30, '/' );\n\t}", "protected function setCookies() {\n $this->cookies = array();\n\n $headers = $this->getHeader(Header::HEADER_COOKIE);\n if (!$headers) {\n return;\n }\n\n if (!is_array($headers)) {\n $headers = array($headers);\n }\n\n foreach ($headers as $header) {\n $cookies = explode(';', $header);\n foreach ($cookies as $cookie) {\n if (strpos($cookie, '=')) {\n list($name, $value) = explode('=', trim($cookie), 2);\n } else {\n $name = $cookie;\n $value = true;\n }\n\n $this->cookies[$name] = $value;\n }\n }\n }", "public function cookie($name);", "function setUrlCookie($url, $postdata, $username)\n\t{\n\t\t// check the user cookie whether exists\n\t\t// if not, create a new cookie file\n\t\t// else use the same filename \n\t\t/* 可能有bug */\n\t\t//$status = 400;\n\t\t//$response = NULL;\n\t\t$chk_cookie = glob('./cookie/'.$username.'*');\n\t\tif($chk_cookie != null) {\n\t\t\tpreg_match(\"/[^(.\\/cookie\\/)].*/\", $chk_cookie[0], $match);\n\t\t\t$cookie_jar = \"/usr/local/www/apache22/data/curl_test/cookie/\".$match[0];\n\t\t\t//echo $cookie_jar.\"<br>\";\n\t\t}\n\t\telse {\n\t\t\t$cookie_jar = tempnam('./cookie/',$username); // Create file with unique file name (cookie*)\n\t\t\t//echo $cookie_jar.\"<br>\";\n\t\t}\n\t\t//$cookie_jar = \"./cookie/\".$username.\"cookie.txt\";\n\n\t\t$resource = curl_init();\n\t\tcurl_setopt($resource, CURLOPT_URL, $url);\n\t\tcurl_setopt($resource, CURLOPT_POST, 1);\n\t\tcurl_setopt($resource, CURLOPT_POSTFIELDS, $postdata);\n\t\tcurl_setopt($resource, CURLOPT_COOKIEJAR, $cookie_jar);\n\t\tcurl_setopt($resource, CURLOPT_COOKIEFILE, $cookie_jar);\n\t\tcurl_setopt($resource, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_exec($resource);\n\n\t\t// echo cookie filename to front-end, it will be used to auth user identity.\n\t\tpreg_match(\"/[^(\\/usr\\/local\\/www\\/apache22\\/data\\/curl_test\\/cookie\\/)].*/\",$cookie_jar, $match);\n\t\t\n\t\t//if(filesize('cookie/'.$match[0]) > 0) {\n\t\t//clearstatcache();\n\t\t//echo filesize($cookie_jar);\n\t\t/*\n\t\tif(filesize($cookie_jar) > 0)\n\t \t{\n\t\t\t$response = $match[0];\n\t\t\t$status = 200;\n\t\t}\n\t\telse {\n\t\t\t$response = \"error\";\n\t\t}\n\n\t\t\n\t\t$response_arr = array(\"status_code\" => $status,\n\t\t \"response\" => $response\n\t\t );\n\t\techo json_encode($response_arr, JSON_UNESCAPED_UNICODE);\n\t\t*/\n\t\treturn $match[0];\n\t}", "public function test_protected_setCookie()\n {\n $cookies = $this->object->getCookies($this->serviceUrl_1c);\n $this->assertInternalType('array', $cookies);\n $this->assertEquals(1, count($cookies));\n $this->assertEquals('k1jut1r1bqrumpei837kk4jks0', $cookies['SID']);\n }", "#[Pure]\nfunction http_parse_cookie($cookie, $flags = null, ?array $allowed_extras = null) {}" ]
[ "0.7423709", "0.72413534", "0.7023248", "0.70126003", "0.6996902", "0.69403803", "0.6939797", "0.68988234", "0.68562573", "0.670981", "0.67063296", "0.66999906", "0.667409", "0.6648376", "0.66480535", "0.6637746", "0.6601291", "0.65902483", "0.658814", "0.658149", "0.65789473", "0.6566378", "0.65600854", "0.654815", "0.6541792", "0.6537552", "0.6532931", "0.6527763", "0.65251553", "0.6521967" ]
0.7251826
1
The only action of this controller. This action is used to rewrite the backend Config saveTemplateAction and save additional data.
public function saveTemplateAction() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function saveAction() :void\n {\n $data = $this->request->getPost();\n $record = ModuleTemplate::findFirst();\n if ($record === null) {\n $record = new ModuleTemplate();\n }\n $this->db->begin();\n foreach ($record as $key => $value) {\n switch ($key) {\n case 'id':\n break;\n case 'checkbox_field':\n case 'toggle_field':\n if (array_key_exists($key, $data)) {\n $record->$key = ($data[$key] === 'on') ? '1' : '0';\n } else {\n $record->$key = '0';\n }\n break;\n default:\n if (array_key_exists($key, $data)) {\n $record->$key = $data[$key];\n } else {\n $record->$key = '';\n }\n }\n }\n\n if ($record->save() === FALSE) {\n $errors = $record->getMessages();\n $this->flash->error(implode('<br>', $errors));\n $this->view->success = false;\n $this->db->rollback();\n return;\n }\n\n $this->flash->success($this->translation->_('ms_SuccessfulSaved'));\n $this->view->success = true;\n $this->db->commit();\n }", "public function saveTemplate($onlyIfUpdated = false) {}", "public function saveAction() {\n parent::saveAction();\n }", "public function savetemplate()\n\t{\n\t\t// Get form data\n\t\t$template_name = ee()->input->get_post('template_name');\n\t\t$template = ee()->input->get_post('json-ld-template-final');\n\n\t\t// Write it to database\n\t\t$data = [\n\t\t\t'template_name' => $template_name,\n\t\t\t'template_text' => $template\n\t\t];\n\n\t\tee()->db->insert('exp_json_ld_templates', $data);\n\n\t\t// return index view\n\t\treturn $this->index();\n\t}", "public function save()\n\t{\n\t\tglobal $tpl, $lng, $ilCtrl;\n\t\n\t\t$pl = $this->getPluginObject();\n\t\t\n\t\t$form = $this->initConfigurationForm();\n\t\tif ($form->checkInput())\n\t\t{\n\t\t\t$set1 = $form->getInput(\"setting_1\");\n\t\t\t$set2 = $form->getInput(\"setting_2\");\n\t\n\t\t\t// @todo: implement saving to db\n\t\t\t\n\t\t\tilUtil::sendSuccess($pl->txt(\"saving_invoked\"), true);\n\t\t\t$ilCtrl->redirect($this, \"configure\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$form->setValuesByPost();\n\t\t\t$tpl->setContent($form->getHtml());\n\t\t}\n\t}", "public function execute()\n {\n $request = $this->getRequest();\n $id = $this->getRequest()->getParam('id');\n\n $template = $this->_initTemplate('id');\n if (!$template->getId() && $id) {\n $this->messageManager->addErrorMessage(__('This email template no longer exists.'));\n $this->_redirect('adminhtml/*/');\n return;\n }\n\n try {\n $template->setTemplateSubject(\n $request->getParam('template_subject')\n )->setTemplateCode(\n $request->getParam('template_code')\n )->setTemplateText(\n $request->getParam('template_text')\n )->setTemplateStyles(\n $request->getParam('template_styles')\n )->setModifiedAt(\n $this->_objectManager->get(\\Magento\\Framework\\Stdlib\\DateTime\\DateTime::class)->gmtDate()\n )->setOrigTemplateCode(\n $request->getParam('orig_template_code')\n )->setOrigTemplateVariables(\n $request->getParam('orig_template_variables')\n );\n\n if (!$template->getId()) {\n $template->setTemplateType(TemplateTypesInterface::TYPE_HTML);\n }\n\n if ($request->getParam('_change_type_flag')) {\n $template->setTemplateType(TemplateTypesInterface::TYPE_TEXT);\n $template->setTemplateStyles('');\n }\n\n $template->save();\n $this->_objectManager->get(\\Magento\\Backend\\Model\\Session::class)->setFormData(false);\n $this->messageManager->addSuccessMessage(__('You saved the email template.'));\n $this->_redirect('adminhtml/*');\n } catch (\\Exception $e) {\n $this->_objectManager->get(\n \\Magento\\Backend\\Model\\Session::class\n )->setData(\n 'email_template_form_data',\n $request->getParams()\n );\n $this->messageManager->addErrorMessage($e->getMessage());\n $this->_forward('new');\n }\n }", "protected function _postSave()\n\t{\n\t\t$templateTitles = array($this->get('template_title'), $this->getExisting('template_title'));\n\t\t$styleIds = $this->_getStyleModel()->getAllChildStyleIds($this->get('style_id'));\n\t\t$styleIds[] = $this->get('style_id');\n\n\t\t$db = $this->_db;\n\t\t$db->update(\n\t\t\t'xf_template_map',\n\t\t\tarray('template_final' => null, 'template_modifications' => null),\n\t\t\t'style_id IN (' . $db->quote($styleIds) . ') AND title IN (' . $db->quote($templateTitles) . ')'\n\t\t);\n\t}", "public function saveSettingAction(){\n $configKey = array('api_key', 'api_secret','include_folders','resize_auto',\n 'resize_image','min_size','max_size','compression_type_pdf','compression_type_png','compression_type_jpg','compression_type_gif', 'saving_auto', 'compress_auto', 'cron_periodicity', 'reindex_init');\n $coreConfig = Mage::getConfig();\n $post = $this->getRequest()->getPost();\n foreach ($configKey as $key) { \n if (isset($post[$key])) { \n $coreConfig->saveConfig(\"mageio_\".$key, Mage::helper('core')->escapeHtml($post[$key]))->cleanCache();\n }\n }\n\t\t$installed_time = Mage::getStoreConfig('mageio_installed_time');\n if(empty($installed_time)) {\n $installed_time = time();\n $coreConfig = Mage::getConfig();\n $coreConfig->saveConfig('mageio_installed_time', Mage::helper('core')->escapeHtml($installed_time))->cleanCache();\n }\n\t\t//Remove error message if set\n\t\t$coreConfig->saveConfig(\"mageio_errormessage\", Mage::helper('core')->escapeHtml(null))->cleanCache();\n\t\t\n\t\t$this->_redirect('imagerecycle/index/index');\n\t}", "public function store()\n\t{\n\t\t$data = Input::all();\n\t\t$userId = Auth::id();\n\t\t\n\t\t$action = $data['action'];\n\n\t\tif($action == \"save\"){\n\t\t\t//Save template as a new record.\n\t\t\t$nb = UserTemplate::all()->where('user', $userId)->count() + 1;\n\n\t\t\t$temp = new Template;\n\t\t\t$temp->category = $data['cat'];\n\t\t\t$temp->templateName = 'Custom Template #'.$nb;\n\t\t\t$temp->isFavorite = '0';\n\t\t\t$temp->isPredefined = '0';\n\t\t\t$temp->html = $data['html'];\n\t\t\t$temp->css = $data['css'];\n\t\t\t$temp->save();\n\n\t\t\t$ut = new UserTemplate;\n\t\t\t$ut->user = $userId;\n\t\t\t$ut->template = $temp->templateId;\n\t\t\t$ut->save();\n\t\t}\n\t\telse{\n\t\t\t//Edit existing template.\n\t\t\t$temp = Template::find($data['id']);\n\t\t\t$temp->html = $data['html'];\n\t\t\t$temp->save();\n\t\t}\n\n\t\treturn url('/templates');\n\n\t\t// \treturn url('/upload', ['id' => $temp->templateId]);\n\t}", "public function FrontendOutputPostGenerate() {\n\t\t\tfile_put_contents($this->location, $this->template);\n\t\t}", "function admin_add(){\n\t\t\t$this->set('title_for_layout', __('Add Email Template', true));\t\t\n\t\t\tif(!empty($this->data)) {\n\t\t\t\t// CSRF Protection\n\t\t\t\tif ($this->params['_Token']['key'] != $this->data['EmailTemplate']['token_key']) {\n\t\t\t\t\t$blackHoleCallback = $this->Security->blackHoleCallback;\n\t\t\t\t\t$this->$blackHoleCallback();\n\t\t\t\t}\n\t\t\t\t//validate and save data\t\t\t\n\t\t\t\t$this->EmailTemplate->set($this->data);\n\t\t\t\t$this->EmailTemplate->setValidation('admin');\n\t\t\t\tif ($this->EmailTemplate->validates()) {\t\t\t\t\n\t\t\t\t\tif ($this->EmailTemplate->save($this->data)) {\t\t\t\t \n\t\t\t\t\t\t$this->Session->setFlash('Email template has been saved', 'admin_flash_good');\n\t\t\t\t\t\t$this->redirect(array('controller'=>'email_templates', 'action' => 'index'));\n\t\t\t\t\t}else {\n\t\t\t\t\t\t$this->Session->setFlash('Please correct the errors listed below.', 'admin_flash_bad');\n\t\t\t\t\t}\n\t\t\t\t}else {\n\t\t\t\t\t$this->Session->setFlash('Email template could not be saved. Please, try again.', 'admin_flash_bad');\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function postProcess()\n {\n if (Tools::isSubmit('saveSettings')) {\n ConfPPM::setConf(\n 'paysto_merchant_id',\n Tools::getValue(ConfPPM::formatConfName('paysto_merchant_id'))\n );\n ConfPPM::setConf(\n 'paysto_secret',\n Tools::getValue(ConfPPM::formatConfName('paysto_secret'))\n );\n ConfPPM::setConf('server_list', Tools::getValue(ConfPPM::formatConfName('server_list')));\n ConfPPM::setConf('ip_only_from_server_list',\n Tools::getValue(ConfPPM::formatConfName('ip_only_from_server_list')));\n ConfPPM::setConf('disable_tax_shop',\n Tools::getValue(ConfPPM::formatConfName('disable_tax_shop')));\n ConfPPM::setConf('tax_delivery', Tools::getValue(ConfPPM::formatConfName('tax_delivery')));\n Tools::redirectAdmin(ToolsModulePPM::getModuleTabAdminLink() . '&conf=6');\n }\n }", "public function action() {\r\n parent::action();\r\n\r\n\r\n switch (SQ_Tools::getValue('action')) {\r\n\r\n case 'sq_settings_update':\r\n if (SQ_Tools::getIsset('sq_post_types')) {\r\n SQ_Tools::$options['sq_post_types'] = array();\r\n foreach (SQ_Tools::getValue('sq_post_types') as $key) {\r\n array_push(SQ_Tools::$options['sq_post_types'], $key);\r\n }\r\n\r\n if (!in_array('product', get_post_types())) {\r\n array_push(SQ_Tools::$options['sq_post_types'], 'product');\r\n }\r\n }\r\n\r\n SQ_Tools::saveOptions('sq_google_country', SQ_Tools::getValue('sq_google_country'));\r\n SQ_Tools::saveOptions('sq_google_country_strict', SQ_Tools::getValue('sq_google_country_strict'));\r\n SQ_Tools::saveOptions('sq_google_ranksperhour', SQ_Tools::getValue('sq_google_ranksperhour'));\r\n\r\n SQ_Tools::saveOptions('sq_keyword_help', (int) SQ_Tools::getValue('sq_keyword_help'));\r\n SQ_Tools::saveOptions('sq_keyword_information', (int) SQ_Tools::getValue('sq_keyword_information'));\r\n SQ_Tools::saveOptions('sq_sla', (int) SQ_Tools::getValue('sq_sla'));\r\n SQ_Tools::saveOptions('sq_keywordtag', (int) SQ_Tools::getValue('sq_keywordtag'));\r\n SQ_Tools::saveOptions('sq_local_images', (int) SQ_Tools::getValue('sq_local_images'));\r\n\r\n\r\n SQ_Tools::saveOptions('sq_google_wt', SQ_ObjController::getModel('SQ_BlockSettingsSeo')->checkGoogleWTCode(SQ_Tools::getValue('sq_google_wt','',true)));\r\n SQ_Tools::saveOptions('sq_bing_wt', SQ_ObjController::getModel('SQ_BlockSettingsSeo')->checkBingWTCode(SQ_Tools::getValue('sq_bing_wt','',true)));\r\n SQ_Tools::saveOptions('sq_alexa', SQ_ObjController::getModel('SQ_BlockSettingsSeo')->checkBingWTCode(SQ_Tools::getValue('sq_alexa','',true)));\r\n\r\n\r\n SQ_Action::apiCall('sq/user/settings', array('settings' => json_encode(SQ_Tools::getBriefOptions())), 10);\r\n SQ_Tools::emptyCache();\r\n break;\r\n }\r\n }", "function modifyTemplate() {\n if (!$this->isAdmin()) {\n return $this->showStart();\n }\n $entity = 'Template';\n if (isset($_REQUEST['entity'])) {\n $entity = strtolower($_REQUEST['entity']);\n \n }\n $plural = $this->pluralise($entity);\n\n if (isset($_REQUEST['parent_entity']) && isset($_REQUEST['parent_id'])){\n $parent_entity = $_REQUEST['parent_entity'];\n $parent_id = $_REQUEST['parent_id'];\n $conditions = array(strtolower($parent_entity) . '_id' => $parent_id);\n $edit_addition = 'parent_entity='.$parent_entity.'&parent_id='.$parent_id;\n $add_addition = '&' . $edit_addition;\n }\n else {\n $conditions = null;\n $edit_addition = \"id=\";\n $add_addition = \"\";\n }\n\n try {\n $template_list = $this->getListFromDB(strtolower($entity . '_view'), $conditions, null);\n /* make sure unimelb templates are visible in view */\n $properties = array();\n if(count($template_list) > 0 ){\n $properties1 = array_keys(get_object_vars($template_list[0]));\n $properties = str_replace('_', ' ', $properties1);\n \n \n }\n }\n catch(Exception $e) {\n return $this->handle_errors($e);\n }\n $editurl = $this->action . \"?mode=update_item&entity=$entity&\" . $edit_addition ;\n $deleteurl = $this->action . \"?mode=delete&entity=$entity\" . $add_addition;\n $addurl = $this->action . \"?mode=add_item&entity=$entity\" . $add_addition;\n /* screen output*/\n $t = 'admin-list.html';\n $t = $this->twig->loadTemplate($t);\n $output = $t->render(array(\n\t\t\t 'modes' => $this->user_visible_modes,\n\t\t\t 'error' => $this->error,\n\t\t\t 'entity' => $entity,\n\t\t\t 'properties' => $properties,\n\t\t\t 'columns' =>$properties1,\n\t\t\t 'item_list' => $template_list,\n\t\t\t 'addurl' => $addurl,\n\t\t\t 'editurl' => $editurl,\n\t\t\t 'action' => $deleteurl,\n\t\t\t 'plural' => $plural\n\t\t\t ));\n return $output;\n}", "public function saveAction()\n {\n $pageCode = $this->getRequest()->getParam('page_code');\n\n $config = $this->initConfig($pageCode);\n\n\n $session = Mage::getSingleton('adminhtml/session');\n\n try {\n\n $section = $config->getData('codes/section');\n $website = $this->getRequest()->getParam('website');\n $store = $this->getRequest()->getParam('store');\n $groups = $this->getRequest()->getPost('groups');\n $configData = Mage::getModel('adminhtml/config_data');\n $configData->setSection($section)\n ->setWebsite($website)\n ->setStore($store)\n ->setGroups($groups)\n ->save();\n\n $session->addSuccess(Mage::helper('novalnet_payment')->__('The configuration has been saved.'));\n } catch (Mage_Core_Exception $e) {\n foreach (explode(\"\\n\", $e->getMessage()) as $message) {\n $session->addError($message);\n }\n } catch (Exception $e) {\n $msg = Mage::helper('novalnet_payment')->__('An error occurred while saving:') . ' ' . $e->getMessage();\n $session->addException($e, $msg);\n }\n\n $this->_redirectByPageConfig();\n }", "public function save()\n {\n parent::save();\n\n $myConfig = $this->getConfig();\n $soxId = $this->getEditObjectId();\n\n $aParams = oxRegistry::getConfig()->getRequestParameter(\"editval\");\n\n\n // #918 S\n // checkbox handling\n $aParams['oxshops__oxactive'] = (isset($aParams['oxshops__oxactive']) && $aParams['oxshops__oxactive'] == true) ? 1 : 0;\n $aParams['oxshops__oxproductive'] = (isset($aParams['oxshops__oxproductive']) && $aParams['oxshops__oxproductive'] == true) ? 1 : 0;\n\n $isubjlang = oxRegistry::getConfig()->getRequestParameter(\"subjlang\");\n $iLang = ($isubjlang && $isubjlang > 0) ? $isubjlang : 0;\n\n /** @var oxShop $oShop */\n $oShop = oxNew(\"oxshop\");\n if ($soxId != \"-1\") {\n $oShop->loadInLang($iLang, $soxId);\n } else {\n $aParams['oxshops__oxid'] = null;\n }\n\n if ($aParams['oxshops__oxsmtp']) {\n $aParams['oxshops__oxsmtp'] = trim($aParams['oxshops__oxsmtp']);\n }\n\n $oShop->setLanguage(0);\n $oShop->assign($aParams);\n $oShop->setLanguage($iLang);\n\n if (($sNewSMPTPass = oxRegistry::getConfig()->getRequestParameter(\"oxsmtppwd\"))) {\n $oShop->oxshops__oxsmtppwd->setValue($sNewSMPTPass == '-' ? \"\" : $sNewSMPTPass);\n }\n\n\n try {\n $oShop->save();\n } catch (oxException $e) {\n\n return;\n }\n\n $this->_aViewData[\"updatelist\"] = \"1\";\n\n\n oxRegistry::getSession()->setVariable(\"actshop\", $soxId);\n }", "public function config_save() {\n }", "public function save()\n\t{\n\t\t$db = App\\Db::getInstance();\n\t\t$templateId = $this->getId();\n\t\t$share = static::getShareFromArray($this->get('share'));\n\t\tif (empty($templateId)) {\n\t\t\t$db->createCommand()\n\t\t\t\t->insert('vtiger_trees_templates', ['name' => $this->get('name'), 'module' => $this->get('module'), 'share' => $share])\n\t\t\t\t->execute();\n\t\t\t$this->set('templateid', $db->getLastInsertID('vtiger_trees_templates_templateid_seq'));\n\t\t\tforeach ($this->get('tree') as $tree) {\n\t\t\t\t$this->insertData($tree, 0, '');\n\t\t\t}\n\t\t} else {\n\t\t\t$db->createCommand()\n\t\t\t\t->update('vtiger_trees_templates', ['name' => $this->get('name'), 'module' => $this->get('module'), 'share' => $share], ['templateid' => $templateId])\n\t\t\t\t->execute();\n\t\t\t$db->createCommand()->delete('vtiger_trees_templates_data', ['templateid' => $templateId])\n\t\t\t\t->execute();\n\t\t\tforeach ($this->get('tree') as $tree) {\n\t\t\t\t$this->insertData($tree, 0, '');\n\t\t\t}\n\t\t}\n\t\tif ($this->get('replace')) {\n\t\t\t$this->replaceValue($this->get('replace'), $templateId);\n\t\t}\n\t\t$this->clearCache();\n\t}", "public function resavetemplate()\n\t{\n\t\t// Get form data\n\t\t$template_id = ee()->input->get_post('json-ld-template-id');\n\t\t$template_name = ee()->input->get_post('template_name');\n\t\t$template = ee()->input->get_post('json-ld-template-final');\n\n\t\t// Write it to database\n\t\t$data = [\n\t\t\t'template_name' => $template_name,\n\t\t\t'template_text' => $template\n\t\t];\n\n\t\tee()->db->update('exp_json_ld_templates', $data, ['id' => $template_id]);\n\n\t\t// return index view\n\t\treturn $this->index();\n\t}", "public function Admin_Action_Save() {\n // Dynamic Content Tags Properties\n $userAPI = &GetUser ();\n $tagId = $this->_getPOSTRequest ( 'dynamiccontenttags_id', 0 );\n $tagName = $this->_getPOSTRequest ( 'dynamiccontenttags_name', '' );\n $tagDate = time ();\n $mesgPrefix = 'Update';\n if ($tagId == 0) {\n $mesgPrefix = 'Create';\n }\n $redirectUrl = $this->admin_url;\n\n // Tag lists\n $lists = $this->_getPOSTRequest ( 'SelectList', array () );\n\n // Content Blocks Properties\n $tmpBlocks = $this->_getPOSTRequest ( 'blocks', array () );\n\n $blocks = array ();\n if (sizeof ( $tmpBlocks )) {\n $sortOrderCounter = 0;\n foreach ( $tmpBlocks as $k => $v ) {\n $blockId = (strlen($k) == 32) ? 0 : $k;\n $blockActivated = (isset ( $v ['activated'] ) && $v ['activated'] == 1) ? 1 : 0;\n $blockName = $v ['name'];\n $blockRules = $v ['data'];\n $blockSortOrder = $sortOrderCounter++;\n $blocks [] = new DynamicContentTag_Api_Block ( $blockId, $blockName, $blockRules, $blockActivated, $blockSortOrder, $tagId );\n }\n }\n\n $tag = new DynamicContentTag_Api_Tag ( $tagId, $tagName, $tagDate, $userAPI->Get('userid'), $blocks, $lists );\n\n $savedTagId = $tag->save ();\n\n if (isset ( $_POST ['subact'] ) && $_POST ['subact'] == 'saveedit') {\n $redirectUrl = $this->admin_url . \"&Action=Edit&id={$savedTagId}\";\n }\n\n if ($savedTagId) {\n FlashMessage ( GetLang ( 'Addon_dynamiccontenttags_' . $mesgPrefix . 'Tag_Success' ), SS_FLASH_MSG_SUCCESS, $redirectUrl );\n } else {\n FlashMessage ( GetLang ( 'Addon_dynamiccontenttags_' . $mesgPrefix . 'Tag_Failure' ), SS_FLASH_MSG_ERROR, $redirectUrl );\n }\n }", "function update_template()\n {\n $parameter_array = $this->get_parameter_array();\n \n parent::update($this->id, 'sssis', $parameter_array);\n }", "public function save(){\n return parent::writeFile( $this->outputFile, $this->template);\n }", "public function actionCreate()\n\t{\n $this->actionUpdate();\n\t}", "public function actionCreate() {\n $this->actionUpdate();\n }", "public function initAction()\n\t{\n\t\t$preservemodels = array('category','Category','file','File','EmailMessage','emailmessage','tag','mgmt_entity','mgmt_lang');\n\t\t$preserve = array('emailmessage','user','tag','mgmtlang','category');\n\t\n\t\t//standard language module is also basis for the front end module\n\t\t$language = $this->language('NL');\n\n\t\t$this->view->disable();\n\t\t$status = array('status' => 'false');\t\n\t\tif ($this->request->isPost()) \n\t\t{\n\t\t\t$post = $this->request->getPost();\n\t\t\t$noincludes = array('file');\n\n\t\t\t$images = array();\n\t\t\t$functions = array();//array for new/edit extra functions information\n\t\t\t$widgets = array();\n\t\t\t$tables = array();\n\t\t\t$ctables = array();\n\t\t\t\n\t\t\t$postkeys = array_keys($post);\n\t\t\tforeach($postkeys as $var)\n\t\t\t{\n\t\t\t\t$v = explode('_',$var);\n\t\t\t\tif(isset($v[1]))\n\t\t\t\t{\n\t\t\t\t\tswitch($v[0])\n\t\t\t\t\t{\n\t\t\t\t\t\tcase 'file':\n\t\t\t\t\t\t\tif($post[$var] == 1){ array_push($images,$v[1]); }\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'functions':\n\t\t\t\t\t\t\tif(is_array($post[$var]))\n\t\t\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tforeach($post[$var] as $function)\n\t\t\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\t\t\t$entity = $v[1];\n\t\t\t\t\t\t\t\t\t$value = explode('_',$function);\n\t\t\t\t\t\t\t\t\t$widgetentity = $value[0];\n\t\t\t\t\t\t\t\t\t$widgetentityid = $value[1];\n\t\t\t\t\t\t\t\t\t$table = array($entity,array('widgetentity' => $widgetentity,'widgetentityid' => $widgetentityid));\n\t\t\t\t\t\t\t\t\tarray_push($functions,$table);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'widget':\n\t\t\t\t\t\t\tarray_push($widgets,$v[1]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif($post[$var] == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tarray_push($tables,$var);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//SETTINGS SLUG & ALIAS SAVE \t\tNEW/EDIT & VIEW WIDGETS ALSO\n\t\t\t\n\t\t\t//mgmtentities cant update for some reason\n\t\t\t\n\t\t\t\n\t\t\t$ent = MgmtEntity::find();\n\t\t\tforeach($ent as $e)\n\t\t\t{\n\t\t\t\t$e->delete();\n\t\t\t}\n\t\t\t\n\t\t\tforeach($tables as $table)\n\t\t\t{\t\t\t\n\t\t\t\tif(isset($post['clearance_'.$table]) && isset($post['alias_'.$table]))\n\t\t\t\t{\n\t\t\t\t\t$mgmt_entity = MgmtEntity::findFirst('titel = \"'.$table.'\"');\n\t\t\t\t\tif(!$mgmt_entity)\n\t\t\t\t\t{\t\n\t\t\t\t\t\t$mgmt_entity = new MgmtEntity();\t\n\t\t\t\t\t}\n\t\t\t\t\t$mgmt_entity->id = $this->uuid();\n\t\t\t\t\t$mgmt_entity->titel = $table;\n\t\t\t\t\t$mgmt_entity->slug = strtolower(preg_replace(\"/[^a-zA-Z]/\", \"\", $table));\n\t\t\t\t\t$mgmt_entity->clearance = $post['clearance_'.$table];\n\t\t\t\t\t$mgmt_entity->alias = $post['alias_'.$table];\t\t\n\t\t\t\t\t\n\t\t\t\t\t$mgmt_entity->newedit = serialize($post['functions_'.$table.'_new']);\n\t\t\t\t\t$mgmt_entity->view = serialize($post['functions_'.$table.'_view']);\n\t\t\t\t\t\n\t\t\t\t\tif($post[$table] == 1)\n\t\t\t\t\t{ $val = 1;\t}else{$val = 0;}\n\t\t\t\t\t\n\t\t\t\t\t$mgmt_entity->visible = $val;\n\t\t\n\t\t\t\t\tif($mgmt_entity->save())\n\t\t\t\t\t{ \n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach ($mgmt_entity->getMessages() as $message)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\techo $message;\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\t\t//get all tables\n\t\t\t$tablesq = $this->db->fetchAll(\"SHOW TABLES\", Phalcon\\Db::FETCH_ASSOC);\n\t\t\t$linktables = array();\n\t\t\tforeach ($tablesq as $tableq) \n\t\t\t{\n\t\t\t\t$ext = explode('_',$tableq['Tables_in_'.DATABASENAME]);\n\t\t\t\tif(isset($ext[1]))\n\t\t\t\t{\tarray_push($linktables,$tableq['Tables_in_'.DATABASENAME]);\t}\n\t\t\t\t\n\t\t\t\tarray_push($ctables,$tableq['Tables_in_'.DATABASENAME]);\n\t\t\t}\n\n\t\t\t//tables with columns\n\t\t\t$tablesobject = array();\n\t\t\tforeach ($tablesq as $tableq) \n\t\t\t{\n\t\t\t\t$tablesobject[$tableq['Tables_in_'.DATABASENAME]] = array();\n\t\t\t\t$columns = $this->db->fetchAll(\"DESCRIBE `\".$tableq['Tables_in_'.DATABASENAME].\"`\", Phalcon\\Db::FETCH_ASSOC);\n\t\t\t\tforeach($columns as $column)\n\t\t\t\t{\n\t\t\t\t\tarray_push($tablesobject[$tableq['Tables_in_'.DATABASENAME]],$column['Field']);\t\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$error =0;\n\t\t\t//create models for link tables\t\n\t\t\tforeach($linktables as $linktable)\n\t\t\t{\n\t\t\t\tif(!in_array($linktable,$preservemodels))\n\t\t\t\t{\n\t\t\t\t\t$model = new Modell();\n\t\t\t\t\t$model->name = $linktable;\n\t\t\t\t\t$columns = $this->db->fetchAll(\"DESCRIBE \".$linktable, Phalcon\\Db::FETCH_ASSOC);\n\t\t\t\t\t$model->columns = $columns;\n\t\t\t\t\t\n\t\t\t\t\t$model->tables = $tables;\n\t\t\t\t\t$model->tablesobject = $tablesobject;\n\t\t\t\t\tif(!$model->tofile()){ $error++; }\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//create models\t\t\t\n\t\t\tforeach($tables as $table)\n\t\t\t{\n\t\t\t\tif(!in_array($table,$preserve))\n\t\t\t\t{\n\t\t\t\t\t$model = new Modell();\n\t\t\t\t\t$model->name = $table;\n\t\t\t\t\t$columns = $this->db->fetchAll(\"DESCRIBE \".$table, Phalcon\\Db::FETCH_ASSOC);\n\t\t\t\t\t$model->columns = $columns;\n\t\t\t\t\t$model->tables = $ctables;\n\t\t\t\t\t$model->tablesobject = $tablesobject;\n\t\t\t\t\tif(!$model->tofile()){ $error++; }\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$relations = array();\n\t\t\t\t\tforeach($tables as $tablex)\n\t\t\t\t\t{\n\t\t\t\t\t\t$columnx = $this->db->fetchAll(\"DESCRIBE \".$tablex, Phalcon\\Db::FETCH_ASSOC);\n\t\t\t\t\t\tforeach($columnx as $column)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($column['Field'] == $tablex.'id')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tarray_push($relations,$column['Field']);\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//generate view relations for detail view\n\t\t\t\t\t$linkentityrelations = array();\n\t\t\t\t\t$entityrelations = array();\n\t\t\t\t\tforeach($tablesq as $tablex)\n\t\t\t\t\t{\t\t\n\t\t\t\t\t\t$table3 = explode('_',$tablex['Tables_in_'.DATABASENAME]);\n\t\t\t\t\t\tif(!isset($table3[1]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$columnx = $this->db->fetchAll(\"DESCRIBE `\".$tablex['Tables_in_'.DATABASENAME].\"`\", Phalcon\\Db::FETCH_ASSOC);\n\t\t\t\t\t\t\tforeach($columnx as $column)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif($table.'id' == $column['Field'])\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif($tablex['Tables_in_'.DATABASENAME] != 'acl')\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tarray_push($entityrelations,$tablex['Tables_in_'.DATABASENAME]);\t\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($table3[0] == $table || $table3[1] == $table)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tarray_push($linkentityrelations,$tablex['Tables_in_'.DATABASENAME]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$controller = new Controller();\n\t\t\t\t\t$controller->language = $language;\t\t\t\t\n\t\t\t\t\t$controller->entity = $table;\n\t\t\t\t\t$controller->columns = $columns;\n\t\t\t\t\t$controller->relations = $entityrelations;\n\t\t\t\t\t$controller->linkrelations = $linkentityrelations;\n\t\t\t\t\t$controller->tables = $tables;\t\t\n\t\t\t\t\t$controller->images = in_array($table,$images);\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t$view = new View();\n\t\t\t\t\t$view->language = $language;\n\t\t\t\t\t$view->entity = $table;\n\t\t\t\t\t$view->columns = $columns;\n\t\t\t\t\t$view->relations = $entityrelations;\n\t\t\t\t\t$view->linkrelations = $linkentityrelations;\n\t\t\t\t\t$view->baseuri = $this->url->getBaseUri();\t\t\n\t\t\t\t\t$view->images = in_array($table,$images); \n\t\t\t\t\t$view->tablesobject = $tablesobject;\n\t\t\t\t\t\n\t\t\t\t\t$functions = array();\n\t\t\t\t\tif(isset($post['functions_'.$table.'_new']) && is_array($post['functions_'.$table.'_new']) )\n\t\t\t\t\t{\t\n\t\t\t\t\t\tforeach($post['functions_'.$table.'_new'] as $function)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tarray_push($functions,$function);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\tif(isset($post['functions_'.$table.'_view']) && is_array($post['functions_'.$table.'_view']) )\n\t\t\t\t\t{\t\n\t\t\t\t\t\tforeach($post['functions_'.$table.'_view'] as $function)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tarray_push($functions,$function);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(count($functions) > 0)\n\t\t\t\t\t{ \n\t\t\t\t\t\t$view->functions = $functions; \n\t\t\t\t\t\t$controller->functions = $functions;\n\t\t\t\t\t}\n\n\t\t\t\t\tif(!$view->tofile()){ $error++; }\t\n\t\t\t\t\t\n\t\t\t\t\tif(!$controller->tofile()){ $error++; }\t\n\t\t\t\t}\n\t\t\t}\t\n\n\t\t\t$menu = new Menu();\n\t\t\t$menu->tables = MgmtEntity::find(array('order' => 'titel ASC'));\n\t\t\tif(!$menu->tofile()){ $error++; }\n\t\t\t\n\t\t\tif(!isset($error) || $error == 0)\n\t\t\t{\n\t\t\t\t$status['status'] = 'ok';\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$status['messages'] = 'Something went wrong!';\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\techo json_encode($status);\n\t}", "public function initializeBackendTemplate() {}", "protected function initializeSaveAction()\n {\n $propertyMappingConfiguration = $this->arguments['event']->getPropertyMappingConfiguration();\n $propertyMappingConfiguration->forProperty('date')->setTypeConverterOption('TYPO3\\\\CMS\\\\Extbase\\\\Property\\\\TypeConverter\\\\DateTimeConverter', \\TYPO3\\CMS\\Extbase\\Property\\TypeConverter\\DateTimeConverter::CONFIGURATION_DATE_FORMAT, 'd.m.y');\n $propertyMappingConfiguration->forProperty('fromTime')->setTypeConverter($this->objectManager->get('Visol\\\\Easyvote\\\\Property\\\\TypeConverter\\\\TimestampConverter'))->setTypeConverterOption('Visol\\\\Easyvote\\\\Property\\\\TypeConverter\\\\TimestampConverter', \\Visol\\Easyvote\\Property\\TypeConverter\\TimestampConverter::CONFIGURATION_DATE_FORMAT, 'H:i');\n }", "public function actionCreate() {\n $model = new Configuration();\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 configSave()\n\t{\n\t\t$section = Mage::app()->getRequest()->getParam('section');\n\t\tif ($section == 'mtghost_design')\n\t\t{\n\t\t\t$websiteCode = Mage::app()->getRequest()->getParam('website');\n\t\t\t$storeCode = Mage::app()->getRequest()->getParam('store');\n\t\t\t\n\t\t\tMage::getSingleton('mtghost/cssgen_generator')->generateCss('design', $websiteCode, $storeCode);\n\t\t}else if($section == 'mtghost'){\n $websiteCode = Mage::app()->getRequest()->getParam('website');\n $storeCode = Mage::app()->getRequest()->getParam('store');\n\n Mage::getSingleton('mtghost/cssgen_generator')->generateCss('layout', $websiteCode, $storeCode);\n }\n\t}", "public function actionSave()\n {\n // we will get called again from\n // Tinhte_XenTag_XenForo_DataWriter_Forum::_preSave()\n $GLOBALS[Tinhte_XenTag_Constants::GLOBALS_CONTROLLERADMIN_FORUM_SAVE] = $this;\n\n return parent::actionSave();\n }" ]
[ "0.6807841", "0.6206388", "0.61593", "0.610639", "0.6096789", "0.6075421", "0.5825599", "0.5812048", "0.5737642", "0.56738055", "0.5637621", "0.5622439", "0.5603154", "0.5595343", "0.5590436", "0.55859154", "0.55521786", "0.5511519", "0.54491484", "0.54472715", "0.5446891", "0.5446477", "0.5434309", "0.54195744", "0.5401162", "0.5397", "0.53920585", "0.5388098", "0.5386281", "0.5384591" ]
0.74228793
0
$servicos = $this>db>query("SELECT FROM vw_listar_servicos_categoria ORDER BY data_servico DESC;")>result();
public function getView() { if(!$this->base->isAdmin()) $servicos = $this->db->where('inativo IS FALSE'); $servicos = $this->db->order_by('data_servico', 'desc')->get('vw_listar_servicos_categoria')->result(); return $servicos; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function noticiasActivas(){\r\n\t$objDatos = new clsDatos();\r\n\t$sql=\"select * from noticias where activo='1' order by fecha DESC\";\r\n\t$res = $objDatos->filtroListado($sql);\r\n\treturn $res;\r\n}", "function listarServicios()\n\t{\n\t\treturn \"select servicios.servicio_id,servicios.nombre_servicio, servicios.estado_servicio, servicios.descripcion, servicios.fecha_creacion,\n trabajadores.nombre,\nsucursales.nombre_sucursal\nfrom trabajadores, servicios,sucursales where servicios.trabajador_id = trabajadores.trabajador_id \nand servicios.estado_servicio = 1 \nand servicios.sucursal_id = sucursales.sucursal_id\";\n\t}", "function get_clientes() {\n $result = $this->db->select(\"t1.*\")\n ->where(\"t1.estado !=\", 0)\n ->order_by(\"t1.agregar\", \"Desc\")\n ->get(\"cliente as t1\")\n ->result_array();\n\n// echo '<pre>';\n// print_r($this->db->last_query());\n// echo '<pre>';\n return $result;\n }", "function trier(){\r\n \r\n $db = config::getConnexion();\r\n $sql=\"SElECT * From livreur ORDER BY nom\";\r\n\r\n try{\r\n $req=$db->prepare($sql);\r\n $req->execute();\r\n $livreur= $req->fetchALL(PDO::FETCH_OBJ);\r\n return $livreur;\r\n }\r\n catch (Exception $e){\r\n die('Erreur: '.$e->getMessage());\r\n } \r\n}", "function listar_todos_repuestos(){\n\t\t $this->db->SELECT('*');\n\t\t$this->db->From('repuestos');\n\t\t$this->db->order_by(\"id\",\"desc\");\n\t\t$query = $this->db->get();\n\t\treturn $query->result();\n\t}", "public function listar(){\n\n\t\t$data = $this->db->from($this->table)\n\t\t\t\t\t\t ->orderBy('id DESC')\n\t\t\t\t\t\t ->fetchAll();\n\t\tif(empty($data)){\n\t\t $respuesta = array('respuesta' => 0 );\n\t\t return $respuesta;\n\t\t}else{\n\t\t return $data;\n\t\t}\t\t\t\t \n\t// return $data = $this->db_pdo->query('select * from '.$this->table)\n\t//\t\t\t\t\t \t\t\t->fetchAll();\t\t\t\t \t\t\t\t\t\t \n\t}", "function sviRezultati() {\n\t\t$mysqli = new mysqli(\"localhost\", \"root\", \"\", \"kviz\");\n\t\t$q = 'SELECT * FROM tabela t join korisnik k on t.korisnikID = k.korisnikID order by t.brojPoena desc';\n\t\t$this ->result = $mysqli->query($q);\n\t\t$mysqli->close();\n\t}", "function get_servicios_trabajador($id)\n {\n $id = $this->session->id;\n $this->db->select('*');\n $this->db->from('servicio');\n $this->db->where('id_trabajador', $id);\n $this->db->order_by('fecha','DESC');\n $query = $this->db->get();\n return $query->result();\n }", "function listarServicio(){\r\n\t\t$this->procedimiento='gev.f_tgv_servicio_sel';\r\n\t\t$this->transaccion='tgv_SERVIC_SEL';\r\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\r\n\r\n\t\t$this->setParametro('tipo_interfaz','tipo_interfaz','varchar');\t\r\n\t\t//Definicion de la lista del resultado del query\r\n\t\t$this->captura('id_servicio','int4');\r\n\t\t$this->captura('estado','varchar');\r\n\t\t$this->captura('estado_reg','varchar');\r\n\t\t$this->captura('id_lugar_destino','int4');\r\n\t\t$this->captura('id_ep','int4');\r\n\t\t$this->captura('fecha_asig_fin','date');\r\n\t\t$this->captura('fecha_sol_ini','date');\r\n\t\t$this->captura('descripcion','varchar');\r\n\t\t$this->captura('id_lugar_origen','int4');\r\n\t\t$this->captura('cant_personas','int4');\r\n\t\t$this->captura('fecha_sol_fin','date');\r\n\t\t$this->captura('id_funcionario','int4');\r\n\t\t$this->captura('fecha_asig_ini','date');\r\n\t\t$this->captura('id_usuario_reg','int4');\r\n\t\t$this->captura('fecha_reg','timestamp');\r\n\t\t$this->captura('id_usuario_mod','int4');\r\n\t\t$this->captura('fecha_mod','timestamp');\r\n\t\t$this->captura('usr_reg','varchar');\r\n\t\t$this->captura('usr_mod','varchar');\r\n\t\t$this->captura('desc_funcionario','text');\r\n\t\t$this->captura('desc_lugar_ini','varchar');\r\n\t\t$this->captura('desc_lugar_des','varchar');\r\n\t\t$this->captura('id_funcionario_autoriz','int4');\r\n\t\t$this->captura('observaciones','varchar');\r\n\t\t$this->captura('desc_funcionario_autoriz','text');\r\n\t\t\r\n\t\t//Ejecuta la instruccion\r\n\t\t$this->armarConsulta();\r\n\t\t$this->ejecutarConsulta();\r\n\t\t//echo '--->'.$this->getConsulta(); exit;\r\n\t\t//Devuelve la respuesta\r\n\t\treturn $this->respuesta;\r\n\t}", "function getNaujienosVisi() {\n $manoSQL = \"SELECT * FROM naujienos order by id DESC \";\n // $rezultataiOBJ - Mysql Objektas\n $rezultataiOBJ = mysqli_query(getPrisijungimas(), $manoSQL);\n return $rezultataiOBJ;\n}", "function listerchambre(){\n \n try {\n $sql = \"SELECT * FROM chambre_hospitalisation ORDER BY id_chambre DESC\";\n \n// $resultat = $this->executeRequete($sql)->fetchAll();\n $result = $this->executeRequete($sql)->fetchAll();\n \n// var_dump($resultat);\n// die();\n return $result;\n } catch (Exception $ex) {\n echo $ex->getMessage();\n }\n }", "function hentAlleAktiviteter()\n{\n return Aktivitet::All()->sortByDesc(\"Dato\");\n}", "public function loMasVendido() {\r\n\r\n $LMV = DB::connection('mysql')->select(\"SELECT tb_productos.idProducto,tb_productos.nombre,tb_productos.urlImage,\r\n tb_productos.fk_idSatate,tb_productos.SubRubro2,tb_productos.precioL1,\r\n tb_productos.precioL2,tb_productos.precioL3,\r\n tb_productos.precioL4,tb_productos.precioL5,\r\n tb_productos.precioL6,tb_productos.precioL7,\r\n tb_productos.precioL8,tb_productos.precioL9,\r\n tb_productos.codeProdSys, tb_productos.kiloProdcuto\r\n FROM tb_order_body \r\n INNER JOIN tb_order_header ON tb_order_header.idOrderHeader = tb_order_body.fk_idOrderHeader \r\n INNER JOIN tb_productos ON tb_productos.codeProdSys = tb_order_body.codeProdSys \r\n WHERE tb_order_header.fk_idStateOrder = 2 and tb_productos.fk_idSatate = 1\r\n group by tb_productos.idProducto, tb_productos.nombre,tb_productos.urlImage,\r\n tb_productos.fk_idSatate,tb_productos.SubRubro2,tb_productos.precioL1,\r\n tb_productos.precioL2,tb_productos.precioL3,\r\n tb_productos.precioL4,tb_productos.precioL5,\r\n tb_productos.precioL6,tb_productos.precioL7,\r\n tb_productos.precioL8,tb_productos.precioL9,\r\n tb_productos.codeProdSys, tb_productos.kiloProdcuto\r\n LIMIT 10\");\r\n\r\n return response()->json($LMV, 200);\r\n }", "public function SelecionarServicosPorFilial($dados){\n\n\n $sql=\"select * from view_servico_filial where idFilial=\".$dados->idFilial;\n\n echo $sql;\n\n $conex = new Mysql_db();\n\n $PDO_conex = $conex->Conectar();\n\n $select = $PDO_conex->query($sql);\n\n $cont=0;\n\n while ($rs=$select->fetch(PDO::FETCH_ASSOC)) {\n $listFiliaisServicoServico[] = new servico_filial();\n\n $listFiliaisServicoServico[$cont]->idFilialServico= $rs['idFilialServico'];\n $listFiliaisServicoServico[$cont]->idFilial= $rs['idFilial'];\n $listFiliaisServicoServico[$cont]->nomeFilial= $rs['nomeFilial'];\n $listFiliaisServicoServico[$cont]->idServico= $rs['idServico'];\n $listFiliaisServicoServico[$cont]->nomeServico= $rs['nome'];\n $listFiliaisServicoServico[$cont]->descricao= $rs['descricao'];\n\n $cont+=1;\n\n }\n\n $conex->Desconectar();\n\n if (isset($listFiliaisServico)) {\n return $listFiliaisServico;\n }\n }", "public function servicios(){\n $anio = date(\"Y\",strtotime(date(\"Y-m-d\").\"- 1 month\"));\n $mes = date(\"m\",strtotime(date(\"Y-m-d\").\"- 1 month\"));\n\n $consulta_popular= DB::select('SELECT vehiculos.idvehiculo,\n COUNT(*) as cantidad FROM alquilers \n INNER JOIN vehiculos ON vehiculos.idvehiculo = alquilers.id_vehiculo\n WHERE YEAR(alquilers.fecha_recogida) = ?\n AND MONTH(alquilers.fecha_recogida) = ?\n GROUP BY id_vehiculo ORDER BY cantidad DESC LIMIT ?',[$anio,$mes,1]);\n\n try{\n $idpopular = $consulta_popular['0']->idvehiculo;\n }catch (\\Exception $ex) {\n $idpopular = 1;\n }\n \n $popular = app\\Vehiculo::where('idvehiculo','=',$idpopular)->get();\n $sucursales = App\\Sucursal::all();\n //return $popular;\n setlocale(LC_TIME, 'es_ES');\n $fecha = DateTime::createFromFormat('!m', $mes);\n $mes = strftime(\"%B\", $fecha->getTimestamp());\n return view('servicios',compact('sucursales','popular','anio','mes'));\n}", "public function listadoProductos(){\n\n$sql = \"select idProducto,desc_Prod,presentacion,tipoProd,stock,m.nomMarca,c.nomCategoria,estadoProd from producto as p inner join Categoria as c ON c.idCategoria=p.idCategoria inner join Marca as m ON m.idMarca=p.idMarca where estadoProd=1 order by desc_Prod asc\";\n\t\n\n\n\t\treturn Yii::app()->db->createCommand($sql)->queryAll();\n\t}", "function newsItem_BacaDataListing_ByKategori_Terkini_All( $tbl_news , $idkategori ){\n\t$sql = mysql_query(\"SELECT * FROM $tbl_news WHERE idkategori = '$idkategori' ORDER BY urutan DESC, timeunix DESC \");\n\treturn $sql;\n}", "function listarServiciosTerminados()\n\t{\n\t\treturn \"select servicios.servicio_id,servicios.nombre_servicio, servicios.estado_servicio, servicios.descripcion, servicios.fecha_creacion,\n trabajadores.nombre,\nsucursales.nombre_sucursal\nfrom trabajadores, servicios,sucursales where servicios.trabajador_id = trabajadores.trabajador_id \nand servicios.estado_servicio = 0 \nand servicios.sucursal_id = sucursales.sucursal_id\";\n\t}", "public function getProductos()\n {\n\n $sql = \"SELECT * FROM productos ORDER BY id DESC\";\n $producto = $this->db->prepare($sql);\n $producto->execute();\n\n return $producto;\n }", "public function orderby(){\n\n $rows = $this\n ->db\n ->order_by(\"title\", \"asc\")\n ->order_by(\"id\", \"random\")\n ->get(\"personel\")\n ->result();\n\n print_r($rows);\n\n }", "function consultar_proveedores(){\n\t\t$this->db->SELECT('*');\n\t\t$this->db->FROM('mantenciones_proveedores');\n\t\t$this->db->order_by(\"id\",\"desc\");\n\t\t$query = $this->db->get();\n\t\treturn $query->result();\n\t}", "public function getAll(){\n\n \t$categorias = $this->db->query(\"SELECT * FROM categorias ORDER BY id_categoria DESC\");\n\n \treturn $categorias;\n }", "public function index()\n {\n return $this->tipoServico->with('categorias','categorias.servicos')->orderBy('id','DESC')->get();\n }", "function getAllTransaksiTab(){\n $data = $this->pengajuan->where('kategori','like',\"%Tabungan\")->orderBy('created_at','DESC')->get();\n return $data;\n }", "function listatpodocubaja(){\n\t\tinclude(\"application/config/conexdb_db2.php\");\n\t\t$codcia=$this->session->userdata('codcia');\n\t\t$sql=\"select DISTINCT(a.YHTIPDOC) AS TIPODOCU,e.EUDSCCOR FROM LIBPRDDAT.MMYHREL0 a INNER JOIN LIBPRDDAT.MMEUREL0 e ON a.YHTIPDOC=e.EUCODELE WHERE a.YHTIPDOC!='' AND e.EUCODTBL='AG' and a.YHSTS='I' AND a.YHCODCIA='\".$codcia.\"' and a.YHFECDOC>='20170101' order by TIPODOCU asc\";\t\t\n\t\t$dato = odbc_exec($dbconect, $sql)or die(\"<p>\" . odbc_errormsg());\n\t\tif (!$dato) {\n\t\t\t$data = FALSE;\n\t\t} else { \n\t\t\t$data = $dato; \n\t\t} \n\t\treturn $data;\n\t\tcerrar_odbc();\n\t}", "function tridate(){\r\n $sql=\"SELECT * FROM livraison ORDER BY date ASC\";\r\n$db = config::getConnexion();\r\n try{\r\n $liste=$db->query($sql);\r\n return $liste;\r\n }\r\n catch (Exception $e){\r\n die('Erreur: '.$e->getMessage());\r\n } \r\n}", "public function obtener_datos_titular( $idv ){\n \n$datos= array();\n\n $sq_titular=\"select tipo_docu, nro_docu, nombape, nacional, porce_titular from rua.titular \";\n \n $res3= $this->db->query( $sq_titular.\" where id_vehic='\". $idv.\"'\" );\n $datos= $res3->result_array; \n return $datos; \n \n}", "function consultar_camiones(){\n\t\t$this->db->SELECT('*');\n\t\t$this->db->FROM('camiones');\n\t\t$this->db->order_by(\"patente\",\"asc\");\n\t\t$query = $this->db->get();\n\t\treturn $query->result();\n\t}", "public function get_datos_pac_rec_ini($sucursal,$id_usuario){\n\n $conectar= parent::conexion();\n\t \n\t $sql= \"select v.id_ventas,v.sucursal,v.subtotal,v.numero_venta,p.nombres,p.telefono,p.id_paciente,v.tipo_pago,v.vendedor from ventas as v join pacientes as p where p.id_paciente=v.id_paciente and v.sucursal=? and v.id_usuario=? order by id_ventas DESC limit 1;\";\n\n $sql=$conectar->prepare($sql);\n $sql->bindValue(1, $sucursal);\n $sql->bindValue(2, $id_usuario);\n $sql->execute();\n\n return $resultado= $sql->fetchAll(PDO::FETCH_ASSOC);\n\n}", "public function listarCategorias() {\n $sql = \"SELECT *\n FROM categorias\n ORDER BY id DESC\";\n\n return $sql;\n }" ]
[ "0.72769225", "0.6814404", "0.6790958", "0.67826134", "0.6764313", "0.67016816", "0.6692756", "0.6640065", "0.6636746", "0.65971464", "0.65594256", "0.6545949", "0.65322655", "0.65309966", "0.65279615", "0.65264034", "0.651125", "0.64916867", "0.64806974", "0.64722884", "0.64605075", "0.6452985", "0.64227164", "0.6410501", "0.6401452", "0.6399142", "0.6385158", "0.63770187", "0.6372022", "0.63669485" ]
0.6856004
1
Flattens `Future>` into `Future`
public static function flatten ($f) { #/home/jahred/haxelib/tink_core/1,23,0/src/tink/core/Future.hx:76: characters 5-31 return new NestedFuture($f); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static public function flatten ($f) {\n\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:71: characters 5-31\n\t\treturn new NestedFuture($f);\n\t}", "static public function ofMany ($futures, $gather = true) {\n\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:93: lines 93-108\n\t\tif ($gather === null) {\n\t\t\t$gather = true;\n\t\t}\n\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:94: characters 5-24\n\t\t$ret = new SyncFuture(new LazyConst(new \\Array_hx()));\n\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:95: lines 95-104\n\t\t$_g = 0;\n\t\twhile ($_g < $futures->length) {\n\t\t\tunset($f);\n\t\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:95: characters 10-11\n\t\t\t$f = ($futures->arr[$_g++] ?? null);\n\t\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:96: lines 96-104\n\t\t\t$ret = $ret->flatMap(function ($results) use (&$f) {\n\t\t\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:98: lines 98-102\n\t\t\t\treturn $f->map(function ($result) use (&$results) {\n\t\t\t\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:100: characters 15-46\n\t\t\t\t\treturn $results->concat(\\Array_hx::wrap([$result]));\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:106: lines 106-107\n\t\tif ($gather) {\n\t\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:106: characters 19-31\n\t\t\treturn $ret->gather();\n\t\t} else {\n\t\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:107: characters 12-15\n\t\t\treturn $ret;\n\t\t}\n\t}", "public static function await($promise = null, $unwrap = false);", "public function flatten(): Result\n {\n if ($this->isOk()) {\n return $this->value;\n }\n\n return $this;\n }", "function all(array $promises) {\n if (empty($promises)) {\n return new Success([]);\n }\n\n $results = [];\n $remaining = count($promises);\n $promisor = new Future;\n\n foreach ($promises as $key => $resolvable) {\n if (!$resolvable instanceof Promise) {\n $resolvable = new Success($resolvable);\n }\n\n $resolvable->when(function($error, $result) use (&$remaining, &$results, $key, $promisor) {\n // If the promisor already failed don't bother\n if (empty($remaining)) {\n return;\n }\n\n if ($error) {\n $remaining = 0;\n $promisor->fail($error);\n return;\n }\n\n $results[$key] = $result;\n if (--$remaining === 0) {\n $promisor->succeed($results);\n }\n });\n }\n\n // We can return $promisor directly because the Future Promisor implementation\n // also implements Promise for convenience\n return $promisor;\n}", "function map(array $promises, callable $functor) {\n if (empty($promises)) {\n return new Success([]);\n }\n\n $results = [];\n $remaining = count($promises);\n $promisor = new Future;\n\n foreach ($promises as $key => $resolvable) {\n $promise = ($resolvable instanceof Promise) ? $resolvable : new Success($resolvable);\n $promise->when(function($error, $result) use (&$remaining, &$results, $key, $promisor, $functor) {\n if (empty($remaining)) {\n // If the future already failed we don't bother.\n return;\n }\n if ($error) {\n $remaining = 0;\n $promisor->fail($error);\n return;\n }\n\n try {\n $results[$key] = $functor($result);\n if (--$remaining === 0) {\n $promisor->succeed($results);\n }\n } catch (\\Exception $error) {\n $remaining = 0;\n $promisor->fail($error);\n }\n });\n }\n\n // We can return $promisor directly because the Future Promisor implementation\n // also implements Promise for convenience\n return $promisor;\n}", "public function flatten() {}", "public function flatten() {}", "public function flatten();", "public function flatten();", "public function flatten();", "function any(array $promises) {\n if (empty($promises)) {\n return new Success([], []);\n }\n\n $results = [];\n $errors = [];\n $remaining = count($promises);\n $promisor = new Future;\n\n foreach ($promises as $key => $resolvable) {\n if (!$resolvable instanceof Promise) {\n $resolvable = new Success($resolvable);\n }\n\n $resolvable->when(function($error, $result) use (&$remaining, &$results, &$errors, $key, $promisor) {\n if ($error) {\n $errors[$key] = $error;\n } else {\n $results[$key] = $result;\n }\n\n if (--$remaining === 0) {\n $promisor->succeed([$errors, $results]);\n }\n });\n }\n\n // We can return $promisor directly because the Future Promisor implementation\n // also implements Promise for convenience\n return $promisor;\n}", "static public function async ($f, $lazy = false) {\n\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:131: lines 131-138\n\t\tif ($lazy === null) {\n\t\t\t$lazy = false;\n\t\t}\n\t\tif ($lazy) {\n\t\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:132: characters 7-32\n\t\t\treturn new LazyTrigger($f);\n\t\t} else {\n\t\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:134: characters 7-26\n\t\t\t$op = new FutureTrigger();\n\t\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:136: characters 7-33\n\t\t\tCallback_Impl_::invoke($f, Boot::getInstanceClosure($op, 'trigger'));\n\t\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:137: characters 7-16\n\t\t\treturn $op;\n\t\t}\n\t}", "public static function async ($f, $lazy = false) {\n\t\t#/home/jahred/haxelib/tink_core/1,23,0/src/tink/core/Future.hx:136: lines 136-143\n\t\tif ($lazy === null) {\n\t\t\t$lazy = false;\n\t\t}\n\t\tif ($lazy) {\n\t\t\t#/home/jahred/haxelib/tink_core/1,23,0/src/tink/core/Future.hx:137: characters 7-32\n\t\t\treturn new LazyTrigger($f);\n\t\t} else {\n\t\t\t#/home/jahred/haxelib/tink_core/1,23,0/src/tink/core/Future.hx:139: characters 7-26\n\t\t\t$op = new FutureTrigger();\n\t\t\t#/home/jahred/haxelib/tink_core/1,23,0/src/tink/core/Future.hx:140: characters 7-41\n\t\t\t$wrapped = $f;\n\t\t\t#/home/jahred/haxelib/tink_core/1,23,0/src/tink/core/Future.hx:141: characters 7-33\n\t\t\tCallback_Impl_::invoke($wrapped, Boot::getInstanceClosure($op, 'trigger'));\n\t\t\t#/home/jahred/haxelib/tink_core/1,23,0/src/tink/core/Future.hx:142: characters 7-16\n\t\t\treturn $op;\n\t\t}\n\t}", "function filter(array $promises, callable $functor) {\n if (empty($promises)) {\n return new Success([]);\n }\n\n $results = [];\n $remaining = count($promises);\n $promisor = new Future;\n\n foreach ($promises as $key => $resolvable) {\n $promise = ($resolvable instanceof Promise) ? $resolvable : new Success($resolvable);\n $promise->when(function($error, $result) use (&$remaining, &$results, $key, $promisor, $functor) {\n if (empty($remaining)) {\n // If the future result already failed we don't bother.\n return;\n }\n if ($error) {\n $remaining = 0;\n $promisor->fail($error);\n return;\n }\n try {\n if ($functor($result)) {\n $results[$key] = $result;\n }\n if (--$remaining === 0) {\n $promisor->succeed($results);\n }\n } catch (\\Exception $error) {\n $promisor->fail($error);\n }\n });\n }\n\n // We can return $promisor directly because the Future Promisor implementation\n // also implements Promise for convenience\n return $promisor;\n}", "function async(\\Closure $closure, mixed ...$args): Future\n{\n static $run = null;\n\n $run ??= static function (FutureState $state, \\Closure $closure, array $args): void {\n $s = $state;\n $c = $closure;\n\n /* Null function arguments so an exception thrown from the closure does not contain the FutureState object\n * in the stack trace, which would create a circular reference, preventing immediate garbage collection */\n $state = $closure = null;\n\n try {\n // Clear $args to allow garbage collection of arguments during fiber execution\n $s->complete($c(...$args, ...($args = [])));\n } catch (\\Throwable $exception) {\n $s->error($exception);\n }\n };\n\n $state = new Internal\\FutureState;\n\n EventLoop::queue($run, $state, $closure, $args);\n\n return new Future($state);\n}", "public function flatMap(callable $fn);", "public function flatMap(callable $callback): self {\n\t\treturn $this->map($callback)->flatten();\n\t}", "function some(array $promises) {\n if (empty($promises)) {\n return new Failure(new \\LogicException(\n 'No promises or values provided for resolution'\n ));\n }\n\n $errors = [];\n $results = [];\n $remaining = count($promises);\n $promisor = new Future;\n\n foreach ($promises as $key => $resolvable) {\n if (!$resolvable instanceof Promise) {\n $resolvable = new Success($resolvable);\n }\n\n $resolvable->when(function($error, $result) use (&$remaining, &$results, &$errors, $key, $promisor) {\n if ($error) {\n $errors[$key] = $error;\n } else {\n $results[$key] = $result;\n }\n\n if (--$remaining > 0) {\n return;\n } elseif (empty($results)) {\n $promisor->fail(new \\RuntimeException(\n 'All promises failed'\n ));\n } else {\n $promisor->succeed([$errors, $results]);\n }\n });\n }\n\n // We can return $promisor directly because the Future Promisor implementation\n // also implements Promise for convenience\n return $promisor;\n}", "public function getFutureHandler(): FutureHandler;", "public function flatMap(Closure $doSomething): Result;", "function flatten($args){\n $res = array();\n foreach($args as $a) {\n if(is_array($a)) $res = array_merge($res, flatten($a));\n else $res[] = $a;\n }\n return $res;\n}", "public function asyncMap(callable $callback): Collection;", "static function chain($fs) { return self::make(function ($x) use($fs) { return array_reduce($fs, function ($x, $f) { return $f($x); }, $x); }); }", "function compose1(array $asyncFns, $k)\n{\n // for debug\n $asyncFns = array_map(__NAMESPACE__ . \"\\\\trace\", $asyncFns);\n\n return array_right_reduce($asyncFns, function($rightCarry, $leftFn) {\n return function($ctx) use($rightCarry, $leftFn) {\n $leftFn($ctx, $rightCarry);\n };\n }, $k);\n}", "public function flatten(): self {\n\t\t$generator = function (Stream $stream) {\n\t\t\tforeach ($stream as $traversable) {\n\t\t\t\tforeach ($traversable as $value) {\n\t\t\t\t\tyield $value;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\treturn new self($generator($this));\n\t}", "public function flatMap(callable $callback)\n {\n return $this->map($callback)->collapse();\n }", "public function flatten()\n {\n $output = [];\n foreach (I($this->hash) as $value) {\n $array = __PRIVATE__::getArrayFrom($value);\n $output[] = $array !== null\n ? $array\n // Because of self::getArrayFrom, this will ALWAYS throw its error\n : __CONTRACT__::contentIsA(FoldableInterface::class, $value);\n }\n return static::from(call_user_func_array('array_merge', $output));\n }", "function first(array $promises) {\n if (empty($promises)) {\n return new Failure(new \\LogicException(\n 'No promises or values provided for resolution'\n ));\n }\n\n $remaining = count($promises);\n $isComplete = false;\n $promisor = new Future;\n\n foreach ($promises as $resolvable) {\n if (!$resolvable instanceof Promise) {\n $promisor->succeed($resolvable);\n break;\n }\n\n $promise->when(function($error, $result) use (&$remaining, &$isComplete, $promisor) {\n if ($isComplete) {\n // we don't care about Futures that resolve after the first\n return;\n } elseif ($error && --$remaining === 0) {\n $promisor->fail(new \\RuntimeException(\n 'All promises failed'\n ));\n } elseif (empty($error)) {\n $isComplete = true;\n $promisor->succeed($result);\n }\n });\n }\n\n // We can return $promisor directly because the Future Promisor implementation\n // also implements Promise for convenience\n return $promisor;\n}", "public function flatten( $depth = INF )\n\t{\n\t\treturn $this->toBase()->flatten( $depth );\n\t}" ]
[ "0.65526605", "0.47828382", "0.4586958", "0.45754296", "0.45375106", "0.44992465", "0.43423042", "0.43423042", "0.4330191", "0.4330191", "0.4330191", "0.43190578", "0.43002105", "0.42518944", "0.4193827", "0.40919286", "0.40881062", "0.40716207", "0.40613842", "0.40016177", "0.40001395", "0.393807", "0.39255837", "0.39248896", "0.39163584", "0.38602296", "0.3858961", "0.38442096", "0.38087443", "0.3796322" ]
0.65837544
0
Sets autorization header telling that you need to be authenticated
public function setAuthenticateHeader() { $response = \Yii::$app->response; $response->getHeaders()->set('WWW-Authenticate', "Basic realm=\"{$this->realm}\""); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setAuthorization()\n\t{\n\t\t// @TODO We don't deal with a case where during your session the token expires\n\t\tif (is_null($this->access_token))\n\t\t{\n\t\t\t$response = $this->getToken();\n\t\t\t$this->access_token = $response->access_token;\n\t\t\t$this->authorization = \"Bearer \" . $this->access_token;\n\t\t}\n\t}", "private function prepareAuth()\n {\n $this->client->setHeaders(\n [\n 'Content-Type' => 'application/json',\n 'Authorization' => 'Bearer ' . $this->zendeskHelper->getToken()\n ]\n );\n }", "public function authentication_header()\n {\n }", "public function auth(){\n if(empty($_COOKIE[\"utoken\"])){\n $cookie_value = $this->uuid();\n $this->utoken = $cookie_value;\n $this->setHeader($this->utoken);\n }else{\n $this->utoken = $_COOKIE[\"utoken\"];\n $this->setHeader($this->utoken);\n }\n }", "protected function setHeader(){\n $this->header = [\n 'Auth-id' => $this->username,\n 'Auth-token' => $this->generateToken(),\n 'Timestamp' => time()\n ];\n }", "protected function set_headers()\n\t{\n\t\tif($this->headers_required) { \n\n\t\t\t$this->headers = [\n\t\t\t \n\t\t\t\t'Authorization: '. $_SESSION['token'] .'',\n\t\t\t];\n\n\t\t}\n\n\t}", "function http_auth_headers() {\n\t\tif($this->http_user || $this->http_pass):\n\t\t\t$this->http_headers_add('Authorization', \" Basic \".base64_encode($this->http_user . \":\" . $this->http_pass));\n\t\tendif;\n\t}", "protected function __authorization(){\n\t\t $this->cURL->headers['Authorization'] = 'Bearer '.$this->access_token;\n }", "public function getAuth()\n {\n $this->getRequestHeaders([\n 'X-User-Id', 'X-Auth-Token'\n ]);\n }", "protected function sendAuthHeaders()\n {\n $sessionId = GlobalRequest::getSessionIdFromCookie();\n $sessionHandleKey = GlobalRequest::getSessionHandleKeyFromCookie();\n\n $this->setHeader('xa-modifier-sid', !empty($sessionId) ? $sessionId : \"null\");\n $this->setHeader('xa-modifier-shk', !empty($sessionHandleKey) ? $sessionHandleKey : \"null\");\n }", "function auth() {\n header('WWW-Authenticate: Basic realm=\"Citations\"');\n header('HTTP/1.0 401 Unauthorized');\n print 'authorisation required';\n exit;\n }", "public function buildAuthorizationHeader ()\n {\n $this->addHeader('Authorization', 'Basic ' . base64_encode($this->clientId . ':' . $this->clientSecret));\n $this->is_preauthorized_request = 1;\n }", "public function setAuthenticated();", "protected function setBasicAuthHeader(): void\n {\n $this->setRequestHeader(\n 'Authorization',\n 'Basic ' . base64_encode($this->appId . ':' . $this->appPassword)\n );\n }", "function wp_populate_basic_auth_from_authorization_header()\n {\n }", "protected function setAuthtoken($authToken)\n {\n $this->header .= \"X-Auth-Token: \" . $authToken . \"\\r\\n\";\n }", "public static function authenticate(): void\n {\n $headers = getallheaders();\n $token = $headers['Authorization'] ?? null;\n\n if ($token === null\n || !self::validate($token)\n ) {\n header('Not authorized', true, 403);\n exit;\n }\n }", "public function buildAccessHeader ()\n {\n $this->is_preauthorized_request = 0;\n if ($this->IsAccessParams())\n $this->addHeader('Authorization', $this->token_type . ' ' . $this->access_token);\n\n }", "public function get_test_authorization_header()\n {\n }", "public function auth()\n {\n\n if (Auth::attempt(['email' => $this->request->header('email'), 'password' => $this->request->header('password')])) {\n $this->user = Auth::user();\n\n } else {\n echo json_encode(['error' => 'Unauthorised']);\n die();\n }\n }", "protected function setCurlHeaderElement() {\n // set header for cur\n $this->header[] = 'Content-type: application/json';\n $this->header[] = 'Authorization: Bearer '.$this->accessToken;\n }", "function setAuthHeaders($authInfos = NULL) {\n if (is_null($authInfos))\n $authInfos = $GLOBALS['clientsAuth'][$GLOBALS['defaultAuth']]; /// TODO revoir pour skidataInventory2\n $auth = new StdClass();\n\n $auth->ClientName = new SoapVar($authInfos['skidataDTAClientName'], XSD_STRING, NULL, NULL, 'ClientName', self::$skidataDTAHeaderNamespace);\n $auth->UserName = new SoapVar($authInfos['skidataDTAUserName'], XSD_STRING, NULL, NULL, 'UserName', self::$skidataDTAHeaderNamespace);\n $auth->Password = new SoapVar($authInfos['skidataDTAPassword'], XSD_STRING, NULL, 'Password', self::$skidataDTAHeaderNamespace);\n $header = new SoapHeader(self::$skidataDTAHeaderNamespace, 'AuthenticationHeader', $auth, false);\n\n $this->__setSoapHeaders(array($header));\n }", "protected function addAuthorization()\n {\n\n $username = $this->getUsername();\n $auth_type = $this->getAuthType();\n $this->addHeader([\n 'Authorization' => ( $auth_type == 'hash')\n ? 'WHM ' . $username . ':' . preg_replace(\"'(\\r|\\n|\\s|\\t)'\", '', $this->getPassword())\n :\n (\n ( $auth_type == 'password')\n ? 'Basic ' . base64_encode($username . ':' .$this->getPassword())\n : null\n )\n ]);\n\n return $this;\n }", "public static function setRedirectUponAuthentication(){\n\n /**\n * Make sure we redirect to the requested page\n */\n if(isset($_SESSION[self::CONST_REQUESTED_URI_SESSION_KEY]) && !empty($_SESSION[self::CONST_REQUESTED_URI_SESSION_KEY])){\n CoreHeaders::setRedirect($_SESSION[self::CONST_REQUESTED_URI_SESSION_KEY]);\n unset($_SESSION[self::CONST_REQUESTED_URI_SESSION_KEY]);\n }else{\n CoreHeaders::setRedirect('/');\n }\n\n }", "protected function protect()\n {\n header('HTTP/1.1 401 Unauthorized');\n\n switch ($this->type) {\n default:\n case self::AUTH_BASIC:\n header('WWW-Authenticate: Basic realm=\"' . $this->realm . '\"');\n break;\n case self::AUTH_DIGEST:\n header(\n 'WWW-Authenticate: Digest realm=\"' . $this->realm .\n '\", qop=\"auth\", nonce=\"' . md5(uniqid()) . '\", opaque=\"' . md5(uniqid()) . '\"'\n );\n break;\n }\n }", "public static function set_headers()\n {\n }", "private function __setAuthUser()\n {\n $authUser = $this->request->session()->read('Auth');\n\n $accountType = 'FREE';\n if (!empty($authUser)) {\n $accountType = $authUser['User']['account_type'];\n }\n\n $this->set(compact('authUser', 'accountType'));\n }", "public function setBasicAuth()\n {\n $auth = $this->auth;\n\n if (null !== $auth['user']) {\n $this->mink->getSession()->setBasicAuth(\n $auth['user'],\n $auth['password']\n );\n }\n }", "function assignFrontAuth() {\n AuthComponent::$sessionKey = 'Auth.User';\n $this->Auth->authenticate = array(\n 'Form' => array(\n 'userModel' => 'User',\n 'fields' => array('username' => 'email', 'password' => 'password', 'store_id'),\n 'scope' => array('User.merchant_id' => $this->Session->read('merchant_id'), 'User.role_id' => array('4', '5'), 'User.is_active' => 1, 'User.is_deleted' => 0)\n )\n );\n }", "private function login()\n {\n if (!isset($_SERVER['PHP_AUTH_USER']) || !$this->isAdmin()) {\n header('WWW-Authenticate: Basic realm=\"My Realm\"');\n header('HTTP/1.0 401 Unauthorized');\n exit;\n }\n }" ]
[ "0.702322", "0.7004076", "0.6986348", "0.6976852", "0.6959325", "0.675015", "0.6735196", "0.673283", "0.6685304", "0.66836655", "0.6605274", "0.6583517", "0.64165694", "0.64147997", "0.63940006", "0.6292193", "0.6210134", "0.617427", "0.61313754", "0.6114502", "0.60141236", "0.5990447", "0.59808046", "0.5932632", "0.5926741", "0.5918034", "0.58954966", "0.5859595", "0.58466816", "0.5845771" ]
0.70890963
0
generate new user emails checks for generic password
public function generate_new_passwords() { // all users added with "password" will be automatically sent a welcome message // and new password $resetpassword = 'password'; // get users $user_list = $this->get_user->get_all_users(); // go through users foreach($user_list as $user) { // check if password is "password" $user_id = $user->user_id; if ($this->get_user->check_password($user_id, $resetpassword) == 1) { // generate simple random password $newpassword = uniqid(); // write new password to database $data = array( 'password' => $newpassword ); $this->get_user->update('user_id', $user_id, $data); // email user new password $this->send_password_mail($user_id, $newpassword); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function generateNewPassword($mail);", "static function password_expired_email() {\n $model = \\Auth::$model;\n $user = $model::requested();\n\n if (!$user->nil()) {\n if ($user->validate()) {\n\n password_expired_email($user) ?\n flash(\"Enviamos um e-mail para <small><b>$user->email</b></small> com as instruções para você criar uma nova senha.\") :\n flash('Não foi possível lhe enviar o e-mail. Por favor, tente novamente mais tarde.', 'error');\n\n go('/');\n } else {\n flash('Verifique os dados do formulário.', 'error');\n }\n }\n\n globals('user', $user);\n }", "private function emailAtLogin() {}", "public function create_password() {\n\t\tif(!empty($this->request->params['named']['email'])){\n\t\t\t$email = $this->request->params['named']['email'];\n\t\t}\n\t\t\n\t\t$authUserData = $this->Auth->user();\n\t\tif(empty($authUserData)){\n\t\t\t$this->Session->setFlash(__('There was an error logging you in and setting up a password. Your temporary password has been sent to your email address.', true));\n\t\t\t//Send the temporary password to the user's email address\n\t\t\t$options = array(\n\t\t\t\t\t\t\t\t'layout'=>'temporary_password',\n\t\t\t\t\t\t\t\t'subject'=>'Your Temporary Password',\n\t\t\t\t\t\t\t\t'view'=>'default'\n\t\t\t\t\t\t\t\t);\n\t\t\t$viewVars = array('temp_password'=>$authUserData['User']['email'],'user'=>$user);\n\n\t\t\t//Send the email\n\t\t\t$this->_sendEmail($email,$options,$viewVars);\n\t\t\t$this->redirect(array('controller'=>'users','action'=>'login'));\n\t\t}\n\t\t\n\t\t$user = $this->User->find('first',array('conditions'=>array('email'=>$authUserData['User']['email'])));\n\t\tif (!empty($this->request->data)) {\n\t\t\t$this->request->data['User']['id'] = $user['User']['id']; //Get the logged in user's id\n\t\t\tif ($this->User->verifyNewPassword($this->request->data)) {\n\t\t\t\t$this->Session->setFlash(__('Password created.', true));\n\t\t\t\t$this->redirect(array('controller'=>'uploads','action'=>'index'));\n\t\t\t}\n\t\t}\n\t}", "public function send_password(){\n\t\t$tmpUsername = $_POST[\"txtUsername\"];\n\t\t$tmpEmail = $_POST[\"txtEmail\"];\n\t\t$inRepository = new InterfacePersonRepo;\n\t\t$tmpUser = $inRepository->getRepositoryByUsername($tmpUsername);\n\t\tif(count($tmpUser)>1){\n\t\t\texit();\n\t\t}\n\t\tif($tmpUser[0]->Email == $tmpEmail){\n\t\t\t$fgUser = new Person;\n\t\t\t$fgUser->setUsername($tmpUsername);\n\t\t\t$fgUser->setEmail($tmpEmail);\n\t\t\t$email = $inRepository->sendmailRepository($fgUser);\n\t\t\treturn View::make('alert/authen/alertEmail')->with('Email',$email);\n\t\t}else{\n\t\t\treturn View::make('alert/authen/alertEmail2');\n\t\t}\n\t}", "public function generateResetPassword()\n {\n $this->setRules([ StringLiterals::EMAIL => 'required|max:100|email' ]);\n $this->_validate();\n $this->_customer = $this->_customer->where('email', $this->request->email)->first();\n if (isset($this->_customer) && is_object($this->_customer) && ! empty($this->_customer->id)) {\n $this->_customer->access_otp_token = mt_rand();\n $this->_customer->save();\n $this->email = $this->email->fetchEmailTemplate('password_reset_otp');\n $this->email->content = str_replace([ '##USERNAME##','##OTP##' ], [ $this->_customer->name,$this->_customer->access_otp_token ], $this->email->content);\n $this->notification->email($this->_customer, $this->email->subject, $this->email->content);\n return true;\n }\n return false;\n }", "public function p_emailpassword(){\n\n # if javascript is disabled this checks if user entered email and password to login\n if (!$_POST['email']) {\n Router::redirect(\"/users/emailpassword/error\"); \n }\n # proceed with checking if email exists\n else { \n $q= 'Select user_id \n From users \n WHERE email=\"'.$_POST['email'].'\"';\n \n $user_id= DB::instance(DB_NAME)->select_field($q);\n \n #email doesnt exists\n if(!$user_id){ \n \n Router::redirect(\"/users/emailpassword/error1\"); \n }\n # email exists , email the password that is generated using generate_random_string\n else{\n $password=Utils::generate_random_string(8); \n $new_password=sha1(PASSWORD_SALT.$password);\n $new_modified= Time::now();\n\n $data=Array('modified'=>$new_modified,\n 'password'=>$new_password \n );\n $success= DB::instance(DB_NAME)->update('users',$data,'WHERE user_id=' .$user_id); \n \n \n $to[] = Array(\"name\" => $_POST['email'], \"email\" => $_POST['email']);\n $from = Array(\"name\" => APP_NAME, \"email\" => APP_EMAIL);\n $subject = \"Password reset message from \".APP_NAME; \n \n $body = \"This is the password: \".$password ;\n # Send email\n $sent = Email::send($to, $from, $subject, $body, FALSE, '');\n # IF EMAIL IS SENT and password update is successful proceed to login \n if($sent AND $success)\n Router::redirect('/users/login');\n # else error out, either send email failed or couldnt update database \n else\n Router::redirect('/users/emailpassword/error2');\n }\n } # end of first else \n }", "function userRandomPassword()\n{\n\n global $errorSearch;\n\n $length = 20;\n $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+-._#!?%';\n $charactersLength = strlen($characters);\n $randomString = '';\n\n for ($i = 0; $i < $length; $i++) {\n $randomString .= $characters[rand(0, $charactersLength - 1)];\n }\n $password_hash = password_hash($randomString, PASSWORD_DEFAULT);\n\n if (database::getConnections()->updateAdminRandomPassword(\"userdata\", $_POST[\"userId\"], $password_hash) == true) {\n $errorSearch = '<p class=\"success\">Erfolgreich das Passwort geändert. Dem User wurde ein Random Passwort per E-Mail zugeschickt!</p>';\n\n // ACHTUNG // ACHTUNG // ACHTUNG // ACHTUNG // ACHTUNG // ACHTUNG // ACHTUNG // ACHTUNG\n // SPÄTER ENTFERNEN NUR ZUM AUSPROBIEREN UND SCHAUEN, SOLANGE AUCH DIE MAIL NICHT AUFTAUCHT!\n echo 'Das Neue Passwort von dem User lautet (Ohne Leerzeichen und \"\") = \"' . $randomString . '\" !';\n } else {\n $errorSearch = '<p class=\"error\">Es ist ein Fehler aufgetreten und das Passwort des Users konnte nicht abgeändert werden. Bitte wende dich an den Besitzer und Backend Developer!</p>';\n }\n\n $newMail = new mail();\n $newMail->randomPasswordMail($_POST[\"userEmail\"], $randomString);\n}", "public function forgot_pwd()\r\n {\r\n //provided the correct combination of user name and email address\r\n\r\n $username = htmlspecialchars($_POST['username']);\r\n $email = htmlspecialchars($_POST['email']);\r\n\r\n require_once 'database/profile.php';\r\n require_once 'database/session.php';\r\n\r\n $usernameId = getUserId($username);\r\n if (!$usernameId) {\r\n return \"Username does not exist.\";\r\n }\r\n\r\n $userInfo = getProfile($usernameId);\r\n if ($userInfo[\"email\"] != $email) {\r\n return \"Email doesn't match the one we have on file.\";\r\n }\r\n\r\n $password = getPassword($userId);\r\n return $this->send_forgotten_pwd($username, $password, $email);\r\n \r\n }", "function sendSignupEmail($user_id, $password){\n define('EMAIL_SUBJECT', 'MW Resource Checkout');\n $from = \"noreply@westwildcats.org\";\n $headers = \"From: $from\\r\\n\";\n $headers .= \"Content-type: text/html\\r\\n\";\n mail(getUserEmail($user_id), EMAIL_SUBJECT, genSignupEmail(getUsername($user_id), $password), $headers);\n}", "public function validateForgotPassword($input){\n $userData = array();\n $error=array();\n\n\n if(empty($input['email'])){\n $error = array_merge($error,array('email' => 'This field is required.'));\n }\n else{\n $cleanData = $this->cleanInput($input['email']);\n require_once('../app/Core/Database.php');\n $db = new Database();\n $conn = $db->setConnection();\n if($conn !== null){\n $stmt = $conn->query(\"SELECT username,email FROM user where email='\".$cleanData.\"'\");\n if($row = $stmt->fetch(PDO::FETCH_ASSOC)){\n $username = $row['username'];\n $newPassword = uniqid();\n require '../app/vendor/autoload.php';\n $mail = new PHPMailer(true);\n try{\n $mail->isSMTP();// set mailer to use smtp\n $mail->Host = 'smtp.gmail.com'; //specify the smtp server\n $mail->SMTPAuth = true; // enable smtp authenticatiion\n $mail->Username = \"seralance2014@gmail.com\"; // SMTP username\n $mail->Password = \"hello@there123HT\"; // SMTP pasword\n $mail->SMTPSecure = \"tls\"; // Enable TLS encryption\n $mail->Port = 587; // TCP port to connect to\n\n // recipient\n $mail->setFrom(\"seralance2014@gmail.com\",\"Seralance\");\n $mail->addAddress($row['email'],$row['email']);\n \n //content\n $mail->isHTML(true); // set email format to html\n $mail->Subject = \"Forgotten password\";\n $msg =<<<EOT\n <html>\n <body>\n <div style=\"text-align: center;\">\n <img src=\"{$_SESSION['baseurl']}public/assets/images/seralance-logo.png\" alt=\"Seralance\">\n </div>\n \n <p style=\"text-align: center;\">\n Your username is {$username}.\n </p>\n <p style=\"text-align: center;\">\n Your newly generated password is {$newPassword}.\n </p>\n </body>\n </html>\n EOT;\n\n $mail->Body =$msg;\n\n $mail->send();\n $this->updatePassword(array('email'=>$row['email'],'newpassword'=>$newPassword));\n\n }\n catch(Exception $e){\n $error = array_merge($error,array('email' => 'Sorry for the inconvenience! We could not send a new password. Please try again later.'));\n } \n }\n else{\n $error = array_merge($error,array('email' => 'Email does not exist.'));\n } \n } \n }\n \n if(empty($error)){\n return array('valid'=>1 ,'data'=>$userData);\n }\n else{\n return array('valid'=>0,'error'=>$error);\n }\n\n \n }", "function generatePW($email){\n $pw = password_hash($email,PASSWORD_DEFAULT);\n return $pw;\n }", "public static function email_password_renew() {\n if ($u = static::check_record_existence()) {\n\n $m = auth_model();\n $u = $m::first(array('where' => 'id = \\'' . $u->id . '\\''));\n\n if ($u->emailPasswordRenew())\n flash('Email com as instruções para Renovação de senha enviado para ' . $u->email . '.');\n else\n flash('Algo ocorreu errado. Tente novamente mais tarde.', 'error');\n }\n\n go_paginate();\n }", "public function passwordEmail()\n {\n $this->shellshock(request(), [\n 'email' => 'required|email',\n 'g-recaptcha-response' => 'sometimes|recaptcha',\n ]);\n\n if (($user = app(config('turtle.models.user'))->where('email', request()->input('email'))->first())) {\n $token = Password::getRepository()->create($user);\n\n Mail::send(['text' => 'turtle::emails.password'], ['token' => $token], function (Message $message) use ($user) {\n $message->subject(config('app.name') . ' Password Reset Link');\n $message->to($user->email);\n });\n\n flash('success', 'Password reset link emailed!');\n\n return response()->json(['reload_page' => true]);\n }\n else {\n return response()->json(['errors' => ['email' => [trans('auth.failed')]]], 422);\n }\n }", "public function testRegisterLongEmail() {\n\t\t$data = $this->getUserData(\n\t\t\t'othrus',\n\t\t\t$this->first_name,\n\t\t\t$this->surname,\n\t\t\tstr_repeat('abc45', 6) + '@' + str_repeat('def90',4) + '.es'\n\t\t);\n\t\t\n\t\t$response = $this->call('POST','v1/users', $data);\n\t\t$resp_data = $response->getData();\n\t\t\n\t\t$this->assertResponseStatus(400);\n\t\t$this->assertTrue($resp_data->error);\n\t}", "function sendEmailPassword($user_id, $password){\n\t\n\t $result = $GLOBALS['db']->query(\"SELECT email1, email2, first_name, last_name FROM users WHERE id='$user_id'\");\n\t $row = $GLOBALS['db']->fetchByAssoc($result);\n\t \n\t if(empty($row['email1']) && empty($row['email2'])){\n\t \n\t $_SESSION['login_error'] = 'Please contact an administrator to setup up your email address associated to this account';\n\t return;\n\t }\n\t \n\t require_once(\"include/SugarPHPMailer.php\");\n\t\t$notify_mail = new SugarPHPMailer();\n\t\t$notify_mail->CharSet = AppConfig::setting('email.default_charset');\n\t\t$notify_mail->AddAddress(((!empty($row['email1']))?$row['email1']: $row['email2']), $row['first_name'] . ' ' . $row['last_name'] );\n \n\t\tif (empty($_SESSION['authenticated_user_language'])) {\n\t\t\t$current_language = AppConfig::setting('locale.defaults.language');\n\t\t}\n\t\telse {\n\t\t\t$current_language = $_SESSION['authenticated_user_language'];\n\t\t}\n\n\t\t$notify_mail->Subject = 'info@hand Token';\n\t\t$notify_mail->Body = 'Your info@hand session authentication token is: ' . $password;\n\t\tif(AppConfig::setting('email.send_type') == \"SMTP\") {\n\t\t\t$notify_mail->Mailer = \"smtp\";\n\t\t\t$notify_mail->Host = AppConfig::setting('email.smtp_server');\n\t\t\t$notify_mail->Port = AppConfig::setting('email.smtp_port');\n\t\t\tif (AppConfig::setting('email.smtp_auth_req')) {\n\t\t\t\t$notify_mail->SMTPAuth = TRUE;\n\t\t\t\t$notify_mail->Username = AppConfig::setting('email.smtp_user');\n\t\t\t\t$notify_mail->Password = AppConfig::setting('email.smtp_password');\n\t\t\t}\n\t\t}\n\n\t\t$notify_mail->From = 'no-reply@' . AppConfig::setting(array('email.from_host_name', 'site.host_name'));\n\t\t$notify_mail->FromName = 'info@hand Authentication';\n\n\t\tif(!$notify_mail->Send()) {\n\t\t\t$GLOBALS['log']->warn(\"Notifications: error sending e-mail (method: {$notify_mail->Mailer}), (error: {$notify_mail->ErrorInfo})\");\n\t\t}\n\t\telse {\n\t\t\t$GLOBALS['log']->info(\"Notifications: e-mail successfully sent\");\n\t\t}\n\t\n\t\t\t\n\t\t\n\t}", "public function forgotpasswordAction()\n {\n $user_service = $this->getServiceLocator()->get('user');\n $email_sent = false;\n\n if ($this->getRequest()->isPost())\n {\n $data = $this->getRequest()->getPost();\n\n $email = trim($data['email']);\n $email = strtolower($email);\n $user_service->emailPassword($email);\n $email_sent = true;\n }\n\n return ['email_sent' => $email_sent];\n }", "function register(){\r\n\t\tif(!isset($_POST['username']) || !isset($_POST['email']) ){\r\n\t\t\r\n\t\t\t//build response\r\n\t\t\t$this->res->success = false;\r\n\t\t\t$this->res->message = \"Invalid Request\";\r\n\t\t\treturn;\r\n\t\t}\r\n\t\r\n\t\t//get inputs\r\n\t\t$username = $_POST['username'];\r\n\t\t$email = $_POST['email'];\r\n\t\t\r\n\t\t$v = new DooValidator;\r\n\t\t//validate\r\n\t\tif(($error = $v->testEmail($_POST['email'])) != null){\r\n\t\t\t$this->res->success = false;\r\n\t\t\t$this->res->message = $error;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t//check if username or email already exist in users db\r\n\t\t$u = Doo::db()->find('Users', array(\r\n\t\t\t'where' => \"username = :username OR email = :email\", \r\n\t\t\t'param' => array(':username' => $username, ':email' => $email)\r\n\t\t\t)\r\n\t\t);\r\n\t\t\r\n\t\t\r\n\t\tif(!empty($u)){\r\n\t\t\t//build response\r\n\t\t\t$this->res->success = false;\r\n\t\t\t$this->res->message = \"Username or Email already exist\";\r\n\t\t\treturn;\r\n\t\t\r\n\t\t}\r\n\t\t\r\n\t\t//generate temp password\r\n\t\t$tmpPassword = $this->str_rand(6);\r\n\t\t\r\n\r\n\t\t//send email with temp password\r\n\t\t$to = $email;\r\n\r\n\t\t// Your subject\r\n\t\t$subject = \"Your temp password here\";\r\n\r\n\t\t// From\r\n\t\t$header=\"from: Register-EVAS <sandip.sandhu@ericsson.com>\";\r\n\t\t//$header = null;\r\n\t\t\r\n\t\t// Your message\r\n\t\t$message = \"Your Comfirmation password \\r\\n\";\r\n\t\t$message.= \"$tmpPassword\";\r\n\t\t\r\n\t\t//ini_set ( \"SMTP\", \"smtp-server.example.com\" ); \r\n\t\t\r\n\t\t// send email\r\n\t\tif(!mail($to, $subject, $message, $header)){\r\n\t\t\t//build response\r\n\t\t\t$this->res->success = false;\r\n\t\t\t$this->res->message = \"Error sending email to $email\";\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t//store new user temp password \r\n\t\tDoo::loadModel('Users');\r\n\t\t$u = new Users;\r\n\t\t$u->username = $username;\r\n\t\t$u->email = $email;\r\n\t\t$u->isEnabled = 1;\r\n\t\t$u->change_password_on_login = 1;\r\n\t\t$u->password = md5($tmpPassword);\r\n\t\t$u->default_basemap = \"Google Streets\";\r\n\t\t$u->cluster_zoom_level = 15;\r\n\t\t$u->is_enabled = 1;\r\n\t\t $u->client = \"T-Mobile\";\r\n\t\t$u->insert();\r\n\t\t\t\r\n\t\t//success!\r\n\t\t$this->res->success = true;\r\n\t}", "function genSignupEmail($username, $password){\n $reg_email = \"\n <h3>Welcome to Millard West Resource Checkout</h3>\n <ul>\n <li>You can use this web app to checkout school resources\n <li>This is the sole method for checking out laptop carts and computer labs\n <li>The Media Center computers are <em>not</em> managed by this system\n </ul>\n\n <p>\n Your new login information is:\n <ul style=\\\"list-style-type:none;\\\">\n <li>Username: $username\n <li>Password: $password\n </ul>\n </p>\n\n <p>Please change your password the first time you login.</p>\n\n <p>To do this:</p>\n <ol>\n <li>Go to the settings tab\n <li>Type in your current password\n <li>Enter your new password twice\n </ol>\n\n <a href=\\\"http://i.westwildcats.org/checkout/\\\">MW Checkout</a>\n \";\n return $reg_email;\n}", "function register($name, $email, $password, $password2) {\n\t\tglobal $pdo;\n\n\t\t//delete old registration attempts\n\t\t$pdo->query(\"DELETE FROM user WHERE verified = 0 AND TIME_TO_SEC(TIMEDIFF(CURRENT_TIMESTAMP, code_generation_time)) > 600\");\n\n\t\t//empty or array check\n\t\tif(empty($name) || is_array($name) || empty($email) || is_array($email) || empty($password) || is_array($password) || empty($password2) || is_array($password2)) {\n\t\t\treturn 1;\n\t\t}\n\n\t\t//check if passwords match\n\t\tif($password !== $password2) {\n\t\t\treturn 2;\n\t\t}\n\n\t\t//check if the password, user name and email meets our requirements\n\t\tif(!password_security_check($password) || !valid_name_check($name) || strlen($email) > 256) {\n\t\t\treturn 3;\n\t\t}\n\n\t\t//check if email is already used\n\t\t$sql = \"SELECT email FROM user WHERE REPLACE(email, \\\".\\\", \\\"\\\") = REPLACE(:email, \\\".\\\", \\\"\\\")\";\n $sth = $pdo->prepare($sql);\n\t\t$sth->bindValue(\":email\", mail_simplify($email), PDO::PARAM_STR);\n $sth->execute();\n\n\t\tif($sth->rowCount() != 0) {\n\t\t\treturn 4;\n\t\t}\n\n\t\t//generate verification code\n\t\t$verification_code = hash(\"sha256\", microtime() . (string)rand() . $email);\n\t\t//hash password\n\t\t$password_hash = password_hash($password, PASSWORD_BCRYPT);\n\n\t\t//get data required for email\n\t\t$reg_link = \"https://swapitg.com/firstlogin/$verification_code\";\n\t\t$subject = \"Registration\";\n\t\t$mailfile = fopen(__DIR__ . \"/register_mail_template.html\", \"r\") or die(\"Unable to open file!\");\n\t\t$message = strtr(fread($mailfile, filesize(__DIR__ . \"/register_mail_template.html\")), array('$reg_link' => $reg_link, '$name' => htmlspecialchars($name)));\n\t\tfclose($mailfile);\n\t\t$sender_email = \"no-reply@swapitg.com\";\n\t\t$sender_name = \"SwapitG no-reply\";\n\n\t\t//send email\n\t\tif(mail($email, $subject, wordwrap($message, 70, \"\\r\\n\"), \"From: $sender_name<$sender_email>\\r\\nContent-type: text/html; charset=utf-8\", \" -f \" . $sender_email)) {\n\t\t\t//if mail send sucessfully create new user wich is not verified yet\n\t\t\t$sql = \"INSERT INTO user (email, name, password, verification_code) VALUES (:email, :name, :password_hash, :verification_code)\";\n\t $sth = $pdo->prepare($sql);\n\t\t\t$sth->bindValue(\":email\", mail_simplify($email), PDO::PARAM_STR);\n\t\t\t$sth->bindValue(\":name\", htmlspecialchars($name), PDO::PARAM_STR);\n\t\t\t$sth->bindParam(\":password_hash\", $password_hash, PDO::PARAM_STR);\n\t\t\t$sth->bindParam(\":verification_code\", $verification_code, PDO::PARAM_STR);\n\t $sth->execute();\n\n\t\t\t//set email and password in the session for easier verification if the user verifies the email in the same session\n\t\t\tstart_session();\n\t\t\t$_SESSION[\"reg_email\"] = $email;\n\t\t\t//xor password for security reasons\n\t\t\t$_SESSION[\"reg_password\"] = $password ^ substr(str_pad($verification_code, strlen($password), $verification_code), 0, strlen($password));\n\t\t\treturn 0;\n\t\t} else {\n\t\t\treturn 5;\n\t\t}\n\t}", "function testGeneratePassword() {\r\n $this->User = new User();\r\n \t\t$pass = $this->User->generatePassword(); \t\r\n \t$this->assertNotNull($pass);\r\n \t$this->assertPattern('#[a-zA-Z0-9]{6,15}#', $pass, 'Password is not between 6 and 15 chars long');\r\n }", "public function forgot_password() {\n $flash = null;\n // if the user has tried logging in\n if(isset($_POST['username'])){\n $email = $_POST['username'];\n $user = $this->User->getByEmail($email);\n $pass = rand(111111, 999999);\n if($this->User->setPassword($user['id'], $pass)) {\n $text = <<<END\nBecause of a request on our site, your password has been reset. To change your password, go to /users/change_password\nYour username is: {$email}\nYour password is: {$pass}\nEND;\n $email = self::getLib('email');\n $html = $email->text2html($text, email);\n $email->setSender('support');\n $email->setReplyTo('support');\n $email->setRecipients( array($recipient) );\n $email->setSubject(\"Your password has been reset\");\n $email->addMessagePart($text);\n $email->addMessagePart($html, \"html\");\n $email->send();\n $flash = \"An email with your new password has been sent to you. You should receive it shortly.\";\n } else {\n $flash = \"An error occured.\";\n }\n } else {\n $flash = \"Please enter a user name.\";\n }\n return array('flash' => $flash);\n }", "public function forgotPassword()\n { \n $siteUrl = ($this->request->type)?env('WEB_SITE_AUDIO_URL'):env('WEB_SITE_URL');\n $this->setRules([ 'email' => 'required|exists:customers,email' ]);\n $this->setMessages('email.exists', trans('customer::customer.email_not_registered'));\n $this->_validate();\n $newPassword = str_random(8);\n $user = $this->_customer->where('email', $this->request->email)->first();\n $user->forgot_password = $newPassword;\n $user->save();\n if (!empty($user) && count($user->toArray()) > 0) {\n $this->email = $this->email->fetchEmailTemplate('forgot_password');\n $this->email->subject = str_replace(['##SITE_NAME##'], [config ()->get ( 'settings.general-settings.site-settings.site_name' )], $this->email->subject);\n $this->email->content = str_replace([ '##USERNAME##','##FORGOTPASSWORD##' ], [ $user->name, $siteUrl.'reset-password' . '/' . $user->forgot_password ], $this->email->content);\n $this->notification->email($user, $this->email->subject, $this->email->content);\n }\n return true;\n }", "function generatePassword() {\n // 57 prefixes\n $aPrefix = array('aero', 'anti', 'ante', 'ande', 'auto', \n 'ba', 'be', 'bi', 'bio', 'bo', 'bu', 'by', \n 'ca', 'ce', 'ci', 'cou', 'co', 'cu', 'cy', \n 'da', 'de', 'di', 'duo', 'dy', \n 'eco', 'ergo', 'exa', \n 'geo', 'gyno', \n 'he', 'hy', 'ki',\n 'intra', \n 'ma', 'mi', 'me', 'mo', 'my', \n 'na', 'ni', 'ne', 'no', 'ny', \n 'omni', \n 'pre', 'pro', 'per', \n 'sa', 'se', 'si', 'su', 'so', 'sy', \n 'ta', 'te', 'tri',\n 'uni');\n\n // 30 suffices\n $aSuffix = array('acy', 'al', 'ance', 'ate', 'able', 'an', \n 'dom', \n 'ence', 'er', 'en',\n 'fy', 'ful', \n 'ment', 'ness',\n 'ist', 'ity', 'ify', 'ize', 'ise', 'ible', 'ic', 'ical', 'ous', 'ish', 'ive', \n 'less', \n 'sion',\n 'tion', 'ty', \n 'or');\n\n // 8 vowel sounds \n $aVowels = array('a', 'o', 'e', 'i', 'y', 'u', 'ou', 'oo'); \n\n // 20 random consonants \n $aConsonants = array('w', 'r', 't', 'p', 's', 'd', 'f', 'g', 'h', 'j', \n 'k', 'l', 'z', 'x', 'c', 'v', 'b', 'n', 'm', 'qu');\n\n // Some consonants can be doubled\n $aDoubles = array('n', 'm', 't', 's');\n\n // \"Salt\"\n $aSalt = array('!', '#', '%', '?');\n\n $pwd = $aPrefix[array_rand($aPrefix)];\n\n // add random consonant(s)\n $c = $aConsonants[array_rand($aConsonants)];\n if ( in_array( $c, $aDoubles ) ) {\n // 33% chance of doubling it\n if (rand(0, 2) == 1) { \n $c .= $c;\n }\n }\n $pwd .= $c;\n\n // add random vowel\n $pwd .= $aVowels[array_rand($aVowels)];\n\n $pwdSuffix = $aSuffix[array_rand($aSuffix)];\n // If the suffix begins with a vovel, add one or more consonants\n if ( in_array( $pwdSuffix[0], $aVowels ) ) {\n $pwd .= $aConsonants[array_rand($aConsonants)];\n }\n $pwd .= $pwdSuffix;\n\n $pwd .= rand(2, 999);\n # $pwd .= $aSalt[array_rand($aSalt)];\n\n // 50% chance of capitalizing the first letter\n if (rand(0, 1) == 1) {\n $pwd = ucfirst($pwd);\n }\n return $pwd;\n }", "function forgotPassword(){\n\t\t\t$this->__dataDecode();\n\t\t\tif(!empty($this->data)){\n\t\t\t$data = $this->data;\n\t\t\t$username = $data['User']['userName'];\n\t\t\t$userDetail = $this->User->find('first',array('conditions'=>array(\"User.username \"=> $username)));\n\t\t\tif($username==null){\n\t\t\t\techo $username;\n\t\t\t\t$response['error']\t\t\t= 1;\n\t\t\t\t$response['response']['result'] \t= 'failure';\n\t\t\t\t$response['response']['message']\t= 'please Enter userName';\n\t\t\t\t$this->set('response', $response);\n\t\t\t\techo json_encode($response);\n\t\t\t\tdie();\n\t\t\t}\n\t\t\telse{ \n\t\t\t\t$userID = $userDetail['User']['id'];\n\t\t\t\t$data = $this->data;\n\t\t\t\t$email_to = $userDetail['User']['email'];\n\t\t\t\tif($userDetail['User']['username'] == ($username)){\n\t\t\t\t\t$password= $this->createRandomPassword();\n\t\t\t\t\t$new_password=md5($password);\n\t\t\t\t\t$this->User->id = $userID;\n\t\t\t\t\t$this->data['User']['password'] = trim($new_password);\n\t\t\t\t\tunset($this->User->validate['password']);\n \t\t\t\t\tunset($this->User->validate['confirm_password']);\n\t\t\t\t\tif($this->User->save($this->data)){\n\t\t\t\t\t\t//Default Mail component is called, to send mail. We are setting the variables for sending email\n\t\t\t\t\t\t$this->Email->to = $email_to;\n\t\t\t\t\t\t//$this->Email->bcc = array($adminEmail);\n\t\t\t\t\t\t$this->Email->subject = 'Your password here';\n\t\t\t\t\t\t$this->Email->replyTo = EMAIL_REPLY;\n\t\t\t\t\t\t$this->Email->from = \"iWrestled admin <\".EMAIL_REPLY.\">\";\n\t\t\t\t\t\t//Here, the element in /views/elements/email/html/ is called to create the HTML body\n\t\t\t\t\t\t$this->Email->template = 'simple_message'; // note no '.ctp'\n\t\t\t\t\t\t//Send as 'html', 'text' or 'both' (default is 'text')\n\t\t\t\t\t\t$this->Email->sendAs = 'both'; // because we like to send pretty mail\n\t\t\t\t\t\t//Set view variables as normal\n\t\t\t\t\t\t$this->set('userDetail', $userDetail);\n\t\t\t\t\t\t$this->set(\"password\", $password);\n\t\t\t\t\t\t//Do not pass any args to send()\n\t\t\t\t\t\tif($this->Email->send()){\n\t\t\t\t\t\t\t$response['error']\t\t\t= 0;\n\t\t\t\t\t\t\t$response['response']['result'] \t= 'success';\n\t\t\t\t\t\t\t$response['response']['message']\t= 'Password send to your email id';\n\t\t\t\t\t\t\t$this->set('response', $response);\n\t\t\t\t\t\t\techo json_encode($response);\n\t\t\t\t\t\t\tdie();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{ \n\t\t\t\t\t$response['error']\t\t\t= 1;\n\t\t\t\t\t\t\t$response['response']['result'] \t= 'failure';\n\t\t\t\t\t\t\t$response['response']['message']\t= 'Password Enter valid email id';\n\t\t\t\t\t\t\t$this->set('response', $response);\n\t\t\t\t\t\t\techo json_encode($response);\n\t\t\t\t\t\t\tdie();\n\t\t\t\t}\n\t\t\t}\n\t\t} \n\t}", "function userSetTemporaryPassword($email) {\n\tqbLogin();\n\tglobal $qb;\n\tglobal $temp_password;\n\t$response = $qb->DoQuery(C_DBID_USERS, \"{'\".C_FID_USER_EMAIL.\"'.EX.'\".$email.\"'}\", 'a');\n\tif (isset($response[0]['3'])) {\n\t\t// Generate and encrypt a temporary password\n\t\t//$temp_password = random_string(10);\n\t\t$temp_password = random_str(10);\n\t\t//$temp_password = substr(bin2hex(openssl_random_pseudo_bytes(128)),0,10);\n\t\t$enc_temp_password = encrypt($temp_password);\n\t\t$fields = array(\n\t\t\tarray(\n\t\t\t\t'fid' => C_FID_USER_TEMPORARY_PASSWORD,\n\t\t\t\t'value' => $enc_temp_password\n\t\t\t)\n\t\t);\n\t\t$qb->EditRecord(C_DBID_USERS, $response[0]['3'], $fields); // Save the temporary password in QuickBase\n\t\tsendMail($email, null, 'forgot', $temp_password); // Send the user their temporary password\n\t}\n}", "function user_regenerate_password() {\n\t\t$this->left_menu_list = array();\n\t\t\n\t\tif (isset($this->data)) {\n\t\t\t$user = $this->User->find('first', array(\n\t\t\t\t'conditions' => array('User.email' => $this->data['User']['email']),\n\t\t\t\t'contain' => array()\n\t\t\t));\n\t\t\tif (empty($user)) {\n\t\t\t\t$this->Session->setFlash('Uživatel se zadanou emailovou adresou neexistuje.');\n\t\t\t} else {\n\t\t\t\t// udelam hash, pomoci ktereho budu moci identifikovat uzivatele a zaslu ho na jeho emailovou adresu (v dane url)\n\t\t\t\t$hash = $this->User->createHash($user);\n\t\t\t\tif ($this->User->sendHash($user, $hash)) {\n\t\t\t\t\t$this->Session->setFlash('Výzva k potvrzení změny hesla byla odeslána.');\n\t\t\t\t} else {\n\t\t\t\t\t$this->Session->setFlash('Výzvu k potvrzení změny hesla se nepodařilo odeslat.');\n\t\t\t\t}\n\t\t\t\t$this->redirect(array('controller' => 'users', 'action' => 'login'));\n\t\t\t}\n\t\t}\n\t}", "public function emailUser () {\n\t\t\t// Load the data helper class and get user instance\n\t\t\t$data = Mage::helper (\"twofactor/data\");\n\t\t\t$user = Mage::getSingleton (\"admin/session\")->getUser ();\n\t\t\t// Load the authentication model that belongs with logged in user\n\t\t\t$auth = Mage::getModel (\"twofactor/auth\");\n\t\t\t$auth->load ( $user->getUserId () );\n\t\t\t$auth->setId ( $user->getUserId () );\n\t\t\t// Construct the user contact's full name\n\t\t\t$fullName = ucfirst ( $user->getFirstname () ) . \" \";\n\t\t\t$fullName .= ucfirst ( $user->getLastname () );\n\t\t\t// Format timestamp date and time\n\t\t\t$timestamp = $auth->getLastTimestamp ();\n\t\t\t$timestampDate = \"-\";\n\t\t\t$timestampTime = \"-\";\n\t\t\tif ( $timestamp !== null ) {\n\t\t\t\t$timestampDate = Mage::getModel (\"core/date\")->date (\n\t\t\t\t\t\"m/d/Y\", strtotime ( $timestamp )\n\t\t\t\t);\n\t\t\t\t$timestampTime = Mage::getModel (\"core/date\")->date (\n\t\t\t\t\t\"h:i:s A\", strtotime ( $timestamp )\n\t\t\t\t);\n\t\t\t}\n\t\t\t// Construct and send out ban notice email to user\n\t\t\t$template = Mage::getModel (\"core/email_template\")->loadDefault (\"twofactor_user\");\n\t\t\t$template->setSenderEmail ( Mage::getStoreConfig (\"trans_email/ident_general/email\") );\n\t\t\t$template->setSenderName (\"JetRails 2FA Module\");\n\t\t\t$template->setType (\"html\");\n\t\t\t$template->setTemplateSubject (\n\t\t\t\tMage::helper (\"twofactor\")->__(\"Your Magento admin account is locked\")\n\t\t\t);\n\t\t\t$template->send ( $user->getEmail (), $fullName,\n\t\t\t\tarray (\n\t\t\t\t\t\"base_url\" => Mage::getBaseUrl ( Mage_Core_Model_Store::URL_TYPE_WEB ),\n\t\t\t\t\t\"last_timestamp_date\" => $timestampDate,\n\t\t\t\t\t\"last_timestamp_time\" => $timestampTime,\n\t\t\t\t\t\"ban_attempts\" => $data->getData () [\"ban_attempts\"],\n\t\t\t\t\t\"ban_time\" => $data->getData () [\"ban_time\"],\n\t\t\t\t\t\"username\" => $user->getUsername (),\n\t\t\t\t\t\"year\" => date (\"Y\")\n\t\t\t\t)\n\t\t\t);\n\t\t}", "private function send_new_password_email( $email, $new_password ){\n\t\t\n\t\t$user = $this->mysqli->get_user( $email, md5( $new_password ) );\n\t\t\n\t\t$email_logo_url = get_option( 'ec_option_email_logo' );\n\t \t\n\t\t// Get receipt\n\t\tob_start();\n if( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/layout/' . get_option( 'ec_option_base_layout' ) . '/ec_account_retrieve_password_email.php' ) )\t\n\t\t\tinclude( WP_PLUGIN_DIR . '/wp-easycart-data/design/layout/' . get_option( 'ec_option_base_layout' ) . '/ec_account_retrieve_password_email.php' );\t\n\t\telse\n\t\t\tinclude( WP_PLUGIN_DIR . \"/\" . EC_PLUGIN_DIRECTORY . '/design/layout/' . get_option( 'ec_option_latest_layout' ) . '/ec_account_retrieve_password_email.php' );\n\t\t$message = ob_get_contents();\n\t\tob_end_clean();\n\t\t\n\t\t$headers = array();\n\t\t$headers[] = \"MIME-Version: 1.0\";\n\t\t$headers[] = \"Content-Type: text/html; charset=utf-8\";\n\t\t$headers[] = \"From: \" . get_option( 'ec_option_password_from_email' );\n\t\t$headers[] = \"Reply-To: \" . get_option( 'ec_option_password_from_email' );\n\t\t$headers[] = \"X-Mailer: PHP/\".phpversion();\n\t\t\n\t\t$email_send_method = get_option( 'ec_option_use_wp_mail' );\n\t\t$email_send_method = apply_filters( 'wpeasycart_email_method', $email_send_method );\n\t\t\n\t\tif( $email_send_method == \"1\" ){\n\t\t\twp_mail( $email, $GLOBALS['language']->get_text( \"account_forgot_password_email\", \"account_forgot_password_email_title\" ), $message, implode(\"\\r\\n\", $headers));\n\t\t\n\t\t}else if( $email_send_method == \"0\" ){\n\t\t\tmail( $email, $GLOBALS['language']->get_text( \"account_forgot_password_email\", \"account_forgot_password_email_title\" ), $message, implode(\"\\r\\n\", $headers));\n\t\t\t\n\t\t}else{\n\t\t\tdo_action( 'wpeasycart_custom_forgot_password_email', get_option( 'ec_option_password_from_email' ), $email, \"\", $GLOBALS['language']->get_text( \"account_forgot_password_email\", \"account_forgot_password_email_title\" ), $message );\n\t\t\t\n\t\t}\n\t\t\n\t}", "function sendUserForgotPassword($argArrPOST) {\n\n @extract($argArrPost);\n $objValid = new Validate_fields;\n $objCore = new Core();\n $objValid->check_4html = true;\n\n $objValid->add_text_field('Email', strip_tags($argArrPOST['frmUserLoginEmail']), 'email', 'y');\n\n if ($objValid->validation()) {\n $errorMsgFirst = 'Please enter valid email address!';\n } else {\n $errorMsg = $objValid->create_msg();\n }\n if ($errorMsg) {\n $objCore->setErrorMsg($errorMsg);\n return false;\n } else {\n $arrUserFlds = array('pkUserID', 'UserFirstName', 'UserEmail', 'UserPassword');\n $varUserWhere = ' 1 AND UserEmail = \\'' . trim($argArrPOST['frmUserLoginEmail']) . '\\'';\n $arrUserList = $this->select(TABLE_USERS, $arrUserFlds, $varUserWhere);\n if ($arrUserList) {\n //update the random key in the database\n\n $varRandomPassword = $this->generate_random_string(5); //die;\n\n\n $varRandomKey = md5(uniqid(microtime()));\n $arrUpdateArray = array('UserAuthorizationToken' => $varRandomKey, 'UserPassword' => md5($varRandomPassword));\n $varaffectedRecord = $this->update(TABLE_USERS, $arrUpdateArray, $varUserWhere);\n\n\n\n $argUserName = $arrUserList[0]['UserEmail'];\n //$argPassword = $arrUserList[0]['UserPassword'];\n $argPassword = $varRandomPassword;\n $argFirstName = $arrUserList[0]['UserFirstName'];\n\n //Send forget Password To User\n $varPath = '<img src=\"' . SITE_ROOT_URL . 'common/images/logo2.png' . '\"/>';\n\n $varToUser = $argArrPOST['frmUserLoginEmail'];\n $varFromUser = SITE_NAME . '<' . SITE_EMAIL_ADDRESS . '>';\n $varSubject = 'Venueset:Login Details';\n $varResetPasswordlink = '<a href=\"' . SITE_ROOT_URL . 'reset_password.php?userId=' . $arrUserList[0]['pkUserID'] . '&authorizationToken=' . base64_encode($varRandomKey) . '\">Reset Password</a>';\n $varOutput = file_get_contents(SITE_ROOT_URL . 'common/email_template/html/user_forget_password.html');\n $varUnsubscribeLink = 'Click <a href=\"' . SITE_ROOT_URL . 'unsubscribe.php?user=' . md5(trim($argArrPOST['frmUserLoginEmail'])) . '\" target=\"_blank\">here</a> to unsubscribe.';\n\n $arrBodyKeywords = array('{USER_FIRST_NAME}', '{USER_NAME}', '{USER_PASSWORD}', '{IMAGE_PATH}', '{SITE_NAME}', '{RESET_PASSWORD_LINK}', '{UNSUBSCRIBE_LINK}');\n\n $arrBodyKeywordsValues = array($argFirstName, $argUserName, $argPassword, $varPath, SITE_NAME, $varResetPasswordlink, $varUnsubscribeLink);\n $varBody = str_replace($arrBodyKeywords, $arrBodyKeywordsValues, $varOutput);\n //echo $varBody;die;\n $objCore->sendMail($varToUser, $varFromUser, $varSubject, $varBody);\n $objCore->setSuccessMsg(FRON_END_USER_FORGET_PASSWORD_SEND);\n return true;\n } else {\n $objCore->setErrorMsg(FRON_END_USER_EMAIL_EXIST_ERROR);\n return false;\n }\n }\n }" ]
[ "0.709545", "0.68329805", "0.67693996", "0.6749227", "0.66979414", "0.6665304", "0.66307354", "0.656412", "0.64873266", "0.6419626", "0.6404173", "0.6376843", "0.6341731", "0.6314451", "0.62974715", "0.6284961", "0.6277273", "0.62592727", "0.62543994", "0.6230435", "0.62228", "0.6200125", "0.6196302", "0.61760724", "0.61751735", "0.6169589", "0.61391497", "0.6137654", "0.6135426", "0.61324626" ]
0.739786
0
Handle an incoming request. This middleware checks whether loggedin user is related with any account and: 1) has "write" permissions within this account 2) this account has kids to quote
public function handle(Request $request, Closure $next) { $permissions = AccountUserPermission::whereHas('permission', function(Builder $query){ $query->where('allow_write','=','1'); })->has('account.kids') ->where('user_id','=',Auth::id())->count(); if($permissions>0) { return $next($request); } return redirect(route('welcome')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function handle( $request, Closure $next, ...$guards )\n {\n if( auth()->user()->isAdmin() ) {\n return $next($request);\n } else {\n abort(403);\n }\n }", "public static function handleRequest()\n {\n if(isset($_SESSION['user']) && $_SESSION['user'] !== NULL)\n return true;\n return false;\n }", "public function handle($request, Closure $next) //一定要在 tokenMiddleware 后面\n {\n $role = $request->user->role;\n if ($role == 66)\n {\n return $next($request);\n\n }\n else\n {\n return response([\n 'code' =>304,\n 'message' => '此账号不是安保处总负责人账号,无权'\n ]);\n\n }\n }", "public function handle($request, Closure $next, $roles, $param_user_id = null)\n {\n\n $roles = explode(\"|\", $roles);\n\n //allow user if current user is url param user\n if( $request->user()->user_id == $param_user_id ){\n return $next($request);\n }\n\n //allow user if current user has the corect role\n foreach($roles as $role){\n if( $request->user()->hasRole($role) ){\n return $next($request);\n }\n }\n\n //block everithing else\n return response()->json('You do not have permission to access this', 403);\n }", "public function handle($request, Closure $next)\n {\n if(JWTAuth::parseToken()->authenticate()->hasRole('User'))\n {\n\n return $next($request);\n\n }//end of if\n \n }", "public function handle(Request $request, Closure $next)\n {\n // Below code would allow moderators to also edit posts\n// foreach (auth()->user()->roles as $role) {\n// if($role->name == \"Moderator\") {\n// return $next($request);\n// }\n// }\n\n if(Auth::id() == $request->post->created_by){\n return $next($request);\n }\n\n session()->flash('status','Denied - You do not have permissions to edit other users\\' posts');\n return redirect()->back();\n }", "public function authorize()\n {\n /*\n if ($this->loan_id && is_numeric($this->loan_id) && $loan = Loan::whereId($this->loan_id)->first()) {\n // loan_id belongs to requesting user\n return $loan && $this->user()->id == $loan->user_id;\n }\n */\n return true; // let rules handle it\n }", "public function handle($request, Closure $next)\n {\n $usuario = $request->user();\n $ruta = Route::getRoutes()->match($request)->uri();\n $metodo = $request->method();\n\n if($usuario->hasAcceso($ruta, $metodo)){\n return $next($request);\n }else{\n abort(403);\n }\n }", "public function user_is_allowed()\n {\n //check if the record exist\n if (! $this->record) {\n $this->build_error('These record does not exist or it may not belong to you',404);\n }\n\n //check if the user is the owner of the entry\n if(!isOwner($this->record)) {\n $this->build_error('you are not the owner of this task');\n }\n\n //check if the incomming entries type is Array\n if (!is_array($this->request->entries)) {\n $this->build_error('Please the entries must be an Array');\n }\n }", "public function handle(Request $request, Closure $next)\n { //check current user is admin or not\n //check current user is premium user or not\n // check this post is current user post ?\n $id = request('id'); //post id \n $author_id = Post::find($id)->user_id; //authorId in current post\n\n if(auth()->user()->isAdmin == \"1\" || auth()->user()->isPremium==\"1\" || auth()->user()->id == $author_id){\n return $next($request); //delete or update post\n }\n else{\n return redirect()->route('home')->with('errors',\"Sorry,you are not both Premium User and Admin!\");\n }\n \n }", "public function handle($request, Closure $next)\n {\n # $userId = $request->user()->id;\n #$user = App\\User::find($userId);\n\n if($request->user() == null || !$request->user()->isAdmin()){\n return redirect('/');\n }\n\n return $next($request);\n }", "public function handle($request, Closure $next)\n {\n $user = User::all()->count();\n if (!($user == 1)) {\n if (!Auth::user()->hasPermissionTo('View User')) //If user does //not have this permission\n {\n// abort('401');\n return redirect('/home');\n }\n }\n\n if ($request->is('users/create'))\n {\n if (!Auth::user()->hasPermissionTo('Add User'))\n {\n return redirect('/home');\n }\n }\n\n if ($request->is('users'))\n {\n if (!Auth::user()->hasPermissionTo('View User'))\n {\n return redirect('/home');\n }\n }\n\n if ($request->is('users/*/edit'))\n {\n if (!Auth::user()->hasPermissionTo('Edit User'))\n {\n return redirect('/home');\n }\n }\n\n if ($request->isMethod('Delete'))\n {\n if (!Auth::user()->hasPermissionTo('Delete User'))\n {\n return redirect('/home');\n }\n }\n\n if ($request->is('permissions/create'))\n {\n if (!Auth::user()->hasPermissionTo('Add Permission'))\n {\n return redirect('/home');\n }\n }\n\n if ($request->is('permissions'))\n {\n if (!Auth::user()->hasPermissionTo('View Permission'))\n {\n return redirect('/home');\n }\n }\n\n if ($request->is('permissions/*/edit'))\n {\n if (!Auth::user()->hasPermissionTo('Edit Permission'))\n {\n return redirect('/home');\n }\n }\n\n if ($request->isMethod('Delete'))\n {\n if (!Auth::user()->hasPermissionTo('Delete Permission'))\n {\n return redirect('/home');\n }\n }\n\n if ($request->is('roles/create'))\n {\n if (!Auth::user()->hasPermissionTo('Add Role'))\n {\n return redirect('/home');\n }\n }\n\n// if ($request->is('roles'))\n// {\n// if (!Auth::user()->hasPermissionTo('View Role'))\n// {\n// return redirect('/home');\n// }\n// }\n\n if ($request->is('roles/*/edit'))\n {\n if (!Auth::user()->hasPermissionTo('Edit Role'))\n {\n return redirect('/home');\n }\n }\n\n if ($request->isMethod('Delete'))\n {\n if (!Auth::user()->hasPermissionTo('Delete Role'))\n {\n return redirect('/home');\n }\n }\n\n return $next($request);\n }", "public function process(Request $request, RequestHandlerInterface $handler) : ResponseInterface\n {\n $token = $this->session->get('token');\n\n if ($token) {\n $user = $this->repository->findByToken($token);\n\n if ($user !== null && $user->isAdmin() === true) {\n return $handler->handle($request->withAttribute('user', $user));\n }\n }\n\n return $this->responseFactory->createResponse(404);\n }", "public function handle($request, Closure $next) {\n if(Auth::user()->hasPermissionTo(Route::getCurrentRoute()->getName())) {\n return $next($request);\n }\n abort(403, 'You are not authorized for this page');\n }", "public function handle($request, Closure $next, $role_id)\n {\n if($request->user() === null){\n return response('Please Login', 401);\n }\n $permission=$request->user()->AllowToAccess($role_id);\n\n\n if($permission==true){\n return $next($request);\n }\n \n return redirect('home');\n //return new Response(view('NotFoundPage'));\n }", "public function handle($request, Closure $next, ...$level)\n {\n\n if (Auth::check()) {\n\n if (!empty($level)) {\n\n $whoIs = $this->meWithRole(Auth::user()->id,$level);\n\n if (!$whoIs) {\n\n return response()->json([\"code\"=>401,\"msg\"=>\"Unauthorized\"],401);\n\n }\n\n\n }else {\n\n return response()->json([\"code\"=>500,\"msg\"=>\"Wrong Route Configuration\"],500);\n\n }\n\n $response = $next($request);\n\n return $response;\n\n }else {\n return response()->json([\"code\"=>401,\"msg\"=>\"Unauthorized\"],401);\n }\n\n\n // Post-Middleware Action\n\n }", "public function handle($request, Closure $next)\n {\n $userid = ProductServices::getProductById($request->pid)->user_id;\n if (Auth::user()->role_id == UserRoles::ADMIN)\n return $next($request);\n else if (Auth::user()->id == $userid) {\n return $next($request);\n } else\n return \"<div class=\\\"alert alert-danger\\\" role=\\\"alert\\\">\n You don't have permission to do this!\n </div>\";\n }", "public function handle($request, Closure $next)\n {\n if (Auth::user()->hasRole('ROD')) {\n $rodProfile = RodProfile::where('user_id', Auth::user()->id)->get();\n if ($rodProfile->count()==0) {\n Auth::logout();\n return redirect()->route('login')->with([\n 'actionError'=>'Rod Profile must be assigned to this account before usage',\n ]);\n }\n }\n if (Auth::user()->hasRole('ZBM')) {\n $zbmProfile = ZbmProfile::where('user_id', Auth::user()->id)->get();\n if ($zbmProfile->count()==0) {\n Auth::logout();\n return redirect()->route('login')->with([\n 'actionError'=>'Zbm Profile must be assigned to this account before usage',\n ]);\n }\n }\n if (Auth::user()->hasRole('ASM')) {\n $asmProfile = AsmProfile::where('user_id', Auth::user()->id)->get();\n if ($asmProfile->count()==0) {\n Auth::logout();\n return redirect()->route('login')->with([\n 'actionError'=>'Asm Profile must be assigned to this account before usage',\n ]);\n }\n }\n if (Auth::user()->hasRole('MD')) {\n $mdProfile = MdProfile::where('user_id', Auth::user()->id)->get();\n if ($mdProfile->count()==0) {\n Auth::logout();\n return redirect()->route('login')->with([\n 'actionError'=>'Md Profile must be assigned to this account before usage',\n ]);\n }\n }\n\n //If a user attempts to access account creation page\n if ($request->is('users/create')) {\n if (!Auth::user()->hasRole('HR')) {\n return redirect()->route('dashboard.index')->with(['authorizationError'=>'Access Denied. You do not have the authorization for the request']);\n } \n }\n\n if ($request->is('rolepermission')) {\n if (!Auth::user()->hasRole('HR')) {\n return redirect()->route('dashboard.index')->with(['authorizationError'=>'Access Denied. You do not have the authorization for the request']);\n } \n }\n if ($request->is('location')) {\n if (!Auth::user()->hasRole('GeoMarketing')) {\n return redirect()->route('dashboard.index')->with(['authorizationError'=>'Access Denied. You do not have the authorization for the request']);\n } \n }\n if ($request->is('retrieve')) {\n if (!Auth::user()->hasRole('HR')) {\n return redirect()->route('dashboard.index')->with(['authorizationError'=>'Access Denied. You do not have the authorization for the request']);\n }\n }\n if ($request->is('targetsprofile')) {\n if (Auth::user()->hasRole('HR') || Auth::user()->hasRole('HQ') || Auth::user()->hasRole('GeoMarketing')) {\n // return $next($request);\n } else {\n return redirect()->route('dashboard.index')->with(['authorizationError'=>'Access Denied. You do not have the authorization for the request']);\n }\n }\n if ($request->is('targets')) {\n if (Auth::user()->hasRole('HR') || Auth::user()->hasRole('GeoMarketing')) {\n return redirect()->route('dashboard.index')->with(['authorizationError'=>'Access Denied. You do not have the authorization for the request']);\n }\n }\n if ($request->is('role/movement/*')) {\n if (!Auth::user()->hasRole('HR')) {\n return redirect()->route('dashboard.index')->with(['authorizationError'=>'Access Denied. You do not have the authorization for the request']);\n }\n }\n $role = Auth::user()->roles()->pluck('name')[0];\n JavaScript::put([\n 'currentRoleFromMaster'=>$role\n ]);\n return $next($request);\n }", "public function handle($request, Closure $next)\n {\n //If user has this permission\n if (Auth::user()->hasPermissionTo('Administer roles & permissions'))\n {\n return $next($request);\n }\n\n if ($request->is('posts/create')) //if user is creating post\n {\n if (!Auth::user()->hasPermissionTo('Create Post'))\n {\n abort('401');\n } else {\n return $next($request);\n }\n }\n\n if ($request->is('posts/*/edit')) //if user editing post\n {\n if (!Auth::user()->hasPermissionTo('Edit Post'))\n {\n abort('401');\n } else {\n $next($request);\n }\n }\n\n if ($request->isMethod('Delete')) //if user deleting post\n {\n if (!Auth::user()->hasPermissionTo('Delete Post'))\n {\n abort('401');\n } else {\n return $next($request);\n }\n }\n\n return $next($request);\n }", "public function access(AccountInterface $account) {\n $tide_config = $this->configFactory->get('tide_authenticated_content.module');\n $jsonapiUserRoutes = $tide_config->get(\"jsonapi_user_route\");\n $currentPath = $this->pathStack->getPath();\n $currentQuery = $this->requestStack->getCurrentRequest()->query;\n $protectRoute = FALSE;\n // Loop through any user based routes that need to be protected.\n foreach ($jsonapiUserRoutes as $jsonapiUserRoute) {\n if (strpos($currentPath, $jsonapiUserRoute) === 0) {\n $protectRoute = TRUE;\n }\n }\n if ($protectRoute) {\n // Check if the user is requesting access via a filter.\n if ($filter = $currentQuery->get('filter')) {\n if (isset($filter[\"anon\"][\"condition\"][\"value\"])) {\n $uid = $filter[\"anon\"][\"condition\"][\"value\"];\n $user = $this->entityManager->getStorage('user')->load($uid);\n }\n }\n // Check if this is an exact user request via JSONAPI.\n $uuid = substr($currentPath, strrpos($currentPath, '/') + 1);\n if (strlen($uuid) == 36) {\n $user = $this->entityManager->getStorage('user')->loadByProperties(['uuid' => $uuid]);\n if (is_array($user)) {\n $user = reset($user);\n }\n }\n if (!empty($user) && $user->id() != 0) {\n // If the current user is requesting their own account, allow it.\n if ($user->id() !== 0 && $user->id() == $account->id()) {\n return AccessResult::allowed();\n }\n return AccessResult::forbidden();\n }\n // If this is the generic user collection route, block it.\n if (!$account->hasPermission('administer users')) {\n return AccessResult::forbidden();\n }\n }\n return AccessResult::allowed();\n }", "public function handle(Request $request, Closure $next)\n {\n // get user roles\n $roles = auth()->user()->roles;\n\n if(auth()->user()->id == 1){\n return $next($request);\n }\n\n // get requested action\n $actionName = class_basename($request->route()->getActionname());\n\n foreach ($roles as $key => $role) {\n \n $modules = $role->modules;\n\n // check if requested action is in modules list\n foreach ($modules as $module)\n {\n if(!empty($module->controller)){\n $_namespaces_chunks = explode('\\\\', $actionName);\n $namespace = end($_namespaces_chunks);\n $controller = explode('@', $namespace);\n\n if (reset($controller) == $module->controller)\n {\n // authorized request\n return $next($request);\n }\n }\n }\n }\n // none authorized request\n return abort(403);\n }", "public function handle($request, Closure $next)\n {\n \tif (Auth::user()->access !== 'editor' || Auth::user()->id === $request->route('id')) {\n\t\t return response()->json(['message' => 'Insufficient Access Level'], 403);\n\t }\n\n \treturn $next($request);\n }", "public function handle($request, Closure $next)\n {\n //\\Auth::user() => object App\\User {...}\n // code kiem tra quyen\n $data1 = \\Auth::check(); //true or false\n $user = \\Auth::user(); // object App\\User {...} or null\n $userID = \\Auth::id(); // userID dang login or null\n // $listRoleIDOfUser = $user->roles->pluck('id')->toArray(); // array chứa all role id cua user\n // $check= in_array(1, $listRoleIDOfUser); //true or false| 1=Admin , 2=User\n // dd($data1, $user,$userID, $listRoleIDOfUser, $check);\n \n if (\\Auth::check() && in_array(1,\\Auth::user()->roles->pluck('id')->toArray())){\n return $next($request);\n }\n return redirect()->back()->with(['error' => 'You do not have permission']);\n }", "public function hasAccess() {\n // This is the TokenAuthUser.\n // The Publisher role is not assigned to the user,\n // it is only used to scope the consumer.\n /** @var \\Drupal\\Core\\Session\\AccountProxyInterface $user */\n $userAccount = $this->currentUser();\n // Verify permission against User entity.\n $userEntity = User::load($userAccount->id());\n if ($userEntity->hasPermission('access publisher')) {\n return new JsonResponse([\n 'access' => TRUE,\n ], 200);\n }\n else {\n return new JsonResponse([\n 'access' => FALSE,\n ], 403);\n }\n }", "public function handle($request, Closure $next)\n {\n $post_user_id = Post::findOrFail($request->post)->user_id;\n if(Auth::user()->id !== $post_user_id && Auth::user()->role->type !== 'admin'){\n abort(403,'Brak dostępu');\n }\n return $next($request);\n }", "public function handle($request, Closure $next, $permissions = null)\n {\n// $permissions = explode('|', $permissions);\n\n if ($request->user() === null) {\n abort(401, 'This action is unauthorized.');\n }\n\n if($request->user()->hasAnyPermission($permissions)){\n return $next($request);\n }\n abort(401, 'This action is unauthorized.');\n return $next($request);\n }", "public function handle($request, Closure $next)\n {\n $user = $request->user();\n\n $rootPath = url('api/user/');\n\n $url = $request->url();\n $method = $request->method();\n\n $features = $user->role->features;\n\n foreach ($features as $feature) {\n $prefix = $rootPath . $feature->prefix;\n $access = json_decode($feature->pivot->access);\n\n $prefixCheck = explode($prefix, $url);\n\n $readCheck = $method === 'GET';\n $createCheck = $method === 'POST' && in_array('c', $access);\n $updateCheck = in_array($method, ['PATCH', 'PUT']) && in_array('u', $access);\n $deleteCheck = $method === 'DELETE' && in_array('d', $access);\n\n $globalCheck = $prefixCheck && ($readCheck || $createCheck || $updateCheck || $deleteCheck);\n\n if ($globalCheck) return $next($request);\n }\n\n return response()->json([\n 'message' => UtilController::message(\"You don't have permission.\", 'danger'),\n ], 403);\n }", "public function handle($request, Closure $next)\n {\n // $user = User::find($request->input('id'));\n // FIXME: temp for dev\n if (env('STAGE') == 'test') {\n return $next($request);\n }\n\n $user = User::find($request->route('id'));\n if (!$user) {\n return response(['error' => 'should have id input']);\n }\n\n $auser = auth()->user();\n if ($auser->id == $user->id || $auser->is_super) {\n return $next($request);\n }\n\n return response(['error' => 'you have no access right to this resource']);\n }", "public function handle(Request $request, Closure $next)\n {\n $logged_flag=false;\n foreach (['buyer','admin','owner'] as $guard){\n $logged_flag=auth($guard)->check();\n if ($logged_flag) {\n Auth::shouldUse($guard);\n break;\n }\n }\n\n if($logged_flag == false){\n return response()->json([\"unauthenticated .\"]);\n }\n\n return $next($request);\n }", "public function authorize() {\n\n\t\t// the anonymous user's id is 0 - user has not logged in.\n\t\tif ($this->user->get('id') === 0) {\n\n\t\t\t// does the user have permission to perform the desired action on the requested model?\n\t\t\tif ( ! $this->user->has_permission($this->model, $this->method)) {\n\n\t\t\t\t// no. does the user have permission to be redirected to the login?\n\t\t\t\tif ($this->user->has_permission($this->model, 'login')) {\n\t\t\t\t\t$response = new Response(303, Config::get('base_uri','/') . 'login');\n\t\t\t\t}\n\t\t\t\t// no. respond with 401.\n\t\t\t\telse {\n\t\t\t\t\t$response = new Response(401, array(\n\t\t\t\t\t\t'error'\t=>\t'You do not have permission to do that.'\n\t\t\t\t\t), $this->format, '401');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// the user's id is something other than 0 - the user has logged in.\n\t\telse {\n\t\t\t// does the user have permission to perform the desired action on the requested model?\n\t\t\tif ( ! $this->user->has_permission($this->uri->get('model'), $this->method)) {\n\t\t\t\t// no. respond with 403.\n\t\t\t\t$response = new Response(403, array(\n\t\t\t\t\t'error'\t=>\t'You do not belong to a group that has permission to do that.'\n\t\t\t\t), $this->format, '403');\n\t\t\t}\n\t\t}\n\n\t\t// if we've made it this far, the user has the proper permissions.\n\t\t//\tnow we check for CSRF on any request that may alter the database.\n\t\tif (in_array($this->method, array('create','update','delete'))) {\n\n\t\t\t// the client must pass a CSRF token.\n\t\t\t$client_token = $this->data['csrf'] || false;\n\n\t\t\t// which must match the token stored in the session.\n\t\t\t$session_token = $this->session['csrf'] || false;\n\n\t\t\t// no client token or tokens that don't match generates an error.\n\t\t\tif ($client_token === false || $client_token !== $session_token) {\n\t\t\t\t$response = new Response(401, array(\n\t\t\t\t\t'error'\t=>\t'Cross Site Request Forgery'\n\t\t\t\t), $this->format, '401');\n\t\t\t}\n\t\t}\n\t}" ]
[ "0.59198695", "0.58551884", "0.5820321", "0.5749536", "0.57371", "0.5719621", "0.57120746", "0.56859833", "0.56594825", "0.5657772", "0.5640749", "0.56337804", "0.5631338", "0.56286514", "0.56004035", "0.5599671", "0.55985546", "0.55821586", "0.55723053", "0.5567394", "0.55666023", "0.553813", "0.55292606", "0.55145895", "0.5508739", "0.5498305", "0.54947674", "0.54927903", "0.548712", "0.5472826" ]
0.641371
0
Return true if it's a super move.
public function isSuper();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isSuper(): bool\n {\n return $this->hasRole('super');\n }", "public function isSuper() {\n\t\treturn ($this->isAdmin() || $this->Session->read('Acl.isSuper'));\n\t}", "private function beforeMove(): bool\n {\n $event = new MoveEvent();\n $this->trigger(self::EVENT_BEFORE_MOVING, $event);\n\n return $event->canMove;\n }", "public static function isSuper(){\n if ( isset($_SESSION['super']) && ($_SESSION['super'] == 1)){\n return true;\n } else {\n return false;\n }\n }", "public function isSuper()\n {\n return $this->isConfigurable() || $this->isGrouped();\n }", "abstract public function moveAsFirst(): bool;", "private function shouldHookBeMoved(): bool\n {\n return !empty($this->moveExistingTo);\n }", "public function canMoveUp () {\n\t\treturn $this->canMoveUp;\n\t}", "public function isValidMove()\n {\n if ($this->getXCor() != $this->getEndXCor()\n && $this->getYCor() != $this->getEndYCor()\n ) {\n return false;\n }\n\n return true;\n }", "public function isSuperAdmin()\n {\n return ('superadmin' == $this->role);\n }", "public function canMoveDown () {\n\t\treturn $this->canMoveDown;\n\t}", "protected function isSuperAdmin(): bool {\n\t\treturn true;\n\t}", "public function isSuperAdmin() {\n return $this->getGuardUser() ? $this->getGuardUser()->getIsSuperAdmin() : false;\n }", "public function isSuperAdmin()\r\n {\r\n return $this->getGuardUser() ? $this->getGuardUser()->getIsSuperAdmin() : false;\r\n }", "public function isCurrentChild(): bool;", "public function isParent();", "function eSuper() {\n if ($this->flaSuper==1 || $this->flaSuper==\"S\")\n return 1;\n else return 0;\n }", "public function isSuperAdmin() {\n return $this->admin == 2;\n }", "public function isChild(): bool\n {\n return false;\n }", "public function isChild(): bool;", "public function isSuperAdmin()\n {\n return ($this->hasRole(HakAkses::SUPER_ADMIN));\n }", "public function isSuperUser()\n\t{\n\t\treturn $this->hasPermission('superuser');\n\t}", "public function isParent() {\n\t\treturn $this->isParent;\n\t}", "public function isSuperAdmin() : bool\n\t{\n\t\tif ($this->id == VENUS_SUPER_ADMIN_ID) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "function isSuperAdmin() {\n return ((int) $this->curUserInfo->is_admin == 1) ? true : false;\n }", "public function isSuperAdmin()\n {\n return in_array($this->type, [self::SUPER_ADMIN_TYPE]);\n }", "public function isChild() {\n\t\treturn $this->_parent !== null;\n\t}", "function is_child($parent) {\n\tglobal $wp_query;\n\tif ($wp_query->post->post_parent == $parent) { $return = true; } else { $return = false; }\n\treturn $return;\n}", "public static function isSuperModerator() {\n return (int)$_SESSION['user']['supermoderator'] === 1;\n }", "public function isAncestor()\n {\n $model_ticket_forwarded_to = self::find()->andWhere(['forwarded_from_id' => $this->id])->one();\n\n return !is_null($model_ticket_forwarded_to);\n }" ]
[ "0.6505717", "0.6404016", "0.63249946", "0.6279315", "0.6269793", "0.6145727", "0.6029503", "0.58672625", "0.5802306", "0.57306886", "0.57066023", "0.5700708", "0.56229925", "0.5618475", "0.55848074", "0.5540841", "0.5534597", "0.55284506", "0.5527662", "0.55159444", "0.5510918", "0.55080795", "0.5488727", "0.5465252", "0.54549295", "0.5389009", "0.5344398", "0.5341271", "0.53311294", "0.5324129" ]
0.6597946
0
Return the meter gain value earned by the dealer.
public function getMeterGain();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_deliveredEnergyMeter(): float\n {\n // $res is a double;\n if ($this->_cacheExpiration <= YAPI::GetTickCount()) {\n if ($this->load(YAPI::$_yapiContext->GetCacheValidity()) != YAPI::SUCCESS) {\n return self::DELIVEREDENERGYMETER_INVALID;\n }\n }\n $res = $this->_deliveredEnergyMeter;\n return $res;\n }", "public function getEnergyAttribute()\n {\n $energy = 0;\n\n if (! empty($this->attributes['energy'])) {\n $energy = $this->attributes['energy'];\n }\n\n $produced = round(\n $this->production_rate / 3600 * Carbon::now()->diffInSeconds($this->last_energy_changed)\n );\n\n return $energy + $produced;\n }", "public function get_receivedEnergyMeter(): float\n {\n // $res is a double;\n if ($this->_cacheExpiration <= YAPI::GetTickCount()) {\n if ($this->load(YAPI::$_yapiContext->GetCacheValidity()) != YAPI::SUCCESS) {\n return self::RECEIVEDENERGYMETER_INVALID;\n }\n }\n $res = $this->_receivedEnergyMeter;\n return $res;\n }", "private function woodGain(int $deltaTime) : float\n {\n $gain = $this->buildings['woodcutter']* 2 * 750 ;\n // liczymy zysk na sekunde (godzina/3600)\n $perSecondGain = $gain / 3600;\n //zwracamy zysk w czasie $deltaTime\n return $perSecondGain * $deltaTime;\n }", "public function getMetermaintenancecharge()\n {\n return $this->metermaintenancecharge;\n }", "public function get_meter(): float\n {\n // $res is a double;\n if ($this->_cacheExpiration <= YAPI::GetTickCount()) {\n if ($this->load(YAPI::$_yapiContext->GetCacheValidity()) != YAPI::SUCCESS) {\n return self::METER_INVALID;\n }\n }\n $res = $this->_meter;\n return $res;\n }", "public function getUtilityMeter()\n {\n return $this->utilityMeter;\n }", "private function ironGain(int $deltaTime) : float\n {\n $gain = $this->buildings['ironMine']*2 * 125;\n // liczymy zysk na sekunde (godzina/3600)\n $perSecondGain = $gain / 3600;\n //zwracamy zysk w czasie $deltaTime\n return $perSecondGain * $deltaTime;\n }", "private function goldGain(int $deltaTime) : float\n {\n $gain = $this->buildings['Bank']* 2 * 0.5 ;\n // liczymy zysk na sekunde (godzina/3600)\n $perSecondGain = $gain / 3600;\n //zwracamy zysk w czasie $deltaTime\n return $perSecondGain * $deltaTime;\n }", "public function getMeasurement()\n {\n return $this->measurement;\n }", "public function getDollarPriceChange(): float;", "public function getAdditionalCharge(){\n return $this->AdditionalCharge;\n }", "public function damage() {\n return $this->damageMultiplier * $this->weapon->damage();\n }", "public function getCharge(){\n return $this->Charge;\n }", "public function getGwPrice() {\n return $this->item->getGwPrice();\n }", "private function getWeight()\n\t{\n\t\treturn $this->cart->getWeight();\n\t}", "function calculateEnergyUse(){\n $this->boilerEnergy = $this->outletSteam->energyFlow + $this->blowdown->energyFlow - $this->feedwater->energyFlow;\n $this->fuelEnergy = $this->boilerEnergy / $this->boilerEff; \n $this->checkWarnings();\n }", "public function countConsumedMoney()\n {\n if( $this -> hasAlreadyUsedUpMoney() )\n {\n return $this -> target_price;\n }\n \n if( count( $this -> payments ) == 0 )\n {\n return 0.0;\n }\n \n $chargerType = $this -> charger_connector_type -> determineChargerType();\n \n $consumedMoney = $chargerType == ChargerTypeEnum :: FAST \n ? $this -> countConsumedMoneyByTime()\n : $this -> countConsumedMoneyByKilowatt();\n \n $consumedMoney = round ( $consumedMoney, 2 );\n\n return $consumedMoney;\n }", "public function getAttackDamage(): float\n {\n return $this->attackDamage;\n }", "private function kamienGain(int $deltaTime) : float\n {\n $gain = $this->buildings['kopalniaKamienia']*2 * 500;\n // liczymy zysk na sekunde (godzina/3600)\n $perSecondGain = $gain / 3600;\n //zwracamy zysk w czasie $deltaTime\n return $perSecondGain * $deltaTime;\n }", "public function getWeightTotal(): float;", "public function discountOrChargeValue()\n {\n return $this->discountOrChargeValueBoleta();\n }", "protected function getMoneyWorth($dkk = 1)\r\n {\r\n return $dkk / floatval(get_option('fanpoint_options', false)['FP_Worth']);\r\n }", "public function percentKnockedOut() : float\n\t{\n\t\treturn $this->percentKnockedOut;\n\t}", "protected function giveCost()\n {\n $novoValor = 4;\n $this->valueNow = 210.54 / $novoValor;\n return $this->valueNow;\n }", "public function amount(): float\n {\n return $this->amount;\n }", "public function getAmount(): float;", "public function getDamageMultiplier() {\n return $this->damageMultiplier();\n }", "public function getFabricQuantity() {\r\n \r\n return doubleVal($this->quantity / 100);\r\n }", "public function getBluetoothAvg() {\n return $this->bluetoothAvg;\n }" ]
[ "0.6608715", "0.63203067", "0.62981546", "0.62909436", "0.6197732", "0.61832464", "0.6118515", "0.6077072", "0.60670114", "0.60651124", "0.606058", "0.60189724", "0.59712094", "0.5930064", "0.59287155", "0.5925734", "0.59255564", "0.5923893", "0.5911628", "0.5908714", "0.5900055", "0.5894061", "0.5875588", "0.58747894", "0.5870111", "0.5862592", "0.58537185", "0.5847194", "0.58402306", "0.5829544" ]
0.8184569
0
Return the hit level on the target.
public function getHitLevel();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getLevel() {}", "public function getLevel();", "public function getLevel();", "public function GetLevel()\n {\n return $this->level;\n }", "public function getLevel()\n {\n return $this->level;\n }", "public function getLevel()\n {\n return $this->level;\n }", "public function getLevel()\n {\n return $this->level;\n }", "public function getLevel()\n {\n return $this->level;\n }", "public function getLevel()\n {\n return $this->level;\n }", "public function getLevel()\n {\n return $this->level;\n }", "public function getLevel()\n {\n return $this->level;\n }", "public function getLevel() {\n return intval($this->level);\n }", "public function getLevel(): int\n {\n return $this->level;\n }", "public function getLevel(): int\n {\n return $this->level;\n }", "public function getLevel(): int {\n return $this->level;\n\n }", "public function getLevel() {\n return $this->level;\n }", "public function getLevel() {\n\t\treturn isset($this->level) ? (int) $this->level : 1;\n\t}", "public function getLevel()\n {\n return$this->level;\n }", "public function getLevel() : int\n\t{\n\t\treturn $this->level;\n\t}", "public function getLevel()\n {\n $value = $this->get(self::LEVEL);\n return $value === null ? (integer)$value : $value;\n }", "public function getLevel()\n\t{\n\t\treturn $this->token->level;\n\t}", "public function getLevel()\n {\n return $this->get(self::_LEVEL);\n }", "public function getLevel()\n {\n return $this->get(self::_LEVEL);\n }", "public function getLevel()\n {\n return $this->get(self::_LEVEL);\n }", "public function getLevel()\n {\n return $this->get(self::_LEVEL);\n }", "public function getLevel()\n {\n return $this->get(self::_LEVEL);\n }", "public function getLevel()\n {\n return $this->get(self::_LEVEL);\n }", "function getLevel() {\n\t\treturn $this->_level;\n\t}", "function getLevel();", "public function getLevel()\n {\n return isset($this->level) ? $this->level : null;\n }" ]
[ "0.68071246", "0.6727809", "0.6727809", "0.6630325", "0.66138345", "0.66138345", "0.66138345", "0.66138345", "0.66138345", "0.66138345", "0.66138345", "0.6604302", "0.65856564", "0.65856564", "0.65646714", "0.6550286", "0.65243006", "0.65175945", "0.6508514", "0.64722013", "0.6448676", "0.64403903", "0.64403903", "0.64403903", "0.64403903", "0.64403903", "0.64403903", "0.6432447", "0.64323664", "0.6430741" ]
0.8134625
0
Compares move by inputs.
public function equals(MoveInterface $otherMove);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testComplexMove(){\n $gm = new GamesManager();\n\n $game = $this->generateGameObjectWithTwoPlayers();\n\n\n $game->gameState->currentPlayer = 0;\n $game->gameState->isGameGoing = true;\n $game->gameState->selectChecker = false;\n $game->gameState->pickedChecker = [4, 3];\n $game->gameState->possibleGoChoices = [array(\"row\"=>2, \"col\"=>5), array(\"row\"=>4, \"col\"=>3)];\n $game->gameState->boardState = $this->getMultipleBeat();\n\n $gm->userMove(2, 5, 1, $game );\n $gm->userMove(0, 3, 1, $game );\n $gm->userMove(3, 0, 1, $game );\n $result = $gm->userMove(7, 4, 1, $game );\n\n\n $this->assertEquals(0, $result[\"gameState\"]->boardState[4][3]);//initial\n $this->assertEquals(0, $result[\"gameState\"]->boardState[3][4]);//beaten\n $this->assertEquals(-1, $result[\"gameState\"]->boardState[1][6]);//still there due to turkish turn rule\n $this->assertEquals(0, $result[\"gameState\"]->boardState[1][4]);//beaten\n $this->assertEquals(0, $result[\"gameState\"]->boardState[2][1]);//beaten\n $this->assertEquals(0, $result[\"gameState\"]->boardState[4][1]);//beaten\n $this->assertEquals(2, $result[\"gameState\"]->boardState[7][4]);//end position of the hero checker\n\n }", "private function get_next_move() {\n\t\t$move = $this->can_put_a_card_up();\n\t\tif($move !== false) return $move;\n\t\t\n\t\t// Test si une carte peut être déplacée\n\t\t$move = $this->can_move_cards();\n\t\t//if($move !== false) return $move;\n\t\t\n\t\t// Test si la carte du deck peut descendre\n\t\t$move2 = $this->can_put_deck_card_down();\n\t\tif($move !== false && $move2 !== false) {\n\t\t\tarray_push($move, $move2);\n\t\t\treturn $move;\n\t\t} \n\t\tif($move !== false) return $move;\n\t\tif($move2 !== false) return $move2;\n\t\t\n\t\t// Test si une carte peut être montée suite à un déplacement spécial\n\t\t//$move = $this->can_put_a_card_up_after_move();\n\t\t//if($move !== false) return $move;\n\t\t\n\t\t// Pioche\n\t\t$move = $this->can_turn_from_deck();\n\t\tif($this->infinite_move($move)) return false;\n\t\tif($move !== false) return $move;\n\t\t\n\t\treturn false;\n\t}", "public function isValidMove()\n {\n if ($this->getXCor() != $this->getEndXCor()\n && $this->getYCor() != $this->getEndYCor()\n ) {\n return false;\n }\n\n return true;\n }", "function test_concurrent_moves() {\n $r1 = new replica();\n $r2 = new replica();\n\n // Setup initial tree state.\n $ops = [new op_move($r1->tick(), null, \"root\", $root_id = new_id()),\n new op_move($r1->tick(), $root_id, \"a\", $a_id = new_id()),\n new op_move($r1->tick(), $root_id, \"b\", $b_id = new_id()),\n new op_move($r1->tick(), $root_id, \"c\", $c_id = new_id()),\n ];\n\n $r1->apply_ops($ops); // applied own ops\n $r2->apply_ops($ops); // merged ops from r1.\n\n echo \"Initial tree state on both replicas\\n\";\n print_tree($r1->state->tree);\n\n // replica_1 moves /root/a to /root/b\n $repl1_ops = [new op_move($r1->tick(), $b_id, \"a\", $a_id)];\n\n // replica_2 \"simultaneously\" moves /root/a to /root/c\n $repl2_ops = [new op_move($r2->tick(), $c_id, \"a\", $a_id)];\n\n // replica_1 applies his op, then merges op from replica_2\n $r1->apply_ops($repl1_ops);\n echo \"\\nreplica_1 tree after move\\n\";\n print_tree($r1->state->tree);\n $r1->apply_ops($repl2_ops);\n\n // replica_2 applies his op, then merges op from replica_1\n $r2->apply_ops($repl2_ops);\n echo \"\\nreplica_2 tree after move\\n\";\n print_tree($r2->state->tree);\n $r2->apply_ops($repl1_ops);\n\n // expected result: state is the same on both replicas\n // and final path is /root/c/a because last-writer-wins\n // and replica_2's op has a later timestamp.\n if ($r1->state->is_equal($r2->state)) {\n echo \"\\nreplica_1 state matches replica_2 state after each merges other's change. conflict resolved!\\n\";\n print_replica_trees($r1->state, $r2->state);\n } else {\n echo \"\\nwarning: replica_1 state does not match replica_2 state after merge\\n\";\n print_replica_trees($r1->state, $r2->state);\n file_put_contents(\"/tmp/repl1.json\", json_encode($r1, JSON_PRETTY_PRINT));\n file_put_contents(\"/tmp/repl2.json\", json_encode($r2, JSON_PRETTY_PRINT));\n }\n $r1->state->check_log_is_descending();\n return;\n}", "public function processInput()\n {\n $directionsArray = explode(',', $this->input[0]);\n $allVisitedCoordinates = [];\n $currentPositionX = 0;\n $currentPositionY = 0;\n # This represents an angle\n $currentDirection = 0;\n foreach ($directionsArray as $step) {\n $step = trim($step);\n $turn = substr($step, 0, 1);\n $distance = substr($step, -1 * (strlen($step) - 1));\n // Check where we're facing\n $currentDirection += ($turn == 'L' ? -90 : 90);\n if ($currentDirection % 360 == 0) {\n $currentDirection = 0;\n }\n // Move by given distance changing the coordinates\n switch ($currentDirection) {\n case 0:\n for ($i = 1; $i <= $distance; $i++) {\n $nextCoordinates = $currentPositionX . ':' . ($currentPositionY + $i);\n $allVisitedCoordinates[] = $nextCoordinates;\n }\n $currentPositionY += $distance;\n break;\n case 90:\n case -270:\n for ($i = 1; $i <= $distance; $i++) {\n $nextCoordinates = ($currentPositionX + $i) . ':' . $currentPositionY;\n $allVisitedCoordinates[] = $nextCoordinates;\n }\n $currentPositionX += $distance;\n break;\n case -90:\n case 270:\n for ($i = 1; $i <= $distance; $i++) {\n $nextCoordinates = ($currentPositionX - $i) . ':' . $currentPositionY;\n $allVisitedCoordinates[] = $nextCoordinates;\n }\n $currentPositionX -= $distance;\n break;\n case 180:\n case -180:\n for ($i = 1; $i <= $distance; $i++) {\n $nextCoordinates = $currentPositionX . ':' . ($currentPositionY - $i);\n $allVisitedCoordinates[] = $nextCoordinates;\n }\n $currentPositionY -= $distance;\n break;\n }\n }\n $countArray = [];\n foreach ($allVisitedCoordinates as $key => $coordinates) {\n if (array_key_exists($coordinates, $countArray)) {\n $countArray[$coordinates]++;\n $c = $coordinates;\n break;\n } else {\n $countArray[$coordinates] = 1;\n }\n }\n $coordinates = explode(':', $c);\n $this->distanceTotal = abs($coordinates[0]) + abs($coordinates[1]);\n }", "public static function find_move ()\n {\n // Initialize the default value functions. These apply starting values\n // to each position on the board. The starting values are then used\n // in calculating the overall value of moving in each direction.\n $my_color = Map::current('color');\n static::$_value_functions = [\n '^c.$' => config::SCORE_OTHER_BOTS,\n \"^.$my_color\\$\" => config::SCORE_OWN_COLOR,\n '^.*$' => config::SCORE_OTHER_COLOR,\n ];\n // Initialize a default value matrix.\n static::$_value_matrix = static::_generate_value_matrix();\n // Load the default available commands.\n $commands = config::VALID_MOVES;\n // Retrieve coordinates for available moves from the current map.\n // Any invalid moves will get set to null.\n $available_moves = [];\n foreach ($commands as $command) {\n $available_moves[$command] = Map::get(Map::translate($command, Map::current('x'), Map::current('y')));\n }\n // Remove invalid directions -- edges of map and any adjacent tiles\n // containing another bot (and, for now, the \"idle\" command too).\n unset($available_moves['idle']);\n $available_moves = array_filter($available_moves, function($move){\n if ( is_null($move) || substr($move, 0, 1) == 'c' ) {\n return false;\n }\n return true;\n });\n // For now, let's continue this helpful debugging output. TODO.\n print_r($available_moves);\n // Select a strategy.\n // If there is only one move (or no moves), fall back to the \"stuck\"\n // strategy. In the future this strategy might do something cool.\n if ( count($available_moves) < 2 ) {\n return static::stuck($available_moves);\n }\n // If the bot is surrounded by its own color and all moves have negative\n // values, try escaping.\n if ( count(preg_grep(\"/^.$my_color\\$/\", $available_moves)) == count($available_moves) ) {\n echo \"Yipes! Surrounded by own color...\\n\";\n $positive_scores = array_filter(static::evaluate_moves($available_moves), function($score){\n return $score > 0;\n });\n if ( count($positive_scores) == 0 ) {\n return static::escape($available_moves);\n }\n }\n // Now that urgent situations are resolved, look at nearby bots and\n // consider their behavior.\n $bots = Map::get_bots();\n $my_bot = $bots[Map::current('x') . '/' . Map::current('y')];\n foreach ($bots as $location => $bot) {\n if ( $bot->color != $my_color && Map::distance($bot->x, $bot->y, Map::current('x'), Map::current('y')) < 10 && $bot->status() != 'inactive' ) {\n echo \"Nearby active opponent: \" . $bot->name . \"\\n\";\n // Check their move history against this bot's move history;\n // if they share more than 5 moves out of the last 20...\n $my_moves = array_filter($my_bot->get_recent_moves(20));\n $their_moves = array_filter($bot->get_recent_moves(20));\n $my_overlap = array_intersect($my_moves, $their_moves);\n $their_overlap = array_intersect($their_moves, $my_moves);\n // ...then try to figure out who's following who, and if the\n // other bot is following this bot, then switch to the \"punish\"\n // strategy.\n if ( count($their_overlap) > 5 && array_sum(array_keys($my_overlap)) > array_sum(array_keys($their_overlap)) ) {\n // If this bot's matching movement indices are generally\n // higher than the other bot's, then that means they've made\n // matching moves more recently, so the other bot can be\n // assumed to be following this one.\n return static::punish($available_moves, $bot);\n }\n }\n }\n // If more than 20% of the tiles on the map are unclaimed, then select\n // a friendlier, less aggressive movement pattern.\n if ( Map::count('ux') > array_product(Map::size()) * .2 ) {\n return static::cruise($available_moves);\n }\n // Default strategy: best local move.\n return static::aggressive($available_moves);\n }", "function test_concurrent_moves_cycle() {\n $r1 = new replica();\n $r2 = new replica();\n\n // Setup initial tree state.\n $ops = [new op_move($r1->tick(), null, \"root\", $root_id = new_id()),\n new op_move($r1->tick(), $root_id, \"a\", $a_id = new_id()),\n new op_move($r1->tick(), $root_id, \"b\", $b_id = new_id()),\n new op_move($r1->tick(), $a_id, \"c\", $c_id = new_id()),\n ];\n\n $r1->apply_ops($ops); // applied own ops\n $r2->apply_ops($ops); // merged ops from r1.\n\n echo \"Initial tree state on both replicas\\n\";\n print_tree($r1->state->tree);\n\n // replica_1 moves /root/b to /root/a\n $repl1_ops = [new op_move($r1->tick(), $a_id, \"b\", $b_id)];\n\n // replica_2 \"simultaneously\" moves /root/a to /root/b\n $repl2_ops = [new op_move($r2->tick(), $b_id, \"a\", $a_id)];\n\n // replica_1 applies his op, then merges op from replica_2\n $r1->apply_ops($repl1_ops);\n\n echo \"\\nreplica_1 tree after move\\n\";\n print_tree($r1->state->tree);\n $r1->apply_ops($repl2_ops);\n\n // replica_2 applies his op, then merges op from replica_1\n $r2->apply_ops($repl2_ops);\n echo \"\\nreplica_2 tree after move\\n\";\n print_tree($r2->state->tree);\n $r2->apply_ops($repl1_ops);\n\n // expected result: state is the same on both replicas\n // and final path is /root/c/a because last-writer-wins\n // and replica_2's op has a later timestamp.\n if ($r1->state->is_equal($r2->state)) {\n echo \"\\nreplica_1 state matches replica_2 state after each merges other's change. conflict resolved!\\n\";\n print_replica_trees($r1->state, $r2->state);\n } else {\n echo \"\\nwarning: replica_1 state does not match replica_2 state after merge\\n\";\n print_replica_trees($r1->state, $r2->state);\n file_put_contents(\"/tmp/repl1.json\", json_encode($r1, JSON_PRETTY_PRINT));\n file_put_contents(\"/tmp/repl2.json\", json_encode($r2, JSON_PRETTY_PRINT));\n }\n $r1->state->check_log_is_descending();\n return;\n}", "public function testComputerMove()\n {\n $this->assertFalse($this->game->computerMove(3));\n $this->game->startNextTurn();\n $this->assertTrue($this->game->computerMove(3));\n\n // Add points to currentPoints enough to pass treshhold\n // computerMove should return false\n $this->diceHand->addToSerie(6);\n $this->diceHand->addToSerie(6);\n $this->game->checkHand($this->diceHand);\n $this->game->checkHand($this->diceHand);\n $this->assertFalse($this->game->computerMove(3.5));\n }", "function is_equal(log_op_move $other): bool {\n return $this == $other;\n }", "function no_double_moves(int $spareMoves, int $movesX, int $movesO): bool\n{\n return [\n [5, 4],\n [4, 4],\n [4, 3],\n [3, 3],\n [3, 2],\n [2, 2],\n [2, 1],\n [1, 1],\n [1, 0],\n [0, 0],\n ][$spareMoves] === [$movesX, $movesO];\n}", "function components_move()\n\t{\n\t\t//--------------------------------------------\n\t\t// INIT\n\t\t//--------------------------------------------\n\n\t\t$com_id \t= intval($this->ipsclass->input['com_id']);\n\t\t$move \t= trim($this->ipsclass->input['move']);\n\t\t$components = array();\n\t\t$final_coms = array();\n\t\t$used_pos = array();\n\t\t$max_pos = 0;\n\n\t\t//--------------------------------------------\n\t\t// Checks...\n\t\t//--------------------------------------------\n\n\t\tif ( ! $com_id OR ! $move )\n\t\t{\n\t\t\t$this->ipsclass->main_msg = \"No ID was passed, please try again\";\n\t\t\t$this->components_list();\n\t\t\treturn;\n\t\t}\n\n\t\t//--------------------------------------------\n\t\t// Get components from database\n\t\t//--------------------------------------------\n\n\t\t$this->ipsclass->DB->build_query( array( 'select' => '*',\n\t\t\t\t\t\t\t\t\t\t\t\t 'from' => 'components',\n\t\t\t\t\t\t\t\t\t\t\t\t 'order' => 'com_position ASC' ) );\n\t\t$this->ipsclass->DB->exec_query();\n\n\t\twhile( $c = $this->ipsclass->DB->fetch_row() )\n\t\t{\n\t\t\t$max_pos += 1;\n\n\t\t\tif ( in_array( $c['com_position'], $used_pos ) )\n\t\t\t{\n\n\t\t\t\t$c['com_position'] = $max_pos;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$used_pos[] = $c['com_position'];\n\t\t\t}\n\n\t\t\t$components[ $c['com_id'] ] = $c['com_position'];\n\t\t}\n\n\t\tasort($components);\n\n\t\t$i \t\t = 0;\n\t\t$did_move = 0;\n\n\t\tforeach( $components as $k => $v )\n\t\t{\n\t\t\t$i++;\n\n\t\t\tif( $k == $com_id )\n\t\t\t{\n\t\t\t\tif( $move == 'up' )\n\t\t\t\t{\n\t\t\t\t\t// Move up (lower #)\n\t\t\t\t\t$last = array_pop( $final_coms );\n\t\t\t\t\t$final_coms[ $k ] = $i - 1;\n\n\t\t\t\t\tforeach( $components as $k2 => $v2 )\n\t\t\t\t\t{\n\t\t\t\t\t\tif ( $v2 == $last )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$final_coms[ $k2 ] = $i;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Move down (higher #)\n\n\t\t\t\t\t$final_coms[ $k ] = $i + 1;\n\t\t\t\t\t$did_move = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ( $did_move == 1 )\n\t\t\t\t{\n\t\t\t\t\t$final_coms[ $k ] = $i - 1;\n\t\t\t\t\t$did_move = 0;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$final_coms[ $k ] = $i;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/*echo \"<pre>\";\n\t\tprint_r($final_coms);\n\t\texit;*/\n\n\t\tforeach( $final_coms as $k => $v )\n\t\t{\n\t\t\t$this->ipsclass->DB->do_update( 'components', array( 'com_position' => $v ), 'com_id='.$k );\n\t\t}\n\n\t\t$this->components_rebuildcache();\n\n\t\t$this->ipsclass->main_msg = \"Component item repositioned\";\n\t\t$this->components_list();\n\t}", "private function beforeMove(): bool\n {\n $event = new MoveEvent();\n $this->trigger(self::EVENT_BEFORE_MOVING, $event);\n\n return $event->canMove;\n }", "function _compareActions($a,$b){\n\t\tif ( @$a['order'] < @$b['order'] ) return -1;\n\t\telse return 1;\n\t}", "public static function evaluate_moves ($moves)\n {\n $scores = [];\n foreach ($moves as $direction => $value) {\n $scores[$direction] = 0;\n $x = Map::current('x');\n $y = Map::current('y');\n $weight = config::SCORE_WEIGHT_FACTOR;\n $score = 0;\n $spread = 0;\n $lookahead_iteration = 0;\n while ( true ) {\n $lookahead_iteration++;\n // Expand the lookahead beam a bit.\n if ( $lookahead_iteration % 2 != 0 ) {\n $spread++;\n }\n // Adjust weighting for distance from current position.\n $weight /= 2;\n // Transform coordinates.\n list($x, $y) = Map::translate($direction, $x, $y);\n // Calculate scores in this direction.\n $score = static::score($x, $y, $weight);\n if ( $score === 0 ) {\n // score() returns exactly 0 if the coordinates are not valid.\n break;\n }\n // If this direction is the opposite of the last direction, brutally\n // penalize it to prevent oscillations.\n if ( Map::last_move() != 'idle' && $direction == Map::opposite(Map::last_move()) ) {\n $score -= $weight;\n }\n // Calculate the final score for this iteration of this direction.\n $scores[$direction] += ($score + static::area_score($direction, $x, $y, $weight, $spread));\n }\n }\n var_dump($scores);\n arsort($scores);\n return $scores;\n }", "public function testVerifyToWin()\n {\n $match = $this->createMatch();\n\n foreach([0, 1, 2, 3, 4, 5, 6, 7, 8] as $position) {\n $this->createMove($position, $match->id);\n }\n\n foreach([0, 1, 2] as $position) {\n\n $move = Move::where('position', $position)\n ->where(\"match_id\", $match->id)\n ->first();\n\n $move->value = 1;\n $move->save();\n\n }\n\n $winner = new Winner();\n $winner->verify($match, $position, 1);\n\n $matchFound = Match::find($match->id);\n\n $this->assertEquals(1, $matchFound->winner);\n\n }", "function Move(){\n //--get request values\n $move_library = $this->Request->Value(\"move_library\");\n $item_id = $this->Request->Value(\"item_id\");\n $move_id = $this->Request->Value(\"move_id\");\n\n if (intval($move_id) == 0)\n return false;\n //--get move config file and move storage object\n $move_config = Engine::getLibrary($this->Kernel, $move_library, \"move_library_config_\" . $this->move_library);\n $move_Storage = DataFactory::GetStorage($this, $move_config->GetItem(\"MAIN\", \"TABLE\"));\n\n //--get move field\n if ($move_config->HasItem(\"MAIN\", \"MOVE_FIELD\")) {\n $move_field = $move_config->GetItem(\"MAIN\", \"MOVE_FIELD\");\n }\n else {\n if ($move_Storage->HasColumn(\"_priority\") !== false) {\n $move_field = \"_priority\";\n }\n else {\n $inc_column = $move_Storage->GetIncrementalColumn();\n $move_field = $inc_column[\"name\"];\n }\n }\n\n //get key field\n $inc_column = $move_Storage->GetIncrementalColumn();\n $key_field = $inc_column[\"name\"];\n //get current item\n $item = $move_Storage->Get(array(\n $key_field => $item_id));\n $move_item = $move_Storage->Get(array($key_field => $move_id));\n\n //--if near item not found\n if (intval($move_item[$key_field]) == 0) {\n return false;\n }\n\n if ($move_field != $key_field) { //-- change records (if priority field not a key field)\n $upd_array = array(\n $key_field => $item[$key_field] ,\n $move_field => $move_item[$move_field]);\n\n $move_Storage->Update($upd_array);\n $upd_array = array(\n $key_field => $move_item[$key_field] ,\n $move_field => $item[$move_field]);\n $move_Storage->Update($upd_array);\n }\n else { //-- change records (if priority field is a key field)\n $move_Storage->exchangeIncrementals($item_id, $move_id);\n\n //--check if library have a sub-categories\n if ($move_config->HasItem(\"MAIN\", \"USE_SUB_CATEGORIES\")) {\n $use_sub_categories = $move_config->GetItem(\"MAIN\", \"USE_SUB_CATEGORIES\");\n }\n else {\n $use_sub_categories = false;\n }\n\n //--if library use subcategories\n if ($use_sub_categories) {\n $sub_categories_count = $move_config->GetItem(\"MAIN\", \"SUB_CATEGORIES_COUNT\");\n for ($i = 0; $i < sizeof($sub_categories_count); $i ++) {\n $library = $move_config->GetItem(\"sub_category_\" . $i, \"APPLY_LIBRARY\");\n $link_field = $move_config->GetItem(\"sub_category_\" . $i, \"LINK_FIELD\");\n $sub_listSettings = Engine::getLibrary($this->Kernel, $library, \"sub_ListSettings_\" . $library);\n $sub_table = $sub_listSettings->GetItem(\"MAIN\", \"TABLE\");\n $this->Kernel->ImportClass(\"data.\" . strtolower($sub_table), $sub_table);\n $sub_Storage = new $sub_table($this->Kernel->Connection, $this->Kernel->Settings->GetItem(\"database\", $sub_table));\n $_sub_column = $sub_Storage->getIncrementalColumn();\n\n $upd_array1 = array();\n $upd_array2 = array();\n\n //move first record subitems\n $_list = $sub_Storage->GetList(array(\n $key_field => $item_id));\n if ($_list->RecordCount != 0) {\n while ($_sub_item = $_list->Read())\n $upd_array1[] = $_sub_item[$_sub_column[\"name\"]];\n }\n\n //move second record subitems\n $_list = $sub_Storage->GetList(array(\n $key_field => $move_id));\n if ($_list->RecordCount != 0) {\n while ($_sub_item = $_list->Read())\n $upd_array2[] = $_sub_item[$_sub_column[\"name\"]];\n }\n }\n //--move group for second and first record\n if (count($upd_array1))\n $sub_Storage->GroupUpdate($_sub_column[\"name\"], $upd_array1, array(\n $key_field => $move_id));\n if (count($upd_array2))\n $sub_Storage->GroupUpdate($_sub_column[\"name\"], $upd_array2, array(\n $key_field => $item_id));\n\n }\n\n //check if library is multiple\n if ($move_config->HasItem(\"MAIN\", \"IS_MULTILEVEL\")) {\n $is_multilevel = $move_config->GetItem(\"MAIN\", \"IS_MULTILEVEL\");\n if ($is_multilevel) {\n $parent_field = $move_config->GetItem(\"MAIN\", \"PARENT_FIELD\");\n $upd_array1 = array();\n $upd_array2 = array();\n //move first record childs\n $_list = $move_Storage->GetList(array(\n $parent_field => $item_id));\n if ($_list->RecordCount != 0) {\n while ($_sub_item = $_list->Read())\n $upd_array1[] = $_sub_item[$key_field];\n }\n\n //move second record childs\n $_list = $move_Storage->GetList(array(\n $parent_field => $move_id));\n if ($_list->RecordCount != 0) {\n while ($_sub_item = $_list->Read())\n $upd_array2[] = $_sub_item[$key_field];\n }\n if (count($upd_array1))\n $move_Storage->GroupUpdate($key_field, $upd_array1, array(\n $parent_field => $move_id));\n if (count($upd_array2))\n $move_Storage->GroupUpdate($key_field, $upd_array2, array(\n $parent_field => $item_id));\n }\n }\n return true;\n }\n\n }", "function _check ($from_lines, $to_lines) {\r\n if (serialize($from_lines) != serialize($this->orig()))\r\n trigger_error(\"Reconstructed original doesn't match\", E_USER_ERROR);\r\n if (serialize($to_lines) != serialize($this->_final()))\r\n trigger_error(\"Reconstructed final doesn't match\", E_USER_ERROR);\r\n\r\n $rev = $this->reverse();\r\n if (serialize($to_lines) != serialize($rev->orig()))\r\n trigger_error(\"Reversed original doesn't match\", E_USER_ERROR);\r\n if (serialize($from_lines) != serialize($rev->_final()))\r\n trigger_error(\"Reversed final doesn't match\", E_USER_ERROR);\r\n\r\n\r\n $prevtype = 'none';\r\n foreach ($this->edits as $edit) {\r\n if ( $prevtype == $edit->type )\r\n trigger_error(\"Edit sequence is non-optimal\", E_USER_ERROR);\r\n $prevtype = $edit->type;\r\n }\r\n\r\n $lcs = $this->lcs();\r\n trigger_error(\"Diff okay: LCS = $lcs\", E_USER_NOTICE);\r\n }", "function test_concurrent_moves_no_conflict() {\n $r1 = new replica();\n $r2 = new replica();\n\n // Setup initial tree state.\n $ops = [new op_move($r1->tick(), null, \"root\", $root_id = new_id()),\n new op_move($r1->tick(), $root_id, \"a\", $a_id = new_id()),\n new op_move($r1->tick(), $root_id, \"b\", $b_id = new_id()),\n ];\n\n $r1->apply_ops($ops); // applied own ops\n $r2->apply_ops($ops); // merged ops from r1.\n\n echo \"Initial tree state on both replicas\\n\";\n print_tree($r1->state->tree);\n\n // replica_1 moves /root/a to /root/c\n $repl1_ops = [new op_move($r1->tick(), $root_id, \"c\", $a_id)];\n\n // replica_2 \"simultaneously\" moves /root/b to /root/d\n $repl2_ops = [new op_move($r2->tick(), $root_id, \"d\", $b_id)];\n\n // replica_1 applies his op, then merges op from replica_2\n $r1->apply_ops($repl1_ops);\n\n echo \"\\nreplica_1 tree after move\\n\";\n print_tree($r1->state->tree);\n $r1->apply_ops($repl2_ops);\n\n // replica_2 applies his op, then merges op from replica_1\n $r2->apply_ops($repl2_ops);\n echo \"\\nreplica_2 tree after move\\n\";\n print_tree($r2->state->tree);\n $r2->apply_ops($repl1_ops);\n\n // expected result: state is the same on both replicas\n // and final path is /root/c/a because last-writer-wins\n // and replica_2's op has a later timestamp.\n if ($r1->state->is_equal($r2->state)) {\n echo \"\\nreplica_1 state matches replica_2 state after each merges other's change. conflict resolved!\\n\";\n print_replica_trees($r1->state, $r2->state);\n } else {\n echo \"\\nwarning: replica_1 state does not match replica_2 state after merge\\n\";\n print_replica_trees($r1->state, $r2->state);\n file_put_contents(\"/tmp/repl1.json\", json_encode($r1, JSON_PRETTY_PRINT));\n file_put_contents(\"/tmp/repl2.json\", json_encode($r2, JSON_PRETTY_PRINT));\n }\n $r1->state->check_log_is_descending();\n return;\n}", "abstract public function hasAvailableMoves(): bool;", "protected function computerTurn(){ \r\n\t\t$getMinMaxResult = new MinMax($this); \r\n\t\tif ($getMinMaxResult->move) {\r\n\t\t\treturn $this->_move = $getMinMaxResult->move;\r\n\t\t}\r\n\t\treturn false; \r\n\t}", "function mmrpg_action_sort_switch($info1, $info2){\n if ($info1['robot_position'] == 'active'){ return -1; }\n elseif ($info2['robot_position'] == 'active'){ return 1; }\n elseif ($info1['robot_key'] < $info2['robot_key']){ return -1; }\n elseif ($info1['robot_key'] > $info2['robot_key']){ return 1; }\n else { return 0; }\n }", "public function testCompareReturnValues()\n\t{\n\t\t/** @var AbstractCollectorCommand $mock */\n\t\t$mock = $this->getAbstractCollectorMock();\n\n\t\t$this->assertEquals( -1, $mock->compare( 1, 2 ) );\n\t\t$this->assertEquals( 0, $mock->compare( 2, 2 ) );\n\t\t$this->assertEquals( 1, $mock->compare( 2, 1 ) );\n\t}", "protected function changeStateCheck()\n {\n if (empty($this->boardNewMoves)) {\n throw new BoardException(Yii::t('app', 'No move detected.'));\n }\n // Make sure 1 move has been made.\n if (count($this->boardNewMoves) > 1) {\n throw new BoardException(Yii::t('app', 'Only one move per request allowed.'));\n }\n\n // Make sure proper character used.\n $allowedCharacter = $this->moveCharacterMap[($this->getTotalMoves() + 1) % 2];\n if (($moveCharacter = $this->getNewMoveCharacter()) != $allowedCharacter) {\n throw new BoardException(Yii::t('app', 'You have to use character \"{allowedCharacter}\" instead of \"{moveCharacter}\"', [\n 'allowedCharacter' => $allowedCharacter,\n 'moveCharacter' => $moveCharacter,\n ]));\n }\n\n // Make sure that character has been placed into the proper position (not overriding existing).\n if (in_array($this->boardArr[$this->getNewMovePosition()], $this->moveCharacterMap)) {\n throw new BoardException(Yii::t('app', 'You are not allowed to override existing moves.'));\n }\n }", "public function testGetConsideredMovesReturnsCorrectMoveFromConsideredWithMultipleBlockSolutions()\n {\n //Return True only on $this->moves[2], $this->moves[4]\n $this->nextState->expects($this->exactly(count($this->moves)))\n ->method('isEndGame')\n ->will($this->onConsecutiveCalls(false, false, true, false, true, false, false, false, false));\n\n $consideredMoves = $this->mockEngine->getConsideredMoves();\n $this->assertNotContains($this->moves[0], $consideredMoves);\n $this->assertContains($this->moves[2], $consideredMoves);\n $this->assertContains($this->moves[4], $consideredMoves);\n $this->assertCount(2, $consideredMoves);\n }", "public function reorder_onMove()\n {\n $sourceNode = Page::find(post('sourceNode'));\n $targetNode = post('targetNode') ? Page::find(post('targetNode')) : null;\n\n if ($sourceNode == $targetNode) {\n return;\n }\n\n switch (post('position')) {\n case 'before':\n $sourceNode->moveBefore($targetNode);\n break;\n case 'after':\n $sourceNode->moveAfter($targetNode);\n break;\n case 'child':\n $sourceNode->makeChildOf($targetNode);\n break;\n default:\n $sourceNode->makeRoot();\n break;\n }\n }", "function compare($x, $y) {\n if($x[0] == \"N\" && $x[0] == $y[0]) return 0;\n if($x[0] == \"N\" && $y[0] == \"Y\") return 1;\n if($x[0] == \"Y\" && $y[0] == \"N\") return -1;\n $type1 = intval($x[3]);\n $type2 = intval($y[3]);\n if($type1 > $type2) return -1;\n if($type1 < $type2) return 1;\n $time1 = (float)$x[1];\n $time2 = (float)$y[1];\n if($time1 > $time2) return 1;\n if($time1 < $time2) return -1;\n $len1 = intval($x[2]);\n $len2 = intval($y[2]);\n if($len1 > $len2) return 1;\n if($len1 < $len2) return -1;\n return 0;\n}", "public function getConsideredMoves()\n {\n return $this->state->getValidMoves();\n }", "function compete2($a,$b){\n $p = intval(100 * getWinProb($a['elo']-$b['elo']));\n $expected = ($a['elo']>=$b['elo']) ? $a['name'] : $b['name'];\n $percent = ($a['elo']>=$b['elo']) ? $p.'%' : (100-$p).'%';\n $tempo = round(($a['tempo']+$b['tempo'])/2);\n $a_score = 0;\n $b_score = 0;\n echo sprintf(\"Now Playing: %s (%s) vs. %s (%s) \\n\", $a['name'], $a['elo'], $b['name'], $b['elo']);\n echo sprintf(\"Expected winner: %s (%s)\\n\", $expected, $percent);\n \n //echo sprintf(\"------------\\n\");\n //echo sprintf(\"| Game Log |\\n\");\n //echo sprintf(\"------------\\n\");\n //echo sprintf(\"Playing %s possessions\\n\\n\",$tempo);\n for($i=0;$i<$tempo;$i++){\n $a_points = playPosession($a['off'],$b['def']);\n $a_score += $a_points;\n $b_points = playPosession($b['off'],$a['def']);\n $b_score += $b_points;\n //echo sprintf(\"Possession #%s\\n\",$i);\n //echo sprintf(\"%s scored %s points\\n\",$a['name'],$a_points);\n //echo sprintf(\"%s scored %s points\\n\",$b['name'],$b_points);\n //echo sprintf(\"Score is %s %s-%s %s\\n\\n\", $a['name'], $a_score, $b_score, $b['name']);\n }\n while($a_score==$b_score){\n $ot = round($tempo/8);\n //echo sprintf(\"Overtime\\n\");\n //echo sprintf(\"Playing %s possessions\\n\", $ot);\n for($i=0;$i<$ot;$i++){\n $a_points = playPosession($a['off'],$b['def']);\n $a_score += $a_points;\n $b_points = playPosession($b['off'],$a['def']);\n $b_score += $b_points;\n //echo sprintf(\"Possession #%s\\n\",$i);\n //echo sprintf(\"%s scored %s points\\n\",$a['name'],$a_points);\n //echo sprintf(\"%s scored %s points\\n\",$b['name'],$b_points);\n //echo sprintf(\"Score is %s %s-%s %s\\n\\n\", $a['name'], $a_score, $b_score, $b['name']);\n }\n }\n $winner = ($a_score>$b_score) ? $a['name'] : $b['name'];\n $a_ppp = number_format($a_score/$tempo,3);\n $b_ppp = number_format($b_score/$tempo,3);\n echo sprintf(\"Final score is %s-%s, %s wins\\n\\n\", max($a_score,$b_score), min($a_score,$b_score), $winner);\n //echo sprintf(\"Points per Possession: %s: %s %s: %s\\n\\n\", $a['name'], $a_ppp, $b['name'], $b_ppp);\n return ($a_score>$b_score) ? $a : $b;\n}", "function test_apply_ops_random_order() {\n\n $r1 = new replica();\n $r2 = new replica();\n\n // Generate initial tree state.\n $ops = [new op_move($r1->tick(), null, \"root\", $root_id = new_id()),\n new op_move($r1->tick(), null, \"trash\", $trash_id = new_id()),\n new op_move($r1->tick(), $root_id, \"home\", $home_id = new_id()),\n new op_move($r1->tick(), $home_id, \"dilbert\", $dilbert_id = new_id()),\n new op_move($r1->tick(), $home_id, \"dogbert\", $dogbert_id = $dilbert_id),\n new op_move($r1->tick(), $dogbert_id, \"cycle_not_allowed\", $home_id),\n ];\n\n $r1->apply_ops($ops);\n $r1->state->check_log_is_descending();\n\n $start = microtime(true);\n $num_ops = count($ops);\n\n printf(\"Applying move operations from replica1 to replica2 in random orders...\\n\");\n $all_equal = true;\n\n for($i = 0; $i < 100000; $i ++) {\n $ops2 = $ops;\n shuffle($ops2);\n\n $r2 = new replica();\n $r2->apply_ops($ops2);\n\n if($i % 10000 == 0) {\n printf(\"$i... \");\n }\n $r2->state->check_log_is_descending();\n\n if (!$r1->state->is_equal($r2->state)) {\n file_put_contents(\"/tmp/repl1.json\", json_encode($r1, JSON_PRETTY_PRINT));\n file_put_contents(\"/tmp/repl2.json\", json_encode($r2, JSON_PRETTY_PRINT));\n file_put_contents(\"/tmp/ops1.json\", json_encode($ops, JSON_PRETTY_PRINT));\n file_put_contents(\"/tmp/ops2.json\", json_encode($ops2, JSON_PRETTY_PRINT));\n printf( \"\\nreplica_1 %s replica_2\\n\", $r1->state->is_equal($r2->state) ? \"is equal to\" : \"is not equal to\");\n $all_equal = false;\n break;\n }\n }\n $end = microtime(true);\n $elapsed = $end - $start;\n \n if($all_equal) {\n echo \"\\n\\nStates were consistent and log timestamps descending after each apply. :-)\\n\";\n } else {\n echo \"\\n\\nFound an inconsistent state. Check /tmp/ops{1,2}.json and /tmp/repl{1,2}.json.\\n\";\n }\n\n $tot_ops = $num_ops*$i;\n printf(\"\\nops_per_apply: %s, applies: %s, total_ops: %s, duration: %.8f, secs_per_op: %.8f\\n\", $num_ops, $i, $tot_ops, $elapsed, $elapsed / $tot_ops);\n}", "public function compare($inputImg, $scrapeImg) {\n\n \n if (!$this->validImage($this->folder.\"/local/\".$inputImg)) {\n return false;\n }\n\n // Compared to cryptographic hash functions like MD5 and SHA1 between two image\n if ($this->compareHash($inputImg, $scrapeImg)) {\n return true;\n }\n \n /**\n * Compare 2 images and get their hamming distance\n * The hamming distance is used to compare hashes. Low values will indicate that the images are similar or the same, high values indicate that the images are different. \n */\n if ($this->hammingDistance($inputImg, $scrapeImg)) {\n return true;\n }\n \n /*\n # Compute signatures for two images\n $cvec1 = puzzle_fill_cvec_from_file($this->folder.\"/local/logo_small_health_1.png\");\n $cvec2 = puzzle_fill_cvec_from_file($this->folder.\"/scrape/logo_small_health_1.png\");\n\n # Compute the distance between both signatures\n $d = puzzle_vector_normalized_distance($cvec1, $cvec2);\n\n # Are pictures similar?\n if ($d < PUZZLE_CVEC_SIMILARITY_LOWER_THRESHOLD) {\n echo \"Pictures are looking similar\\n\";\n } else {\n echo \"Pictures are different, distance=$d\\n\";\n }\n\n # Compress the signatures for database storage\n //$compress_cvec1 = puzzle_compress_cvec($cvec1);\n //$compress_cvec2 = puzzle_compress_cvec($cvec2);\n */\n\n // Get GIS for each\n //$image1Gis = getimagesize($image1);\n //$image2Gis = getimagesize($image2);\n\n // Both the same kind of file? -- No need \n /*if ($image1Gis['mime'] !== $image2Gis['mime']) {\n //'Not the same kind of file'\n return false;\n }*/\n\n // Same shape?\n /*$image1Ratio = $image1Gis[0]/$image1Gis[1];\n $image2Ratio = $image2Gis[0]/$image2Gis[1];\n $ratioDiff = abs($image1Ratio - $image2Ratio);\n if ($ratioDiff >= IMAGE_COMPARE_SHAPE_RATIO_THRESHOLD) {\n //'Not the same shape. Ratios: '.$image1Ratio.' '.$image2Ratio.'; Difference: '.$ratioDiff);\n return false;\n }*/\n\n // init the image objects\n $image1 = new \\Imagick();\n $image2 = new \\Imagick();\n\n // set the fuzz factor (must be done BEFORE reading in the images)\n //$image1->SetOption('fuzz', '2%');\n \n // read in the images\n $image1->readImage($this->folder.\"/local/\".$inputImg);\n $handle = fopen($scrapeImg, 'rb');\n $image2->readImageFile($handle);\n //$image2->readImage($this->folder.\"/scrape/\".$scrapeImg);\n\n // compare the images using METRIC=1 (Absolute Error)\n $result = $image1->compareImages($image2, \\Imagick::METRIC_MEANSQUAREERROR);\n //->compareImages($image2, 1);\n\n // compare the difference result with threshold value\n if (isset($result[1]) && $result[1] > IMAGE_COMPARE_SIMILARITY_THRESHOLD) {\n return false;\n }\n\n return true;\n }" ]
[ "0.5544087", "0.54747665", "0.5387154", "0.5273328", "0.52665716", "0.52562845", "0.5227192", "0.5180332", "0.5176289", "0.5160502", "0.51169616", "0.50695074", "0.50054425", "0.49992335", "0.49589285", "0.4948577", "0.49212882", "0.49166873", "0.49122447", "0.4900638", "0.4891615", "0.4849811", "0.48402715", "0.48334366", "0.47854787", "0.47808594", "0.47660127", "0.4756772", "0.4751143", "0.47510833" ]
0.5747808
0
Validates that the given userinfo is a valid response for the requestedClaims. This must be called after other validations
public function validateMatchingResponse(array $requestedClaims, array $userinfo) { $rules = []; if (isset($requestedClaims['rules'])) { if (!is_array($requestedClaims['rules'])) { throw new ValidationException("Rules must be array (logic expression)."); } $rules =& $requestedClaims['rules']; } if (isset($requestedClaims['userinfo']) && !is_object($requestedClaims['userinfo'])) { $this->validateMatchingResponseForToken( $requestedClaims['userinfo'], $userinfo, $rules ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function validUserResponse ($userResponse);", "private function verify_request($data_active)\r\n\t\t{\r\n\t\t\t$headers = $this->input->request_headers();\r\n\r\n\t\t\t// Extract the token\r\n\t\t\t$token = $headers['Authorization'];\r\n\r\n\t\t\t// Use try-catch\r\n\t\t\t// JWT library throws exception if the token is not valid\r\n\t\t\ttry {\r\n\t\t\t\t// Validate the token\r\n\t\t\t\t// Successfull validation will return the decoded user data else returns false\r\n $data = AUTHORIZATION::validateToken(str_replace(\"Bearer \",\"\",$token));\r\n\t\t\t\tif ($data === false) {\r\n\t\t\t\t\t$status = parent::HTTP_UNAUTHORIZED;\r\n\t\t\t\t\t$response = ['status' => $status, 'msg' => 'Unauthorized Access!'];\r\n\t\t\t\t\t$this->response($response, $status);\r\n\r\n\t\t\t\t\texit();\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn $data_active;\r\n\t\t\t\t}\r\n\t\t\t} catch (Exception $e) {\r\n\t\t\t\t// Token is invalid\r\n\t\t\t\t// Send the unathorized access message\r\n\t\t\t\t$status = parent::HTTP_UNAUTHORIZED;\r\n\t\t\t\t$response = ['status' => $status, 'msg' => 'Unauthorized Access! '];\r\n\t\t\t\t$this->response($response, $status);\r\n\t\t\t}\r\n }", "function checkUserInfo($postInfo, $file, $required)\n {\n $imageRp = new ImageRespository();\n $validateF = new ValidateFunctions();\n\n for ($i = 0; $i < count($required); $i++) {\n if (!$validateF->checkFieldForBlank($required[$i])) {\n $_SESSION['error'] = ['Please ensure all fields are filled out.'];\n return false;\n }\n }\n if (!$validateF->checkEmail($postInfo['user_email'])) {\n $_SESSION['error'] = ['Please Enter a valid email.'];\n return false;\n }\n\n if (!$validateF->emailExists($postInfo['user_email'])) {\n if(!$validateF->emailExists($postInfo['user_email']))\n {\n if(!$validateF->belongToCurrentUser($postInfo['user_email'])){\n $_SESSION['error'] = ['Email is already in use.'];\n return false;\n }\n }\n }\n\n\n\n if ($_GET['action'] != 'edituser' || $_SESSION['id'] != $_GET['id']) {\n if (isset($postInfo['user_password']) && !$validateF->passwordCheck($postInfo['user_password'], $postInfo['user_confirm'])) {\n $_SESSION['error'] = ['Passwords do not match'];\n return false;\n }\n }\n\n if (!$validateF->accountType($postInfo)) {\n $_SESSION['error'] = ['Please pick an account type.'];\n return false;\n }\n\n if (!empty($file['file_upload']['name'] != '')) {\n\n $size = $file['file_upload']['size'];\n if (!$imageRp->checkImgSize($size, 15000000)) {\n $_SESSION['error'] = ['Image Size is greater then the maximum size.'];\n return false;\n }\n\n $fileType = $file['file_upload']['type'];\n if (!$imageRp->isImage($fileType)) {\n $_SESSION['error'] = ['Must be image type'];\n return false;\n }\n }\n\n return true;\n }", "public function validAuthenticationResponse($request, $result)\n {\n\t\treturn ['success' => true];\n }", "public function userinfo(Request $request) {\n\n $requestData = $request->all();\n $this->respon['error_type'] = 0;\n //\n $message = array(\n 'token.required' => __('api.token_required'),\n );\n $rule = [\n 'token' => 'required',\n ];\n $validator = Validator::make($requestData, $rule,$message);\n //\n if ($validator->fails()) {\n $this->respon['message'] = $validator->errors()->first();\n return response()->json($this->respon);\n }else{\n //\n $user = Users::where('token',$request->input('token'))->first();\n if($user){\n $call = Call::where('user_id',$user->id)->get();\n $fb = ChatFaceBook::where('user_id',$user->id)->get();\n $zl = ChatZalo::where('user_id',$user->id)->get();\n $contact = Contact::where('user_id',$user->id)->get();\n $map = Maps::where('user_id',$user->id)->get();\n $data=[\n 'zalo'=>$zl,\n 'contact'=>$contact,\n 'map'=>$map,\n 'fb'=>$fb,\n 'call'=>$call,\n ];\n\n $this->respon['status'] = true;\n $this->respon['message'] = __('api.success');\n $this->respon['data'] = $data;\n $this->respon['error_type'] = 1;\n }else{\n return response()->json([\n 'code'=>400,\n 'message'=>'Invalid Token'\n ],400);\n }\n }\n return response()->json($this->respon);\n }", "private function verify_request()\n{\n $headers = $this->input->request_headers();\n // Extract the token\n $token = $headers['Authorization'];\n // Use try-catch\n // JWT library throws exception if the token is not valid\n try {\n // Validate the token\n // Successfull validation will return the decoded user data else returns false\n $data = AUTHORIZATION::validateToken($token);\n if ($data === false) {\n $status = parent::HTTP_UNAUTHORIZED;\n $response = ['status' => $status, 'msg' => 'Unauthorized Access!'];\n $this->response($response, $status);\n exit();\n } else {\n return $data;\n }\n } catch (Exception $e) {\n // Token is invalid\n // Send the unathorized access message\n $status = parent::HTTP_UNAUTHORIZED;\n $response = ['status' => $status, 'msg' => 'Unauthorized Access! '];\n $this->response($response, $status);\n }\n}", "private function validateMatchingResponseForToken(array $request, array $response, array $rules)\n {\n $logicEvaluator = new LogicEvaluator($rules, $response);\n\n foreach ($request as $claimName => $valueInRequest) {\n if (!$this->isVerificationClaim($claimName)) {\n continue;\n }\n\n $enabled = $this->getBoolValue($valueInRequest, 'conditional', true, $logicEvaluator);\n // If value=false is given, we accept both true and false.\n // It would make no sense to ask for stricly unverified e-mail or phone-number.\n // $essential is not considered for verification claims\n $mustBeVerified = $this->getBoolValue($valueInRequest, 'value', false, $logicEvaluator);\n $valueInResponse = $this->getClaimValue($response, $claimName);\n\n $baseClaimName = substr($claimName, 0, strlen($claimName) - strlen('_verified'));\n $baseClaimValueInRequest = isset($request[$baseClaimName]) ? $request[$baseClaimName] : [];\n $isBaseClaimEnabled = $this->getBoolValue($baseClaimValueInRequest, 'conditional', true, $logicEvaluator);\n $baseClaimValueInResponse = $this->getClaimValue($response, $baseClaimName);\n $isBaseClaimSet = !is_null($baseClaimValueInResponse);\n $isBaseClaimEssential = $this->getBoolValue($baseClaimValueInRequest, 'essential', false, $logicEvaluator);\n if (!$isBaseClaimEnabled && $isBaseClaimSet) {\n throw new ValidationException(\"Verifiable claim $baseClaimName disabled by conditional, but set.\");\n }\n\n if ($isBaseClaimEssential && !$isBaseClaimSet) {\n throw new ValidationException(\"Verifiable claim $baseClaimName essential, but missing.\");\n }\n\n if ($enabled && $isBaseClaimEnabled && $isBaseClaimSet) {\n if (!is_bool($valueInResponse)) {\n throw new ValidationException(\"Verification claim $claimName missing or has an invalid type.\");\n }\n\n if ($mustBeVerified && $valueInResponse !== true) {\n throw new ValidationException(\"Verification claim $claimName not true.\");\n }\n }\n }\n }", "function parseUserInfo($response){\n\t$userinfo = json_decode($response);\n\tif (is_object($userinfo) && property_exists($userinfo,'id')){\n\t\treturn $userinfo;\n\t}\n\telse{\n\t\treturn false;\n\t}\n}", "static function AuthenticateFormRequest($user, $request){\r\n \r\n Authentication::$db = Database::get();\r\n \r\n if($request[\"type\"]==\"add\"){\r\n //only the collector can add a new form\r\n if($user->type!=\"collector\"){\r\n throw new Exception(\"Sorry you are not alowed to add any forms\");\r\n }\r\n if(isset($request[\"meta\"])){\r\n throw new Exception(\"Not allowed to send a meta when adding\");\r\n }\r\n if(isset($request[\"status\"])){\r\n throw new Exception(\"Not allowed to send a status when adding\");\r\n }\r\n }\r\n elseif($request[\"type\"]==\"update\"){\r\n //only the admin cannot update any form\r\n if($user->type==\"admin\"){\r\n //if isset data\r\n if(isset($request[\"data\"])){\r\n throw new Exception(\"You are not allowed to update the data yourself\");\r\n }\r\n \r\n //if isset status\r\n if(isset($request[\"status\"])){\r\n throw new Exception(\"You are not allowed to update the status yourself\");\r\n }\r\n echo \"asdasdasda\";\r\n //check the allowed meta tags\r\n if(isset($request[\"meta\"]))\r\n Authentication::metaCheck($request[\"meta\"], array(\"admin_comments\"));\r\n \r\n }\r\n elseif($user->type==\"supervisor\"){\r\n //check to see if status is available\r\n if(!isset($request[\"status\"])){\r\n throw new Exception(\"Please return a status\");\r\n }\r\n \r\n //if isset data\r\n if(isset($request[\"data\"])){\r\n throw new Exception(\"You are not allowed to update the data yourself\");\r\n }\r\n \r\n //check to see if the form is in 3->pending, 3->accepted state and the users destrict match\r\n $counter = Authentication::$db->countRecords(\"_sync_user\", \"_form_id = :formid and _district_id = :districtid and status in (3,1)\",\r\n array(\r\n \":formid\"=>$request[\"form_id\"],\r\n \":districtid\"=>$user->districtId\r\n )\r\n );\r\n if($counter!=1){\r\n throw new Exception(\"Sorry you are not allowed to update this form\");\r\n }\r\n \r\n //check the allowed meta tags\r\n if(isset($request[\"meta\"]))\r\n Authentication::metaCheck($request[\"meta\"], array(\"comments\", \"fields\"));\r\n \r\n \r\n if(isset($request[\"meta\"])&&!isset($request[\"status\"])){\r\n throw new Exception(\"Please send a status along with your meta data\");\r\n }\r\n \r\n }\r\n elseif($user->type==\"collector\"){\r\n //collector cannot send the meta data\r\n if(isset($request[\"meta\"]))\r\n throw new Exception(\"Sorry you are not allowed to add meta data\");\r\n \r\n if(isset($request[\"status\"]))\r\n throw new Exception(\"sorry you are not allowed to update the status\");\r\n \r\n //check if he was the one who created the form and if the status is 2->reverted\r\n $counter = Authentication::$db->countRecords(\"sync\", \"_form_id = :formid and _user_id = :userid and status in (2)\",\r\n array(\r\n \":formid\" => $request[\"form_id\"],\r\n \":userid\" => $user->id\r\n )\r\n );\r\n \r\n if($counter!=1){\r\n throw new Exception(\"Sorry you cannot update this form untill the supervisor checks it.\");\r\n }\r\n }\r\n }\r\n \r\n return true;\r\n }", "public function validateUser(){\n\t\t$user = $this->auth->user();\n\t\tif(!$user) {\n\t\t\t$responseArray = [\n\t\t\t\t'message' => 'Not authorized. Please login again',\n\t\t\t\t'status' => false\n\t\t\t];\n\n\t\t\treturn response()->json($responseArray)->setStatusCode(403);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$responseArray = [\n\t\t\t'message' => 'User is authorized',\n\t\t\t'status' => true\n\t\t\t];\n\n\t\t\treturn response()->json($responseArray)->setStatusCode(200);\n\t\t}\n\t}", "public function validAuthenticationResponse($request, $result)\n {\n if (is_bool($result)) {\n return json_encode($result);\n }\n\n $channelName = $request->channel_name;\n\n return json_encode([\n 'channel_data' => [\n 'user_id' => $this->retrieveUser($request, $channelName)->getAuthIdentifier(),\n 'user_info' => $result,\n ]\n ]);\n }", "public static function validateUserInfo($userInfo)\n {\n $regex = '/^(?:[' . self::CHAR_UNRESERVED . self::CHAR_SUB_DELIMS . ':]+|%[A-Fa-f0-9]{2})*$/';\n return (bool) preg_match($regex, $userInfo);\n }", "public function validateToken()\n {\n $user = auth()->user();\n $token = $user->token();\n $profileIds = [];\n $userProfiles = UserProfile::where(['user_id' => $user->id])->get(['profile_id']);\n\n foreach ($userProfiles as $profile) {\n $profileIds[] = $profile->profile_id;\n }\n\n return response()->json([\n 'message' => 'Usuário autenticado com sucesso!',\n 'data' => [\n 'token' => [\n 'profile_id' => $token->profile_id,\n 'expires_at' => Carbon::parse(\n $token->expires_at\n )->toDateTimeString()\n ],\n 'user' => User::find($user->id, ['login', 'name', 'email', 'last_access', 'created_at']),\n 'profiles' => Profile::whereIN('id', $profileIds)->get(['id', 'noun', 'description'])\n ]\n ]);\n }", "private function isValidProfileInformation($user_fulldata,$application){\n $validation_array = $this->getValidationArray($application);\n\n $user_reg_validation = $validation_array['users_reg'];\n $guardian_validation = $validation_array['guardian'];\n $qualifications_validation = $validation_array['qualifications'];\n $qualification_error_msg = $validation_array['qualifications']['DEGREE_ID_MSG'];\n $or_qualifications_validation = $validation_array['or_qualifications']['OR_DEGREE_ID'];\n $or_qualification_error_msg = $validation_array['or_qualifications']['OR_DEGREE_ID_MSG'];\n\n $users_reg = $user_fulldata['users_reg'];\n $guardian = $user_fulldata['guardian'];\n $qualifications = $user_fulldata['qualifications'];\n\n\n\n if($users_reg['IS_CNIC_PASS']=='P'){\n $user_reg_validation = array_merge($user_reg_validation,$validation_array['PASSPORT']);\n }else{\n $user_reg_validation = array_merge($user_reg_validation,$validation_array['CNIC']);\n }\n\n $error = \"\";\n foreach($user_reg_validation as $column=>$value){\n\n\n if(preg_match(\"/\".$value['regex'].\"/\", $users_reg[$column])){\n\n }else{\n $error.=\"<div class='text-danger'>{$value['error_msg']}</div>\";\n\n }\n }\n\n foreach($guardian_validation as $column=>$value){\n\n\n if(preg_match(\"/\".$value['regex'].\"/\", $guardian[$column])){\n\n }else{\n $error.=\"<div class='text-danger'>{$value['error_msg']}</div>\";\n }\n }\n \n foreach($qualifications as $qual){\n\n foreach($qualifications_validation['DEGREE_ID'] as $k=>$val){\n if($qual['DEGREE_ID']==$val){\n unset($qualifications_validation['DEGREE_ID'][$k]);\n unset($qualification_error_msg[$k]);\n\n break;\n }\n }\n }\n foreach ($qualification_error_msg as $error_msg){\n $error.=\"<div class='text-danger'>{$error_msg}</div>\";\n }\n\n\n if(is_array($or_qualifications_validation)){\n $bool = true;\n foreach($qualifications as $qual){\n\n foreach($or_qualifications_validation as $val){\n if($qual['DEGREE_ID']==$val){\n $bool = false;\n break;\n }\n }\n }\n\n if($bool){\n $error.=\"<div class='text-danger'>{$or_qualification_error_msg}</div>\";\n }\n\n }\n return $error;\n //prePrint($qualification_error_msg);\n\n }", "public function verifyEmailAddressByUserId($request)\n {\n return $this->start()->uri(\"/api/user/verify-email\")\n ->bodyHandler(new JSONBodyHandler($request))\n ->post()\n ->go();\n }", "protected function verify_token($request)\n {\n $header = $request->getHeaders();\n $token = $header['Authorization'][0];\n try{\n $current_user = $this->getDecodeJwt($token, getenv(\"APP_KEY\"));\n return (array)$current_user->data;\n }\n catch (\\Exception $e){\n return false;\n \n }\n }", "function checkIncompleteInfoById($userid)\r\n\t{\r\n\t\t$userid = funcs::check_input($userid);\r\n\r\n\t\t$sql = \"SELECT country, state, city, waitver_mobileno, mobileno FROM \".TABLE_MEMBER.\" WHERE id = '\".$userid.\"'\";\r\n\t\t$row = DBconnect::assoc_query_1D($sql);\r\n\r\n\t\tif($row['country'] == '0' && $row['state'] == '0' && $row['city'] == '0')\r\n\t\t{\r\n\t\t\treturn 2; //go to register step2\r\n\t\t}\r\n\t\telse if(!(isset($row['mobileno'])) || $row['mobileno'] == \"\")\r\n\t\t{\r\n\t\t\treturn 3; //go to mobile verify\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn 1; //complete info, users can access to the link which allow their permission\r\n\t\t}\r\n\t}", "public function verify_userinfo()\n\t{\n\t\t//load the user model\n\t\t$this->load->model('user');\n\t\t//call login function of user model\n\t\tif ($this->user->login())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse return false;\n\t}", "public function check($information) {\n $user = Users::findFirstByEmail($information['email']);\n if ($user == false) {\n //$this->registerUserThrottling(0);\n throw new PhalconException('Wrong email/password combination');\n }\n\n // Check the password\n if (!$this->security->checkHash($information['password'], $user->password)) {\n //$this->registerUserThrottling($user->id);\n throw new PhalconException('Wrong email/password combination');\n }\n\n // Check if the user was flagged\n //$this->checkUserFlags($user);\n\n // Register the successful login\n //$this->saveSuccessLogin($user);\n\n // Check if the remember me was selected\n /*if (isset($information['remember'])) {\n $this->createRememberEnvironment($user);\n }*/\n\n $this->session->set('auth-identity', [\n 'id' => $user->id,\n 'name' => $user->name,\n 'permission' => $user->permission\n ]);\n }", "protected function _infoComplete($user_info, $pwdOptional = false)\n\t{\n\t\t/**\n \t * Ensure we have all the required fields...\n \t */\n \t$noerror = true;\n \t$noerror &= array_key_exists('firstname',$user_info);\n \t$noerror &= array_key_exists('lastname',$user_info);\n \t$noerror &= array_key_exists('gender',$user_info);\n \t$noerror &= array_key_exists('email',$user_info);\n// \t$noerror &= array_key_exists('mobile',$user_info); /* Optional */\n \t$noerror &= array_key_exists('day',$user_info);\n \t$noerror &= array_key_exists('month',$user_info);\n \t$noerror &= array_key_exists('year',$user_info);\n \t$noerror &= array_key_exists('address1',$user_info);\n// \t$noerror &= array_key_exists('address2',$user_info); /* Optional */\n \t$noerror &= array_key_exists('town',$user_info);\n// \t$noerror &= array_key_exists('zip',$user_info); \t /* Optional */\n\t\tif (!$pwdOptional)\n \t\t$noerror &= array_key_exists('password',$user_info);\n \t$noerror &= array_key_exists('state',$user_info);\n \t$noerror &= array_key_exists('country',$user_info);\n \t\n \treturn $noerror;\t\n\t}", "protected function userDetailsValidator($request) {\n \treturn Validator::make($request,[\n 'company_id' => 'required',\n 'department_id' => 'required',\n 'group_id' => 'required',\n 'role_id' => 'required'\n ]);\n \t}", "public function validateAccessToken()\n {\n try {\n \n // Try to get token from header\n $token = $this->getBearerToken();\n //echo(\"TOKEN: \" .$token.\"\\n\"); //debug\n $payload = JWT::decode($token, API_ACCESS_TOKEN_KEY, [''.API_ALGORITHM.'']);\n \n //moved SQL connection from __construct(). At least do not make so many connections to database. \n try {\n $db = new Database();\n $this->database = $db->connect();\n $sql = $this->database->prepare(\"SELECT Id, Disabled FROM users WHERE Id = :id\");\n $sql->bindParam(\":id\", $payload->userId);\n $sql->execute();\n $user = $sql->fetch(PDO::FETCH_ASSOC);\n } catch (Exception $e) {\n $this->throwException(DATABASE_ERROR, \"Database select error.\");\n }\n if (!is_array($user)) {\n $this->response(INVALID_USER_PASS, \"This user is not found in our database\");\n }\n \n if ($user['Disabled'] == 1 ) {\n $this->response(USER_IS_DISABLED, \"This user is disabled.\");\n }\n \n // if validated correctly lets set \n \n $this->user->setUserId($payload->userId);\n //$this->userId = $payload->userId;\n \n } catch (Exception $e) {\n //close db connection\n //$this->database->disconnect();\n $this->throwException(ACCESS_TOKEN_ERROR, \"AccessToken: \".$e->getMessage());\n }\n //close db connection\n //$this->database->disconnect();\n \n }", "protected function validateDetails($request) \n {\n return $this->validate($request, [\n 'client_first_name' => 'required|alpha|max:256',\n 'client_last_name' => 'required|alpha|max:256',\n 'client_phone' => 'required|regex:/^([0-9\\s\\-\\+\\(\\)]*)$/|min:10',\n 'client_email' => 'required|email',\n ]);\n }", "private static function validate_sale_info($payment_info) {\n\n return Validation::factory($payment_info)\n ->rule('card_number', 'not_empty')\n ->rule('expirationMonth', 'not_empty')\n ->rule('expirationYear', 'not_empty')\n ->rule('cvv', 'not_empty')\n ->rule('currency', 'not_empty')\n ->rule('firstName', 'not_empty');\n }", "public function verify(UserInterface $signator, Request $request) {\n if(!$this->isValidTimestamp($request->headers->getDate(\"date\"))) {\n return false;\n }\n\n $parts = array();\n if(preg_match(self::$authRegex,$this->getAuthorizationHeader($request),$parts)) {\n $requestUser = $parts[1];\n $requestSignature = $parts[2];\n \n if($requestUser == $signator->getUsername()) {\n $calculatedSignature = $this->makeSignature($signator,$request);\n\n if($calculatedSignature == $requestSignature) {\n return true;\n }\n }\n }\n\n return false;\n }", "protected function validateUserEmail($userInfo) {\n $config = \\Drupal::service('config.factory')->get('auth0.settings');\n $requires_email = $config->get('auth0_requires_verified_email');\n\n if ($requires_email) {\n if (!isset($userInfo['email']) || empty($userInfo['email'])) {\n throw new EmailNotSetException();\n }\n if (!$userInfo['email_verified']) {\n throw new EmailNotVerifiedException();\n }\n }\n }", "private function validateObservation() {\n\n $response = new ApiResponse();\n\n if (!\\Request::has('device_uuid')) {\n $response->status = 'error';\n $response->message = [\n 'id' => '',\n 'code' => 'device_uuid_null',\n 'description' => 'The device uuid should not be null'];\n }\n else{\n $device = Device::where('device_uuid', \\Request::get('device_uuid'))->first();\n\n if($device==null){\n $response->status = 'error';\n $response->message = [\n 'id' => '',\n 'code' => 'device_not_found',\n 'description' => 'The device could not be found'];\n }\n }\n\n if (!\\Request::has('mission_id')) {\n $response->status = 'error';\n $response->message = [\n 'id' => '',\n 'code' => 'mission_id_null',\n 'description' => 'The mission id should not be null'];\n } else {\n //check that the mission_id exists\n $this->mission = Mission::with('type')->find(\\Request::get('mission_id'));\n\n if ($this->mission == null) {\n $response->status = 'error';\n $response->message = [\n 'id' => '',\n 'code' => 'mission_id_not_found',\n 'description' => 'The requested mission could not be found'];\n }\n }\n\n if (\\Request::has('observation_date')) {\n if (!$this->validateDate(\\Request::get('observation_date'))) {\n $response->status = 'error';\n $response->message = [\n 'id' => '',\n 'code' => 'wrong_date_format',\n 'description' => 'The date should be in the following format: Y-m-d hh:mm:ss'];\n }\n }\n\n if (\\Request::has('latitude') && !is_numeric(\\Request::get('latitude')) || \\Request::has('longitude') && !is_numeric(\\Request::get('longitude'))) {\n $response->status = 'error';\n $response->message = [\n 'id' => '',\n 'code' => 'coordinates_not_numeric',\n 'description' => 'The coordinates of the observation should be numeric'];\n }\n\n if (!\\Request::has('measurements')) {\n $response->status = 'error';\n $response->message = [\n 'id' => '',\n 'code' => 'measurements_null',\n 'description' => 'The measurements should not be null'];\n } else {\n foreach (\\Request::get('measurements') as $measurement) {\n\n if (!isset($measurement['latitude']) || $measurement['latitude'] == '' || !isset($measurement['longitude']) || $measurement['longitude'] == '') {\n $response->status = 'error';\n $response->message = [\n 'id' => '',\n 'code' => 'coordinates_null',\n 'description' => 'The coordinates of the measurements should not be null'];\n } else if (!is_numeric($measurement['latitude']) || !is_numeric($measurement['longitude'])) {\n $response->status = 'error';\n $response->message = [\n 'id' => '',\n 'code' => 'coordinates_not_numeric',\n 'description' => 'The coordinates of the measurements should be numeric'];\n }\n }\n }\n\n return $response;\n }", "public function testGetInfoUser()\n {\n $id = 1;\n $this->json('GET', \"api/user/get-info/$id\", ['Accept' => 'application/json'])\n ->assertStatus(200)\n ->assertJsonStructure([\n \"data\" => [\n \"created_at\",\n \"email\",\n \"name\",\n \"id\",\n \"org_id\",\n \"updated_at\"\n ]\n ]);\n }", "public function hasValidClaims($token){\n \n $flatToken = explode('.',$token);\n $payload = $flatToken[1];\n $decodedPayload = base64_decode($payload);\n\n $claimsArray = $this->filterClaimsFromDecoded($decodedPayload);\n // dd($claimsArray);\n\n //validate claims\n foreach ($claimsArray as $key => $value) {\n $claimClassFromObj = $this->defaultClaims[$key];\n $claimClass = (new $claimClassFromObj($value));\n if(method_exists($claimClass,'validatePayload')){\n $claimClass->validatePayload();\n }\n }\n return true;\n\n }", "public function verifyUserRegistration($request)\n {\n return $this->startAnonymous()->uri(\"/api/user/verify-registration\")\n ->bodyHandler(new JSONBodyHandler($request))\n ->post()\n ->go();\n }" ]
[ "0.61199075", "0.53209674", "0.5161927", "0.513904", "0.50741595", "0.49586102", "0.49447203", "0.49420717", "0.49323457", "0.4922052", "0.49094534", "0.4908126", "0.48788986", "0.48533937", "0.48219582", "0.48139027", "0.481387", "0.48041713", "0.47919026", "0.47835636", "0.47609735", "0.47609037", "0.47512677", "0.4750467", "0.47327065", "0.47242156", "0.4721892", "0.47213992", "0.47207743", "0.47193515" ]
0.69121504
0
Validates that the requested essential claims are in the response, taking conditionals and special cases into account
private function validateMatchingResponseForToken(array $request, array $response, array $rules) { $logicEvaluator = new LogicEvaluator($rules, $response); foreach ($request as $claimName => $valueInRequest) { if (!$this->isVerificationClaim($claimName)) { continue; } $enabled = $this->getBoolValue($valueInRequest, 'conditional', true, $logicEvaluator); // If value=false is given, we accept both true and false. // It would make no sense to ask for stricly unverified e-mail or phone-number. // $essential is not considered for verification claims $mustBeVerified = $this->getBoolValue($valueInRequest, 'value', false, $logicEvaluator); $valueInResponse = $this->getClaimValue($response, $claimName); $baseClaimName = substr($claimName, 0, strlen($claimName) - strlen('_verified')); $baseClaimValueInRequest = isset($request[$baseClaimName]) ? $request[$baseClaimName] : []; $isBaseClaimEnabled = $this->getBoolValue($baseClaimValueInRequest, 'conditional', true, $logicEvaluator); $baseClaimValueInResponse = $this->getClaimValue($response, $baseClaimName); $isBaseClaimSet = !is_null($baseClaimValueInResponse); $isBaseClaimEssential = $this->getBoolValue($baseClaimValueInRequest, 'essential', false, $logicEvaluator); if (!$isBaseClaimEnabled && $isBaseClaimSet) { throw new ValidationException("Verifiable claim $baseClaimName disabled by conditional, but set."); } if ($isBaseClaimEssential && !$isBaseClaimSet) { throw new ValidationException("Verifiable claim $baseClaimName essential, but missing."); } if ($enabled && $isBaseClaimEnabled && $isBaseClaimSet) { if (!is_bool($valueInResponse)) { throw new ValidationException("Verification claim $claimName missing or has an invalid type."); } if ($mustBeVerified && $valueInResponse !== true) { throw new ValidationException("Verification claim $claimName not true."); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handle_claim() {\n $file = $_FILES[\"claim\"];\n\n if (!check_upload(&$file)) {\n header(\"HTTP/1.1 400 Bad Request\");\n echo \"Uploaded file missing or of wrong type!\\n\";\n return false;\n }\n\n if (($err = verify_signature(&$file)) !== \"OK\") {\n header(\"HTTP/1.1 400 Bad Request\");\n echo \"The claim's signature is invalid!\\n$err\\n\";\n return false;\n }\n\n extract_claim($file);\n return true;\n}", "private function verify_request()\n{\n $headers = $this->input->request_headers();\n // Extract the token\n $token = $headers['Authorization'];\n // Use try-catch\n // JWT library throws exception if the token is not valid\n try {\n // Validate the token\n // Successfull validation will return the decoded user data else returns false\n $data = AUTHORIZATION::validateToken($token);\n if ($data === false) {\n $status = parent::HTTP_UNAUTHORIZED;\n $response = ['status' => $status, 'msg' => 'Unauthorized Access!'];\n $this->response($response, $status);\n exit();\n } else {\n return $data;\n }\n } catch (Exception $e) {\n // Token is invalid\n // Send the unathorized access message\n $status = parent::HTTP_UNAUTHORIZED;\n $response = ['status' => $status, 'msg' => 'Unauthorized Access! '];\n $this->response($response, $status);\n }\n}", "public function hasValidClaims($token){\n \n $flatToken = explode('.',$token);\n $payload = $flatToken[1];\n $decodedPayload = base64_decode($payload);\n\n $claimsArray = $this->filterClaimsFromDecoded($decodedPayload);\n // dd($claimsArray);\n\n //validate claims\n foreach ($claimsArray as $key => $value) {\n $claimClassFromObj = $this->defaultClaims[$key];\n $claimClass = (new $claimClassFromObj($value));\n if(method_exists($claimClass,'validatePayload')){\n $claimClass->validatePayload();\n }\n }\n return true;\n\n }", "function GetTokenValidateRequest($Payloads) {\n\n if(!$Payloads ['Email'] || !$Payloads ['Password'] ) {\n Return \"False\" ;\n }\n return \"True\";\n\n}", "private function validateObservation() {\n\n $response = new ApiResponse();\n\n if (!\\Request::has('device_uuid')) {\n $response->status = 'error';\n $response->message = [\n 'id' => '',\n 'code' => 'device_uuid_null',\n 'description' => 'The device uuid should not be null'];\n }\n else{\n $device = Device::where('device_uuid', \\Request::get('device_uuid'))->first();\n\n if($device==null){\n $response->status = 'error';\n $response->message = [\n 'id' => '',\n 'code' => 'device_not_found',\n 'description' => 'The device could not be found'];\n }\n }\n\n if (!\\Request::has('mission_id')) {\n $response->status = 'error';\n $response->message = [\n 'id' => '',\n 'code' => 'mission_id_null',\n 'description' => 'The mission id should not be null'];\n } else {\n //check that the mission_id exists\n $this->mission = Mission::with('type')->find(\\Request::get('mission_id'));\n\n if ($this->mission == null) {\n $response->status = 'error';\n $response->message = [\n 'id' => '',\n 'code' => 'mission_id_not_found',\n 'description' => 'The requested mission could not be found'];\n }\n }\n\n if (\\Request::has('observation_date')) {\n if (!$this->validateDate(\\Request::get('observation_date'))) {\n $response->status = 'error';\n $response->message = [\n 'id' => '',\n 'code' => 'wrong_date_format',\n 'description' => 'The date should be in the following format: Y-m-d hh:mm:ss'];\n }\n }\n\n if (\\Request::has('latitude') && !is_numeric(\\Request::get('latitude')) || \\Request::has('longitude') && !is_numeric(\\Request::get('longitude'))) {\n $response->status = 'error';\n $response->message = [\n 'id' => '',\n 'code' => 'coordinates_not_numeric',\n 'description' => 'The coordinates of the observation should be numeric'];\n }\n\n if (!\\Request::has('measurements')) {\n $response->status = 'error';\n $response->message = [\n 'id' => '',\n 'code' => 'measurements_null',\n 'description' => 'The measurements should not be null'];\n } else {\n foreach (\\Request::get('measurements') as $measurement) {\n\n if (!isset($measurement['latitude']) || $measurement['latitude'] == '' || !isset($measurement['longitude']) || $measurement['longitude'] == '') {\n $response->status = 'error';\n $response->message = [\n 'id' => '',\n 'code' => 'coordinates_null',\n 'description' => 'The coordinates of the measurements should not be null'];\n } else if (!is_numeric($measurement['latitude']) || !is_numeric($measurement['longitude'])) {\n $response->status = 'error';\n $response->message = [\n 'id' => '',\n 'code' => 'coordinates_not_numeric',\n 'description' => 'The coordinates of the measurements should be numeric'];\n }\n }\n }\n\n return $response;\n }", "private function verify_request()\n {\n try{\n $headers = $this->input->request_headers();\n $token = $headers['X-API-KEY'];\n if(!$token) {\n $status = parent::HTTP_UNAUTHORIZED;\n $res = ['status' => $status, 'msg' => 'Unauthorized access!'];\n $this->response($res, $status);\n return;\n }\n\n $data = AUTHORIZATION::validateToken($token);\n if($data === false){\n $status = parent::HTTP_UNAUTHORIZED;\n $res = ['status' => $status, 'msg' => 'Unauthorized accesss'];\n $this->response($res, $status);\n exit();\n }else{\n return $data;\n }\n\n }catch(Exception $e){\n $status = parent::HTTP_UNAUTHORIZED;\n $res = ['status' => $status, 'msg' => 'Unauthorized access!'];\n $this->response($res, $status);\n }\n }", "private function verify_request()\n {\n try{\n $headers = $this->input->request_headers();\n $token = $headers['X-API-KEY'];\n if(!$token) {\n $status = parent::HTTP_UNAUTHORIZED;\n $res = ['status' => $status, 'msg' => 'Unauthorized access!'];\n $this->response($res, $status);\n return;\n }\n\n $data = AUTHORIZATION::validateToken($token);\n if($data === false){\n $status = parent::HTTP_UNAUTHORIZED;\n $res = ['status' => $status, 'msg' => 'Unauthorized accesss'];\n $this->response($res, $status);\n exit();\n }else{\n return $data;\n }\n\n }catch(Exception $e){\n $status = parent::HTTP_UNAUTHORIZED;\n $res = ['status' => $status, 'msg' => 'Unauthorized access!'];\n $this->response($res, $status);\n }\n }", "public function validate($request, $requestId, $offerId) {\n $doctrine = $this->getDoctrine();\n $sessionId = $request->headers->get('X-SESSION-ID');\n $sessionRepo = $doctrine->getRepository('MegasoftEntangleBundle:Session');\n $session = $sessionRepo->findOneBy(array('sessionId' => $sessionId));\n $requestRepo = $doctrine->getRepository('MegasoftEntangleBundle:Request');\n $claimerRequest = $requestRepo->findOneBy(array('id' => $requestId));\n if ($sessionId == null) {\n return new Response('No such session1', 400);\n }\n if ($session == null) {\n return new Response('No such session2', 400);\n }\n if ($session->getExpired()) {\n return new Response('No such session3', 400);\n }\n if ($requestId == null || $offerId == null) {\n return new Response('No such request or offer', 400);\n }\n $userId = $session->getUserId();\n if ($userId == null) {\n return new Response('No such claimer', 400);\n }\n if ($claimerRequest == null) {\n return new Response('No such request', 400);\n }\n $offerRepo = $doctrine->getRepository('MegasoftEntangleBundle:Offer');\n $offer = $offerRepo->findOneBy(array('requestId' => $requestId, 'deleted' => false, 'status' => 2));\n if ($offer == null) {\n return new Response('No such offer', 400);\n }\n if (!($offer->getUserId() == $userId || $claimerRequest->getUserId() == $userId)) {\n return new Response('Not authorized to claim', 400);\n }\n $tangleId = $claimerRequest->getTangleId();\n $tangleRepo = $doctrine->getRepository('MegasoftEntangleBundle:Tangle');\n $tangle = $tangleRepo->findOneBy(array('id' => $tangleId, 'deleted' => false));\n if ($tangleId == null || $tangle == null) {\n return new Response('No such tangle', 400);\n }\n return null;\n }", "public function verifyRequest()\n {\n }", "public function validateMatchingResponse(array $requestedClaims, array $userinfo)\n {\n $rules = [];\n if (isset($requestedClaims['rules'])) {\n if (!is_array($requestedClaims['rules'])) {\n throw new ValidationException(\"Rules must be array (logic expression).\");\n }\n\n $rules =& $requestedClaims['rules'];\n }\n if (isset($requestedClaims['userinfo']) && !is_object($requestedClaims['userinfo'])) {\n $this->validateMatchingResponseForToken(\n $requestedClaims['userinfo'],\n $userinfo,\n $rules\n );\n }\n }", "public function get_claims(Request $request)\n{\n\n if (!Auth::guard('merchant')->check()) {\n return response([\"status\" => \"fail\", \"message\" => \"Permission Denied. Please log out and login again\"]);\n }\n\n if (auth()->user()->merchant_flagged) {\n $request->user()->token()->revoke();\n return response([\"status\" => \"fail\", \"message\" => \"Account access restricted\"]);\n }\n\n $where_array = array(\n ['merchant_id', '=', auth()->user()->merchant_id],\n ['paid_status', '=', 0],\n ); \n\n $unpaid_redemptions = DB::table('claims')\n ->selectRaw('count(*)')\n ->where($where_array)\n ->get();\n\n $unpaid_redemptions = (array) $unpaid_redemptions[0];\n $unpaid_redemptions = (array) $unpaid_redemptions[\"count(*)\"];\n\n\n $where_array = array(\n ['merchant_id', '=', auth()->user()->merchant_id],\n ); \n\n $claims = DB::table('claims')\n ->select('claims.*')\n ->where($where_array)\n ->get();\n\n\n for ($i=0; $i < count($claims); $i++) { \n\n if($claims[$i]->merchant_id > 0 && $claims[$i]->merchant_id != null){\n $this_merchant = DB::table('merchants')\n ->where(\"merchant_id\", \"=\", $claims[$i]->merchant_id)\n ->get();\n \n if(isset($this_merchant[0])){\n $claims[$i]->merchant_fullname = $this_merchant[0]->merchant_name;\n $claims[$i]->merchant_phone_number = $this_merchant[0]->merchant_phone_number;\n } else {\n $claims[$i]->merchant_fullname = \"[NA]\";\n $claims[$i]->merchant_phone_number = \"[NA]\";\n }\n } else {\n $claims[$i]->merchant_fullname = \"[NA]\";\n $claims[$i]->merchant_phone_number = \"[NA]\";\n }\n\n if($claims[$i]->payer_admin_id > 0 && $claims[$i]->payer_admin_id != null){\n $this_admin = DB::table('administrators')\n ->where(\"admin_id\", \"=\", $claims[$i]->payer_admin_id)\n ->get();\n \n if(isset($this_admin[0])){\n $claims[$i]->admin_fullname = $this_admin[0]->admin_firstname . \" \" . $this_admin[0]->admin_surname;\n } else {\n $claims[$i]->admin_fullname = \"[NA]\";\n }\n } else {\n $claims[$i]->admin_fullname = \"[NA]\";\n }\n }\n\n return response([\n \"status\" => \"success\", \n \"message\" => \"Operation successful\", \n \"unpaid\" => $unpaid_redemptions[0], \n \"merchant_balance\" => auth()->user()->merchant_balance, \n \"claims\" => $claims\n ]);\n }", "public function hasValidResponse(RequestEntity $request);", "function verifyRequest($req){\n\n}", "function check_esewa_response() {\n\n\t\t\t@ob_clean();\n\n\t\t\tif ( ! empty( $_REQUEST ) && $this->check_esewa_response_is_valid() ) {\n\n\t\t\t\tdo_action( 'valid-esewa-standard-response' );\n\n\t\t\t} else {\n\n\t\t\t\twp_die( 'eSewa Response Validation Failure' );\n\n\t\t\t}\n\n\t\t}", "private function requestIsValid() : bool\n {\n $queryParams = $this->request->getQueryParams();\n\n return array_has($queryParams,self::OPENID_ASSOC_HANDLE)\n && array_has($queryParams,self::OPENID_SIGNED)\n && array_has($queryParams,self::OPENID_SIG);\n }", "function attributes2claims($attributes)\n{\n $email = NULL;\n if (isset($attributes['mail']))\n $email = $attributes['mail'][0];\n else if (isset($attributes['email']))\n $email = $attributes['email'][0];\n else\n $email = NULL;\n\n $claims = array();\n $claims['subject_id'] = (isset($attributes['subject-id'])? $attributes['subject-id'][0] : null);\n $claims['name'] = (isset($attributes['cn']) ? $attributes['cn'][0] : null);\n $claims['family_name'] = (isset($attributes['sn']) ? $attributes['sn'][0] : null);\n $claims['given_name'] = (isset($attributes['givenName']) ? $attributes['givenName'][0] : null);\n $claims['middle_name'] = (isset($attributes['middleName']) ? $attributes['middleName'][0] : null);\n $claims['nickname'] = (isset($attributes['nickname']) ? $attributes['nickname'][0] : null);\n $claims['preferred_username'] = (isset($attributes['displayName']) ? $attributes['displayName'][0] : null);\n $claims['profile'] = (isset($attributes['profile']) ? $attributes['profile'][0] : null);\n $claims['picture'] = (isset($attributes['picture']) ? $attributes['picture'][0] : null);\n $claims['website'] = (isset($attributes['website']) ? $attributes['website'][0] : null);\n $claims['gender'] = (isset($attributes['gender']) ? $attributes['gender'][0] : null);\n $claims['age'] = (isset($attributes['age']) ? $attributes['age'][0] : null);\n $claims['birthdate'] = (isset($attributes['birthdate']) ? $attributes['birthdate'][0] : null);\n $claims['zoneinfo'] = (isset($attributes['zoneinfo']) ? $attributes['zoneinfo'][0] : null);\n $claims['locale'] = (isset($attributes['locale']) ? $attributes['locale'][0] : null);\n $claims['updated_at'] = (isset($attributes['updatedAt']) ? $attributes['updatedAt'][0] : null);\n $claims['email'] = $email;\n $claims['email_verified'] = (isset($attributes['emailVerified']) ? $attributes['emailVerified'][0] : null);\n $claims['affiliation'] = (isset($attributes['affiliation']) ? $attributes['affiliation'][0] : null);\n $claims['profession'] = (isset($attributes['profession']) ? $attributes['profession'][0] : null);\n $claims['idp_country'] = (isset($attributes['c']) ? $attributes['c'][0] : null);\n $claims['idp_country'] = (isset($attributes['idpCountry']) ? $attributes['idpCountry'][0] : null);\n $claims['idp_name'] = (isset($attributes['schacHomeOrganization']) ? $attributes['schacHomeOrganization'][0] : null);\n $claims['idp_name'] = (isset($attributes['idpName']) ? $attributes['idpName'][0] : null);\n $claims['idp_origin'] = (isset($attributes['businessCategory']) ? $attributes['businessCategory'][0] : null);\n $claims['idp_origin'] = (isset($attributes['idpOrigin']) ? $attributes['idpOrigin'][0] : null);\n $claims['home_town'] = (isset($attributes['homeTown']) ? $attributes['homeTown'][0] : null);\n\n return $claims;\n}", "public function getUserValidationAction()\n {\n $email = $this->params()->fromQuery('email','');\n $featureName = $this->params()->fromQuery('featureName','');\n $res = $this->entityManager->getRepository(Usersso::class)->isUserAllowed($email ,$featureName );\n if($res[0]['canAccess']>0)\n {\n $this->httpStatusCode = 200; \n\n }else{\n $this->httpStatusCode = 403;\n }\n $this->apiResponse['canAccess'] = $res[0]['canAccess'];\n return $this->createResponse();\n \n }", "private function verify_request($data_active)\r\n\t\t{\r\n\t\t\t$headers = $this->input->request_headers();\r\n\r\n\t\t\t// Extract the token\r\n\t\t\t$token = $headers['Authorization'];\r\n\r\n\t\t\t// Use try-catch\r\n\t\t\t// JWT library throws exception if the token is not valid\r\n\t\t\ttry {\r\n\t\t\t\t// Validate the token\r\n\t\t\t\t// Successfull validation will return the decoded user data else returns false\r\n $data = AUTHORIZATION::validateToken(str_replace(\"Bearer \",\"\",$token));\r\n\t\t\t\tif ($data === false) {\r\n\t\t\t\t\t$status = parent::HTTP_UNAUTHORIZED;\r\n\t\t\t\t\t$response = ['status' => $status, 'msg' => 'Unauthorized Access!'];\r\n\t\t\t\t\t$this->response($response, $status);\r\n\r\n\t\t\t\t\texit();\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn $data_active;\r\n\t\t\t\t}\r\n\t\t\t} catch (Exception $e) {\r\n\t\t\t\t// Token is invalid\r\n\t\t\t\t// Send the unathorized access message\r\n\t\t\t\t$status = parent::HTTP_UNAUTHORIZED;\r\n\t\t\t\t$response = ['status' => $status, 'msg' => 'Unauthorized Access! '];\r\n\t\t\t\t$this->response($response, $status);\r\n\t\t\t}\r\n }", "protected function validateRequest() {\n \t \t\n $request = new Oauth_Model_Request($this->getRequest());\n\n if (!$this->_request_validator->isValid($request)) {\n $response = Array();\n\n $messages = $this->_request_validator->getMessages();\n $last_msg = explode(\":\", array_pop($messages));\n $response['error'] = $last_msg[0];\n $response['error_description'] = isset($last_msg[1]) ? $last_msg[1] : \"\";\n\n $this->getResponse()->setHttpResponseCode(401);\n $this->getResponse()->setBody(json_encode($response));\n $this->getResponse()->setHeader('Content-Type', 'application/json;charset=UTF-8');\n\n return FALSE;\n }\n\n return TRUE;\n }", "abstract public function is_authorized_response($response);", "public function validateRequest();", "function simpleid_check_authentication($request) {\n global $version;\n \n log_info('OpenID direct verification: ' . log_array($request));\n \n $is_valid = simpleid_verify_signatures($request);\n\n if ($is_valid) {\n $response = array('is_valid' => 'true');\n } else {\n $response = array('is_valid' => 'false');\n }\n \n // RP wants to check whether a handle is invalid\n if (isset($request['openid.invalidate_handle'])) {\n $invalid_assoc = cache_get('association', $request['openid.invalidate_handle']);\n \n if (!$invalid_assoc || ($invalid_assoc['created'] + SIMPLEID_ASSOC_EXPIRES_IN < time())) {\n // Yes, it's invalid\n $response['invalidate_handle'] = $request['openid.invalidate_handle'];\n }\n }\n\n log_info('OpenID direct verification response: ' . log_array($response));\n \n openid_direct_response(openid_direct_message($response, $version));\n}", "function verifyTokenValidity($authToken) { \n try {\n $decoded = JWT::decode($authToken, secretKey, array('HS256'));\n if(count($decoded) > 0){\n return TRUE;\n }\n \n } catch (Exception $ex) { \n $jsonData = new stdClass();\n //$message = 'Caught exception: '.$ex->getMessage();\n $message = currentUTCTime.','.nextOneHourTime;\n $bool = 0;\n $status = 401;\n //$code = REST_Controller::HTTP_OK;\n $setParams = [\n 'success' => $bool,\n 'status' => $status,\n 'message' => $message,\n 'result' => $jsonData\n ];\n // echo json_encode($setParams);die;\n return json_encode($setParams); \n exit();\n }\n}", "private function validate_input()\n \t{\n \t\t$this->errors_found = FALSE;\t\t\t\t\n\n\t\t// validate the get request\n\t\t//is their an IVR code?\n\t\tif(! isset($_GET['ivrcode'])){\n\t\t\t$this->response['status'] = 'Error';\n\t\t\t$this->response['message'][] = 'Missing ivrcode';\n\t\t\t$this->errors_found = TRUE;\n\t\t}elseif(! is_numeric($_GET['ivrcode'])){\n\t\t\t$this->response['status'] = 'Error';\n\t\t\t$this->response['message'][] = 'Invalid value for ivrcode - should be numeric';\n\t\t\t$this->errors_found = TRUE;\n\t\t}else{\n\t\t\t$this->form_answers['ivrcode'] = $_GET['ivrcode'];\n\t\t}\n\n\t\t//is there a phone number\n\t\tif(! isset($_GET['phonenumber'])){\n\t\t\t$this->response['status'] = 'Error';\n\t\t\t$this->response['message'][] = 'Missing phonenumber';\n\t\t\t$this->errors_found = TRUE;\n\t\t}elseif(! is_numeric($_GET['phonenumber'])){\n\t\t\t$this->response['status'] = 'Error';\n\t\t\t$this->response['message'][] = 'Invalid value for phonenumber - should be numeric';\n\t\t\t$this->errors_found = TRUE;\n\t\t}else{\n\t\t\t$this->form_answers['phonenumber'] = $_GET['phonenumber'];\n\t\t}\n\t\t\n\t\t//is there a well working?\n\t\tif(!isset($_GET['wellwork'])){\n\t\t\t$this->response['status'] = 'Error';\n\t\t\t$this->response['message'][] = 'Missing wellwork';\n\t\t\t$this->errors_found = TRUE;\n\t\t}else\n\t\t{\n\t\t\t$_GET['wellwork'] = strtolower($_GET['wellwork']);\n\t\t\t\n\t\t\tif($_GET['wellwork'] != 'yes' && $_GET['wellwork'] != 'no')\n\t\t\t{\n\t\t\t\t$this->response['status'] = 'Error';\n\t\t\t\t$this->response['message'][] = 'Invalid value for wellwork - should be Yes or No';\n\t\t\t\t$this->errors_found = TRUE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->form_answers['wellwork'] = $_GET['wellwork'];\n\t\t\t}\n\t\t}\n\t\t\n\n\t\t//is there a does the mechanic know?\n\t\tif(isset($_GET['mechanicknow']))\n\t\t{\n\t\t\t$_GET['mechanicknow'] = strtolower($_GET['mechanicknow']);\n\t\t\tif($_GET['mechanicknow'] != 'yes' && $_GET['mechanicknow'] != 'no'){\n\t\t\t\t$this->response['status'] = 'Error';\n\t\t\t\t$this->response['message'][] = 'Invalid value for mechanicknow - should be Yes or No';\n\t\t\t\t$this->errors_found = TRUE;\n\t\t\t}else{\n\t\t\t\t$this->form_answers['mechanicknow'] = $_GET['mechanicknow'];\n\t\t\t}\n\t\t}\n\n\t\t\t\n\t\t//is there a can the mechanic fix\n\t\tif(isset($_GET['mechanicfix']))\n\t\t{\n\t\t\t$_GET['mechanicfix'] = strtolower($_GET['mechanicfix']);\n\t\t\tif($_GET['mechanicfix'] != 'yes' && $_GET['mechanicfix'] != 'no'){\n\t\t\t\t$this->response['status'] = 'Error';\n\t\t\t\t$this->response['message'][] = 'Invalid value for mechanicfix - should be Yes or No';\n\t\t\t\t$this->errors_found = TRUE;\n\t\t\t}else{\n\t\t\t\t$this->form_answers['mechanicfix'] = $_GET['mechanicfix'];\n\t\t\t}\n\t\t}\n\t\t//is there a file name\n\t\tif(isset($_GET['filename'])){\n\t\t\t$get = new Validation($_GET);\n\t\t\t$get->add_rules('filename','standard_text');\n\t\t\tif(! $get->validate()){\n\t\t\t\t$this->response['status'] = 'Error';\n\t\t\t\t$this->response['message'][] = 'Invalid value for filename - should be standard text';\n\t\t\t\t$this->errors_found = TRUE;\n\t\t\t}else{\n\t\t\t\t$this->form_answers['filename'] = $_GET['filename'];\n\t\t\t}\n\t\t}\n\t\t\n\t\t//is there a response format \n\t\tif(isset($_GET['resp'])){\n\t\t\tif($_GET['resp'] != 'json' && $_GET['resp'] != 'xml'){\n\t\t\t\t$this->response['status'] = 'Error';\n\t\t\t\t$this->response['message'][] = 'Invalid value for resp - should be json or xml';\n\t\t\t\t$this->errors_found = TRUE;\n\t\t\t}else{\n\t\t\t\t$this->resp = $_GET['resp'];\n\t\t\t}\n\t\t}else{\n\t\t\t$this->resp = 'json';\n\t\t}\n\n\t\t//if there are errors, let them know.\n\t\tif($this->errors_found){\n\t\t\t$this->send_response($this->response, $this->resp);\n\t\t\treturn;\n\t\t}\t\t\n \t}", "private function validate () {\n $payload = $this->payload;\n // Unset fields that don't match the spec\n foreach (array_keys($payload) as $field) {\n if (!in_array($field, $this->fields)) {\n unset($payload[$field]);\n }\n }\n\n // If the user is signing up manually (I.e. not via a social network), then\n // we also need a password\n if ($this->method === 'manual' && empty($payload['password'])) {\n return false;\n }\n\n $this->payload = $payload;\n return true;\n }", "abstract public function verifyRequest(): void;", "abstract public function verifyRequest(): void;", "public function filterClaimsFromDecoded($payload){\n $dc_pl = json_decode($payload,TRUE);\n $res = array();\n\n foreach ($dc_pl as $key => $val ) {\n if(array_key_exists($key,$this->defaultClaims)){\n $res[$key] = $val; \n }\n }\n \n return $res;\n\n }", "protected function validateTokenClaims(string $clientId): void\n {\n // 1. The Issuer Identifier for the OpenID Provider (which is typically obtained during Discovery)\n // MUST exactly match the value of the iss (issuer) Claim.\n if (empty($this->payload['iss']) || $this->issuer !== $this->payload['iss']) {\n throw new OidcInvalidTokenException('Missing or non-matching token issuer value');\n }\n\n // 2. The Client MUST validate that the aud (audience) Claim contains its client_id value registered\n // at the Issuer identified by the iss (issuer) Claim as an audience. The ID Token MUST be rejected\n // if the ID Token does not list the Client as a valid audience, or if it contains additional\n // audiences not trusted by the Client.\n if (empty($this->payload['aud'])) {\n throw new OidcInvalidTokenException('Missing token audience value');\n }\n\n $aud = is_string($this->payload['aud']) ? [$this->payload['aud']] : $this->payload['aud'];\n if (count($aud) !== 1) {\n throw new OidcInvalidTokenException('Token audience value has ' . count($aud) . ' values, Expected 1');\n }\n\n if ($aud[0] !== $clientId) {\n throw new OidcInvalidTokenException('Token audience value did not match the expected client_id');\n }\n\n // 3. If the ID Token contains multiple audiences, the Client SHOULD verify that an azp Claim is present.\n // NOTE: Addressed by enforcing a count of 1 above.\n\n // 4. If an azp (authorized party) Claim is present, the Client SHOULD verify that its client_id\n // is the Claim Value.\n if (isset($this->payload['azp']) && $this->payload['azp'] !== $clientId) {\n throw new OidcInvalidTokenException('Token authorized party exists but does not match the expected client_id');\n }\n\n // 5. The current time MUST be before the time represented by the exp Claim\n // (possibly allowing for some small leeway to account for clock skew).\n if (empty($this->payload['exp'])) {\n throw new OidcInvalidTokenException('Missing token expiration time value');\n }\n\n $skewSeconds = 120;\n $now = time();\n if ($now >= (intval($this->payload['exp']) + $skewSeconds)) {\n throw new OidcInvalidTokenException('Token has expired');\n }\n\n // 6. The iat Claim can be used to reject tokens that were issued too far away from the current time,\n // limiting the amount of time that nonces need to be stored to prevent attacks.\n // The acceptable range is Client specific.\n if (empty($this->payload['iat'])) {\n throw new OidcInvalidTokenException('Missing token issued at time value');\n }\n\n $dayAgo = time() - 86400;\n $iat = intval($this->payload['iat']);\n if ($iat > ($now + $skewSeconds) || $iat < $dayAgo) {\n throw new OidcInvalidTokenException('Token issue at time is not recent or is invalid');\n }\n\n // 7. If the acr Claim was requested, the Client SHOULD check that the asserted Claim Value is appropriate.\n // The meaning and processing of acr Claim Values is out of scope for this document.\n // NOTE: Not used for our case here. acr is not requested.\n\n // 8. When a max_age request is made, the Client SHOULD check the auth_time Claim value and request\n // re-authentication if it determines too much time has elapsed since the last End-User authentication.\n // NOTE: Not used for our case here. A max_age request is not made.\n\n // Custom: Ensure the \"sub\" (Subject) Claim exists and has a value.\n if (empty($this->payload['sub'])) {\n throw new OidcInvalidTokenException('Missing token subject value');\n }\n }", "public function validateResponseProvider() {\n $defaults = [\n 'route_name' => 'jsonapi.node--article.individual',\n 'resource_type' => new ResourceType('node', 'article', NULL),\n ];\n\n $test_data = [\n // Test validation success.\n [\n 'json' => <<<'EOD'\n{\n \"data\": {\n \"type\": \"node--article\",\n \"id\": \"4f342419-e668-4b76-9f87-7ce20c436169\",\n \"attributes\": {\n \"nid\": \"1\",\n \"uuid\": \"4f342419-e668-4b76-9f87-7ce20c436169\"\n }\n }\n}\nEOD\n ,\n 'expected' => TRUE,\n 'description' => 'Response validation flagged a valid response.',\n ],\n // Test validation failure: no \"type\" in \"data\".\n [\n 'json' => <<<'EOD'\n{\n \"data\": {\n \"id\": \"4f342419-e668-4b76-9f87-7ce20c436169\",\n \"attributes\": {\n \"nid\": \"1\",\n \"uuid\": \"4f342419-e668-4b76-9f87-7ce20c436169\"\n }\n }\n}\nEOD\n ,\n 'expected' => FALSE,\n 'description' => 'Response validation failed to flag an invalid response.',\n ],\n // Test validation failure: \"errors\" at the root level.\n [\n 'json' => <<<'EOD'\n{\n \"data\": {\n \"type\": \"node--article\",\n \"id\": \"4f342419-e668-4b76-9f87-7ce20c436169\",\n \"attributes\": {\n \"nid\": \"1\",\n \"uuid\": \"4f342419-e668-4b76-9f87-7ce20c436169\"\n }\n },\n \"errors\": [{}]\n}\nEOD\n ,\n 'expected' => FALSE,\n 'description' => 'Response validation failed to flag an invalid response.',\n ],\n // Test validation of an empty response passes.\n [\n 'json' => NULL,\n 'expected' => TRUE,\n 'description' => 'Response validation flagged a valid empty response.',\n ],\n // Test validation fails on empty object.\n [\n 'json' => '{}',\n 'expected' => FALSE,\n 'description' => 'Response validation flags empty array as invalid.',\n ],\n ];\n\n $test_cases = array_map(function ($input) use ($defaults) {\n [$json, $expected, $description, $route_name, $resource_type] = array_values($input + $defaults);\n return [\n $this->createRequest($route_name, $resource_type),\n $this->createResponse($json),\n $expected,\n $description,\n ];\n }, $test_data);\n\n return $test_cases;\n }" ]
[ "0.5917254", "0.58860385", "0.5828724", "0.5704555", "0.5642776", "0.55364764", "0.55364764", "0.55023044", "0.5487876", "0.5476067", "0.5457175", "0.54370266", "0.54347104", "0.53679836", "0.5352606", "0.53438467", "0.5340123", "0.53141844", "0.5310807", "0.53002864", "0.52892077", "0.5288528", "0.5274322", "0.52688193", "0.5247333", "0.5200387", "0.5200387", "0.5195857", "0.51934713", "0.5184753" ]
0.58951604
1
Does the string end with the given ending?
private function endsWith($string, $ending) { $length = strlen($ending); if ($length == 0) { return true; } return (substr($string, -$length) === $ending); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ends_with($string,...$end)\n{\n if(!$string)\n return false;\n foreach( $end as $e )\n if( substr($string,strlen($string)-strlen($e)) == $e )\n return true;\n return false;\n}", "function check_str_end(string $string, string $end, int $len, $endLength): bool\n{\n return substr($string, $len - $endLength, $endLength) == $end;\n}", "function str_endsWith (string $str, string $needle): bool {\n\t$strLen = strlen($str);\n\t$needleLen = strlen($needle);\n\treturn (substr($str, $strLen - $needleLen, $needleLen) === $needle);\n}", "function string_ends_with( $haystack, $needle ) {\n\t\treturn substr($haystack, -strlen($needle))===$needle;\n\t}", "function ends_with($haystack, $needle)\n{\n\treturn substr($haystack, -strlen($needle))===$needle;\n}", "function str_endswith($string, $test) {\n $strlen = strlen($string);\n $testlen = strlen($test);\n if ($testlen > $strlen) {\n return false;\n }\n return substr_compare($string, $test, $strlen - $testlen, $testlen) === 0;\n }", "public function isLastPartOfStringReturnsFalseForNotMatchingFirstPartDataProvider() {}", "function ends_with($haystack, $needle) {\r\n $length = strlen($needle);\r\n $start = $length *-1; //negative\r\n return (substr($haystack, $start, $length) === $needle);\r\n}", "public function isLastPartOfStringReturnsTrueForMatchingFirstPartDataProvider() {}", "function ends_with($haystack, $needle) {\n\treturn $needle === substr($haystack, -strlen($needle));\n}", "public static function endsWith($string, $end)\n {\n // Needle cannot be found if needle is longer than haystack.\n if (($offset = strlen($string) - strlen($end)) >= 0) {\n return strpos($string, $end, $offset) === $offset;\n }\n\n return false;\n }", "public static function endsWith($str, $suffix) {\n\t\treturn substr($str, strlen($str) - strlen($suffix)) === $suffix;\n\t}", "function strEndsWith($haystack,$needle){\n\n if(strlen($haystack)<=strlen($needle)){\n return false;\n }\n $pos=stripos($haystack,$needle,0-strlen($needle));\n\n if($pos==(strlen($haystack)-strlen($needle))){\n return true;\n }\n return false;\n}", "function ends_iwith($string,...$end)\n{\n if(!$string)\n return false;\n $string = strtolower($string);\n foreach( $end as $e )\n if( substr($string,strlen($string)-strlen($e)) == strtolower($e) )\n return true;\n return false;\n}", "public function endsWithReturnsFalseForNotMatchingLastPartDataProvider() {}", "public function endsWith($suffix) {\n $other = new Str($suffix, $this->charset);\n\n return mb_strrpos($this->rawString, $suffix, 0, $this->charset) === ($this->length() - $other->length());\n }", "function endsBy(string $haystack, string $needle) : bool\n{\n $length = strlen($needle);\n\n return $length === 0 ||\n (substr($haystack, -$length) === $needle);\n}", "public function endsWithReturnsTrueForMatchingLastPartDataProvider() {}", "function endsWith($haystack, $needle) {\n return $needle === \"\" || strpos($haystack, $needle, strlen($haystack) - strlen($needle)) !== FALSE;\n}", "public function testTrueEndsWith()\n {\n $this->assertTrue(Str::endsWith('foo', 'o'));\n }", "public static function endsWith($haystack, $needle) {\n return (strrpos($haystack, $needle) == (strlen($haystack) - strlen(\n $needle\n )));\n }", "function endsWith($haystack, $needle) {\n\treturn $needle === \"\" || strpos($haystack, $needle, strlen($haystack) - strlen($needle)) !== FALSE;\n}", "function endsWith($haystack, $needle)\n{\n return $needle === \"\" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== FALSE);\n}", "function endsWith($haystack, $needle)\n{\n return $needle === \"\" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== FALSE);\n}", "function endsWith($needle, $haystack)\n{\n $needle = strrev($needle);\n $haystack = strrev($haystack);\n return (strpos($haystack, $needle) === 0);\n}", "public static function stringEndsWith($string, $suffix)\n {\n $str_len = strlen($string);\n $suffix_len = strlen($suffix);\n if ($suffix_len > $str_len) return false;\n return substr_compare($string, $suffix, $str_len - $suffix_len, $suffix_len) === 0;\n }", "public function testFalseEndsWith()\n {\n $this->assertFalse(Str::endsWith('foo', 'y'));\n }", "function endsWith($haystack, $needle) {\n return $needle === \"\" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== FALSE);\n}", "function endsWith($haystack, $needle) {\n return $needle === \"\" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== FALSE);\n}", "function endsWith($haystack, $needle) {\n return $needle === \"\" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== FALSE);\n}" ]
[ "0.8075019", "0.79937583", "0.783031", "0.77522296", "0.77446014", "0.77412206", "0.7707136", "0.7633017", "0.7626689", "0.7624749", "0.7588783", "0.7531934", "0.7489809", "0.74896574", "0.74605316", "0.73864275", "0.7373679", "0.73714787", "0.7369942", "0.7367351", "0.72840846", "0.72799677", "0.72737026", "0.72737026", "0.72719485", "0.7268855", "0.724449", "0.72260475", "0.72260475", "0.72260475" ]
0.8063734
1
Deletes configuration objects whose names start with a given prefix. Given the following configuration object names: node.type.article node.type.page Passing the prefix 'node.type.' will delete the above configuration objects.
public function deleteAll($prefix = '');
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function delete($prefix)\n {\n if (!is_string($prefix) or $prefix === null or $prefix === '') {\n throw new \\InvalidArgumentException(\n \"\\$prefix should be a string and cannot be null or empty\"\n );\n }\n\n $prefix = strtolower($prefix);\n self::namespaces(); // make sure, that self::$namespaces is initialized\n if (isset(self::$namespaces[$prefix])) {\n unset(self::$namespaces[$prefix]);\n }\n }", "public function flushPrefix($prefix)\n\t{\n\t\t$prefix = $this->id_prefix . $prefix;\n\t\t$prefix_like = \"$prefix%\";\n\n\t\ttry {\n\t\t\t$this->db->fetchAll(\"\n\t\t\t\tDELETE FROM cache\n\t\t\t\tWHERE id LIKE ?\n\t\t\t\", array($prefix_like));\n\t\t} catch (\\Exception $e) {\n\t\t\tif (!$this->silence_exceptions) {\n\t\t\t\tthrow $e;\n\t\t\t}\n\t\t}\n\n\t\tforeach (array_keys($this->loaded) as $key) {\n\t\t\tif (strpos($key, $prefix) === 0) {\n\t\t\t\tunset($this->loaded[$key]);\n\t\t\t}\n\t\t}\n\t}", "public static function deletePrefix($prefix)\n {\n return self::pipeline(function ($pipe) use ($prefix) {\n $keys = self::keys($prefix);\n foreach ($keys as $key) {\n $pipe->del($key);\n }\n });\n }", "public static function delete_by_prefix( $prefix = '' ) {\n\t\tif ( empty( $prefix ) ) {\n\t\t\treturn;\n\t\t}\n\t\t$base = static::get_upload_base();\n\n\t\tif ( is_dir( $base ) ) {\n\t\t\t$files = preg_grep( '~^' . $prefix . '.*\\.pdf$~', scandir( $base ) );\n\t\t\tforeach ( $files as $file_name ) {\n\t\t\t\tif ( file_exists( $base . $file_name ) ) {\n\t\t\t\t\t@unlink( $base . $file_name );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function clearByPrefix(string $prefix): bool;", "function acf_remove_array_key_prefix($array, $prefix)\n{\n}", "public function removeTablePrefixes($prefix)\n {\n $connection = $this->entityManager->getConnection();\n $schemaManager = $connection->getSchemaManager();\n $schema = $schemaManager->createSchema();\n // remove table prefixes\n foreach ($this->importTables as $value) {\n if (!$schema->hasTable($prefix . $value)) {\n continue;\n }\n\n $sql = 'RENAME TABLE ' . $prefix . $value . ' TO ' . $value;\n $stmt = $connection->prepare($sql);\n\n try {\n $stmt->execute();\n } catch (\\Exception $e) {\n $this->addFlash('error', $e->getMessage() . $this->__f('There was a problem recognizing the existing Dizkus tables. Please confirm that your prefix match the actual Dizkus tables in the database. (Current prefix loaded as `%s`)', ['%s' => $prefix]));\n\n return false;\n }\n }\n }", "public function deleteCacheByPrefix($prefix)\n {\n $keys = $this->cache->queryKeys($prefix);\n foreach ($keys as $key) {\n $this->deleteCache($key);\n }\n return true;\n }", "public function delete(string $prefix, string $key): void;", "public function clearParams($prefix = '') {\n if (!empty($prefix)) {\n $fields = $this->_rediska->getHashFields($prefix);\n foreach ($fields As $field){\n $this->_rediska->deleteFromHash($prefix, $field);\n }\n return true;\n } else {\n return false;\n }\n }", "public function clearByPrefixes(array $prefixes): bool;", "public function setPrefix($prefix);", "public function clear($cachePrefix)\n {\n foreach ($this->filesystem->keys() as $key) {\n if (false !== strpos($key, DIRECTORY_SEPARATOR)) {\n $this->filesystem->delete($key);\n }\n }\n foreach ($this->filesystem->keys() as $key) {\n $this->filesystem->delete($key);\n }\n }", "public function setPrefix( $prefix );", "public function prefixKey($prefix);", "public function removePrefixFromPath()\n {\n $this->fileStructure->path = $this->getPathWithoutPrefix( $this->fileStructure->path, $this->prefix );\n $this->prefix = \"\";\n }", "abstract protected function deleteConfiguration($name);", "static function detachPrefixKeys($arr_inputs, $prefix = 'openid.')\n\t{\n\t\t$arr_outputs = array();\n\t\t$len = strlen($prefix);\n\t\tforeach ($arr_inputs as $k => $v) {\n\t\t\t$key = ($prefix === substr($k, 0, $len)) ? substr($k, $len) : $k;\n\t\t\t$arr_outputs[$key] = $v;\n\t\t}\n\t\treturn $arr_outputs;\n\t}", "function removeAllByPrefix ($s)\r\n\t{ \r\n if (!($rHandler = opendir($this->sPath))) \r\n return false;\r\n\r\n $l = strlen($s);\r\n while (($sFile = readdir($rHandler)) !== false)\r\n if (0 == strncmp($sFile, $s, $l))\r\n @unlink ($this->sPath . $sFile);\r\n \r\n closedir($rHandler);\r\n\r\n return true;\r\n }", "function cleanPrefixes($array){\n return array_merge($array, Configure::read('appli.CleanPrefixes'));\n }", "public function removeOption($name, $prefix = '')\n\t{\n\t\tif (array_key_exists($prefix . $name, $this->_options)) {\n\t\t\tunset($this->_options[$prefix . $name]);\n\t\t}\n\t}", "public function cleanupUploadDirs($lifetime, $uploadPrefix)\n {\n $uploadDirs = glob(ABSPATH . $uploadPrefix . '*');\n $toDelete = array_filter($uploadDirs, function($dir) {\n return filemtime($dir) < time() - $lifetime * 60 ? true : false;\n });\n\n foreach ($toDelete as $dir) {\n $files = new \\RecursiveIteratorIterator(\n new \\RecursiveDirectoryIterator($dir . '/', \\RecursiveDirectoryIterator::SKIP_DOTS), \\RecursiveIteratorIterator::CHILD_FIRST);\n \n foreach ($files as $file)\n $file->isDir() === true ? rmdir($file->getRealPath()) : unlink($file->getRealPath());\n\n rmdir($dir);\n }\n }", "public function prune()\n {\n $list = $this->metadata->getAllMetadata();\n\n $pruneMappings = $this->client->indices()->getMapping();\n\n # Remove configured mappings from prune list\n foreach ($list as $metadata) {\n $index = $metadata->getIndex();\n $type = $metadata->getType();\n\n unset($pruneMappings[$index]['mappings'][$type]);\n }\n\n # Delete mappings that are not in the configuration\n foreach ($pruneMappings as $index => $indexMapping) {\n foreach ($indexMapping['mappings'] as $type => $typeMapping) {\n try {\n $params = [\n 'index' => $index,\n 'type' => $type\n ];\n\n $response = $this->client->indices()->deleteMapping($params);\n } catch (Exception $exception) {\n $response = [\n 'ok' => false,\n 'error' => $exception->getMessage()\n ];\n } finally {\n $metadata = new MetadataOptions;\n $metadata->setIndex($index);\n $metadata->setType($type);\n\n $this->getEventManager()\n ->trigger('prune', $this, compact('response', 'metadata'));\n }\n }\n }\n }", "function cfg_del(...$args)\n{\n\tglobal $CONFIG;\n\tswitch( count($args) )\n\t{\n\t\tcase 1: unset($CONFIG[$args[0]]); break;\n\t\tcase 2: unset($CONFIG[$args[0]][$args[1]]); break;\n\t\tcase 3: unset($CONFIG[$args[0]][$args[1]][$args[2]]); break;\n\t\tcase 4: unset($CONFIG[$args[0]][$args[1]][$args[2]][$args[3]]); break;\n\t\tcase 5: unset($CONFIG[$args[0]][$args[1]][$args[2]][$args[3]][$args[4]]); break;\n\t\tcase 6: unset($CONFIG[$args[0]][$args[1]][$args[2]][$args[3]][$args[4]][$args[5]]); break;\n\t\tdefault: WdfException::Raise(\"Illegal argument count: \".count($args));\n\t}\n}", "public function preparePrefixes()\n {\n $this->prefixes['route'] = explode('/', config('app-generator.prefixes.route', ''));\n $this->prefixes['path'] = explode('/', config('app-generator.prefixes.path', ''));\n\n if ($prefix = $this->getOption('prefix')) {\n $multiplePrefixes = explode(',', $prefix);\n\n $this->prefixes['route'] = array_merge($this->prefixes['route'], $multiplePrefixes);\n $this->prefixes['path'] = array_merge($this->prefixes['path'], $multiplePrefixes);\n }\n\n $this->prefixes['route'] = array_filter($this->prefixes['route']);\n $this->prefixes['path'] = array_filter($this->prefixes['path']);\n\n $routePrefix = '';\n foreach ($this->prefixes['route'] as $singlePrefix) {\n $routePrefix .= Str::camel($singlePrefix) . '.';\n }\n $this->prefixes['route'] = !empty($routePrefix) ? substr($routePrefix, 0, -1) : $routePrefix;\n\n $namespacePrefix = $pathPrefix = '';\n foreach ($this->prefixes['path'] as $singlePrefix) {\n $namespacePrefix .= Str::title($singlePrefix) . '\\\\';\n $pathPrefix .= Str::title($singlePrefix) . '/';\n }\n\n $this->prefixes['namespace'] = !empty($namespacePrefix) ? substr($namespacePrefix, 0, -1) : $namespacePrefix;\n $this->prefixes['path'] = !empty($pathPrefix) ? substr($pathPrefix, 0, -1) : $pathPrefix;\n }", "public function deleteObsoleteConfigs();", "public function delete( $args, $assoc_args ) {\n\n\t\tlist( $alias ) = $args;\n\n\t\t$config = ( ! empty( $assoc_args['config'] ) ? $assoc_args['config'] : '' );\n\n\t\tlist( $config_path, $aliases ) = $this->get_aliases_data( $config, $alias );\n\n\t\t$this->validate_config_file( $config_path );\n\n\t\tif ( empty( $aliases[ $alias ] ) ) {\n\t\t\tWP_CLI::error( \"No alias found with key '{$alias}'.\" );\n\t\t}\n\n\t\tunset( $aliases[ $alias ] );\n\t\t$this->process_aliases( $aliases, $alias, $config_path, 'Deleted' );\n\n\t}", "public function setPrefix($prefix = \"\") {\n $this->_prefix = !empty($prefix) ? $prefix : '';\n }", "function removeAllByPrefix ($s)\r\n\t{\r\n // not implemented for current cache\r\n return false;\r\n }", "public function setPrefix($prefix) {\n $this->prefix = $prefix;\n }" ]
[ "0.59229916", "0.5854187", "0.58503544", "0.5822707", "0.57871926", "0.552195", "0.5466166", "0.5421459", "0.534045", "0.53156245", "0.5227362", "0.51237273", "0.5120324", "0.49455112", "0.49274817", "0.48961696", "0.48476747", "0.48331958", "0.4800423", "0.4796945", "0.47775134", "0.47315446", "0.47311884", "0.4727132", "0.47259298", "0.47240108", "0.47094852", "0.47050175", "0.46789566", "0.46764022" ]
0.6815704
0
this three functions look for id,amount,account_type from array accounts
function emetteur_account_id() { global $account_type; foreach ($account_type as $key => $accounts) { foreach ($accounts as $key => $account) { if ($account == test_input($_POST["compte_emetteur"])) { return $accounts["id"]; } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function beneficiaire_account_id() {\n global $account_type;\n foreach ($account_type as $key => $accounts) {\n foreach ($accounts as $key => $account) {\n if ($account == test_input($_POST[\"compte_beneficiaire\"])) {\n return $accounts[\"id\"];\n }\n }\n }\n }", "public function getAccounts(){\n $accounts = [];\n foreach ($this->data['Items'] as $account) {\n $newAccount = [];\n $newAccount['accounting_id'] = IndexSanityCheckHelper::indexSanityCheck('UID', $account);\n $newAccount['code'] = IndexSanityCheckHelper::indexSanityCheck('DisplayID', $account);\n $newAccount['name'] = IndexSanityCheckHelper::indexSanityCheck('Name', $account);\n $newAccount['description'] = IndexSanityCheckHelper::indexSanityCheck('Description', $account);\n $newAccount['type'] = IndexSanityCheckHelper::indexSanityCheck('Type', $account);\n\n if (array_key_exists('Type', $account)) {\n if ($account['Type']) {\n $newAccount['is_bank_account'] = ($account['Type'] === 'Bank');\n }\n }\n\n if (array_key_exists('BankingDetails', $account)) {\n if ($account['BankingDetails']) {\n $newAccount['bank_account_number'] = IndexSanityCheckHelper::indexSanityCheck('BankAccountNumber', $account['BankingDetails']);\n }\n }\n\n if (array_key_exists('TaxCode', $account)) {\n if ($account['TaxCode']) {\n $newAccount['tax_type'] = IndexSanityCheckHelper::indexSanityCheck('Code', $account['TaxCode']);\n }\n }\n array_push($accounts, $newAccount);\n }\n\n return $accounts;\n }", "private static function parseAccounts($arr)\n\t{\n\t\t$results = array();\n\t\tif (count($arr) > 0) {\n\t\t\tif (array_key_exists('account', $arr)) {\n\t\t\t\t$accounts = $arr['account'];\n\t\t\t\tforeach ($accounts as $account) {\n\t\t\t\t\t$attr = $account->attributes();\n\t\t\t\t\tif (array_key_exists('account', $account)) {\n\t\t\t\t\t\t$results = array_merge(\n\t\t\t\t\t\t\t$results, self::parseAccounts((array)$account)\n\t\t\t\t\t\t);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t$code = (string)$attr['code'];\n\t\t\t\t\t$name = (string)$attr['name'];\n//\t\t\t\t\tif ($code >= '4000') {\n\t\t\t\t\t\t$results[] = $code;\n//\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$results = array_unique($results);\n\t\t\t\tsort($results);\n\t\t\t}\n\t\t}\n\t\treturn $results;\n\t}", "function selectTransactionsByAccountId($id) {\n $connection = openDb();\n $id = (int) $id;\n\n\n //Using prepared statements and parameterized queries:\n $sql = \"SELECT * FROM transaction_view WHERE SENDER_ACCOUNT = ? OR RECIPIENT_ACCOUNT = ?\";\n $stmt = $connection->stmt_init();\n if(!$stmt->prepare($sql)) {\n return false;\n }\n $stmt->bind_param(\"si\",$id,$id);\n\n return executeQueryPrepared($stmt, $connection);\n}", "public static function getAccountById($account_id){\n $stmt = Dbh::connect() ->PREPARE(\"SELECT * FROM accounts WHERE account_id=?\");\n $stmt->execute([$account_id]);\n $account = array();\n if($stmt->rowCount()){\n while ($row = $stmt->fetch()){\n $account = array(\"id\"=>$row['account_id'], \"email\"=>$row['email'], \"firstName\"=>$row['first_name'], \"lastName\"=>$row['last_name'],\n \"type\"=>$row['account_type'],\"password\"=>$row['password'],\"subscription\"=>$row['subscription']);\n }\n return $account;\n } else {\n\t\t\treturn false;\n\t\t}\n }", "public function CommissionFeeServiceAccordingVendor($type=\"STRIPE\",$account_status=0)\n{\n\t \n\t $orders = Auth::user()->ShopProductCartItemOfVendors;\n $arr =[];\n $account =[];\n\n\t foreach ($orders as $key => $value) {\n\n\t \n\t \t$amount = trim($value->getOrderOfSingleVendor->sum('total')); \n\n $account_id = $type == \"STRIPE\" ? $value->vendor->shop->stripe_account_id : $value->vendor->shop->paypal_email;\n $service_fee = $this->getServiceFee($amount);\n $commission_fee = $this->getCommissionFee($amount);\n\n\n $payable_amount = round($amount - ($service_fee + $commission_fee));\n\n $stripeAccountParams= (array)[\"amount\" => $payable_amount,\"stripe_account\" => $account_id];\n\n array_push($account, $stripeAccountParams);\n\n\t \t$arr[$value->vendor_id] = [\n 'vendor_id' => $value->vendor_id,\n 'total' => $this->getGrandTotal(),\n 'amount' => $amount,\n 'tax' => $this->getTax(),\n 'commission_fee' => $commission_fee,\n 'service_fee' => $service_fee,\n 'payable_amount' => $payable_amount,\n 'account_id' => $account_id,\n 'stripeAccountParams' => $stripeAccountParams\n\t \t];\n\n\n\t \t//array_push($arr[$value->vendor_id], $arr1);\n\t }\n\n\t return $account_status == 0 ? $arr : $account;\n \n}", "public function getAccounts();", "public function findAccounts() {\n\t\t\n\t}", "public function getAccountDetailsByaccountId($accountId)\n {\n $account = Account::where('id', $accountId)->first();\n if(!empty($account)) {\n return ([\n 'flag' => true,\n 'name' => $account->accountDetail->name,\n ]);\n } else {\n return ([\n 'flag' => false\n ]); \n }\n }", "function getAccounts() {\n $stmt = $this->pdo->query('SELECT * FROM get_accounts()');\n $accounts = [];\n while ($row = $stmt->fetch()) {\n $accounts[] = [\n 'id' => $row['id'],\n 'first_name' => $row['first_name'],\n 'last_name' => $row['last_name'],\n 'plan' => $row['plan'],\n 'effective_date' => $row['effective_date']\n ];\n }\n return $accounts;\n }", "public function getFinanceAccount($user_id = null,$payment_type = null)\n {\n $table = Engine_Api::_()->getDbtable('paymentAccounts', 'mp3music');\n $select = $table->select();\n \n if($user_id != null)\n {\n $select->where('user_id = ?',$user_id);\n }\n if($payment_type != null)\n {\n $select->where('payment_type = ?',$payment_type); \n }\n $accounts = $table->fetchAll($select)->toArray(); \n return @$accounts[0]; \n }", "function media_theplatform_mpx_get_accounts_select() {\n // Check for the signIn token.\n $mpx_token = media_theplatform_mpx_variable_get('token', NULL);\n if (!$mpx_token) {\n return t('There was an error with your request.');\n }\n // Get the list of accounts from thePlatform.\n $url = 'http://access.auth.theplatform.com/data/Account?schema=1.3.0&form=json&byDisabled=false&token=' . $mpx_token;\n $result = drupal_http_request($url);\n $result_data = drupal_json_decode($result->data);\n\n global $user;\n\n if (empty($result_data['entryCount']) || $result_data['entryCount'] == 0) {\n $log = array(\n 'uid' => $user->uid,\n 'type' => 'request',\n 'type_id' => NULL,\n 'action' => 'account',\n 'details' => '0 accounts returned.',\n );\n media_theplatform_mpx_insert_log($log);\n //return FALSE;\n drupal_set_message(t('The logged in user does not have the privilege to set the account.'), 'warning');\n return array();\n }\n $accounts = array();\n $accounts_data = array();\n\n foreach ($result_data['entries'] as $entry) {\n $title = $entry['title'];\n $key = rawurlencode($title);\n $accounts[$key] = $title;\n }\n $log = array(\n 'uid' => $user->uid,\n 'type' => 'request',\n 'type_id' => NULL,\n 'action' => 'account',\n 'details' => count($accounts) . ' accounts returned.',\n );\n media_theplatform_mpx_insert_log($log);\n // Sort accounts alphabetically.\n natcasesort($accounts);\n return $accounts;\n}", "protected function getAccountData()\n\t{\n\t\t$db = $this->getDatabase();\n\n\t\t$query = $db->getQuery(true);\n\n\t\t$query->select('*')\n\t\t\t\t->from('#__accountdata')\n\t\t\t\t->where('(w20_facebook <> \"\" OR w20_twitter <> \"\")')\n\t\t\t\t->where('typ = 0')\n\t\t\t\t// ->where('bid IN (2657)')\n\t\t\t\t->where('status = 0');\n\n\n\t\t$db->setQuery($query);\n\t\t$this->adata = $db->loadObjectList();\n\n\t\treturn $this->adata;\n\t}", "private function findAccountByOwner(string $type, int $id)\n {\n return Account::where([\n \"owner_id\" => $id,\n \"owner_type\" => $type\n ])->firstOrFail();\n }", "function getThirdPartyIDThirdPartyAccountAssignment($post_source_account,$status1,$DbConnection)\n {\n $third_party_account_id=array();\n $querydesaid=\"SELECT third_party_account_id from third_party_account_assignment WHERE admin_account_id='$post_source_account' and status='$status1'\";\n $resultdesaid=mysql_query($querydesaid,$DbConnection);\n while($row=mysql_fetch_object($resultdesaid))\n {\n $third_party_account_id[]=$row->third_party_account_id;\n }\n return $third_party_account_id; \n }", "public function get_account_data() {\n return array(\n 'accountId' => $this->accountId,\n 'email' => $this->email,\n 'firstName' => $this->firstName,\n 'lastName' => $this->lastName,\n 'type' => $this->type,\n 'subscription' => $this->subscription\n );\n }", "function transactions_by_type($type){\n\t\t$query = $this->db->query(\"SELECT * FROM transactions WHERE Trans = '$type';\");\n\t\treturn $query->result_array();\n\t}", "public function add_account($id,$balance){\n if(preg_match(\"/^[0-9]+$/\",$id) && preg_match(\"/^[-+]?[0-9]*\\.?[0-9]+$/\",$balance)){\n if(array_key_exists($id,$this->accounts)){\n return 4;\n }else{\n $account = new Account($id,$balance);\n $this->accounts[$account->id] = $account;\n return 0;\n }\n }else{\n return 3;\n }\n }", "function get_user_info($account_id)\n {\n // $query_avg_score=$this->db->query(\"SELECT AVG(score) AS score FROM xl_score WHERE target_id='{$account_id}'\");\n\n $query_avatar_url=$this->db->query(\"SELECT avatar_url AS avatar_url FROM xl_avatar WHERE account_id='{$account_id}'\");\n\n $query_account_info=$this->db->query(\"SELECT id,nickname,cellphone,sex,birthday,horoscope,status,register_user,type FROM xl_account WHERE id='{$account_id}'\");\n\n $arr = array();\n\n foreach($query_account_info->result_array() as $row)\n {\n array_push($arr,$row);\n }\n $user_info=array();\n\n if (count($arr)==0) \n {\n \n return $user_info;\n }\n\n $user_info=$arr[0];\n \n if ($query_avatar_url->num_rows()>0) \n {\n $arr_avatar = array();\n\n foreach($query_avatar_url->result_array() as $row)\n {\n array_push($arr_avatar,$row);\n }\n\n $user_avatar=$arr_avatar[0];\n\n }\n else\n {\n $user_avatar=array('avatar_url' => '', );\n\n }\n\n $user_info=array_merge($user_info, $user_avatar);\n // $user_info=array_merge($user_info,$user_score);\n\n return $user_info;\n \n\n }", "function getAccounts() {\n $stmt = $this->pdo->query('SELECT * FROM get_accounts()');\n $accounts = [];\n while ($row = $stmt->fetch()) {\n $accounts[] = [\n 'id' => $row['id'],\n 'first_name' => $row['first_name'],\n 'last_name' => $row['last_name'],\n 'plan' => $row['plan'],\n 'effective_date' => $row['effective_date']\n ];\n }\n return $accounts;\n }", "function get_pay_type_array() {\n $sql = \"SELECT id, name FROM \".TB_PREF.\"payroll_pay_type\";\n $result = db_query($sql, \"could not get pay rates\");\n $type_array = array();\n while($myrow = db_fetch($result)){\n\t$type_array[$myrow['id']] = $myrow['name'];\n }\n return $type_array;\n}", "public function getAccount();", "public function listAccountIds() //*\n\t{\n\t$this->errorLogging->logInfo(__CLASS__, __METHOD__, \"Called.\");\n\t\n\t$userGroup = $_SESSION[\"usergroup\"];\n\n\t$select_array = array(\n\t\"table\" => 'accounts', \n\t\"where\" => 'WHERE', \n\t\"columns\" => array(\n\t\"account_pk\",\n\t\"account_name\",),\n\t\"returns\" => array(\n\t\"accountPK\",\n\t\"accountName\"),\n\t\"conditions\" => array(\n\t\tarray(\n\t\t\"column\" => \"user_group\",\n\t\t\"operator\" => \"=\",\n\t\t\"value\" => \"$userGroup\",\n\t\t\"concat\" => \"\")\n\t),\n\t\"endingQuery\" => \"\"\n\t);\n\t\n\t$returnedArray = $this->dbConnection->ConstructSelect($select_array); //errors handled by dbase class\n\t$this->responseClass->apiResponse($returnedArray);\n\treturn true;\n\t}", "function get_account_type_by_date($group_id, $from_date, $to_date) {\n $CI = & get_instance();\n $CI->load->helper('traialbalance');\n $CI->load->model('account/report');\n $returnArr = get_opening_balance_cal_by_date($group_id, $from_date, $to_date);\n $opening_balance = 0;\n foreach ($returnArr as $row) {\n if ($row['account_type'] == 'Dr') {\n $opening_balance = $opening_balance + $row['opening_balance'];\n }\n if ($row['account_type'] == 'Cr') {\n $opening_balance = $opening_balance - str_replace('-', '', $row['opening_balance']);\n }\n }\n if ($opening_balance >= 0) {\n return 'Dr';\n }\n if ($opening_balance < 0) {\n return 'Cr';\n }\n}", "public static function getAllAccounts(){\n\t\t$stmt = Dbh::connect()->query(\"SELECT * FROM accounts\");\n\t\t$accounts = array();\n while ($row = $stmt->fetch(PDO::FETCH_ASSOC)){\n $accounts[] = new Account($row['account_id'], $row['email'], $row['first_name'], $row['last_name'], $row['account_type'], $row['password']);\n }\n return $accounts;\n\t}", "private function managedAccountResponse($id)\n {\n return [\n 'id' => $id,\n 'currencies_supported' => [\n 'usd', 'aed', 'afn', '...',\n ],\n 'object' => 'account',\n 'business_name' => 'Stripe.com',\n 'bank_accounts' => [\n 'object' => 'list',\n 'total_count' => 0,\n 'has_more' => false,\n 'url' => '/v1/accounts/' . $id . '/bank_accounts',\n 'data' => [],\n ],\n 'verification' => [\n 'fields_needed' => [\n 'product_description',\n 'business_url',\n 'support_phone',\n 'bank_account',\n 'tos_acceptance.ip',\n 'tos_acceptance.date',\n ],\n 'due_by' => null,\n 'contacted' => false,\n ],\n 'tos_acceptance' => [\n 'ip' => null,\n 'date' => null,\n 'user_agent' => null,\n ],\n 'legal_entity' => [\n 'type' => null,\n 'business_name' => null,\n 'address' => [\n 'line1' => null,\n 'line2' => null,\n 'city' => null,\n 'state' => null,\n 'postal_code' => null,\n 'country' => 'US',\n ],\n 'first_name' => null,\n 'last_name' => null,\n 'additional_owners' => null,\n 'verification' => [\n 'status' => 'unverified',\n 'document' => null,\n 'details' => null,\n ],\n ],\n ];\n }", "function getDetailAllAcIDUIDNext($admin_id1,$DbConnection)\n{\n\t$query =\"SELECT account.account_id,account.user_id FROM account,account_detail USE INDEX(ad_acamdid) WHERE account.user_type='substation' AND account.status=1 and account.account_id=account_detail.account_id AND account_detail.account_admin_id='$admin_id1'\";\n\t$result = mysql_query($query,$DbConnection);\t\n\twhile($row = mysql_fetch_object($result))\n\t{\n\t\t/*$account_id_sub = $row->account_id;\n\t\t$user_id_sub = $row->user_id;*/\n\t\t\n\t\t$data[]=array('account_id_sub'=>$row->account_id,'user_id_sub'=>$row->user_id);\t\n\t}\n\treturn $data;\t\n}", "public function userAccountListJson2(){\n\t\t$user = loggedInUserData();\n\t\t$userID = $user['user_id'];\n\t\t\n\t\t$role \t= $user['role'];\n\n \n\t\t\n\t\t$limit = $this->input->get('length');\n\t\t$start = $this->input->get('start');\n\n\t\t$queryCount = $this->ledger_model->userAccountListCount2();\n\n\t\t$query = $this->ledger_model->userAccountList2($limit, $start);\n\t\t\n\t\t$draw = $this->input->get('draw');\n\n\t\t$data = [];\n\t\t$data['draw'] = $draw;\n\t\t$data['recordsTotal'] = $queryCount;\n\t\t$data['recordsFiltered'] = $queryCount;\n\t\tif($query -> num_rows() > 0) \n\t\t{\t\n\t\tforeach($query->result() as $r)\n\t\t{\n\t\t\t\n\t\t\tif ($r->tran_count != null)\n\t\t\t{\n\t\t\t\t$counts = $r->tran_count;\n\t\t\t}\n\n\t\t\t//Action Button\n\t\t\t$button = '';\n\t\t\t$button .= '<a class=\"btn btn-primary editBtn\" href=\"'.base_url('account/balancesheet_view/'. $r->id).'\" data-toggle=\"tooltip\" title=\"View\">\n\t\t\t\t\t\t<i class=\"fa fa-eye\"></i> </a>';\n\t\t\t//Get Decision who in online?\n if($user['role'] == 'admin')\n {\n\t\t//\t$button .= '<a class=\"btn btn-danger deleteBtn\" id=\"'.$r->id.'\" data-toggle=\"tooltip\" title=\"Delete\">\n\t\t//\t\t\t\t<i class=\"fa fa-trash\"></i> </a>';\n\t\t}\t\n\t\t\n\t\t\n\t\t\t\t$data['data'][] = array(\n\t\t\t\t$button,\n $counts,\n\t\t\t\tdate('d/m/Y h:i A', $r->created_at), //date format\n\t\t\t\tnumber_format($r->debit, 2),\t\n\t\t\t\tnumber_format($r->credit, 2),\t\n\t\t\t\tnumber_format($r->amount, 2),\t\t\n\t\t\t\t$r->points_mode,\t\t\t\t\t\n\t\t\t\t$r->tranx_id\n\t\t\t\t\n\t\t\t);\n\t\t\n\t\t}\n\t\t}\n\t\telse{\n\t\t\t$data['data'][] = array(\n\t\t\t\t'Offer Accounts are not yet updated' , '', '','', '','',''\n\t\t\t);\n\t\t\n\t\t}\n\t\techo json_encode($data);\t\t\n\n\t}", "public function getWhereAccounts($post_id) {\n $return = array();\n $get = array(\n //'limit' => 10,\n 'conditions' => array(array('post_id' => $post_id, 'scheduled' => 1)),\n //'fields' => array('', ''),\n //'order' => array('date'=>'desc')\n );\n //fb users\n $fbusers = $this->FcbUserPosts->find('all', $get);\n if (!empty($fbusers)) {\n foreach ($fbusers as $user) {\n $value = 'fcbuseredit-' . $user['FcbUserPosts']['fcb_uid'];\n array_push($return, $value);\n }\n }\n //fb pages\n $fbpages = $this->FcbPagePosts->find('all', $get);\n if (!empty($fbpages)) {\n foreach ($fbpages as $page) {\n $value = 'fcbpageedit-' . $page['FcbPagePosts']['fcb_uid'] . '-' . $page['FcbPagePosts']['fcb_page_id'];\n array_push($return, $value);\n }\n }\n //twitter\n $twitter = $this->TwUserPosts->find('all', $get);\n if (!empty($twitter)) {\n foreach ($twitter as $account) {\n $value = 'twuseredit-' . $account['TwUserPosts']['tw_uid'];\n array_push($return, $value);\n }\n }\n //return \n return $return;\n }", "function totalAmount_account() {\r\n global $date;\r\n $query = \"SELECT DISTINCT\r\n account AS Account,\r\n (\r\n (\r\n (\r\n SELECT IFNULL(SUM(amount), 0)\r\n FROM record\r\n WHERE acc = Account\r\n AND transaction_type = 'in'\r\n AND date BETWEEN\r\n (\r\n SELECT MIN(date)\r\n FROM record\r\n ) AND '{$date}'\r\n )\r\n +\r\n (\r\n SELECT IFNULL(SUM(amount), 0)\r\n FROM record\r\n WHERE to_acc = Account\r\n AND transaction_type = 'tr'\r\n AND date BETWEEN\r\n (\r\n SELECT MIN(date)\r\n FROM record\r\n ) AND '{$date}'\r\n )\r\n )\r\n -\r\n (\r\n (\r\n SELECT IFNULL(SUM(amount), 0)\r\n FROM record\r\n WHERE acc = Account\r\n AND transaction_type = 'ex'\r\n AND date BETWEEN\r\n (\r\n SELECT MIN(date)\r\n FROM record\r\n ) AND '{$date}'\r\n )\r\n +\r\n (\r\n SELECT IFNULL(SUM(amount), 0)\r\n FROM record\r\n WHERE from_acc = Account\r\n AND transaction_type = 'tr'\r\n AND date BETWEEN\r\n (\r\n SELECT MIN(date)\r\n FROM record\r\n ) AND '{$date}'\r\n )\r\n )\r\n ) AS Remain\r\n FROM account;\";\r\n return fetch($query);\r\n }" ]
[ "0.6595377", "0.6134952", "0.60930204", "0.5779701", "0.57348096", "0.56539696", "0.56191105", "0.5611026", "0.5601746", "0.55570155", "0.5549037", "0.554459", "0.55139583", "0.54715633", "0.54419416", "0.543885", "0.5429928", "0.54044324", "0.5379817", "0.5375252", "0.5372752", "0.5355025", "0.5344065", "0.53327614", "0.53327435", "0.52871037", "0.5287103", "0.52797586", "0.52791685", "0.52755684" ]
0.62901866
1
this three functions look for id,amount,account_type from array accounts
function beneficiaire_account_id() { global $account_type; foreach ($account_type as $key => $accounts) { foreach ($accounts as $key => $account) { if ($account == test_input($_POST["compte_beneficiaire"])) { return $accounts["id"]; } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function emetteur_account_id() {\n global $account_type;\n foreach ($account_type as $key => $accounts) {\n foreach ($accounts as $key => $account) {\n if ($account == test_input($_POST[\"compte_emetteur\"])) {\n return $accounts[\"id\"];\n }\n }\n }\n }", "public function getAccounts(){\n $accounts = [];\n foreach ($this->data['Items'] as $account) {\n $newAccount = [];\n $newAccount['accounting_id'] = IndexSanityCheckHelper::indexSanityCheck('UID', $account);\n $newAccount['code'] = IndexSanityCheckHelper::indexSanityCheck('DisplayID', $account);\n $newAccount['name'] = IndexSanityCheckHelper::indexSanityCheck('Name', $account);\n $newAccount['description'] = IndexSanityCheckHelper::indexSanityCheck('Description', $account);\n $newAccount['type'] = IndexSanityCheckHelper::indexSanityCheck('Type', $account);\n\n if (array_key_exists('Type', $account)) {\n if ($account['Type']) {\n $newAccount['is_bank_account'] = ($account['Type'] === 'Bank');\n }\n }\n\n if (array_key_exists('BankingDetails', $account)) {\n if ($account['BankingDetails']) {\n $newAccount['bank_account_number'] = IndexSanityCheckHelper::indexSanityCheck('BankAccountNumber', $account['BankingDetails']);\n }\n }\n\n if (array_key_exists('TaxCode', $account)) {\n if ($account['TaxCode']) {\n $newAccount['tax_type'] = IndexSanityCheckHelper::indexSanityCheck('Code', $account['TaxCode']);\n }\n }\n array_push($accounts, $newAccount);\n }\n\n return $accounts;\n }", "private static function parseAccounts($arr)\n\t{\n\t\t$results = array();\n\t\tif (count($arr) > 0) {\n\t\t\tif (array_key_exists('account', $arr)) {\n\t\t\t\t$accounts = $arr['account'];\n\t\t\t\tforeach ($accounts as $account) {\n\t\t\t\t\t$attr = $account->attributes();\n\t\t\t\t\tif (array_key_exists('account', $account)) {\n\t\t\t\t\t\t$results = array_merge(\n\t\t\t\t\t\t\t$results, self::parseAccounts((array)$account)\n\t\t\t\t\t\t);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t$code = (string)$attr['code'];\n\t\t\t\t\t$name = (string)$attr['name'];\n//\t\t\t\t\tif ($code >= '4000') {\n\t\t\t\t\t\t$results[] = $code;\n//\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$results = array_unique($results);\n\t\t\t\tsort($results);\n\t\t\t}\n\t\t}\n\t\treturn $results;\n\t}", "function selectTransactionsByAccountId($id) {\n $connection = openDb();\n $id = (int) $id;\n\n\n //Using prepared statements and parameterized queries:\n $sql = \"SELECT * FROM transaction_view WHERE SENDER_ACCOUNT = ? OR RECIPIENT_ACCOUNT = ?\";\n $stmt = $connection->stmt_init();\n if(!$stmt->prepare($sql)) {\n return false;\n }\n $stmt->bind_param(\"si\",$id,$id);\n\n return executeQueryPrepared($stmt, $connection);\n}", "public static function getAccountById($account_id){\n $stmt = Dbh::connect() ->PREPARE(\"SELECT * FROM accounts WHERE account_id=?\");\n $stmt->execute([$account_id]);\n $account = array();\n if($stmt->rowCount()){\n while ($row = $stmt->fetch()){\n $account = array(\"id\"=>$row['account_id'], \"email\"=>$row['email'], \"firstName\"=>$row['first_name'], \"lastName\"=>$row['last_name'],\n \"type\"=>$row['account_type'],\"password\"=>$row['password'],\"subscription\"=>$row['subscription']);\n }\n return $account;\n } else {\n\t\t\treturn false;\n\t\t}\n }", "public function CommissionFeeServiceAccordingVendor($type=\"STRIPE\",$account_status=0)\n{\n\t \n\t $orders = Auth::user()->ShopProductCartItemOfVendors;\n $arr =[];\n $account =[];\n\n\t foreach ($orders as $key => $value) {\n\n\t \n\t \t$amount = trim($value->getOrderOfSingleVendor->sum('total')); \n\n $account_id = $type == \"STRIPE\" ? $value->vendor->shop->stripe_account_id : $value->vendor->shop->paypal_email;\n $service_fee = $this->getServiceFee($amount);\n $commission_fee = $this->getCommissionFee($amount);\n\n\n $payable_amount = round($amount - ($service_fee + $commission_fee));\n\n $stripeAccountParams= (array)[\"amount\" => $payable_amount,\"stripe_account\" => $account_id];\n\n array_push($account, $stripeAccountParams);\n\n\t \t$arr[$value->vendor_id] = [\n 'vendor_id' => $value->vendor_id,\n 'total' => $this->getGrandTotal(),\n 'amount' => $amount,\n 'tax' => $this->getTax(),\n 'commission_fee' => $commission_fee,\n 'service_fee' => $service_fee,\n 'payable_amount' => $payable_amount,\n 'account_id' => $account_id,\n 'stripeAccountParams' => $stripeAccountParams\n\t \t];\n\n\n\t \t//array_push($arr[$value->vendor_id], $arr1);\n\t }\n\n\t return $account_status == 0 ? $arr : $account;\n \n}", "public function getAccounts();", "public function findAccounts() {\n\t\t\n\t}", "public function getAccountDetailsByaccountId($accountId)\n {\n $account = Account::where('id', $accountId)->first();\n if(!empty($account)) {\n return ([\n 'flag' => true,\n 'name' => $account->accountDetail->name,\n ]);\n } else {\n return ([\n 'flag' => false\n ]); \n }\n }", "function getAccounts() {\n $stmt = $this->pdo->query('SELECT * FROM get_accounts()');\n $accounts = [];\n while ($row = $stmt->fetch()) {\n $accounts[] = [\n 'id' => $row['id'],\n 'first_name' => $row['first_name'],\n 'last_name' => $row['last_name'],\n 'plan' => $row['plan'],\n 'effective_date' => $row['effective_date']\n ];\n }\n return $accounts;\n }", "public function getFinanceAccount($user_id = null,$payment_type = null)\n {\n $table = Engine_Api::_()->getDbtable('paymentAccounts', 'mp3music');\n $select = $table->select();\n \n if($user_id != null)\n {\n $select->where('user_id = ?',$user_id);\n }\n if($payment_type != null)\n {\n $select->where('payment_type = ?',$payment_type); \n }\n $accounts = $table->fetchAll($select)->toArray(); \n return @$accounts[0]; \n }", "function media_theplatform_mpx_get_accounts_select() {\n // Check for the signIn token.\n $mpx_token = media_theplatform_mpx_variable_get('token', NULL);\n if (!$mpx_token) {\n return t('There was an error with your request.');\n }\n // Get the list of accounts from thePlatform.\n $url = 'http://access.auth.theplatform.com/data/Account?schema=1.3.0&form=json&byDisabled=false&token=' . $mpx_token;\n $result = drupal_http_request($url);\n $result_data = drupal_json_decode($result->data);\n\n global $user;\n\n if (empty($result_data['entryCount']) || $result_data['entryCount'] == 0) {\n $log = array(\n 'uid' => $user->uid,\n 'type' => 'request',\n 'type_id' => NULL,\n 'action' => 'account',\n 'details' => '0 accounts returned.',\n );\n media_theplatform_mpx_insert_log($log);\n //return FALSE;\n drupal_set_message(t('The logged in user does not have the privilege to set the account.'), 'warning');\n return array();\n }\n $accounts = array();\n $accounts_data = array();\n\n foreach ($result_data['entries'] as $entry) {\n $title = $entry['title'];\n $key = rawurlencode($title);\n $accounts[$key] = $title;\n }\n $log = array(\n 'uid' => $user->uid,\n 'type' => 'request',\n 'type_id' => NULL,\n 'action' => 'account',\n 'details' => count($accounts) . ' accounts returned.',\n );\n media_theplatform_mpx_insert_log($log);\n // Sort accounts alphabetically.\n natcasesort($accounts);\n return $accounts;\n}", "protected function getAccountData()\n\t{\n\t\t$db = $this->getDatabase();\n\n\t\t$query = $db->getQuery(true);\n\n\t\t$query->select('*')\n\t\t\t\t->from('#__accountdata')\n\t\t\t\t->where('(w20_facebook <> \"\" OR w20_twitter <> \"\")')\n\t\t\t\t->where('typ = 0')\n\t\t\t\t// ->where('bid IN (2657)')\n\t\t\t\t->where('status = 0');\n\n\n\t\t$db->setQuery($query);\n\t\t$this->adata = $db->loadObjectList();\n\n\t\treturn $this->adata;\n\t}", "private function findAccountByOwner(string $type, int $id)\n {\n return Account::where([\n \"owner_id\" => $id,\n \"owner_type\" => $type\n ])->firstOrFail();\n }", "function getThirdPartyIDThirdPartyAccountAssignment($post_source_account,$status1,$DbConnection)\n {\n $third_party_account_id=array();\n $querydesaid=\"SELECT third_party_account_id from third_party_account_assignment WHERE admin_account_id='$post_source_account' and status='$status1'\";\n $resultdesaid=mysql_query($querydesaid,$DbConnection);\n while($row=mysql_fetch_object($resultdesaid))\n {\n $third_party_account_id[]=$row->third_party_account_id;\n }\n return $third_party_account_id; \n }", "public function get_account_data() {\n return array(\n 'accountId' => $this->accountId,\n 'email' => $this->email,\n 'firstName' => $this->firstName,\n 'lastName' => $this->lastName,\n 'type' => $this->type,\n 'subscription' => $this->subscription\n );\n }", "function transactions_by_type($type){\n\t\t$query = $this->db->query(\"SELECT * FROM transactions WHERE Trans = '$type';\");\n\t\treturn $query->result_array();\n\t}", "public function add_account($id,$balance){\n if(preg_match(\"/^[0-9]+$/\",$id) && preg_match(\"/^[-+]?[0-9]*\\.?[0-9]+$/\",$balance)){\n if(array_key_exists($id,$this->accounts)){\n return 4;\n }else{\n $account = new Account($id,$balance);\n $this->accounts[$account->id] = $account;\n return 0;\n }\n }else{\n return 3;\n }\n }", "function get_user_info($account_id)\n {\n // $query_avg_score=$this->db->query(\"SELECT AVG(score) AS score FROM xl_score WHERE target_id='{$account_id}'\");\n\n $query_avatar_url=$this->db->query(\"SELECT avatar_url AS avatar_url FROM xl_avatar WHERE account_id='{$account_id}'\");\n\n $query_account_info=$this->db->query(\"SELECT id,nickname,cellphone,sex,birthday,horoscope,status,register_user,type FROM xl_account WHERE id='{$account_id}'\");\n\n $arr = array();\n\n foreach($query_account_info->result_array() as $row)\n {\n array_push($arr,$row);\n }\n $user_info=array();\n\n if (count($arr)==0) \n {\n \n return $user_info;\n }\n\n $user_info=$arr[0];\n \n if ($query_avatar_url->num_rows()>0) \n {\n $arr_avatar = array();\n\n foreach($query_avatar_url->result_array() as $row)\n {\n array_push($arr_avatar,$row);\n }\n\n $user_avatar=$arr_avatar[0];\n\n }\n else\n {\n $user_avatar=array('avatar_url' => '', );\n\n }\n\n $user_info=array_merge($user_info, $user_avatar);\n // $user_info=array_merge($user_info,$user_score);\n\n return $user_info;\n \n\n }", "function getAccounts() {\n $stmt = $this->pdo->query('SELECT * FROM get_accounts()');\n $accounts = [];\n while ($row = $stmt->fetch()) {\n $accounts[] = [\n 'id' => $row['id'],\n 'first_name' => $row['first_name'],\n 'last_name' => $row['last_name'],\n 'plan' => $row['plan'],\n 'effective_date' => $row['effective_date']\n ];\n }\n return $accounts;\n }", "function get_pay_type_array() {\n $sql = \"SELECT id, name FROM \".TB_PREF.\"payroll_pay_type\";\n $result = db_query($sql, \"could not get pay rates\");\n $type_array = array();\n while($myrow = db_fetch($result)){\n\t$type_array[$myrow['id']] = $myrow['name'];\n }\n return $type_array;\n}", "public function getAccount();", "public function listAccountIds() //*\n\t{\n\t$this->errorLogging->logInfo(__CLASS__, __METHOD__, \"Called.\");\n\t\n\t$userGroup = $_SESSION[\"usergroup\"];\n\n\t$select_array = array(\n\t\"table\" => 'accounts', \n\t\"where\" => 'WHERE', \n\t\"columns\" => array(\n\t\"account_pk\",\n\t\"account_name\",),\n\t\"returns\" => array(\n\t\"accountPK\",\n\t\"accountName\"),\n\t\"conditions\" => array(\n\t\tarray(\n\t\t\"column\" => \"user_group\",\n\t\t\"operator\" => \"=\",\n\t\t\"value\" => \"$userGroup\",\n\t\t\"concat\" => \"\")\n\t),\n\t\"endingQuery\" => \"\"\n\t);\n\t\n\t$returnedArray = $this->dbConnection->ConstructSelect($select_array); //errors handled by dbase class\n\t$this->responseClass->apiResponse($returnedArray);\n\treturn true;\n\t}", "function get_account_type_by_date($group_id, $from_date, $to_date) {\n $CI = & get_instance();\n $CI->load->helper('traialbalance');\n $CI->load->model('account/report');\n $returnArr = get_opening_balance_cal_by_date($group_id, $from_date, $to_date);\n $opening_balance = 0;\n foreach ($returnArr as $row) {\n if ($row['account_type'] == 'Dr') {\n $opening_balance = $opening_balance + $row['opening_balance'];\n }\n if ($row['account_type'] == 'Cr') {\n $opening_balance = $opening_balance - str_replace('-', '', $row['opening_balance']);\n }\n }\n if ($opening_balance >= 0) {\n return 'Dr';\n }\n if ($opening_balance < 0) {\n return 'Cr';\n }\n}", "public static function getAllAccounts(){\n\t\t$stmt = Dbh::connect()->query(\"SELECT * FROM accounts\");\n\t\t$accounts = array();\n while ($row = $stmt->fetch(PDO::FETCH_ASSOC)){\n $accounts[] = new Account($row['account_id'], $row['email'], $row['first_name'], $row['last_name'], $row['account_type'], $row['password']);\n }\n return $accounts;\n\t}", "private function managedAccountResponse($id)\n {\n return [\n 'id' => $id,\n 'currencies_supported' => [\n 'usd', 'aed', 'afn', '...',\n ],\n 'object' => 'account',\n 'business_name' => 'Stripe.com',\n 'bank_accounts' => [\n 'object' => 'list',\n 'total_count' => 0,\n 'has_more' => false,\n 'url' => '/v1/accounts/' . $id . '/bank_accounts',\n 'data' => [],\n ],\n 'verification' => [\n 'fields_needed' => [\n 'product_description',\n 'business_url',\n 'support_phone',\n 'bank_account',\n 'tos_acceptance.ip',\n 'tos_acceptance.date',\n ],\n 'due_by' => null,\n 'contacted' => false,\n ],\n 'tos_acceptance' => [\n 'ip' => null,\n 'date' => null,\n 'user_agent' => null,\n ],\n 'legal_entity' => [\n 'type' => null,\n 'business_name' => null,\n 'address' => [\n 'line1' => null,\n 'line2' => null,\n 'city' => null,\n 'state' => null,\n 'postal_code' => null,\n 'country' => 'US',\n ],\n 'first_name' => null,\n 'last_name' => null,\n 'additional_owners' => null,\n 'verification' => [\n 'status' => 'unverified',\n 'document' => null,\n 'details' => null,\n ],\n ],\n ];\n }", "function getDetailAllAcIDUIDNext($admin_id1,$DbConnection)\n{\n\t$query =\"SELECT account.account_id,account.user_id FROM account,account_detail USE INDEX(ad_acamdid) WHERE account.user_type='substation' AND account.status=1 and account.account_id=account_detail.account_id AND account_detail.account_admin_id='$admin_id1'\";\n\t$result = mysql_query($query,$DbConnection);\t\n\twhile($row = mysql_fetch_object($result))\n\t{\n\t\t/*$account_id_sub = $row->account_id;\n\t\t$user_id_sub = $row->user_id;*/\n\t\t\n\t\t$data[]=array('account_id_sub'=>$row->account_id,'user_id_sub'=>$row->user_id);\t\n\t}\n\treturn $data;\t\n}", "public function userAccountListJson2(){\n\t\t$user = loggedInUserData();\n\t\t$userID = $user['user_id'];\n\t\t\n\t\t$role \t= $user['role'];\n\n \n\t\t\n\t\t$limit = $this->input->get('length');\n\t\t$start = $this->input->get('start');\n\n\t\t$queryCount = $this->ledger_model->userAccountListCount2();\n\n\t\t$query = $this->ledger_model->userAccountList2($limit, $start);\n\t\t\n\t\t$draw = $this->input->get('draw');\n\n\t\t$data = [];\n\t\t$data['draw'] = $draw;\n\t\t$data['recordsTotal'] = $queryCount;\n\t\t$data['recordsFiltered'] = $queryCount;\n\t\tif($query -> num_rows() > 0) \n\t\t{\t\n\t\tforeach($query->result() as $r)\n\t\t{\n\t\t\t\n\t\t\tif ($r->tran_count != null)\n\t\t\t{\n\t\t\t\t$counts = $r->tran_count;\n\t\t\t}\n\n\t\t\t//Action Button\n\t\t\t$button = '';\n\t\t\t$button .= '<a class=\"btn btn-primary editBtn\" href=\"'.base_url('account/balancesheet_view/'. $r->id).'\" data-toggle=\"tooltip\" title=\"View\">\n\t\t\t\t\t\t<i class=\"fa fa-eye\"></i> </a>';\n\t\t\t//Get Decision who in online?\n if($user['role'] == 'admin')\n {\n\t\t//\t$button .= '<a class=\"btn btn-danger deleteBtn\" id=\"'.$r->id.'\" data-toggle=\"tooltip\" title=\"Delete\">\n\t\t//\t\t\t\t<i class=\"fa fa-trash\"></i> </a>';\n\t\t}\t\n\t\t\n\t\t\n\t\t\t\t$data['data'][] = array(\n\t\t\t\t$button,\n $counts,\n\t\t\t\tdate('d/m/Y h:i A', $r->created_at), //date format\n\t\t\t\tnumber_format($r->debit, 2),\t\n\t\t\t\tnumber_format($r->credit, 2),\t\n\t\t\t\tnumber_format($r->amount, 2),\t\t\n\t\t\t\t$r->points_mode,\t\t\t\t\t\n\t\t\t\t$r->tranx_id\n\t\t\t\t\n\t\t\t);\n\t\t\n\t\t}\n\t\t}\n\t\telse{\n\t\t\t$data['data'][] = array(\n\t\t\t\t'Offer Accounts are not yet updated' , '', '','', '','',''\n\t\t\t);\n\t\t\n\t\t}\n\t\techo json_encode($data);\t\t\n\n\t}", "public function getWhereAccounts($post_id) {\n $return = array();\n $get = array(\n //'limit' => 10,\n 'conditions' => array(array('post_id' => $post_id, 'scheduled' => 1)),\n //'fields' => array('', ''),\n //'order' => array('date'=>'desc')\n );\n //fb users\n $fbusers = $this->FcbUserPosts->find('all', $get);\n if (!empty($fbusers)) {\n foreach ($fbusers as $user) {\n $value = 'fcbuseredit-' . $user['FcbUserPosts']['fcb_uid'];\n array_push($return, $value);\n }\n }\n //fb pages\n $fbpages = $this->FcbPagePosts->find('all', $get);\n if (!empty($fbpages)) {\n foreach ($fbpages as $page) {\n $value = 'fcbpageedit-' . $page['FcbPagePosts']['fcb_uid'] . '-' . $page['FcbPagePosts']['fcb_page_id'];\n array_push($return, $value);\n }\n }\n //twitter\n $twitter = $this->TwUserPosts->find('all', $get);\n if (!empty($twitter)) {\n foreach ($twitter as $account) {\n $value = 'twuseredit-' . $account['TwUserPosts']['tw_uid'];\n array_push($return, $value);\n }\n }\n //return \n return $return;\n }", "public function getAmounts(): array{\r\n $amounts = array();\r\n $con = $this->db->getConnection();\r\n foreach(mysqli_query($con, 'SELECT * FROM amounts')as $key){ $amounts[$key['idamounts']] = $key['amount']; }\r\n return $amounts;\r\n $this->con->closeConnection();\r\n }" ]
[ "0.6289802", "0.6134071", "0.609225", "0.5778751", "0.57343304", "0.5654055", "0.561856", "0.5610239", "0.56008947", "0.55561996", "0.55483097", "0.55452555", "0.5513649", "0.54710156", "0.5441734", "0.5439063", "0.54292583", "0.5402549", "0.53785807", "0.53743976", "0.5373095", "0.53530794", "0.53450924", "0.53326464", "0.5331831", "0.5288897", "0.52869457", "0.5280374", "0.5278823", "0.5274113" ]
0.659521
0
/ the constructor loads the necessary core files and classes, and creates a router instance
public function __construct() { $this->loadCoreClasses(); $this->router = new Router(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct()\n {\n $this->uri = Fly::app()->getUri();\n Fly::log('debug', \"Router Class Initialized\");\n $this->setRouting();\n }", "function __construct()\n {\n $routesPath = ROOT . '/core/config/routes.php';\n if (file_exists($routesPath)) {\n $this->routes = include_once($routesPath);\n } else {\n die('error');\n }\n }", "public function __construct()\n\t{\n\t\t$this->CI =& get_instance();\n\t\t$this->route_stack = array('', '', '', '');\n\t\tlog_message('debug', 'Router Class Initialized');\n\t}", "function __construct(){\r\n $parser = new Shumvc_RouteParser();\r\n $this->routes = $parser->getRoutes();\r\n }", "public function __construct()\r\n {\r\n $routesPath = ROOT . 'config/routes.php';\r\n $this->routes = include($routesPath);\r\n }", "function __construct() {\n global $urlpatterns,$errorhandler;\n //Initialize config object\n $this->config=new Config();\n //Get all URLs Routes\n $this->routes=$this->config->urlpatterns;\n //Get all ErrorHandler\n $this->error_routes=$this->config->errorhandler;\n //Check for server error\n $this->server_error();\n //Route URLs\n $this->router($this->config->request_path, $this->routes);\n }", "public function __construct()\r\n {\r\n Zend_Loader::registerAutoload();\r\n $this->_frontController = Zend_Controller_Front::getInstance();\r\n $this->_router = $this->_frontController->getRouter();\r\n }", "public function __construct()\n\t{\n\t\tself::$classRouter\t= RecursiveRouter::class;\n\t\tself::$configFile\t= \"config/config.ini\";\n\t\t$this->detectSelf( FALSE );\n\t\t$this->uri\t= getCwd().'/';\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// hack for console jobs\n\t\t$this->initClock();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// setup clock\n\t\t$this->initConfiguration();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// setup configuration\n\t\t$this->initModules();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// setup module support\n\t\t$this->initDatabase();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// setup database connection\n\t\t$this->initCache();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// setup cache support\n\t\t$this->initRequest();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// setup HTTP request handler\n\t\t$this->initResponse();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// setup HTTP response handler\n\t\t$this->initRouter();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// setup request router\n\t\t$this->initLanguage();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// [DO NOT] setup language support\n\t\t$this->initPage();\n\t\t$this->__onInit();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// call init event (implemented by extending classes)\n\t\tif( $this->getModules()->has( 'Resource_Database' ) )\n\t\t\t$this->dbc->query( 'SET NAMES \"utf8\"' );\t\t\t\t\t\t\t\t\t\t\t\t// ...\n\t}", "private function __construct() {\n\n /**\n * Throw an exception if we are trying to create\n * a second instance of the router class.\n */\n if (self::$instance != null) {\n throw new Exception('Cannot create multiple router instances.');\n }\n\n $this->registry = Registry::getInstance();\n\n request::parseRequest();\n $this->route = request::getRoute();\n\n }", "public function __construct()\n {\n $this->route = new \\Janrain\\Union\\Lib\\Route;\n }", "public function __construct() {\r\n $host = $_SERVER['HTTP_HOST'];\r\n $this->routes['default'] = \"http://$host/index.php\";\r\n $this->routes['login'] = \"http://$host/login.php\";\r\n }", "public function __construct() {\n // Initialisation du mappage du site\n if ($this->router === false) {\n $router = new Router();\n $router->map();\n $this->router = true;\n }\n // On récupère l'URL et on la traite\n $this->request = new Request();\n $this->request = new Router($this->request->url);\n $this->request = $this->request->request;\n // On appelle soit le controlleur soit une page d'erreur\n $controller = $this->loadController();\n $action = $this->request['action']; \n if (class_exists($controller) && in_array($action, get_class_methods($controller))) {\n call_user_func_array(array(new $controller, $action), $this->request['params']);\n } else {\n Router::error(); \n } \n }", "public function bootstrapRouter()\n {\n $this->router = new Router($this);\n }", "protected function initRouter()\n {\n $xml = new \\DOMDocument;\n $xml->load(ROOT_DIR . '/configs/routing.xml');\n\n $routes = $xml->getElementsByTagName('route');\n\n $routeList = new RouteList();\n\n /** @var $DOMRoute DOMElement */\n foreach ($routes as $DOMRoute) {\n $attrController = $DOMRoute->getAttribute('controller');\n list($controller, $action) = explode('::', $attrController);\n\n /** @var Route $route */\n $route =\n new Route(\n $DOMRoute->getAttribute('path'),\n $controller,\n $action\n );\n\n if ($DOMRoute->hasChildNodes()) {\n /** @var \\DOMElement $node */\n $requirements = [];\n foreach ($DOMRoute->childNodes as $node) {\n if ($node->nodeType === XML_ELEMENT_NODE && $node->nodeName === \"requirement\") {\n $requirements[$node->getAttribute('key')] = $node->nodeValue;\n }\n if ($node->nodeType === XML_ELEMENT_NODE && $node->nodeName === \"condition\") {\n $route->setCondition($node->nodeValue);\n }\n }\n $route->setRequirements($requirements);\n }\n\n $routeList->offsetSet(\n $DOMRoute->getAttribute('id'),\n $route\n );\n }\n\n $this->router = new Router($routeList);\n }", "protected function _initLoadRouter(){\r\n\t}", "function __construct()\n\t{\n\t\t$this->load = new Load();\n\t\t$this->model = new Model();\n\n\t\t$this->home();\n\t}", "protected static function createRouter() {\n\t\tstatic::$router = new Router();\n\t}", "private function initRouter()\n {\n $this->di->mapService('core.router', '\\Core\\Router\\Router');\n\n $this->router = $this->di->get('core.router');\n $this->router->setBaseUrl(BASEURL);\n $this->router->setParametersToTarget([\n 'app',\n 'controller',\n 'action'\n ]);\n $this->router->addMatchTypes([\n 'mvc' => '[A-Za-z0-9_]++'\n ]);\n\n // Generic routes\n $routes = [\n 'index' => [\n 'route' => '/[mvc:app]/[mvc:controller]',\n 'target' => [\n 'action' => 'index'\n ]\n ],\n 'action' => [\n 'route' => '/[mvc:app]/[mvc:controller]/[mvc:action]'\n ],\n 'id' => [\n 'route' => '/[mvc:app]/[mvc:controller]/[i:id]?/[mvc:action]'\n ],\n 'child' => [\n 'route' => '/[mvc:app]/[mvc:controller]/[i:id]?/[mvc:action]/of/[i:id_parent]'\n ]\n ];\n\n foreach ($routes as $name => $route) {\n $this->router->map($route['method'] ?? 'GET|POST', $route['route'], $route['target'] ?? [], 'generic.' . $name);\n }\n }", "private function __construct() {\n require_once CORE_LIBRARY . 'CoreAutoloader.php';\n\n // instantiate core-class objects\n $this->autoloader = new CoreAutoloader();\n $this->config = CoreConfig::instance();\n $this->uri = CoreUri::instance();\n $this->message = CoreMessage::instance();\n }", "public function __construct(Router $router)\n {\n //Set the variables\n $this->router = $router;\n }", "public function __construct () {\n $this->router = new \\Skeletal\\Router\\Router();\n $this->session = new Session();\n \n $this->onNotFound = function ( $svc, $req ) {\n return (new Response())->text( '404 - Not Found' )->code(404);\n };\n $this->onException = function ( $svc, $req, $ex ) {\n return (new Response())->serverError()->text( '500 - Server Error' );\n };\n }", "public function __construct() {\n\t\t$this->getRoutes = array();\n\t\t$this->postRoutes = array();\n\t}", "public function __construct()\n {\n $this->checkRequestType($_SERVER['REQUEST_METHOD']);\n\n $this->setRoute();\n\n $this->executeRoute();\n }", "function __construct($a)\n {\n $this->RootDIR = $a . '/';\n \n // Load the config file\n $this->LoadConfigFile();\n \n // Get the autoloaders working\n $this->SetUpAutoLoaders();\n \n // Load classes into this object\n $this->LoadClasses();\n \n // Setup Smarty\n $this->SmartySetup();\n \n // Route the traffic\n $this->Router->RouteTraffic();\n }", "protected function _createRouter(){\n\t\treturn new SimpleRouter();\n\t}", "public function router()\n {\n // Initializing variables\n LSReqenvironment::initialize();\n }", "public function __construct()\n {\n $this->routes = array();\n }", "public function __construct(){\n $this->findRoute();\n }", "protected function _initRouter()\n {\n $front = Zend_Controller_Front::getInstance();\n $router = $front->getRouter();\n \n // Add some routes\n $router->addRoute('routeId', new Zend_Controller_Router_Route('route/definition/:param'));\n //...\n \n // Returns the router resource to bootstrap resource registry\n return $router;\n }", "public function init()\n\t{\n\t\t$this->loader->init();\n\t\t$this->routing->init();\n\t}" ]
[ "0.8297344", "0.788802", "0.7747912", "0.7725001", "0.77034354", "0.77000535", "0.76570654", "0.76074505", "0.7605644", "0.7557966", "0.7504764", "0.74951476", "0.7449673", "0.74465173", "0.7301544", "0.7273089", "0.7268058", "0.7231878", "0.72175306", "0.72009236", "0.7188815", "0.7161417", "0.7128109", "0.70756924", "0.7052148", "0.70489895", "0.704416", "0.70025414", "0.698841", "0.69520164" ]
0.88063747
0
/ validates if a controller path exists and is readable
protected function validController($path) { return file_exists($path) && is_readable($path); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static function checkControllerIsExist () {\n\t\tif ( !isset(self::$url[0]))\n\t\t\treturn false ;\n\t\t$controller = trim(self::$url[0]);\n\t\tif ( !empty($controller)) {\n\t\t\t$controllerPatch = self::$appPatch.self::$app.DIRECTORY_SEPARATOR . 'controller' . DIRECTORY_SEPARATOR . $controller . '.php' ;\n\t\t\tif (file_exists($controllerPatch)) {\n\t\t\t\tif (class_exists('App\\\\'.self::$app.'\\controller\\\\'.$controller)) {\n\t\t\t\t\tarray_shift(self::$url);\n\t\t\t\t\tif ( ! self::checkAppIsInstalled(self::$app,false) ){\n\t\t\t\t\t\tself::$app = 'core';\n\t\t\t\t\t\tself::$controller = 'httpErrorHandler';\n\t\t\t\t\t\tself::$method = 'E404';\n\t\t\t\t\t\treturn false ;\n\t\t\t\t\t}\n\t\t\t\t\tself::$controller = $controller;\n\t\t\t\t\treturn true ;\n\t\t\t\t} else {\n\t\t\t\t\tself::$app = 'core';\n\t\t\t\t\tself::$controller = 'httpErrorHandler';\n\t\t\t\t\tself::$method = 'E404';\n\t\t\t\t\treturn false ;\n\t\t\t\t}\n\t\t\t} elseif ( is_dir(self::$appPatch.self::$app )) {\n\t\t\t\t$files = file::get_files_by_pattern(self::$appPatch,'*'.DIRECTORY_SEPARATOR.'app_provider'.DIRECTORY_SEPARATOR.self::$app.DIRECTORY_SEPARATOR.$controller.'.php');\n\t\t\t\tif ( is_array($files) and count($files) > 0 ){\n\t\t\t\t\t$appProvider = strings::deleteWordFirstString(strings::deleteWordLastString($files[0] ,DIRECTORY_SEPARATOR.'app_provider'.DIRECTORY_SEPARATOR.self::$app.DIRECTORY_SEPARATOR.$controller.'.php'),self::$appPatch);\n\t\t\t\t\tif (class_exists('App\\\\'.$appProvider.'\\app_provider\\\\'.self::$app.'\\\\'.$controller)) {\n\t\t\t\t\t\tarray_shift(self::$url);\n\t\t\t\t\t\tif ( ! self::checkAppIsInstalled($appProvider,true) or ! self::checkAppIsInstalled(self::$app,false) ){\n\t\t\t\t\t\t\tself::$app = 'core';\n\t\t\t\t\t\t\tself::$controller = 'httpErrorHandler';\n\t\t\t\t\t\t\tself::$method = 'E404';\n\t\t\t\t\t\t\treturn false ;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tself::$controller = $controller;\n\t\t\t\t\t\tself::$appProvider = $appProvider;\n\t\t\t\t\t\treturn true ;\n\t\t\t\t\t}\n\t\t\t\t} else\n\t\t\t\t\treturn false ;\n\t\t\t}\n\t\t}\n\t\treturn true ;\n\t}", "public function checkRoute(){\n $pathController = \"../app/controllers/\".$this->controllerName.\".class.php\";\n\n if( !file_exists($pathController) ){\n //echo \"Le fichier du controller n'existe pas\";\n return false;\n }\n include $pathController;\n\n if ( !class_exists($this->controllerName) ){\n //echo \"Le fichier du controller existe mais il n'y a pas de classe\";\n return false;\n }\n if( !method_exists($this->controllerName, $this->actionName) ){\n //echo \"L'action n'existe pas\";\n return false;\n }\n return true;\n }", "function check_path($controller, $action)\n {\n if(!method_exists($controller, $action)){\n $controller = $config['error_controller'];\n require_once(APP_DIR . 'controllers/' . $controller . '.php');\n $action = 'index';\n }\n }", "public function checkControllerExists(string $controller)\n {\n if(!class_exists($this->ctlrStrSrc.$controller))\n {\n die(\"Defined Controller doesn't exists\");\n }\n }", "private function _loadExistingController()\r\n {\r\n $file = $this->_controller_path . $this->_url[0] . '.php';\r\n if (file_exists($file)) {\r\n require_once $file;\r\n $this->_controller = new $this->_url[0];\r\n $this->_controller->loadModel($this->_url[0],$this->_model_path);\r\n } else {\r\n $this->_error();\r\n return FALSE;\r\n //throw new Exception(\"The file $file does not exist\"); \r\n }\r\n }", "private function _loadExistingController(){\n\t\t$file = $this->_controllerPath . $this->_url[0] . '.php';\n\t\tif (file_exists($file)) {\n\t\t\trequire $file;\n\t\t\t$this->_controller = new $this->_url[0];\n\t\t $this->_controller->loadModel($this->_url[0], $this->_modelPath);\n\t\t} else {\n\t\t\t$this->_error();\n\t\t\treturn false;\n\t\t}\t\t\n\t}", "public function GetControllerHasAbsoluteNamespace ();", "function _validate_request($segments)\n\t{\n\t\t//return parent::_validate_request($segments);\n\t\t$o_segments=$segments;\n\t\t// Does the requested controller exist in the root folder?\n\t\tif (file_exists(APPPATH.'controllers/'.$segments[0].EXT))\n\t\t{\n\t\t\treturn $segments;\n\t\t}\n \n\t\t// Is the controller in a sub-folder?\n\t\tif (is_dir(APPPATH.'controllers/'.$segments[0]))\n\t\t{\t\t\n\t\t\t// Set the directory and remove it from the segment array\n\t\t\t$this->set_directory($segments[0]);\n\t\t\t$segments = array_slice($segments, 1);\n \n \t\t\t//search multi-level deep folders\n\t\t\twhile(count($segments) > 0 && is_dir(APPPATH.'controllers/'.$this->directory.$segments[0]))\n {\n\t\t\t\techo \"X\";\n\t\t\t\t// Set the directory and remove it from the segment array\n\t\t\t\t$this->set_directory($this->directory . $segments[0]);\n\t\t\t\t$segments = array_slice($segments, 1);\n }\n \n\t\t\tif (count($segments) > 0)\n\t\t\t{\n\t\t\t\t// Does the requested controller exist in the sub-folder?\n\t\t\t\tif ( ! file_exists(APPPATH.'controllers/'.$this->fetch_directory().$segments[0].EXT))\n\t\t\t\t{\n\t\t\t\t\treturn parent::_validate_request($o_segments);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->set_class($this->default_controller);\n\t\t\t\t$this->set_method('index');\n \n\t\t\t\t// Does the default controller exist in the sub-folder?\n\t\t\t\tif ( ! file_exists(APPPATH.'controllers/'.$this->fetch_directory().$this->default_controller.EXT))\n\t\t\t\t{\n\t\t\t\t\t$this->directory = '';\n\t\t\t\t\treturn array();\n\t\t\t\t}\n\t\t\t}\n \n\t\t\treturn $segments;\n\t\t}\n \t\t \n\t\t// Can't find the requested controller...\n\t\treturn $this->error_404();\n\t}", "private static function isController($str) {\n\t\t$str = self::formatAsController($str);\n\t\t\n\t\tif (file_exists(APP_DIR.'/Mvc/Controller/'.$str.'.php')) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "public function validate_route($route)\n\t{\n\t\t// If we don't have any segments, the default will have to do\n\t\tif (empty($route))\n\t\t{\n\t\t\t$route = $this->_default_segments();\n\t\t\tif (empty($route))\n\t\t\t{\n\t\t\t\t// No default - fail\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\n\t\t// Explode route if not already segmented\n\t\tif ( ! is_array($route))\n\t\t{\n\t\t\t$route = explode('/', $route);\n\t\t}\n\n\t\t// Parse any custom routing that may exist\n\t\t$route = $this->_parse_routes($route);\n\n\t\t// Search paths for controller\n\t\tforeach ($this->CI->load->get_package_paths() as $path)\n\t\t{\n\t\t\t// Does the requested controller exist in the base folder?\n\t\t\tif (file_exists($path.'controllers/'.$route[0].'.php'))\n\t\t\t{\n\t\t\t\t// Found it - append method if missing\n\t\t\t\tif ( ! isset($route[1]))\n\t\t\t\t{\n\t\t\t\t\t$route[] = 'index';\n\t\t\t\t}\n\n\t\t\t\t// Prepend path and empty directory and return\n\t\t\t\treturn array_merge(array($path, ''), $route);\n\t\t\t}\n\n\t\t\t// Is the controller in a sub-folder?\n\t\t\tif (is_dir($path.'controllers/'.$route[0]))\n\t\t\t{\n\t\t\t\t// Found a sub-folder - is there a controller name?\n\t\t\t\tif (isset($route[1]))\n\t\t\t\t{\n\t\t\t\t\t// Yes - get class and method\n\t\t\t\t\t$class = $route[1];\n\t\t\t\t\t$method = isset($route[2]) ? $route[2] : 'index';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Get default controller segments\n\t\t\t\t\t$default = $this->_default_segments();\n\t\t\t\t\tif (empty($default))\n\t\t\t\t\t{\n\t\t\t\t\t\t// No default controller to apply - carry on\n\t\t\t\t\t\tunset($default);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Get class and method\n\t\t\t\t\t$class = array_shift($default);\n\t\t\t\t\t$method = array_shift($default);\n\t\t\t\t}\n\n\t\t\t\t// Does the requested controller exist in the sub-folder?\n\t\t\t\tif (file_exists($path.'controllers/'.$route[0].'/'.$class.'.php'))\n\t\t\t\t{\n\t\t\t\t\t// Found it - assemble segments\n\t\t\t\t\tisset($route[1]) OR $route[] = $class;\n\t\t\t\t\tisset($route[2]) OR $route[] = $method;\n\t\t\t\t\tif (isset($default) && count($default) > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$route = array_merge($route, $default);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Prepend path and return\n\t\t\t\t\tarray_unshift($route, $path);\n\t\t\t\t\treturn $route;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Search for controller in modules hierarchy\n\t\t// If the module path is APPPATH/modules/, \"/foo/bar/baz\" may map to:\n\t\t//\tAPPPATH/modules/controllers/foo.php\n\t\t//\tAPPPATH/modules/foo/controllers/bar.php\n\t\t//\tAPPPATH/modules/foo/bar/controllers/baz.php\n\t\t//\tAPPPATH/modules/foo/bar/baz/controllers/[default].php\n\t\t$seg_ct = count($route);\n\t\tforeach ($this->CI->load->get_module_paths() as $path)\n\t\t{\n\t\t\t// Does the requested controller exist in the base folder?\n\t\t\tif (file_exists($path.'controllers/'.$route[0].'.php'))\n\t\t\t{\n\t\t\t\t// Found it - append method if missing\n\t\t\t\tif ($seg_ct < 2)\n\t\t\t\t{\n\t\t\t\t\t$route[] = 'index';\n\t\t\t\t}\n\n\t\t\t\t// Prepend path and empty directory and return\n\t\t\t\treturn array_merge(array($path, ''), $route);\n\t\t\t}\n\n\t\t\t// Is there a module sub-folder?\n\t\t\tfor ($sub = '', $seg = 0; $seg < $seg_ct; ++$seg)\n\t\t\t{\n\t\t\t\t// Add segment to subdirectory path and check for controllers\n\t\t\t\t$sub .= $route[$seg].'/';\n\t\t\t\tif (is_dir($path.$sub.'controllers/'))\n\t\t\t\t{\n\t\t\t\t\t// Found a module - is there a controller name?\n\t\t\t\t\tif ($seg_ct > $seg + 1)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Yes - get class and method\n\t\t\t\t\t\t$class = $route[$seg + 1];\n\t\t\t\t\t\t$method = $seg_ct > $seg + 2 ? $route[$seg + 2] : 'index';\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t// Get default controller segments\n\t\t\t\t\t\t$default = $this->_default_segments();\n\t\t\t\t\t\tif (empty($default))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// No default controller to apply - carry on\n\t\t\t\t\t\t\tunset($default);\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Get class and method\n\t\t\t\t\t\t$class = array_shift($default);\n\t\t\t\t\t\t$method = array_shift($default);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Does the requested controller exist in the module?\n\t\t\t\t\tif (file_exists($path.$sub.'controllers/'.$class.'.php'))\n\t\t\t\t\t{\n\t\t\t\t\t\t// Found it - assemble segments\n\t\t\t\t\t\tif ($seg_ct <= $seg + 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$route[] = $class;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($seg_ct <= $seg + 2)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$route[] = $method;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (isset($default) && count($default) > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$route = array_merge($route, $default);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Return path, empty (post-)subdirectory, and remainder of route\n\t\t\t\t\t\t$route = array_merge(array($path.$sub, ''), array_slice($route, $seg + 1));\n\t\t\t\t\t\treturn $route;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// If we got here, no valid route was found\n\t\treturn FALSE;\n\t}", "private static function check_route($a_route){\n\t\t$args=explode(\"/\",$a_route);\n\t\t\n\t\tarray_shift($args);\n\t\tif(count($args)>1){\n\t\t\t$controller=$args[0];\n\t\t\tarray_shift($args);\n\t\t\t$action=$args[0];\n\t\t\tarray_shift($args);\n\t\t}else{\n\t\t\t$controller=$args[0];\n\t\t\tarray_shift($args);\n\t\t\t$action=\"index\";\n\t\t}\n\t\t\n\t\ttry{\n\t\t\tif(file_exists('controllers/'.$controller.'_controller.php')){\n\t\t\t\trequire_once('controllers/'.$controller.'_controller.php');\n\t\t\t\t$maj_controller=ucfirst($controller).'Controller';\n\t\t\t\tif(method_exists($maj_controller,$action)){\n\t\t\t\t\t//print \"Found\";\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}catch(Exception $e){\n\t\t\t//print \"Error\";\n\t\t\t$controller=new ErrorController();\n\t\t\t$controller->server();\n\t\t\tdie();\n\t\t}\n\t}", "private function hasController($page) {\r\n return file_exists($this->getController($page));\r\n }", "public function checkControllerMethodExists(object $controller, string $method)\n {\n if(!method_exists($controller,$method))\n {\n die(\"Unknown method for instantiated controller object\");\n }\n }", "private function ControllerExist($controller) {\n $ControllerExist = false;\n\n foreach ($this->folders as $folder) {\n\n if (class_exists($folder.'\\\\'.$controller)) {\n\n $ControllerExist = true;\n $this->namespace = $folder;\n $this->controller = $controller;\n\n }\n\n }\n\n return $ControllerExist;\n\n }", "public function path_valid() {\n\t\tif (!file_exists($this->path)) return false;\n\t\treturn true;\n\t}", "public function path_valid() {\n\t\tif (!file_exists($this->path)) return false;\n\t\treturn true;\n\t}", "function VerifyController()\n\t\t{\n\t\t\tif ($this->CONTROLLER == \"\" && $this->ACTION == \"\")\n\t\t\t{\n\t\t\t\t$this->CONTROLLER\t= \"PageController\";\n\t\t\t\t$this->ACTION\t\t= \"Home\";\n\t\t\t}\n\t\t\t\n\t\t\t// Check that the parameters are well-formed\t\t\t\n\t\t\tif ($this->CONTROLLER == \"\")\n\t\t\t{\n\t\t\t\t$this->error_message = \"Error: Class name value was blank.\";\n\t\t\t\t$this->loaded = false;\n\t\t\t\treturn $this->loaded;\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->ACTION == \"\")\n\t\t\t{\n\t\t\t\t$this->error_message = \"Error: Class method name value was blank.\";\n\t\t\t\t$this->loaded = false;\n\t\t\t\treturn $this->loaded;\n\t\t\t}\n\t\t\t\n\t\t\t// Check that the data class file actually exists\n\t\t\t$this->CheckFile($this->config->base['app'] . '/Base' . $this->CONTROLLER . \".php\", \"Base\" . $this->CONTROLLER);\n\t\t\t$this->CheckFile($this->config->classes['app'] . '/' . $this->CONTROLLER . \".php\", $this->CONTROLLER);\n\n\t\t\t// Check the function we want to run is in the class\n\t\t\tif (is_callable(array($this->CONTROLLER, $this->ACTION)))\n\t\t\t{\n\t\t\t\t$this->error_message = \"\";\n\t\t\t\t$this->loaded = true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo $this->CONTROLLER . \"->\" . $this->ACTION;\n\t\t\t\theader(\"HTTP/1.0 404 Not Found\"); exit;\n\t\t\t\t// $this->error_message = \"Error: Class \" . $this->CONTROLLER . \" does not contain a method called '\" . $this->ACTION . \"'.\";\n\t\t\t\t$this->loaded = false;\n\t\t\t}\n\n\t\t\treturn $this->loaded;\n\t\t}", "private function isControllerAction()\n {\n return is_string($this->attributes[self::ACTION]);\n }", "private function controllerExist($controller)\r\n {\r\n $controller = ucfirst($controller . self::$postfix);\r\n if (file_exists(\"controllers/{$controller}.php\")) {\r\n $this->controller = new $controller;\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "private function veriFyControllerOnUrl()\n {\n if (!empty($this->urlParameters[3])) {\n $this->existControllerOnRoute = true;\n }\n if ($this->urlParameters && array_key_exists(0, $this->urlParameters)) {\n $this->controller = ucfirst($this->urlParameters[0]) . 'Controller';\n $this->controllerNameAliases = $this->urlParameters[0];\n }\n }", "static function requireController($controllerName, $action ) {\n\n\t\t$paths = array_merge(array(\n\t\t\tROOT . 'app' . DS . 'controllers' . DS,\n\t\t\tROOT . 'controllers' . DS,\n\t\t\tAE_CONTROLLERS\n\t\t\t), self::$_paths\n\t\t);\n\n\t\tif (strpos($action, '.') !== false) {\n\t\t\t$action = substr($action, 0, strpos($action, '.'));\n\t\t}\n\t\t\n\t\t$controllerName = camelize($controllerName) . 'Controller';\n\t\t$action = camelize($action);\n\n\t\tforeach ($paths as $p) {\n\t\t\tif (is_file($p . $controllerName . '.php')) {\n\t\t\t\trequire_once($p . $controllerName . '.php');\n\n\t\t\t\tif (!class_exists($controllerName)) {\n\t\t\t\t\tif (debuggin()) {\n\t\t\t\t\t\tthrow new Exception ($controllerName . ' is not defined as class.');\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (!method_exists($controllerName, $action)) {\n\t\t\t\t\tif (debuggin()) {\n\t\t\t\t\t\tthrow new Exception ($action . ' is not defined in class ' . $controllerName);\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (!is_public_controller_method($controllerName, $action) || substr($controllerName, 0, 1) == '_') {\n\t\t\t\t\tif (debuggin()) {\n\t\t\t\t\t\tthrow new Exception ($action . ' is not public in class ' . $controllerName);\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\n\t\t\t\treturn true;\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "private static function viewRequiresController(): bool\n {\n return true;\n }", "public function includeControllerFile() : bool\n {\n if(file_exists($this->routerEntity->getControllerFile())){\n include_once ($this->routerEntity->getControllerFile());\n return true;\n }\n return false;\n }", "public function is_accessible_controller() {\r\n\t\tinclude_once 'menu_aksi.php';\r\n\t\t$menu_aksi = new menu_aksi($this->Command);\r\n\t\tif($menu_aksi->getByController(true) != 0) {\r\n\t\t\tinclude_once 'menu_function_aksi.php';\r\n\t\t\t$menu_function_aksi = new menu_function_aksi($this->Command);\r\n\t\t\tif($menu_function_aksi->getByName(true) != 0) {\r\n\t\t\t\t$this->model = new permission();\r\n\t\t\t\t$this->model->set_select_full_prefix('select * from permission p,user u');\r\n\t\t\t\t$this->model->set_select_full_suffix('p.ROLE = u.ROLE and p.MENU = (select id_menu from menu where controller=\\'' . $this->Command->getControllerName() . '\\') and u.USERNAME=\\'' . $this->Command->getUserLogged()->get_username() . '\\' and menu_function=(select id_menu_function from menu_function where nama_menu_function=\"' . $this->Command->getFunction() . '\" limit 1)');\r\n\t\t\t\treturn ($this->svc->select_count($this->model) > 0) ? true : false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}", "private static function load_and_run_controller($path) {\n if (file_exists($path[\"path\"] . $path[0])) {\n require_once $path[\"path\"] . $path[0];\n\n /** Add Controller and strip .php extension */\n $path[0] = str_replace(\".php\", \"\", $path[0]) . \"Controller\";\n if (class_exists($path[0])) {\n $class = new $path[0]();\n $method = isset($path[1]) ? $path[1] : \"index\";\n\n /** Is this a REAL controller? */\n if (is_subclass_of($class, \"Nitro_Controller\")) {\n\n if (method_exists($class, $method) && !in_array($method, self::$reserved_functions)) {\n call_user_func_array(array(\n $class,\n $method\n ), array_slice($path, 2, -1));\n } else {\n throw new InvalidMethodException();\n }\n } else {\n throw new InvalidControllerException();\n }\n } else {\n throw new NoControllerException();\n }\n } else {\n throw new NoControllerException();\n }\n }", "private function init_route(){\n if(array_key_exists ( $this->uri_request , $this->web )){\n /*\n * check controller folder exist\n */\n if(is_dir(_CONTROLLER)){\n\n if(is_file(_CONTROLLER.\"/\".$this->web[$this->uri_request]['controller'])){\n $this->controller_path = _CONTROLLER.\"/\".$this->web[$this->uri_request]['controller'];\n $this->controller = basename(explode(\".\",$this->controller_path)[0]);\n $this->method = $this->web[$this->uri_request]['method'];\n }\n else{\n $ERROR = \"Controller not found!\";\n }\n\n }\n else{\n $ERROR = \"Controller path not set properly!\";\n }\n\n\n }\n else{\n $ERROR = \"route not found!\";\n }\n\n // echo $controller;\n\n }", "public function loadBaseController()\n\t{\n\t\t$baseControllerClass = $this->getOption('defaultClassBaseController', null, 'eccBaseController');\n\t\tif (!$this->isBaseController OR !class_exists($baseControllerClass)) {\n\t\t\t$this->isBaseController = $this->modx->loadClass($baseControllerClass, $this->config['controllersPath'], true, true);\n\t\t}\n\n\t\treturn !empty($this->isBaseController) AND class_exists($baseControllerClass);\n\t}", "protected function isControllerAction()\n {\n return is_string($this->action['uses']);\n }", "protected function isControllerAction()\n {\n return is_string($this->action['uses']);\n }", "static function invoke_controller()\n\t{\n\t\t// Try to fetch requested controller\n\t\t$controller_path = APPPATH.'controllers/'.self::$directory.self::$controller_name.'.php';\n\t\tif (is_readable($controller_path))\n\t\t{\n\t\t\trequire($controller_path);\n\n\t\t\t// Check if the controller class is defined\n\t\t\tif (!class_exists(self::$controller_name))\n\t\t\t\tSystem::error('controller <code>'.self::$controller_name.'</code> is not defined');\n\n\t\t\t// Check if the method exists in the controller\n\t\t\tif (!method_exists(self::$controller_name, self::$method_name))\n\t\t\t\tSystem::error('controller <code>'.self::$controller_name.'</code> has no method named <code>'.self::$method_name.'</code>');\n\n\t\t\t// Create controller instance and call the method\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$reflection_method = new ReflectionMethod(self::$controller_name, self::$method_name);\n\n\t\t\t\t$argc = count(self::$segments);\n\t\t\t\tif ($reflection_method->getNumberOfRequiredParameters() > $argc)\n\t\t\t\t\tSystem::error('Not enough parameters for calling <code>'.self::$controller_name.'::'.self::$method_name.'()</code>,\n\t\t\t\t\t'.$argc.' provided, expected at least '.$reflection_method->getNumberOfRequiredParameters());\n\n\t\t\t\tif ($reflection_method->getNumberOfParameters() < $argc)\n\t\t\t\t\tSystem::error('Too many parameters for calling <code>'.self::$controller_name.'::'.self::$method_name.'()</code>,\n\t\t\t\t\t'.$argc.' provided, expected '.$reflection_method->getNumberOfParameters());\n\n\t\t\t\t$reflection_method->invokeArgs(new self::$controller_name, self::$segments);\n\t\t\t}\n\t\t\tcatch (ReflectionException $e)\n\t\t\t{\n\t\t\t\tSystem::error($e->getMessage());\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}" ]
[ "0.7252334", "0.7035493", "0.68429124", "0.65190035", "0.6396005", "0.6281552", "0.626848", "0.62484044", "0.61569375", "0.60835975", "0.606851", "0.6057534", "0.6037909", "0.5993838", "0.5947583", "0.5947583", "0.5938197", "0.5896171", "0.5877429", "0.5872966", "0.5851458", "0.5844393", "0.58215606", "0.5797846", "0.5785881", "0.57828176", "0.577203", "0.57553023", "0.57553023", "0.57524663" ]
0.7996422
0
/ loads the core class files
protected function loadCoreClasses() { require __DIR__ . DIRECTORY_SEPARATOR . 'Config.php'; require __DIR__ . DIRECTORY_SEPARATOR . 'Router.php'; require __DIR__ . DIRECTORY_SEPARATOR . 'Loader.php'; require __DIR__ . DIRECTORY_SEPARATOR . 'Controller.php'; require __DIR__ . DIRECTORY_SEPARATOR . 'Database.php'; require __DIR__ . DIRECTORY_SEPARATOR . 'Model.php'; require __DIR__ . DIRECTORY_SEPARATOR . 'Library.php'; require __DIR__ . DIRECTORY_SEPARATOR . 'View.php'; require __DIR__ . DIRECTORY_SEPARATOR . 'Request.php'; require __DIR__ . DIRECTORY_SEPARATOR . 'Response.php'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function loadClassFiles() {}", "private function loadClasses()\n\t\t{\n\t\t\t// foreach($GLOBALS['classes'] as $var => $class)\n\t\t\t// {\n\t\t\t\t// $this->$var = $class;\n\t\t\t// }\n\t\t\t\n\t\t\t// $this->load = _new('loader');\n\t\t\t\n\t\t\t/** Registramos todos os objetos que serão necessários **/\n\t\t\tforeach(Registry::getAll() as $var => $object)\n\t\t\t{\n\t\t\t\t$this->$var = $object;\n\t\t\t}\n\t\t\t\n\t\t\t// E também a classe loader\n\t\t\t$this->load = Registry::get('loader');\n\t\t}", "function classes() {\n\tcore();\n}", "protected static function loadCore($class_name)\n\t{\n require_once(COREPATH .\"$class_name.php\");\n }", "static public function coreClasses ($classname) {\n\t\t$classname = autoloader::ignoreNamespace($classname);\n\t\tif (file_exists(\"../core/\".$classname.\".php\")) require_once(\"../core/\".$classname.\".php\");\n\t}", "function __autoload($className){\n if (file_exists(\"core/$className.php\")){\n include_once \"core/$className.php\";\n }\n}", "public function loadClasses(){\n spl_autoload_register(function($className){\n require_once preg_replace(\"/\\\\\\\\/\", \"/\", $className).\".php\";\n });\n }", "private function load_classes() {\n\n\t\t\trequire_once ASCRIPTA_ENGINE_ADMIN_PATH . 'class-ae-settings.php';\n\n\t\t}", "function load_my_classes($_cls)\n{\n //echo '<hr />' . $_cls . '<hr />';\n $PATH_SEPARATOR = DIRECTORY_SEPARATOR;\n //$ROOTPATH = $_SERVER[\"DOCUMENT_ROOT\"];\n\t$ROOTPATH = dirname($_SERVER[\"SCRIPT_FILENAME\"]);\n\t\n\t//print_r($_SERVER);\n \n\t\n\n\n if(class_exists($_cls))\n {\n //doe niks, het is een ingebouwde class zoals \\SplObjectStorage o.i.d.\n }\n elseif(strpos($_cls, 'Exception') !== false)\n {\n $candidate_class_file = $ROOTPATH . $PATH_SEPARATOR . 'common' . $PATH_SEPARATOR . 'classes' . $PATH_SEPARATOR . 'Exceptions.php';\n if(file_exists($candidate_class_file))\n {\n require_once($candidate_class_file);\n //echo($candidate_class_file . ' found in ' . $candidate_class_file . '<br />');\n }\n else\n {\n //echo($candidate_class_file . ' does not exist!<br />');\n }\n }\n elseif(strpos($_cls, 'Common') === false)\n {\n $dirsToLookIn = Array(\"controller\", \"core\", \"model\", \"view\");\n \n foreach($dirsToLookIn as $dir)\n {\n if(strpos($_cls, __NAMESPACE__) !== false)\n {\n //namespace eraf strippen anders komt die mee in de padverwijzingen\n $_cls = substr($_cls, strlen(__NAMESPACE__)+1); \n }\n \n \n $candidate_class_file = $ROOTPATH . $PATH_SEPARATOR . $dir . $PATH_SEPARATOR . $_cls . '.php';\n if(file_exists($candidate_class_file))\n {\n require_once($candidate_class_file);\n //echo($candidate_class_file . ' found in ' . $candidate_class_file . '<br />');\n }\n else\n {\n //echo($candidate_class_file . ' does not exist!<br />');\n }\n }\n }\n else\n {\n $_cls = substr($_cls, 7);\n $candidate_class_file = $ROOTPATH . $PATH_SEPARATOR . 'common' . $PATH_SEPARATOR . 'classes' . $PATH_SEPARATOR . $_cls . '.php';\n \n if(file_exists($candidate_class_file))\n {\n require_once($candidate_class_file);\n //echo($candidate_class_file . ' found in ' . $candidate_class_file . '<br />');\n }\n else\n {\n //echo($candidate_class_file . ' does not exist!<br />');\n }\n }\n //echo '<hr />';\n}", "function __autoload($class)\n {\n require_once('core/'.$class.'.php');\n }", "protected function load_files() {\n\t\trequire_once __DIR__ . '/class-papi-admin-meta-handler.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-option-handler.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-entry-post.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-entry-taxonomy.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-columns.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-page-type-switcher.php';\n\t}", "public function getClassLoaders();", "public function load()\n {\n if( $this->autoload ) {\n $loader = new BasePathClassLoader( $this->paths );\n $loader->useEnvPhpLib();\n $loader->register();\n }\n\n foreach( $this->paths as $path ) {\n $di = new RecursiveDirectoryIterator($path);\n $ita = new RecursiveIteratorIterator($di);\n $regex = new RegexIterator($ita, '/^.+\\.php$/i', \n RecursiveRegexIterator::GET_MATCH);\n\n foreach( $regex as $matches ) foreach( $matches as $match ) {\n try {\n require_once $match;\n } \n catch ( Exception $e ) {\n echo \"$match class load failed.\\n\";\n }\n }\n }\n }", "function __autoload($class_name) {\n include_once $_SERVER['DOCUMENT_ROOT'].'/core/classes/class.' . $class_name . '.inc.php';\n}", "function __autoload($className)\n{\n require_once \"webcore.reflection.php\";\n \n ClassLoader::loadClass($className);\n}", "private static function load_files() {\n\t\t\t// Classes.\n\t\t\tinclude_once ASTRA_ADDON_EXT_ADVANCED_HEADERS_DIR . 'classes/class-astra-ext-advanced-headers-data.php';\n\t\t\t// Load Astra Breadcrumbs.\n\t\t\tinclude_once ASTRA_ADDON_EXT_ADVANCED_HEADERS_DIR . 'classes/astra-breadcrumbs.php';\n\t\t}", "public function load()\n {\n $this->_retrievedFiles = $this->getRetrievedFiles();\n $this->_loadedClasses = [];\n\n $manifestRepository = $this->_registry->getManifestRepository();\n $providerRepository = $this->_registry->getProviderRepository();\n\n $loadedClasses = [];\n\n // loop through files and find the classes declared by loading the file\n foreach ($this->_retrievedFiles as $file) {\n if(is_dir($file)) {\n continue;\n }\n\n $classesLoadedBefore = get_declared_classes();\n $oldLevel = error_reporting(E_ALL | ~E_STRICT); // remove strict so that other packages wont throw warnings\n // should we lint the files here? i think so\n include_once $file;\n error_reporting($oldLevel); // restore old error level\n $classesLoadedAfter = get_declared_classes();\n $loadedClasses = array_merge($loadedClasses, array_diff($classesLoadedAfter, $classesLoadedBefore));\n }\n\n // loop through the loaded classes and ensure that\n foreach ($loadedClasses as $loadedClass) {\n\n // reflect class to see if its something we want to load\n $reflectionClass = new ReflectionClass($loadedClass);\n if ($reflectionClass->implementsInterface('Zend_Tool_Framework_Manifest_Interface')\n && !$reflectionClass->isAbstract())\n {\n $manifestRepository->addManifest($reflectionClass->newInstance());\n $this->_loadedClasses[] = $loadedClass;\n }\n\n if ($reflectionClass->implementsInterface('Zend_Tool_Framework_Provider_Interface')\n && !$reflectionClass->isAbstract()\n && !$providerRepository->hasProvider($reflectionClass->getName(), false))\n {\n $providerRepository->addProvider($reflectionClass->newInstance());\n $this->_loadedClasses[] = $loadedClass;\n }\n\n }\n\n return $this->_loadedClasses;\n }", "private function init()\n\t{\n\t\tforeach (isLoadedClass() as $objName)\n\t\t{\n\t\t\t$this->$objName =& loadClass('', '', $objName);\n\t\t}\n\t}", "public static function load()\n {\n spl_autoload_register(array('AutoLoader', 'autoloadGenericClasses'));\n spl_autoload_register(array('AutoLoader', 'autoloadPhpdocx'));\n spl_autoload_register(array('AutoLoader', 'autoloadLog4php'));\n spl_autoload_register(array('AutoLoader', 'autoloadZetaComponents'));\n spl_autoload_register(array('AutoLoader', 'autoloadTcpdf'));\n spl_autoload_register(array('AutoLoader', 'autoloadPdf'));\n spl_autoload_register(array('AutoLoader', 'autoloadDompdf'));\n spl_autoload_register(array('AutoLoader', 'autoloadMht'));\n }", "public function loadAllClassesIncrementally()\n {\n }", "public static function autoload() {\n // autoload\n include('cache/classes.yml.php');\n foreach($return as $class) {\n require_once($class);\n }\n }", "function __autoload($class_name0) {\n\n\t// casos especiais\n\tif ($class_name0==\"datalog\") {\n\t\t$class_name0=\"pdata\";\n\t}\n\n\n\t$class_name = strtolower($class_name0);\n\t$file[]=CORENLIB.\"cls_\".$class_name.\".php\";\n\t$file[]=CORENLIB.\"cls_\".$class_name.\".nx\";\n\t$file[]=DIRNLIB.\"cls_\".$class_name.\".php\";\n\t$file[]=CORENLIB.\"cls_\".$class_name.\".nx\";\n\t$file[]=CORENLIB.$class_name.\".nx\";\n\t$file[]=CORENLIB.$class_name.\".php\";\n\t$file[]=CORENLIB.\"cls.nx\";\t\n\t\n\n\tforeach ($file as $v) {\n\t\tif (file_exists($v)) {\n\t\t\trequire_once ($v);\n\t\t\treturn;\n\t\t}\n\t}\n\tdie (\"CLASS NAME: '$class_name' NOT FOUND\");\n}", "private function load_dependencies() {\n /**\n * \"BEHIND THE SCENCE\" CLASSES\n * Note: usually the admin and public do not directly use them, they are\n * necessary for the plugin (eg. i18n)\n */\n require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-i18n.php';\n\n /* ADMIN */\n require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-admin.php';\n require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-api.php';\n\n /* PUBLIC */\n require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-public.php';\n }", "public static function registerClassLoadingInformation() {}", "public static function __autoload()\n\t{\n\t\tself::$FPATH = dirname(__DIR__);\n\t\tself::$APATH = self::detect_project();\n\n\t\tspl_autoload_register(array(__CLASS__, 'load'));\n\n\t\tself::cache_files();\n\t\tself::import_initializers();\n\t}", "public function core($className){\n if( strpos($className, 'Twig_') !== false ){\n return;\n }\n $fileScanner = new FileScanner( DOCUMENT_ROOT );\n $files = $fileScanner->getFilesInOneDimensionalArray();\n // exclude folders.\n $corefiles = array_filter($files, array($this, 'isCoreClass'));\n foreach($corefiles as $file){\n if( strpos(pathinfo($file, PATHINFO_FILENAME), $className) > -1 ){\n require_once $file;\n }\n }\n }", "function __autoload($class_name){\n require_once \"../cls/\".$class_name.'.php';\n}", "protected function _Load_Core() {\r\n $dir = untrailingslashit( plugin_dir_path(__FILE__ ) );\r\n // Recurssively load the directory\r\n $this->_Recusive_Load_Dir($dir.'/core');\r\n // Fire the shortcode init action\r\n do_action('vcff_supports_core_init',$this);\r\n }", "function __autoload($class_name) {\n\t$inc = ['sys/core/', 'sys/libs/'];\n\tforeach ($inc as $in) {\n\t\t$path = APP_DIR . $in . $class_name . '.php';\n\t\tif (file_exists($path)) {\n\t\t\tinclude $path;\n\t\t}\n\t}\n}", "static function autoload()\r\n\t{\r\n\t\t\r\n\t}" ]
[ "0.78886384", "0.74368006", "0.7236141", "0.7230211", "0.71069735", "0.7071298", "0.70692074", "0.7036053", "0.6996384", "0.6929936", "0.6881678", "0.687795", "0.6813528", "0.68101895", "0.67888033", "0.6780812", "0.67777777", "0.6765415", "0.6741987", "0.673613", "0.6727286", "0.67146057", "0.67051584", "0.67010635", "0.6670042", "0.666578", "0.6659575", "0.66580254", "0.66300875", "0.6612537" ]
0.84678334
0
Get an asset by its path
public static function path($path) { return Assets::all()->filter(function ($asset) use ($path) { return $asset->resolvedPath() === $path; })->first(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAsset($key, $path = null) {\n if (isset($path))\n return $this->m->Assets->getAsset($key, $path);\n return $this->info->getAsset($this->m->Assets, $key);\n }", "static function asset($path)\n {\n return Assets::src($path);\n }", "public function asset(string $path)\n {\n $filename = basename($path);\n $assetsFile = configFileSystem::getSiteRoot() . '/public/assets.json';\n if (!file_exists($assetsFile)) {\n return $path; \n }\n\n $fileParts = explode('.', $filename);\n $jsonFile = json_decode(file_get_contents($assetsFile), true);\n\n if (!array_key_exists($fileParts[0], $jsonFile)) {\n return $path; \n }\n\n if (!array_key_exists($fileParts[1], $jsonFile[$fileParts[0]])) {\n return $path; \n }\n\n return $jsonFile[$fileParts[0]][$fileParts[1]];\n }", "public function getAsset($asset)\n {\n $result = $this->newAPIRequest('GET', '/assets/'.$asset);\n return $result;\n }", "public function getAsset(string $path): string\n {\n if (!empty($path)) {\n $paths = explode('/', $path);\n\n $type = !empty($paths[0]) ? $paths[0] : '';\n $asset = !empty($paths[1]) ? $paths[1] : '';\n\n if (!empty($type) && !empty($asset)) {\n return (string) $this->dependencies[$type][$asset];\n }\n\n if (!empty($type)) {\n return (string) $this->dependencies[$type];\n }\n }\n\n return '';\n }", "public function getAsset(Component $component, $asset) {}", "function asset( $path ) {\n\n\t\tif ( ! $this->mix ) {\n\t\t\t$file = $this->path( 'public/mix-manifest.json' );\n\t\t\t$this->mix = (array) json_decode( file_get_contents( $file ), true );\n\t\t}\n\n\t\t// Make sure to trim any slashes from the front of the path.\n\t\t$path = '/' . ltrim( $path, '/' );\n\n\t\tif ( $this->mix && isset( $this->mix[ $path ] ) ) {\n\t\t\t$path = $this->mix[ $path ];\n\t\t}\n\n\t\treturn $this->uri( 'public' . $path );\n\t}", "public function Asset($params)\n {\n if (gettype($params) == \"string\") {\n $params = [$params];\n }\n $filename = $params[0];\n $Link = $this->_machine->plugin(\"Link\");\n return $Link->Get($this->_prefixDir . \"/assets/\" . $filename);\n }", "function asset( string $asset, ?string $path = null ): string\n {\n return Asset::url( $asset, $path );\n }", "public function getAsset($id)\n\t{\n\t\treturn $this->getResourceChildObject('assets', $id);\n\t}", "public function get($path);", "public function get($path);", "public function get($path)\n {\n if ($this->check($path)) return File::get($path);\n }", "private function getBuilderAsset($path)\n {\n return Storage::disk('builder')->get($path);\n }", "public function getAsset()\n {\n if ($this->asset === null) {\n $this->asset = AssetFacade::find($this->getAssetId());\n }\n\n return $this->asset;\n }", "public static function getAsset() {\n if (Asset::$asset == null) {\n Asset::$asset = new Asset();\n }\n return Asset::$asset;\n }", "function asset($path) {\n echo getAbsolutePath() . \"public/$path\";\n}", "function getAssets();", "protected function parseAsset($asset_path) {\n $absolute_path = $this->getAbsolutePath($asset_path);\n\n #i:::: Check for HttpAsset\n if (starts_with($asset_path, 'http://')) {\n return new HttpAsset($asset_path);\n\n #i:::: Check for GlobAsset\n }else if (str_contains($asset_path, array('*', '?'))) {\n return new GlobAsset($absolute_path);\n\n #i:::: Check for FileAsset\n }else if( $this->getAbsolutePath($asset_path, true) ){\n #i: Return if path exist\n return new FileAsset($absolute_path);\n\n }else{\n return null;\n }\n }", "function _asset($path, $secure = null)\n {\n\n if(env('APP_ASSETS') == 'local'){\n return app('url')->asset($path, $secure);\n } else {\n return app('url')->asset(\"public/\".$path, $secure);\n }\n }", "public function getAssets();", "public function getAssets();", "public function getAssetById($id)\n\t{\n\t\treturn craft()->elements->getElementById($id, ElementType::Asset);\n\t}", "function asset($path = '')\n {\n \treturn (!empty($path)) ? BASE_URL . $path : BASE_URL ; \n }", "public function get_asset($id, $private = FALSE, $queryargs = array()) {\n return $this->get_item_of_type($id, 'asset', $private, $queryargs);\n }", "public function getAsset($type, $name)\n {\n return sprintf(\"%s/%s\", $this->$type, $name);\n }", "function cdn_asset(string $path)\n {\n return \\App\\Utils::cdnAsset($path);\n }", "public function getFile($path)\n {\n return $this->files[$path];\n }", "public function assetPath($path = '')\n\t{\n\t\treturn $this['path.asset'].ltrim($path, '/');\n\t}", "abstract public function getSingle(string $path);" ]
[ "0.783336", "0.728482", "0.7275394", "0.71702605", "0.70674044", "0.6842171", "0.67996275", "0.66976744", "0.66391087", "0.6557754", "0.651351", "0.651351", "0.6472198", "0.6446784", "0.6430077", "0.6422105", "0.6416686", "0.6400945", "0.6394981", "0.6370265", "0.63701123", "0.63701123", "0.6345266", "0.6275297", "0.6236403", "0.6230329", "0.61768526", "0.61573124", "0.61513084", "0.61110413" ]
0.7417017
1
Lists all Examination models.
public function actionIndex() { $userId = Yii::$app->user->id; $searchModel = new ExaminationSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); $dataProvider->query->AndWhere(['user_id' => $userId]); $dataProvider->query->orderBy('create_at DESC'); return $this->render('index', [ 'searchModel' => $searchModel, 'dataProvider' => $dataProvider, ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function index()\n\t{\n\t\t$exams = Exam::with('course')->get(['id', 'name', 'type', 'course_id', 'class', 'campus_id', 'created_at']);\n\n\t\tforeach ($exams as $value) {\n\t\t\t$value['campus'] = Campus::find($value['campus_id'])->title;\n\t\t}\n\t\treturn $exams;\n\t}", "public function index()\n\t{\n\t\t$exampaths = ExamPath::all();\n\n\t\treturn View::make('exampaths.index', compact('exampaths'));\n\t}", "public function index()\n {\n $lists = ExamList::select('id', 'name', 'remarks')\n ->where('status', 1)->get();\n\n return view('exam::list.index', compact('lists'));\n }", "public function index() {\n\t\t$expence_management = ExpenceManagement::query()\n\t\t\t->leftjoin('users as users', 'users.id', '=', 'expence_managements.created_by')\n\t\t\t->orderBy('expence_managements.id', 'ASC')\n\t\t\t->where('expence_managements.deletion_status', 0)\n\t\t\t->get([\n\t\t\t\t'expence_managements.*',\n\t\t\t\t'users.name',\n\t\t\t])\n\t\t\t->toArray();\n\n\t\t$employees = User::where('deletion_status', 0)\n\t\t\t->where('access_label', '>=', 2)\n\t\t\t->where('access_label', '<=', 3)\n\t\t\t->get(['name', 'id'])\n\t\t\t->toArray();\n\t\t//return dd($employees);\n\t\treturn view('administrator.hrm.expence.manage_expence', compact('expence_management', 'employees'));\n\t}", "public function actionIndex() {\n if (Yii::$app->user->can('school_exam')) {\n $searchModel = new SchoolExamMarksSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n $classList = ArrayHelper::map(Classes::findAll(['is_active' => 'Y', 'is_deleted' => 'N']), 'id', 'name');\n $subclassList = ArrayHelper::map(Subclass::findAll(['is_active' => 'Y', 'is_deleted' => 'N']), 'id', 'sub_class');\n $semesterList = ArrayHelper::map(SchoolExamSemester::findAll(['is_active' => 'Y', 'is_deleted' => 'N']), 'id', 'semester');\n $divisionList = ArrayHelper::map(Division::findAll(['is_deleted' => 'N', 'is_active' => 'Y']), 'id', 'division');\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 'classList' => $classList,\n 'subclassList' => $subclassList,\n 'semesterList' => $semesterList,\n 'divisionList' => $divisionList,\n ]);\n } else {\n throw new ForbiddenHttpException;\n }\n }", "public function index(Request $request)\n {\n $exam = new Exam;\n $exam->setAttribute('exam_entity_id', $request->input('eei'));\n $exam->setAttribute('class_entity_id', $request->input('cei'));\n $exam->loadData();\n return view('dashboard.school.Exam.list', compact('exam'));\n }", "public function index()\n {\n return $this->model->all();\n }", "public function index()\n {\n return Employee::all();\n }", "public function index(){\n return $this->model->all();\n }", "public function index()\n {\n $exams = Exam::all();\n return view('admin.exam.index', compact('exams'));\n }", "public function getAllExaminations()\n {\n if (REQ::is('api/*'))\n return response()->json(['examinations' => Examination::all()], 200);\n return view('pages.exams',['Examinations'=>Examination::all(),'subjects'=>Subject::all(),'grades'=>Grade::all()]);\n }", "public function index()\n {\n $expences = Expence::orderBy('id', 'desc')->get();\n return view('bsd-admin.expences.index', compact('expences'));\n }", "public function indexAction() {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('BackOfficebackBundle:Extraitnaissances')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function getModelsForIndex()\n {\n $models = [];\n $all_models = $this->getAllModels();\n\n foreach ($all_models as $model) {\n //parse model\n $pieces = explode('.', $model);\n if (count($pieces) != 2) {\n throw new Exception('Parse error in AppModelList');\n }\n //check form match\n $app_model = $pieces[1];\n $link = $this->convertModelToLink($app_model);\n\n // add to actions\n $models[$app_model]['GET'] = [\n [\n 'action' => 'index',\n 'description' => 'List & filter all ' . $app_model . ' resources.',\n 'route' => '/' . env('EASY_API_BASE_URL', 'easy-api') . '/' . $link\n ],\n [\n 'action' => 'show',\n 'description' => 'Show the ' . $app_model . ' that has the matching {id} from the route.',\n 'route' => '/' . env('EASY_API_BASE_URL', 'easy-api') . '/' . $link . '/{id}'\n ]\n ];\n }\n return $models;\n }", "public function index()\n {\n //\n return ExamenesClinicos::all();\n }", "public function index()\n {\n return $this->model->getAll();\n }", "public function index()\n {\n $exams=Exam::All();\n return view('admin.pages.exam.exam_details')->with('exams',$exams);\n }", "public function index()\n {\n $employees = Employee::all();\n $trainings = Training::all();\n\n return view('employee.index', compact(['employees','trainings']));\n }", "public function models()\n {\n $this->_display('models');\n }", "public function index()\n {\n if (! Gate::allows('exam_access')) {\n return abort(401);\n }\n\n\n if (request('show_deleted') == 1) {\n if (! Gate::allows('exam_delete')) {\n return abort(401);\n }\n $exams = Exam::onlyTrashed()->get();\n } else {\n $exams = Exam::all();\n }\n\n return view('admin.exams.index', compact('exams'));\n }", "public function getModels();", "public function getModels();", "public function index()\n {\n //\n $exams=Exam::all();\n return view('exams.index',compact('exams'));\n }", "public function actionIndex()\n {\n AllocationDetails::getExtCentres();\n $dataProvider = new ActiveDataProvider([\n 'query' => AllocationDetails::find(),\n 'pagination' => \n [\n 'pageSize' => 20,\n ],\n 'sort' => \n [\n 'defaultOrder' => \n [\n 'name' => SORT_ASC,\n ]\n ],\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index() {\n $empleados = $this->Empleados->find('all');\n $this->set(compact('empleados'));\n }", "public function list ()\n {\n $employees[\"data\"] = Employee::get();\n $employees['deleted'] = \"0\";\n\n return view(\"employee.list\", compact(\"employees\"));\n }", "function index(){\r\n \r\n $all = $this->model->selectAll();\r\n $this->data('all', $all);\r\n $this->loadView();\r\n }", "public function index()\n\t{\n\t\treturn $this->careers->findAll();\n\t}", "public function index()\n {\n return Api_Employees::all()->toArray(); \n }", "public function index()\n {\n $data = $this->model->all();\n return view('admin.backends.employee.index',compact('data'));\n }" ]
[ "0.6388559", "0.6354124", "0.62900794", "0.6183228", "0.61783564", "0.6168356", "0.6096302", "0.6082665", "0.607787", "0.6073956", "0.60720295", "0.60704064", "0.6067534", "0.6064393", "0.60572386", "0.5988476", "0.59781706", "0.5957731", "0.59494495", "0.5945963", "0.59428483", "0.59428483", "0.5941481", "0.59017575", "0.58715826", "0.5860553", "0.5858122", "0.58378595", "0.58343047", "0.58332264" ]
0.70736754
0
Creates a new Examination model. If creation is successful, the browser will be redirected to the 'view' page.
public function actionCreate() { $model = new Examination(); if ($model->load(Yii::$app->request->post())) { $userId = \Yii::$app->user->id; $this->saveResult($model->result, $userId); return $this->redirect('index'); } return $this->render('create', [ 'model' => $model, ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionCreate()\n\t{\n\t\t$model=new ElearningExam;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['ElearningExam']))\n\t\t{\n\t\t\t$model->attributes=$_POST['ElearningExam'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->elearningExamId));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreate()\n {\n $model = new Escaparate();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->idNTC_Escaparate]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new IhubAbsence();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'idOpr' => $model->idOpr, 'tglabsence' => $model->tglabsence, 'ibadah' => $model->ibadah]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate() {\n $model = new AllocationDetail();\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 $exam=Exam::all();\n $section=Section::all();\n $class = Classe::all();\n $session=Session::all();\n $term=Term::all();\n return view('basicinfo::exam.create',compact('exam','section','class','session','term'));\n }", "public function actionCreate()\n\t{\n\t\t$model = new Exam;\n\t\t$examQuestionModel = new ExamQuestion();\n\t\t$examChoiceModel = new ExamChoice();\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t//$this->performAjaxValidation($model);\n\n\t\tif (isset($_POST['Exam']) && isset($_POST['ExamQuestion']) && isset($_POST['ExamChoice']))\n\t\t{\n\t\t\t$model->attributes = $_POST['Exam'];\n\n\t\t\t$flag = true;\n\t\t\t$transaction = Yii::app()->db->beginTransaction();\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif ($model->save())\n\t\t\t\t{\n\t\t\t\t\t$examTitleId = Yii::app()->db->lastInsertID;\n\n\t\t\t\t\t//Question\n\t\t\t\t\tforeach ($_POST['ExamQuestion'] as $qId => $examQuestion)\n\t\t\t\t\t{\n\t\t\t\t\t\t$examQuestionModel = new ExamQuestion();\n\t\t\t\t\t\t$examQuestionModel->attributes = $examQuestion;\n\n\t\t\t\t\t\tif (!$examQuestionModel->save())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$flag = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$examQuestionId = Yii::app()->db->lastInsertID;\n\n\t\t\t\t\t\t$examTitleExamQuestionModel = new ExamExamQuestion();\n\t\t\t\t\t\t$examTitleExamQuestionModel->examId = $examTitleId;\n\t\t\t\t\t\t$examTitleExamQuestionModel->examQuestionId = $examQuestionId;\n\n\t\t\t\t\t\tif (!$examTitleExamQuestionModel->save())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$flag = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ($examQuestion['questionType'] == 2)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t//Choice\n\t\t\t\t\t\tforeach ($_POST['ExamChoice'][$qId] as $examChoice)\n\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t$examChoiceModel = new ExamChoice();\n\t\t\t\t\t\t\t$examChoiceModel->attributes = $examChoice;\n\n\t\t\t\t\t\t\tif (!$examChoiceModel->save())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$flag = false;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$examChoiceId = Yii::app()->db->lastInsertID;\n\n\t\t\t\t\t\t\t$examQuestionExamChoiceModel = new ExamQuestionExamChoice();\n\t\t\t\t\t\t\t$examQuestionExamChoiceModel->examQuestionId = $examQuestionId;\n\t\t\t\t\t\t\t$examQuestionExamChoiceModel->examChoiceId = $examChoiceId;\n\n\t\t\t\t\t\t\tif (!$examQuestionExamChoiceModel->save())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$flag = false;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (!$flag)\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$flag = false;\n\t\t\t\t}\n\n\t\t\t\tif ($flag)\n\t\t\t\t{\n\t\t\t\t\t$transaction->commit();\n\t\t\t\t\t$this->redirect(array(\n\t\t\t\t\t\t'view',\n\t\t\t\t\t\t'id' => $model->examId));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$transaction->rollback();\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (Exception $e)\n\t\t\t{\n\t\t\t\tthrow new Exception($e->getMessage());\n\t\t\t\t$transaction->rollback();\n\t\t\t}\n\t\t}\n\n\t\t$this->render('create', array(\n\t\t\t'model' => $model,\n\t\t\t'examQuestionModel' => $examQuestionModel,\n\t\t\t'examChoiceModel' => $examChoiceModel,\n\t\t));\n\t}", "public function actionCreate()\n {\n $model = new Evaluation();\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()\r\n\t{\r\n\t\t$model=new Study;\r\n\r\n\t\t// Uncomment the following line if AJAX validation is needed\r\n\t\t// $this->performAjaxValidation($model);\r\n\r\n\t\tif(isset($_POST['Study']))\r\n\t\t{\r\n\t\t\t$model->attributes=$_POST['Study'];\r\n\t\t\tif($model->save())\r\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\r\n\t\t}\r\n\r\n\t\t$this->render('create',array(\r\n\t\t\t'model'=>$model,\r\n\t\t));\r\n\t}", "public function actionCreate()\n\t{\n\t\t$model=new Employe;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Employe']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Employe'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id_employe));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function create()\n {\n //\n return view('exam.create');\n }", "public function actionCreate()\n {\n $model = new WpIschoolSafecard();\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\t{\n\t\t//\n\t\t// if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n\t\t// try {\n\t\t// $model->save();\n\t\t// Yii::$app->session->setFlash('alert', [\n\t\t// 'body' => Yii::$app->params['create-success'],\n\t\t// 'class' => 'bg-success',\n\t\t// ]);\n\t\t// } catch (\\yii\\db\\Exception $exception) {\n\t\tYii::$app->session->setFlash('alert', [\n\t\t\t'body' => Yii::$app->params['create-danger'],\n\t\t\t'class' => 'bg-danger',\n\t\t]);\n\n\t\t// }\n\t\treturn $this->redirect(['index']);\n\t\t// }\n\n\t\t// return $this->render('create', [\n\t\t// 'model' => $model,\n\t\t// ]);\n\t}", "public function actionCreate()\n {\n $model = new SasaranEs4();\n\n if ($model->load(Yii::$app->request->post())) {\n if ($model->save()){\n flash('success','Data Sasaran Eselon IV Berhasil Disimpan');\n return $this->redirect(['index']);\n }\n \n flash('error','Data Sasaran Eselon IV Gagal Disimpan');\n \n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Employe();\n\n if ($model->load(Yii::$app->request->post())) {\n if ($model->save()) {\n Yii::$app->session->setFlash('success', \"Employee created successfully.\");\n } else {\n Yii::$app->session->setFlash('error', \"Employee not saved.\");\n }\n return $this->redirect(['index']);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Persyaratan();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_persyaratan]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Test();\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 Data();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->no]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n \t /** @var ActiveRecord $model */\n \t $modelClass = static::modelClass();\n \t $model = new $modelClass();\n\n\t$viewFolder = '/';\n\t$viewName = 'create';\n\t$viewExtension = '.php';\n\t$viewFile = $this->getViewPath().$viewFolder.$viewName.$viewExtension;\n\t$viewPath = file_exists($viewFile) ? '' : $this->getDefaultViewPath(false);\n\t\n\tif ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t$this->processData($model, 'create');\n\t\treturn $this->redirect(['view', 'id' => $model->getPrimaryKey()]);\n\t} else {\n\t\treturn $this->render($viewPath.$viewName, array_merge($this->commonViewData(), [\n\t\t\t'model' => $model,\n\t]));\n\t}\n }", "public function actionCreate()\n {\n $model = new Patient();\n $model->StatusId = DictionaryDetail::PATIENT_STATUS_NEW;\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n if (!empty($model->interestPoint)) {\n foreach ($model->interestPoint as $interestPoint) {\n $modelInterestPoint = new InterestPointXPatient();\n $modelInterestPoint->PatientId = $model->Id;\n $modelInterestPoint->InterestPointId = $interestPoint;\n $modelInterestPoint->save();\n }\n }\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 Student();\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 $this->setModelByConditions();\n\n if (Yii::$app->request->isPost &&\n $this->model->load(Yii::$app->request->post()) &&\n $this->setAdditionAttributes() &&\n $this->model->save()) {\n\n if ($this->viewCreated) {\n $redirectParams = [\n $this->urlPrefix.'view',\n 'id' => $this->model->getId(),\n ];\n } else {\n $redirectParams = [\n $this->urlPrefix.'index',\n ];\n }\n\n return $this->redirect($redirectParams);\n }\n\n return $this->render('create',\n ArrayHelper::merge(\n [\n 'model' => $this->model,\n ],\n $this->getAdditionFields()\n )\n );\n }", "public function actionCreate()\n {\n $model = new Qrxq2017Enroll();\n $model->loadDefaultValues();\n\n $model->id = JdhnCommonHelper::createGuid();\n $model->created_at = time();\n $model->modified_at = $model->created_at;\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 HorarioEstudiante();\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 House();\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 create()\n {\n return view('admin.imagingExam.create');\n }", "public function actionCreate()\n {\n $model = new Amphur();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->amphurId]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n return view('exam::create');\n }", "public function create()\n {\n //\n return view('exams.create');\n }", "public function actionCreate()\n {\n $model = new ActivityDetail();\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 Clearanceentries();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect([\n 'view', \n 'Clear By ID' => $model['Clear By ID'], \n 'Clearance Level Code' => $model['Clearance Level Code'], \n 'Department' => $model->Department, \n 'Student ID' => $model['Student ID']\n ]);\n } else {\n return $this->render('create', [ 'model' => $model ]);\n }\n }" ]
[ "0.75224596", "0.70448494", "0.69286925", "0.6925248", "0.6869331", "0.6866634", "0.6846652", "0.68006235", "0.6791648", "0.67599225", "0.6747884", "0.67406905", "0.67236465", "0.67160517", "0.66948795", "0.6693164", "0.6677648", "0.6677507", "0.6677325", "0.667132", "0.66658115", "0.6665657", "0.6657997", "0.6604234", "0.65812826", "0.6575975", "0.6567612", "0.655345", "0.65533566", "0.6550623" ]
0.84992194
0
Finds the Examination model based on its primary key value. If the model is not found, a 404 HTTP exception will be thrown.
protected function findModel($id) { if (($model = Examination::findOne($id)) !== null) { return $model; } throw new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function findModel($id)\n {\n if (($model = PaidEmployment::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404);\n }\n }", "public abstract function find($primary_key, $model);", "private function findModel($key)\n {\n if (null === $key) {\n throw new BadRequestHttpException('Key parameter is not defined in findModel method.');\n }\n\n $modelObject = $this->getNewModel();\n\n if (!method_exists($modelObject, 'findOne')) {\n $class = (new\\ReflectionClass($modelObject));\n throw new UnknownMethodException('Method findOne does not exists in ' . $class->getNamespaceName() . '\\\\' .\n $class->getShortName().' class.');\n }\n\n $result = call_user_func([\n $modelObject,\n 'findOne',\n ], $key);\n\n if ($result !== null) {\n return $result;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "public function find($id){\n\t\t$db = static::getDatabaseConnection();\n\t\t//Create a select query\n\t\t$query = \"SELECT \" . implode(\",\" , static::$columns).\" FROM \" . static::$tableName . \" WHERE id = :id\";\n\t\t//prepare the query\n\t\t$statement = $db->prepare($query);\n\t\t//bind the column id with :id\n\t\t$statement->bindValue(\":id\", $id);\n\t\t//Run the query\n\t\t$statement->execute();\n\n\t\t//Put the associated row into a variable\n\t\t$record = $statement->fetch(PDO::FETCH_ASSOC);\n\n\t\t//If there is not a row in the database with that id\n\t\tif(! $record){\n\t\t\tthrow new ModelNotFoundException();\n\t\t}\n\n\t\t//put the record into the data variable\n\t\t$this->data = $record;\n\t}", "protected function findModel($masterlist_id)\n\t{\n\t\tif (($model = WiMasterlist::findOne($masterlist_id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}", "public function loadModel($id)\n\t{\n\t\t$model = Exam::model()->findByPk($id);\n\t\tif ($model === null)\n\t\t\tthrow new CHttpException(404, 'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($id)\n {\n if (($model = Menu::findOne([ 'id' => $id ])) !== null)\n {\n return $model;\n }\n else\n {\n throw new HttpException(404, Yii::t('backend', 'The requested page does not exist.'));\n }\n }", "protected function findModel($id)\n {\n if (($model = Offer::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404, 'The requested page does not exist.');\n }\n }", "protected function findModel($id)\n\t{\n\t\tif (($model = Trailer::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}", "protected function findModel($id) {\n if (($model = AllocationDetail::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id) {\n if (($model = SchoolExamMarks::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n$model = Reports::findOne($id);\n\t\tif ((isset(Yii::$app->params['ADMIN_CLIENT_ID']) and Yii::$app->user->identity->clientID == Yii::$app->params['ADMIN_CLIENT_ID']))\n\t\t{\n return $model;\n }\n\t\telse\n\t\t\tthrow new NotFoundHttpException('The requested page does not exist.');\n\t\t\n }", "public function returnDetailFindByPK($id);", "protected function findModel($id) {\n\t\tif (($model = EntEmpleados::findOne ( $id )) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new NotFoundHttpException ( 'The requested page does not exist.' );\n\t\t}\n\t}", "protected function findModel($id)\n {\n\t\t$p = $this->primaryModel;\n if (($model = $p::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id) {\n if (($model = learnerscoring::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = DetailPkl::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "public function loadModel($id)\r\n\t{\r\n\t\t$model=StudentDocument::model()->findByPk($id);\r\n\t\tif($model===null)\r\n\t\t\tthrow new CHttpException(404,Yii::t('app','The requested page does not exist.'));\r\n\t\treturn $model;\r\n\t}", "public function findById() {\n // TODO: Implement findById() method.\n }", "protected function findModel($id)\n {\n if (($model = SoSheet::findOne($id)) !== null) { \n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = Employee::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id)\n\t{\n\t\t$model=ElearningExam::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($id)\n {\n if (($model = Publication::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id)\n\t{\n\t\t$model=Student::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,Yii::t('common','The requested page does not exist.'));\n\t\treturn $model;\n\t}", "public function loadModel($id)\n\t{\n\t\t$model=Entry::model()->with('entryAnswers')->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($id)\n {\n if (($model = WpIschoolSafecard::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n\t\t{\n\t\t\tif (($model = PhoneRecord::findOne($id)) !== null) {\n\t\t\t\treturn $model;\n\t\t\t}\n\t\t\t\n\t\t\tthrow new NotFoundHttpException(Yii::t('app', 'Запрашиваемая страница не существует.'));\n\t\t}", "protected function findModel($id) {\n if (($model = MeBackToOfficeReport::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($ClearByID, $ClearanceLevelCode, $Department, $StudentID)\n {\n if (($model = Clearanceentries::findOne(['Clear By ID' => $ClearByID, 'Clearance Level Code' => $ClearanceLevelCode, 'Department' => $Department, 'Student ID' => $StudentID])) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = Escaparate::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }" ]
[ "0.67698216", "0.66550237", "0.6546686", "0.6543248", "0.6519957", "0.64661765", "0.6399759", "0.6376996", "0.63081235", "0.6267306", "0.6229699", "0.61941415", "0.6169507", "0.61658055", "0.6164623", "0.6141948", "0.6129402", "0.61219573", "0.6112529", "0.6109874", "0.6101743", "0.6099951", "0.6097799", "0.6071214", "0.60445315", "0.60321456", "0.6029299", "0.60277915", "0.6019249", "0.6017901" ]
0.6949804
0
cp_js_end This adds orig_cat_url_title field to capture and post the original value after submission
function cp_js_end() { $data = ''; if ($this->EE->extensions->last_call !== FALSE) { $data = $this->EE->extensions->last_call; } $js = ' $(".pageContents form").has("input[name=cat_name]#cat_name").find("input[name=cat_url_title]#cat_url_title").each(function() { var $cat_url_title = $(this); if ($(".pageContents form").find("input[name=cat_id]").length > 0) { $cat_url_title.after( $("<input>") .attr("type", "hidden") .attr("name", "orig_cat_url_title") .val($cat_url_title.val()) ); } }); '; $js = ( ! empty($js)) ? NL . '(function($) {'.$js.'})(jQuery);' : ''; return $data . $js; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wp_ajax_press_this_add_category()\n {\n }", "private function getCategoryPostData()\n {\n // Get data from form fields\n $this->data['category_title'] = $this->input->post('category_title');\n }", "function product_category_edit(){\n\t\tglobal $tpl, $config, $meta, $_r, $_l, $_u, $fs;\n\t\t\n\t\t$data = $_r['data'];\n\t\t$data['id'] = $_r['id'];\n\t\t\n\t\tif($data['save'] || $data['apply']){\n\t\t\tif(!$data['title']) $error['title'] = true;\n\t\t\tif(count($error)==0){\n\t\t\t\t$set = array();\n\t\t\t\t$set[] = \"title = '\".add_slash($data['title']).\"'\";\n\t\t\t\t$set[] = \"language_id = '1'\";\n\t\t\t\t$set[] = \"category_id = '0'\";\n\t\t\t\t\n\t\t\t\t$set = implode(', ', $set);\n\t\t\t\tif($data['id']){\n\t\t\t\t\tmysql_q(\"UPDATE product_category SET $set WHERE id = '\".add_slash($data['id']).\"'\");\n\t\t\t\t} else {\n\t\t\t\t\t$data['id'] = mysql_q(\"INSERT INTO product_category SET $set\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($data['save']){\n\t\t\t\t\tredirect(\"product_category.htm\", \"\");\n\t\t\t\t} else{\n\t\t\t\t\tredirect(\"product_category-edit-\".$data['id'].\".htm\", \"\");\n\t\t\t\t}\n\t\t\t}\n\t\t} else if($data['cancel']) {\n\t\t\tredirect(\"product_category.htm\", \"\");\n\t\t}\n\n\t\t$fields = \"\n\t\t[hidden name='id']\n\t\t[input name='title' label='Category Title' error='Please Enter Category Title']\n\t\t[sac class='']\n\t\t\";\n\t\t\n\t\tif(!$data['save'] && $data['id']){\n\t\t\t$data = mysql_q(\"SELECT * FROM product_category WHERE id='\".add_slash($data['id']).\"'\", \"single\");\n\t\t}\n\n\t\t$tpl->assign(\"data\", $data);\n\t\t\n\t\t$form = new form();\n\t\t$form->add($fields);\n\t\t$tpl->assign(\"form1\", $form->build());\n\t\t\n\t\t$main['content'] = $tpl->fetch(\"admin_product_category_edit.tpl\");\n\t\tdisplay($main);\n\t}", "function categoryAdd($str=''){\n\n\t#Get referring page to send users back to\n\t$previous = $_SERVER['HTTP_REFERER'];\n\n\t$str .= '<!-- start general content -->\n\t\t<script type=\"text/javascript\" src=\"' . VIRTUAL_PATH . '_js/util.js\"></script>\n\n\t\t<script type=\"text/javascript\">\n\n\t\t\tfunction checkForm(thisForm)\n\n\t\t\t{//check form data for valid info\n\t\t\t\tif(empty(thisForm.FirstName,\"Please Enter Customer\\'s First Name\")){return false;}\n\t\t\t\tif(empty(thisForm.LastName,\"Please Enter Customer\\'s Last Name\")){return false;}\n\t\t\t\tif(!isEmail(thisForm.Email,\"Please Enter a Valid Email\")){return false;}\n\t\t\t\treturn true;//if all is passed, submit!\n\t\t\t}\n\n\t\t</script>\n\n\n\t\t<div class=\"row\" style=\"\"><!-- begin content -->\n\t\t\t<form action=\"' . THIS_PAGE . '\" method=\"post\" onsubmit=\"return checkForm(this);\" >\n\n\n\t\t\t\t<input type=\"hidden\" name=\"CatID\" />\n\n\t\t\t\t<!-- inner container -->\n\t\t\t\t<div class=\"class=\"col-sm-9 pull-right\" style=\"\">\n\n\t\t\t\t\t<!-- left container -->\n\t\t\t\t\t<div class=\"col-sm-8 pull-left\" style=\"\">\n\t\t\t\t\t\t<h4 class=\"text-center\">Add New Catagory</b></h4>';\n\n\n\n\n\t\t\t\t\t\t\t$str .= '<div class=\"row \">\n\t\t\t\t\t\t\t\t<div class=\"pull-middle\">\n\n\t\t\t\t\t\t\t\t\t<select class=\"selectpicker\" name=\"CatSort\" required>\n\t\t\t\t\t\t\t\t\t\t<option value=\"person\" select=\"select\">Group By: Indivual</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"team\">Group By: Group/Team</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"organization\">Group By: Organization</option>\n\t\t\t\t\t\t\t\t\t</select>\n\n\n\t\t\t\t\t\t\t\t\t<select class=\"selectpicker\" name=\"CatSort\" required>\n\t\t\t\t\t\t\t\t\t\t<option value=\"individual\" select=\"select\">Catagory Type: IC</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"team\">Catagory Type: OOC</option>\n\t\t\t\t\t\t\t\t\t</select>\n\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div><!-- END Container -->\n\n\t\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\tclass=\"col-sm-12\"\n\t\t\t\t\t\t\t\t\ttype=\"text\"\n\n\t\t\t\t\t\t\t\t\tname=\"CatTitle\"\n\t\t\t\t\t\t\t\t\tplaceholder=\"Team/Group/Character Name here\"/>\n\t\t\t\t\t\t\t</div><!-- END Container -->\n\n\t\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t\t<textarea\n\t\t\t\t\t\t\t\t\tname=\"CatDescription\"\n\n\t\t\t\t\t\t\t\t\tclass=\"autoExpand col-sm-12\"\n\t\t\t\t\t\t\t\t\trows=\"3\"\n\t\t\t\t\t\t\t\t\tdata-min-rows=\"3\"\n\n\t\t\t\t\t\t\t\t\tplaceholder=\"Catagory Description\"\n\t\t\t\t\t\t\t\t\t></textarea>\n\t\t\t\t\t\t\t</div><!-- end container-->\n\n\n\t\t\t\t\t</div><!-- end inner container -->\n\n\t\t\t\t<div class=\"clearfix\">\n\t\t\t\t\t<br /><br />\n\t\t\t\t</div>\n\n\t\t\t\t<div\n\t\t\t\t\talign=\"center\"\n\t\t\t\t\tstyle=\"\">\n\n\t\t\t\t\t<input type=\"hidden\" name=\"act\" value=\"categoryInsert\" />\n\t\t\t\t\t<input class=\"btn btn-primary btn-xs \" type=\"submit\" value=\"Add Catagory\">\n\n\t\t\t\t\t&nbsp; &nbsp;\n\n\t\t\t\t\t<a class=\"btn btn-primary btn-xs outline\" href=\"' . $previous . '\">Exit Post</a>\n\t\t\t\t</div>\n\n\t\t\t</form>\n\t\t</div>\n\n\t<!-- END content -->';\n\n\treturn $str;\n}", "public static function func_ajax_add_category() {\n\t\t\t \n\t\t\t\tglobal $wpdb;\n\t\t\t\t\n\t\t\t\tif(!defined('DOING_AJAX')){\n wp_redirect (site_url());\n exit;\n } else {\n $self = self::sanitize($_POST['name']);\n $day = self::sanitize($_POST['day']);\n $desc = self::sanitize($_POST['description']);\n $wpdb->query($wpdb->prepare( \"INSERT INTO \".$wpdb->prefix.self::$table_name .\" VALUES (%d, %s, %s, %s)\", null, $self,$day,$desc ));\n die();\n\t\t\t\t}\n\t\t\n\t\t}", "private function setCategoryDefaultValues()\n {\n if($this->formMode === 'add')\n {\n $this->data['category_title'] = '';\n }\n else if(empty($_POST['category_submit']))\n {\n // Retrieve data from database if NOT POST request\n $data = $this->post_categories_model->getByID($this->data['category_id']);\n $this->data['category_title'] = $data['Post_Category_Title'];\n }\n }", "function lm_save_category() {\n\t@copy(LM_CDATA, LM_CBACKUP);\n\t$id = isset($_POST['category-id']) ? intval($_POST['category-id']) : null;\n\t$cid = isset($_POST['category-cid']) ? intval($_POST['category-cid']) : time();\n\t$arr = array('cid'=>$cid, 'name'=>safe_slash_html($_POST['category-name']));\n\tif (function_exists('return_i18n_languages')) {\n\t\tforeach(return_i18n_languages() as $lang) {\n\t\t\tif ($lang != return_i18n_default_language()) {\n\t\t\t\t$arr['name_'.$lang] = safe_slash_html($_POST['category-name_'.$lang]);\n\t\t\t}\n\t\t}\n\t}\n\t$categories = lm_get_categories();\n\tif (isset($id))\n\t\t$categories[$id] = $arr;\n\telse\n\t\t$categories[] = $arr;\n\tif (lm_c_to_xml($categories))\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/SUCCESS_SAVE'), true, false, true);\n\telse\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/ERROR_SAVE'), false);\n}", "function save_categ_redirect($data) {\n\t\t\tupdate_option('categ_url_hack', $data);\n\t\t}", "function _arc_meta_category_meta($event, $step, $data, $rs)\n{\n // category types).\n if ($rs['type']!='article') {\n return $data;\n }\n\n // Get the existing meta data for this category.\n $meta = _arc_meta('category', $rs['name'], true);\n\n $form = hInput('arc_meta_id', $meta['id']);\n $form .= '<div class=\"txp-form-field edit-category-arc_meta_title\">';\n $form .= '<div class=\"txp-form-field-label\">' . tag(gtxt('arc_meta_title'), 'label', ' for=\"arc_meta_title\"') . '</div>';\n $form .= '<div class=\"txp-form-field-value\">' . fInput('text', 'arc_meta_title', $meta['title'], '', '', '', '32', '', 'arc_meta_title') . '</div>';\n $form .= '</div>';\n $form .= '<div class=\"txp-form-field edit-category-arc_meta_image\">';\n $form .= '<div class=\"txp-form-field-label\">' . tag(gtxt('arc_meta_image'), 'label', ' for=\"arc_meta_image\"') . '</div>';\n $form .= '<div class=\"txp-form-field-value\">' . fInput('number', 'arc_meta_image', $meta['image'], '', '', '', '32', '', 'arc_meta_image') . '</div>';\n $form .= '</div>';\n $form .= '<div class=\"txp-form-field edit-category-arc_meta_robots\">';\n $form .= '<div class=\"txp-form-field-label\">' . tag(gtxt('arc_meta_robots'), 'label', ' for=\"arc_meta_description\"') . '</div>';\n $form .= '<div class=\"txp-form-field-value\">' . selectInput('arc_meta_robots', _arc_meta_robots(), $meta['robots'], 'arc_meta_robots') . '</div>';\n $form .= '</div>';\n\n return $data . $form;\n}", "protected function addOnSubmitJavaScriptCode() {}", "function tck_custom_js() {\n?>\n <script language=\"javascript\">\n function edit_link_save_custom(id) {\n add_loading(\"#edit-close-\" + id);\n var newurl = encodeURI( $(\"#edit-url-\" + id).val() );\n var newkeyword = $(\"#edit-keyword-\" + id).val();\n var title = $(\"#edit-title-\" + id).val();\n var custom = ($(\"#edit-custom-\" + id).is(':checked') ? 1 : 0);\n var keyword = $('#old_keyword_'+id).val();\n var nonce = $('#nonce_'+id).val();\n var www = $('#yourls-site').val();\n\n $.getJSON(\n ajaxurl,\n {action:'edit_save_custom', url: newurl, id: id, keyword: keyword, newkeyword: newkeyword, title: title, custom: custom, nonce: nonce },\n function(data){\n if(data.status == 'success') {\n\n if( data.url.title != '' ) {\n var display_link = '<a href=\"' + data.url.url + '\" title=\"' + data.url.url + '\">' + data.url.display_title + '</a><br/><small><a href=\"' + data.url.url + '\">' + data.url.display_url + '</a></small>';\n } else {\n var display_link = '<a href=\"' + data.url.url + '\" title=\"' + data.url.url + '\">' + data.url.display_url + '</a>';\n }\n\n $(\"#url-\" + id).html(display_link);\n $(\"#keyword-\" + id).html('<a href=\"' + data.url.shorturl + '\" title=\"' + data.url.shorturl + '\">' + data.url.keyword + '</a>');\n $(\"#timestamp-\" + id).html(data.url.date);\n $(\"#edit-\" + id).fadeOut(200, function(){\n $('#main_table tbody').trigger(\"update\");\n });\n $('#keyword-'+id).val( newkeyword );\n $('#custom-'+id).html( data.url.custom );\n $('#statlink-'+id).attr( 'href', data.url.shorturl+'+' );\n }\n feedback(data.message, data.status);\n end_loading(\"#edit-close-\" + id);\n end_disable(\"#actions-\" + id + ' .button');\n }\n );\n }\n </script>\n<?php\n }", "function colorpicker_field_add_new_category( $taxonomy ) { ?> \r\n\t<div class=\"form-field term-colorpicker-wrap\"> \r\n\t<label for=\"term-colorpicker\">Category Color</label> \r\n\t<input name=\"_category_color\" value=\"#ffffff\" class=\"colorpicker\" id=\"term-colorpicker\" /> \r\n\t<p>This is the field description where you can tell the user how the color is used in the theme.</p> \r\n\t</div> <?php }", "private function categoriesFormInputs()\n {\n // Get the field name of the field with the category icon\n // #47631, dwildt, 1-\n //$arrLabels[ 'catIcon' ] = $this->confMap['configuration.']['categories.']['fields.']['categoryIcon'];\n // #47631, #i0007, dwildt, 10+\n switch ( true )\n {\n case( $this->pObj->typoscriptVersion <= 4005004 ):\n $arrLabels[ 'catIcon' ] = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'fields.' ][ 'categoryIcon' ];\n break;\n case( $this->pObj->typoscriptVersion <= 4005007 ):\n default:\n $arrLabels[ 'catIcon' ] = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'fields.' ][ 'marker.' ][ 'categoryIcon' ];\n break;\n }\n // #47631, #i0007, dwildt, 10+\n // Default space in HTML code\n $tab = ' ';\n\n // FOREACH category label\n//$this->pObj->dev_var_dump( $this->arrCategories );\n // #i0118, dwildt, 1-/+\n //foreach ( $this->arrCategories[ 'labels' ] as $labelKey => $labelValue )\n foreach ( ( array ) $this->arrCategories[ 'labels' ] as $labelKey => $labelValue )\n {\n // Get the draft for an input field\n $cObj_name = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'form_input' ];\n $cObj_conf = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'form_input.' ];\n $input = $this->pObj->cObj->cObjGetSingle( $cObj_name, $cObj_conf );\n // replace the category marker\n $input = str_replace( '###CAT###', $labelValue, $input );\n // 4.1.17, 120927, dwildt\n // replace the category marker\n //$labelValueWoSpc = str_replace( ' ', null, $labelValue );\n $labelValueWoSpc = $this->zz_properFormLabel( $labelValue );\n $input = str_replace( '###CAT_WO_SPC###', $labelValueWoSpc, $input );\n // 4.1.17, 120927, dwildt\n // #54548, 131221, dwildt, 6+\n $class = $this->arrCategories[ 'cssClass' ][ $labelKey ];\n if ( !empty( $class ) )\n {\n $class = ' class=\"' . $class . '\"';\n }\n $input = str_replace( '###CLASS###', $class, $input );\n\n // IF draft for an input field contains ###IMG###, render an image\n $pos = strpos( $input, '###IMG###' );\n if ( !( $pos === false ) )\n {\n // SWITCH : Render the image\n switch ( true )\n {\n // #i0062\n case( $labelKey == $this->arrWoCategories[ 'iconKey' ] ):\n $name = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'colours.' ][ 'legend.' ][ $labelKey ];\n $conf = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'colours.' ][ 'legend.' ][ $labelKey . '.' ];\n $img = $this->pObj->cObj->cObjGetSingle( $name, $conf );\n break;\n case( is_array( $this->arrCategories[ 'icons' ] ) ):\n // 4.1.7, dwildt, +\n $this->cObjDataAddArray( array( $arrLabels[ 'catIcon' ] => $this->arrCategories[ 'icons' ][ $labelKey ] ) );\n $img = $this->renderMapMarkerVariablesSystemItem( 'categoryIconLegend' );\n $this->cObjDataRemoveArray( array( $arrLabels[ 'catIcon' ] => $this->arrCategories[ 'icons' ][ $labelKey ] ) );\n // 4.1.7, dwildt, +\n break;\n default:\n // Render the image\n $name = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'colours.' ][ 'legend.' ][ $labelKey ];\n $conf = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'colours.' ][ 'legend.' ][ $labelKey . '.' ];\n $img = $this->pObj->cObj->cObjGetSingle( $name, $conf );\n break;\n }\n // SWITCH : Render the image\n\n $input = str_replace( '###IMG###', $img, $input );\n }\n // IF draft for an input field contains ###IMG###, render an image\n\n $arrInputs[] = $tab . $input;\n }\n // FOREACH category label\n // Move array of input fields to a string\n // #i0118, dwildt, 1-/+\n //$inputs = implode( PHP_EOL, $arrInputs );\n $inputs = implode( PHP_EOL, ( array ) $arrInputs );\n $inputs = trim( $inputs );\n\n // RETURN input fields\n return $inputs;\n }", "public function es_add_category_fields() {\n\t\t\t?>\n\t\t\t<div class=\"form-field\">\n\t\t\t\t<label><?php _e( 'Banner', 'woocommerce' ); ?></label>\n\t\t\t\t<div id=\"product_cat_banner\" style=\"float:left;margin-right:10px;\"><img src=\"<?php echo esc_url( wc_placeholder_img_src() ); ?>\" width=\"60px\" height=\"60px\" /></div>\n\t\t\t\t<div style=\"line-height:60px;\">\n\t\t\t\t\t<input type=\"hidden\" id=\"product_cat_banner_id\" name=\"product_cat_banner_id\" />\n\t\t\t\t\t<button type=\"button\" class=\"banner_upload_image_button button\"><?php _e( 'Upload/Add image', 'woocommerce' ); ?></button>\n\t\t\t\t\t<button type=\"button\" class=\"banner_remove_image_button button\"><?php _e( 'Remove image', 'woocommerce' ); ?></button>\n\t\t\t\t</div>\n\n\n\t\t\t<script type=\"text/javascript\">\n\n\t\t\t\t// Only show the \"remove image\" button when needed\n\t\t\t\tif ( ! jQuery('#product_cat_banner_id').val() ) {\n\t\t\t\t\tjQuery('.banner_remove_image_button').hide();\n\t\t\t\t}\n\n\t\t\t\t// Uploading files\n\t\t\t\tvar file_frame;\n\n\t\t\t\tjQuery( document ).on( 'click', '.banner_upload_image_button', function( event ) {\n\n\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t// Create the media frame.\n\t\t\t\t\tfile_frame = wp.media.frames.downloadable_file = wp.media({\n\t\t\t\t\t\ttitle: '<?php _e( 'Choose an image', 'woocommerce' ); ?>',\n\t\t\t\t\t\tbutton: {\n\t\t\t\t\t\t\ttext: '<?php _e( 'Use image', 'woocommerce' ); ?>',\n\t\t\t\t\t\t},\n\t\t\t\t\t\tmultiple: false\n\t\t\t\t\t});\n\n\t\t\t\t\t// When an image is selected, run a callback.\n\t\t\t\t\tfile_frame.on( 'select', function() {\n\t\t\t\t\t\tattachment = file_frame.state().get('selection').first().toJSON();\n\n\t\t\t\t\t\tjQuery('#product_cat_banner_id').val( attachment.id );\n\t\t\t\t\t\tjQuery('#product_cat_banner img').attr('src', attachment.url );\n\t\t\t\t\t\tjQuery('.banner_remove_image_button').show();\n\n\t\t\t\t\t\tfile_frame = undefined;\n\n\t\t\t\t\t});\n\n\t\t\t\t\t// Finally, open the modal.\n\t\t\t\t\tfile_frame.open();\n\t\t\t\t});\n\n\t\t\t\tjQuery( document ).on( 'click', '.banner_remove_image_button', function( event ) {\n\t\t\t\t\tjQuery('#product_cat_banner img').attr('src', '<?php echo esc_url( wc_placeholder_img_src() ); ?>');\n\t\t\t\t\tjQuery('#product_cat_banner_id').val('');\n\t\t\t\t\tjQuery('.banner_remove_image_button').hide();\n\t\t\t\t\treturn false;\n\t\t\t\t});\n\n\t\t\t</script>\n\t\t\t\t<div class=\"clear\"></div>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}", "public function ajax_save_category()\n {\n $translation = ee()->input->post('translation');\n $status = ee()->input->post('publisher_save_status');\n\n // Stop here if false or if the array is empty\n if ( !$translation || empty($translation))\n {\n ee()->publisher_helper->send_ajax_response('failure');\n }\n\n $result = ee()->publisher_category->save_translation($translation, $status);\n\n if ($result)\n {\n ee()->publisher_helper->send_ajax_response('success');\n }\n else\n {\n ee()->publisher_helper->send_ajax_response($result);\n }\n }", "function wp_ajax_add_link_category($action)\n {\n }", "public function category_urlSlugGenerator()\n {\n $output['token'] = $this->security->get_csrf_hash();\n header('Content-Type: application/json');\n $slug = $this->input->post('title', true);\n $output['response'] = $this->common->_urlSlugGenerator('tbl_categories', 'id', 'url_slug', $slug);\n $output = html_escape($this->security->xss_clean($output));\n exit(json_encode($output));\n }", "function templ_save_comment_script() {\n\t$javascript = <<<JS\n <script type=\"text/javascript\">\n var sub = document.getElementById('submit');\n document.getElementById('recaptcha-submit-btn-area').appendChild (sub);\n document.getElementById('submit').tabIndex = 6;\n if ( typeof _recaptcha_wordpress_savedcomment != 'undefined') {\n document.getElementById('comment').value = \n _recaptcha_wordpress_savedcomment;\n }\n </script>\nJS;\n\techo $javascript;\n}", "function my_admin_add_js() {\n\t$screen = get_current_screen();\n\tif ($screen->id == 'contact') {\n\t\techo \"<script>document.getElementById('newcategory_parent').remove()</script>\n\t\t <script>document.getElementById('titlediv').remove(); </script>\";\n\t\t wp_enqueue_script('inputmask', get_template_directory_uri() . '/js/jquery.inputmask.bundle.min.js', array('jquery'));\n wp_enqueue_script('admin', get_template_directory_uri() . '/js/admin.js', array('jquery'));\n\t}\n}", "private function escapeCategories()\n {\n foreach($this->data['categories'] as $key => $category)\n {\n $this->data['categories'][$key]['Post_Category_Title'] = $this->security->xss_clean($category['Post_Category_Title'] );\n }\n }", "public function ajax_get_category()\n {\n $cat_id = ee()->input->get('cat_id');\n $group_id = ee()->input->get('group_id');\n $status = ee()->input->get('publisher_view_status') ? ee()->input->get('publisher_view_status') : PUBLISHER_STATUS_OPEN;\n\n $data = array(\n 'cat_id' => $cat_id,\n 'status' => $status\n );\n\n $vars = ee()->publisher_helper->get_toolbar_options('category', $data, FALSE);\n\n $vars['cat_id'] = $cat_id;\n $vars['group_id'] = $group_id;\n $vars['data'] = ee()->publisher_category->get_translations($cat_id, $group_id, $status);\n $vars['save_url'] = ee()->publisher_helper_cp->mod_link('ajax_save_category', array(), TRUE);\n $vars['custom_fields'] = ee()->publisher_category->get_custom_fields($group_id);\n\n // Load core lang file so views are translated\n ee()->lang->loadfile('content');\n\n if (ee()->input->get('publisher_view_status'))\n {\n $data = ee()->load->view('category/edit_form', $vars, TRUE);\n }\n else\n {\n $data = ee()->load->view('category/edit', $vars, TRUE);\n }\n\n ee()->publisher_helper->send_ajax_response($data);\n }", "function kulam_acf_prepare_acf_form_post_category_field( $field ) {\n\n\t/**\n\t * Variables\n\t */\n\t$field_label = get_field( 'acf-form_form_category_title' );\n\n\tif ( $field_label ) {\n\n\t\t$field[ 'label' ] = $field_label;\n\n\t}\n\n\t// return\n\treturn $field;\n\n}", "function categ_redirect() {\n\n\t\t\t$redirects = get_option('categ_url_hack');\n\t\t\t$categ = get_query_var('cat');\n\t\t\t$categz = array();\n\n // WPML compliant\n/*\n $original = array_key_exists( 'wpml_object_id' , $GLOBALS['wp_filter'] ) ? apply_filters( 'wpml_object_id', $currenta, 'category', true, $default_lg ) : $currenta;\n apply_filters( 'wpml_object_id', int $element_id, string $element_type, bool $return_original_if_missing, mixed $ulanguage_code )\n*/\n if ( array_key_exists( 'wpml_object_id' , $GLOBALS['wp_filter'] ) ) {\n global $sitepress, $wpdb;\n $defaultlg = $sitepress->get_default_language();\n \n $query = \"SELECT trid, language_code, source_language_code FROM wp_icl_translations WHERE element_id='$categ' AND element_type='tax_category'\";\n $trid = $wpdb->get_var( $query, 0 );\n $source_lg = $wpdb->get_var( $query, 2 );\n \n $query2 = \"SELECT element_id FROM wp_icl_translations WHERE trid='$trid' AND element_type='tax_category'\";\n $results_cat = $wpdb->get_results($query2, ARRAY_A);\n \n foreach ($results_cat as $k) {\n $categz[] = $k['element_id'];\n }\n }\n\n\t\t\tif ( !empty($redirects) && !empty($categz) ) {\n\t\t\t if( $redirects['categ'] == $categ || in_array($redirects['categ'], $categz) ) {\n\t\t\t wp_redirect( $redirects['url'] );\n exit();\n }\n\t\t\t}\n\t\t}", "function display_addcategory_form($category_name='', $id='')\r\n{\r\n\tglobal $dropbox_cnf;\r\n\r\n\t$title=get_lang('AddNewCategory');\r\n\r\n\tif (isset($id) AND $id<>'')\r\n\t{\r\n\t\t// retrieve the category we are editing\r\n\t\t$sql=\"SELECT * FROM \".$dropbox_cnf['tbl_category'].\" WHERE cat_id='\".Database::escape_string($id).\"'\";\r\n\t\t$result=api_sql_query($sql);\r\n\t\t$row=mysql_fetch_array($result);\r\n\r\n\t\tif ($category_name=='') // after an edit with an error we do not want to return to the original name but the name we already modified. (happens when createinrecievedfiles AND createinsentfiles are not checked)\r\n\t\t{\r\n\t\t\t$category_name=$row['cat_name'];\r\n\t\t}\r\n\t\tif ($row['received']=='1')\r\n\t\t{\r\n\t\t\t$target='received';\r\n\t\t}\r\n\t\tif ($row['sent']=='1')\r\n\t\t{\r\n\t\t\t$target='sent';\r\n\t\t}\r\n\t\t$title=get_lang('EditCategory');\r\n\r\n\t}\r\n\r\n\tif ($_GET['action']=='addreceivedcategory')\r\n\t{\r\n\t\t$target='received';\r\n\t}\r\n\tif ($_GET['action']=='addsentcategory')\r\n\t{\r\n\t\t$target='sent';\r\n\t}\r\n\r\n\r\n\techo \"<form name=\\\"add_new_category\\\" method=\\\"post\\\" action=\\\"\".api_get_self().\"?view=\".$_GET['view'].\"\\\">\\n\";\r\n\techo '<strong>'.$title.'</strong>';\r\n\tif (isset($id) AND $id<>'')\r\n\t{\r\n\t\techo '<input name=\"edit_id\" type=\"hidden\" value=\"'.$id.'\">';\r\n\t}\r\n\techo '<input name=\"target\" type=\"hidden\" value=\"'.$target.'\">';\r\n\techo \"<table border=\\\"0\\\">\\n\";\r\n\techo \"\\t<tr>\\n\";\r\n\techo \"\\t<td>\\n\";\r\n\techo get_lang('CategoryName').': ';\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t<td>\\n\";\r\n\techo \"<input type=\\\"text\\\" name=\\\"category_name\\\" value=\\\"\".$category_name.\"\\\" />\";\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t</tr>\\n\";\r\n\techo \"\\t<tr>\\n\";\r\n\techo \"\\t<td valign=\\\"top\\\">\\n\";\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t<td>\\n\";\r\n\techo \"<input type=\\\"submit\\\" name=\\\"StoreCategory\\\" value=\\\"\".get_lang('Ok').\"\\\">\";\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t</tr>\\n\";\r\n\techo \"</table>\\n\";\r\n\techo \"</form>\";\r\n}", "function SRW_hiddenfield_title() {\r\n\tglobal $post; ?>\r\n\t<script>\r\n\t\tjQuery(document).ready(function($){\r\n\t\t\tif( $('input#page-title').length > 0 ){\r\n\t\t\t\t$('input#page-title').val('<?php echo $post->post_title ?>');\r\n\t\t\t}\r\n\t\t})\r\n\t</script>\r\n\t<?php\r\n}", "function extra_category_fields( $tag ) { //check for existing featured ID\n $t_id = $tag->term_id;\n $cat_meta = get_option( \"category_$t_id\");\n\t?>\n\t<tr class=\"form-field\">\n\t\t<th scope=\"row\" valign=\"top\"><label for=\"cat_Image_url\"><?php _e('Category Url'); ?></label></th>\n\t\t<td><input type=\"text\" name=\"Cat_meta[cat_url]\" id=\"Cat_meta[img]\" size=\"3\" style=\"width:60%;\" value=\"<?php echo $cat_meta['cat_url'] ? $cat_meta['cat_url'] : ''; ?>\"><br />\n\t <span class=\"description\"><?php _e('Url for category'); ?></span>\n\t\t</td>\n\t</tr>\n\t<?php\n}", "function insert_cat()\n\t {\n\t\t $cat_par_id = $_POST['cat_par_id'];\n\t\t if(mysql_real_escape_string(trim($_POST['cat_title']))=='')\n\t\t {\n\t\t return '<span class=\"err\">please enter the category title</span>';\n\t\t }\n\t\t else\n\t\t {\n\t\t mysql_query(\"insert into category(cat_par_id,cat_title,cat_des) values('$cat_par_id','\".mysql_real_escape_string(trim($_POST['cat_title'])).\"','\".mysql_real_escape_string(trim($_POST['cat_des'])).\"')\");\n\t\t unset($_POST);\n\t\t return '<span class=\"fine\">category inserted successfully...</span>';\n\t\t }\n \t \n }", "function edit_form_after_title()\n {\n }", "function edit_form_after_title()\n {\n }", "public function form($instance) {\n\n // set up background color\n $bg_color = \"#212121\";\n if (isset($instance['bg_color'])) {\n $bg_color = $instance['bg_color'];\n }\n?>\n <div class=\"an-catlinks-settings-container\">\n <p>\n <label for=\"<?php echo $this->get_field_id( 'bg_color' ); ?>\" style=\"display:block;\"><?php _e( 'Background Color:', 'an_catlinks_wiget' ); ?></label>\n <input class=\"widefat color-picker an-catlist-bg-color-picker\"\n id=\"<?php echo $this->get_field_id( 'bg_color' ); ?>\"\n name=\"<?php echo $this->get_field_name( 'bg_color' ); ?>\" type=\"text\" value=\"<?php echo esc_attr( $bg_color ); ?>\" />\n </p>\n\n<?php\n // setup font color\n $font_color = \"#ffffff\";\n if (isset($instance['font_color'])) {\n $font_color = $instance['font_color'];\n }\n?>\n <p>\n <label for=\"<?php echo $this->get_field_id( 'font_color' ); ?>\" style=\"display:block;\"><?php _e( 'Font color:', 'an_catlinks_wiget' ); ?></label>\n <input class=\"widefat color-picker\"\n id=\"<?php echo $this->get_field_id( 'font_color' ); ?>\"\n name=\"<?php echo $this->get_field_name( 'font_color' ); ?>\" type=\"text\" value=\"<?php echo esc_attr( $font_color ); ?>\" />\n </p>\n\n<?php\n // set up 1st category\n $cat = 0;\n if (isset($instance['cat1'])) {\n $cat = $instance['cat1'];\n }\n?>\n <!-- 1st category and image -->\n <label for=\"<?php _e($this->get_field_id('cat1')); ?>\"><?php esc_html__(\"Category 1\", \"an_catlinks_wiget\"); ?></label>\n <select id=\"<?php _e($this->get_field_id('cat1')); ?>\" name=\"<?php _e($this->get_field_name('cat1')); ?>\" class=\"widefat\" width=\"100%\">\n <option value-\"0\"><?php _e('(not selected)', 'an_catlinks_wiget'); ?></option>\n <?php foreach(get_terms('category','parent=0&hide_empty=0') as $category): ?>\n <option <?php $cat == $category->term_id ? _e(\"selected\") : _e(\"\"); ?> value=\"<?php _e($category->term_id); ?>\">\n <?php _e($category->name); ?>\n </option>\n <?php endforeach; ?>\n </select>\n\n<?php\n // set up image for the first category\n $image = '';\n if(isset($instance['image1']))\n {\n $image = $instance['image1'];\n }\n?>\n\n <p class=\"an-catlinks-image-demo\">\n <label for=\"<?php _e($this->get_field_name( 'image1' )); ?>\"><?php _e( 'Image 1:', 'an_catlinks_wiget' ); ?></label>\n\n <input name=\"<?php _e($this->get_field_name( 'image1' )); ?>\"\n id=\"<?php _e($this->get_field_id( 'image1' )); ?>\"\n class=\"widefat\" type=\"text\" size=\"36\"\n value=\"<?php _e(esc_url( $image )); ?>\" />\n <img src=\"<?php _e(esc_url( $image )); ?>\" style=\"max-width: 100%; height: auto; background: <?php _e($bg_color); ?>\" />\n <input class=\"upload_image_button\" type=\"button\" value=\"<?php _e('Upload Image','an_catlinks_wiget'); ?>\" />\n </p>\n\n <!-- 2nd category and image -->\n<?php\n $cat = 0;\n if (isset($instance['cat2'])) {\n $cat = $instance['cat2'];\n }\n?>\n <label for=\"<?php _e($this->get_field_id('cat2')); ?>\"><?php esc_html__(\"Category 2\", \"an_catlinks_wiget\"); ?></label>\n <select id=\"<?php _e($this->get_field_id('cat2')); ?>\" name=\"<?php _e($this->get_field_name('cat2')); ?>\" class=\"widefat\" width=\"100%\">\n <option value-\"0\"><?php _e('(not selected)', 'an_catlinks_wiget'); ?></option>\n <?php foreach(get_terms('category','parent=0&hide_empty=0') as $category): ?>\n <option <?php $cat == $category->term_id ? _e(\"selected\") : _e(\"\"); ?> value=\"<?php _e($category->term_id); ?>\">\n <?php _e($category->name); ?>\n </option>\n <?php endforeach; ?>\n </select>\n\n<?php\n $image = '';\n if(isset($instance['image2']))\n {\n $image = $instance['image2'];\n }\n?>\n\n <p class=\"an-catlinks-image-demo\">\n <label for=\"<?php _e($this->get_field_name( 'image2' )); ?>\"><?php _e( 'Image 2:', 'an_catlinks_wiget' ); ?></label>\n\n <input name=\"<?php _e($this->get_field_name( 'image2' )); ?>\"\n id=\"<?php _e($this->get_field_id( 'image2' )); ?>\"\n class=\"widefat\" type=\"text\" size=\"36\"\n value=\"<?php _e(esc_url( $image )); ?>\" />\n <img src=\"<?php _e(esc_url( $image )); ?>\" style=\"max-width: 100%; height: auto;background: <?php _e($bg_color); ?>\" />\n <input class=\"upload_image_button\" type=\"button\" value=\"<?php _e('Upload Image','an_catlinks_wiget'); ?>\" />\n </p>\n\n <!-- 3rd category and image -->\n\n <?php\n $cat = 0;\n if (isset($instance['cat3'])) {\n $cat = $instance['cat3'];\n }\n ?>\n <label for=\"<?php _e($this->get_field_id('cat3')); ?>\"><?php esc_html__(\"Category 3\", \"an_catlinks_wiget\"); ?></label>\n\n <select id=\"<?php _e($this->get_field_id('cat3')); ?>\" name=\"<?php _e($this->get_field_name('cat3')); ?>\" class=\"widefat\" width=\"100%\">\n <option value-\"0\"><?php _e('(not selected)', 'an_catlinks_wiget'); ?></option>\n <?php foreach(get_terms('category','parent=0&hide_empty=0') as $category): ?>\n <option <?php $cat == $category->term_id ? _e(\"selected\") : _e(\"\"); ?> value=\"<?php _e($category->term_id); ?>\">\n <?php _e($category->name); ?>\n </option>\n <?php endforeach; ?>\n </select>\n\n<?php\n $image = '';\n if(isset($instance['image3']))\n {\n $image = $instance['image3'];\n }\n?>\n\n <p class=\"an-catlinks-image-demo\">\n <label for=\"<?php _e($this->get_field_name( 'image3' )); ?>\"><?php _e( 'Image 3:', 'an_catlinks_wiget' ); ?></label>\n\n <input name=\"<?php _e($this->get_field_name( 'image3' )); ?>\"\n id=\"<?php _e($this->get_field_id( 'image3' )); ?>\"\n class=\"widefat\" type=\"text\" size=\"36\"\n value=\"<?php _e(esc_url( $image )); ?>\" />\n <img src=\"<?php _e(esc_url( $image )); ?>\" style=\"max-width: 100%; height: auto;background: <?php _e($bg_color); ?>\" />\n <input class=\"upload_image_button\" type=\"button\" value=\"<?php _e('Upload Image','an_catlinks_wiget'); ?>\" />\n </p>\n </div>\n <script>\n\n (function($) {\n\n $(document).ready(function() {\n $('.color-picker').wpColorPicker({\n change: function(event, ui) {\n $(this).parent().trigger('change');\n\n if ($(this).hasClass('an-catlist-bg-color-picker')) {\n $('.an-catlinks-image-demo img').css('background',$(this).val());\n }\n },\n\n clear: function(event) {\n $(this).parent().trigger('change');\n\n if ($(this).hasClass('an-catlist-bg-color-picker')) {\n $('.an-catlinks-image-demo img').css('background','transparent');\n }\n }\n\n });\n\n });\n }\n )(jQuery);\n\n </script>\n\n<?php\n\n }" ]
[ "0.57493216", "0.5638515", "0.5587308", "0.5583835", "0.5576168", "0.5532479", "0.5492839", "0.5468453", "0.5453175", "0.5439546", "0.542789", "0.5405437", "0.53552526", "0.52939606", "0.5288841", "0.5271692", "0.5238602", "0.5228893", "0.52277046", "0.5167096", "0.5166725", "0.5166276", "0.5149655", "0.5132167", "0.51272017", "0.51069653", "0.5100877", "0.5091436", "0.5091436", "0.5089934" ]
0.7567759
0
caso: cargarAlumno (post): Se deben guardar los siguientes datos: nombre, apellido, email y foto. Los datos se guardan en el archivo de texto alumnos.txt, tomando el email como identificador.
public static function cargarAlumno() { throw new Exception('No implementado aun '); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cargarDatostxt(){\n // Si no existe lo creo\n $tabla=[]; \n if (!is_readable(FILEUSER) ){\n // El directorio donde se crea tiene que tener permisos adecuados\n $fich = @fopen(FILEUSER,\"w\") or die (\"Error al crear el fichero.\");\n fclose($fich);\n }\n $fich = @fopen(FILEUSER, 'r') or die(\"ERROR al abrir fichero de usuarios\"); // abrimos el fichero para lectura\n \n while ($linea = fgets($fich)) {\n $partes = explode('|', trim($linea));\n // Escribimos la correspondiente fila en tabla\n $tabla[]= [ $partes[0],$partes[1],$partes[2],$partes[3]];\n }\n fclose($fich);\n return $tabla;\n}", "public function importarAdministrativos($archivo=$this->archivo){\n $lineas = file($archivo); \n $i=0; \n foreach ($lineas as $linea_num => $linea)\n { \n if($i != 0) \n { \n $administrativos = explode(\";\",$linea);\n $dni=trim($administrativos[0]);\n $apellidos=trim($administrativos[1]);\n $nombre = trim($administrativos[2]);\n $dependencia =trim($administrativos[3]);\n $telefono = trim($administrativos[4]);\n $correo = trim($administrativos[5]);\n $categoria = trim($administrativos[6]);\n $cargo= trim($administrativos[7]); \n mysql_query(\"INSERT INTO administrativos(nombre,edad,profesion) \n VALUES('$dni,'$apellidos','$nombre','$dependencia','$telefono','$correo','$categoria','$cargo')\");\n } \n $i++;\n }\n}", "public function importCsv()\n {\n if( auth()->user()->hasRole(['Administrador','Secretaria'])){\n //Agregado para rellenar las Carreras que no estaban\n $cuantos=Carrera::all()->count();\n //Creamos instancia de Faker designando el lenguaje a utilizar\n $faker = Faker::create('es_ES'); \n\n \n /** El método load permite cargar el archivo definido como primer parámetro */\n //Metodo para archivo Csv\n /** Carga del documento*/\n Excel::load($archivo.'.csv', function ($reader) {\n /**\n * $reader->get() nos permite obtener todas las filas de nuestro archivo\n */\n $rol_estudiante = Role::where('name', 'LIKE', 'Estudiante')->get()->first()->id;\n foreach ($reader->get() as $key => $row) {\n $persona = [\n 'nombre_apellido' => $row['apellido' . \" \" .'nombre'],\n 'dni' => $row['dni'],\n 'email' => $row['email'],\n 'fecha_registro' => $row['fecha_registro'],\n 'status' => $row['status'],\n ];\n //alumno\n \n $usuario = [\n 'email' => $row['email'],\n 'password' => \"123456\",\n 'username' => \"alumno\",\n \n ];\n\n /** Una vez obtenido los datos de la fila procedemos a registrarlos */\n if (!empty($archivo)) {\n //temporal de los datos de un usuario\n $data_user = $estudiante['usuario'];\n //temporal de los datos de una persona\n $data_persona = $estudiante['persona'];\n \n //Creamos un Usuario con los datos del temporal\n $user = User::create($data_user);\n \n //Actualizamos el temporal de los datos con el id del Usuario que referencia\n $data_persona['user_id'] = $user->id;\n \n //Creamos una Persona con los datos del temporal\n $persona = Persona::create($data_persona);\n \n //Hasheamos el Password del Usuario\n $user->hashPassword();\n //Actualizamos el Username del Usuario\n $user->updateUsername();\n //Asignamos el Rol del Estudiante\n $user->attachRole($rol_estudiante);\n \n }\n }\n\n \n echo 'Los Alumnos han sido importadas exitosamente';\n });\n } \n abort(403); \n }", "public function importarDocentes($archivo=$this->archivo){\n //cargamos el archivo\n $lineas = file($archivo); \n //inicializamos variable a 0, esto nos ayudará a indicarle que no lea la primera línea\n $i=0; \n //Recorremos el bucle para leer línea por línea\n foreach ($lineas as $linea_num => $linea)\n { \n //abrimos bucle\n /*si es diferente a 0 significa que no se encuentra en la primera línea \n (con los títulos de las columnas) y por lo tanto puede leerla*/\n if($i != 0) \n { \n //abrimos condición, solo entrará en la condición a partir de la segunda pasada del bucle.\n /* La funcion explode nos ayuda a delimitar los campos, por lo tanto irá \n leyendo hasta que encuentre un ; */\n $docente = explode(\";\",$linea);\n //Almacenamos los docente que vamos leyendo en una variable\n $dni=trim($docente[0]);\n $apellidos=trim($docente[1]);\n $nombre = trim($docente[2]);\n $facultad =trim($docente[3]);\n $telefono = trim($docente[4]);\n $correo = trim($docente[5]);\n $categoria = trim($docente[6]);\n $regimen = trim($docente[7]);\n $cargo= trim($docente[8]); \n //guardamos en base de docente la línea leida\n mysql_query(\"INSERT INTO docente(nombre,edad,profesion) \n VALUES('$dni,'$apellidos','$nombre','$facultad','$telefono','$correo','$categoria','$regimen','$cargo')\"); \n //cerramos condición\n } \n /*Cuando pase la primera pasada se incrementará nuestro valor y a la siguiente pasada ya \n entraremos en la condición, de esta manera conseguimos que no lea la primera línea.*/\n $i++;\n //cerramos bucle\n }\n}", "public function postCargarInformacion(){\n\t\t$fecha = date(\"Y-d-m H:i:s\");\n\t\t$registro = DB::SELECT(\"SELECT ident_current('MODBID_INFORMACIONPUBLIC') AS [LastID_1]\");\t\t\n\t\t$id_foto = (($registro[0]->LastID_1)+1).\".jpg\";\n\t\t\t\t\n\t\tDB::table('MODBID_INFORMACIONPUBLIC')->insert(\n\t\t \tarray(\n\t\t \t\t'id_usuario' => Auth::user()->id,\t\t \t\t\n\t\t \t\t'titulo' => Input::get('titulo'),\n\t\t \t\t'foto' => $id_foto,\n\t\t \t\t'tipo' => Input::get('tipo'),\n\t\t \t\t'texto' => Input::get('texto'),\t\t\t \t\t\n\t\t \t\t'created_at' => $fecha,\n\t \t\t\t'updated_at' => $fecha,\n\t \t\t\t'fecha_noticia' => Input::get('fecha_info')\n\n\t\t \t)\n\t\t);\n\n\t\t$path_foto = public_path().'/assets/bid/informacion/'.(($registro[0]->LastID_1)+1).\"/\";\n\t\tInput::file('foto')->move($path_foto,$id_foto);\n\t\treturn Redirect::to('vista1_bid')->with('status', 'ok_estatus');\n\t}", "public function loadDataIntoBD() : void{\n $consulta = new Consultas();\n try{\n $reader = new Csv();\n \n $reader->setInputEncoding('CP1252');\n $reader->setDelimiter(';');\n $reader->setEnclosure('');\n $reader->setSheetIndex(0);\n \n $spreadsheet = $reader->load('./files/' . $this->files['name']);\n \n $worksheet = $spreadsheet->getActiveSheet();\n \n //Se debe hacer lectura anticipada, o hacerle un next al iterador\n //Manera no encontrada\n //Se salta el primero para que no lea las cabeceras de las columnas\n \n $cutradaParaSaltarPrimero = 0;\n foreach ($worksheet->getRowIterator() as $row) {\n if($cutradaParaSaltarPrimero == 0){\n $cutradaParaSaltarPrimero++;\n continue;\n }\n\n $cellIterator = $row->getCellIterator();\n $cellIterator->setIterateOnlyExistingCells(FALSE);\n \n $arrayFila = array();\n foreach ($cellIterator as $cell) {\n $arrayFila[] = $this->utf8Decode(trim($cell->getValue()));\t\t\t\t\n }\n \n if($arrayFila[0] != '') {\n $consulta->insertarCompetidor($arrayFila);\n }\n \n }\n \n }catch(\\PhpOffice\\PhpSpreadsheet\\Reader\\Exception $e){\n die('Error loading file: ' . $e->getMessage());\n }\n }", "static public function cargarUsuario($legajo, $email, $nombre, $clave, $fotoUno, $fotoDos)\n {\n $lista = self::LeerJSON(PATH_ARCHIVOS . \"/usuarios.json\", \"Usuario\");\n $Usuario = self::BuscaXCriterio($lista, \"legajo\", $legajo);\n\n if ($Usuario != null) {\n echo \"<br>El Usuario ya existe<br>\";\n } else {\n $nomFotoUno = \"fotoUno_\" . $legajo;\n self::cargarImagenPorNombre($fotoUno, $nomFotoUno, PATH_IMAGENES);\n $nomFotoDos = \"fotoDos_\" . $legajo;\n self::cargarImagenPorNombre($fotoDos, $nomFotoDos, PATH_IMAGENES);\n\n $Usuario = new Usuario($legajo, $email, $nombre, $clave, $nomFotoUno, $nomFotoDos);\n array_push($lista, $Usuario);\n self::guardarJSON($lista, PATH_ARCHIVOS . \"/usuarios.json\", \"Usuario\");\n }\n }", "function insertAtenciones(){\n\n\t$id_item=2; // proyecto : LEVEL\n\t$id_status=3;\n\t$id_nivel=1;\n\t$id_usuario=146; //larry portanova\n\t$id_user=203; //larry portanova\n\n\n\t//leer archivo\n\t$buffer=implode('',file('atenciones2/level.csv'));\n\n\t//parsear csv\n\t$atenciones=[];\n\n\t$lineas=explode(\"\\n\",$buffer);\n\n\t$campos=explode(\",\",$lineas[0]);\n\n\tforeach($lineas as $i => $linea){\n\n\t\tif($i==0) continue;\n\n\t\t$columnas=str_getcsv($linea);\n\n\t\tforeach($columnas as $j => $columna){\n\n\t\t\t$atenciones[$i][strtolower(trim($campos[$j]))]=$columna;\n\t\t}\n\n\t}\n\n\t// prin($atenciones);\n\n\t//inserts\n\n\t$fechaMonth=[\n\t'Ene'=>'01','Feb'=>'02','Mar'=>'03','Apr'=>'04','May'=>'05','Jun'=>'06','Jul'=>'07','Aug'=>'08','Set'=>'09','Oct'=>'10','Nov'=>'11','Dic'=>'12',\n\t'01'=>'01','02'=>'02','03'=>'03','04'=>'04','05'=>'05','06'=>'06','07'=>'07','08'=>'08','09'=>'09','10'=>'10','11'=>'11','12'=>'12',\n\t];\n\n\n\n\tforeach($atenciones as $i => &$atencion){\n\n\t\tif(trim($atencion['nombre'])=='') continue;\n\n\t\t//eliminamos vacio\n\t\tunset($atencion['']);\n\n\t\t//nombre completo\n\t\t$atencion['nombre_completo']=$atencion['nombre'];\n\n\t\t//nombre y apellidos\n\t\t$nom_partes=explode(\" \",$atencion['nombre']);\n\t\t$atencion['nombre']=$nom_partes[0];\n\t\tunset($nom_partes[0]);\n\t\t$atencion['apellidos']=trim(implode(\" \",$nom_partes));\n\n\t\t//fecha\n\t\t$atencion['fecha_original']=$atencion['fecha'];\n\t\t$fecha_partes=explode(\"-\",$atencion['fecha']);\n\t\t$atencion['fecha']=\"2015-\".$fechaMonth[$fecha_partes[1]].\"-\".str_pad($fecha_partes[0], 2, \"0\", STR_PAD_LEFT).\" 14:00:00\";\n\n\t\t$atencion['seguimiento']='Primer contacto';\n\t\t// prin($atencion['fecha']);\n\n\t\t// prin($atencion);\n\n\t\t// continue;\n\n\t\t//\n\t\t//cliente\n\t\t$clienteId=getIdOrCreate(\n\t\t\t\"clientes\",\n\t\t\t[\n\t\t\t\t\"nombre\" =>$atencion['nombre'],\n\t\t\t\t\"apellidos\" =>$atencion['apellidos'],\n\t\t\t],\n\t\t\t[\n\t\t\t\t\"celular_claro\" =>$atencion['tel. cel.'],\n\t\t\t\t\"email\" =>$atencion['email'],\n\t\t\t\t\"telefono\" =>$atencion['fijo'],\n\n\t\t\t\t\"id_usuario\" =>$id_usuario,//\n\t\t\t\t\"user\" \t\t =>$id_user,//\n\n\t\t\t\t// \"tipo_cliente\" =>rand(1, 2),\n\t\t\t\t// \"genero\" \t\t=>rand(1, 2),\n\t\t\t\t// \"genero\" \t\t=>rand(1, 2),\n\t\t\t\t// \"email\" \t\t=>\"guillermolozan@icloud.com\",\n\t\t\t]\n\t\t\t);\n\n\n\t\t//\t$pedido='[{\"type\":\"departamento\",\"price\":\"621000\",\"id\":\"12\"}]';\n\t\t//departamento\n\t\t$item_item=select_fila(\"id,pvlista\",\"productos_items_items\",\"where numero=\".$atencion['departamento'].\" and id_item=\".$id_item);\n\n\t\t// $pedido='[{\"type\":\"departamento\",\"price\":\"'.$item_item['pvlista'].'\",\"id\":\"'.$item_item['id'].'\"}]';\n\n\t\t// $pedido='[{\"type\":\"departamento\",\"price\":\"'.$item_item['pvlista'].'\",\"id\":\"'.$item_item['id'].'\",\"name\":\"1 departamento'.$atencion['departamento'].'\",\"num\":\"'.$atencion['departamento'].'\",\"torre\":\"1\"}]';\n\n\t\t$canalId=getIdOrCreate(\n\t\t\t\"contacto_canales\",\n\t\t\t[\n\t\t\t\"nombre\" =>$atencion['medio'],\n\t\t\t]\n\t\t\t);\n\n\n\t\t// prin($atencion);\n\t\t//atencion\n\t\t$venta=insert(\n\t\t\t[\n\t\t\t\"fecha_creacion\" =>$atencion['fecha'],//\n\t\t\t\"fecha_creacion2\"=>$atencion['fecha'],//\n\t\t\t\"visibilidad\" =>'1',\n\t\t\t\"id_cliente\" =>$clienteId,\n\t\t\t\"id_status\" =>$id_status,//\n\t\t\t\"id_nivel\" =>$id_nivel,//\n\t\t\t\"id_canal\" =>$canalId,\n\t\t\t\"id_item\" =>$id_item,//\n\t\t\t\"id_usuario\" =>$id_usuario,//\n\t\t\t\"user\" \t\t =>$id_user,//\n\t\t\t\n\t\t\t// \"pedido\" =>$pedido,//\n\t\t\t// \"pvlista\" =>$item_item['pvlista'],//\n\t\t\t// \"pvpromocion\" =>$item_item['pvlista'],//\n\n\t\t\t// \"id_item_item\" =>$item_item['id'],//\n\n\t\t\t]\n\t\t\t,\"ventas_items\"\n\t\t\t);\n\n\t\tif(trim($atencion['seguimiento'])!='')\n\t\tinsert(\n\t\t\t[\n\t\t\t'fecha_creacion' =>$atencion['fecha'],\n\t\t\t// \"id_item\" =>$id_item,//\n\t\t\t'id_grupo' =>$venta['id'],\n\t\t\t// \"id_cliente\" =>$clienteId,\n\t\t\t'texto' =>$atencion['seguimiento'],\n\t\t\t]\n\t\t\t,'ventas_mensajes'\n\t\t\t,1\n\t\t\t);\n\n\t}\n\n\t// exit();\n\n\tprin(\"Inserciones DONE\");\n\n\t// prin($atenciones);\n\n\t// prin($celdas);\n\n\n\t// $matriz = str_getcsv($buffer,',','\"','\\\\',\"\\n\");\n\n\t// $matriz = str_getcsv($buffer); \n\n\t// prin($matriz);\n\n}", "public function carga($archivo) {\n $public_path = storage_path();\n $url = $public_path.'/app/'.$archivo;\n DB::select(\"delete from temporal\");\n if (($gestor = fopen($url, \"r\")) !== FALSE) {\n while (($datos = fgetcsv($gestor, 1000, \";\")) !== FALSE) {\n //dd(iconv('UCS-2', 'UTF-8', $datos[1].\"\\0\")) ;\n $datos[0]=utf8_encode ( $datos[0]);\n $datos[1]=utf8_encode ( $datos[1]);\n DB::insert(\"INSERT INTO temporal (nombre,apellido,correo,contrasena,puesto,jefe,departamento,permisos) VALUES ('$datos[0]', '$datos[1]', '$datos[2]', '$datos[3]', '$datos[4]', '$datos[5]', '$datos[6]', '$datos[7]')\");\n }\n fclose($gestor);\n //LLENAR TABLA USUARIOS Y PERMISOS\n DB::Select(\"delete from users where id>1\");\n DB::Select(\"delete from detallepermisos where id>8\");\n $tuplas=DB::Select(\"select * from temporal\");\n $total=0;\n foreach ($tuplas as $tupla)\n {\n $jefe=null;\n $departamento=0;\n $Usuario = new \\App\\User();\n $puesto = 0;\n //----------------departamento-----------------------\n $dep=DB::Select(\"select id from departamentos where nombredepartamento='\".$tupla->departamento.\"'\");\n if(count($dep)>0)\n {\n $departamento=$dep[0]->id;\n }\n else\n {\n DB::Insert(\"insert into departamentos (nombredepartamento) values('\".$tupla->departamento.\"')\");\n $dep=DB::Select(\"select id from departamentos where nombredepartamento='\".$tupla->departamento.\"'\");\n $departamento=$dep[0]->id;\n }\n //----------------puesto------------------------------\n $dep=DB::Select(\"select id from puestos where nombrepuesto='\".$tupla->puesto.\"'\");\n if(count($dep)>0)\n {\n $puesto=$dep[0]->id;\n }\n else\n {\n DB::Insert(\"insert into puestos (nombrepuesto) values('\".$tupla->puesto.\"')\");\n $dep=DB::Select(\"select id from puestos where nombrepuesto='\".$tupla->puesto.\"'\");\n $puesto=$dep[0]->id;\n }\n \n $Usuario->name = $tupla->nombre;\n $Usuario->lastname = $tupla->apellido;\n $Usuario->email = $tupla->correo;\n $Usuario->puesto = $puesto;\n $Usuario->departamento = $departamento;\n $Usuario->password = Hash::make($tupla->contrasena);;\n $Usuario->save();\n \n \n $permisos=$tupla->permisos;\n $permisos=str_replace(\"[\", \"\", $permisos);\n $permisos=str_replace(\"]\", \"\", $permisos);\n $numeros=explode(\",\",$permisos);\n \n $id=DB::Select(\"select id from users where email='\".$tupla->correo.\"'\");\n foreach ($numeros as $numero)\n {\n $DetallePermiso = new \\App\\Detallepermiso();\n $DetallePermiso->user_id = $id[0]->id;\n $DetallePermiso->permisos_id = $numero;\n $DetallePermiso->save();\n }\n }\n foreach ($tuplas as $tupla)\n {\n if($tupla->jefe != \"\")\n {\n $id=DB::Select(\"select id from users where name='\".$tupla->jefe.\"'\");\n if(count($id)>0)\n {\n DB::Select(\"update users set id_jefe='\".$id[0]->id.\"'where name='\".$tupla->nombre.\"'\");\n }\n }\n }\n dd(\"completado\");\n }}", "function cargar_autonomo()\n\t{\n\t\ttoba_logger::instancia()->debug( \"Cargando PROYECTO {$this->identificador}\");\n\t\t$errores = array();\n\t\ttry {\n\t\t\t$this->db->abrir_transaccion();\n\t\t\t$this->db->retrasar_constraints();\n\t\t\t$errores = $this->cargar();\n\t\t\t$this->instancia->actualizar_secuencias();\n\t\t\t$this->generar_roles_db();\n\t\t\t$this->db->cerrar_transaccion();\n\t\t} catch ( toba_error $e ) {\n\t\t\t$this->db->abortar_transaccion();\n\t\t\tthrow $e;\n\t\t}\n\t\treturn $errores;\n\t}", "public function ActualizarPerfilAlumnoC(){\n\n\t\tif(isset($_POST[\"idAl\"])){\n\n\t\t\t$rutaImg = $_POST[\"imgActual\"];\n\n\t\t\tif(isset($_FILES[\"imgAl\"][\"tmp_name\"]) && !empty($_FILES[\"imgAl\"][\"tmp_name\"])){\n\n\t\t\t\tif(!empty($_POST[\"imgActual\"])){\n\n\t\t\t\t\tunlink($_POST[\"imgActual\"]);\n\n\t\t\t\t}\n\n\n\t\t\t\tif($_FILES[\"imgAl\"][\"type\"] == \"image/png\"){\n\n\t\t\t\t\t$nombre = mt_rand(100,999);\n\n\t\t\t\t\t$rutaImg = \"Vistas/img/Alumnos/Al-\".$nombre.\".png\";\n\n\t\t\t\t\t$foto = imagecreatefrompng($_FILES[\"imgAl\"][\"tmp_name\"]);\n\n\t\t\t\t\timagepng($foto, $rutaImg);\n\n\t\t\t\t}\n\n\t\t\t\tif($_FILES[\"imgAl\"][\"type\"] == \"image/jpeg\"){\n\n\t\t\t\t\t$nombre = mt_rand(100,999);\n\n\t\t\t\t\t$rutaImg = \"Vistas/img/Alumnos/Al-\".$nombre.\".jpg\";\n\n\t\t\t\t\t$foto = imagecreatefromjpeg($_FILES[\"imgAl\"][\"tmp_name\"]);\n\n\t\t\t\t\timagejpeg($foto, $rutaImg);\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t$tablaBD = \"alumnos\";\n\n\t\t\t$datosC = array(\"id\"=>$_POST[\"idAl\"], \"nombre\"=>$_POST[\"nombreAl\"], \"apellidopaterno\"=>$_POST[\"apellidopaternoAl\"], \"apellidomaterno\"=>$_POST[\"apellidomaternoAl\"], \"noControl\"=>$_POST[\"noControl\"], \"correo\"=>$_POST[\"correoAl\"], \"clave\"=>$_POST[\"claveAl\"], \"foto\"=>$rutaImg);\n\n\t\t\t$resultado = AlumnosM::ActualizarPerfilAlumnoM($tablaBD, $datosC);\n\n\t\t\tif($resultado == true){\n\n\t\t\t\tif ($_SESSION[\"rol\"] == \"Alumno\") {\n\t\t\t\t\t\n\t\t\t\t\techo '<script>\n\t\t\t\t\twindow.location = \"http://localhost/psicologiaitsur/perfil-'.$_SESSION[\"rol\"].'\";\n\t\t\t\t\t</script>';\n\n\t\t\t\t}else if ($_SESSION[\"rol\"] == \"Administrador\"){\n\n\t\t\t\t\techo '<script>\n\t\t\t\t\twindow.location = \"http://localhost/psicologiaitsur/alumnos\";\n\t\t\t\t\t</script>';\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}", "function escreveArquivo($aux_nome, $aux_tel, $aux_cpf, $aux_rg){\n\n $pessoa = new Individuo();\n\n /**\n * Para evitar que o usuario fique recarregando a pagina\n */\n \n $pessoa->setNome($aux_nome);\n if($pessoa->getNome() == '' || $pessoa->getNome() == null){\n session_destroy();\n die(\"Falha\");\n }\n /**\n * Gravando os dados\n */\n $pessoa->setTelefone($aux_tel);\n $pessoa->setCPF($aux_cpf);\n $pessoa->setRg($aux_rg);\n\n $dados = fopen(\"/home/mateus/Arquivos/dados_individual.csv\", \"a+\") or die(\"Failed\"); \n $conteudo = '';\n $conteudo = fread($dados, 1);\n\n if($conteudo == ''){\n escreveCabecalho($dados);\n }\n \n fwrite($dados, $pessoa->getNome());\n fwrite($dados, \",\");\n fwrite($dados, $pessoa->getTelefone());\n fwrite($dados, \",\");\n fwrite($dados, $pessoa->getCPF());\n fwrite($dados, \",\");\n fwrite($dados, $pessoa->getRg());\n fwrite($dados, \"\\n\");\n\n\n fclose($dados);\n }", "public function importExcel()\n {\n if( auth()->user()->hasRole(['Administrador','Secretaria'])){\n //Agregado para rellenar las Carreras que no estaban\n $cuantos=Carrera::all()->count();\n //Creamos instancia de Faker designando el lenguaje a utilizar\n $faker = Faker::create('es_ES'); \n\n /** El método load permite cargar el archivo definido como primer parámetro */\n Excel::load($archivo.'.xlsx', function ($reader) {\n /**\n * $reader->get() nos permite obtener todas las filas de nuestro archivo\n */\n $rol_estudiante = Role::where('name', 'LIKE', 'Estudiante')->get()->first()->id;\n\n foreach ($reader->get() as $key => $row) {\n $persona = [\n 'nombre_apellido' => $row['apellido' . \" \" .'nombre'],\n 'dni' => $row['dni'],\n 'email' => $row['email'],\n 'fecha_registro' => $row['fecha_registro'],\n 'status' => $row['status'],\n ];\n //alumno\n \n $usuario = [\n 'email' => $row['email'],\n 'password' => \"123456\",\n 'username' => \"alumno\",\n \n ];\n\n /** Una vez obtenido los datos de la fila procedemos a registrarlos */\n if (!empty($archivo)) {\n //temporal de los datos de un usuario\n $data_user = $estudiante['usuario'];\n //temporal de los datos de una persona\n $data_persona = $estudiante['persona'];\n \n //Creamos un Usuario con los datos del temporal\n $user = User::create($data_user);\n \n //Actualizamos el temporal de los datos con el id del Usuario que referencia\n $data_persona['user_id'] = $user->id;\n \n //Creamos una Persona con los datos del temporal\n $persona = Persona::create($data_persona);\n \n //Hasheamos el Password del Usuario\n $user->hashPassword();\n //Actualizamos el Username del Usuario\n $user->updateUsername();\n //Asignamos el Rol del Estudiante\n $user->attachRole($rol_estudiante);\n \n }\n }\n\n \n echo 'Los Alumnos han sido importadas exitosamente';\n });\n } \n abort(403); \n }", "public static function formularioMarcas()\n {\n //Variable con los permisos del usuario\n $dato_tipo = Sentencias::Seleccionar(\"tipos_usuarios\", \"id\", array($_SESSION[\"tipo\"]), 0, null);\n\n //Variables de los campos de la tabla marcas\n $marca = null;\n\n \n\n //Se empiezan a validar los datos del formulario de marcas\n if(isset($_POST[\"formulario\"]))\n {\n //Se valida que no se dejen espacios vacios\n if($_POST[\"marca\"] != \"\")\n {\n //Se valida que la marca cumpla con los criterios\n if(Validaciones::alfanumerico($_POST[\"marca\"]) && Validaciones::longitud($_POST[\"marca\"], 20))\n {\n //Se divide en si es ingresar un registro o modificar uno existente\n //Aqui es donde se modifica el registro\n if(!empty($_GET[\"id_marca\"]))\n {\n //Se valida si el parametro es un numero\n if(is_numeric($_GET[\"id_marca\"]))\n {\n //Se divide entre solo actualizar marca, imagen y ambas a la vez\n //Aqui se actualiza el nombre y la imagen\n if(is_uploaded_file($_FILES[\"archivo\"][\"tmp_name\"]))\n {\n $img = $_POST[\"marca\"].time().\".jpg\";\n\n $campos_valores = array\n (\n 'marca' => $_POST[\"marca\"],\n 'imagen' => $img\n );\n\n $condiciones_parametros = array\n (\n 'id' => $_GET[\"id_marca\"]\n );\n\n Sentencias::Actualizar(\"marcas\", $campos_valores, $condiciones_parametros, 1, \"marcas.php\");\n move_uploaded_file($_FILES['archivo']['tmp_name'], \"../img/marcas/$img\");\n }\n\n //Aqui solo se actualizara el nombre\n else\n {\n $campos_valores = array\n (\n 'marca' => $_POST[\"marca\"]\n );\n\n $condiciones_parametros = array\n (\n 'id' => $_GET[\"id_marca\"]\n );\n\n Sentencias::Actualizar(\"marcas\", $campos_valores, $condiciones_parametros, 1, \"marcas.php\"); \n }\n }\n\n else\n {\n header(\"Location: marcas.php\");\n }\n }\n\n //Aqui es donde se agrega un nuevo registro\n else\n {\n //Se valida si ya se subio la imagen\n if(is_uploaded_file($_FILES[\"archivo\"][\"tmp_name\"]))\n {\n //Se validan los valores de la iamgen\n if(Validaciones::imagen($_FILES[\"archivo\"]))\n {\n $img = $_POST[\"marca\"].time().\".jpg\";\n $campos_valores = array\n (\n 'marca' => $_POST[\"marca\"],\n 'imagen' => $img\n );\n\n Sentencias::Insertar(\"marcas\", $campos_valores, 1, \"marcas.php\");\n move_uploaded_file($_FILES['archivo']['tmp_name'], \"../img/marcas/$img\");\n }\n\n else\n {\n Ventanas::Mensaje(2, \"La imagen no es valida\", null);\n }\n }\n\n else\n {\n Ventanas::Mensaje(2, \"Debe ingresar una imagen\", null);\n }\n }\n } \n\n else\n {\n Ventanas::Mensaje(2, \"El nombre de la marca no es valido\", null);\n }\n }\n\n else\n {\n Ventanas::Mensaje(2, \"No deje campos vacios\", null);\n }\n }\n\n //Renderiza el formulario de marcas\n echo\n (\"\n <form method='post' enctype='multipart/form-data' id='registro'>\n <div class='row'>\n <div class='container'>\n <div class='col s12 center-align'>\n <h4>Aqui puedes ingresar una nueva marca</h4>\n </div>\n <div class='input-field col s10 offset-s1'>\n <input id='marca' value='$marca' name='marca' type='text' class='validate' autocomplete='off'>\n <label for='marca' class='blue-text text-darken-4'>Nombre de la marca</label>\n </div>\n <div class='file-field input-field col s10 offset-s1'>\n <div class='btn blue darken-4'>\n <span>Imagen</span>\n <input type='file' name='archivo'>\n </div>\n <div class='file-path-wrapper'>\n <input class='file-path validate' type='text' placeholder='Seleccione una imagen para el usuario'>\n </div>\n </div>\n \");\n\n //Se renderiza el boton dependiendo de si es para crear o modificar\n if(empty($_GET[\"id_marca\"]))\n {\n //Se valida si tiene permisos para ingresar\n if($dato_tipo[\"marcas\"] == 2 || $dato_tipo[\"marcas\"] == 5 || $dato_tipo[\"marcas\"] == 6 || $dato_tipo[\"marcas\"] == 9)\n {\n echo\n (\"\n <div class='col s3 offset-s1'>\n <button name='formulario' class='waves-effect waves-light btn blue darken-4'>Ingresar marca</button>\n </div> \n \");\n } \n }\n\n else\n {\n //Se valida si tiene permisos para modificar\n if($dato_tipo[\"marcas\"] == 3 || $dato_tipo[\"marcas\"] == 5 || $dato_tipo[\"marcas\"] > 6)\n {\n echo\n (\"\n <div class='col s3 offset-s1'>\n <button name='formulario' class='waves-effect waves-light btn blue darken-4'>Actualizar marca</button>\n </div> \n \");\n } \n }\n\n echo\n (\" \n <div class='col s3'>\n <a href='marcas.php' class='waves-effect waves-light btn blue darken-4'>Limpiar campos</a>\n </div> \n </div>\n </div> \n </form>\n \");\n }", "public function actualizarperfil($id,$nombre,$primer_apellido,$segundo_apellido,$ano,$email,$telefono,$alias,$foto)\n {\n \n //busca en la tabla usuarios los campos donde el id sea el que le ha pasado el controlador\n $usuarios = R::load('usuarios',$id);\n \n //sobreescribe los campos\n $usuarios->nombre=$nombre;\n $usuarios->primer_apellido=$primer_apellido;\n $usuarios->segundo_apellido=$segundo_apellido;\n $usuarios-> fecha_nacimiento=$ano;\n $usuarios->email=$email;\n $usuarios->telefono=$telefono;\n $usuarios->alias=$alias;\n //si la foto exite se guarda en la base de datos se guarda el campo extension como png si la foto no exite se guarda como null\n $sustitutuirespaciosblancos = str_replace(\" \",\"_\",$alias);\n $directorio = \"assets/fotosperfil/usuario-\".$sustitutuirespaciosblancos.\".png\";\n $existefichero = is_file( $directorio );\n \n \n \n if($foto!=null){\n \n if ( $existefichero==true ){\n $extension=\"png\";\n }else{\n \n \n \n \n \n \n \n }}\n $usuarios->foto = $extension;\n // almacena los datos en la tabla usuarios de la base de datos\n R::store($usuarios);\n //rdirege al controlador Usuarios/Bienvenidos_u\n \n redirect(base_url().\"usuario/Usuarios/perfil_usuario\");\n \n \n }", "public function guardarAlumnoTXT($path)\n {\n $datosAlumno = \"{$this->nombre};{$this->edad};{$this->dni};{$this->legajo}\".PHP_EOL;\n\n if (file_exists($path))\n {\n //EL modo \"a\" coloca el puntero al fichero al final de mismo. Si no existe, se intenta crear\n $file = fopen($path, \"a\");\n fwrite($file, $datosAlumno);// datosAlumno es un string con los datos del alumno\n fclose($file);\n } \n else\n {\n //El modo \"w\" coloca el puntero al fichero al principio del fichero. Si no existe, se intenta crear\n $file = fopen($path, \"w\");\n fwrite($file, $datosAlumno);\n fclose($file);\n }\n }", "function Alumno(){\n $matricula =\"\";\n $nombre=\"\";\n $carrera=\"\";\n $email=\"\";\n $telefono=\"\";\n $nameErr=\"\";\n $emailErr=\"\";\n $carreraErr=\"\";\n $telErr=\"\"; \n $conexion=\"\";\n }", "function cargar_informacion_reducida()\n\t{\n\t\t// Cabecera del proyecto\n\t\t$this->manejador_interface->mensaje('Cargando datos globales', false);\n\t\t$archivo = $this->get_dir_tablas() . '/apex_proyecto.sql';\n\t\t$this->db->ejecutar_archivo( $archivo );\n\t\t$this->manejador_interface->mensaje('.OK');\n\t\t// Grupos de acceso y permisos\n\t\t$this->cargar_perfiles();\n\t}", "public function EditarPerfilAlumnoC(){\n\n\t\t$tablaBD = \"alumnos\";\n\t\tif ($_SESSION[\"rol\"] == \"Alumno\") {\n\t\t\t\n\t\t\t$id = $_SESSION[\"id\"];\n\n\t\t}else if ($_SESSION[\"rol\"] == \"Administrador\") {\n\t\t\t\n\t\t\t$id = substr($_GET[\"url\"], 10);\n\n\t\t}\n\t\t\n\n\t\t$resultado = AlumnosM::VerPerfilAlumnoM($tablaBD, $id);\n\n\t\techo '<form method=\"post\" enctype=\"multipart/form-data\">\n\t\t\t\t\t\n\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\n\t\t\t\t\t\t<div class=\"col-md-6 col-xs-12\">\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<h2>Nombre:</h2>\n\t\t\t\t\t\t\t<input type=\"text\" class=\"input-lg\" name=\"nombreAl\" value=\"'.$resultado[\"nombre\"].'\">\n\t\t\t\t\t\t\t<input type=\"hidden\" name=\"idAl\" value=\"'.$resultado[\"id\"].'\">\t\n\n\t\t\t\t\t\t\t<h2>Apellido Paterno:</h2>\n\t\t\t\t\t\t\t<input type=\"text\" class=\"input-lg\" name=\"apellidopaternoAl\" value=\"'.$resultado[\"apellidopaterno\"].'\">\n\n\t\t\t\t\t\t\t<h2>Apellido Materno:</h2>\n\t\t\t\t\t\t\t<input type=\"text\" class=\"input-lg\" name=\"apellidomaternoAl\" value=\"'.$resultado[\"apellidomaterno\"].'\">\n\n\t\t\t\t\t\t\t<h2>No. Control:</h2>\n\t\t\t\t\t\t\t<input type=\"text\" class=\"input-lg\" name=\"noControl\" value=\"'.$resultado[\"noControl\"].'\">\n\t\t\t\t\t\n\t\t\t\t\t\t\t<h2>Correo Electronico:</h2>\n\t\t\t\t\t\t\t<input type=\"text\" class=\"input-lg\" name=\"correoAl\" value=\"'.$resultado[\"correo\"].'\">\n\n\t\t\t\t\t\t\t<h2>Contraseña:</h2>\n\t\t\t\t\t\t\t<input type=\"text\" class=\"input-lg\" name=\"claveAl\" value=\"'.$resultado[\"clave\"].'\">\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t</div>\n\n\n\t\t\t\t\t\t<div class=\"col-md-6 col-xs-12\">\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<br><br>\n\n\t\t\t\t\t\t\t<input type=\"file\" name=\"imgAl\">\n\t\t\t\t\t\t\t<br>';\n\n\t\t\t\t\t\t\tif($resultado[\"foto\"] == \"\"){\n\n\t\t\t\t\t\t\t\techo '<img src=\"http://localhost/psicologiaitsur/Vistas/img/defecto.png\" class=\"img-responsive\" width=\"200px\">';\n\n\t\t\t\t\t\t\t}else{\n\n\t\t\t\t\t\t\t\techo '<img src=\"http://localhost/psicologiaitsur/'.$resultado[\"foto\"].'\" class=\"img-responsive\" width=\"200px\">';\n\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\techo '<input type=\"hidden\" name=\"imgActual\" value=\"'.$resultado[\"foto\"].'\">\n\n\t\t\t\t\t\t\t<br><br>\n\n\t\t\t\t\t\t\t<button type=\"submit\" class=\"btn btn-success\">Guardar Cambios</button>\n\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t</div>\n\n\t\t\t\t</form>';\n\n\t}", "function actualizarDatos(){\n $e = new Empresa();\n \n $e->ruc = $_POST['ruc'];\n\n $imagenName = $_FILES['file']['name']; \n\n if($_POST['nameimage'] ==\"\"){\n\n \n \n //-------- MODIFIED NAME --------------\n $extension = pathinfo($imagenName, PATHINFO_EXTENSION);\n $random = rand(0,99);\n $rename = $random.date('Ymd').$imagenName;\n $newname = $rename;\n //for obtain extension of image .'.'.$extension\n $imageurl = \"./vistas/panel_usuario/logoemp/\" . $newname;\n \n $imagenTemp = $_FILES['file']['tmp_name'];\n move_uploaded_file($imagenTemp, $imageurl);\n //copy($imagenTemp,$imagenUrl);\n }else{\n \n\n $eliminarimage = \"./vistas/panel_usuario/logoemp/\" . $_POST['nameimage'];\n unlink($eliminarimage);\n\n $extension = pathinfo($imagenName, PATHINFO_EXTENSION);\n $random = rand(0,99);\n $rename = $random.date('Ymd').$imagenName;\n $newname = $rename;\n //for obtain extension of image .'.'.$extension\n $imageurl = \"./vistas/panel_usuario/logoemp/\" . $newname;\n \n $imagenTemp = $_FILES['file']['tmp_name'];\n move_uploaded_file($imagenTemp, $imageurl);\n\n }\n //ad in controller \n $e->logo = $newname;\n $e->logoUrl = $imageurl;\n\n $e->emailEmp = str_replace(\" \",\"\",$_POST['email']);\n $e->descripcion = trim($_POST['descripcion']);\n $e->direccion = trim($_POST['direccion']);\n $e->distrito = $_POST['distrito'];\n $e->telefono = $_POST['telefono'];\n $e->whatsapp = $_POST['whatsapp'];\n $e->facebook = trim($_POST['facebook']);\n $e->instagram = trim($_POST['instagram']);\n if (empty($e->descripcion) || empty($e->direccion) || $_POST['departamento'] == '0' || strlen($e->telefono) != 9 || strlen($e->whatsapp) > 9) {\n return ['bool' => false, 'msg' => 'datosIncorrectos'];\n }\n return ($this->modelo->actualizarEmpresa($e)) ?\n $this->modelo->buscarByRuc($e->ruc) :\n ['bool' => true, 'msg' => 'problemaSQL'];\n }", "function modificarAnuncio($titulo, $descripcion, $imagen, $id_poi, $id_usuario) {\n $sql = \"UPDATE anuncio SET titulo='\" . $titulo . \"',descripcion='\" . $descripcion . \"',imagen='\" . $imagen\n . \"' WHERE id_usuario='\" . $id_usuario . \"' AND id_poi='\" . $id_poi . \"'\";\n $con = new DB();\n $result = $con->exec($sql);\n $con = null;\n }", "public function crearArchivoSql($data)\n {\n // el Email y el username a enviar\n $user = $this->getUser();\n $nivelUser = $user->getNivel();\n\n $nombreArchivo = __DIR__.'/../Resources/doc/ArchivoSql.txt';\n if (file_exists($nombreArchivo)) {\n unlink($nombreArchivo);\n } \n $file = fopen($nombreArchivo,\"w\");\n foreach($data as $clave => $generar) {\n if($clave !== 'submit'){\n fputs($file, $clave);\n fputs($file,\"\\n\");\n fputs($file, $generar);\n fputs($file,\"\\n\");\n }\n }\n if($file){\n fclose($file);\n } \n \n return ;\n }", "function editar_pelicula($peliActual){\n // leemos todas las pelis, y las volcamos al fichero menos la pasada como argumento\n\n $lesPelis=readPelis();\n\n // obrim el fitxer de pelis per a escriptura. \n $f = fopen(filePeliculas, \"w\");\n\n foreach($lesPelis as $peli){\n\n // guardem la peli llegida o l'actual, si és el cas\n if ($peli[\"id\"]==$peliActual[\"id\"]){\n $p=$peliActual;\n }\n else{\n $p=$peli;\n }\n\n //convertim $peli (array asociatiu) en array\n\n $valors_peli=array();\n foreach($p as $k=>$v){\n array_push($valors_peli,$v);\n }\n\n //escrivim al fitxer\n fputcsv($f,$valors_peli,\",\");\n\n }\n\n fclose($f);\n \n \n\n}", "public function TutoresPermanentes(){\n if (isset($_FILES['file'])) {\n if (($gestor = fopen($_FILES['file']['tmp_name'], \"r\")) !== FALSE) {\n $coun = 0 ;\n \n\n while (($datos = fgetcsv($gestor, 1000, \";\")) !== FALSE) {\n \n if ($coun!=0) {\n $dato = explode('-',$datos['1']);\n $nombre=$datos['0'];\n $rut = $dato['0'];\n $dv = $dato['1'];\n $email=$datos['2'];\n $area=$datos['3']; \n }\n $coun= $coun + 1;\n fclose($gestor);\n }\n $user = $this->session->userdata('logged_in');\n if(count($user['permisos']) > 0){\n if (in_array(1, $user['permisos'])) {\n redirect('Asesor_Controller/importar','refresh');\n }elseif (in_array(2, $user['permisos'])) {\n redirect('Asistente_Controller/importar','refresh');\n }\n }\n }\n }\n\n }", "public function cargar()\n {\n $resp = false;\n $base = new BaseDatos();\n $sql = \"SELECT * FROM archivocargado WHERE idarchivocargado = \" . $this->getidArchivoCargado();\n if ($base->Iniciar()) {\n $res = $base->Ejecutar($sql);\n if ($res > -1) {\n if ($res > 0) {\n $row = $base->Registro();\n $user = new Usuario();\n $user->setIdUsuario($row['idusuario']);\n $user->cargar();\n $this->setear(\n $row['idarchivocargado'],\n $row['acnombre'],\n $row['acdescripcion'],\n $row['acicono'],\n $user,\n $row['aclinkacceso'],\n $row['accantidaddescarga'],\n $row['accantidadusada'],\n $row['acfechainiciocompartir'],\n $row['acefechafincompartir'],\n $row['acprotegidoclave']\n );\n }\n }\n } else {\n $this->setmensajeoperacion(\"ArchivoCargado->listar: \" . $base->getError());\n }\n return $resp;\n }", "function recuperar_datos() {\n\t\tglobal $nombre, $tipo ;\n\t\t\n\t\t\t$pers_id =(isset($_POST['id_marcas']) && !empty($_POST['id_marcas']))? $_POST['id_marcas']:\"\";\n\t\t\t$tipo =(isset($_POST['tipo']) && !empty($_POST['tipo']))? $_POST['tipo']:\"A\"; \t\n\n\t\t\t$nombre=(isset($_POST[\"nombre\"]) && !empty($_POST[\"nombre\"]))? $_POST[\"nombre\"]:\"\";\t\t\t\n\t\n\t\t}", "function tabla_actores(){\n $fichero = \"bbdd/actores.csv\";\n $array_actores;\n\n //Si existe el fichero lo abrimos para leerlo\n $manejador = fopen($fichero, \"r\");\n if($manejador != FALSE){\n $j=0;\n while(($arrayFila= fgetcsv($manejador, 1000, \",\")) != FALSE){ \n $array_actores[$j] = array(\"id\" => $arrayFila[0], \"nombre\" => $arrayFila[1], \"anyo\" => $arrayFila[2], \"lugar\" => $arrayFila[3]);\n $j++;\n } \n fclose($manejador);\n } \n return $array_actores;\n }", "public function CargarProductos()\n\t{\n\t\tself::SetNames();\n\t\tif(empty($_FILES[\"sel_file\"]))\n\t\t{\n\t\t\techo \"1\";\n\t\t\texit;\n\t\t}\n //Aquí es donde seleccionamos nuestro csv\n $fname = $_FILES['sel_file']['name'];\n //echo 'Cargando nombre del archivo: '.$fname.' ';\n $chk_ext = explode(\".\",$fname);\n \n if(strtolower(end($chk_ext)) == \"csv\")\n {\n //si es correcto, entonces damos permisos de lectura para subir\n $filename = $_FILES['sel_file']['tmp_name'];\n $handle = fopen($filename, \"r\");\n \n while (($data = fgetcsv($handle, 1000, \";\")) !== FALSE)\n {\n //Insertamos los datos con los valores...\n\t\t\t \n$query = \" insert into productos values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); \";\n\t\t$stmt = $this->dbh->prepare($query);\n\t\t$stmt->bindParam(1, $data[0]);\n\t\t$stmt->bindParam(2, $data[1]);\n\t\t$stmt->bindParam(3, $data[2]);\n\t\t$stmt->bindParam(4, $data[3]);\n\t\t$stmt->bindParam(5, $data[4]);\n\t\t$stmt->bindParam(6, $data[5]);\n\t\t$stmt->bindParam(7, $data[6]);\n\t\t$stmt->bindParam(8, $data[7]);\n\t\t$stmt->bindParam(9, $data[8]);\n\t\t$stmt->bindParam(10, $data[9]);\n\t\t$stmt->bindParam(11, $data[10]);\n\t\t$stmt->bindParam(12, $data[11]);\n\t\t$stmt->bindParam(13, $data[12]);\n\t\t$stmt->execute();\n\n\t\t$query = \" insert into kardexproductos values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); \";\n\t\t$stmt = $this->dbh->prepare($query);\n\t\t$stmt->bindParam(1, $codproceso);\n\t\t$stmt->bindParam(2, $codresponsable);\n\t\t$stmt->bindParam(3, $codproducto);\n\t\t$stmt->bindParam(4, $movimiento);\n\t\t$stmt->bindParam(5, $entradas);\n\t\t$stmt->bindParam(6, $salidas);\n\t\t$stmt->bindParam(7, $devolucion);\n\t\t$stmt->bindParam(8, $stockactual);\n\t\t$stmt->bindParam(9, $preciounit);\n\t\t$stmt->bindParam(10, $costototal);\n\t\t$stmt->bindParam(11, $documento);\n\t\t$stmt->bindParam(12, $fechakardex);\n\t\t\n\t\t$codproceso = strip_tags($data[0]);\n\t\t$codresponsable = strip_tags(\"0\");\n\t\t$codproducto = strip_tags($data[0]);\n\t\t$movimiento = strip_tags(\"ENTRADAS\");\n\t\t$entradas = strip_tags($data[5]);\n\t\t$salidas = strip_tags(\"0\");\n\t\t$devolucion = strip_tags(\"0\");\n\t\t$stockactual = strip_tags($data[6]);\n\t\t$preciounit = strip_tags($data[4]);\n\t\t$costototal = rount($data[4]*$data[6],2);\n\t\t$documento = strip_tags(\"INVENTARIO INICIAL\");\n\t\t$fechakardex = strip_tags(date(\"Y-m-d\"));\n\t\t$stmt->execute();\n\t\t\t\t\n }\n //cerramos la lectura del archivo \"abrir archivo\" con un \"cerrar archivo\"\n fclose($handle);\n\t \necho \"<div class='alert alert-success'>\";\necho \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\necho \"<span class='fa fa-check-square-o'></span> LA CARGA MASIVA DE PRODUCTOS FUE REALIZADA EXITOSAMENTE </div>\";\necho \"</div>\";\nexit;\n \n }\n else\n {\n //si aparece esto es posible que el archivo no tenga el formato adecuado, inclusive cuando es cvs, revisarlo para ver si esta separado por \" , \"\n echo \"2\";\n\t\t exit;\n } \n}", "public function ObtenerDat()\n {\n $this->validate([\n 'folio'=>'required'\n ]) ;\n\n $datos = Empleado::where('folio', $this->folio)->first();\n\n if($datos){\n\n $this->nombre= $datos->nombre; \n\n $this->apellido_p= $datos->apellido_p;\n \n $this->apellido_m= $datos->apellido_m;\n \n $this->puesto= $datos->puestos->puesto;\n \n if(!empty($this->imagen)){\n $this->imagen=$datos->imagen->store(\"public\");\n }else{\n $this->imagen= null;\n }\n\n }else{\n\n session()->flash('MensajeD','El empleado no trabaja en este Hotel.');\n\n $this->nombre= ''; \n\n $this->apellido_p= '';\n \n $this->apellido_m= '';\n \n $this->puesto= '';\n \n }\n\n }", "public function subir_datos() {\n $datos = array(\n 'nombre' => $this->helper->cleanInput($_POST['cname']),\n 'email' => $this->helper->cleanInput($_POST['email']),\n 'telefono' => $this->helper->cleanInput($_POST['phone']),\n 'message' => $this->helper->cleanInput($_POST['message'])\n );\n $insert = $this->model->subir_datos($datos);\n $id = $insert['id'];\n #SUBIMOS EL ARCHIVO\n $dir = 'public/archivos/cv/';\n $serverdir = $dir;\n $filename = \"\";\n foreach ($_FILES as $inputname => $file) {\n $newname = $this->helper->cleanUrl($_POST[$inputname . '_name']);\n //$extension = strtolower(end(explode('.', $file['name'])));\n $ext = explode('.', $file['name']);\n $extension = strtolower(end($ext));\n $fname = $id . '_' . $newname . '.' . $extension;\n $contents = file_get_contents($file['tmp_name']);\n\n $handle = fopen($serverdir . $fname, 'w');\n fwrite($handle, $contents);\n fclose($handle);\n\n $filename = $fname;\n var_dump($filename);\n }\n $update = array(\n 'id' => $id,\n 'archivo' => $filename\n );\n $updateTrabaja = $this->model->updateTrabaja($update);\n if (!empty($id)) {\n $data = array(\n 'type' => 'succes',\n 'message' => $this->helper->messageAlert('success', 'Gracias, tu C.V. se ha agregado correctamente a nuestra Base de Datos.')\n );\n } else {\n $data = array(\n 'type' => 'error',\n 'message' => $this->helper->messageAlert('error', 'Lo sentimos ha ocurrido un error, por favor vuelva a intertarlo')\n );\n }\n Session::set('result', $data);\n header('Location: ' . URL . 'trabaja_con_nosotros/');\n }" ]
[ "0.6084217", "0.5927711", "0.5755315", "0.56801736", "0.56752354", "0.56591696", "0.5650602", "0.56040895", "0.56008196", "0.5588999", "0.5584097", "0.5556028", "0.5499985", "0.54826623", "0.5468537", "0.54244405", "0.54075575", "0.5399108", "0.53829056", "0.5375976", "0.5365376", "0.5348389", "0.5335681", "0.5314032", "0.5278682", "0.52784413", "0.5256922", "0.5249192", "0.52394885", "0.52326953" ]
0.6596407
0
Query the Search API by a search term and location
function search($term, $location) { $url_params = array(); $url_params['term'] = $term; $url_params['location'] = $location; $url_params['limit'] = $GLOBALS['SEARCH_LIMIT']; return request($GLOBALS['API_HOST'], $GLOBALS['SEARCH_PATH'], $url_params); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function search($term, $location, $price, $radius, $categories, $sort) {\n $url_params = array();\n \n $url_params['term'] = $term;\n $url_params['location'] = $location;\n $url_params['limit'] = $GLOBALS['SEARCH_LIMIT'];\n\t$url_params['open_now'] = true;\n $url_params['price'] = $price;\n $url_params['radius'] = $radius;\n $url_params['categories'] = $categories;\n $url_params['sort_by'] = $sort;\n \n return request($GLOBALS['API_HOST'], $GLOBALS['SEARCH_PATH'], $url_params);\n}", "public function search() {\r\n\t\t$mintURL = $this->Configuration->findByName('Mint URL');\r\n\t\t$queryURL = $mintURL['Configuration']['value'];\r\n\t\t$query = '';\r\n\t\tif (isset($this->params['url']['query'])) {\r\n\t\t\t$query = $this->params['url']['query'];\r\n\t\t}\r\n\r\n\t\t$queryURL = $queryURL.\"/Parties_People/opensearch/lookup?searchTerms=\".$query;\r\n\t\t$queryResponse = \"error\";\r\n\n\t\t$ch = curl_init();\r\n\t\t$timeout = 5;\r\n\t\tcurl_setopt($ch,CURLOPT_URL,$queryURL);\r\n\t\tcurl_setopt($ch,CURLOPT_RETURNTRANSFER,1);\r\n\t\tcurl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);\r\n\t\t$queryResponse = curl_exec($ch);\r\n\t\tcurl_close($ch);\r\n\r\n\t\t$this->autoRender = false;\r\n\t\t$this->response->type('json');\r\n\r\n\t\t$this->response->body($queryResponse);\r\n\t}", "public function search($q);", "function query_api($term, $location) {\r\n $response = json_decode(search($term, $location));\r\n $business_id = $response->businesses[0]->id;\r\n /* \r\n print sprintf(\r\n \"%d local businesses found, querying business info for the top result \\\"%s\\\"\\n\\n <br>\",\r\n count($response->businesses),\r\n $business_id\r\n );\r\n */ \r\n $response = get_business($business_id);\r\n \r\n print sprintf(\"Result for business \\\"%s\\\" found:\\n\", $business_id);\r\n $pretty_response = json_encode(json_decode($response), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);\r\n print \"$pretty_response\\n\";\r\n\r\n return json_decode($response, true);\r\n }", "public function search($query);", "public function searchByKeyword($query);", "public function search($city);", "public function search($term = null);", "function search() {\n\n /* Start building the query object. We hope to end up with something like:\n $reqeust = '{\n \"from\" : 0,\n \"size\": 10,\n \"query\" : {\n \"terms\" : {\n \"creator\" : [ \"card\" ]\n }\n },\n sort: {\n title: {\n order: \"desc\"\n }\n }\n }';\n */\n $request = array();\n\n // Users can query by specifying an url param like &filter=title:ender\n // TODO: We should allow for multiple filters.\n $key_and_val = explode(\":\", $this->get('GET.filter'));\n if (count($key_and_val) == 2 and !empty($key_and_val[0]) and !empty($key_and_val[1])) {\n $request['query']['query_string']['fields'] = array($key_and_val[0]);\n $request['query']['query_string']['query'] = '*' . $key_and_val[1] . '*';\n $request['query']['query_string']['default_operator'] = 'AND';\n } else {\n $request['query'] = array(\"match_all\" => new stdClass);\n }\n //$request['query']['query_string']['query'] = 'American FactFinder';\n // start parameter (elasticsearch calls this 'from')\n $incoming_start = $this->get('GET.start');\n if (!empty($incoming_start)) {\n $request['from'] = $this->get('GET.start');\n }\n \n // limit parameter (elasticsearch calls this 'size')\n $incoming_limit = $this->get('GET.limit');\n if (!empty($incoming_limit)) {\n $request['size'] = $this->get('GET.limit');\n }\n \n // sort parameter\n $incoming_sort = $this->get('GET.sort');\n $sort_field_and_dir = explode(\" \", $this->get('GET.sort'));\n if (count($sort_field_and_dir) == 2) {\n $request['sort'] = array($sort_field_and_dir[0] => array('order' => $sort_field_and_dir[1]));\n }\n \n // We now have our built request, let's jsonify it and send it to ES\n $jsoned_request = json_encode($request);\n \n $url = $this->get('ELASTICSEARCH_URL') . '_search';\n $ch = curl_init();\n $method = \"GET\";\n\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, strtoupper($method));\n curl_setopt($ch, CURLOPT_POSTFIELDS, $jsoned_request);\n\n $results = curl_exec($ch);\n curl_close($ch);\n\n // We should have a response. Let's pull the docs out of it\n $cleaned_results = $this->get_docs_from_es_response(json_decode($results, True));\n // callback for jsonp requests\n $incoming_callback = $this->get('GET.callback');\n if (!empty($incoming_callback)) {\n $this->set('callback', $this->get('GET.callback'));\n }\n \n // We don't want dupes. Dedupe based on hollis_id\n //$deduped_docs = $this->dedupe_using_hollis_id($cleaned_results);\n \n // Hopefully we're deduping on intake\n $deduped_docs = $cleaned_results;\n \n $this->set('results', $deduped_docs);\n //$this->set('results', $cleaned_results);\n $path_to_template = 'api/templates/search_json.php';\n echo $this->render($path_to_template);\n }", "public function search( $request ) {\n\t\tif( $keyword = is_object($request) ? $request->requestVar('term') : $request ) {\n\t\t\t$geoLocations = GeoLocation::getByKeyword($keyword, 10);\n\t\t\t$response = array();\n\t\t\tforeach( $geoLocations->map('ID', 'getFullTitle') as $id => $label ) {\n\t\t\t\t$response[] = array(\n\t\t\t\t\t'id' => $id,\n\t\t\t\t\t'label' => $label\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$response = false;\n\t\t}\n\t\treturn json_encode($response);\n\t}", "public function search(){}", "public function findBySearchTerm($query, $term = '', $facetConfiguration = [], $searchConfiguration = []);", "public function search( $query, $wordSearch = true, $categorySearch = true, $exact = false, $sortType = 'instanceCount', $includePages = false, $offset = 0, $limit = 100 ){ return $this->APICallSub( '/ul', array( 'search' => $query, 'wordSearch' => $wordSearch, 'categorySearch' => $categorySearch, 'sortType' => $sortType, 'exact' => $exact, 'includePages' => $includePages, 'offset' => $offset, 'limit' => $limit ), \"Could not perform Ultralink search\" ); }", "public function search();", "public function search();", "public function searchByName($query);", "public function search(Query $query);", "public function search($search_term, $category = 0){\n\t\t\t$this->search_type = self::get_search_type($search_term);\n\t\t\t\n\t\t\t$long = 0;\n\t\t\t$lat = 0;\t\t\t\n\n\t\t\t//postcode?\n\t\t\tif($this->search_type == 'postcode'){\n\n\t\t\t\t//if its a partial postcode, padd it\n\t\t\t\t$clean_postcode = clean_postcode($search_term);\n\t\t\t\t$longlat = get_postcode_location($clean_postcode, 'UK');\n\n\t\t\t\tif($longlat != false){\n\t\t\t\t\t$long = $longlat[0];\n\t\t\t\t\t$lat = $longlat[1];\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t\t//Update the stats table\n\t\t\t\ttableclass_stat::increment_stat(\"search.type.ukpostcode\");\n\t\t\t}\n\t\t\t\n\t\t\t//zipcode?\n\t\t\tif($this->search_type == 'zipcode'){\n\t\t\t\t$clean_postcode = trim($search_term);\n\t\t\t\t$longlat = get_postcode_location($clean_postcode, 'US');\n\t\t\t\tif($longlat == false){\n\t\t\t\t\tarray_push($this->warnings, \"A error occured when trying to find that zip code\");\n\t\t\t\t\ttrigger_error(\"Unable to get location for zipcode: \" . $search_term);\n\t\t\t\t}else{\n\t\t\t\t\t$long = $longlat[0];\n\t\t\t\t\t$lat = $longlat[1];\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Update the stats table\n\t\t\t\ttableclass_stat::increment_stat(\"search.type.zipcode\");\t\t\t\t\n\t\t\t}\n\t\t\t//long lat?\n\t\t\tif($this->search_type == 'longlat'){\n\n\t\t\t\t$split = split(\",\", trim($search_term));\n\t\t\t\t$long = $split[0];\n\t\t\t\t$lat = $split[1];\n\n\n\t\t\t\t//Update the stats table\n\t\t\t\ttableclass_stat::increment_stat(\"search.type.longlat\");\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t//Do the search for groups directly covering this location\n\t\t\t$search = factory::create('search');\n\t\t\t$groups = $search->search('group', $this->add_category(array(\n\t\t\t\tarray('long_bottom_left', '<', $long),\n\t\t\t\tarray('long_top_right', '>', $long),\n\t\t\t\tarray('lat_bottom_left', '<', $lat),\n\t\t\t\tarray('lat_top_right', '>', $lat),\n\t\t\t\tarray('confirmed', '=', 1)\t\t\n\t\t\t\t), $category),\n\t\t\t\t'AND'\n\t\t\t);\n\t\t\t\n\t\t\t//Do another search with buffeering based on population density \n\t\t\t$gaze = factory::create('gaze');\n\t\t\t$radius_km = $gaze->get_radius_containing_population($long, $lat, POPULATION_THRESHOLD, MAX_KM_DISTANCE_BUFFER);\n\t\t\t\n\t\t\t//if that worked, do the other search\n\t\t\tif ($radius_km && $gaze->status !='service unavaliable' && !get_http_var('pointonly')) {\n\t\t\t\n\t\t\t\t//work out the buffered long / lat values\n\t\t\t\t$buffered_long = distance_to_longitude($radius_km);\n\t\t\t\t$buffered_lat = distance_to_latitude($radius_km);\n\n\t\t\t\t//make the bounding box\n\t\t\t\t$buffered_bottom_left_long = $long - $buffered_long;\n\t\t\t\t$buffered_bottom_left_lat = $lat - $buffered_lat;\n\t\t\t\t$buffered_top_right_long = $long + $buffered_long;\n\t\t\t\t$buffered_top_right_lat = $lat + $buffered_lat;\n\n\t\t\t\t//do the buffered searches (THIS IS REALY INEFFICANT BUT PEAR DATA OBJECTS DONT DO MIXED AND/OR SEARCHES)\n\t\t\t\t$groups_buffered = array();\n\t\t\t\t$groups_buffered1 = $search->search('group', $this->add_category(array(\n\t\t\t\t\tarray('long_bottom_left', '>', $buffered_bottom_left_long),\n\t\t\t\t\tarray('long_bottom_left', '<', $buffered_top_right_long),\n\t\t\t\t\tarray('lat_bottom_left', '>', $buffered_bottom_left_lat),\n\t\t\t\t\tarray('lat_bottom_left', '<', $buffered_top_right_lat),\n\t\t\t\t\tarray('confirmed', '=', 1)\t\t\t\t\n\t\t\t\t\t), $category),\n\t\t\t\t\t'AND'\n\t\t\t\t);\n\t\t\t\t$groups_buffered = array_merge($groups_buffered, $groups_buffered1);\n\t\t\t\t\n\t\t\t\t$groups_buffered2 = $search->search('group', $this->add_category(array(\n\t\t\t\t\tarray('long_top_right', '<', $buffered_top_right_long),\n\t\t\t\t\tarray('long_top_right', '>', $buffered_top_right_long),\n\t\t\t\t\tarray('lat_top_right', '>', $buffered_bottom_left_lat),\n\t\t\t\t\tarray('lat_top_right', '<', $buffered_top_right_lat),\n\t\t\t\t\tarray('confirmed', '=', 1)\t\t\t\t\n\t\t\t\t\t), $category),\n\t\t\t\t\t'AND'\n\t\t\t\t);\n\t\t\t\t$groups_buffered = array_merge($groups_buffered, $groups_buffered2);\n\t\t\t\t\n\t\t\t\t$groups_buffered3 = $search->search('group', $this->add_category(array(\n\t\t\t\t\tarray('long_bottom_left', '>', $buffered_bottom_left_long),\n\t\t\t\t\tarray('long_bottom_left', '<', $buffered_top_right_long),\n\t\t\t\t\tarray('lat_top_right', '>', $buffered_bottom_left_lat),\n\t\t\t\t\tarray('lat_top_right', '<', $buffered_top_right_lat),\n\t\t\t\t\tarray('confirmed', '=', 1)\t\t\t\t\n\t\t\t\t\t), $category),\n\t\t\t\t\t'AND'\n\t\t\t\t);\n\t\t\t\t$groups_buffered = array_merge($groups_buffered, $groups_buffered3);\n\t\t\t\t\n\t\t\t\t$groups_buffered4 = $search->search('group', $this->add_category(array(\n\t\t\t\t\tarray('long_top_right', '>', $buffered_bottom_left_long),\n\t\t\t\t\tarray('long_top_right', '<', $buffered_top_right_long),\n\t\t\t\t\tarray('lat_bottom_left', '>', $buffered_bottom_left_lat),\n\t\t\t\t\tarray('lat_bottom_left', '<', $buffered_top_right_lat),\n\t\t\t\t\tarray('confirmed', '=', 1)\t\t\t\t\n\t\t\t\t\t), $category),\n\t\t\t\t\t'AND'\n\t\t\t\t);\n\t\t\t\t$groups_buffered = array_merge($groups_buffered, $groups_buffered4);\n\n\t\t\t\t//if we have any buffered groups, add them in\n\t\t\t\tif($groups_buffered){\n\t\t\t\t\t$groups = array_merge($groups, $groups_buffered);\n\t\t\t\t\t\n\t\t\t\t\t//remove any duplicates (again should really be in the database call)\n\t\t\t\t\t$cleaned_groups = array();\n\t\t\t\t\tforeach ($groups as $group){\n\t\t\t\t\t\tif (!isset($cleaned_groups[$group->group_id]))\n\t\t\t\t\t\t\t$cleaned_groups[$group->group_id] = $group;\n\t\t\t\t\t}\n\t\t\t\t\t$groups = array_values($cleaned_groups);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tusort($groups, create_function('$a,$b',\n\t\t\t\t'\n\t\t\t\tif ($a->{category_id} < $b->{category_id}) return -1;\n\t\t\t\tif ($a->{category_id} > $b->{category_id}) return 1;\n\t\t\t\tif ($a->{zoom_level} < $b->{zoom_level}) return 1;\n\t\t\t\tif ($a->{zoom_level} > $b->{zoom_level}) return -1;\n\t\t\t\treturn 0;\n\t\t\t\t'\n\t\t\t));\n\n\t\t\t//Update the stats table\n\t\t\ttableclass_stat::increment_stat(\"search.count\");\n\t\t\t\n\t\t\t//Return search result\n\t\t\treturn array($groups, $long, $lat);\n\t\t\t\n\t\t}", "public function suggest() {\n // Set the content type to json\n $this->response->type('application/json');\n $result = $this->searchPlace();\n $this->set('result', $result);\n }", "public function search($search);", "function query_api($term, $location, $price, $radius, $categories, $sort) { \n $response = search($term, $location, $price, $radius, $categories, $sort);\n echo $response;\n}", "public static function search($query, &$results = array()) {\n\n }", "public function search($jql)\n {\n return $this->client->get('/rest/api/2/search?jql='.urlencode($jql));\n }", "public function search(){\n //includes google maps script for place autocomplete and to get experiences\n \t$this->set('jsIncludes',array('http://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&language=fr&libraries=places','places_autocomplete','get_experiences','logo_fly','jquery.dropdown','cookies'));\n \n //sets motives, schools and departments by alphbetical order\n $this->__set_motives_schools_and_departments();\n }", "public function search($query, $year = null, $language = null);", "public function search($keyword)\n {\n }", "public function search(Request $request)\r\n {\r\n /*$request->validate([\r\n 'query' => 'required|min:3',\r\n ]);\r\n*/\r\n $query = $request->input('query');\r\n\r\n // $products = Product::where('name', 'like', \"%$query%\")\r\n // ->orWhere('details', 'like', \"%$query%\")\r\n // ->orWhere('description', 'like', \"%$query%\")\r\n // ->paginate(10);\r\n\r\n $listings = Listing::search($query)->paginate(10);\r\n}", "function search($searchType, $price, $location, $categories) {\n $url_params = array();\n \n $url_params['term'] = $searchType;\n //$url_params['location'] = $location;\n $url_params['longitude'] = $location[0];\n $url_params['latitude'] = $location[1];\n //8046.72 is equivalent to 5 miles 16093.44 is equivalent to 10 miles\n $url_params['radius'] = 16093;\n $url_params['price'] = $price;\n $url_params['sort_by'] = 'rating';\n $url_params['open_now'] = true;\n $url_params['limit'] = 20;\n $url_params['categories'] = $categories;\n \n //converts into 'https://api.yelp.com/v3/businesses/search/location&limit&price&sort_by&radius'\n $response = request($GLOBALS['API_HOST'], $GLOBALS['SEARCH_PATH'], $url_params);\n \n $pretty_response = json_encode(json_decode($response), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);\n\n $data = json_decode($pretty_response, true);\n\n return $data['businesses'];\n}", "public function search() {\n\t\tif(isset($_GET['query'])) $this->query_str = $_GET['query'];\n\t\telse return;\n\n\t\t$raw = null;\n\n\t\t$cache = new Cache($this->query_str);\n\t\t//check if the result is cached\n\t\t\n\t\tif($cache->allow_cache()) {\n\t\t\t$raw = $cache->load_cache();\n\t\t\tif($raw === false) $raw = null;\n\t\t}\n\n\t\tif($raw === null) {\n\t\t\t//check if jar exists\n\t\t\tif(file_exists('../executable/app.jar')) $raw = shell_exec('cd ../executable/ && java -jar app.jar search ' . escapeshellarg($this->query_str));\n\t\t\telse return;\n\n\t\t\t//only save into cached when the escaped string equal to input string\n\t\t\tif($raw !== null && count($raw) > 0 && $cache->allow_cache()) \n\t\t\t\t$cache->save_cache($raw);\n\t\t}\n\n\t\t$this->results = json_decode($raw);\n\n\t\t$this->end_time = microtime(true);\n\t}", "function _admin_search_query()\n {\n }" ]
[ "0.7596438", "0.74730897", "0.7405362", "0.7267051", "0.716777", "0.7147625", "0.6984506", "0.69432247", "0.6934082", "0.68978876", "0.6779909", "0.67794234", "0.6776836", "0.67475784", "0.67475784", "0.67432684", "0.67276835", "0.6668217", "0.6656132", "0.6567901", "0.6552493", "0.654868", "0.65439355", "0.65200305", "0.6518319", "0.650361", "0.64876413", "0.6471368", "0.6468047", "0.64542145" ]
0.7809321
0
Query the Business API by business_id
function get_business($business_id) { $business_path = $GLOBALS['BUSINESS_PATH'] . urlencode($business_id); return request($GLOBALS['API_HOST'], $business_path); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_business($bearer_token, $business_id) {\n $business_path = $GLOBALS['BUSINESS_PATH'] . urlencode($business_id);\n \n return request($GLOBALS['API_HOST'], $business_path);\n}", "function GetBusiness($businessId)\n\t{\n\t\t$result = $this->sendRequest(\"GetBusiness\", array(\"BusinessId\"=>$businessId));\t\n\t\treturn $this->getResultFromResponse($result);\n\t}", "function get_business_details($business_id) {\n\n //converts into '/v3/businesses/{id}'\n $business_path = $GLOBALS['BUSINESS_PATH'] . urlencode($business_id);\n \n $response = request($GLOBALS['API_HOST'], $business_path);\n\n $pretty_response = json_encode(json_decode($response), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);\n\n $data = json_decode($pretty_response, true);\n\n //var_dump($data);\n\n return $data;\n}", "function select_business_data($bus_id)\n\t{\n\t\tglobal $db;\n\n\t\t$sql = \"SELECT * FROM \" . GARAGE_BUSINESS_TABLE . \" WHERE id = '$bus_id' \";\n\n\t\tif( !($result = $db->sql_query($sql)) )\n\t\t{\n\t\t\tmessage_die(GENERAL_ERROR, 'Could Not Select Model', '', __LINE__, __FILE__, $sql);\n\t\t}\n\n\t\t$row = $db->sql_fetchrow($result);\n\t\t$db->sql_freeresult($result);\n\n\t\treturn $row;\n\t}", "public function getBusinessId()\n {\n return $this->business_id;\n }", "public function getBusinessId()\n {\n return $this->business_id;\n }", "public function getBusinessId()\n {\n return $this->business_id;\n }", "public function getBusinessId()\n {\n return $this->business_id;\n }", "public function getBusinessId()\n {\n return $this->business_id;\n }", "public function getBusinessById($id) {\n\t\t$em = $this->getEntityManager();\n\t\t/** @var $business Business */\n\t\t$business = $em->getRepository('Business')->findOneByBusinessID($id);\n\t\tif (empty($business)) {\n\t\t\treturn $this->respondError(\"Invalid business ID\", 400);\n\t\t}\n\t\t\n\t\t$response = $business;\n\t\t\n\t\t// Is parent?\n\t\tif ($business->getParentBusinessID() == 0) {\n\t\t\t// Get the children\n\t\t\t$children = $em->getRepository('Business')->findBy(array(\n\t\t\t\t'parentBusinessID' => $business->getBusinessID()\n\t\t\t));\n\t\t\t$response->children = $children;\n\t\t}\n\t\telse {\n\t\t\t// Get the parent\n\t\t\tif ($business->getParentBusinessID() != $business->getBusinessID()) {\n\t\t\t\t$parent = $em->getRepository('Business')->findOneBy(array(\n\t\t\t\t\t'businessID' => $business->getParentBusinessID()\n\t\t\t\t));\n\t\t\t\t$response->parent = $parent;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Add meta data\n\t\t$metaData = $em->getRepository('MetaData')->findBy(array(\n\t\t\t'type' => 'business',\n\t\t\t'typeID' => $business->getBusinessID()\n\t\t), array(\n\t\t\t'valueOrder' => 'ASC'\n\t\t));\n\t\t$response->meta_data = $metaData;\n\t\t\n\t\treturn $this->respond($response);\n\t}", "public function show(Business $business)\n {\n //\n }", "public function getBusiness($businessId)\n {\n $businessPath = $this->businessPath . urlencode($businessId);\n\n return $this->request($businessPath);\n }", "public function getBusinessId()\n {\n return $this->id;\n }", "public function findById(string $id): BusinessResponse\n {\n return $this->mappedGet('empresa/id/' . $id, BusinessResponse::class);\n }", "function getAnswersByBusinessId($userId, $business_id, $conn) {\n $sql = \"SELECT * FROM tbl_business_answer WHERE u_id='\".$userId.\"' AND business_id = '\".$business_id.\"'\";\n $result = mysqli_query($conn, $sql);\n return mysqli_fetch_all($result, MYSQLI_ASSOC);\n }", "function get_chamber_business(){\r\n $sql = $this->db->prepare(\"SELECT businessID, businessname FROM BUSINESS WHERE chamberID = :chamberid;\");\r\n\r\n $result = $sql->execute(array(\r\n \"chamberid\" => $_SESSION['chamber'],\r\n ));\r\n\r\n if ($result)\r\n return $sql->fetchAll(PDO::FETCH_ASSOC);\r\n else\r\n return false;\r\n }", "public function business() {\n return $this->belongsTo( 'App\\Http\\Models\\Business', 'business_id', 'id' );\n }", "public function setBusinessId($var)\n {\n GPBUtil::checkString($var, True);\n $this->business_id = $var;\n }", "public function setBusinessId($var)\n {\n GPBUtil::checkString($var, True);\n $this->business_id = $var;\n }", "public function setBusinessId($var)\n {\n GPBUtil::checkString($var, True);\n $this->business_id = $var;\n }", "public function setBusinessId($var)\n {\n GPBUtil::checkString($var, True);\n $this->business_id = $var;\n }", "public function setBusinessId($var)\n {\n GPBUtil::checkString($var, True);\n $this->business_id = $var;\n }", "public function business( ) {\n return $this->belongsTo( 'App\\Http\\Models\\Business', 'business_id', 'id' );\n }", "public function show($id)\n {\n $business = Business::with('offices', 'jobs')->find($id);\n return ['business' => $business];\n }", "function GetBusinessList($businessIds)\n\t{\n\t\t$result = $this->sendRequest(\"GetBusinessList\", array(\"BusinessIds\"=>$businessIds));\t\n\t\treturn $this->getResultFromResponse($result);\n\t}", "public function __construct($business_id)\r\n {\r\n $this->business_id = $business_id;\r\n }", "function query_api($term, $location) {\r\n $response = json_decode(search($term, $location));\r\n $business_id = $response->businesses[0]->id;\r\n /* \r\n print sprintf(\r\n \"%d local businesses found, querying business info for the top result \\\"%s\\\"\\n\\n <br>\",\r\n count($response->businesses),\r\n $business_id\r\n );\r\n */ \r\n $response = get_business($business_id);\r\n \r\n print sprintf(\"Result for business \\\"%s\\\" found:\\n\", $business_id);\r\n $pretty_response = json_encode(json_decode($response), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);\r\n print \"$pretty_response\\n\";\r\n\r\n return json_decode($response, true);\r\n }", "function getBookingsByCustomerId($customerid) {\n $query = \"SELECT * FROM `bookings` WHERE CustomerId='\" . $customerid . \"'\";\n \n $result = Database::selectQuery($query);\n \n if($result == null) {\n return null;\n } else {\n return $result;\n }\n }", "public function setBusinessId($id)\n {\n $this->id = $id;\n }", "public function show($id)\n {\n $business = Business::findOrfail($id);\n\n return new BusinessResource($business);\n }" ]
[ "0.72874045", "0.68762845", "0.6643683", "0.6613496", "0.64544404", "0.64544404", "0.64544404", "0.64544404", "0.64544404", "0.64386517", "0.6426751", "0.63784474", "0.6187909", "0.61160827", "0.60744554", "0.60321623", "0.60273176", "0.602034", "0.602034", "0.602034", "0.602034", "0.602034", "0.5971741", "0.59451526", "0.5921251", "0.5893548", "0.5798308", "0.5775919", "0.57684815", "0.56807035" ]
0.7619095
0
Get the existing recommandation category list
function getCategoryRecommandationList(){ global $wpdb; $query = $wpdb->prepare( "SELECT RECOMMANDATION_CAT.*, PIC.photo FROM " . TABLE_CATEGORIE_PRECONISATION . " AS RECOMMANDATION_CAT LEFT JOIN " . TABLE_PHOTO_LIAISON . " AS LINK_ELT_PIC ON ((LINK_ELT_PIC.idElement = RECOMMANDATION_CAT.id) AND (tableElement = '" . TABLE_CATEGORIE_PRECONISATION . "') AND (LINK_ELT_PIC.isMainPicture = 'yes')) LEFT JOIN " . TABLE_PHOTO . " AS PIC ON ((PIC.id = LINK_ELT_PIC.idPhoto)) WHERE RECOMMANDATION_CAT.status = 'valid' GROUP BY RECOMMANDATION_CAT.id", ""); $CategoryRecommandationList = $wpdb->get_results($query); return $CategoryRecommandationList; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCategories();", "public function getCategories();", "public function getCategories(){\n\t\t$query = \"SELECT * FROM final_categoria\";\n\t\treturn $this->con->action($query);\n\t}", "public function getCategoryList()\n {\n// return $this->categoryList = DB::table('categories')->get();\n return $this->categoryList = Categories::all();\n }", "public function getRewardCategories()\r\n {\r\n return Controllers\\RewardCategories::getInstance();\r\n }", "public function get_category_list()\n\t{\n\t\t$result = $this->db->from(\"category\")\n\t\t->where(array(\"category_status\" => 1,\"main_category_id\"=>0))->orderby(\"category_name\",\"ASC\")->get();\n\t\treturn $result;\n\t}", "function category_list() {\n $query = $this->db->get(\"categories\");\n return $query->result_array();\n }", "public function get_category_list()\n\t{\n\t\t$result = $this->db->from(\"category\")->where(array(\"category_status\" => 1,\"main_category_id\"=>0))->orderby(\"category_name\",\"ASC\")->get();\n\t\treturn $result;\n\t}", "public function getCategoriesList() {\n return $this->_get(16);\n }", "public function get_category_list()\n\t{\n\t\t$result = $this->db->from(\"category\")\n\t\t\t\t\t\t->where(array(\"category_status\" => 1,\"main_category_id\"=>0))\n\t\t\t\t\t\t->orderby(\"category_name\", \"ASC\")\n\t\t\t\t\t\t->get();\n\t\treturn $result;\n\t}", "public function getCategory() {}", "public function getAllCategories(){\r\n\t\treturn $this->query(\"SELECT * FROM category\");\r\n\t}", "public function getCategoryList()\n {\n $this->db->select(\"tc_category\");\n $this->db->from(\"ims_hris.training_category\");\n $this->db->where(\"COALESCE(tc_status,'N') = 'Y'\");\n $this->db->order_by(\"1\");\n $q = $this->db->get();\n \n return $q->result_case('UPPER');\n }", "public function getCategory();", "public function getCategory();", "public function getCategoriesForListView(): Collection;", "public function getCategory()\n {\n }", "public function getAllCategories();", "public function getCategories() : array;", "public function getCategoryList()\r\n\t{\r\n\t\t$this->db->select('*');\r\n\t\t$this->db->from('tbl_category');\r\n\t\t$this->db->where(\"(category_parent_id = '' OR category_parent_id = '0')\");\r\n\t\t$this->db->where('category_status', '1');\r\n\t\t$this->db->where('category_type', 'Product');\r\n\t\t$query = $this->db->get();\r\n\t\treturn $query->result() ;\r\n\t}", "public function getCategoryList() {\n $categories = $this->couponServices_model->fetchCategories();\n\n $category_options = array();\n $category_options[\"\"] = \"-- Select category --\";\n foreach ($categories as $item) {\n $category_options[$item['categoryId']] = $item['categoryName'];\n }\n return $category_options;\n }", "function getCategorias(){\r\n $conector = new Conector();\r\n $banco = new BancoCategoria();\r\n return $banco->getCategorias($conector->getConexao());\r\n }", "function afficherCategories()\n\t{\n\t\t$sql=\"SElECT * From categorie\";\n\t\t$db = config::getConnexion();\n\t\ttry\n\t\t{\n\t\t$liste=$db->query($sql);\n\t\treturn $liste;\n\t\t}\n catch (Exception $e)\n {\n die('Erreur: '.$e->getMessage());\n }\t\n\t}", "public function getList()\n {\n $categories = array();\n\n $q = $this->_db->query('SELECT * FROM categorie ORDER BY idCategorie');\n\n while ($donnees = $q->fetch(PDO::FETCH_ASSOC))\n {\n $categories[] = ($donnees);\n \n }\n }", "public function categories() {\n\t\treturn $this->terms('category');\n\t}", "public static function getCategories() {\n $top_level_cats = array();\n//Select all top level categories\n Db_Actions::DbSelect(\"SELECT * FROM cscart_categories LEFT OUTER JOIN cscart_category_descriptions ON cscart_categories.category_id = cscart_category_descriptions.category_id WHERE cscart_categories.parent_id=0\");\n $result = Db_Actions::DbGetResults();\n if (!isset($result->empty_result)) {\n foreach ($result as $cat) {\n $top_level_cats[] = array('id' => $cat->category_id,\n 'cat_name' => $cat->category,\n 'company_id' => $cat->company_id,\n 'status' => $cat->status,\n 'product_count' => $cat->product_count,\n 'is_op' => $cat->is_op,\n 'usergroup_ids' => $cat->usergroup_ids);\n }\n }\n if (!isset($result->empty_result)) {\n return $result;\n }\n else {\n return new stdClass();\n }\n }", "public function findCategories();", "public static function getActiveCategories(){}", "function getCategories(){\n\treturn dbSelect('categories');\n}", "function getDocumentCategories()\n\t{\n\t\tif(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');\n\t\t$module_srl = Context::get('module_srl');\n\t\t$categories= $this->getCategoryList($module_srl);\n\t\t$lang = Context::get('lang');\n\t\t// No additional category\n\t\t$output = \"0,0,{$lang->none_category}\\n\";\n\t\tif($categories)\n\t\t{\n\t\t\tforeach($categories as $category_srl => $category)\n\t\t\t{\n\t\t\t\t$output .= sprintf(\"%d,%d,%s\\n\",$category_srl, $category->depth,$category->title);\n\t\t\t}\n\t\t}\n\t\t$this->add('categories', $output);\n\t}" ]
[ "0.7073164", "0.7073164", "0.70191187", "0.6952801", "0.6952469", "0.6925243", "0.69237745", "0.691156", "0.6873652", "0.68731844", "0.68014926", "0.6720509", "0.67117107", "0.6695676", "0.6695676", "0.6617632", "0.66162014", "0.66094625", "0.65975153", "0.65836245", "0.65781736", "0.65739214", "0.65715456", "0.6570649", "0.65603954", "0.65437615", "0.6540404", "0.652218", "0.6517411", "0.6512365" ]
0.76744723
0
Get the output for the recommandation categories list for a category
function getCategoryRecommandationListOutput($outputMode = 'pictos', $selectedRecommandationCategory = '', $arguments = array()) { $categoryListOutput = ''; $categoryList = evaRecommandationCategory::getCategoryRecommandationList(); $specific_container = !empty($arguments) && !empty($arguments['form_container']) ? $arguments['form_container'] . '_' : ''; if ($outputMode == 'pictos') { $i = 0; foreach($categoryList as $category) { $recommandationMainPicture = evaPhoto::checkIfPictureIsFile($category->photo, TABLE_CATEGORIE_PRECONISATION); if (!$recommandationMainPicture) { $recommandationMainPicture = ''; } else { $checked = $selectedClass = ''; if (($selectedRecommandationCategory != '') && ($selectedRecommandationCategory == $category->id)) { $checked = ' checked="checked" '; $selectedClass = 'recommandationCategorySelected'; } $recommandationMainPicture = ' <div class="alignleft recommandationCategoryBloc ' . $selectedClass . '" > <label for="' . $specific_container . 'recommandationCategory' . $category->id . '" > <img class="recommandationDefaultPictosList" src="' . $recommandationMainPicture . '" alt="' . ucfirst(strtolower($category->nom)) . '" title="' . ELEMENT_IDENTIFIER_P . $category->id . '&nbsp;-&nbsp;' . ucfirst(strtolower($category->nom)) . '" /> </label> <input class="hide ' . $specific_container . 'recommandationCategory" type="radio" ' . $checked . ' id="' . $specific_container . 'recommandationCategory' . $category->id . '" name="recommandationCategory" value="' . $category->id . '" /> </div>'; } $categoryListOutput .= $recommandationMainPicture; $i++; } } else if ($outputMode == 'selectablelist') { $categoryListOutput = EvaDisplayInput::afficherComboBox($categoryList, 'recommandationCategory', __('Cat&eacute;gorie', 'evarisk'), 'recommandationCategory', "", ""); } return $categoryListOutput; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function retrieve_category_description() {\n\t\treturn $this->retrieve_term_description();\n\t}", "function getCategoryRecommandationList(){\r\n\t\tglobal $wpdb;\r\n\r\n\t\t$query = $wpdb->prepare(\r\n\t\t\t\"SELECT RECOMMANDATION_CAT.*, PIC.photo\r\n\t\t\tFROM \" . TABLE_CATEGORIE_PRECONISATION . \" AS RECOMMANDATION_CAT\r\n\t\t\t\tLEFT JOIN \" . TABLE_PHOTO_LIAISON . \" AS LINK_ELT_PIC ON ((LINK_ELT_PIC.idElement = RECOMMANDATION_CAT.id) AND (tableElement = '\" . TABLE_CATEGORIE_PRECONISATION . \"') AND (LINK_ELT_PIC.isMainPicture = 'yes'))\r\n\t\t\t\tLEFT JOIN \" . TABLE_PHOTO . \" AS PIC ON ((PIC.id = LINK_ELT_PIC.idPhoto))\r\n\t\t\tWHERE RECOMMANDATION_CAT.status = 'valid'\r\n\t\t\t\tGROUP BY RECOMMANDATION_CAT.id\", \"\");\r\n\r\n\t\t$CategoryRecommandationList = $wpdb->get_results($query);\r\n\r\n\t\treturn $CategoryRecommandationList;\r\n\t}", "public function GetCategories()\n {\n \n \n global $PAGE;\n $output = '';\n \n \n if ($this->Is_Instructor) {\n $type = \" AND `type_instructor`=1\";\n } else {\n $type = \" AND `type_customer`=1\";\n }\n \n \n # GET THE CURRENTLY SELECTED CATEGORY\n # ============================================================================\n $default_selected_cid = ($this->Use_Common_Category) ? $this->Common_Category_Id : $this->Default_Category_Id;\n $eq_cat = (Get('eq')) ? GetEncryptQuery(Get('eq'), false) : null;\n $selected_cid = (isset($eq_cat['cid'])) ? $eq_cat['cid'] : $default_selected_cid;\n \n if ($this->Use_Common_Category) {\n $selected_common = (isset($eq_cat['special']) && $eq_cat['special'] == 'common') ? true : false;\n $selected_common = ($selected_cid == $this->Common_Category_Id) ? true : $selected_common;\n } else {\n $selected_common = ($selected_cid == $this->Common_Category_Id) ? true : false;\n }\n \n if ($this->Use_Display_All_Category) {\n $selected_all = (isset($eq_cat['special']) && $eq_cat['special'] == 'all') ? true : false;\n $selected_all = ($selected_cid == $this->All_Category_Id) ? true : $selected_all;\n }\n //$selected_all = true;\n \n \n # GET ALL THE CATEGORIES\n # ============================================================================\n $records = $this->SQL->GetArrayAll(array(\n 'table' => $GLOBALS['TABLE_helpcenter_categories'],\n 'keys' => '*',\n 'where' => \"`active`=1 $type\",\n ));\n if ($this->Show_Query) echo \"<br />LAST QUERY = \" . $this->SQL->Db_Last_Query;\n \n \n \n # OUTPUT THE CATEGORIES MENU\n # ============================================================================\n $output .= '<div class=\"orange left_header\">HELP CENTER TOPICS</div><br />';\n $output .= '<div class=\"left_content\">';\n \n # OUTPUT COMMON CATEGORY\n if ($this->Use_Common_Category) {\n $eq = EncryptQuery(\"cat=Most Common;cid=0;special=common\");\n $link = \"{$PAGE['pagelink']};eq=$eq\";\n $class = ($selected_common) ? 'faq_selected_category' : '';\n $output .= \"<div class='$class'><a href='{$link}' class='link_arrow' >Most Common</a></div><br />\";\n }\n \n # OUTPUT ALL DATABASE CATEGORIES\n foreach ($records as $record) {\n \n # MAKE LINKS\n if ($this->Use_Seo_Urls) {\n $title = ProcessStringForSeoUrl($record['title']);\n $query_link = '/' . EncryptQuery(\"cid={$record['helpcenter_categories_id']}\");\n $link = \"{$PAGE['pagelink']}/{$title}\" . $query_link;\n } else {\n $eq = EncryptQuery(\"cat={$record['title']};cid={$record['helpcenter_categories_id']}\");\n $link = \"{$PAGE['pagelink']};eq=$eq\";\n }\n \n $class = ($record['helpcenter_categories_id'] == $selected_cid) ? 'faq_selected_category' : '';\n $output .= \"<div class='$class'><a href='{$link}' class='link_arrow' >{$record['title']}</a></div>\";\n }\n \n # OUTPUT DISPLAY ALL CATEGORY\n if ($this->Use_Display_All_Category) {\n \n # MAKE LINKS\n if ($this->Use_Seo_Urls) {\n $title = ProcessStringForSeoUrl('View All');\n $query_link = '/' . EncryptQuery(\"cid={$this->All_Category_Id}\");\n $link = \"{$PAGE['pagelink']}/{$title}\" . $query_link;\n } else {\n $eq = EncryptQuery(\"cat=View All;cid={$this->All_Category_Id};special=all\");\n $link = \"{$PAGE['pagelink']};eq=$eq\";\n }\n \n $class = ($selected_all) ? 'faq_selected_category' : '';\n $output .= \"<br /><div class='$class'><a href='{$link}' class='link_arrow' >View All</a></div>\";\n }\n \n $output .= '</div>';\n \n \n AddStyle(\"\n .faq_selected_category {\n background-color:#F2935B;\n color:#fff;\n }\n \");\n \n return $output;\n \n\n }", "public function getCategories(){\n\t\t$query = \"SELECT * FROM final_categoria\";\n\t\treturn $this->con->action($query);\n\t}", "public function getCategory() {}", "public function getCategoryList()\n {\n $this->db->select(\"tc_category\");\n $this->db->from(\"ims_hris.training_category\");\n $this->db->where(\"COALESCE(tc_status,'N') = 'Y'\");\n $this->db->order_by(\"1\");\n $q = $this->db->get();\n \n return $q->result_case('UPPER');\n }", "function tc_category_list() {\r\n $post_terms = apply_filters( 'tc_cat_meta_list', $this -> _get_terms_of_tax_type( $hierarchical = true ) );\r\n $html = false;\r\n if ( false != $post_terms) {\r\n foreach( $post_terms as $term_id => $term ) {\r\n $html .= sprintf('<a class=\"%1$s\" href=\"%2$s\" title=\"%3$s\"> %4$s </a>',\r\n apply_filters( 'tc_category_list_class', 'btn btn-mini' ),\r\n get_term_link( $term_id , $term -> taxonomy ),\r\n esc_attr( sprintf( __( \"View all posts in %s\", 'customizr' ), $term -> name ) ),\r\n $term -> name\r\n );\r\n }//end foreach\r\n }//end if $postcats\r\n return apply_filters( 'tc_category_list', $html );\r\n }", "function getAllCategories()\n {\n // Get list of categories using solr\n $metadataDao = MidasLoader::loadModel('Metadata')->getMetadata(MIDAS_METADATA_TEXT, \"mrbextrator\", \"category\");\n $enabledDao = MidasLoader::loadModel('Metadata')->getMetadata(MIDAS_METADATA_TEXT, \"mrbextrator\", \"slicerdatastore\");\n $terms = array(); \n if($metadataDao)\n {\n $db = Zend_Registry::get('dbAdapter');\n $results = $db->query(\"SELECT value, itemrevision_id FROM metadatavalue WHERE metadata_id='\".$metadataDao->getKey().\"' order by value ASC\")\n ->fetchAll();\n foreach($results as $result)\n {\n $arrayTerms = explode(\" --- \", $result['value']);\n foreach($arrayTerms as $term)\n { \n if(strpos($term, \"zzz\") === false) continue;\n $tmpResults = $db->query(\"SELECT value FROM metadatavalue WHERE itemrevision_id='\".$result['itemrevision_id'].\"' AND metadata_id='\".$enabledDao->getKey().\"' order by value ASC\")\n ->fetchAll();\n if(empty($tmpResults))continue;\n $term = trim(str_replace('zzz', '', $term));\n if(!isset($terms[$term]))\n {\n $terms[$term] = 0;\n }\n $terms[$term]++;\n }\n } \n }\n ksort($terms);\n return $terms;\n }", "public function catCompare() {\n\t\tglobal $db;\n\t\t$user = new User;\n\t\t$lang = new Language;\n\t\t$where = \"WHERE category_author = '{$user->_user()}'\";\n\t\tif ( $user->can( 'manage_user_items' ) ) {\n\t\t\t$where = null;\n\t\t}\n\t\t$get = $db->customQuery( \"SELECT category_id,category_name FROM {$db->tablePrefix()}categories $where\" );\n\t\t$return = '';\n\t\t$getLinks = $db->customQuery( \"SELECT COUNT(*) FROM {$db->tablePrefix()}links WHERE link_category = '0'\" );\n\t\t$countLinks = $getLinks->fetch_row();\n\t\t$return .= \"['{$lang->_tr( 'Without Category', 1 )}', {$countLinks[0]}],\";\n\t\t$countLinks = $getLinks->fetch_row();\n\t\twhile ( $array = $get->fetch_array() ) {\n\t\t\t$getLinks = $db->customQuery( \"SELECT COUNT(*) FROM {$db->tablePrefix()}links WHERE link_category = '{$array['category_id']}'\" );\n\t\t\t$countLinks = $getLinks->fetch_row();\n\t\t\t$return .= \"['{$array['category_name']}', {$countLinks[0]}],\";\n\t\t}\n\t\treturn $return;\n\t}", "public function getCategories();", "public function getCategories();", "public function getCategory();", "public function getCategory();", "function GetCategories(){\n\t\t\tglobal $wpdb;\n\n\t\t\t$categories = get_all_category_ids();\n\t\t\t$separator = '|';\n\t\t\t$output = array();\n\t\t\tif($categories){\n\t\t\t\tforeach($categories as $category) {\n\t\t\t\t\t$temp_catname = get_cat_name($category);\n\t\t\t\t\tif ($temp_catname !== \"Uncategorized\"){\n\t\t\t\t\t\t$output[$category] = $temp_catname;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$output = 'test';\n\t\t\t}\n\t\t\treturn $output;\n\t\t}", "public function getCategories() {\n $sql = \"SELECT * FROM categories\";\n //Commit the query\n $result = $this->connection->query($sql);\n //Parse result to JSON list\n $answer = '{\"categories\": [';\n if ($result->num_rows > 0) {\n // output data of each row\n while($row = $result->fetch_assoc()) {\n $answer = $answer . '{\"ID\":\"' . $row[\"category_ID\"] . '\",' .\n '\"Name\": \"' . $row[\"category_Name\"] .'\"},' ;\n }\n //Trim the last comma\n $answer=rtrim($answer,\", \");\n //Finish parsing\n $answer=$answer . \"]}\";\n //Retrun the list as a string\n return $answer;\n } else {\n echo \"0 results\";\n }\n\n\n }", "public function getCategoryList()\n {\n global $user;\n\n $returned=array();\n\n if($this->options['galleryRoot'])\n {\n $startLevel=1;\n }\n else\n {\n $startLevel=0;\n }\n\n $sql=\"SELECT DISTINCT pct.id, pct.name, pct.global_rank AS `rank`, pct.status\n FROM \".CATEGORIES_TABLE.\" pct \";\n\n switch($this->options['filter'])\n {\n case self::FILTER_PUBLIC :\n $sql.=\" WHERE pct.status = 'public' \";\n break;\n case self::FILTER_ACCESSIBLE :\n if(!is_admin())\n {\n $sql.=\" JOIN \".USER_CACHE_CATEGORIES_TABLE.\" pucc\n ON (pucc.cat_id = pct.id) AND pucc.user_id='\".$user['id'].\"' \";\n }\n else\n {\n $sql.=\" JOIN (\n SELECT DISTINCT pgat.cat_id AS catId FROM \".GROUP_ACCESS_TABLE.\" pgat\n UNION DISTINCT\n SELECT DISTINCT puat.cat_id AS catId FROM \".USER_ACCESS_TABLE.\" puat\n UNION DISTINCT\n SELECT DISTINCT pct2.id AS catId FROM \".CATEGORIES_TABLE.\" pct2 WHERE pct2.status='public'\n ) pat\n ON pat.catId = pct.id \";\n }\n\n break;\n }\n $sql.=\"ORDER BY global_rank;\";\n\n $result=pwg_query($sql);\n if($result)\n {\n while($row=pwg_db_fetch_assoc($result))\n {\n $row['level']=$startLevel+substr_count($row['rank'], '.');\n\n /* rank is in formated without leading zero, giving bad order\n * 1\n * 1.10\n * 1.11\n * 1.2\n * 1.3\n * ....\n *\n * this loop cp,vert all sub rank in four 0 format, allowing to order\n * categories easily\n * 0001\n * 0001.0010\n * 0001.0011\n * 0001.0002\n * 0001.0003\n */\n $row['rank']=explode('.', $row['rank']);\n foreach($row['rank'] as $key=>$rank)\n {\n $row['rank'][$key]=str_pad($rank, 4, '0', STR_PAD_LEFT);\n }\n $row['rank']=implode('.', $row['rank']);\n\n $row['name']=GPCCore::getUserLanguageDesc($row['name']);\n\n $returned[]=$row;\n }\n }\n\n if($this->options['galleryRoot'])\n {\n $returned[]=array(\n 'id' => 0,\n 'name' => l10n('All the gallery'),\n 'rank' => '0000',\n 'level' => 0,\n 'status' => 'public',\n 'childs' => null\n );\n }\n\n usort($returned, array(&$this, 'compareCat'));\n\n if($this->options['tree'])\n {\n $index=0;\n $returned=$this->buildSubLevel($returned, $index);\n }\n else\n {\n //check if cats have childs & remove rank (enlight the response)\n $prevLevel=-1;\n for($i=count($returned)-1;$i>=0;$i--)\n {\n unset($returned[$i]['rank']);\n if($returned[$i]['status']=='private')\n {\n $returned[$i]['status']='0';\n }\n else\n {\n $returned[$i]['status']='1';\n }\n\n if($returned[$i]['level']>=$prevLevel)\n {\n $returned[$i]['childs']=false;\n }\n else\n {\n $returned[$i]['childs']=true;\n }\n $prevLevel=$returned[$i]['level'];\n }\n }\n\n return($returned);\n }", "function recharge_category() {\n\n\t\t$category = $this -> conn -> get_table_row_byidvalue('recharge_category', 'category_status', 1);\n\t\tforeach ($category as $key => $value) {\n\n\t\t\t$name = $value['category_name'];\n\t\t\t$category_id = $value['recharge_category_id'];\n\n\t\t\t$response[] = array('recharge_category_id' => $category_id, 'category_name' => $name);\n\t\t}\n\t\tif (!empty($response)) {\n\t\t\t$post = array(\"status\" => \"true\", \"message\" => $response);\n\t\t} else {\n\t\t\t$post = array('status' => \"false\", \"message\" => \"No Record Found\");\n\t\t}\n\n\t\techo $this -> json($post);\n\t}", "function recharge_category() {\n\n\t\t$category = $this -> conn -> get_table_row_byidvalue('recharge_category', 'category_status', 1);\n\t\tforeach ($category as $key => $value) {\n\n\t\t\t$name = $value['category_name'];\n\t\t\t$category_id = $value['recharge_category_id'];\n\t\t\t\n\t\t\t$response[] = array('recharge_category_id' => $category_id, 'category_name' => $name);\n\t\t}\n\t\tif(!empty($response)){\n\t\t\t$post = array(\"status\" => \"true\",\"message\" => $response);\n\t\t}else{\n\t\t\t$post = array('status' => \"false\",\"message\" => \"No Record Found\");\n\t\t}\n\t\t\n\t\techo $this -> json($post);\n\t}", "private function getCategory() {\n return '';\n }", "function getDocumentCategories()\n\t{\n\t\tif(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');\n\t\t$module_srl = Context::get('module_srl');\n\t\t$categories= $this->getCategoryList($module_srl);\n\t\t$lang = Context::get('lang');\n\t\t// No additional category\n\t\t$output = \"0,0,{$lang->none_category}\\n\";\n\t\tif($categories)\n\t\t{\n\t\t\tforeach($categories as $category_srl => $category)\n\t\t\t{\n\t\t\t\t$output .= sprintf(\"%d,%d,%s\\n\",$category_srl, $category->depth,$category->title);\n\t\t\t}\n\t\t}\n\t\t$this->add('categories', $output);\n\t}", "public function getCategory()\n {\n }", "public function categories() {\n\t\treturn $this->terms('category');\n\t}", "public function token_the_category() {\n\t\treturn implode( ', ', wp_list_pluck( (array)get_the_category(), 'name' ) );\n\t}", "public function getCategory()\n {\n return \"Injection Flaws\"; //See category.php for list of all the categories\n }", "public function findCategories();", "public function getCategories(){\n\t\t// preapres the request\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: ' . TOKEN));\n\t\tcurl_setopt($ch, CURLOPT_URL, \"http://\" . IP . \"/bde_site/api/category/\");\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n\t\t// send the request\n\t\t$output = curl_exec($ch);\n\t\t$info = curl_getinfo($ch);\n\t\tcurl_close($ch);\n\n\t\t// decode the answer into a php object\n\t\t$categories = json_decode($output, true);\n\n\t\treturn $categories;\n\t}", "function read_Categories() {\n\n\t\tglobal $myCategories;\n\t\tglobal $gesamt;\n\t\t\n\t\t$i = 0;\n\t\t\n\t\tforeach ($myCategories as $catInfo):\n\t\t\n\t\t$test=$myCategories->category[$i]['typ'];\n\t\t\n\t\tarray_push($gesamt, $test);\n\t\t\n\t\t$i++;\n\t\tendforeach;\t\n\t\t\n\t}", "function getCategory_details($category_name)\n\t\t{\n\t\t\t$details = $this->manage_content->getValue_where('vertical_navbar','*','menu_name',$category_name);\n\t\t\techo '<div class=\"category_header\">'.$details[0]['menu_name'].'</div>\n <br /><br/>\n <div class=\"category_description\">'.$details[0]['description'].'</div>';\n\t\t}", "function category(){\n\t\trequire('quizrooDB.php');\n\t\t$query = sprintf(\"SELECT cat_name FROM q_quiz_cat WHERE cat_id = %d\", GetSQLValueString($this->fk_quiz_cat, \"int\"));\n\t\t$getQuery = mysql_query($query, $quizroo) or die(mysql_error());\n\t\t$row_getQuery = mysql_fetch_assoc($getQuery);\n\t\treturn $row_getQuery['cat_name'];\n\t}", "public function GetCategories() {\n // Setup the Query\n $this->sql = \"SELECT *\n FROM categories\";\n \n // Run the query \n $this->RunBasicQuery();\n }" ]
[ "0.66375893", "0.6628101", "0.6549832", "0.6475605", "0.6454724", "0.6424433", "0.64082116", "0.6385193", "0.6338418", "0.6304909", "0.6304909", "0.62741977", "0.62741977", "0.6237723", "0.6224425", "0.62137187", "0.6212677", "0.6130184", "0.61257416", "0.6124295", "0.61215603", "0.6111906", "0.60967815", "0.6071749", "0.6064516", "0.60523796", "0.6051722", "0.6046533", "0.60459524", "0.6045142" ]
0.6635155
1
This command fetches the new versions of the packages.json from the known repositories This command fetches the new versions of the packages.json from the known repositories
public function updateCommand() { $this->browser->setRequestEngine($this->browserRequestEngine); $flowPackages = array(); foreach ($this->repositories as $baseUrl => $repository) { $domain = parse_url($repository, PHP_URL_HOST); #$baseUrl = dirname($repository) . '/'; $basePath = FLOW_PATH_DATA . 'Packages/' . $domain; if (!is_dir(FLOW_PATH_DATA . 'Packages/')) { mkdir(FLOW_PATH_DATA . 'Packages/'); } if (!is_dir(FLOW_PATH_DATA . 'Packages/' . $domain)) { mkdir(FLOW_PATH_DATA . 'Packages/' . $domain); } $response = $this->browser->request($repository); $packagesFile = $basePath . '/packages.json'; file_put_contents($packagesFile, $response->getContent()); $packageList = json_decode($response->getContent()); if (isset($packageList->includes)) { $includes = get_object_vars($packageList->includes); if (!empty($includes)) { foreach ($includes as $file => $meta) { $packagesFile = $basePath . '/' . $file; if (file_exists($packagesFile) && sha1_file($packagesFile) == $meta->sha1) { continue; } if (!is_dir(dirname(($packagesFile)))) { \TYPO3\Flow\Utility\Files::createDirectoryRecursively(dirname($packagesFile)); } try { $response = $this->browser->request($baseUrl . $file); file_put_contents($packagesFile, $response->getContent()); } catch(\Exception $e) { } } } } if (isset($packageList->providers)) { $providers = get_object_vars($packageList->providers); if (!empty($providers)) { foreach ($providers as $file => $meta) { $packagesFile = $basePath . '/' . $file; if (file_exists($packagesFile) && sha1_file($packagesFile) == $meta->sha1) { continue; } if (!is_dir(dirname(($packagesFile)))) { \TYPO3\Flow\Utility\Files::createDirectoryRecursively(dirname($packagesFile)); } try { $response = $this->browser->request($baseUrl . $file); file_put_contents($packagesFile, $response->getContent()); } catch(\Exception $e) { } } } } $files = \TYPO3\Flow\Utility\Files::readDirectoryRecursively($basePath, '.json'); foreach ($files as $file) { $packagesObject = json_decode(file_get_contents($file)); $flowPackages = array_merge($flowPackages, $this->filterFlowPackages($packagesObject->packages)); } } $flowPackagesFile = FLOW_PATH_DATA . 'Packages/packages-typo3-flow.json'; file_put_contents($flowPackagesFile, json_encode($flowPackages)); $this->checkForNewPackages($flowPackages); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function find_updatable_packages() {\n\tif ($this->updatable === null) {\n\t\t/**\n\t\t * @todo don't call installed_packages here\n\t\t * instead, make calls to installed_version find out if there are installed\n\t\t * and let them cache the composer.lock themselves\n\t\t */\n\t\t$installed_packages = $this->find_installed_packages();\n\t\t$required_packages = $this->find_required_packages();\n\t\t\n\t\tif (debby\\VERBOSE) {\n\t\t\tdebby\\debby::log('Checking '.$this->get_name().' for updatable packages');\n\t\t}\n\t\t\n\t\tif (debby\\VERBOSE) {\n\t\t\t$debug_index = 0;\n\t\t\t$debug_count = count($required_packages);\n\t\t\t$debug_padding = strlen($debug_count);\n\t\t}\n\t\t\n\t\t$this->updatable = [];\n\t\tforeach ($required_packages as $package) {\n\t\t\tif (debby\\VERBOSE) {\n\t\t\t\t$debug_index++;\n\t\t\t\t$debug_prefix = \"\\t\".str_pad($debug_index, $debug_padding, $string=' ', $type=STR_PAD_LEFT).'/'.$debug_count.': ';\n\t\t\t\tdebby\\debby::log($debug_prefix.$package->get_name());\n\t\t\t}\n\t\t\t\n\t\t\t$version_regex = '/versions\\s*:.+v?([0-9]+\\.[0-9]+(\\.[0-9]+)?)(,|$)/U';\n\t\t\tif ($package->is_installed_by_reference()) {\n\t\t\t\t$version_regex = '/source\\s*:.+ ([a-f0-9]{40})$/m';\n\t\t\t}\n\t\t\t\n\t\t\t// find out the latest release\n\t\t\t$package_info = shell_exec('cd '.$this->path.' && '.$this->executable.' show -a '.escapeshellarg($package->get_name()));\n\t\t\tpreg_match($version_regex, $package_info, $latest_version);\n\t\t\tif (empty($latest_version)) {\n\t\t\t\t$e = new exception('can not find out latest release for '.$package->get_name());\n\t\t\t\t$e->stop();\n\t\t\t}\n\t\t\t\n\t\t\tif ($package->is_later_version($latest_version[1])) {\n\t\t\t\t$package->mark_updatable($latest_version[1]);\n\t\t\t\t$this->updatable[$package->get_name()] = $package;\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn array_values($this->updatable);\n}", "protected static function updatePackages()\n {\n if (! file_exists(base_path('package.json'))) {\n return;\n }\n\n $packages = json_decode(file_get_contents(base_path('package.json')), true);\n\n $packages['devDependencies'] = static::updatePackageArray(\n $packages['devDependencies']\n );\n\n file_put_contents(\n base_path('package.json'),\n json_encode($packages, JSON_PRETTY_PRINT)\n );\n }", "public function cloneJson()\n {\n $jsonData = array();\n try {\n $this->packages = $this->repo->getPackages();\n\n foreach ($this->packages as $package) {\n $this->packageName = $package->getPrettyName();\n\n if (!isset($this->packageName)) {\n throw new InvalidArgumentException(\"The package name was not found in the composer.json at '\"\n .$this->url.\"' in '\". $package->getPrettyVersion().\"' \");\n }\n\n if (!preg_match('{^[a-z0-9]([_.-]?[a-z0-9]+)*/[a-z0-9]([_.-]?[a-z0-9]+)*$}i', $this->packageName)) {\n throw new InvalidArgumentException(\n \"The package name '{$this->packageName}' is invalid, it should have a vendor name,\n\t\t\t\t\t\ta forward slash, and a package name. The vendor and package name can be words separated by -, . or _.\n\t\t\t\t\t\tThe complete name should match '[a-z0-9]([_.-]?[a-z0-9]+)*/[a-z0-9]([_.-]?[a-z0-9]+)*' at \"\n .$this->url.\"' in '\". $package->getPrettyVersion().\"' \");\n }\n\n if (preg_match('{[A-Z]}', $this->packageName)) {\n $suggestName = preg_replace('{(?:([a-z])([A-Z])|([A-Z])([A-Z][a-z]))}', '\\\\1\\\\3-\\\\2\\\\4', $this->packageName);\n $suggestName = strtolower($suggestName);\n\n throw new InvalidArgumentException(\n \"The package name '{$this->packageName}' is invalid,\n\t\t\t\t\t\tit should not contain uppercase characters. We suggest using '{$suggestName}' instead. at '\"\n .$this->url.\"' in '\". $package->getPrettyVersion().\"' \");\n }\n }\n\n $this->latestReleasePackage = $this->repo->findPackage($this->packageName, '9999999-dev');\n } catch (Exception $e) {\n $jsonData['ErrorMsg'] = $e->getMessage();\n return $jsonData;\n }\n\n $jsonData['AllRelease'] = $this->packages;\n $jsonData['LatestRelease'] = $this->latestReleasePackage;\n return $jsonData;\n }", "public function getVersions();", "public function getVersions();", "public function getVersions();", "public function getVersions()\n {\n return json_decode(\n file_get_contents(dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'version.json'),\n true\n );\n }", "public function gitCloneRepositories() {\n\t\t$count = 0;\n\n\t\t$packages = $this->Package->find('list');\n\t\tforeach ($packages as $id => $name) {\n\t\t\t$this->out(sprintf(__(\"* Downloading package %s\"), $name));\n\t\t\tif ($this->Package->setupRepository($id)); {\n\t\t\t\t$count++;\n\t\t\t}\n\t\t}\n\t\t$this->out(sprintf(__('* Downloaded %s of %s repositories'), $count, count($packages)));\n\t}", "protected function packages()\n {\n $target = path('base').'repositories.json';\n\n if (! is_file($target)) {\n throw new \\Exception('Missing repository. Please contact rakit team.'.PHP_EOL);\n }\n\n $target = file_get_contents($target);\n\n // Lihat: https://www.php.net/manual/en/function.json-last-error.php#118165\n $packages = @json_decode($target);\n\n if (strlen(trim($target)) < 1 || JSON_ERROR_NONE !== json_last_error()) {\n throw new \\Exception('Broken repository. Please contact rakit team.');\n }\n\n // Paksa seluruh objek stdClass di data json menjadi array.\n $packages = json_decode(json_encode($packages), true);\n\n return $packages;\n }", "public function scanForUpdates() {\n\n $objManager = new class_module_packagemanager_manager();\n $arrVersions = $objManager->getArrLatestVersion();\n\n foreach($arrVersions as $strOneModule => $strOneVersion) {\n $objMetadata = $objManager->getPackage($strOneModule);\n if($objMetadata != null) {\n $objManager->updateAvailable($objManager->getPackageManagerForPath($objMetadata->getStrPath()), $strOneVersion);\n }\n }\n\n return $arrVersions;\n }", "function gitUpdate()\n{\n \n $config = json_decode(file_get_contents(\"/app/config.json\"), true);\n\n $git = $config['git'];\n $remote = \"https://\" . $git['user'] . \":\" . $git['token'] . \"@github.com/\" . $git['git_dir'];\n exec(\"cd \" . $config['project_dir'] . \" && git init && git pull $remote \" . $git['branch']);\n exec(\"cd \" . $config['project_dir'] . \" && composer update\");\n}", "protected static function updatePackages($dev = true)\n {\n if (! file_exists(base_path('package.json'))) {\n return;\n }\n \n $packages = json_decode(file_get_contents(base_path('package.json')), true);\n \n $dependencies = static::updatePackageArray(\n $packages\n );\n\n $packages['dependencies'] = $dependencies['dependencies'];\n $packages['devDependencies'] = $dependencies['devDependencies'];\n\n ksort($packages['dependencies']);\n ksort($packages['devDependencies']);\n\n file_put_contents(\n base_path('package.json'),\n json_encode($packages, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT).PHP_EOL\n );\n }", "public function getUpdates()\n {\n $releaseData = @file_get_contents(config('services.website.api') . '/releases/latest');\n $version = @json_decode($releaseData, true)['version'];\n\n if (!$version) {\n return Redirect::route('about')->with([\n 'message' => trans('info.updates.error'),\n 'message_type' => 'danger',\n ]);\n }\n\n $version = substr($version, 1); // Strip \"v\" from the front\n\n if (version_compare($version, (new Codice)->getVersion(), 'gt')) {\n return Redirect::route('about')->with([\n 'message' => trans('info.updates.available', [\n 'url' => config('services.website.url'),\n 'version' => $version,\n ]),\n 'message_type' => 'warning',\n 'message_raw' => true,\n ]);\n } else {\n return Redirect::route('about')->with([\n 'message' => trans('info.updates.none'),\n 'message_type' => 'info',\n ]);\n }\n }", "public function do_download_update($protocol, $repo_to_update, $new_version)\n {\n try\n {\n global $wpdb;\n $repo = $protocol . '://' . esc_sql($repo_to_update) . '/@';\n $sql = \"SELECT a.post_title,b.post_id,b.meta_value FROM $wpdb->posts a inner join $wpdb->postmeta b on a.ID=b.post_id WHERE b.meta_key = '_scb_edd_repo_url' AND b.meta_value like '%$repo%' \";\n $posts = $wpdb->get_results($sql, ARRAY_A);\n\n p_l($posts);\n if (!is_array($posts) || !count($posts))\n {\n throw new Exception('nothing to process ' . $sql);\n }\n $failed = array();\n $passed = array();\n foreach ($posts as $download)\n {\n try\n {\n if (!isset($download['meta_value']))\n {\n throw new Exception('Download to update not found was looking for ' . $repo);\n }\n $repo_to_update_url = @unserialize($download['meta_value']);\n if (!is_array($repo_to_update_url))\n {\n throw new Exception('Download to update was found but data is not valid.Received ' . $download['meta_value']);\n }\n\n $files = get_post_meta($download['post_id'], 'edd_download_files', true);\n $found = false;\n foreach ($files as $index => $file)\n {\n if (isset($repo_to_update_url[$file['attachment_id']]))\n {\n $found = $index;\n break;\n }\n }\n if ($found === false || empty($repo_to_update_url[$file['attachment_id']]['url']))\n {\n throw new Exception('Unable to find correct download to update <pre>' . print_r($files, true) . \"----\" . print_r($repo_to_update_url, true) . \"</pre>\");\n }\n $file = array_merge($files[$index], scb_edd_merge_repo_input($repo_to_update_url[$file['attachment_id']]['url']));\n\n $file['new_tag'] = scb_edd_clean_tag_input($new_version);\n p_l($file);\n if (version_compare($file['new_tag'], $file['tag_num'], 'lt'))\n {\n p_l(\"lower version pushed skip\");\n throw new Exception('lower version pushed skipping ' . $file['new_tag'] . \"<\" . $file['tag_num']);\n\n return;\n }\n elseif (version_compare($file['new_tag'], $file['tag_num'], 'gt'))\n {\n $file = array_merge($file, scb_edd_merge_repo_input($protocol . '://' . $repo_to_update . '/@' . $file['new_tag']));\n //$file['repo_url'] = 'git://' . $repo_to_update . '/@' . $file['new_tag'];\n //$file['tag'] = $file['new_tag'];\n }\n elseif (version_compare($file['new_tag'], $file['tag_num'], 'eq'))\n {\n $file = array_merge($file, scb_edd_merge_repo_input($protocol . '://' . $repo_to_update . '/@' . $file['new_tag']));\n\n }\n else\n {\n throw new Exception('Unable to get new version');\n }\n p_l($file);\n $file = apply_filters('scb_repo_' . $protocol . '_save_edd_download_files', array($file), $download['post_id']);\n\n $files[$index] = scb_edd_clear_temp_indexes($file[0]);\n p_l($files);\n update_post_meta($download['post_id'], 'edd_download_files', $files);\n $passed[] = sprintf('Download %1$s updated succesfuly from %2$s respositry %3$s tag %4$s ',\n isset($download['post_title']) ? '\"' . $download['post_title'] . '\"' : '',\n $protocol,\n $repo_to_update,\n $new_version);\n\n }\n catch (Exception $e)\n {\n $failed[] = \"Failed to Update download :\" . (isset($download['post_title']) ? '\"' . $download['post_title'] . '\" ' : '') . $e->getMessage();\n }\n }\n\n if (count($passed) && count($failed))\n {\n $msg = \"Successfull:\\n\" . implode(\"\\n\", $passed) . \"\\n\\n\";\n $msg .= \"Failed:\\n\" . implode(\"\\n\", $failed);\n p_l($msg);\n scb_edd_send_email('Download Deploy Result', nl2br($msg));\n return array(1, 'done but few failed');\n }\n elseif (count($failed))\n {\n $msg = implode(\"\\n\", $failed);\n p_l($msg);\n scb_edd_send_email('Download Failed to deploy from repo', nl2br($msg));\n return array(0, 'failed');\n }\n elseif (count($passed))\n {\n $msg = implode(\"\\n\", $passed);\n p_l($msg);\n scb_edd_send_email('Download Deployed from repo succesfuly', nl2br($msg));\n return array(1, 'All done');\n }\n\n }\n catch (Exception $e)\n {\n $msg = \"Failed to Update download :\" . (isset($download['post_title']) ? '\"' . $download['post_title'] . '\" ' : '') . $e->getMessage();\n p_l($msg);\n scb_edd_send_email('Download Failed to deploy from repo', nl2br($msg));\n\n return array(0, $msg);\n }\n\n }", "private function getArrLatestVersion() {\n $arrPackages = $this->getAvailablePackages();\n\n $arrQueries = array();\n foreach($arrPackages as $objOneMetadata) {\n $arrQueries[$objOneMetadata->getStrTitle()] = $objOneMetadata;\n }\n\n $arrResult = array();\n $arrProvider = $this->getContentproviders();\n\n foreach($arrProvider as $objOneProvider) {\n $arrRemoteVersions = $objOneProvider->searchPackage(implode(\",\", array_keys($arrQueries)));\n if(!is_array($arrRemoteVersions))\n continue;\n\n foreach($arrRemoteVersions as $arrOneRemotePackage) {\n $arrResult[$arrOneRemotePackage[\"title\"]] = $arrOneRemotePackage[\"version\"];\n unset($arrQueries[$arrOneRemotePackage[\"title\"]]);\n }\n\n }\n\n return $arrResult;\n }", "public function getPackages(): array\n {\n $http = $this->getHttp();\n\n // Fetch data from\n try {\n $apiResponse = $http->get('https://get.typo3.org/json');\n } catch (ClientException $e) {\n throw new \\RuntimeException(\"Could not fetch releases for TYPO3\");\n }\n\n $branchList = json_decode((string) $apiResponse->getBody(), true);\n $packages = [];\n\n foreach ($branchList as $branch) {\n if (!is_array($branch)) {\n continue;\n }\n\n foreach ($branch[\"releases\"] as $version => $versionData) {\n if (in_array($version, self::IGNORES)) {\n continue;\n }\n\n $packages[$version] = [\n \"url\" => \"https://get.typo3.org\" . $versionData[\"url\"][\"tar\"],\n \"filename\" => $version . \".tgz\"\n ];\n }\n }\n\n return $packages;\n }", "public function getAllVersions(): Collection\n {\n $guzzleClient = new Client(['base_uri' => config('bitbucket.api_base_url')]);\n $response = $guzzleClient\n ->get(\"2.0/repositories/\" . config('bitbucket.vendor') . \"/\" . config('bitbucket.repo') . \"/refs/tags\", [\n 'auth' => [config('bitbucket.username'), config('bitbucket.password')]\n ])->getBody();\n\n return collect(\\GuzzleHttp\\json_decode($response)->values);\n }", "protected function packages(): void\n {\n $rootPackages = json_decode(file_get_contents(__DIR__.'/../../../package.json'), true);\n\n if (file_exists($this->laravel->basePath('package.json'))) {\n $packages = json_decode(file_get_contents($this->laravel->basePath('package.json')), true);\n\n $packages['dependencies'] = array_replace(\n $packages['dependencies'] ?? [], $rootPackages['dependencies']\n );\n\n ksort($packages['dependencies']);\n }\n\n file_put_contents(\n $this->laravel->basePath('package.json'),\n json_encode($packages ?? $rootPackages, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT).PHP_EOL\n );\n\n $this->info('The \"packages.json\" file has been updated.');\n }", "protected static function updateComposer()\n {\n $packages = json_decode(file_get_contents(base_path('composer.json')), true);\n $packages['require'] = static::updateComposerArray($packages['require']);\n ksort($packages['require']);\n\n file_put_contents(\n base_path('composer.json'),\n json_encode($packages, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT).PHP_EOL\n );\n }", "protected static function updatePackagesScripts(): void\n {\n if (! file_exists(base_path('package.json'))) {\n return;\n }\n\n $packages = json_decode(file_get_contents(base_path('package.json')), true);\n\n $packages['scripts'] = static::updatePackagesScriptsArray(\n array_key_exists('scripts', $packages) ? $packages['scripts'] : []\n );\n\n ksort($packages['scripts']);\n\n file_put_contents(\n base_path('package.json'),\n json_encode($packages, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT).PHP_EOL\n );\n }", "function update_repos() {\n\n\t$rc = -1;\n\t$out = NULL;\n\t$product_name = g_get('product_name');\n\n\t$res = exec(\"/usr/local/sbin/{$product_name}-repoc\", $out, $rc);\n\tif ($res === false || $out === NULL) {\n\t\treturn (array( \"error\" => 1,\n\t\t \"messages\" => array(\"We could not connect to Netgate servers. Please try again later.\")));\n\t}\n\t$rtrn = array( \"error\" => $rc, \"messages\" => array() );\n\tif (isset($out) && is_array($out) &&\n\t count($out) > 1 && $out[0] === \"Messages:\") {\n\t\tfor ($i = 1; $i < count($out); $i++) {\n\t\t\t$rtrn['messages'][] = $out[$i];\n\t\t}\n\t}\n\n\treturn ($rtrn);\n}", "public static function info ()\r\n {\r\n try {\r\n $latest = json_decode(@file_get_contents(\"https://cdn.rawgit.com/tetreum/mongolo/master/version.json\"));\r\n if ($latest == null) {\r\n throw new \\Exception(\"failed to fetch\");\r\n }\r\n } catch (\\Exception $e) {\r\n $latest = new \\stdClass();\r\n $latest->version = \"failed to fetch\";\r\n }\r\n\r\n return [\r\n \"current\" => self::CURRENT_VERSION,\r\n \"latest\" => $latest\r\n ];\r\n }", "function pm_update_packages($update_info, $tmpfile) {\n $drupal_root = drush_get_context('DRUSH_DRUPAL_ROOT');\n\n $print = '';\n $status = array();\n foreach($update_info as $project) {\n $print .= $project['title'] . \" [\" . $project['name'] . '-' . $project['candidate_version'] . \"], \";\n $status[$project['status']] = $project['status'];\n }\n // We print the list of the projects that need to be updated.\n if (isset($status[UPDATE_NOT_SECURE])) {\n if (isset($status[UPDATE_NOT_CURRENT])) {\n $title = (dt('Security and code updates will be made to the following projects:'));\n }\n else {\n $title = (dt('Security updates will be made to the following projects:'));\n }\n }\n else {\n $title = (dt('Code updates will be made to the following projects:'));\n }\n $print = \"$title \" . (substr($print, 0, strlen($print)-2));\n drush_print($print);\n file_put_contents($tmpfile, \"\\n\\n$print\\n\\n\", FILE_APPEND);\n\n // Print the release notes for projects to be updated.\n if (drush_get_option('notes', FALSE)) {\n drush_print('Obtaining release notes for above projects...');\n $requests = pm_parse_project_version(array_keys($update_info));\n release_info_print_releasenotes($requests, TRUE, $tmpfile);\n }\n\n // We print some warnings before the user confirms the update.\n drush_print();\n if (drush_get_option('no-backup', FALSE)) {\n drush_print(dt(\"Note: You have selected to not store backups.\"));\n }\n else {\n drush_print(dt(\"Note: A backup of your project will be stored to backups directory if it is not managed by a supported version control system.\"));\n drush_print(dt('Note: If you have made any modifications to any file that belongs to one of these projects, you will have to migrate those modifications after updating.'));\n }\n if(!drush_confirm(dt('Do you really want to continue with the update process?'))) {\n return drush_user_abort();\n }\n\n // Now we start the actual updating.\n foreach($update_info as $project) {\n if (empty($project['path'])) {\n return drush_set_error('DRUSH_PM_UPDATING_NO_PROJECT_PATH', dt('The !project project path is not available, perhaps the !type is enabled but has been deleted from disk.', array('!project' => $project['name'], '!type' => $project['project_type'])));\n }\n drush_log(dt('Starting to update !project code at !dir...', array('!project' => $project['title'], '!dir' => $project['path'])));\n // Define and check the full path to project directory and base (parent) directory.\n $project['full_project_path'] = $drupal_root . '/' . $project['path'];\n if (stripos($project['path'], $project['project_type']) === FALSE || !is_dir($project['full_project_path'])) {\n return drush_set_error('DRUSH_PM_UPDATING_PATH_NOT_FOUND', dt('The !project directory could not be found within the !types directory at !full_project_path, perhaps the project is enabled but has been deleted from disk.', array('!project' => $project['name'], '!type' => $project['project_type'], '!full_project_path' => $project['full_project_path'])));\n }\n if (!$version_control = drush_pm_include_version_control($project['full_project_path'])) {\n return FALSE;\n }\n $project['base_project_path'] = dirname($project['full_project_path']);\n // Check we have a version control system, and it clears its pre-flight.\n if (!$version_control->pre_update($project)) {\n return FALSE;\n }\n\n // Package handlers want the name of the directory in project_dir.\n // It may be different to the project name for pm-download.\n // Perhaps we want here filename($project['full_project_path']).\n $project['project_dir'] = $project['name'];\n\n // Run update on one project.\n if (pm_update_project($project, $version_control) === FALSE) {\n return FALSE;\n }\n pm_update_complete($project, $version_control);\n }\n\n return TRUE;\n}", "public function updateRepositories() {\n $projects = $this->loadProjects();\n if (!$projects)\n return;\n\n $this->m_authors = $this->loadAuthors();\n\n foreach ($projects as $project)\n $this->updateProject($project);\n }", "public function getVersionListByPackagist($user_repo) {\n extract($this->userRepoPairDivide($user_repo, 3));\n $pair_low = strtolower($git_user.'/' . $git_repo);\n $src_url = 'https://packagist.org/p/' . $pair_low . '.json';\n $json_arr = $this->jsonGetHttpsOrCache($src_url, 260, true);\n if(!isset($json_arr['packages'][$pair_low])) {\n if(isset($json_arr['error'])) {\n $err=$json_arr['error'];\n } else {\n $err=['message'=>'Unknown error','code'=>500];\n }\n throw new \\Exception($err['message'],$err['code']);\n }\n $versions_arr=[];\n foreach($json_arr['packages'][$pair_low] as $version=>$dist_arr) {\n $versions_arr[$version]=[\n 'version_normalized'=>$dist_arr['version_normalized'],\n 'time'=>$dist_arr['time'],\n 'dist_url'=>$dist_arr['dist']['url'],\n 'authors'=>$dist_arr['authors'],\n 'require'=>$dist_arr['require'],\n ];\n }\n return $versions_arr;\n }", "function pkg_build_repo_list() {\n\t$repos = pkg_list_repos();\n\t$list = array();\n\n\tforeach ($repos as $repo) {\n\t\t$list[$repo['name']] = $repo['descr'];\n\t}\n\n\treturn($list);\n}", "public function getVersions(): Collection;", "public function latest_version();", "public function getPackagesVersions()\n {\n $components = [\n 'core' => [],\n 'theme' => [],\n 'widget' => [],\n 'module' => [],\n ];\n\n $components['core']['ZEDx'] = Core::VERSION;\n\n foreach (Themes::all() as $theme) {\n $components['theme'][$theme['manifest']['name']] = $theme['manifest']['version'];\n }\n\n foreach (Widgets::noType()->noFilter()->all(null, true) as $namespace => $widget) {\n $components['widget'][$namespace] = $widget->get('version');\n }\n\n foreach (Modules::all() as $module) {\n $components['module'][$module->name] = $module->version;\n }\n\n return $components;\n }", "function pkg_update($force = false) {\n\tglobal $g;\n\n\treturn pkg_call(\"update\" . ($force ? \" -f\" : \"\"));\n}" ]
[ "0.63468957", "0.6128971", "0.5906176", "0.5762853", "0.5762853", "0.5762853", "0.575414", "0.5726493", "0.56422204", "0.55780244", "0.5555245", "0.5490769", "0.54845524", "0.54644066", "0.5426084", "0.5392912", "0.53787833", "0.5378026", "0.5365938", "0.53623855", "0.5354967", "0.5277754", "0.52657694", "0.52528715", "0.5244423", "0.523332", "0.5192437", "0.51521116", "0.5150266", "0.5141027" ]
0.6538907
0
Get Match Now Title
public function getMatchNowTitle() { return $this->getData('match_now_title'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function rep_title_callback($match) {\r\n\t\t\r\n\t\t$query = substr($match[0],3,-3);\t\t\r\n\t\t$title = '<h2>'.$query.'</h2>';\r\n\t\treturn $title;\r\n\t\t\r\n\t}", "private function titleGuess(): string {\n $collaboration = $this->containsCollaboration($this->title);\n return $collaboration;\n }", "private function getTalkTitle()\n {\n $html = getSimpleHTMLDOMCached($this->getInput('url'));\n $title = $html->find('h1[class=thread-title]', 0)->plaintext;\n return $title;\n }", "function get_the_title() {\n\n md_get_the_title();\n \n }", "public function get_title();", "public function get_title() {\n\t\treturn __( 'Team', 'qazana' );\n\t}", "public function current_title()\n\t{\n\t\treturn $this->CLI->stringQuery($this->SqueezePlyrID.\" current_title ?\");\n\t}", "public function getMatch(): string\n {\n return $this->match;\n }", "public function getOriginalTitle() {\n $result = TingOpenformatMethods::parseFields($this->_getDetails(), array('originalTitle' => array('originalTitleHeader' => 'header', \"originalTitleElement\")));\n return (is_array($result)) ? reset($result) : $result;\n }", "public function get_title () {\r\n\t\treturn $this->get_info()['title'];\r\n\t}", "public function getTitleFromDisplayPattern()\n {\n $formattedTitle = $this->getName();\n \n return $formattedTitle;\n }", "function extract_title_from_wiki_text($text)\n{\n if (preg_match(\"/--- DIVISION TITLE ---\\s*(.*)\\s*--- MOTION EFFECT/s\", $text, $matches)) {\n $title = $matches[1];\n }\n $title = trim(strip_tags($title));\n $title = str_replace(\" - \", \" &#8212; \", $title);\n return $title;\n}", "function return_title($source) {\r\n preg_match('@((<title\\s*)([a-zA-Z]+=(\"|\\')?[a-zA-Z0-9_-]*(\"|\\')?\\s*)*\\>)([a-zA-Z0-9()-_\\s.:|&#;]*)(</title>)@',$source, $output);\r\n\treturn html_entity_decode(strip_tags(trim($output[0])));\r\n}", "public function title() {\r\n\t\treturn trim(strtok($this->_content, \"\\n\"));\r\n\t}", "public function getTitle(){\n return $this->film['title'];\n }", "public function title()\n\t{\n\t\treturn $this->CLI->stringQuery($this->SqueezePlyrID.\" title ?\");\n\t}", "private function get_title( $html ) {\n\t\t$pattern = '#<title[^>]*>(.*?)<\\s*/\\s*title>#is';\n\t\tpreg_match( $pattern, $html, $match_title );\n\n\t\tif ( empty( $match_title[1] ) || ! is_string( $match_title[1] ) ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$title = trim( $match_title[1] );\n\n\t\treturn $this->prepare_metadata_for_output( $title );\n\t}", "public function getMovieTitle() {\n\t\treturn ($this->movieTitle);\n\t}", "public function getMetaTitle() {\n\t\t$title = $this->data()->getTitle();\n\t\t$filter = $this->FilterDescription();\n\t\tif($filter) {\n\t\t\t$title = \"{$title} - {$filter}\";\n\t\t}\n\n\t\t$this->extend('updateMetaTitle', $title);\n\t\treturn $title;\n\t}", "public function getMetaTitle();", "function regexgettitle($text, $rule=''){\n\t\t\t\t\t\t\t\t//make sure we call regexnoweirdwhite first on the text\n\t\t\t\t\t\t\t\t//regexnoweirdwhite removes spaces from around the < and > characters\n\t\t\t\t\t\t\t\t//regexnoweirdwhite also makes all runs of white spaces including breaks and nbsps into single spaces\n\t$regex_pattern=\"/<title\\s?[^>]*>(.+?)<\\/\\s?title>/i\";\t//will search for anything between and including the title tags (text insensitive)\n\t\t\t\t\t\t\t\t\t\t\t\t//the period followed by the plus will match any number of any characters\n\t\t\t\t\t\t\t\t\t\t\t\t//placing it within the parentheses will allow us to get just the title without grabbing the tags too\n\t$title=\"\";\n\tif(preg_match($regex_pattern,$text,$match))$title=$match[1];\n\t//get rid of unneeded spaces\n\t$title=regexspacecleaner($title);\n\treturn $title;\t\n}", "public function getTitle() {\n\t\t$titles = array(\n\t\t\t'CEO',\n\t\t\t'Assistant Regional Manager',\n\t\t\t'Champion of Light',\n\t\t\t'Usurper Lord',\n\t\t\t'Overlord Maximus',\n\t\t\t'Shadowpuppet Master',\n\t\t);\n\t\t$index = mt_rand(0, count($titles) - 1);\n\t\treturn $titles[$index];\n\t}", "public function computedTitle();", "public function getMatch();", "function getTitle() ;", "public function getTitleFromDisplayPattern()\n {\n $formattedTitle = ''\n . $this->getEventTitle();\n \n return $formattedTitle;\n }", "public function getTitle(){\n\t\t$title = $this->TitleText;\n\t\tif($title == ''){\n\t\t\t$title = \"New state\";\n\t\t}\n\n\t\t$textObj = new Text('TitleText');\n\t\t$textObj->setValue($title);\n\t\treturn $textObj->LimitWordCount(10);\n\t}", "public function getAlternativeTitle() {\n $result = TingOpenformatMethods::parseFields($this->_getDetails(), array('alternativeTitle' => array('alternativeTitleDescriptor' => 'header', \"alternativeTitle\")));\n return $result;\n }", "public function getTitle(): string\n {\n return $this->title ?? $this->name;\n }", "public function getTitle()\n {\n return round($this->getTimeDiff()*1000, 3).' ms';\n }" ]
[ "0.73566365", "0.7144896", "0.670221", "0.66354424", "0.64411277", "0.64210975", "0.63641554", "0.63528347", "0.62879276", "0.627547", "0.6252517", "0.624463", "0.6240199", "0.6239946", "0.62379575", "0.62182564", "0.62112147", "0.6208389", "0.6202894", "0.6190242", "0.6188978", "0.617557", "0.61703205", "0.6163746", "0.6163128", "0.6154874", "0.61418134", "0.6140591", "0.6137833", "0.61292636" ]
0.85028267
0
Get Match Now Url
public function getMatchNowUrl() { return $this->getData('match_now_url'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCurrentUrlFromRoutes()\n {\n $input = &SGL_Registry::singleton();\n $url = $input->getCurrentUrl();\n $currUrl = $url->toString();\n $baseUrl = $url->getBaseUrl($skipProto = false, $includeFc = false);\n return str_replace($baseUrl, '', $currUrl);\n }", "public function getRegexurl() {\n }", "public function get_url();", "protected function getApiUrl(): string\n {\n return preg_replace($this->regexPattern,$this->currencyDate,$this->apiEndpoint);\n }", "public function getCurrentUrl();", "function get_twitch_url($api) {\n $url = null;\n\n $data = file_get_contents($api);\n $json = json_decode($data, TRUE);\n\n foreach($json['videos'] as $key => $val) {\n $rec_date_arr = getdate(strtotime($val['recorded_at']));\n $rec_date = str_pad($rec_date_arr['mon'], 2, \"0\", STR_PAD_LEFT) . \"/\"\n . str_pad($rec_date_arr['mday'], 2, \"0\", STR_PAD_LEFT) . \"/\"\n . $rec_date_arr['year'];\n\n if ($val['game'] == 'Spelunky' && $rec_date == date('m/d/Y')) {\n $url = $val['url'] . \"\\n\";\n }\n }\n\n return $url;\n }", "protected static function get_new_url()\n {\n return parse_url($_SERVER['REQUEST_URI'])['path'] . '?' . $_SERVER['QUERY_STRING'];\n }", "function formatCurrentUrl() ;", "abstract public function get_url_update();", "static function obtenerUrlActual() {\n $url = Util::crearUrl($_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);\n return $url;\n }", "public static function getBNETHistoryURL($url)\r\n\t{\r\n\t\treturn $url . 'matches';\r\n\t}", "public static function getRequestedURL()\n {\n return self::getInstance()->requestedUrl;\n }", "public function formatCurrentUrl() {}", "public function formatCurrentUrl() {}", "public function formatCurrentUrl() {}", "public function formatCurrentUrl() {}", "public function formatCurrentUrl() {}", "public function formatCurrentUrl() {}", "public function url()\n {\n return explode('?' ,$this->uri)[0];\n }", "public function getShopNowUrl()\n {\n return $this->getData('show_now_url');\n }", "protected function get_url()\n {\n return $this->base_url + $this->api_version; \n }", "public function getUrl()\n {\n return $this->lastUrl;\n }", "function get_trackback_url()\n {\n }", "public static function getThisUrl() {}", "public function getURL();", "public function getURL();", "private function getVideoTutorialsUrl() {\n\t\t\treturn apply_filters('gsf-video-tutorials-url','#');\n\t\t}", "public function getURL ();", "public function url()\n\t{\n\t\tif( $this->modified === false ) return $this->url;\n\t\telse\n\t\t{\n\t\t\t$url = $this->generateString();\n\t\t\treturn htmlentities( $url );\n\t\t}\n\t}", "function GetPrewURI() /*added 16_05*/\n\t\t{\n\t\tif($this->history[count($this->history)-1])\n\t\t\t$ret = $this->history[count($this->history)-1];\n\t\telse\n\t\t\t$ret = $_SERVER['SERVER_NAME'];\n//\t\treturn $this->history[count($this->history)-1]; \n\t\treturn $ret;\n\t\t}" ]
[ "0.6147555", "0.597051", "0.59636706", "0.5956001", "0.59448093", "0.58937925", "0.5831257", "0.5823231", "0.58090425", "0.57796514", "0.577795", "0.577617", "0.5774891", "0.5774891", "0.5774891", "0.5774891", "0.5774891", "0.5774891", "0.57267094", "0.5710036", "0.57099426", "0.5694431", "0.568366", "0.56814736", "0.56595147", "0.56595147", "0.5650583", "0.56427896", "0.56422526", "0.564141" ]
0.8403448
0
Get Shop Now Title
public function getShopNowTitle() { return $this->getData('shop_now_title'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hestia_shop_title_callback() {\n\treturn get_theme_mod( 'hestia_shop_title' );\n}", "public function get_title () {\r\n\t\treturn $this->get_info()['title'];\r\n\t}", "protected function getTitle() {\r\n\t\treturn $this->newsItem->getTitle();\r\n\t}", "public function get_title(): string {\n\t\treturn __( 'Tips to make the most of Web Stories', 'web-stories' );\n\t}", "public function get_title();", "public function get_title() {\n\t\treturn __( 'Gastenboek', 'elementor-gastenboek' );\n\t}", "public function get_title() {\n\t\treturn apply_filters( \"wpo_wcpdf_{$this->slug}_title\", __( 'Packing Slip', 'woocommerce-pdf-invoices-packing-slips' ), $this );\n\t}", "public function get_title() {\n\t\treturn $this->format_string( $this->title );\n\t}", "public function get_title() {\r\n\t\treturn esc_html__( 'Price Plan: 02', 'aapside-master' );\r\n\t}", "public function getTitle(): string\n {\n if (!empty( $this->title )) {\n return $this->title;\n } elseif (!empty( $this->stock )) {\n return $this->stock->title;\n } else {\n return '';\n }\n }", "function get_title()\n {\n }", "public function getTitle() {\n\t\treturn Template::getSiteTitle();\n\t}", "public function getSiteTitle() {\n\t\treturn isset($this->cache->siteTitle) ? $this->cache->siteTitle : 'Crystal-Web System';\n\t}", "public function get_title() {\n\t\treturn __( 'Hello World', 'elementor-hello-world' );\n\t}", "public function get_title() {\n return esc_html__( 'Onsale Product', 'Alita-extensions' );\n }", "public function getProdTitle()\n {\n return $this->prod_title;\n }", "public function getTitle() {\n\t\treturn $this->item->getTitle()->getText();\n\t}", "function get_title() {\n\t\treturn $this->settings['title'];\n\t}", "public function getTitle() {\n\t\treturn $this->title;\t\n\t}", "public function getTitle(): string\n {\n return $this->title ?? $this->name;\n }", "public function getTitle(): string {\n\t\treturn $this->title;\n\t}", "function get_the_title() {\n\n md_get_the_title();\n \n }", "public function get_title()\n\t{\n\t\treturn $this->title;\n\t}", "public function getMetaTitle();", "public function get_title(){\n\t\treturn $this->title;\n\t}", "public function get_title(){\n\t\treturn $this->title;\n\t}", "public function getTitle(): string\n {\n return $this->title;\n }", "public function getTitle(): string\n {\n return $this->title;\n }", "public function getTitle(): string\n {\n return $this->title;\n }", "public function getTitle(): string\n {\n return $this->title;\n }" ]
[ "0.7708132", "0.753332", "0.7376903", "0.7373858", "0.7337966", "0.7273591", "0.716291", "0.7120857", "0.7113418", "0.71119654", "0.70995754", "0.70971644", "0.7095166", "0.7070589", "0.70700467", "0.7057545", "0.70480055", "0.70457923", "0.70331323", "0.70267814", "0.70111924", "0.7010257", "0.70093185", "0.7004421", "0.700031", "0.700031", "0.6994075", "0.6994075", "0.6994075", "0.6994075" ]
0.86199474
0
Get Shop Now Url
public function getShopNowUrl() { return $this->getData('show_now_url'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getShopUri()\n {\n return sprintf(self::SHOP_URI, $this->getShopName());\n }", "function _getHellaspayUrl($method) {\r\n\r\n\t\t$url = $method->hellaspay_production == '1' ? $method->hellaspay_production_url : $method->hellaspay_test_url;\r\n\r\n\t\treturn $url;\r\n\t}", "public function get_renewal_url() {\n\t\t$renewal_url = add_query_arg(\n\t\t\tarray(\n\t\t\t\t'subscription' => $this->get_id(),\n\t\t\t\t'key' => $this->get_key(),\n\t\t\t\t'action' => 'renew',\n\t\t\t), home_url()\n\t\t);\n\n\t\treturn $renewal_url;\n\t}", "public function getMytripUrl() {\n $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance ()->get ( 'Magento\\Store\\Model\\StoreManagerInterface' )->getStore ();\n return $objectManager->getUrl('booking/mytrip/currenttrip/');\n }", "private function getServiceUrl()\n {\n $store = $this->storeRepository->getById($this->storeManager->getStore()->getId());\n return $this->url->getUrl(\n $this->service . \"/\" . $store->getCode() . \"/\" . $this->version\n );\n }", "public function getContinueShoppingURL() {\n\t\treturn BASKET_CONTINUE_SHOPPING_URL;\n\t}", "protected function get_url()\n {\n return $this->base_url + $this->api_version; \n }", "protected function getUrl(){\n\t\treturn $this->apiUrl . $this->apiVersion . '/';\n\t}", "public function siteUrl() {}", "public function getCheckoutUrl()\n {\n return $this->helper('checkout/url')->getCheckoutUrl();\n }", "public function getOneClickUrl()\n {\n $store = Mage::getSingleton('adminhtml/session_quote')->getStore();\n\n return Zend_Json::encode($this->escapeUrl(Mage::getStoreConfig('oyst/oneclick/payment_url', $store->getId())));\n }", "public function getShopUrl($stripHttp = true): string\n {\n /** @var string $shopUrl */\n $shopUrl = $this->router->generate(\n 'frontend.home.page',\n [],\n $this->router::ABSOLUTE_URL\n );\n\n if ($stripHttp === true) {\n $shopUrl = str_ireplace('http://', '', $shopUrl);\n $shopUrl = str_ireplace('https://', '', $shopUrl);\n }\n\n if (substr($shopUrl, -1) === '/') {\n $shopUrl = substr($shopUrl, 0, -1);\n }\n\n return $shopUrl;\n }", "public function getMatchNowUrl()\n {\n return $this->getData('match_now_url');\n }", "public function getURL(): string\n {\n return $this->url.$this->apiVersion.'/';\n }", "public function getCurrentUrl();", "public function getStoreUrl()\r\n\t{\r\n\t\treturn Mage::getBaseUrl();\r\n\t}", "public function getUrl() {\n\t\treturn $this->siteURL;\n\t}", "public function get_url();", "public function getURL() {\n return $this->apiURL . $this->endPoint . $this->storeID . $this->jsonFile;\n }", "function get_checkout_url() {\n\t\t\t$checkout_page_id = get_option('cmdeals_checkout_page_id');\n\t\t\tif ($checkout_page_id) :\n\t\t\t\tif (is_ssl()) return str_replace('http:', 'https:', get_permalink($checkout_page_id));\n\t\t\t\treturn get_permalink($checkout_page_id);\n\t\t\tendif;\n\t\t}", "public function getServiceUrl()\n {\n if($this->testMode) {\n return 'https://www.alipay.com/cooperate/gateway.do';\n }\n\t\treturn 'https://www.alipay.com/cooperate/gateway.do';\n }", "public function getUrl() {\n return $this->_gatewayRedirect->getUrl ();\n }", "public function getUrl()\n\t{\n\t\treturn rtrim(Mage::helper('wordpress')->getUrlWithFront($this->getId()), '/') . '/';\n\t}", "private function getShopUrl($aShop)\n {\n $shop = $aShop;\n if (!strpos($aShop, \"https://\")) {\n $shop = \"https://\" . $aShop;\n }\n return $shop;\n }", "public function getUrl()\n {\n return Mage::getUrl('magna_news', array('news_id' => $this->getId(), '_secure' => true));\n }", "public function getConnectUrl()\n {\n return Mage::helper('adminhtml')->getUrl('adminhtml/shopgate/connect');\n }", "public static function getThisUrl() {}", "public function getWelcomeURL()\n\t{\n\t\t$merchantId = $this->settingsHelper->getMerchantId();\n\t\t$countryId = $this->localizationHelper->getShippingCountry();\n\t\t\n\t\tif($this->settingsHelper->isStagingEnabled())\n\t\t\treturn trim(Mage::getStoreConfig('borderfree_options/settings/welcomematstageurl')) . \"?merchId=$merchantId&countryId=$countryId&setCookie=Y\";\n\t\telse\n\t\t\treturn trim(Mage::getStoreConfig('borderfree_options/settings/welcomematprodurl')) . \"?merchId=$merchantId&countryId=$countryId&setCookie=Y\";\n\t}", "function getCurrentUrl() {\n\t\t$url = isset( $_SERVER['HTTPS'] ) && 'on' === $_SERVER['HTTPS'] ? 'https' : 'http';\n\t\t$url .= '://' . $_SERVER['SERVER_NAME'];\n\t\t$url .= in_array( $_SERVER['SERVER_PORT'], array('80', '443') ) ? '' : ':' . $_SERVER['SERVER_PORT'];\n\t\t$url .= $_SERVER['REQUEST_URI'];\n\t\treturn $url;\n\t}", "public function getUrl() {\n\t\t$url = $this->getBaseUrl().$this->getBasePath().$this->getOperation();\n\t\t$params = http_build_query($this->getUrlParameters());\n\t\tif ($params) {\n\t\t\t$url .= '?'.$params;\n\t\t}\n\t\treturn $url;\n\t}" ]
[ "0.7105449", "0.7083607", "0.6912421", "0.6779383", "0.67741054", "0.6689031", "0.66760945", "0.6673764", "0.65760225", "0.65040964", "0.65006465", "0.64723665", "0.64637905", "0.64625484", "0.64383256", "0.64369553", "0.6436007", "0.6433064", "0.64321524", "0.63954127", "0.63546056", "0.6353899", "0.63498807", "0.63313437", "0.6320763", "0.6314525", "0.6311877", "0.63061345", "0.62938696", "0.62932354" ]
0.851698
0
Remove nonnumeric characters from $cc_no
function clean_no ($cc_no) { return ereg_replace ('[^0-9]+', '', $cc_no); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function cleanCCNumber($cc = '') {\n $cc = preg_replace('/[^0-9]/', '', trim($cc));\n return (string)$cc;\n }", "protected function strip_non_numeric($cardno) {\n return preg_replace('/[^0-9]/', null, $cardno);\n }", "function cardNumberClean($number)\n {\n return preg_replace(\"/[^0-9]/\", \"\", $number);\n }", "protected function cleanCardNumber($number) {\n\t\t$result = preg_replace('/\\D/', '', $number);\n\t\treturn $result;\n\t}", "function clean_number($phone_number){\n\treturn preg_replace(\"/[^0-9]/\", \"\", $phone_number);\n}", "function format_phone_plain($number) {\n return preg_replace('/[^0-9]/', '', $number);\n}", "public function clean($cpf)\n {\n return preg_replace(\"/[^0-9]/\", \"\", $cpf);\n }", "public function cleanSmsSender($number) {\n if ((int)substr($number, 0, 1) === 0) {//Starts with 0\n return '44' . substr($number, 1);\n }//E# if statement\n\n return $number;\n }", "function soNumero($str) {\r\nreturn preg_replace(\"/[^0-9]/\", \"\", $str);\r\n\r\n}", "function get_phone_number( $phone_number ) {\n return str_replace( array( '-', '(', ')', ' ' ), '', $phone_number );\n}", "function clean_phone($phone_number){\n $clean = str_replace(array('+','(',')','-',' '),'',$phone_number);\n return $clean;\n }", "public static function normalize($number) {\n\t\t$number = preg_replace('#[^0-9]#','',''.$number);\n\t\t$norm = array('ccc'=>'');\n\t\tswitch (true) {\n\t\t\t\n\t\t\tcase (strlen($number)==10 && substr($number,0,1)=='0'):\n\t\t\t\t$number = substr($number,1);\n\t\t\tcase (strlen($number)==9 && substr($number,0,1)!=='0'):\t\n\t\t\t\t$norm['ccc'] = '33';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$found = false;\n\t\t\t\t$number = preg_replace('#^[0]+#', '', $number);\n\t\t\t\t$found = false;\n\t\t\t\tfor ($i=4; $i>0; $i--) {\n\t\t\t\t\t$ccc = substr($number,0,$i);\n\t\t\t\t\tif (in_array($ccc,self::$ccc)) {\n\t\t\t\t\t\t$found = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($found) {\n\t\t\t\t\t$norm['ccc'] = $ccc;\n\t\t\t\t\t$number = preg_replace('#^'.$ccc.'0*#','',$number);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthrow new PhoneNumberException($number,1);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t\t$norm['number'] = $number;\n\t\treturn $norm;\n\t}", "function MaskCreditCard($cc){\n\t$cc_length = strlen($cc);\n\t// Replace all characters of credit card except the last four and dashes\n\tfor($i=0; $i<$cc_length-4; $i++){\n\t\tif($cc[$i] == '-'){continue;}\n\t\t$cc[$i] = 'X';\n\t}\n\t// Return the masked Credit Card #\n\treturn $cc;\n}", "protected function clean(string $number): string {\n $number = preg_replace('#[^\\d]#', '', $number);\n return trim($number);\n }", "public function filter($value)\n {\n $value = preg_replace(\"/\\([^)]+\\)/\", \"\", $value);\n $numeric = preg_replace(\"/[^0-9]/\", \"\", $value);\n\n if (strpos($numeric, '00') === 0 && (strlen($numeric) === 12 || strlen($numeric) === 13)) {\n $numeric = ltrim($numeric, '0');\n }\n\n if ((strpos($numeric, '06') === 0 && strlen($numeric) === 10) || (strpos($numeric, '6') && strlen($numeric) === 9)) {\n $numeric = '31' . ltrim($numeric, '0');\n }\n\n return (string)$numeric;\n }", "function fn_validate_cc_number($number, $show_error = false)\n{\n if (empty($number)) {\n return false;\n }\n\n $number = str_replace(array('-',' '), '', $number);\n\n if (preg_match('/^([?0-9]{13,19}|[?*\\d]+)$/', $number)) {\n return true;\n } elseif ($show_error) {\n fn_set_notification('E', __('error'), __('text_not_valid_cc_number', array(\n '[cc_number]' => $number\n )));\n }\n\n return false;\n}", "public function cleanNumber($value) {\n $data = trim($value);\n\n // Removes Unwanted Characters\n $data = filter_var($data, FILTER_SANITIZE_NUMBER_INT);\n\n // Sanitizes HTML Characters\n $data = htmlspecialchars_decode($data, ENT_QUOTES);\n\n return $data;\n }", "function removerMascaraCpf($valor)\n{\n return preg_replace([\"/\\\\D+/\"], [''], $valor);\n}", "public function phoneClean():string\n {\n $phone = '';\n if (!empty($this->phone)) {\n $phone = preg_replace('#[^\\d\\+]#si', '', $this->phone);\n }\n return $phone;\n }", "function remove_dash_ic($nric) {\n $ic = str_replace(\"-\",\"\",$nric);\n return $ic;\n}", "function clean_account($account)\n{\n\t$account = rtrim($account, \"0\");\n\n\treturn $account;\n}", "public static function maskCPF_CNPJ($_input = NULL) {\n\n $number = self::getNumbers($_input);\n $length = strlen($number);\n\n if ($length != 11 && $length != 14) {\n return $_input;\n }\n\n $return = ($length == 11) ? '###.###.###-##' : '##.###.###/####-##';\n $key = -1;\n\n for ($i = 0, $size = strlen($return); $i < $size; $i++) {\n\n if ($return[$i] == '#') {\n $return[$i] = $number[++$key];\n }\n }\n\n return $return;\n }", "function FormatCreditCard($cc)\n{\n\t$cc = str_replace(array('-',' '),'',$cc);\n\t// Get the CC Length\n\t$cc_length = strlen($cc);\n\t// Initialize the new credit card to contian the last four digits\n\t$newCreditCard = substr($cc,-4);\n\t// Walk backwards through the credit card number and add a dash after every fourth digit\n\tfor($i=$cc_length-5;$i>=0;$i--){\n\t\t// If on the fourth character add a dash\n\t\tif((($i+1)-$cc_length)%4 == 0){\n\t\t\t$newCreditCard = '-'.$newCreditCard;\n\t\t}\n\t\t// Add the current character to the new credit card\n\t\t$newCreditCard = $cc[$i].$newCreditCard;\n\t}\n\t// Return the formatted credit card number\n\treturn $newCreditCard;\n}", "function trimPhone($phone){\n\treturn preg_replace('/[^+0-9]/', '', $phone);\n}", "function justNumbers($var)\n{\n return preg_replace('/[^0-9]/', '', $var);\n}", "function clean_postcode ($postcode) {\n\n\t\t$postcode = str_replace(' ','',$postcode);\n\t\t$postcode = strtoupper($postcode);\n\t\t$postcode = trim($postcode);\n\t\t$postcode = preg_replace('/(\\d[A-Z]{2})/', ' $1', $postcode);\n\t\n\t\treturn $postcode;\n\n\t}", "function remove_non_coding_prot($seq) {\r\n // change the sequence to upper case\r\n $seq=strtoupper($seq);\r\n // remove non-coding characters([^ARNDCEQGHILKMFPSTWYVX\\*])\r\n $seq = preg_replace (\"([^ARNDCEQGHILKMFPSTWYVX\\*])\", \"\", $seq);\r\n return $seq;\r\n}", "function clean_iptc_value($value)\n{\n\t// strip leading zeros (weird Kodak Scanner software)\n\twhile ( isset($value[0]) and $value[0] == chr(0)) {\n\t\t$value = substr($value, 1);\n\t}\n\t// remove binary nulls\n\t$value = str_replace(chr(0x00), ' ', $value);\n\n\treturn $value;\n}", "function mask_format($nric) {\n if (is_numeric($nric) == 1) {\n return $nric;\n } else {\n $new_nric = substr_replace($nric, 'XXXXX', 0, 5);\n //$new_nric = substr_replace($nric,'XXXX',5); \n return $new_nric;\n }\n }", "private function cleanPhoneNumber($phone = '') {\n $phone = preg_replace('/[^0-9-]/', '', trim($phone));\n return (string)$phone;\n }" ]
[ "0.8084143", "0.7543891", "0.73490924", "0.70768434", "0.6868711", "0.64037097", "0.63835174", "0.6351201", "0.6348136", "0.6306462", "0.61999434", "0.6092688", "0.6074876", "0.6041102", "0.60364217", "0.59928334", "0.596019", "0.593639", "0.5930621", "0.5922269", "0.5916077", "0.5912353", "0.5908119", "0.58878165", "0.5838883", "0.58239233", "0.58080554", "0.5787867", "0.57871056", "0.5767699" ]
0.87696636
0
Get returned result keys
public static function getReturnedResultKeys() { return [ 'ip', 'ua', 'browser', 'language', 'platform', 'mobile', 'tablet', 'pc', 'page', 'open', 'close', 'location' ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getKeys();", "public function getKeys() {}", "static function getKeys();", "abstract public function getKeys();", "public function getKeys(): array;", "public function getKeys()\n {\n if ($this->_queryResult === null) {\n return [];\n }\n\n return $this->_queryResult->getKeys();\n }", "public function keys(): array;", "public function keys(): array;", "public function keys(): array;", "public static function keys(): array;", "public function getResultsKeys() {\n return ['lines_after_maximum_allowed_lines',\n 'lines_with_non_matching_values',\n 'lines_with_too_many_values',\n 'lines_with_too_few_values',\n 'lines_with_too_many_characters',\n 'lines_with_non_numeric_values',\n 'lines_with_invalid_labeling',\n 'lines_with_non_unique_label'\n ];\n }", "public function getKeys() {\n\t\treturn $this->getAllKeys();\n\t}", "public function getKeys() {\n return array_keys($this->data);\n }", "public function keys() : array;", "public function keys() : array;", "public function getKeys()\n {\n return $this->getNames();\n }", "public function getAllKey();", "public function keys();", "public function keys();", "public function keys();", "public function keys();", "public function keys();", "public function keys();", "public function getKeys(){\n\t\treturn $this->keys;\n\t}", "public function getKeys() {\n\t\treturn array_keys( $this->array );\n\t}", "public function GetAllKeys()\n {\n return array_keys($this->_keyValPairs);\n }", "public function get_keys() {\n try{\n return array_keys($this->Items);\n }catch(Exception $e){\n throw $e;\n }\n }", "public function getRecordKeys()\n\t{\n\t\t$arKeys = [];\n\t\t$arKey = [];\n\t\tif (Param(\"key_m\") !== NULL) {\n\t\t\t$arKeys = Param(\"key_m\");\n\t\t\t$cnt = count($arKeys);\n\t\t} else {\n\t\t\tif (Param(\"id\") !== NULL)\n\t\t\t\t$arKeys[] = Param(\"id\");\n\t\t\telseif (IsApi() && Key(0) !== NULL)\n\t\t\t\t$arKeys[] = Key(0);\n\t\t\telseif (IsApi() && Route(2) !== NULL)\n\t\t\t\t$arKeys[] = Route(2);\n\t\t\telse\n\t\t\t\t$arKeys = NULL; // Do not setup\n\n\t\t\t//return $arKeys; // Do not return yet, so the values will also be checked by the following code\n\t\t}\n\n\t\t// Check keys\n\t\t$ar = [];\n\t\tif (is_array($arKeys)) {\n\t\t\tforeach ($arKeys as $key) {\n\t\t\t\tif (!is_numeric($key))\n\t\t\t\t\tcontinue;\n\t\t\t\t$ar[] = $key;\n\t\t\t}\n\t\t}\n\t\treturn $ar;\n\t}", "public function getRecordKeys()\n\t{\n\t\t$arKeys = [];\n\t\t$arKey = [];\n\t\tif (Param(\"key_m\") !== NULL) {\n\t\t\t$arKeys = Param(\"key_m\");\n\t\t\t$cnt = count($arKeys);\n\t\t} else {\n\t\t\tif (Param(\"IncomeCode\") !== NULL)\n\t\t\t\t$arKeys[] = Param(\"IncomeCode\");\n\t\t\telseif (IsApi() && Key(0) !== NULL)\n\t\t\t\t$arKeys[] = Key(0);\n\t\t\telseif (IsApi() && Route(2) !== NULL)\n\t\t\t\t$arKeys[] = Route(2);\n\t\t\telse\n\t\t\t\t$arKeys = NULL; // Do not setup\n\n\t\t\t//return $arKeys; // Do not return yet, so the values will also be checked by the following code\n\t\t}\n\n\t\t// Check keys\n\t\t$ar = [];\n\t\tif (is_array($arKeys)) {\n\t\t\tforeach ($arKeys as $key) {\n\t\t\t\tif (!is_numeric($key))\n\t\t\t\t\tcontinue;\n\t\t\t\t$ar[] = $key;\n\t\t\t}\n\t\t}\n\t\treturn $ar;\n\t}", "function keys() {\n\t\treturn array_keys($this->_cache);\n\t}" ]
[ "0.77945185", "0.77771175", "0.7681449", "0.76676846", "0.75974745", "0.7347882", "0.729458", "0.729458", "0.729458", "0.7294162", "0.72029704", "0.71652776", "0.7152434", "0.7105446", "0.7105446", "0.7054161", "0.6992623", "0.69894123", "0.69894123", "0.69894123", "0.69894123", "0.69894123", "0.69894123", "0.6970434", "0.6931754", "0.69099915", "0.69030505", "0.6902332", "0.6892809", "0.6887597" ]
0.7790886
1
Returns $dat encoded to UTF8
protected static function utf8Encode($dat) { if (is_string($dat)) { if (mb_check_encoding($dat, 'UTF-8')) { return $dat; } else { return utf8_encode($dat); } } if (is_array($dat)) { $answer = array(); foreach ($dat as $i => $d) { $answer[$i] = self::utf8Encode($d); } return $answer; } return $dat; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function utf8Encode($dat)\n {\n if (is_string($dat)){\n return utf8_encode($dat);\n }\n if (!is_array($dat)){\n return $dat;\n }\n $ret = array();\n foreach ($dat as $i => $d){\n $ret[$i] = $this->utf8Encode($d);\n }\n return $ret;\n }", "function utf8_encode($data)\n{\n}", "private function utf8Encode($data)\n {\n return $data;\n /*\n * if (is_array ( $data )) {\n * foreach ( $data as $key => $value ) {\n * $data [$key] = $this->utf8Encode ( $value );\n * }\n * } else {\n * $data = utf8_encode ( $data );\n * }\n * return $data;\n */\n }", "function win1252_to_utf8($data){\r\n\treturn iconv(\"Windows-1252\", \"UTF-8\", $data);\r\n}", "function html_to_utf8 ($data)\r\n {\r\n return preg_replace(\"/\\\\&\\\\#([0-9]{3,10})\\\\;/e\", '_html_to_utf8(\"\\\\1\")', $data);\r\n }", "public function convertDatabaseToUTF8();", "function convert_data_encodings($known_utf8 = false)\n{\n global $VALID_ENCODING, $CONVERTED_ENCODING;\n $VALID_ENCODING = true;\n\n if ($CONVERTED_ENCODING) {\n return; // Already done it\n }\n\n if (preg_match('#^[\\x00-\\x7F]*$#', serialize($_POST) . serialize($_GET) . serialize($_FILES)) != 0) { // Simple case, all is ASCII\n $CONVERTED_ENCODING = true;\n return;\n }\n\n require_code('character_sets');\n _convert_data_encodings($known_utf8);\n}", "function uni2utf8($uniescape)\n\t{\n\t\t$c = \"\";\n\t\t\n\t\t$n = intval(substr($uniescape, -4), 16);\n\t\tif ($n < 0x7F) {// 0000-007F\n\t\t\t$c .= chr($n);\n\t\t} elseif ($n < 0x800) {// 0080-0800\n\t\t\t$c .= chr(0xC0 | ($n / 64));\n\t\t\t$c .= chr(0x80 | ($n % 64));\n\t\t} else {\t\t\t\t// 0800-FFFF\n\t\t\t$c .= chr(0xE0 | (($n / 64) / 64));\n\t\t\t$c .= chr(0x80 | (($n / 64) % 64));\n\t\t\t$c .= chr(0x80 | ($n % 64));\n\t\t}\n\t\treturn $c;\n\t}", "public static function toDataUS($data){\n\t\t$tmp = explode('/', $data);\n\t\treturn $tmp[2].'-'.$tmp[1].'-'.$tmp[0];\n\t}", "function encodeData($data)\n {\n if (is_array($data)) {\n /*\n * Traitement des tableaux\n */\n foreach ($data as $key => $value) {\n $data[$key] = $this->encodeData($value);\n }\n } else {\n /*\n * Traitement des chaines individuelles\n */\n if ($this->typeDatabase == 'pgsql') {\n if ($this->UTF8 && mb_detect_encoding($data) != \"UTF-8\") {\n $data = mb_convert_encoding($data, 'UTF-8');\n }\n $data = pg_escape_string($data);\n } else {\n $data = addslashes($data);\n }\n }\n return $data;\n }", "protected function utf8Values(&$data)\n {\n foreach ($data as $key => $value)\n {\n // Convert atomic values to UTF-8\n if (!is_array($value))\n {\n $data[$key] = utf8_encode($value);\n }\n\n // Handle nested arrays\n if (is_array($value))\n {\n $this->utf8Values($data[$key]);\n }\n }\n }", "function convert_to_utf8($data, $encoding) {\n if (function_exists('iconv')) {\n $out = @iconv($encoding, 'utf-8', $data);\n }\n else if (function_exists('mb_convert_encoding')) {\n $out = @mb_convert_encoding($data, 'utf-8', $encoding);\n }\n else if (function_exists('recode_string')) {\n $out = @recode_string($encoding .'..utf-8', $data);\n }\n else {\n /* watchdog('php', t(\"Unsupported encoding '%s'. Please install iconv, GNU\nrecode or mbstring for PHP.\", array('%s' => $encoding)), WATCHDOG_ERROR); */\n return FALSE;\n }\n return $out;\n}", "public function convertToUTF8(array|string $data): array|string\n {\n if (is_array($data)) {\n /** @var array|string|null $v */\n foreach ($data as $k => $v) {\n if ($v !== null) {\n $data[$k] = $this->convertToUTF8($v);\n }\n }\n } else {\n $data = Encoding::toUTF8($data);\n }\n return $data;\n }", "function utf8_to_win1252($data){\r\n\treturn iconv(\"UTF-8\", \"Windows-1252\", $data);\r\n}", "abstract public static function encode($data): string;", "public static function encode($data)\n {\n if (is_array($data)) {\n foreach ($data as $key => $value) {\n $data[$key] = self::encode($value);\n }\n } elseif (is_object($data)) {\n foreach ($data as $key => $value) {\n $data->{$key} = self::encode($value);\n }\n } elseif (is_string($data)) {\n if (PHP_VERSION_ID >= 80200) {\n return iconv('windows-1252', 'UTF-8', $data);\n }\n return utf8_encode($data);\n }\n return $data;\n }", "public static function encodeData($data)\n {\n if (preg_match('/[<>&]/', $data)) {\n $data = '<![CDATA[' . $data . ']]>';\n }\n\n $data = preg_replace('/\"/', '\\\"', $data);\n\n return $data;\n }", "public function encode($data);", "public function encode($data);", "public function encode($data);", "public function encode($data) {}", "public function encode($data) {}", "public function encode($data) {}", "public function encode($data) {}", "public function encode($data) {}", "function win2utf($val,$always=false) { #trace();\r\n global $ezer_mysql_cp;\r\n if ( $always || !$ezer_mysql_cp || $ezer_mysql_cp=='cp1250' ) {\r\n $val= strtr($val, \"\\x9E\\x9A\\x9D\\x8E\\x8A\\x8D\", \"\\xBE\\xB9\\xBB\\xAE\\xA9\\xAB\");\r\n $val= mb_convert_encoding($val,'UTF-8','ISO-8859-2');\r\n }\r\n return $val;\r\n}", "public function encode($data) {\n return serialize($data);\n }", "private function uniConvert ()\n\t\t{\n\t\t\t return preg_replace(\"/\\\\\\\\u([a-f0-9]{4})/e\",\n \"iconv('UCS-4LE','UTF-8',pack('V', hexdec('U$1')))\",\n json_encode($this->result));\n\t\t}", "protected final function _encodeUnsynchronisation(&$data)\n {\n $result = \"\";\n for ($i = 0, $j = 0; $i < strlen($data) - 1; $i++)\n if (ord($data[$i]) == 0xff &&\n ((($tmp = ord($data[$i + 1])) & 0xe0) == 0xe0 || $tmp == 0x0)) {\n $result .= substr($data, $j, $i + 1 - $j) . \"\\0\";\n $j = $i + 1;\n }\n return $result . substr($data, $j);\n }", "private static function sample_convert($data) {\n return implode(\"\\x1f\", $data);\n }" ]
[ "0.70902044", "0.6691718", "0.6488349", "0.6484774", "0.63320524", "0.61628664", "0.6086392", "0.60392594", "0.60084146", "0.6004522", "0.5980297", "0.5915582", "0.59041953", "0.5881356", "0.5802224", "0.5793196", "0.575121", "0.573841", "0.573841", "0.573841", "0.5726693", "0.57239455", "0.57239455", "0.57239455", "0.57239455", "0.56644744", "0.56490344", "0.5639338", "0.5603455", "0.5587454" ]
0.7488785
0
Get the books by id
public function book($id) { return $this->get("/books/{$id}"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getBooks($id) {\n }", "public function getBookById($id) {\n\t\t$book = null;\n\n foreach ($this->db-> query(\"SELECT * FROM book WHERE id=$id\") as $row){\n \n $book = new Book($row['title'], $row['author'], $row['description'], $row['id']);\n }\n\n return $book;\n }", "public function getbookById($id)\n {\n return $this->bookDao->getbookById($id);\n }", "public function getBook($id) {\n // the database using eloquent to return the record with matching id in JSON with 200 as the response code.\n \n if (Book::where('id', $id)->exists()) {\n $book = Book::where('id', $id)->get()->toJson(JSON_PRETTY_PRINT);\n return response($book, 200);\n } else {\n return response()->json([\n \"message\" => \"book not found\"\n ], 404);\n }\n }", "public function show($id)\n {\n //\n return book::where('id', '=', $id)->get();\n }", "public function BooksLS($id){\n\t\t$url = 'http://192.168.1.5:8000/query/bookid/' . $id;\n\t\t$page = file_get_contents($url);\n\t\treturn response()->json(json_decode($page));\n\t}", "public function find(int $id)\n {\n return $this->bookRepo->find($id);\n }", "public function getBookById($id) {\n\n $book = Libro::findOrFail($id);\n\n return $book;\n }", "public function getbookbyId($id){\n\n\t\t\t$this->db->select('id,name, price, author, category, language, ISBN, publish_date')\n\t\t\t\t\t->from('tbl_books')\n\t\t\t\t\t->where('id', $id);\n\n\t\t\t$query = $this->db->get();\n\n\t\t\tif($query->num_rows() == 1){\n\t\t\t\treturn $query->row();\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn 0;\t\n\t\t\t}\n\t\t\t\n\t\t}", "public function fetchFindBook($id){\n \tif (!$data = $this->_cache->load('bibliobook' . (int)$id)) {\n $refs = $this->getAdapter();\n $select = $refs->select()\n ->from($this->_name, array('pages_plates','reference','pubID'))\n ->joinLeft('publications','publications.secuid = bibliography.pubID',\n array('publicationtitle' => 'title', 'authors'))\n ->joinLeft('finds','finds.secuid = bibliography.findID', array('id'))\n ->where($this->_name . '.id = ?', $id);\n $data = $refs->fetchAll($select);\n \t$this->_cache->save($data, 'bibliobook' . (int)$id);\n \t}\n return $data;\n }", "public function show($id)\n {\n return $this->book->find($id);\n }", "public function show($id)\n {\n return Book::find($id);\n }", "function get_booksinn($id)\n {\n return $this->db->get_where('booksinn',array('id'=>$id))->row_array();\n }", "function get_book( $id ) {\r\n\t$options = get_option('nowReadingOptions');\r\n\t\r\n\t$id = intval($id);\r\n\t\r\n\t$books = get_books('include=' . $id);\r\n\t\r\n\treturn $books[0];\r\n}", "public function show($id)\n {\n return $this->authorService->findAuthor($id, ['books']);\n }", "public function showbook($id)\n {\n $books = Book::find($id);\n return response(array(\n 'success' => true,\n 'books' =>$books,\n ),200);\n }", "public static function bookDetail($id) {\n\n $detail_book = \"SELECT \"\n . \"c.category_name, \"\n . \"a.book_title, \"\n . \"a.id_book, \"\n . \"b.author_name, \"\n . \"a.book_image, \"\n . \"a.book_subject, \"\n . \"a.book_ISBN, \"\n . \"a.book_price, \"\n . \"a.book_discount \"\n . \"FROM books a \"\n . \"JOIN authors b ON a.id_author=b.id_author \"\n . \"JOIN categories c ON a.id_category=c.id_category \"\n . \"WHERE a.id_book='\" . $id . \"';\";\n\n if ($result = DB::getInstance()->query($detail_book)) {\n if ($result->num_rows > 0) {\n return $result->fetch_array(MYSQLI_ASSOC);\n } else {\n return false;\n }\n } else {\n return false;\n } \n }", "public function publisherBooks($id)\n {\n $publisher = Publisher::where('id', $id)->first();\n\n $books = DB::table('books')\n ->join('categories', 'books.category_id', '=', 'categories.id')\n ->join('authors', 'books.author_id', '=', 'authors.id')\n ->select('books.*', 'categories.name as category', 'authors.name as author')\n ->where('books.publisher_id', $id)\n ->paginate(20);\n\n\n return response()->json(['success' => true, 'publisher' => $publisher, 'books' => $books]);\n }", "public static function getBooksByGenre($id) {\n $query = Book::find()->innerJoin('book_genre', '`book_genre`.`book_id` = `book`.`id`')->innerJoin('genre', '`book_genre`.`genre_id` = `genre`.`id`')->where(['genre_id'=> $id]);\n\n\n // get the total number of articles (but do not fetch the article data yet)\n $count = $query->count();\n\n // create a pagination object with the total count\n $pagination = new Pagination(['totalCount' => $count, 'pageSize' => 2]);\n\n // limit the query using the pagination and retrieve the articles\n $books = $query->offset($pagination->offset)\n ->limit($pagination->limit)\n ->all();\n\n $data['books'] = $books;\n $data['pagination'] = $pagination;\n\n return $data;\n }", "public function show(int $id)\n {\n return new BookResources(Book::with(['user','categories','authors'])->findOrFail($id));\n }", "public function show($id)\n {\n $book = DB::table('books')\n ->join('categories', 'books.category_id', '=', 'categories.id')\n ->select(DB::raw('books.id, books.name, books.author, books.category_id, books.published, books.available, books.user_id'))\n ->where('books.id', $id)\n ->get();\n return response()->json(['status'=>'ok','data'=>$book], 200);\n }", "public function getLivreById($id)\n {\n // En guise de test on passe à cette fonction l'id d'un bouquin qu'on a déjà et si la fonction renvoi rien, c'est qu'elle est bugguée\n $em = $this->getDoctrine()->getManager();\n $livre = $em->getRepository(book::class)->find($id);\n return $livre;\n }", "public function getDataBook($id)\n {\n $books = Book::find($id);\n\n return response()->json($books);\n }", "public function findByBookId($bookId);", "public function get($id)\n {\n return new BookResource(Book::find($id));\n }", "public function getBook ($session, $id) {\n\n // get dummy data if books don't exist\n if (!$session->has('books')) {\n $this->dummyData($session);\n }\n\n return $session->get('books')[$id];\n\n }", "public function getBookId($id)\n {\n return $this->db->get_where($this->table, array('id_book' => $id))->row_array();\n }", "function getById($id)\n\t{\n\t\t$json = @file_get_contents(\"http://api.douban.com/v2/book/\".$id);\n\t\tif($json == null) $json = '{\"msg\":\"book_not_found\",\"code\":6000,\"request\":\"GET \\/v2\\/book\\/'.$id.'\"}';\n\t\t// echo $json;\n\t\t$array = json_decode($json, true);\n\t\treturn $array;\n\t}", "public function getBooks()\n {\n $sql = 'SELECT bookshop_books.id,\n bookshop_books.description,\n bookshop_books.booksName,\n bookshop_books.pubyear,\n bookshop_discounts.id AS discountsId,\n bookshop_discounts.discountsName,\n bookshop_discounts.percent,\n bookshop_books.price,\n bookshop_authors.id AS idAuthors,\n bookshop_authors.authorsName,\n bookshop_genres.id AS idGenres,\n bookshop_genres.genresName\n FROM bookshop_books_to_authors\n INNER JOIN bookshop_books\n ON bookshop_books_to_authors.id_book = bookshop_books.id\n INNER JOIN bookshop_books_to_genres\n ON bookshop_books_to_genres.id_book = bookshop_books.id\n INNER JOIN bookshop_authors\n ON bookshop_books_to_authors.id_author = bookshop_authors.id\n INNER JOIN bookshop_genres\n ON bookshop_books_to_genres.id_genre = bookshop_genres.id\n INNER JOIN bookshop_discounts\n ON bookshop_books.id_discount = bookshop_discounts.id';\n \n $result = $this->db->execute($sql);\n\n if (!$result)\n return $this->error();\n\n return $this->formingBooks($result);\n }", "public function getDataByID($id){\n $query = $this->db->query('select from books where ID');\n }" ]
[ "0.8623019", "0.81779176", "0.8146076", "0.7855995", "0.7847217", "0.7789382", "0.7778965", "0.77668166", "0.7707386", "0.7695172", "0.76458347", "0.7565044", "0.75385535", "0.7455013", "0.7394145", "0.73688716", "0.733261", "0.7307886", "0.73040533", "0.7281313", "0.7171885", "0.7147463", "0.71332455", "0.7120282", "0.7108873", "0.7072395", "0.7053352", "0.70312744", "0.7013689", "0.6985829" ]
0.8379085
1
Get list of VIN Pattern using VIN only.
public function index($vin, VinRepository $vinRepository) { $result = $vinRepository->getVinPatterns($vin); if ($result instanceof ApiException) { return ApiResponse::error( $result->getResponseCode(), $result->getMessage(), $result->getData(), $result->getCode() ); } return ApiResponse::success('Here are your VIN Patterns.', $result); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function findinvirtual($pattern)\n {\n $result = array();\n $virtual = null;\n\n if ($this->file)\n $virtual = file($this->file);\n\n if (empty($virtual))\n return $result;\n\n // check each line for matches\n foreach ($virtual as $line) {\n $line = trim($line);\n if (empty($line) || $line[0]=='#')\n continue;\n\n if (preg_match($pattern, $line))\n $result[] = $line;\n }\n\n return $result;\n }", "public static function vsi() {\n $list = [];\n //dobimo objekt, ki predstavlja povezavo z bazo\n $db = Db::getInstance();\n //izvedemo query\n $result = mysqli_query($db,'SELECT * FROM nabiralnik');\n //v zanki ustvarjamo nove objekte in jih dajemo v seznam\n while($row = mysqli_fetch_assoc($result)){\n $list[] = new Nabiralnik($row['id'], $row['id_uporabnik'], $row['ime']);\n }\n\n //vrnemo list objektov/nabiralnikov\n return $list;\n }", "public function getVipAnnounces() {\n\t\treturn $this->getAnnouncesByToken('active', 'vip', array('strLimit' => '0, ' . CONF_VACANCY_VIP_SHOW_PERPAGE, 'calcRows' => true), array('RAND()' => false));\n\t}", "public function getVids($dir) {\n\n $videos = array();\n\n $scan = scandir($dir);\n\n $hidden = array('..', '.');\n\n $list = array_diff($scan, $hidden);\n\n return $list;\n\n }", "private function Venues()\n\t{\t$venues = array();\n\t\t$where = array();\n\t\t\n\t\tif ($filter = $this->SQLSafe($this->filter))\n\t\t{\t$where[] = '(vname LIKE \"%' . $filter . '%\" OR vcity LIKE \"%' . $filter . '%\" OR vaddress LIKE \"%' . $filter . '%\")';\n\t\t}\n\t\t\n\t\t$sql = 'SELECT * FROM coursevenues';\n\t\tif ($where)\n\t\t{\t$sql .= ' WHERE ' . implode(' AND ', $where);\n\t\t}\n\t\t$sql .= ' ORDER BY vname ASC';\n\t\tif ($result = $this->db->Query($sql))\n\t\t{\twhile ($row = $this->db->FetchArray($result))\n\t\t\t{\t$venues[] = $row;\n\t\t\t}\n\t\t} else echo '<p>', $sql, ': ', $this->db->Error(), '</p>';\n\t\t\n\t\treturn $venues;\t\n\t}", "public function getVICMS()\n {\n return $this->vICMS;\n }", "public function getVICMS()\n {\n return $this->vICMS;\n }", "function drush_cousin_vinny_vin_collect($vin = FALSE) {\n//drush_mymodule_custom_save_node\n // Check for existence of argument\n $arguments = _vin_arguments(); //use custom function to encapsulate\n if (!$vin) {\n $vin = drush_choice($arguments, dt('Which VIN would you like to interact with using \\'Cousin Vinny\\'?'));\n }\n\n // Check for correct argument\n $correct_args = array_keys($arguments);\n if (!in_array($vin, $correct_args)) {\n if ($vin == '0') {\n drush_user_abort('Buh-Bye! VIN Collect!');\n return;\n }\n $string = _vin_arguments('string');\n return drush_set_error(dt('\"@type\" is not a valid example. ',\n array('@type' => $example)) . $string);\n }\n $specification = drush_get_option('spec','common');\n // drush_print($vin);\n // drush_print($specification);\n // return;\n _drush_execute_vin_collect($vin, $specification);\n}", "public function getVuesinterne(): array\n {\n return $this->vuesinterne;\n }", "public function getLinInves() {\n return $this->linInves;\n }", "public function getVilles()\n {\n $arrVillesSelectionnees = [];\n if (count($this->villes) > 0) {\n //dd($this->villes);\n foreach ($this->villes as $ville) {\n array_push($arrVillesSelectionnees, $ville->id);\n }\n\n return json_encode($arrVillesSelectionnees);\n } else {\n return json_encode([]);\n }\n }", "public function getVersesFromSearch($pattern, $version = '', $book = '', $chapter = '') {\n return [];\n }", "public static function asin ($v) {\n\t\treturn asin($v);\n\t}", "public function leerListaInformes($ciu)\n {\n //leemos todos los informes de este usuario\n $this->db->select(\"id, privado, episodio, fecha, nombre_completo_medico, especialidad\");\n $this->db->where(\"CIU_paciente\", $ciu);\n $this->db->order_by(\"fecha\", \"DESC\");\n return $this->db->get(\"vista_resumen_informes\")->result_array();\n }", "public function listar(){\n $rol= $this->db->select('*')->from('versions')->join('plans', 'plans.PLAN_PK = versions.VRSN_FK_plans');\n return $rol->get();\n }", "public function _get_list_voxy_level()\n {\n return Array(\n 1 => 'Super Basic', // super basic\n 2 => 'Basic', // basic\n 3 => 'Pre Inter', // pre inter\n 4 => 'Inter', // inter\n 5 => 'Advan', // advan\n );\n }", "public function getequipesin($in)\n {\n if( is_array($in) )\n return self::whereIn('idequipe',$in)->get();\n else\n return null;\n }", "public function getListeVisiteurs(){\n\t\t$req = \"select * from visiteur order by VIS_MATRICULE\";\n\t\t$rs = PdoGsb::$monPdo->query($req);\n\t\t$ligne = $rs->fetchAll();\n\t\treturn $ligne;\n\t}", "public static function queryListInmuebles()\n {\n $connect = Connect::getINSTANCE();\n $query = \"SELECT * FROM `list_inmuebles`\";\n $resultado = $connect->getConnection()->query($query);\n $inmuebles = array();\n if ($resultado->num_rows > 0) {\n // output data of each row\n while ($row = $resultado->fetch_assoc()) {\n $inmuebles[] = $row;\n }\n return $inmuebles;\n }\n return [];\n }", "public function getVendas()\n {\n return $this->vendas;\n }", "public function getListeSousVisiteurs($reg){\n\t\t$req = \"select distinct REG_CODE,v.VIS_MATRICULE as visiteurmat, v.VIS_NOM as nom from visiteur v, travailler t where t.TRA_ROLE ='visiteur' and REG_CODE='$reg' order by v.VIS_MATRICULE\";\n\t\t$rs = PdoGsb::$monPdo->query($req);\n\t\treturn $rs;\n\t}", "public function vodVideosListing()\n\t\t\t{\n\t\t\t\t$cls\t\t\t=\tnew adminUser();\n\t\t\t\t$cls->unsetSelectionRetention(array($this->getPageName()));\n\t\t\t\t$user\t\t\t\t\t\t=\tnew userManagement();\n\t\t\t\t$tutor\t\t\t=\t $user->getInstructors();\n\t\t\t\t$instmnt\t\t=\t new instrument();\n\t\t\t\t$instrument_list=\t $instmnt->getAllInstruments();\n\t\t\t\t$courses\t\t=\t new userCourse();\n\t\t\t\t$course_list\t=\t$courses->getAllTaughtCourses();\n\t\t\t\t\n\t\t\t\tunset($_SESSION[\"txtCourse\"]);\n\t\t\t\tunset($_SESSION[\"txtInst\"]);\n\t\t\t\tunset($_SESSION['instrument_id']);\n\t\t\t\t\t\t\t\n\t\t\t\tif(!empty($_POST[\"txtInst\"])){\n\t\t\t\t\t$_SESSION[\"txtInst\"]\t=\ttrim($_POST[\"txtInst\"]);\n\t\t\t\t}\n\t\t\t\tif(!empty($_POST[\"txtCourse\"])){\n\t\t\t\t\t$_SESSION[\"txtCourse\"]\t=\ttrim($_POST[\"txtCourse\"]);\n\t\t\t\t}\n\t\t\t\tif(!empty($_POST['instrument_id'])){\n\t\t\t\t$_SESSION[\"instrument_id\"]\t\t=\t$_POST[\"instrument_id\"];\n\t\t\t\t}\t\t\n\t\t\t\t\n\t\t\t\t$txtInst\t\t=\t$_POST[\"txtInst\"];\n\t\t\t\t$txtCourse\t\t=\t$_POST[\"txtCourse\"];\n\t\t\t\t$instrument_id\t=\t$_POST[\"instrument_id\"];\n\t\t\t\n\t\t\t\treturn array(\"tutor\"=>$tutor,\"instrument\"=>$instrument_list,\"course\"=>$course_list,\"txtInst\"=>$txtInst,\"txtCourse\"=>$txtCourse,\"instrument_id\"=>$instrument_id);\n\t\t\t}", "public function parse(string $virin): array\n {\n $matches = [];\n $parsed = preg_match('/' . self::CAPTURE_PATTERN . '/', $virin, $matches);\n\n if (!$parsed) {\n throw new Exception(\"Unable to parse input VIRIN string (is it syntactically valid?)\");\n }\n\n // Shift the first match off the beginning, it's the full string match\n array_shift($matches);\n\n // Set the matched parts for retrieval\n $this->field1 = $matches[0];\n $this->field2 = $matches[1];\n $this->field3 = $matches[2];\n $this->field4 = $matches[3];\n $this->field5 = $matches[4] ?? null;\n\n return $matches;\n }", "function get_votos() {\n\t\t$condicion = array(\n\t\t\t'IdUsuario' => $this->session->userdata('id_usuario'),\n\t\t);\n\t\t\n\t\t$consulta = $this->db->get_where( 'pa_capacitacion_cursos_votos', $condicion ); \n\t\t\n\t\treturn $consulta;\n\t}", "function grab_video_vine($url) {\n $vId = explode('/', $url);\n $vTitle = get_vine_title($url);\n $video = array();\n $video[0]['index'] = 1;\n $video[0]['video_id'] = $vId[4];\n $video[0]['title'] = (string) $vTitle;\n $video[0]['duration'] = 'Unknown';\n $video[0]['video_source'] = 'Vine';\n\n return $video;\n}", "function Varr(&$R,$n,$m=\"\")\n\t\t{\n\t\treturn $this->Zarr($R,\"uint8\",$n,$m);\n\t\t}", "public function getMemberInBoxNotices($to_member_id, $mdb_control)\n\t{\n\t\t$notices_to_member = array();\t\t\n\t\t\n\t\t// essentially gets a list of notice ids sent to this member id\n\t\t$controller = $mdb_control->getController(\"notice_to_member\");\n\t\t$notices_to_member = $controller->getByAttribute(\"to_member_id\", $to_member_id);\n\t\t\n\t\t$num_notices = count($notices_to_member);\n\t\t$notice_list = array();\t\n\t\t$controller = $mdb_control->getController(\"notice_view\");\n\t\t\n\t\t// now get the actual notices for each notice id\n\t\tfor($i = 0; $i < $num_notices; $i++)\n\t\t{\n\t\t\t$notice_id = $notices_to_member[$i]->get_notice_id();\n\t\t\t$notice = array();\n\t\t\t$notice = $controller->getByAttribute(\"notice_id\", $notice_id);\n\t\t\t\n\t\t\tif(count($notice) == 1)\n\t\t\t{\n\t\t\t\t$notice_list[] = $notice[0];\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $notice_list;\n\t}", "private function getListMapVille()\r\n {\r\n $repo = $this->getDoctrine()->getRepository(MapVille::class);\r\n return $repo->findAll();\r\n }", "public function getVotos() {\n return $this->votos;\n }", "public function get_patterns()\n {\n }" ]
[ "0.5229542", "0.5206358", "0.51823413", "0.49076906", "0.4897251", "0.48405182", "0.48405182", "0.48068368", "0.47646004", "0.47254863", "0.47246695", "0.4722298", "0.46968603", "0.4687372", "0.46547836", "0.46456403", "0.46222693", "0.46099022", "0.4602385", "0.45938125", "0.4580839", "0.45648825", "0.45521894", "0.45279568", "0.45258552", "0.4513032", "0.45040494", "0.44938797", "0.4492184", "0.44832796" ]
0.58806443
0
Function returns node string ready for insertion into database. If parameters are null or '', returns empty string (possibly delimited)
function new_node_str($flag = '', $parent_pos = null, $keys = null, $values_pos = null, $children_pos = null) { $empty_str = str_repeat(Database::$empty_char, $this->pos_len); $flag_str = $flag ? $flag : str_repeat(Database::$empty_char, $this->n_format['flag']['length']); $parent_pos_str = $parent_pos ? str_pad($parent_pos, $this->pos_len, Database::$empty_char, STR_PAD_LEFT) : $empty_str; $keys_str = $this->get_property_pos_str($keys, $this->t * 2 - 1); $values_pos_str = $this->get_property_pos_str($values_pos, $this->t * 2 - 1); $children_pos_str = $this->get_property_pos_str($children_pos, $this->t * 2); if ($this->is_delimited) { $d = $this->delimiter; return $flag_str . $d . $parent_pos_str . $d . $keys_str . $d . $values_pos_str . $d . $children_pos_str . "\n"; } else { return $flag_str . $parent_pos_str . $keys_str . $values_pos_str . $children_pos_str . "\n"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function to_str() {\n $smt=\"INSERT \\n\"\n //\n //Get the root of the sql \n . \"INTO {$this->root->fromexp()}\\n\"\n //The values\n . \"{$this->str_values()}\\n\"\n //\n //The joins if any because some insert may have sqls as their root\n .\"{$this->joins->to_str()}\" \n \n \n ;\n //\n //Return the sql statement that inserts \n return $smt;\n }", "public function insert() : string\n {\n if (empty($this->newProperties)) {\n $this->fillProperties();\n }\n\n $params = [];\n $columns = [];\n\n foreach ($this->newProperties as $key => $value) {\n if ($key === 'id') {\n continue;\n }\n\n $params[\":{$key}\"] = $value;\n $columns[] = \"`{$key}`\";\n }\n\n $columns = implode(', ', $columns);\n $placeholders = implode(', ', array_keys($params));\n $tableName = static::getTableName();\n\n $sql = sprintf(\n \"INSERT INTO `%s` (%s) VALUES (%s)\",\n $tableName,\n $columns,\n $placeholders\n );\n\n $stmt = static::getConn()->prepare($sql);\n $stmt->execute($params);\n\n $info = $stmt->errorInfo();\n if ($info[0] !== \\PDO::ERR_NONE) {\n die('We have : ' . $info[2]);\n }\n\n return static::getLastInsertId();\n }", "public function build($statement, ...$params) : PlainNode\n\t{\n\t\tif (!($statement instanceof Node)) {\n\t\t\tif (strpos($statement, '{') !== false) {\n\t\t\t\t$statement = $this->prepare($statement);\n\t\t\t} else {\n\t\t\t\t$statement = new PlainNode($statement);\n\t\t\t}\n\t\t}\n\t\treturn $this->formatter->format($statement, $params, [$this->link, 'real_escape_string']);\n\t}", "private function newNode($params=null) \n {\n $id=$this->storage->newId();\n $node=new DataNode($this,$id,$this->untypedNode);\n if (is_array($params)) {\n foreach ($params as $k=>$v) {\n $node->set($k,$v);\n }\n }\n return $node;\n }", "public function createString($entity)\n {\n if (is_string($entity)) {\n return $entity;\n }\n\n if ($entity instanceof Node) {\n $string = $this->getPrettyPrinter()->prettyPrint([$entity]);\n\n if (!($entity instanceof Use_)) {\n // Single nodes don't get trailling ;s\n if (substr($string, -1) === ';') {\n $string = substr($string, 0, -1);\n }\n } else {\n $string .= PHP_EOL;\n }\n\n return $string;\n }\n\n if (is_array($entity)) {\n // Sets of node haves a trailing newline\n $string = $this->getPrettyPrinter()->prettyPrint($entity);\n $string .= \"\\n\";\n return $string;\n }\n\n throw new \\InvalidArgumentException('createString must be passed a string, Node, or array of Nodes');\n }", "private function getNodeToStringConverter(): callable\n {\n return function (...$nodes) {\n $value = '';\n foreach ($nodes as $node) {\n if (is_scalar($node)) {\n $value .= $node;\n } else {\n $value .= $node->getValue();\n }\n }\n\n return $value;\n };\n }", "function insertparen($inparms){ \n if ($this->selectedNode >= 0) {\n if ($inparms['ptype'] == 'open') {\n $this->_query->insert(new queryElement('(', 'p'), $this->selectedNode);\n if ($this->selectedOperator > $this->selectedNode) {\n $this->selectedOperator++;\n }\n $this->selectedNode++;\n } else {\n $this->_query->insert(new queryElement(')', 'p'), $this->selectedNode+1);\n if ($this->selectedOperator > $this->selectedNode) {\n $this->selectedOperator++;\n } \n }\n }\n\n return $this->output(NULL);\n }", "private function getInsertString($data, $table) {\n $attr = '';\n $values = '';\n\n foreach ($data as $key => $val) {\n if ($val instanceof \\DateTime) {\n $val = $val->format('Y-m-d H:i:s');\n }\n if ($attr == '' && $values == '') {\n $attr .= $key;\n $values .= \"'\" . trim(addslashes(htmlspecialchars($val))) . \"'\";\n } else {\n $attr .= \", \" . $key;\n $values .= \", '\" . trim(addslashes(htmlspecialchars($val))) . \"'\";\n }\n }\n return \"INSERT INTO \" . $table . \" (\" . $attr . \") VALUES (\" . $values . \");\";\n }", "function encodeNode($data, $as) {\n $result = \"<$as>\";\n\n if(is_foreachable($data)) {\n $has_numeric = false;\n foreach($data as $k => $v) {\n if(is_numeric($k)) {\n $has_numeric = true;\n break;\n } // if\n } // if\n\n $singular = null;\n if($has_numeric) {\n $singular = Inflector::singularize($as);\n } // if\n\n foreach($data as $k => $v) {\n if(is_numeric($k)) {\n $k = $singular;\n } // if\n $result .= $this->encodeNode($v, $k);\n } // if\n } else {\n if(is_int($data) || is_float($data)) {\n $result .= $data;\n } elseif(is_array($data)) {\n $result .= '';\n } elseif(instance_of($data, 'DateValue')) {\n $result .= $data->toMySQL();\n } elseif(is_null($data)) {\n $result .= '';\n } elseif(is_bool($data)) {\n $result .= $data ? '1' : '0';\n } else {\n $result .= '<![CDATA[' . $data . \"]]>\";\n } // if\n } // if\n\n return $result . \"</$as>\\n\";\n }", "function addNode($nodename, $nodeaddress) {\n\t$query = sprintf(\"INSERT INTO Nodes VALUES('%s','%s')\",\n\t\tmysql_real_escape_string($nodename),\n\t\tmysql_real_escape_string($nodeaddress)\n\t);\n\t\n\tdb_query($query);\n}", "function addNode($inparms){\n if ($this->_query->sizeof()) {\n $this->_query->append(new queryElement($_SESSION['global_currentOperator'], 'o'));\n }\n $this->_query->append(new queryNode($inparms['title'],$inparms['id']));\n\n return $this->output(NULL);\n }", "public static function createInsertUrl($getParams = null): ?string;", "function prepare_insert($data = []){\n // if there is no data to set, then return an empty string\n if($data == []){\n return '';\n }\n $set_sql = $this->create_set($data);\n // check again to make sure there were proper columns listed in the SET\n if(strlen($set_sql) == 0){\n return '';\n }\n $return_string = \"INSERT INTO {$this->table_name} $set_sql;\";\n return $return_string;\n }", "function addSlhs($elm){return \"'\".$elm.\"'\";}", "public function getInsert(): string;", "public static function sqlInsert($params)\n\t{\t\n\t\tif(!$params) return \"\";\n\t $table = $params[\"table\"];\n\t\tunset($params[\"table\"]);\n\t\t$columns = array_keys($params);\n\t\t$columns = implode(\", \", $columns);\n\n\t \tforeach($params as $key => $param)\n\t\t\t$values[] = \"?\";\n\t\t$values = implode(\",\", $values);\n\t return \"INSERT INTO $table ($columns) VALUES ($values)\";\n\t}", "function sduconnect_nodelist_to_string($node_list) {\n if ($node_list->length) {\n return trim($node_list->item(0)->nodeValue);\n }\n return '';\n}", "public function get()\n {\n $values = (array) $this->parts['values'];\n\n $keys = ' (' . implode(', ', array_keys($values)) . ')';\n\n $values = ' VALUES (' . implode(', ', $values) . ')';\n\n return 'INSERT INTO ' . $this->table() . $keys . $values;\n }", "public function get_insert()\n {\n $pairs = !empty($this->multiset) ? $this->multiset: array($this->set);\n\n $vals = array();\n $keys = null;\n foreach ($pairs as $row)\n {\n $keys = array_keys($row);\n $vals[] = join(', ', self::prepare($row));\n }\n $keys = join(', ', $keys);\n $vals = join('), (', $vals);\n $table = self::quote_name($this->table);\n return \"insert into $table ($keys) values ($vals)\";\n }", "public function prepare_insertNewEmail($params)\n\t{\n\t\t$xml_string = \"p_Token=\".$params['p_Token'].\"&p_UserID=\".$params['p_UserID'].\"&p_SenderName=\".$params['p_SenderName'].\"&p_SenderEmail=\".$params['p_SenderEmail'].\"&p_RecipientName=\".$params['p_RecipientName'].\"&p_RecipientEmail=\".$params['p_RecipientEmail'].\"&p_Subject=\".$params['p_Subject'].\"&p_Body=\".$params['p_Body'].\"&p_BookingID=\".$params['p_BookingID'].\"\";\n\t\treturn $xml_string;\n\t}", "public function insertValues() \r\n { \r\n $str = \"''\" . \",\"; \r\n $str .= \"'\". self::getFolderName() . \"', \"; \r\n $str .= \"'\". self::getFullPath() . \"', \";\r\n $str .= \"'\". self::getStatus() . \"', \";\r\n $str .= self::getStatusCode() . \", \"; \r\n $str .= \"now()\"; \r\n \r\n return $str;\r\n }", "public function __toString()\n {\n if (empty($this->data)) {\n return \"INSERT INTO `{$this->entity->name}` (`id`) VALUES (NULL)\";\n }\n\n $fields = array_keys($this->data);\n\n $query = \"INSERT INTO `{$this->entity->name}`\";\n $query .= ' (`'.implode('`, `', $fields).'`)';\n $query .= ' VALUES (:'.implode(', :', $fields).')';\n\n if ($this->duplications) {\n $query .= ' ON DUPLICATE KEY UPDATE';\n $query .= ' id = LAST_INSERT_ID(id), '.static::buildFields($fields);\n }\n\n return $query;\n }", "public function node($input) {\n if(is_string($input)) {\n return $this->name($input);\n }\n return $input;\n }", "function insertData($strInput)//Use In inserting or updating data into database\n{\n\t$strInput = addslashes(unconvertHTML($strInput));\n\treturn $strInput;\n}", "function tosql_string($string,$addslashes = false,$quotes){\n\tif (empty($string) && (!isset($string) || $string!='0')){\n\t\t$string = \"NULL\";\n\t}else{\n\t\t$string = trim(addslashes($string));\n\t\tif ($quotes){\n\t\t\tif ($addslashes){\n\t\t\t\t$string = \"\\\\'\".$string.\"\\\\'\";\n\t\t\t}else{\n\t\t\t\t$string = \"'\".$string.\"'\";\n\t\t\t}\n\t\t}\n\t}\n\treturn $string;\n}", "private function create_insert_sql($param) {\n $ques = array();\n foreach ($param as $key => $value) {\n $ques[] = '?';\n }\n\n return implode(', ', $ques);\n }", "protected function doInsert() {\n return '';\n }", "function buildInsert($params)\n {\n $fieldList = $this->getFieldList($params['table']);\n $fieldInsert = '';\n $valueInsert = '';\n\n reset($fieldList);\n while(current($fieldList))\n {\n if (in_array(current($fieldList), array_keys($params)))\n {\n $fieldInsert .= \"`\" . current($fieldList) . \"`, \";\n $valueInsert .= \"'\" . $params[current($fieldList)] . \"', \";\n }\n else\n {\n $this->setError(\"\", \"buildInsert #001\");\n return false;\n }\n $fieldInfo = next($fieldList);\n }\n\n $fieldInsert = preg_replace(\"/,\\s*$/\", \"\", $fieldInsert);\n $valueInsert = preg_replace(\"/,\\s*$/\", \"\", $valueInsert);\n\n $result = \"INSERT INTO `\"\n . $params[\"table\"]\n . \"` (\" . $fieldInsert . \") VALUES (\" . $valueInsert . \");\";\n return $result;\n }", "function delimited_to_xml($params, $reduce_null = FALSE)\n\t{\n\t\tif ( ! is_array($params))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t$defaults = array (\n\t\t\t\t\t\t\t'data'\t\t\t=>\tNULL,\n\t\t\t\t\t\t\t'structure'\t\t=>\tarray(),\n\t\t\t\t\t\t\t'root'\t\t\t=>\t'root',\n\t\t\t\t\t\t\t'element'\t\t=>\t'element',\n\t\t\t\t\t\t\t'delimiter'\t\t=>\t\"\\t\",\n\t\t\t\t\t\t\t'enclosure'\t\t=>\t''\n\t\t\t\t\t\t\t);\n\n\t\tforeach ($defaults as $key => $val)\n\t\t{\n\t\t\tif ( ! isset($params[$key]))\n\t\t\t{\n\t\t\t\t$params[$key] = $val;\n\t\t\t}\n\t\t}\n\n\t\textract($params);\n\n\t\t/*\n\t\t $data \t\t- string containing delimited data\n\t\t $structure \t- array providing a key for $data elements\n\t\t $root\t\t\t- the root XML document tag name\n\t\t $element\t\t- the tag name for the element used to enclose the tag data\n\t\t $delimiter\t- the character delimiting the text, default is \\t (tab)\n\t\t $enclosure\t- character used to enclose the data, such as \" in the case of $data = '\"item\", \"item2\", \"item3\"';\n\t\t*/\n\n\t\tif ($data === NULL OR ! is_array($structure) OR count($structure) == 0)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t/** -------------------------------------\n\t\t/** Convert delimited text to array\n\t\t/** -------------------------------------*/\n\t\t$data_arr \t= array();\n\t\t$data\t\t= str_replace(array(\"\\r\\n\", \"\\r\"), \"\\n\", $data);\n\t\t$lines\t\t= explode(\"\\n\", $data);\n\n\t\tif (empty($lines))\n\t\t{\n\t\t\t$this->errors[] = \"No data to work with\";\n\t\t\treturn FALSE;\n\t\t}\n\n\t\tif ($enclosure == '')\n\t\t{\n\t\t\tforeach ($lines as $key => $val)\n\t\t\t{\n\t\t\t\tif ( ! empty($val))\n\t\t\t\t\t$data_arr[$key] = explode($delimiter, $val);\n\t\t\t}\n\t\t}\n\t\telse // values are enclosed by a character, e.g.: \"value\",\"value2\",\"value3\"\n\t\t{\n\t\t\tforeach ($lines as $key => $val)\n\t\t\t{\n\t\t\t\tif ( ! empty($val))\n\t\t\t\t{\n\t\t\t\t\tpreg_match_all(\"/\".preg_quote($enclosure).\"(.*?)\".preg_quote($enclosure).\"/si\", $val, $matches);\n\t\t\t\t\t$data_arr[$key] = $matches[1];\n\n\t\t\t\t\tif (empty($data_arr[$key]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->errors[] = 'Structure mismatch, skipping line: '.$val;\n\t\t\t\t\t\tunset($data_arr[$key]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Construct the XML\n\n\t\t$xml = \"<{$root}>\\n\";\n\n\t\tforeach ($data_arr as $datum)\n\t\t{\n\t\t\tif ( ! empty($datum) AND count($datum) == count($structure))\n\t\t\t{\n\n\t\t\t\t$xml .= \"\\t<{$element}>\\n\";\n\n\t\t\t\tforeach ($datum as $key => $val)\n\t\t\t\t{\n\t\t\t\t\tif ($reduce_null == TRUE && $structure[$key] == '')\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$xml .= \"\\t\\t<{$structure[$key]}>\".xml_convert($val).\"</{$structure[$key]}>\\n\";\n\t\t\t\t}\n\n\t\t\t\t$xml .= \"\\t</{$element}>\\n\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$details = '';\n\n\t\t\t\tforeach ($datum as $val)\n\t\t\t\t{\n\t\t\t\t\t$details .= \"{$val}, \";\n\t\t\t\t}\n\n\t\t\t\t$this->errors[] = 'Line does not match structure: '.substr($details, 0, -2);\n\t\t\t}\n\t\t}\n\n\t\t$xml .= \"</{$root}>\\n\";\n\n\t\tif ( ! stristr($xml, \"<{$element}>\"))\n\t\t{\n\t\t\t$this->errors[] = \"No valid elements to build XML\";\n\t\t\treturn FALSE;\n\t\t}\n\n\t\treturn $xml;\n\t}", "public function createCommaDelimitedValueForInsert() {\n $retVal = \"\";\n $retVal .= \"$this->btxid\";\n $retVal .= \",'$this->coin'\";\n $retVal .= \",'$this->market'\";\n $retVal .= \",\". $this->quantity .\"\";\n $retVal .= \",\". $this->value . \"\";\n $retVal .= \",\". $this->usdValue .\"\";\n $retVal .= \",\". $this->total .\"\";\n $retVal .= \",\". $this->fillytype .\"\";\n $retVal .= \",\". $this->ordertype .\"\";\n $retVal .= \",\". $this->btxtimestamp .\"\";\n\n return $retVal;\n }" ]
[ "0.5991256", "0.5452782", "0.5351307", "0.52994555", "0.5198407", "0.5192369", "0.5127906", "0.51028", "0.5093311", "0.5076967", "0.50089824", "0.50012976", "0.5000416", "0.4995035", "0.49949732", "0.49794808", "0.49641508", "0.4957233", "0.49563095", "0.49465948", "0.49387634", "0.49285275", "0.49269184", "0.4907615", "0.48981914", "0.489513", "0.4886344", "0.48425597", "0.48405764", "0.48339856" ]
0.6110811
0
Function builds BNode from string given. If get_values = true, fills node data with key=>values
function get_node($str, $pos, $get_data) { $start = 0; $len = $this->n_format['flag']['length'] + $this->d_len; $flag = $this->get_substr($str, $start, $len); $parent_pos = $this->get_pos_value($this->get_substr($str, $start, $this->pos_len + $this->d_len)); $keys = $this->get_property_arr('keys', $str); $children_pos = $this->get_property_arr('children_pos', $str); $values_pos = $this->get_property_arr('values_pos', $str); return new BNode($pos, $keys, $parent_pos, $children_pos, $values_pos); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function build($value, $key)\n {\n $key = str_replace(\"_\", \" \", $key);\n\n if ($value) {\n if (in_array($key, [\"code\", \"name\", \"native\"])) {\n $key = \"Language \" . $key;\n } else {\n $key = ucfirst($key);\n }\n $this->allData[$key] = $value;\n }\n }", "function new_node_str($flag = '', $parent_pos = null, $keys = null, $values_pos = null, $children_pos = null)\n {\n $empty_str = str_repeat(Database::$empty_char, $this->pos_len);\n\n $flag_str = $flag ? $flag : str_repeat(Database::$empty_char, $this->n_format['flag']['length']);\n\n $parent_pos_str = $parent_pos ? str_pad($parent_pos, $this->pos_len, Database::$empty_char, STR_PAD_LEFT)\n : $empty_str;\n\n $keys_str = $this->get_property_pos_str($keys, $this->t * 2 - 1);\n $values_pos_str = $this->get_property_pos_str($values_pos, $this->t * 2 - 1);\n $children_pos_str = $this->get_property_pos_str($children_pos, $this->t * 2);\n\n if ($this->is_delimited) {\n $d = $this->delimiter;\n return $flag_str . $d . $parent_pos_str . $d . $keys_str . $d . $values_pos_str . $d . $children_pos_str . \"\\n\";\n } else {\n return $flag_str . $parent_pos_str . $keys_str . $values_pos_str . $children_pos_str . \"\\n\";\n }\n }", "protected function parse()\n {\n if($this->isRelationalKey()){\n $this->parsedValue = $this->makeRelationInstruction();\n } \n else {\n $this->parsedValue = $this->parseFlatValue($this->value);\n } \n }", "function makeNodeObject($NodeHash, $eachNodeName, $NewNodesHash){\n$selConVal1=$NodeHash[$eachNodeName];\n$group1=substr($selConVal1, strlen($selConVal1)-2, 1);\n$ConStr1=substr($selConVal1, 0, strlen($selConVal1)-3);\n$conAry1=explode(\"'\", $ConStr1);\n$conLen1=count($conAry1);\n$conElementsAry1=array();\nfor($i=0; $i<$conLen1; $i++){\n\tif($i%2 != 0){\n\t\tarray_push($conElementsAry1, $conAry1[$i]);\n\t}\n}\n\n$TempAry=array(\"name\"=> $eachNodeName, \"group\"=> intval($group1), \"cc\"=>$conElementsAry1, \"index1\"=>$NewNodesHash[$eachNodeName]);\nreturn json_encode($TempAry);\n}", "public function test_build_a_leaf_instance_with_mixed_values() {\n\t\t\t$confValName = \"value\";\n\t\t\t$confVal = \"testString\";\n\t\t\t$instanceName = \"leafStub\";\n\t\t\t$value = \"aae\\\\\\\\std\\\\\\\\LeafStub\";\n\t\t\t$json = \"{\\\"$confValName\\\": \\\"$confVal\\\",\\\"$instanceName\\\": {\\\"class\\\": \\\"$value\\\",\\\"args\\\": [{\\\"dep\\\": \\\"$confValName\\\"},5]}}\";\n\t\t\t$obj = new DIFactory(json_decode($json, true));\n\t\t\n\t\t\t# When build is called\n\t\t\t$instance = $obj->build($instanceName);\n\t\t\t$result = $instance->val1;\n\t\t\t\n\t\t\t# Then an instance with all dependencies\n\t\t\t# declared in the configuration object is created\n\t\t\t$this->assertEquals($confVal, $result);\n\t\t\t$this->assertEquals($instance->val2, 5);\n\t\t}", "protected function parseToNode($node_id, $node_name, $id, $key, $value)\n\t{\n\t\t$query = \"//*[@c.\" . $node_name . \"][@id='\" . $node_id . \"']//*[@c.\" . $key . \"]\";\n\t\t$results = $this->xpath->query($query);\n\n\t\tif ($results->length > 0) {\n\t\t\t$child_node = $results->item(0);\n\t\t\t$child_node->setAttribute('rel', $id);\n\t\t\t$child_node->setAttribute('id', 'c.' . $key . $id);\n\n\t\t\tif (is_array($value)) {\n\t\t\t\tforeach ($value as $key2 => $value2) {\n\t\t\t\t\tif ($key2 === 0) {\n\t\t\t\t\t\t$child_node->nodeValue = $value2;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$child_node->setAttribute($key2, $value2);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->setElementContent($child_node, $value);\n\t\t\t}\n\t\t\t$child_node->removeAttribute('c.' . $key);\n\t\t}\n\t}", "private static function convert($node_name, $arr=array()) \n { \n //print_arr($node_name);\n $xml = self::getXMLRoot();\n $node = $xml->createElement($node_name);\n \n if(is_array($arr)){\n // get the attributes first.;\n if(isset($arr['@attributes'])) {\n foreach($arr['@attributes'] as $key => $value) {\n if(!self::isValidTagName($key)) {\n throw new Exception('[Array2XML] Illegal character in attribute name. attribute: '.$key.' in node: '.$node_name);\n }\n $node->setAttribute($key, self::bool2str($value));\n }\n unset($arr['@attributes']); //remove the key from the array once done.\n }\n \n // check if it has a value stored in @value, if yes store the value and return\n // else check if its directly stored as string\n if(isset($arr['@value'])) {\n $node->appendChild($xml->createTextNode(self::bool2str($arr['@value'])));\n unset($arr['@value']); //remove the key from the array once done.\n //return from recursion, as a note with value cannot have child nodes.\n return $node;\n } else if(isset($arr['@cdata'])) {\n $node->appendChild($xml->createCDATASection(self::bool2str($arr['@cdata'])));\n unset($arr['@cdata']); //remove the key from the array once done.\n //return from recursion, as a note with cdata cannot have child nodes.\n return $node;\n }\n }\n \n //create subnodes using recursion\n if(is_array($arr)){\n // recurse to get the node for that key\n foreach($arr as $key=>$value){\n if(!self::isValidTagName($key)) {\n throw new Exception('[Array2XML] Illegal character in tag name. tag: '.$key.' in node: '.$node_name);\n }\n if(is_array($value) && is_numeric(key($value))) {\n // MORE THAN ONE NODE OF ITS KIND;\n // if the new array is numeric index, means it is array of nodes of the same kind\n // it should follow the parent key name\n foreach($value as $k=>$v){\n $node->appendChild(self::convert($key, $v));\n }\n } else {\n // ONLY ONE NODE OF ITS KIND\n $node->appendChild(self::convert($key, $value));\n }\n unset($arr[$key]); //remove the key from the array once done.\n }\n }\n \n // after we are done with all the keys in the array (if it is one)\n // we check if it has any text value, if yes, append it.\n if(!is_array($arr)) {\n $node->appendChild($xml->createTextNode(self::bool2str($arr)));\n }\n \n return $node;\n }", "function d2d_value_decode($string) {\n $array = preg_split('/\\$/', $string, 2);\n if (sizeof($array) != 2) {\n return array(FALSE, '');\n }\n switch ($array[0]) {\n case 'n': return array(TRUE, NULL);\n case 'b': return array(TRUE, $array[1] ? TRUE : FALSE);\n case 's': return array(TRUE, $array[1]);\n }\n return array(FALSE, '');\n}", "public function test_build_a_leaf_instance_with_configuration_value() {\n\t\t\t$confValName = \"value\";\n\t\t\t$confVal = \"testString\";\n\t\t\t$instanceName = \"leafStub\";\n\t\t\t$value = \"aae\\\\\\\\std\\\\\\\\LeafStub\";\n\t\t\t$json = \"{\\\"$confValName\\\": \\\"$confVal\\\",\\\"$instanceName\\\": {\\\"class\\\": \\\"$value\\\",\\\"args\\\": [{\\\"dep\\\": \\\"$confValName\\\"}]}}\";\n\t\t\t$obj = new DIFactory(json_decode($json, true));\n\t\t\n\t\t\t# When build is called\n\t\t\t$instance = $obj->build($instanceName);\n\t\t\t$result = $instance->val1;\n\t\t\t\n\t\t\t# Then an instance with all dependencies\n\t\t\t# declared in the configuration object is created\n\t\t\t$this->assertEquals($confVal, $result);\n\t\t}", "private function makeStructure3($key, $value, $elements) {\r\n if ($value != '')\r\n $elements->appendChild($this->createElementEscape($key, $value));\r\n return $elements;\r\n }", "public function newBNode($types = array())\n {\n return $this->resource($this->newBNodeId(), $types);\n }", "abstract public function parse($value);", "abstract public static function parse($value);", "public function parse(string $value);", "public function Create ( )\r\n\t {\r\n\t\t$default\t= '' ;\r\n\t\t\r\n\t\tif ( $this -> StringSize < 16384 )\t\t// Not really the maximum size of a VARCHAR, but we have to fix a limit\r\n\t\t {\r\n\t\t\t$value_type\t= \"VARCHAR( {$this -> StringSize} )\" ;\r\n\t\t\t$default\t= \"DEFAULT ''\" ;\r\n\t\t }\r\n\t\telse if ( $this -> StringSize < 65536 )\r\n\t\t\t$value_type\t= \"TEXT\" ;\r\n\t\telse if ( $this -> StringSize < 16 * 1024 * 1024 )\r\n\t\t\t$value_type\t= \"MEDIUMTEXT\" ;\r\n\t\telse\r\n\t\t\t$value_type\t= \"LONGTEXT\" ;\r\n\t\t\r\n\t\tif ( $this -> StringIndexSize )\r\n\t\t\t$value_index\t= \"KEY\t\t( value( {$this -> StringIndexSize} ) ),\" ;\r\n\t\telse\r\n\t\t\t$value_index\t= '' ;\r\n\t\t\r\n\t\t$sql\t= <<<END\r\nCREATE TABLE IF NOT EXISTS {$this -> Name}\r\n (\r\n\tid\t\tBIGINT UNSIGNED\t\tNOT NULL AUTO_INCREMENT\r\n\t\t\t\t\t\tCOMMENT 'Unique id for this string entry',\r\n\ttype\t\tINT\t\t\tNOT NULL DEFAULT 0\r\n\t\t\t\t\t\tCOMMENT 'Value type ; can be used to differentiate between value groups',\r\n\tchecksum\tINT UNSIGNED\t\tNOT NULL DEFAULT 0\r\n\t\t\t\t\t\tCOMMENT 'CRC32 hash of the string value',\r\n\t\r\n\tvalue\t\t$value_type \t\tNOT NULL $default\r\n\t\t\t\t\t\tCOMMENT 'String value',\r\n\t\t\t\t\t\t\r\n\tPRIMARY KEY\t( id ),\r\n\t$value_index\r\n\tKEY\t\t( type, checksum )\r\n ) ENGINE = MyISAM CHARSET latin1 COMMENT '{$this -> Comment}' ;\r\nEND;\r\n\t\t\r\n\t\tmysqli_query ( $this -> Database, $sql ) ;\r\n\t }", "private function newNode($params=null) \n {\n $id=$this->storage->newId();\n $node=new DataNode($this,$id,$this->untypedNode);\n if (is_array($params)) {\n foreach ($params as $k=>$v) {\n $node->set($k,$v);\n }\n }\n return $node;\n }", "function parseBISArray($str) {\n $str = substr($str, 1, -1); // Strip trailing quotes\n $bla = parseBISArray_helper($str);\n $result = array();\n\n foreach ($bla as $row) {\n foreach ($row as $child) {\n $result[] = $child;\n }\n if (count($row) == 0)\n $result[] = array();\n }\n //var_dump($result);\n return $result;\n}", "private function createFeatureValue($BkpFeatureId, $value){\r\n\r\n $ObjectValue = BkpFeatureValue::getValueByFeature($BkpFeatureId, $value['valuekey']);\r\n\r\n if (!Validate::isLoadedObject($ObjectValue)) {\r\n\r\n $ObjectValue->id_bkp_feature = $BkpFeatureId;\r\n $ObjectValue->value_key = $value['valuekey'];\r\n $ObjectValue->value_desc = $value['valuedesc'];\r\n $ObjectValue->save();\r\n }\r\n\r\n return $ObjectValue;\r\n }", "public function create($string)\n {\n $setInfo = $this->parse($string);\n $setObj = null;\n $fabricList = [\n new StringSpecial(),\n new StringNumeric(),\n new StringText(),\n new StringDatetime(),\n new StringEn(),\n new StringRu()\n ];\n\n while (!$setObj && $fabricList) {\n $fabric = array_shift($fabricList);\n $setObj = $fabric->create($setInfo);\n }\n\n if ($setObj && $setInfo->getParams()) {\n $setObj->init($setInfo->getParams());\n }\n\n return $setObj ?: new \\RandData\\Set\\NullValue();\n }", "function set($keystr, $value)\n{\n\t$key = explode('/',$keystr);\n\tif (count($key) == 3) $block = array_shift($key);\n\t$id = $key[0];\n\t$attr = $key[1];\n\t$sattr = false;\n\tif (strpos($id,'=')) list($sattr,$svalue) = explode('=', $id);\n\n\tif (!$sattr and $id != '*') {\n\t\t$this->elements[$id][$attr] = $value;\n\t\treturn;\n\t}\n\n\tforeach($this->elements as $id => $tmp) {\n\t\tif ($block and !$this->isInBlock($id,$block)) continue;\n\t\tif ($sattr and $this->elements[$id][$sattr] != $svalue) continue;\n\t\t$this->elements[$id][$attr] = $value;\n\t}\n}", "function create($value)\n {\n return new Value($value);\n }", "public abstract function makeValue($value);", "static function dn2n($data,$set=array()){\n if(!is_array($data)) return($data);\n $def = array('def'=>'label','childs'=>'childs');\n $set = ops_array::setdefault($set,$def);\n $stack = array();\n $keys = array_keys($data);\n $res = array();\n while(count($data)>0 or count($stack)>0){\n if(count($data)==0){\n\tlist($ckey,$tres,$data,$keys)= array_pop($stack);\n\t$tres[$ckey] = $res;\n\t$res = $tres;\n } else {\n\t$ckey = array_shift($keys);\n\t$cdat = array_shift($data);\n\n\tif(isset($cdat[$set['childs']]) and is_array($cdat[$set['childs']])){\n\t $stack[] = array($ckey,$res,$data,$keys);\n\t $data = $cdat[$set['childs']];\n\t $keys = array_keys($data);\n\t $res = array();\n\t} else $res[$ckey] = $cdat[$set['def']];\n }\n }\n return($res);\n \n }", "protected function _parseNestedValues($values)\n {\n foreach ($values as $key => $value) {\n if ($value === '1') {\n $value = true;\n }\n if ($value === '') {\n $value = false;\n }\n\n if (strpos($key, '.') !== false) {\n $values = Set::insert($values, $key, $value);\n //$this->_parseNestedValues($values);\n } else {\n $values[$key] = $value;\n }\n }\n return $values;\n }", "abstract protected function getNode(array $values, $line);", "public function buildByText($text);", "function AbbcInit()\r\n{\r\n\tglobal $ABBC;\r\n\r\n\t// Special Character that need to be masked for use in reg-exps\r\n\t// the '/' at the end is the default delimiting character!\r\n\t// nothing should be placed before the '\\' replacing or its '\\' will be doubled!\r\n\t$ABBC['sc'] = array('\\\\', '^', '$', '.', '[', ']', '|', '(', ')', '?', '*', '+', '{', '}', '/');\r\n\t$ABBC['sc2'] = array();\r\n\tforeach ($ABBC['sc'] as $c) $ABBC['sc2'][] = '\\\\' . $c;\r\n\r\n\t$ABBC['scan'] = array();\r\n\r\n\t// prepare tag configuration\r\n\t$ABBC['MaxTagLength'] = 0;\r\n\tforeach ($ABBC['Tags'] as $key => $value)\r\n\t{\r\n\t\t$ABBC['Tags'][$key]['level'] = 0;\r\n\t\t$ABBC['Tags'][$key]['start'] = array();\r\n\r\n\t\t// get the longest tag and stop looking for a '=' or ']' after $max_taglen characters\r\n\t\t// add 1 for the ending tag's preceeding '/'\r\n\t\tif (strlen($key) + 1 > $ABBC['MaxTagLength']) $ABBC['MaxTagLength'] = strlen($key) + 1;\r\n\t}\r\n\r\n\t// prepare smileys\r\n\t$ABBC['SmilieStarts'] = '';\r\n\t$ABBC['SmilieCount'] = sizeof($ABBC['Smilies']);\r\n\tfor ($n = 0; $n < $ABBC['SmilieCount']; $n++)\r\n\t{\r\n\t\t// get the first character of this smiley and store it, it it isn't already there\r\n\t\t$start = $ABBC['Smilies'][$n]['code']{0};\r\n\t\tif (strpos($ABBC['SmilieStarts'], $start) === false) $ABBC['SmilieStarts'] .= $start;\r\n\r\n\t\t$ABBC['Smilies'][$n]['code_len'] = strlen($ABBC['Smilies'][$n]['code']);\r\n\r\n\t\tif ($ABBC['Smilies'][$n]['code_len'] > $ABBC['MaxSmilieLength']) $ABBC['MaxSmilieLength'] = $ABBC['Smilies'][$n]['code_len'];\r\n\t}\r\n\r\n\t// Set initial nice quotes\r\n\t// You can change them after including this file\r\n\t$ABBC['Config']['use_nicequotes'] = true;\r\n\t$ABBC['Config']['nicequote_ls'] = '&lsquo;';\r\n\t$ABBC['Config']['nicequote_rs'] = '&rsquo;';\r\n\t$ABBC['Config']['nicequote_ld'] = '&ldquo;';\r\n\t$ABBC['Config']['nicequote_rd'] = '&rdquo;';\r\n\r\n\t$ABBC['HighlightWords'] = null;\r\n}", "private function _toType($value) {\n\t//--\n\tif($value === '') {\n\t\treturn null;\n\t} //end if\n\t//--\n\t$first_character = $value[0];\n\t$last_character = substr($value, -1, 1);\n\t//--\n\t$is_quoted = false;\n\tdo {\n\t\tif(!$value) {\n\t\t\tbreak;\n\t\t} //end if\n\t\tif($first_character != '\"' && $first_character != \"'\") {\n\t\t\tbreak;\n\t\t} //end if\n\t\tif($last_character != '\"' && $last_character != \"'\") {\n\t\t\tbreak;\n\t\t} //end if\n\t\t$is_quoted = true;\n\t} while (0);\n\t//--\n\tif($is_quoted) {\n\t\treturn strtr(substr($value, 1, -1), array ('\\\\\"' => '\"', '\\'\\'' => '\\'', '\\\\\\'' => '\\''));\n\t} //end if\n\t//--\n\tif(strpos($value, ' #') !== false && !$is_quoted) {\n\t\t$value = preg_replace('/\\s+#(.+)$/','',$value);\n\t} //end if\n\t//--\n\tif(!$is_quoted) {\n\t\t$value = str_replace('\\n', \"\\n\", $value);\n\t} //end if\n\t//--\n\tif($first_character == '[' && $last_character == ']') {\n\t\t// Take out strings sequences and mappings\n\t\t$innerValue = trim(substr($value, 1, -1));\n\t\tif($innerValue === '') {\n\t\t\treturn array();\n\t\t} //end if\n\t\t$explode = $this->_inlineEscape($innerValue);\n\t\t// Propagate value array\n\t\t$value = array();\n\t\tforeach($explode as $z => $v) {\n\t\t\t$value[] = $this->_toType($v);\n\t\t} //end foreach\n\t\treturn $value;\n\t} //end if\n\t//--\n\tif(strpos($value, ': ') !== false && $first_character != '{') {\n\t\t$array = explode(': ', $value);\n\t\t$key = trim($array[0]);\n\t\tarray_shift($array);\n\t\t$value = trim(implode(': ', $array));\n\t\t$value = $this->_toType($value);\n\t\treturn array($key => $value);\n\t} //end if\n\t//--\n\tif($first_character == '{' && $last_character == '}') {\n\t\t$innerValue = trim(substr($value, 1, -1));\n\t\tif($innerValue === '') {\n\t\t\treturn array();\n\t\t} //end if\n\t\t// Inline Mapping\n\t\t// Take out strings sequences and mappings\n\t\t$explode = $this->_inlineEscape($innerValue);\n\t\t// Propagate value array\n\t\t$array = array();\n\t\tforeach($explode as $z => $v) {\n\t\t\t$SubArr = $this->_toType($v);\n\t\t\tif(empty($SubArr)) {\n\t\t\t\tcontinue;\n\t\t\t} //end if\n\t\t\tif(is_array ($SubArr)) {\n\t\t\t\t$array[key($SubArr)] = $SubArr[key($SubArr)]; continue;\n\t\t\t} //end if\n\t\t\t$array[] = $SubArr;\n\t\t} //end foreach\n\t\treturn $array;\n\t} //end if\n\t//--\n\tif((string)$value == '') {\n\t\treturn '';\n\t} //end if\n\t//--\n\tif(strtolower($value) == 'null' || $value == '~') {\n\t\treturn null;\n\t} //end if\n\t//--\n\tif(is_numeric($value) && preg_match('/^(-|)[1-9]+[0-9]*$/', $value)){\n\t\t$intvalue = (int)$value;\n\t\tif($intvalue != PHP_INT_MAX) {\n\t\t\t$value = $intvalue;\n\t\t} //end if\n\t\treturn $value;\n\t} //end if\n\t//--\n\t/* this was added in v.0.5.1 but is unsafe !!\n\tif(is_numeric($value) && preg_match('/^0[xX][0-9a-fA-F]+$/', $value)) {\n\t\t// Hexadecimal value.\n\t\treturn hexdec($value);\n\t} //end if\n\t*/\n\t//--\n\tif(in_array(strtolower($value), array('true', 'on', '+', 'yes', 'y'))) {\n\t\treturn true;\n\t} //end if\n\t//--\n\tif(in_array(strtolower($value), array('false', 'off', '-', 'no', 'n'))) {\n\t\treturn false;\n\t} //end if\n\t//--\n\tif(is_numeric($value)) {\n\t\tif((string)$value == '0') {\n\t\t\treturn 0;\n\t\t} //end if\n\t\tif(rtrim($value, 0) === $value) {\n\t\t\t$value = (float)$value;\n\t\t} //end if\n\t\treturn $value;\n\t} //end if\n\t//--\n\treturn $value;\n\t//-- $k\n}", "public function testConvertStringtoObjects(): void\n {\n $tests = [\n [\n 'input' => '',\n 'expected' => [],\n ],\n [\n 'input' => 'gate',\n 'expected' => ['gate'],\n ],\n [\n 'input' => 'gate;cost index',\n 'expected' => [\n 'gate',\n 'cost index',\n ],\n ],\n [\n 'input' => 'gate=B32;cost index=100',\n 'expected' => [\n 'gate' => 'B32',\n 'cost index' => '100',\n ],\n ],\n [\n 'input' => 'Y?price=200&cost=100; F?price=1200',\n 'expected' => [\n 'Y' => [\n 'price' => 200,\n 'cost' => 100,\n ],\n 'F' => [\n 'price' => 1200,\n ],\n ],\n ],\n [\n 'input' => 'Y?price&cost; F?price=1200',\n 'expected' => [\n 'Y' => [\n 'price',\n 'cost',\n ],\n 'F' => [\n 'price' => 1200,\n ],\n ],\n ],\n [\n 'input' => 'Y; F?price=1200',\n 'expected' => [\n 0 => 'Y',\n 'F' => [\n 'price' => 1200,\n ],\n ],\n ],\n [\n 'input' => 'Y?;F?price=1200',\n 'expected' => [\n 'Y' => [],\n 'F' => [\n 'price' => 1200,\n ],\n ],\n ],\n [\n 'input' => 'Departure Gate=4;Arrival Gate=C61',\n 'expected' => [\n 'Departure Gate' => '4',\n 'Arrival Gate' => 'C61',\n ],\n ],\n // Blank values omitted\n [\n 'input' => 'gate; ',\n 'expected' => [\n 'gate',\n ],\n ],\n ];\n\n foreach ($tests as $test) {\n $parsed = $this->importBaseClass->parseMultiColumnValues($test['input']);\n $this->assertEquals($test['expected'], $parsed);\n }\n }", "public function test_build_retrieve_a_configuraion_value() {\n\t\t\t$instanceName = \"value\";\n\t\t\t$value = \"testString\";\n\t\t\t$json = \"{\\\"$instanceName\\\": \\\"$value\\\"}\";\n\t\t\t$obj = new DIFactory(json_decode($json, true));\n\t\t\n\t\t\t# When build is called\n\t\t\t$result = $obj->build($instanceName);\n\t\t\t\n\t\t\t# Then an instance with all dependencies\n\t\t\t# declared in the configuration object is created\n\t\t\t$expected = $value;\n\t\t\t$this->assertEquals($expected, $result);\n\t\t}" ]
[ "0.4749919", "0.4705231", "0.46302524", "0.4597355", "0.44590124", "0.44415614", "0.4433053", "0.44121525", "0.43920425", "0.43707222", "0.43684363", "0.43556684", "0.43428394", "0.43185925", "0.4316652", "0.4286249", "0.42704257", "0.42618603", "0.4235861", "0.4225837", "0.4196809", "0.41862956", "0.41856828", "0.4173555", "0.41673216", "0.41608003", "0.41526598", "0.41402555", "0.41181272", "0.41060162" ]
0.6251009
0
Function replaces $name property on position $pos with $new value in string $str
function edit_property(&$str, $new_value, $pos, $name = 'keys') { $prop_str = $this->get_pos_str($new_value); $start = $this->get_start_pos($name) + $pos * ($this->pos_len + $this->d_len); $str = substr($str, 0, $start) . $prop_str . substr($str, $start + strlen($prop_str)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _replaceVariable($str, $pos, $var, $repl)\n {\n $expr = substr($str, $pos, strpos($str, ')', $pos + 1) - $pos + 1);\n $eqsign = strpos($expr, '=');\n if (false !== $eqsign)\n {\n $name = substr($expr, $eqsign + 1, strlen($expr) - $eqsign - 2);\n }\n return substr_replace($str, \"(?P<$name>$repl)\", $pos, strlen($expr));\n }", "function __replace_special_name($leters = array(),$name = \"\", $idx = 0){\n\t\t\n\t\tif(count($leters) > $idx){\n\t\t\t$name = str_replace($leters[$idx][0], $leters[$idx][1], $name);\n\t\t\treturn $this->__replace_special_name($leters,$name,++$idx);\n\t\t}else{\n\t\t\treturn $name;\n\t\t\t\n\t\t}\t\n\t\t\n\t}", "function str_replace_from_offset($search, $replace, $subject, $count = -1, $offset = 0) {\r\n\t\t$substr = substr($subject, $offset);\r\n\t\t$substr = str_replace($search, $replace, $substr, $count);\r\n\t\t$subject = substr($subject, 0, $offset) . $substr;\r\n\t\treturn $subject;\r\n\t}", "private function update_name($new_name) { \n\n\t\tif ($this->_update_item('name',$new_name,'50')) { \n\t\t\t$this->name = $new_name;\n\t\t}\n\n\t}", "public function setName ($name){\n\t\tif($name){\n\t\t\t$this->Item['name'] = substr($name, 0,100);\n\t\t}\n\t}", "function transform_name( $name = '', $type = '' ) {\n $word = array( ' ' => $type, '&' => '' );\n $new = strtr( $name, $word );\n $new = strtolower( $new );\n\n return $new;\n}", "function transform_name( $name = '', $type = '' ) {\n\t$word = array( ' ' => $type, '&' => '' );\n\t$new = strtr( $name, $word );\n $new = strtolower( $new );\n return $new;\n}", "public function updateName($s, $write = true)\n {\n $this->Name = $s;\n if (isset(self::$charges[$s])) {\n $this->CalculatedTotal = self::$charges[$s];\n }\n if ($write) {\n $this->write();\n }\n }", "function setName($existingNames)\n\t{\n\t\t$str = str_word_count(strtolower($this->getLabel()),1);\n\t\t$name = $str[0];\n\t\t$i=0;\n\t\twhile(in_array($name,$existingNames))\n\t\t{\n\t\t\t$i++;\n\t\t\tif(isset($str[$i]))\n\t\t\t{\n\t\t\t\t$name = $name.'_'.$str[$i];\n\t\t\t} \n\t\t\telse\n\t\t\t{ \t\n\t\t\t\t$j=2;\n\t\t\t\twhile(in_array($name.'_'.$j,$existingNames))\n\t\t\t\t{\n\t\t\t\t\t$j++;\n\t\t\t\t}\n\t\t\t\t$name = $name.'_'.$j;\n\t\t\t}\n\t\t}\n\t\t$this->_position = count($existingNames) + 1; \n\t\t$this->_name = $name;\n\t\treturn $this->_name;\n\t}", "public function setName(string $name)\n\t{\n\t\t$this->name=$name; \n\t\t$this->keyModified['name'] = 1; \n\n\t}", "function setName($newName){\n $this->name = \"Glittery \" . $newName;\n }", "function newName($name)\n{\nreturn ' My name is' .$name;\n}", "function name2field($name) {\n return str_replace(\n array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'), array('_a', '_b', '_c', '_d', '_e', '_f', '_g', '_h', '_i', '_j', '_k', '_l', '_m', '_n', '_o', '_p', '_q', '_r', '_s', '_t', '_u', '_v', '_w', '_x', '_y', '_z'), lcfirst($name)\n );\n}", "function replace_credential($credentials, $credName, $newValue)\n\t{\n\t\t$newCredentials = '';\n\t\t$tempCredString = explode(\"'$credName'\", $credentials);\n\t\t$newCredentials = $tempCredString[0] . \"'$credName', '$newValue');\";\n\t\t$tempCredString = explode(\";\", $tempCredString[1]);\n\t\tunset($tempCredString[0]);\n\t\t$tempCredString = implode(';', $tempCredString);\n\t\t$newCredentials = $newCredentials . $tempCredString;\n\t\treturn $newCredentials;\n\t}", "function our_str_replace($find, &$replacements, $subject)\n\n{\n\n $l = strlen($find);\n\n // allocate some memory\n\n $new_subject = str_repeat(' ', strlen($subject));\n\n $new_subject = '';\n\n foreach($replacements as $r)\n\n {\n\n if(($pos = strpos($subject, $find)) === false) break;\n\n $new_subject .= substr($subject, 0, $pos).$r;\n\n $subject = substr($subject, $pos+$l);\n\n // the above appears to be the fastest method\n\n //$subject = substr_replace($subject, $r, $pos, $l);\n\n //$subject = substr($subject, 0, $pos).$r.substr($subject, $pos+strlen($find));\n\n }\n\n $new_subject .= $subject;\n\n return $new_subject;\n\n}", "function old_replace_credential($credentials, $credName, $newValue)\n\t{\n\t\t$newCredentials = '';\n\t\t$tempCredString = explode(\"'$credName', '\", $credentials);\n\t\t$newCredentials = $tempCredString[0] . \"'$credName', '\";\n\t\t$tempCredString = explode(\"'\", $tempCredString[1]);\n\t\t$tempCredString[0] = $newValue;\n\t\t$tempCredString = implode(\"'\", $tempCredString);\n\t\t$newCredentials = $newCredentials . $tempCredString;\n\t\treturn $newCredentials;\n\t}", "public function formatName($name);", "public function setName($NewName){\n\t\t// public function __construct($NewName)\n\n\t\t$nameVar = $this->name = $NewName;\n\t\treturn $nameVar;\n\t\t\n\t}", "public function setReplacementId($name, $replacement);", "public function replace($key,$value,$string){\n\t\treturn str_replace(\"::$key::\",$value,$string);\n\t}", "public function set_name($new_name) {\r\n\t\t$this->name = strtoupper($new_name);\r\n\t}", "public function setName($newName) {\n\t\t$newName = filter_var($newName, FILTER_SANITIZE_STRING);\n\n\t\t//Exception if input is only non-sanitized string data\n\t\tif($newName === false) {\n\t\t\tthrow (new InvalidArgumentException(\"name is not a valid string\"));\n\t\t}\n\n\t\t//Exception if input will not fit in the database\n\t\tif(strlen($newName) > 128) {\n\t\t\tthrow (new RangeException(\"name is too large\"));\n\t\t}\n\n\t\t//If input is a valid string, save the value\n\t\t$this->name = $newName;\n\t}", "public function setterIze($offset)\n {\n return 'set' . str_replace(' ', '', ucwords(strtr($offset, '_-', ' ')));\n }", "function replace($p, $str){\n $p2 = __t($p)->map(function($x) use($str){return $str;});\n return $p2();\n }", "public function setName($x) { $this->name = $x; }", "function replace($str){\n\t$temp = preg_replace('#([^a-z0-9]+)#i',' ',$str);\n\t$tab = explode(' ',$temp);\n\t$val = null;\n\tfor($i=0; $i<count($tab);$i++){\n\t\tif($i != 0){\n\t\t\t$val .= ucfirst($tab[$i]);\n\t\t}\n\t\telse{\n\t\t\t$val .= $tab[$i];\n\t\t}\n\t}\n\treturn $val;\n}", "public function assign($name, $value)\n {\n $this->_data = str_replace(\"%\" . $name . \"%\", $value, $this->_data);\n return $this;\n }", "public function setName($name, $value)\t{\n\n\t\t\t$this->{$name} = $value;\n\t\t\t\t\n\t\t\t//if (ctype_alnum($name) == true)\n\t\t\t\n\t\t\t//(die('The name of the store should only contain letters');\n\t\t\t\n\t\t\t//$this->name = $name;\n\t\t}", "public function setName($string)\r\n {\r\n $this->_name = $string;\r\n }", "function tpl_modifier_replace($string, $search, $replace)\r\n{\r\n\treturn str_replace($search, $replace, $string);\r\n}" ]
[ "0.59950745", "0.5923943", "0.58378243", "0.5704068", "0.5572111", "0.54351354", "0.5431104", "0.5281488", "0.52504885", "0.5223439", "0.52060515", "0.5193551", "0.5186991", "0.5161758", "0.5124974", "0.5110818", "0.5088579", "0.5080547", "0.50745887", "0.5071972", "0.50369227", "0.5015791", "0.4984487", "0.4979421", "0.49678826", "0.49648333", "0.49637112", "0.49634874", "0.4957389", "0.494571" ]
0.7856642
0
Register and load the widget
function wpb_load_widget() { register_widget( 'dmv_widget' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wpb_load_widget() {\n register_widget( 'lrq_widget' );\n }", "public static function register() {\n\t register_widget( __CLASS__ );\n\t}", "public function register_widget() {\n register_widget( 'WPP_Widget' );\n }", "function abc_load_widget()\n{\n register_widget('awesome_bmi_widget');\n}", "public static function a_widget_init() {\n\t\t\treturn register_widget(__CLASS__);\n\t\t}", "static function register_widget() {\n\t\t\t$classname = get_called_class();\n\t\t\tregister_widget( $classname );\n\t\t}", "function cm_load_widget_r() {\n\tregister_widget( 'cm_widget_r' );\n}", "public function _register_widgets()\n {\n }", "function gardenia_load_widget() {\n\tregister_widget( 'gardenia_widget' );\n}", "function widget_load() {\n\t\tregister_widget('ilgelo_wSocial');\n\t\tregister_widget('ilgelo_wTwitter');\n\t\tregister_widget('ilgelo_banner');\n\t}", "function duende_load_widget() {\n\tregister_widget( 'duende_widget' );\n}", "function load_widget() {\n\n\t\tregister_widget( 'WordpressConnectWidgetActivityFeed' );\n\t\tregister_widget( 'WordpressConnectWidgetComments' );\n\t\tregister_widget( 'WordpressConnectWidgetFacepile' );\n\t\tregister_widget( 'WordpressConnectWidgetLikeBox' );\n\t\tregister_widget( 'WordpressConnectWidgetLikeButton' );\n\t\tregister_widget( 'WordpressConnectWidgetLiveStream' );\n\t\tregister_widget( 'WordpressConnectWidgetLoginButton' );\n\t\tregister_widget( 'WordpressConnectWidgetRecommendations' );\n\t\tregister_widget( 'WordpressConnectWidgetSendButton' );\n\n\t}", "function hotpro_load_widget() {register_widget( 'data_hotpro_widget' );}", "public function widgets(){\n\t\t//register_widget(\"sampleWidget\");\n\t}", "public function widgets(){\n\t\t//register_widget(\"sampleWidget\");\n\t}", "function rs_load_widget()\n{\n\tregister_widget('rs_Widget_Agenda');\n}", "function aw_add_load_widget() {\r\n\t\tregister_widget( 'AW_AddFeed' );\r\n\t}", "function example_load_widgets()\n{\n\tregister_widget('GuildNews_Widget');\n}", "function wpb_load_widget()\n{\n register_widget( 'WC_External_API_Widget' );\n}", "function cwcg_load_widget() {\n register_widget( 'cwcg_test_grid_widget' );\n}", "function load_widget_plugin_name() {\n register_widget( 'widget_plugin_name' );\n}", "protected function registerWidget()\n {\n\t\t$id = $this->options['id'];\n $gridSelector = $this->gridSelector;\n\t\t\n\t\t$view = $this->getView();\n\t\t\n IsotopeAsset::register($view);\n $js = [];\n \n $options = Json::encode($this->clientOptions);\n $js[] = \"var isotopeContainer$id = $('$gridSelector');\";\n $js[] = \"var isotope$id = isotopeContainer$id.isotope($options);\";\n\n $view->registerJs(implode(\"\\n\", $js),$view::POS_READY);\n\t\t\n\t\tif (!empty($this->cssFile)) {\n\t\t\tcall_user_func_array([$view, \"registerCssFile\"], $this->cssFile);\n\t\t} \t\t\n }", "function pre_load_widget() {\n register_widget( 'events_widget' );\n register_widget( 'fundys_widget' );\n}", "function ois_load_widgets() {\r\n register_widget( 'OptinSkin_Widget' );\r\n}", "function wpb_load_widget() {\r\n\tregister_widget( 'wpb_widget' );\r\n}", "function wpb_load_widget()\n{\n register_widget('wpb_widget');\n}", "function d7_schema_info_widget_load_widget() {\n\tregister_widget( 'd7_schema_info_widget' );\n}", "function wpb_load_widget() {\n register_widget( 'wpb_widget' );\n}", "function wpb_load_widget() {\n register_widget( 'wpb_widget' );\n}", "function whichet_load_widget() {\n\tregister_widget( 'WHICHet_widget' );\n\tadd_action( 'wp_enqueue_script', 'WHICHet_scripts' );\n}" ]
[ "0.8110661", "0.7967675", "0.78804576", "0.7738934", "0.7702892", "0.7682854", "0.76820266", "0.76244855", "0.7621846", "0.76101273", "0.7574632", "0.74874914", "0.741399", "0.7409604", "0.7409604", "0.7344513", "0.731742", "0.729245", "0.726935", "0.72691077", "0.724296", "0.7219335", "0.7199558", "0.7199408", "0.7183758", "0.7168517", "0.71638155", "0.7160979", "0.7160979", "0.7136273" ]
0.8054664
1
expense report date wise
public function expenseReportDate(Request $request){ if($request->pdf=='pdf_download'){ echo "<h1>Coming soon</h1>"; }else{ $start=$request->start; $end=$request->end; $company=Company::first(); $data=ExpenseAmount::whereBetween('expense_date',[$start,$end])->with('ExpenseCategorys','Warehouses','users')->get(); return view('report.expense.expense_date_wise',compact('start','end','company','data')); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function dtexpensegroupreport()\n {\n $search_type = $this->input->post('search_type');\n $date_from = $this->input->post('date_from');\n $date_to = $this->input->post('date_to');\n $head = $this->input->post('head');\n\n $data['date_type'] = $this->customlib->date_type();\n $data['date_typeid'] = '';\n\n if (isset($_POST['search_type']) && $_POST['search_type'] != '') {\n\n $dates = $this->customlib->get_betweendate($_POST['search_type']);\n $data['search_type'] = $_POST['search_type'];\n\n } else {\n\n $dates = $this->customlib->get_betweendate('this_year');\n $data['search_type'] = '';\n\n }\n\n $data['head_id'] = $head_id = \"\";\n if (isset($_POST['head']) && $_POST['head'] != '') {\n $data['head_id'] = $head_id = $_POST['head'];\n }\n\n $start_date = date('Y-m-d', strtotime($dates['from_date']));\n $end_date = date('Y-m-d', strtotime($dates['to_date']));\n\n $data['label'] = date($this->customlib->getSchoolDateFormat(), strtotime($start_date)) . \" \" . $this->lang->line('to') . \" \" . date($this->customlib->getSchoolDateFormat(), strtotime($end_date));\n $result = $this->expensehead_model->searchexpensegroup($start_date, $end_date, $head_id);\n\n $m = json_decode($result);\n $currency_symbol = $this->customlib->getSchoolCurrencyFormat();\n $dt_data = array();\n $grand_total = 0;\n if (!empty($m->data)) {\n $grd_total = 0;\n foreach ($m->data as $key => $value) {\n\n $expensedata = explode(',', $value->expense);\n $expense_id = \"\";\n $expense_name = \"\";\n $expense_date = \"\";\n $invoice_no = \"\";\n $expense_amount = \"\";\n foreach ($expensedata as $expensevalue) {\n $expenseexpload = explode('@', $expensevalue);\n\n $expense_id .= $expenseexpload[0];\n $expense_id .= \"<br>\";\n $expense_date .= date($this->customlib->getSchoolDateFormat(), strtotime($expenseexpload[1]));\n $expense_date .= \"<br>\";\n $expense_name .= $expenseexpload[2];\n $expense_name .= \"<br>\";\n $invoice_no .= $expenseexpload[3];\n $invoice_no .= \"<br>\";\n $expense_amount .= $expenseexpload[4];\n $expense_amount .= \"<br>\";\n }\n\n $total_amount = \"<b>\" . $value->total_amount . \"</b>\";\n $grd_total += $value->total_amount;\n $row = array();\n $row[] = $value->exp_category;\n $row[] = $expense_id;\n $row[] = $expense_name;\n $row[] = $expense_date;\n $row[] = $invoice_no;\n $row[] = $expense_amount;\n $dt_data[] = $row;\n\n $amount_row = array();\n $amount_row[] = \"\";\n $amount_row[] = \"\";\n $amount_row[] = \"\";\n $amount_row[] = \"\";\n $amount_row[] = \"\";\n $amount_row[] = $total_amount;\n $dt_data[] = $amount_row;\n }\n\n $grand_total = \"<b>\" . $currency_symbol . $grd_total . \"</b>\";\n $footer_row = array();\n $footer_row[] = \"\";\n $footer_row[] = \"\";\n $footer_row[] = \"\";\n $footer_row[] = \"\";\n $footer_row[] = \"<b>\" . $this->lang->line('total') . \"</b>\";\n $footer_row[] = $grand_total;\n $dt_data[] = $footer_row;\n }\n\n $json_data = array(\n \"draw\" => intval($m->draw),\n \"recordsTotal\" => intval($m->recordsTotal),\n \"recordsFiltered\" => intval($m->recordsFiltered),\n \"data\" => $dt_data,\n );\n echo json_encode($json_data);\n }", "public function getTotalExpensesByDate($date)\n\t{\n\t $cid = $this->gasolinereceived_model->getCompanyId();\n\t\t $cid1 = $cid['0']->c_id;\n \n $this->db->select('SUM(exp_amount) as total_exp', FALSE);\n\t\t$this->db->like('date', $date);\n\t\t// $this->db->where('date <=', $date);\n\t\t// $this->db->where('date >=', $date);\n // $this->db->where('date <=', $date2);\n \n\t\t $this->db->where('c_id\t',$cid1);\n\t\t// $this->db->where('pid',$pid);\n\t\t //$this->db->group_by('cc_type'); \n\t\t $query = $this->db->get('expenses')->row_array();\n\t\t $q= $this->db->last_query($query);\n\t\t //print_r($q); die();\n\t return $query['total_exp'];\n\t \n\t}", "function quantizer_expenses_general_report($start_date= null, $end_date = null)\r\n\t\t{\r\n\t\t\t// ya que sino daria un error al generar el pdf.\r\n\t\t\tConfigure::write('debug',0);\r\n\r\n\t\t\t$resultado = $this->calculateQuantizerGeneralExpenses($start_date, $end_date);\r\n\t\t\t\r\n\t\t\t$resultado['Details']['start_date'] = $this->RequestAction('/external_functions/setDate/'.$start_date);\r\n\t\t\t$resultado['Details']['end_date'] = $this->RequestAction('/external_functions/setDate/'.$end_date);\r\n\t\t\t$resultado['Details']['date_today'] = date('d-m-Y H:i:s');\r\n\t\t\t\r\n\t\t\t$user = $this->RequestAction('/external_functions/getDataSession');\r\n\t\t\t\r\n\t\t\t$resultado['Details']['generated_by'] = $user['User']['name'].' '.$user['User']['first_lastname'];\r\n\r\n\t\t\t$this->set('data', $resultado);\r\n\t\t\t$this->layout = 'pdf';\r\n\t\t\t$this->render();\r\n\t\t}", "public function expense(Request $request)\n {\n\n $d=DB::table('expense'); // define for filter\n\n $from_date=\"\"; $to_date=\"\";\n if($request->from_date!=\"\"){\n // $Fdate=str_replace(\"/\",\"-\",$request->from_date);\n $from_date =Date('Y-m-d',strtotime($request->from_date)); \n }\n if($request->to_date !=\"\"){\n // $Tdate=str_replace(\"/\",\"-\",$request->to_date);\n $to_date =Date('Y-m-d',strtotime($request->to_date)); \n }\n \n\n if($from_date!=\"\" && $to_date!=\"\"){\n $d->whereBetween('date',[$from_date,$to_date]); \n }\n $type=0;\n if($request->type!=\"\"){\n $d->where('type',$request->type); \n $type=$request->type;\n }\n $category=\"\";\n if($request->category!=\"\"){\n $d->where('category',$request->category); \n $category=$request->category;\n }\n\n $month_array=array('1'=>'Jan','2'=>'Feb','3'=>'Mar','4'=>'Apr','5'=>'May','6'=>'Jun','7'=>'Jul','8'=>'Aug','9'=>'Sep','10'=>'Oct','11'=>'Nov','12'=>'Dec'); \n \n $incomes=DB::table('expense')\n ->where('type',1)\n ->where('customer_name',request()->user()->name)\n ->select(DB::raw('sum(total_amount) as total_amount'), DB::raw('MONTH(created_at) as month'))\n ->groupBy('month')\n ->get()\n ->keyBy('month');\n\n \n $expenses=DB::table('expense')\n ->where('type',2)\n ->where('customer_name',request()->user()->name)\n ->select(DB::raw('sum(total_amount) as total_amount'), DB::raw('MONTH(created_at) as month'))\n ->groupBy('month')\n ->get()\n ->keyBy('month');\n\n $incomeexp_percent=DB::table('expense')\n ->where('customer_name',request()->user()->name)\n ->select(DB::raw('count(*) as total'), DB::raw('category as category'), DB::raw('MONTH(created_at) as month'))\n ->groupBy('category','month')\n ->get();\n \n $total_amount_income=[];\n $total_amount_income1=[];\n \n $total_amount_expense=[];\n $total_amount_expense1=[];\n \n foreach ($incomes as $key => $income) {\n $total_amount_income[$key] = $income->total_amount;\n }\n \n foreach ($expenses as $key => $expense) {\n $total_amount_expense[$key] = $expense->total_amount;\n }\n\n for($i = 1; $i <= 12; $i++)\n {\n $month[$i]=$month_array[$i];\n\n if(!empty($total_amount_income[$i])){\n $total_amount_income1[$i] = $total_amount_income[$i]; \n }else{\n $total_amount_income1[$i] = 0; \n }\n\n if(!empty($total_amount_expense[$i])){\n $total_amount_expense1[$i] = $total_amount_expense[$i]; \n }else{\n $total_amount_expense1[$i] = 0; \n }\n }\n $sum=[];\n foreach($incomeexp_percent as $key=>$percent) {\n $sum[$key]=$percent->total;\n }\n $total_category=array_sum($sum); \n\n $data=$d->orderBy('id','desc')->get();\n $autocomplete=Expense::distinct('category')->select('category')->get();\n return view('user_expense_report',['data'=>$data,'from_date'=>$from_date,'to_date'=>$to_date,'type'=>$type,'autocomplete'=>$autocomplete,'category'=>$category,'month'=>$month,'total_amount_income1'=>$total_amount_income1,'total_amount_expense1'=>$total_amount_expense1,'incomeexp_percent'=>$incomeexp_percent,'total_category'=>$total_category]);\n }", "public function get_sales_man_daily_work_report($date){\n\t\t $this->db->select('empployee.e_id,empployee.e_emplouee_id,assign_work.w_d_id,assign_work.date')->from('assign_work');\n\t\t $this->db->join('empployee', 'empployee.e_id = assign_work.work_employee_id ', 'left');\n\t\t $this->db->order_by('empployee.role_id',8);\n\t\t $this->db->where('empployee.status',1);\n\t\t $this->db->where('assign_work.date',$date);\n\t\t $return=$this->db->get()->result_array();\n\t\t $work_details=$data_work='';\n\t\t foreach($return as $list){\n\t\t\t $emp_work=$this->get_employee_work_dailay_details($list['date'],$list['e_id'],$list['w_d_id']);\n\t\t\t $data[$list['e_id']]=$list;\n\t\t\t $data[$list['e_id']]['work']=isset($emp_work)?$emp_work:'';\n\t\t\t \n\t\t }\n\t\t if(!empty($data)){\n\t\t\t return $data;\n\t\t }\n\t}", "function getDailyReport($date = null)\n{\n//SELECT COUNT(0)\n//FROM `0_debtor_trans`\n//WHERE ((`0_debtor_trans`.`type` = 10) AND (`0_debtor_trans`.`tran_date` = '$date'))) AS `invoice_count`,\n//`b`.`tran_date` AS `tran_date`,(\n//SELECT COUNT(`0_debtor_trans_details`.`id`)\n//FROM (`0_debtor_trans`\n//LEFT JOIN `0_debtor_trans_details` ON((`0_debtor_trans`.`trans_no` = `0_debtor_trans_details`.`debtor_trans_no`)))\n//WHERE ((`0_debtor_trans_details`.`debtor_trans_type` = 10) AND\n//(`0_debtor_trans`.`type` = 10) AND (`0_debtor_trans`.`tran_date` = '$date'))) AS `total_service_count`,(\n//SELECT SUM((`0_debtor_trans`.`ov_amount` + `0_debtor_trans`.`ov_gst`))\n//FROM `0_debtor_trans`\n//WHERE ((`0_debtor_trans`.`type` = 10) AND (`0_debtor_trans`.`tran_date` = '$date'))) AS `total_invoice_amount`,(\n//SELECT SUM(`0_debtor_trans`.`alloc`)\n//FROM `0_debtor_trans`\n//WHERE ((`0_debtor_trans`.`type` = 10) AND (`0_debtor_trans`.`tran_date` = '$date'))) AS `total_amount_recieved`,(\n//SELECT (SUM((`0_debtor_trans`.`ov_amount` + `0_debtor_trans`.`ov_gst`)) - SUM(`0_debtor_trans`.`alloc`))\n//FROM `0_debtor_trans`\n//WHERE ((`0_debtor_trans`.`type` = 10) AND (`0_debtor_trans`.`tran_date` = '$date'))) AS `pending_amount`,(\n//SELECT (SUM((`0_debtor_trans_details`.`quantity` * `0_debtor_trans_details`.`unit_price`)) -\n//SUM((`0_debtor_trans_details`.`quantity` * `0_debtor_trans_details`.`discount_amount`)))\n//FROM (`0_debtor_trans`\n//LEFT JOIN `0_debtor_trans_details` ON((`0_debtor_trans`.`trans_no` = `0_debtor_trans_details`.`debtor_trans_no`)))\n//WHERE ((`0_debtor_trans_details`.`debtor_trans_type` = 10) AND (`0_debtor_trans`.`type` = 10) AND\n//(`0_debtor_trans`.`tran_date` = '$date'))) AS `total_service_charge`,(\n//SELECT SUM((`0_debtor_trans_details`.`quantity` * `0_debtor_trans_details`.`user_commission`))\n//FROM (`0_debtor_trans`\n//LEFT JOIN `0_debtor_trans_details` ON((`0_debtor_trans`.`trans_no` = `0_debtor_trans_details`.`debtor_trans_no`)))\n//WHERE ((`0_debtor_trans_details`.`debtor_trans_type` = 10) AND (`0_debtor_trans`.`type` = 10) AND\n//(`0_debtor_trans`.`tran_date` = '$date'))) AS `total_commission`,(\n//SELECT SUM(ABS(`0_gl_trans`.`amount`))\n//FROM `0_gl_trans`\n//WHERE ((`0_gl_trans`.`type` = 12) AND (`0_gl_trans`.`account` = 1200) AND\n//(`b`.`tran_date` = '$date'))) AS `total_collection`\n//FROM ((`0_debtor_trans` `a`\n//JOIN `0_gl_trans` `b` ON((`a`.`trans_no` = `b`.`type_no`)))\n//JOIN `0_debtor_trans_details` `c` ON((`a`.`trans_no` = `c`.`debtor_trans_no`)))\n//WHERE ((`c`.`debtor_trans_type` = 10) AND (`a`.`type` = 10)) and `b`.`tran_date` = '$date'\n//GROUP BY `b`.`tran_date`\n//ORDER BY `b`.`tran_date`\";\n//\n//// if ($date) {\n//// $sql .= \" and tran_date='$date' \";\n//// }\n////\n//// $sql .= \" order by tran_date desc LIMIT 10\";\n//\n//\n//// print_r($sql); die;\n//\n// $result = db_query($sql, \"Transactions could not be calculated\");\n//\n// $table_html = \"\";\n//\n// $i = 0;\n//\n// while ($myrow = db_fetch($result)) {\n//\n// $class = 'class=\"oddrow\"';\n// if ($i % 2 == 0)\n// $class = 'class=\"evenrow\"';\n//\n// $table_html .= \"<tr $class>\";\n// $table_html .= \"<td>\" . $myrow['tran_date'] . \"</td>\";\n// $table_html .= \"<td style='text-align: center'>\" . $myrow['invoice_count'] . \"</td>\";\n// $table_html .= \"<td style='text-align: center'>\" . $myrow['total_service_count'] . \"</td>\";\n// $table_html .= \"<td style='text-align: right'>\" . number_format2($myrow['total_service_charge'], user_price_dec()) . \"</td>\";\n// $table_html .= \"<td style='text-align: right'>\" . number_format2($myrow['total_invoice_amount'], user_price_dec()) . \"</td>\";\n// $table_html .= \"<td style='text-align: right'>\" . number_format2($myrow['total_collection'], user_price_dec()) . \"</td>\";\n// $table_html .= \"</tr>\";\n// $i++;\n// }\n// return $table_html;\n\n}", "public function dtincomegroupreport()\n {\n $search_type = $this->input->post('search_type');\n $date_from = $this->input->post('date_from');\n $date_to = $this->input->post('date_to');\n $head = $this->input->post('head');\n\n if (isset($search_type) && $search_type != '') {\n\n $dates = $this->customlib->get_betweendate($search_type);\n $data['search_type'] = $_POST['search_type'];\n\n } else {\n\n $dates = $this->customlib->get_betweendate('this_year');\n $data['search_type'] = '';\n\n }\n $data['head_id'] = $head_id = \"\";\n if (isset($_POST['head']) && $_POST['head'] != '') {\n $data['head_id'] = $head_id = $_POST['head'];\n }\n\n $start_date = date('Y-m-d', strtotime($dates['from_date']));\n $end_date = date('Y-m-d', strtotime($dates['to_date']));\n\n $data['label'] = date($this->customlib->getSchoolDateFormat(), strtotime($start_date)) . \" \" . $this->lang->line('to') . \" \" . date($this->customlib->getSchoolDateFormat(), strtotime($end_date));\n $incomeList = $this->income_model->searchincomegroup($start_date, $end_date, $head_id);\n $m = json_decode($incomeList);\n $currency_symbol = $this->customlib->getSchoolCurrencyFormat();\n $dt_data = array();\n $grand_total = 0;\n if (!empty($m->data)) {\n $grd_total = 0;\n foreach ($m->data as $key => $value) {\n\n $incomedata = explode(',', $value->income);\n $income_id = \"\";\n $income_name = \"\";\n $income_date = \"\";\n $invoice_no = \"\";\n $income_amount = \"\";\n $total_amount = 0;\n foreach ($incomedata as $incomevalue) {\n $incomeexpload = explode('@', $incomevalue);\n $income_id .= $incomeexpload[0];\n $income_id .= \"<br>\";\n $income_name .= $incomeexpload[1];\n $income_name .= \"<br>\";\n $income_date .= date($this->customlib->getSchoolDateFormat(), strtotime($incomeexpload[3]));\n $income_date .= \"<br>\";\n $invoice_no .= $incomeexpload[2];\n $invoice_no .= \"<br>\";\n $income_amount .= $incomeexpload[4];\n $income_amount .= \"<br>\";\n }\n $total_amount = \"<b>\" . $value->total_amount . \"</b>\";\n $grd_total += $value->total_amount;\n $row = array();\n $row[] = $value->income_category;\n $row[] = $income_id;\n $row[] = $income_name;\n $row[] = $income_date;\n $row[] = $invoice_no;\n $row[] = $income_amount;\n $dt_data[] = $row;\n\n $amount_row = array();\n $amount_row[] = \"\";\n $amount_row[] = \"\";\n $amount_row[] = \"\";\n $amount_row[] = \"\";\n $amount_row[] = \"\";\n $amount_row[] = $total_amount;\n $dt_data[] = $amount_row;\n }\n\n $grand_total = \"<b>\" . $currency_symbol . $grd_total . \"</b>\";\n $footer_row = array();\n $footer_row[] = \"\";\n $footer_row[] = \"\";\n $footer_row[] = \"\";\n $footer_row[] = \"\";\n $footer_row[] = \"<b>\" . $this->lang->line('total') . \"</b>\";\n $footer_row[] = $grand_total;\n $dt_data[] = $footer_row;\n }\n\n $json_data = array(\n \"draw\" => intval($m->draw),\n \"recordsTotal\" => intval($m->recordsTotal),\n \"recordsFiltered\" => intval($m->recordsFiltered),\n \"data\" => $dt_data,\n );\n echo json_encode($json_data);\n }", "public function retrieve_dateWise_profit_report($start_date,$end_date)\n\t{\n\t\t$this->db->select(\"a.date,a.invoice,b.invoice_id,\n\t\t\tCAST(sum(total_price) AS DECIMAL(16,2)) as total_sale\");\n\t\t$this->db->select('CAST(sum(`quantity`*`supplier_rate`) AS DECIMAL(16,2)) as total_supplier_rate', FALSE);\n\t\t$this->db->select(\"CAST(SUM(total_price) - SUM(`quantity`*`supplier_rate`) AS DECIMAL(16,2)) AS total_profit\");\n\n\t\t$this->db->from('invoice a');\n\t\t$this->db->join('invoice_details b','b.invoice_id = a.invoice_id');\n\n\t\t$this->db->where('a.date >=', $start_date); \n\t\t$this->db->where('a.date <=', $end_date); \n\n\t\t$this->db->group_by('b.invoice_id');\n\t\t$this->db->order_by('a.invoice','desc');\n\t\t$query = $this->db->get();\n\t\treturn $query->result_array();\n\t}", "function get_acquisition_value(){\n\n $from_date = $_REQUEST['from_date'];\n $to_date = $_REQUEST['to_date'];\n\n $obj = new vintage_has_acquire();\n //$columns = \"DATE_FORMAT(acquire_date,'%b') as Month\";\n $columns = \"DATE_FORMAT(tblAcquire.acquire_date,'%b') as month, sum(trelVintageHasAcquire.total_price) as total\";\n //$group = \" trelVintageHasAcquire.acquire_id \";\n $group = \" Month \";\n $where = \" tblAcquire.acquire_date BETWEEN '2014-01-01' AND '2014-12-31'\";\n $sort = \" acquire_date ASC \";\n $rst = $obj ->get_extended($where,$columns,$group, $sort);\n \n \n if(!$rst){\n $var_result['success']=false;\n $var_result['error']=\"acquisition report failed\";\n return $var_result;\n }\n\n $var_result['success']=true;\n $var_result['data']=$rst;\n return $var_result;\n\n}", "public function retrieve_dateWise_profit_report($start_date,$end_date)\n\t{\n\t\t$dateRange = \"a.date BETWEEN '$start_date%' AND '$end_date%'\";\n\n\t\t$this->db->select(\"a.date,a.invoice,b.invoice_id,sum(total_price) as total_sale\");\n\t\t$this->db->select('sum(`quantity`*`supplier_rate`) as total_supplier_rate', FALSE);\n\t\t$this->db->select(\"(SUM(total_price) - SUM(`quantity`*`supplier_rate`)) AS total_profit\");\n\n\t\t$this->db->from('invoice a');\n\t\t$this->db->join('invoice_details b','b.invoice_id = a.invoice_id');\n\t\t$this->db->where($dateRange, NULL, FALSE); \n\t\t$this->db->group_by('b.invoice_id');\n\t\t$this->db->order_by('a.invoice','desc');\n\t\t$this->db->limit('500');\n\t\t$query = $this->db->get();\n\t\treturn $query->result_array();\n\t}", "public function byDate(Request $request)\n {\n // Default return today's expense\n $myUser = Auth::user();\n if (isset($request->start_date) && isset($request->end_date)) {\n $start_date = $request->start_date;\n $end_date = $request->end_date;\n } elseif (isset($request->start_date)) {\n $start_date = $request->start_date;\n $end_date = date('Y-m-d');\n } else {\n $start_date = date('Y-m-d');\n $end_date = date('Y-m-d');\n }\n $myExpense = Expense::selectRaw('expense_date, sum(amount) as total_amount')\n ->whereBetween('expense_date', [ $start_date, $end_date ])\n ->where('user_id', $myUser->id)\n ->orderby('expense_date')\n ->groupby('expense_date')\n ->get();\n\n return view('report.bydate')\n ->with('expenseList', $myExpense)\n ->with('start_date', $start_date)\n ->with('end_date', $end_date);\n }", "public function date_range_report()\n\t{\n\t\t$this->data['crystal_report']=$this->reports_personnel_schedule_model->crystal_report_view();\n\t\t$this->data['company_list'] = $this->reports_personnel_schedule_model->company_list();\n\t\t$this->load->view('employee_portal/report_personnel/schedule/date_range_report',$this->data);\n\t}", "public function show_sales_review_date()\n {\n $query = $this->db->query(\"SELECT `date`,`product_id`,`type`,`weight`, SUM(`amount`) as amoun,SUM(`price`) as price FROM `sales` WHERE DATE(`date`)=CURDATE() GROUP BY `product_id`\");\n return $query->result();\n }", "public function expenses_report()\n {\n $expensecategories = ExpenseCategory::select('id','name')->where('status',0)->get();\n\n return view('reports.expenses',compact('expensecategories'));\n }", "public function fillDailyTReport(Request $request)\n {\n $CIH = new CashInHand();\n $TF = new TermFee();\n $STA = new Stationary();\n $AD = new Admission();\n $COS = new Course();\n $exp = new Expense();\n $OI = new OtherIncome();\n\n //fees\n $ncTF = $TF->getMonthlyTF($request->Fdate, $request->Tdate, 'nc_term_tbl');//NC all monthly term fee\n $bcTF = $TF->getMonthlyTF($request->Fdate, $request->Tdate, 'bc_term_tbl');//BC all monthly term fee\n $ncEF = $TF->getMonthlyEF($request->Fdate, $request->Tdate, 'nc_exam_tbl');//NC all monthly exam fee\n $bcEF = $TF->getMonthlyEF($request->Fdate, $request->Tdate, 'bc_exam_tbl');//BC all monthly exam fee\n $ncExtF = $TF->getMonthlyExtF($request->Fdate, $request->Tdate, 'nc_exam_tbl');//NC all monthly extra curricular fee\n $bcExtF = $TF->getMonthlyExtF($request->Fdate, $request->Tdate, 'bc_exam_tbl');//BC all monthly extra curricular fee\n\n //stationary\n $stationary = $STA->getMonthlySta($request->Fdate, $request->Tdate);//get all monthly stationary\n\n //Other income\n $otherIncm = $OI->getMonthlyOI($request->Fdate, $request->Tdate);//get all monthly other income\n\n //admission & refund\n $admRefM = $AD->getMonthlyAdmRef($request->Fdate, $request->Tdate);//get all monthly admission & refund\n $admDisMexp = $AD->getMonthlydiscount($request->Fdate, $request->Tdate);//get all monthly discount expense\n\n //courses\n $cosM = $COS->getMonthlyCos($request->Fdate, $request->Tdate);//get all monthly course fee\n\n //expenses\n $expM = $exp->getMonthlyExp($request->Fdate, $request->Tdate);//get all monthly expenses\n\n //total income\n $totIncome = $CIH->getTotalIncome($request->Fdate, $request->Tdate);//get total income\n //total expense\n $totExpense = $CIH->getTotalExpense($request->Fdate, $request->Tdate);//get total expense\n\n return array($ncTF, $bcTF, $ncEF, $bcEF, $ncExtF, $bcExtF, $stationary, $otherIncm, $admRefM, $cosM, $admDisMexp, $expM, $totIncome, $totExpense);\n }", "public function show_other_expense_review_by_date($date_from,$date_to)\n {\n $query = $this->db->query(\"SELECT `date`,GROUP_CONCAT(`purpose`) as purpose, GROUP_CONCAT(`amount`) as amount, SUM(`amount`) as rowtotal FROM `expense` WHERE DATE(`date`) BETWEEN STR_TO_DATE('$date_from', '%Y-%m-%d') AND STR_TO_DATE('$date_to', '%Y-%m-%d') GROUP BY `date` \");\n return $query->result();\n }", "public function getSelectedDayLoanDetails($selectedDate) {\n\n\n date_default_timezone_set(\"Asia/Calcutta\");\n $time = date('H:i:s');\n $today = date('Y-m-d H:i:s');\n\n $numOfInstallments = DefaultData::getNumOfInstlByPeriodAndType($this->loan_period, $this->installment_type);\n $first_installment_date = '';\n $paid_aditional_interrest = 0;\n $INSTALLMENT = new Installment(NULL);\n $total_paid_installment = 0;\n\n foreach ($INSTALLMENT->getInstallmentByLoan($this->id) as $installment) {\n $paid_aditional_interrest += $installment[\"additional_interest\"];\n $total_paid_installment = $total_paid_installment + $installment[\"paid_amount\"];\n }\n\n $loan_amount = $numOfInstallments * $this->installment_amount;\n $actual_due = $loan_amount - $total_paid_installment;\n\n //daily installment\n if ($this->installment_type == 30) {\n\n $FID = new DateTime($this->effective_date);\n $FID->modify('+1 day');\n $first_installment_date = $FID->format('Y-m-d ' . $time);\n\n\n $start = new DateTime($first_installment_date);\n $first_date = $start->format('Y-m-d ' . $time);\n\n $x = 0;\n $total_installment_amount = 0;\n $ins_total = 0;\n $total_paid = 0;\n $od_amount_all_array = array();\n\n $od_array = array();\n $last_od = array();\n $od_total = array();\n $last_od_balance = array();\n $od_balance_amount = array();\n\n while ($x < $numOfInstallments) {\n if ($numOfInstallments == 4) {\n $modify_range = '+7 day';\n } elseif ($numOfInstallments == 30) {\n $modify_range = '+1 day';\n } elseif ($numOfInstallments == 8) {\n $modify_range = '+7 day';\n } elseif ($numOfInstallments == 60) {\n $modify_range = '+1 day';\n } elseif ($numOfInstallments == 2) {\n $modify_range = '+1 months';\n } elseif ($numOfInstallments == 1) {\n $modify_range = '+1 months';\n } elseif ($numOfInstallments == 90) {\n $modify_range = '+1 day';\n } elseif ($numOfInstallments == 12) {\n $modify_range = '+7 day';\n } elseif ($numOfInstallments == 3) {\n $modify_range = '+1 months';\n } elseif ($numOfInstallments == 100) {\n $modify_range = '+1 day';\n } elseif ($numOfInstallments == 13) {\n $modify_range = '+7 day';\n }\n\n $date = $start->format('Y-m-d ' . $time);\n\n $paid_amount = 0;\n $od_amount = 0;\n $od_amount_all = 0;\n $balance = 0;\n $loan_proccesign_fee_paid = 0;\n $total_od_paid = 0;\n $paid_all_amount_before_ins_date = 0;\n $paid_all_od_before_ins_date = 0;\n $last_od_amount = 0;\n $od_interest = 0;\n\n $customer = $this->customer;\n $CUSTOMER = new Customer($customer);\n $route = $CUSTOMER->route;\n $center = $CUSTOMER->center;\n $installment_amount = $this->installment_amount;\n\n $FID = new DateTime($date);\n $FID->modify($modify_range);\n $day_remove = '-1 day';\n $FID->modify($day_remove);\n $second_installment_date = $FID->format('Y-m-d ' . $time);\n $amount = $this->installment_amount;\n\n $INSTALLMENT = new Installment(NULL);\n $ALl_AMOUNT = $INSTALLMENT->getAmountByLoanId($this->id);\n\n foreach ($INSTALLMENT->CheckInstallmetByPaidDate($date, $this->id) as $paid) {\n $paid_amount += $paid['paid_amount'];\n }\n\n foreach ($INSTALLMENT->getPaidAmountByBeforeDate($date, $this->id) as $before_payment_amount) {\n $paid_all_amount_before_ins_date += $before_payment_amount['paid_amount'];\n $paid_all_od_before_ins_date += $before_payment_amount['additional_interest'];\n }\n\n if (PostponeDate::CheckIsPostPoneByDateAndCustomer($date, $customer) || PostponeDate::CheckIsPostPoneByDateAndRoute($date, $route) || PostponeDate::CheckIsPostPoneByDateAndCenter($date, $center) || PostponeDate::CheckIsPostPoneByDateAndAll($date) || PostponeDate::CheckIsPostPoneByDateCenterAll($date) || PostponeDate::CheckIsPostPoneByDateRouteAll($date)) {\n $start->modify($modify_range);\n } else {\n\n\n $ins_total += $amount;\n $total_paid += $paid_amount;\n $last_od_amount = (float) end($od_amount_all_array);\n\n $balance = $actual_due;\n\n $OD = new OD(NULL);\n $OD->loan = $this->id;\n $AllOd = $OD->allOdByLoan();\n\n\n //get daily loan od amount \n if (!$AllOd || PostponeDate::CheckIsPostPoneByDateAndCustomer($date, $customer) || PostponeDate::CheckIsPostPoneByDateAndRoute($date, $route) || PostponeDate::CheckIsPostPoneByDateAndCenter($date, $center) || PostponeDate::CheckIsPostPoneByDateAndAll($date) || PostponeDate::CheckIsPostPoneByDateCenterAll($date) || PostponeDate::CheckIsPostPoneByDateRouteAll($date) || $ALl_AMOUNT[0] >= $ins_total) {\n \n } else {\n if ($AllOd) {\n foreach ($AllOd as $key => $allod) {\n\n if (strtotime($allod['od_date_start']) <= strtotime($date) && strtotime($date) <= strtotime($allod['od_date_end']) && (-1 * ($allod['od_interest_limit'])) > $balance) {\n\n if (strtotime($date) >= strtotime($selectedDate)) {\n break;\n }\n\n $ODDATES = new DateTime($date);\n $ODDATES->modify(' +23 hours +59 minutes +58 seconds');\n\n $od_date_morning = $ODDATES->format('Y-m-d H:i:s');\n\n $paid_all_amount_before_ins_date1 = 0;\n $before_payment_amounts1 = $INSTALLMENT->getPaidAmountByBeforeDate($od_date_morning, $this->id);\n\n foreach ($before_payment_amounts1 as $before_payment_amount1) {\n $paid_all_amount_before_ins_date1 += $before_payment_amount1['paid_amount'];\n }\n\n $od_interest = $this->getOdIntereset1(-$ins_total + $paid_all_amount_before_ins_date1, $allod['od_interest_limit']);\n\n $od_array[] = $od_interest;\n $od_amount_all = json_encode(round(array_sum($od_array), 2));\n\n if ($od_amount_all > 0 || $paid_all_od_before_ins_date == $last_od_amount) {\n\n array_push($od_amount_all_array, $od_amount_all);\n }\n }\n }\n }\n }\n\n $total_installment_amount += $installment_amount;\n\n if (strtotime($selectedDate) <= strtotime($date)) {\n break;\n }\n\n $start->modify($modify_range);\n $x++;\n\n //end of the installment\n if ($numOfInstallments == $x) {\n\n $ODDATES = new DateTime($date);\n $ODDATES->modify('+23 hours +59 minutes +58 seconds');\n $od_date_morning = $ODDATES->format('Y-m-d H:i:s');\n\n //check log ends with od or installment\n $last_od_date = date('D/M/Y', strtotime($od_date_morning));\n $last_installment_date = date('D/M/Y', strtotime($date));\n\n if ($last_od_date == $last_installment_date) {\n $last_loop_od = $od_interest;\n } else {\n $last_loop_od = 0;\n }\n\n //get installment end date\n $INSTALLMENT_END = new DateTime($date);\n $INSTALLMENT_END->modify('+1 day');\n $installment_end = $INSTALLMENT_END->format('Y-m-d H:i:s');\n\n //get 5 years ahead date from installment end date\n $INSTALLMENT_UNLIMITED_END = new DateTime($date);\n $INSTALLMENT_UNLIMITED_END->modify('+1725 day');\n $installment_unlimited_end = $INSTALLMENT_UNLIMITED_END->format('Y-m-d H:i:s');\n\n\n $start = strtotime($date);\n $end = strtotime(date(\"Y/m/d\"));\n $days_between = floor(abs($end - $start) / 86400) - 1;\n $od = $OD->allOdByLoanAndDate($date, $balance);\n $y = 0;\n\n $od_date_start1 = new DateTime($date);\n $od_date_start1->modify('+47 hours +59 minutes +58 seconds');\n\n $defult_val = $days_between;\n $od_amount_all_array_1 = array();\n\n while ($y <= $defult_val) {\n\n if ($od['od_date_start'] <= $od_date_start1) {\n $od_dates = '+1 day';\n }\n\n $od_date = $od_date_start1->format('Y-m-d H:i:s');\n\n //getting echo $od_date; before of date from current od date\n $OLDODDATE = new DateTime($od_date);\n $od_date_remove1 = '-23 hours -59 minutes -58 seconds';\n\n $OLDODDATE->modify($od_date_remove1);\n $old_od_date = $OLDODDATE->format('Y-m-d H:i:s');\n\n if (strtotime($selectedDate) < strtotime($old_od_date) || strtotime($selectedDate) < strtotime($od_date) || strtotime($od['od_date_end'] . $time) < strtotime($old_od_date)) {\n break;\n }\n\n $od_array[] = $od_interest;\n $od_amount_all = json_encode(round(array_sum($od_array), 2));\n\n if ($od_amount_all > 0 || $paid_all_od_before_ins_date == $last_od_amount) {\n\n array_push($od_amount_all_array_1, $od_amount_all);\n }\n\n $od_date_start1->modify($od_dates);\n\n $y++;\n }\n\n $last_od_amount = (float) end($od_amount_all_array_1);\n }\n }\n }\n //weekly installment\n } else if ($this->installment_type == 4) {\n\n $FID = new DateTime($this->effective_date);\n $FID->modify('+7 day');\n $first_installment_date = $FID->format('Y-m-d ' . $time);\n\n\n $start = new DateTime($first_installment_date);\n $first_date = $start->format('Y-m-d ' . $time);\n\n $x = 0;\n $total_installment_amount = 0;\n $ins_total = 0;\n $total_paid = 0;\n $od_amount_all_array = array();\n $od_array = array();\n $last_od = array();\n $od_total = array();\n $last_od_balance = array();\n $od_balance_amount = array();\n\n while ($x < $numOfInstallments) {\n if ($numOfInstallments == 4) {\n $modify_range = '+7 day';\n } elseif ($numOfInstallments == 30) {\n $modify_range = '+1 day';\n } elseif ($numOfInstallments == 8) {\n $modify_range = '+7 day';\n } elseif ($numOfInstallments == 60) {\n $modify_range = '+1 day';\n } elseif ($numOfInstallments == 2) {\n $modify_range = '+1 months';\n } elseif ($numOfInstallments == 1) {\n $modify_range = '+1 months';\n } elseif ($numOfInstallments == 90) {\n $modify_range = '+1 day';\n } elseif ($numOfInstallments == 12) {\n $modify_range = '+7 day';\n } elseif ($numOfInstallments == 3) {\n $modify_range = '+1 months';\n } elseif ($numOfInstallments == 100) {\n $modify_range = '+1 day';\n } elseif ($numOfInstallments == 13) {\n $modify_range = '+7 day';\n }\n\n $date = $start->format('Y-m-d ' . $time);\n\n $paid_amount = 0;\n $od_amount = 0;\n $od_amount_all = 0;\n $balance = 0;\n $loan_proccesign_fee_paid = 0;\n $total_od_paid = 0;\n $paid_all_amount_before_ins_date = 0;\n $paid_all_od_before_ins_date = 0;\n\n\n $customer = $this->customer;\n $CUSTOMER = new Customer($customer);\n $route = $CUSTOMER->route;\n $center = $CUSTOMER->center;\n $installment_amount = $this->installment_amount;\n\n $FID = new DateTime($date);\n $FID->modify($modify_range);\n $day_remove = '-1 day';\n $FID->modify($day_remove);\n $second_installment_date = $FID->format('Y-m-d ' . $time);\n $amount = $this->installment_amount;\n $od_night = date(\"Y/m/d\");\n\n $INSTALLMENT = new Installment(NULL);\n $ALl_AMOUNT = $INSTALLMENT->getAmountByLoanId($this->id);\n\n foreach ($INSTALLMENT->CheckInstallmetByPaidDate($date, $this->id) as $paid) {\n $paid_amount += $paid['paid_amount'];\n }\n\n if (PostponeDate::CheckIsPostPoneByDateAndCustomer($date, $customer) || PostponeDate::CheckIsPostPoneByDateAndRoute($date, $route) || PostponeDate::CheckIsPostPoneByDateAndCenter($date, $center) || PostponeDate::CheckIsPostPoneByDateAndAll($date) || PostponeDate::CheckIsPostPoneByDateCenterAll($date) || PostponeDate::CheckIsPostPoneByDateRouteAll($date)) {\n $start->modify($modify_range);\n } else {\n\n $last_od_amount = (float) end($od_amount_all_array);\n $ins_total += $amount;\n $total_paid += $paid_amount;\n\n $balance = $total_paid_installment - $ins_total;\n\n\n $OD = new OD(NULL);\n $OD->loan = $this->id;\n $od = $OD->allOdByLoanAndDate($date, $balance);\n\n if (strtotime(date(\"Y/m/d\")) < strtotime($date) || PostponeDate::CheckIsPostPoneByDateAndCustomer($date, $customer) || PostponeDate::CheckIsPostPoneByDateAndRoute($date, $route) || PostponeDate::CheckIsPostPoneByDateAndCenter($date, $center) || PostponeDate::CheckIsPostPoneByDateAndAll($date) || PostponeDate::CheckIsPostPoneByDateCenterAll($date) || PostponeDate::CheckIsPostPoneByDateRouteAll($date) || $ALl_AMOUNT[0] >= $ins_total) {\n \n } else {\n if ($od !== false) {\n\n $od_interest = $this->getOdIntereset(-$ins_total + $paid_all_amount_before_ins_date, $od['od_interest_limit']);\n\n $y = 0;\n $od_date_start = new DateTime($date);\n $defult_val = 6;\n\n while ($y <= $defult_val) {\n\n if ($defult_val <= 6 && $this->od_date <= $od_date_start) {\n $od_dates = '+1 day';\n }\n\n $od_date = $od_date_start->format('Y-m-d H:i:s');\n\n //// od dates range\n $ODDATES = new DateTime($od_date);\n $ODDATES->modify($od_dates);\n\n $od_date_remove = '-1 day -23 hours -59 minutes -58 seconds';\n\n $ODDATES->modify($od_date_remove);\n $od_night = $ODDATES->format('Y-m-d H:i:s');\n\n $od_array[] = $od_interest;\n $od_amount_all = json_encode(round(array_sum($od_array)));\n\n\n if (strtotime($od_date) >= strtotime($selectedDate)) {\n break;\n }\n array_push($od_amount_all_array, $od_interest);\n\n\n $od_date_start->modify($od_dates);\n $y++;\n }\n $last_od_amount = (float) end($od_amount_all_array);\n }\n }\n }\n\n if ($selectedDate . \" \" . $time == $date) {\n $total_installment_amount += $installment_amount;\n if (strtotime(date(\"Y/m/d\")) < strtotime($date) || strtotime($selectedDate) < strtotime($date)) {\n break;\n }\n } else {\n if (strtotime(date(\"Y/m/d\")) < strtotime($date) || strtotime($selectedDate) < strtotime($date)) {\n break;\n }\n $total_installment_amount += $installment_amount;\n }\n\n\n $start->modify($modify_range);\n $x++;\n\n if ($numOfInstallments == $x) {\n //get installment end date\n $INSTALLMENT_END = new DateTime($date);\n $INSTALLMENT_END->modify('+7 day');\n $installment_end = $INSTALLMENT_END->format('Y-m-d H:i:s');\n\n //get 5 years ahead date from installment end date\n $INSTALLMENT_UNLIMITED_END = new DateTime($date);\n $INSTALLMENT_UNLIMITED_END->modify('+1725 day');\n $installment_unlimited_end = $INSTALLMENT_UNLIMITED_END->format('Y-m-d H:i:s');\n\n\n $start = strtotime($date);\n $end = strtotime(date(\"Y/m/d\"));\n\n $days_between = floor(abs($end - $start) / 86400) - 1;\n\n $z = 0;\n\n $od_date_start1 = new DateTime($od_night);\n $od_date_start1->modify('+1 day +23 hours +59 minutes +58 seconds');\n $defult_val = $days_between;\n\n //if having od after installment end\n if ($od !== false) {\n\n $last_od_date = date('D/M/Y', strtotime($od_night));\n $last_installment_date = date('D/M/Y', strtotime($date));\n\n if ($last_od_date == $last_installment_date) {\n $last_loop_od = $od_interest;\n } else {\n $last_loop_od = 0;\n }\n\n// $od_amount_all_array_1 = array();\n\n while ($z <= $defult_val) {\n\n if ($od['od_date_start'] <= $od_date_start1) {\n $od_dates = '+1 day';\n }\n\n\n $od_date1 = $od_date_start1->format('Y-m-d H:i:s');\n\n //getting brfore of date from current od date\n $OLDODDATE = new DateTime($od_date1);\n $od_date_remove1 = '-23 hours -59 minutes -58 seconds';\n\n $OLDODDATE->modify($od_date_remove1);\n $old_od_date = $OLDODDATE->format('Y-m-d H:i:s');\n\n if (strtotime($selectedDate) <= strtotime($od_date1)) {\n break;\n }\n\n\n $od_array[] = $od_interest;\n $od_amount_all = json_encode(round(array_sum($od_array)));\n\n// if ($od_amount_all > 0 || $paid_all_od_before_ins_date == $last_od_amount) {\n//\n// array_push($od_amount_all_array_1, $od_amount_all);\n// }\n array_push($od_amount_all_array, $od_interest);\n\n// $last_od_amount = (float) end($od_amount_all_array_1);\n $od_date_start1->modify($od_dates);\n $z++;\n }\n }\n }\n }\n } else if ($this->installment_type == 1) {\n\n $FID = new DateTime($this->effective_date);\n $FID->modify('+1 months');\n $first_installment_date = $FID->format('Y-m-d ' . $time);\n\n\n $start = new DateTime($first_installment_date);\n $first_date = $start->format('Y-m-d ' . $time);\n\n $x = 0;\n $no_of_installments = 0;\n $total_installment_amount = 0;\n $ins_total = 0;\n $total_paid = 0;\n $od_amount_all_array = array();\n $od_array = array();\n $last_od = array();\n $od_total = array();\n $last_od_balance = array();\n $od_balance_amount = array();\n\n while ($x < $numOfInstallments) {\n if ($numOfInstallments == 4) {\n $modify_range = '+7 day';\n } elseif ($numOfInstallments == 30) {\n $modify_range = '+1 day';\n } elseif ($numOfInstallments == 8) {\n $modify_range = '+7 day';\n } elseif ($numOfInstallments == 60) {\n $modify_range = '+1 day';\n } elseif ($numOfInstallments == 2) {\n $modify_range = '+1 months';\n } elseif ($numOfInstallments == 1) {\n $modify_range = '+1 months';\n } elseif ($numOfInstallments == 90) {\n $modify_range = '+1 day';\n } elseif ($numOfInstallments == 12) {\n $modify_range = '+7 day';\n } elseif ($numOfInstallments == 3) {\n $modify_range = '+1 months';\n } elseif ($numOfInstallments == 100) {\n $modify_range = '+1 day';\n } elseif ($numOfInstallments == 13) {\n $modify_range = '+7 day';\n }\n\n $date = $start->format('Y-m-d ' . $time);\n\n $paid_amount = 0;\n $od_amount = 0;\n $od_amount_all = 0;\n $balance = 0;\n $loan_proccesign_fee_paid = 0;\n $total_od_paid = 0;\n $paid_all_amount_before_ins_date = 0;\n $paid_all_od_before_ins_date = 0;\n\n $customer = $this->customer;\n $CUSTOMER = new Customer($customer);\n $route = $CUSTOMER->route;\n $center = $CUSTOMER->center;\n $installment_amount = $this->installment_amount;\n\n $FID = new DateTime($date);\n $FID->modify($modify_range);\n $day_remove = '-1 day';\n $FID->modify($day_remove);\n $second_installment_date = $FID->format('Y-m-d ' . $time);\n $amount = $this->installment_amount;\n\n $INSTALLMENT = new Installment(NULL);\n $ALl_AMOUNT = $INSTALLMENT->getAmountByLoanId($this->id);\n\n foreach ($INSTALLMENT->CheckInstallmetByPaidDate($date, $this->id) as $paid) {\n $paid_amount += $paid['paid_amount'];\n }\n\n $before_payment_amounts = $INSTALLMENT->getPaidAmountByBeforeDate($date, $this->id);\n\n foreach ($before_payment_amounts as $before_payment_amount) {\n $paid_all_amount_before_ins_date += $before_payment_amount['paid_amount'];\n $paid_all_od_before_ins_date += $before_payment_amount['additional_interest'];\n }\n\n if (PostponeDate::CheckIsPostPoneByDateAndCustomer($date, $customer) || PostponeDate::CheckIsPostPoneByDateAndRoute($date, $route) || PostponeDate::CheckIsPostPoneByDateAndCenter($date, $center) || PostponeDate::CheckIsPostPoneByDateAndAll($date) || PostponeDate::CheckIsPostPoneByDateCenterAll($date) || PostponeDate::CheckIsPostPoneByDateRouteAll($date)) {\n $start->modify($modify_range);\n } else {\n\n $last_od_amount = (float) end($od_amount_all_array);\n $ins_total += $amount;\n $total_paid += $paid_amount;\n\n $balance = $paid_all_od_before_ins_date + $paid_all_amount_before_ins_date - $ins_total - $last_od_amount;\n\n $OD = new OD(NULL);\n $OD->loan = $this->id;\n $od = $OD->allOdByLoanAndDate($date, $balance);\n\n if (PostponeDate::CheckIsPostPoneByDateAndCustomer($date, $customer) || PostponeDate::CheckIsPostPoneByDateAndRoute($date, $route) || PostponeDate::CheckIsPostPoneByDateAndCenter($date, $center) || PostponeDate::CheckIsPostPoneByDateAndAll($date) || PostponeDate::CheckIsPostPoneByDateCenterAll($date) || PostponeDate::CheckIsPostPoneByDateRouteAll($date) || $ALl_AMOUNT[0] >= $ins_total) {\n \n } else {\n if ($od !== false) {\n $y = 0;\n //get how many dates in month\n $dateValue = strtotime($date);\n $year = date(\"Y\", $dateValue);\n $month = date(\"m\", $dateValue);\n\n $daysOfMonth = cal_days_in_month(CAL_GREGORIAN, $month, $year);\n\n $od_date_start = new DateTime($date);\n $defult_val = $daysOfMonth - 1;\n $od_interest = $this->getOdIntereset(-$ins_total + $paid_all_amount_before_ins_date, $od['od_interest_limit']);\n\n while ($y <= $defult_val) {\n\n if ($defult_val <= $daysOfMonth - 1 && $this->od_date <= $od_date_start) {\n $od_dates = '+1 day';\n }\n\n $od_date = $od_date_start->format('Y-m-d');\n\n\n if (strtotime($date) >= strtotime($selectedDate) || strtotime($od_date) >= strtotime($selectedDate)) {\n break;\n }\n $ODDATES = new DateTime($od_date);\n $ODDATES->modify($od_dates);\n\n $od_date_remove = '-1 day -23 hours -59 minutes -58 seconds';\n\n $ODDATES->modify($od_date_remove);\n\n $od_night = $ODDATES->format('Y-m-d H:i:s');\n\n $od_array[] = $od_interest;\n $od_amount_all = json_encode(round(array_sum($od_array), 2));\n\n array_push($od_amount_all_array, $od_amount_all);\n\n $od_date_start->modify($od_dates);\n $y++;\n }\n }\n }\n }\n\n if ($selectedDate . \" \" . $time == $date) {\n $total_installment_amount += $installment_amount;\n if (strtotime(date(\"Y/m/d\")) < strtotime($date) || strtotime($selectedDate) < strtotime($date)) {\n break;\n }\n } else {\n if (strtotime(date(\"Y/m/d\")) < strtotime($date) || strtotime($selectedDate) < strtotime($date)) {\n break;\n }\n $total_installment_amount += $installment_amount;\n }\n\n $start->modify($modify_range);\n $x++;\n\n if ($numOfInstallments == $x) {\n\n //get installment end date\n $INSTALLMENT_END = new DateTime($date);\n $INSTALLMENT_END->modify('+' . $daysOfMonth . ' day');\n $installment_end = $INSTALLMENT_END->format('Y-m-d H:i:s');\n\n //get 5 years ahead date from installment end date\n $INSTALLMENT_UNLIMITED_END = new DateTime($date);\n $INSTALLMENT_UNLIMITED_END->modify('+1725 day');\n $installment_unlimited_end = $INSTALLMENT_UNLIMITED_END->format('Y-m-d H:i:s');\n\n\n $start = strtotime($date);\n $end = strtotime(date(\"Y/m/d\"));\n\n $days_between = floor(abs($end - $start) / 86400) - 1;\n\n $z = 0;\n\n $od_date_start1 = new DateTime($od_night);\n $od_date_start1->modify('+1 day +23 hours +59 minutes +58 seconds');\n\n $defult_val = $days_between;\n\n //if having od after installment end\n if ($od !== false) {\n\n $last_od_date = date('D/M/Y', strtotime($od_night));\n $last_installment_date = date('D/M/Y', strtotime($date));\n\n $od_amount_all_array_1 = array();\n while ($z <= $defult_val) {\n\n if ($od['od_date_start'] <= $od_date_start1) {\n $od_dates = '+1 day';\n }\n\n $od_date1 = $od_date_start1->format('Y-m-d');\n\n //getting brfore of date from current od date\n $OLDODDATE = new DateTime($od_date1);\n\n $od_date_remove1 = '-23 hours -59 minutes -58 seconds';\n\n $OLDODDATE->modify($od_date_remove1);\n\n $old_od_date = $OLDODDATE->format('Y-m-d H:i:s');\n if (strtotime($selectedDate) <= strtotime($old_od_date) || strtotime($od['od_date_end'] . $time) < strtotime($old_od_date)) {\n break;\n }\n $last_od_amount = (float) end($od_amount_all_array_1);\n\n $od_array[] = $od_interest;\n $od_amount_all = json_encode(round(array_sum($od_array), 2));\n\n if ($od_amount_all > 0 || $paid_all_od_before_ins_date == $last_od_amount) {\n\n array_push($od_amount_all_array_1, $od_amount_all);\n }\n\n $od_date_start1->modify($od_dates);\n $z++;\n }\n }\n }\n }\n }\n\n $last_od_amount_balance = $last_od_amount - $paid_aditional_interrest;\n\n if ($last_od_amount_balance > 0) {\n $last_od_amount_balance = $last_od_amount_balance;\n } else {\n $last_od_amount_balance = 0;\n }\n\n $all_arress = ($total_paid_installment) - ($total_installment_amount );\n $system_due = $loan_amount - $total_installment_amount;\n $system_due_num_of_ins = $system_due / $this->installment_amount;\n $actual_due_num_of_ins = $actual_due / $this->installment_amount;\n\n\n if ($this->installment_type == 4 || $this->installment_type == 1) {\n $actual_due = $all_arress + ($last_od_amount - $paid_aditional_interrest);\n }\n return [\n 'date' => $date,\n 'od_amount' => $last_od_amount_balance,\n 'all_arress' => $all_arress,\n 'all_amount' => $balance,\n 'system-due-num-of-ins' => $system_due_num_of_ins,\n 'system-due' => $system_due,\n 'actual-due-num-of-ins' => $actual_due_num_of_ins,\n 'actual-due' => $actual_due,\n 'receipt-num-of-ins' => $total_paid_installment / $this->installment_amount,\n 'receipt' => $total_paid_installment + $paid_aditional_interrest,\n 'arrears-excess-num-of-ins' => ($total_installment_amount - $total_paid_installment) / $this->installment_amount,\n 'arrears-excess' => $total_installment_amount - $total_paid_installment,\n 'installment_amount' => $amount,\n ];\n }", "public function testReport(){\n // $autoTaskTools->checkTask('AutoDaySessReport');\n // $date = array(\n // date_to_int('-',date('Y-m-01', strtotime('-1 month'))),\n // date_to_int('-',date('Y-m-t', strtotime('-1 month'))),\n // );\n\n $reportTools = new ReportTools();\n $reportTools->saveReportList('AutoDaySessReport');\n\n\n $BeginDate = date('Y-m-01', strtotime(date(\"Y-m-d\")));\n $date = array(\n date_to_int('-',$BeginDate),\n date_to_int('-',date('Y-m-d', strtotime(\"$BeginDate +1 month -1 day\"))),\n );\n $month = date('Y-m-01', strtotime('-1 month'));\n $month1 = date('Y-m-t', strtotime('-1 month'));\n dump($month);\n dump($month1);\n $mytime = date(\"Y-01-01\", strtotime(\"-1 year\"));\n dump($mytime);\n $monthEndDays = cal_days_in_month(CAL_GREGORIAN, 12, date(\"Y\", strtotime(\"-1 year\")));\n $year = date(\"Y-12-\".$monthEndDays, strtotime(\"-1 year\"));\n echo 'year:' . $year;\n $monthDays = cal_days_in_month(CAL_GREGORIAN, date('m',strtotime('-1 month')), date('Y'));\n dump($monthDays);\n echo 'n:' . date('n');\n $season = ceil((date('n'))/3)-1;\n echo '<br>上季度起始时间:<br>';\n echo date('Y-m-d H:i:s', mktime(0, 0, 0,$season*3-3+1,1,date('Y'))),\"\\n\";\n echo date('Y-m-d H:i:s', mktime(23,59,59,$season*3,date('t',mktime(0, 0 , 0,$season*3,1,date(\"Y\"))),date('Y'))),\"\\n\";\n //获取第几季度\n // $season = ceil((date('n'))/3);\n // echo date('m', mktime(0, 0, 0,$season*3-3+1,1,date('Y'))),\"\\n\";\n // echo date('Y-m-d', mktime(23,59,59,$season*3,date('t',mktime(0, 0 , 0,$season*3,1,date(\"Y\"))),date('Y'))),\"\\n\";\n dump($season);\n // $daySessReportTools = new DaySessReportTools();\n // $daySessReportTools->getDateList($date);\n // $daySessReportTools->daySessExcelGen($date);\n //\n // $dayErrorReportTools = new DayErrorReportTools();\n // $dayErrorReportTools->dayErrorExcelGen($date);\n // $daySessReportTools->getDateList($date);\n $str = stristr('DaySuccessReport_UID_2017-06-29.xlsx','_',true);\n dump($str);\n $this->display();\n }", "public static function getSalePerDay($i,$month,$year,$branch)\n {\n $str = $i. '-' . $month . '-' . $year;\n $date = date('Y-m-d', strtotime($str));\n $data = DB::table('month_sales')->where('branch_id', $branch)->where('_date', $date)->first();\n\n $with_receipt_total = 0;\n $with_out_receipt_total = 0;\n $credit_total = 0;\n $expense_total = 0;\n $return_total = 0;\n $total_amount = 0;\n $taken_total = 0;\n $deposit_total = 0;\n $is_check = 2;\n $coh = 0;\n\n\n $expense_string = '';\n $firstRec ='' ;\n $lastRec ='' ;\n\n $number_of_check = 0;\n\n if($data != null){\n $json_data = json_decode($data->data,TRUE);\n\n\n $rec_no = [];\n foreach ($json_data['with_receipt'] as $key => $val){\n $total =0;\n if($val['rec_amount'] == 'null'){\n $total= 0;\n }else{\n $total = $val['rec_amount'];\n }\n $with_receipt_total = $with_receipt_total + $total ;\n array_push($rec_no,$val['rec_no']);\n\n $number_of_check = $number_of_check + (isset($val['is_check']) ? 1 : 0 );\n }\n\n $firstRec = $rec_no[0];\n $lastRec = $rec_no[count($rec_no) - 1];\n\n foreach ($json_data['without_receipt'] as $key => $val){\n $total =0;\n if($val['amount'] == 'null'){\n $total= 0;\n }else{\n $total = $val['amount'];\n }\n $with_out_receipt_total = $with_out_receipt_total + $total ;\n }\n foreach ($json_data['credit'] as $key => $val){\n $total =0;\n if($val['amount'] == 'null'){\n $total= 0;\n }else{\n $total = $val['amount'];\n }\n $credit_total = $credit_total + $total ;\n }\n foreach ($json_data['expense'] as $key => $val){\n $total =0;\n if($val['amount'] == 'null'){\n $total= 0;\n }else{\n $total = $val['amount'];\n }\n $expense_total = $expense_total + $total ;\n\n $expense_string .= $val['details'].' ';\n\n }\n foreach ($json_data['return'] as $key => $val){\n $total =0;\n if($val['amount'] == 'null'){\n $total= 0;\n }else{\n $total = $val['amount'];\n }\n $return_total = $return_total + $total ;\n }\n\n\n $amount_1000 = ($json_data['amount_1000'] != null) ? json_decode($data->data,TRUE)['amount_1000'] * 1000 : 0;\n $amount_500 = ($json_data['amount_500'] != null) ? json_decode($data->data,TRUE)['amount_500'] * 500 : 0;\n $amount_100 = ($json_data['amount_100'] != null) ? json_decode($data->data,TRUE)['amount_100'] * 100 : 0;\n $amount_50 = ($json_data['amount_50'] != null) ? json_decode($data->data,TRUE)['amount_50'] * 50 : 0;\n $amount_20 = ($json_data['amount_20'] != null || json_decode($data->data,TRUE)['amount_20'] != '') ? json_decode($data->data,TRUE)['amount_20'] * 20 : 0;\n $amount_coins = ($json_data['amount_coins'] != null) ? json_decode($data->data,TRUE)['amount_coins'] : 0;\n $total_amount = $amount_1000 + $amount_500 + $amount_100 + $amount_50 +$amount_20+ $amount_coins;\n $is_check = (isset($json_data['is_check'])) ? json_decode($data->data,TRUE)['is_check'] : $is_check;\n $coh = (isset($json_data['coh'])) ? json_decode($data->data,TRUE)['coh'] : $coh;\n\n foreach (json_decode($data->data,TRUE)['taken'] as $key => $val){\n $total =0;\n if($val['amount'] == 'null'){\n $total= 0;\n }else{\n $total = $val['amount'];\n }\n $taken_total = $taken_total + $total ;\n }\n foreach (json_decode($data->data,TRUE)['deposit'] as $key => $val){\n $total =0;\n if($val['amount'] == 'null'){\n $total= 0;\n }else{\n $total = $val['amount'];\n }\n $deposit_total = $deposit_total + $total ;\n }\n\n }\n\n\n $_data =[\n 'with_receipt_total' =>$with_receipt_total,\n 'with_out_receipt_total' =>$with_out_receipt_total,\n 'credit_total' =>$credit_total,\n 'expense_total' =>$expense_total,\n 'return_total' =>$return_total,\n 'amount_total' =>$total_amount,\n 'taken_total' =>$taken_total,\n 'deposit_total' =>$deposit_total,\n 'data' =>($data != null) ? $data->data : '',\n 'date' =>$date,\n 'is_check'=>$is_check,\n 'coh'=>$coh,\n 'expense_details'=>$expense_string,\n 'rec_no'=>$firstRec.'-'.$lastRec,\n 'number_of_check' =>$number_of_check\n\n\n ];\n\n\n return json_encode($_data);\n\n }", "public function vbd_report_other_datewise()\n\t\t{\n\t\t\t$this->load->view('admin/header');\n\t\t\t$this->load->view('admin/nav');\n\t\t\t$data['get_state']=$this->Mod_report->get_state();\n\t\t\t$data['get_institute']=$this->Mod_report->get_institute();\n\t\t\t$this->load->view('reports/vbd_report_other_datewise',$data);\t\t\n\t\t\t$this->load->view('admin/footer');\t\n\n\t\t}", "public function overAllSummaryReportView(Request $request)\n {\n $from_date = trim($request->from); \n $from = date (\"Y-m-d\", strtotime($from_date));\n $explode = explode('-',$from);\n $from_year = $explode[0];\n $get_current_day = date(\"l\",strtotime($from));\n $current_year = date('Y');\n if($get_current_day =='Saturday'){\n $current_day = 1 ;\n }\n if($get_current_day =='Sunday'){\n $current_day = 2 ;\n }\n if($get_current_day =='Monday'){\n $current_day = 3 ;\n }\n if($get_current_day =='Tuesday'){\n $current_day = 4 ;\n }\n if($get_current_day =='Wednesday'){\n $current_day = 5 ;\n }\n if($get_current_day =='Thursday'){\n $current_day = 6 ;\n }\n if($get_current_day =='Friday'){\n $current_day = 7 ;\n }\n if($from > $this->rcdate1){\n echo 'f1';\n exit();\n }\n // get door holiday\n $holiday_count = DB::table('holiday')->where('door_holiday',0)->where('holiday_date',$from)->count();\n if($holiday_count > 0){\n echo 'f2';\n exit();\n }\n if($from_year != $current_year){\n echo 'f3';\n exit();\n }\n // attendent holiday count\n $attendent_holiday_count = DB::table('holiday')->where('attendent_holiday',0)->where('holiday_date',$from)->count();\n // total staff\n $total_staff_count = DB::table('users')->where('trasfer_status',0)->whereNotIn('type',[10])->count();\n // total teacher count \n $total_teacher_count = DB::table('users')->where('trasfer_status',0)->where('type',3)->count();\n // total staff enter into the campus\n $total_staff_enter_into_campus = DB::table('tbl_door_log')->where('type',1)->whereNotIn('user_type',[10])->where('enter_date',$from)->distinct('user_id')->count('user_id');\n\n // total staff leave\n $total_staff_leave_count = DB::table('tbl_leave')->where('final_request_from',$from)->where('status',1)->count();\n $total_teacher_leave_count = DB::table('tbl_leave')\n ->join('users', 'users.id', '=', 'tbl_leave.user_id')\n ->select('tbl_leave.*')\n ->where('users.type', 3)\n ->where('final_request_from',$from)\n ->where('status',1)\n ->count();\n $total_teacher_attendent_in_class = DB::table('teacher_attendent')->where('created_at',$from)->where('status',1)->where('type',3)->distinct('teacherId')->count('teacherId');\n // total class of this day\n $total_class_count = DB::table('routine')\n ->join('semister', 'routine.semister_id', '=', 'semister.id')\n ->select('routine.*')\n ->where('routine.year', $from_year)\n ->where('routine.day', $current_day)\n ->where('semister.status',1)\n ->count();\n\n // total teacher attendent class\n $teacher_taken_total_class_class = DB::table('teacher_attendent')->where('created_at',$from)->where('status',1)->where('type',3)->count();\n #--------------------------------- student section------------------------------------#\n $total_student_count = DB::table('student')\n ->join('semister', 'student.semister_id', '=', 'semister.id')\n ->select('student.*')\n ->where('student.year', $from_year)\n ->where('student.status', 0)\n ->where('semister.status',1)\n ->count();\n $total_student_enter_into_campus = DB::table('tbl_door_log')->where('type',2)->where('enter_date',$from)->distinct('student_id')->count('student_id');\n $total_student_enter_into_class = DB::table('student_attendent')->where('created_at',$from)->distinct('studentId')->count('studentId');\n // total hours class of this day\n $total_class_hour_in_routine = DB::table('routine')\n ->join('semister', 'routine.semister_id', '=', 'semister.id')\n ->select('routine.*')\n ->where('routine.year', $from_year)\n ->where('routine.day', $current_day)\n ->where('semister.status',1)\n ->get();\n // total hours class held\n $total_hours_class_held_query = DB::table('teacher_attendent')->where('created_at',$from)->where('status',1)->where('type',3)->get(); \n\n return view('view_report.overAllSummaryReportView')\n ->with('total_staff_count',$total_staff_count)\n ->with('total_teacher_count',$total_teacher_count)\n ->with('total_staff_enter_into_campus',$total_staff_enter_into_campus)\n ->with('total_staff_leave_count',$total_staff_leave_count)\n ->with('total_teacher_leave_count',$total_teacher_leave_count)\n ->with('total_teacher_attendent_in_class',$total_teacher_attendent_in_class)\n ->with('total_class_count',$total_class_count)\n ->with('teacher_taken_total_class_class',$teacher_taken_total_class_class)\n ->with('from',$from)\n ->with('attendent_holiday_count',$attendent_holiday_count)\n ->with('total_student_count',$total_student_count)\n ->with('total_student_enter_into_campus',$total_student_enter_into_campus)\n ->with('total_student_enter_into_class',$total_student_enter_into_class)\n ->with('total_class_hour_in_routine',$total_class_hour_in_routine)\n ->with('total_hours_class_held_query',$total_hours_class_held_query)\n ;\n }", "public function getReportedDate();", "public function expired_report()\n{\n\t$expiration_date=Input::get('expiration_date');\n\tif($expiration_date=='')\n\t{\n\t\t$fecha = date('Y-m-j');\n\t\t$nuevafecha = strtotime ( '+3 month' , strtotime ( $fecha ) ) ;\n\t\t$nuevafecha = date ( 'Y-m-j' , $nuevafecha );\n\t\t$data_items=Item::join('bodega_productos','items.id','=', 'bodega_productos.id_product')\n\t\t->where('items.expiration_date','>',$nuevafecha)\n\t\t->select('items.id'\n\t\t,'items.item_name'\n\t\t,'items.selling_price'\n\t\t,'items.cost_price'\n\t\t,'items.minimal_existence'\n\t\t,'bodega_productos.quantity'\n\t\t,'items.expiration_date')\n\t\t->get();\n\t\t//cambiamos el formato de la fecha\n\t\t$array_Fecha= explode('-',$nuevafecha);\n\t\t$fecha_formateada=$array_Fecha[2].'/'.$array_Fecha[1].'/'.$array_Fecha[0];\n\t\treturn view('report.listProduct_expirate')->with('data_items',$data_items)->with('date_parameters',$fecha_formateada);\n\t}\n\telse\n\t{\n\t\t$date = explode('/', $expiration_date);\n\t\t$ndate = $date[2].'-'.$date[1].'-'.$date[0];\n\t\t$data_items=Item::join('bodega_productos','items.id','=', 'bodega_productos.id_product')\n\t\t->where('items.expiration_date','>',$ndate)\n\t\t->select('items.id'\n\t\t,'items.item_name'\n\t\t,'items.selling_price'\n\t\t,'items.cost_price'\n\t\t,'items.minimal_existence'\n\t\t,'bodega_productos.quantity'\n\t\t,'items.expiration_date')\n\t\t->get();\n\t\treturn view('report.listProduct_expirate')->with('data_items',$data_items)\n\t\t->with('date_parameters',$expiration_date);\n\t}\n\n}", "public function cusreports()\n {\n //\n \t\n\t\t$start_date = Input::get('start_date');\n\t\t$end_date = Input::get('end_date');\n\t\t$rintrest = Input::get('return_intrest');\n\t\t$infound = Input::get('intrests_found');\n\t\t\n\t\tif($rintrest==1){\n\t\t\tif($infound==1){\n\t $loggeduser=$loggeduser=\\App::make('authenticator')->getLoggedUser(); \n if(array_key_exists('_branch',$loggeduser->permissions)){\n \t $intrests=t_interestdetail::where('user_id',$loggeduser->id)\n\t ->where('planinterest_date','>',$start_date)\n\t ->where('planinterest_date','<=',$end_date)->get();\n\t\t\t}\n\t\t\telse{\n\t\t\t $intrests=t_interestdetail::where('planinterest_date','>',$start_date)\n\t ->where('planinterest_date','<=',$end_date)->get();\n\t\t\t\n\t\t\t}\n\t\t\t}\n\t\t\telseif($infound==2){\n\t\t\t\t $loggeduser=$loggeduser=\\App::make('authenticator')->getLoggedUser(); \n if(array_key_exists('_branch',$loggeduser->permissions)){\n \t $intrests=t_interestdetail::where('user_id',$loggeduser->id)\n\t ->where('planinterest_date','>',$start_date)\n\t ->where('planinterest_date','<=',$end_date)\n\t\t\t\t\t\t\t\t\t ->where('principal_money','=',0)\n\t ->get();\n\t\t\t}\n\t\t\telse{\n\t\t\t $intrests=t_interestdetail::where('planinterest_date','>',$start_date)\n\t\t\t ->where('principal_money','=',0)\n\t ->where('planinterest_date','<=',$end_date)->get();\n\t\t\t\n\t\t\t}\n\t\t\t}\t\t\n\t\t else{\n\t\t\t\t $loggeduser=$loggeduser=\\App::make('authenticator')->getLoggedUser(); \n if(array_key_exists('_branch',$loggeduser->permissions)){\n \t $intrests=t_interestdetail::where('user_id',$loggeduser->id)\n\t ->where('planinterest_date','>',$start_date)\n\t\t\t\t\t\t\t\t\t ->where('principal_money','<>',0)\n\t ->where('planinterest_date','<=',$end_date)->get();\n\t\t\t}\n\t\t\telse{\n\t\t\t $intrests=t_interestdetail::where('planinterest_date','>',$start_date)\n\t\t\t ->where('principal_money','<>',0)\n\t ->where('planinterest_date','<=',$end_date)->get();\n\t\t\t\n\t\t\t}\n\t\t\t}\t\t\n\t\t}\t\nelseif($rintrest==2){\n\t\t\tif($infound==1){\n\t $loggeduser=$loggeduser=\\App::make('authenticator')->getLoggedUser(); \n if(array_key_exists('_branch',$loggeduser->permissions)){\n \t $intrests=t_interestdetail::where('user_id',$loggeduser->id)\n\t ->where('planinterest_date','>',$start_date)\n\t\t\t\t\t\t\t\t\t->where('have_intrests','=',1)\n\t ->where('planinterest_date','<=',$end_date)->get();\n\t\t\t}\n\t\t\telse{\n\t\t\t $intrests=t_interestdetail::where('planinterest_date','>',$start_date)\n\t\t\t ->where('have_intrests','=',1)\n\t ->where('planinterest_date','<=',$end_date)->get();\n\t\t\t\n\t\t\t}\n\t\t\t}\n\t\t\telseif($infound==2){\n\t\t\t\t $loggeduser=$loggeduser=\\App::make('authenticator')->getLoggedUser(); \n if(array_key_exists('_branch',$loggeduser->permissions)){\n \t $intrests=t_interestdetail::where('user_id',$loggeduser->id)\n\t ->where('planinterest_date','>',$start_date)\n\t ->where('planinterest_date','<=',$end_date)\n\t\t\t\t\t\t\t\t\t ->where('principal_money','=',0)\n\t\t\t\t\t\t\t\t\t ->where('have_intrests','=',1)\n\t ->get();\n\t\t\t}\n\t\t\telse{\n\t\t\t $intrests=t_interestdetail::where('planinterest_date','>',$start_date)\n\t\t\t ->where('principal_money','=',0)\n\t\t\t\t\t\t\t\t\t->where('have_intrests','=',1)\n\t ->where('planinterest_date','<=',$end_date)->get();\n\t\t\t\n\t\t\t}\n\t\t\t}\t\t\n\t\t else{\n\t\t\t\t $loggeduser=$loggeduser=\\App::make('authenticator')->getLoggedUser(); \n if(array_key_exists('_branch',$loggeduser->permissions)){\n \t $intrests=t_interestdetail::where('user_id',$loggeduser->id)\n\t ->where('planinterest_date','>',$start_date)\n\t\t\t\t\t\t\t\t\t ->where('principal_money','<>',0)\n\t\t\t\t\t\t\t\t\t ->where('have_intrests','=',1)\n\t ->where('planinterest_date','<=',$end_date)->get();\n\t\t\t}\n\t\t\telse{\n\t\t\t $intrests=t_interestdetail::where('planinterest_date','>',$start_date)\n\t\t\t ->where('principal_money','<>',0)\n\t\t\t ->where('have_intrests','=',1)\n\t ->where('planinterest_date','<=',$end_date)->get();\n\t\t\t\n\t\t\t}\n\t\t\t}\t\t\n\t\t}\t\t\t\nelse{\n\t\t\tif($infound==1){\n\t $loggeduser=$loggeduser=\\App::make('authenticator')->getLoggedUser(); \n if(array_key_exists('_branch',$loggeduser->permissions)){\n \t $intrests=t_interestdetail::where('user_id',$loggeduser->id)\n\t ->where('planinterest_date','>',$start_date)\n\t\t\t\t\t\t\t\t\t->where('have_intrests','=',0)\n\t ->where('planinterest_date','<=',$end_date)->get();\n\t\t\t}\n\t\t\telse{\n\t\t\t $intrests=t_interestdetail::where('planinterest_date','>',$start_date)\n\t\t\t ->where('have_intrests','=',0)\n\t ->where('planinterest_date','<=',$end_date)->get();\n\t\t\t\n\t\t\t}\n\t\t\t}\n\t\t\telseif($infound==2){\n\t\t\t\t $loggeduser=$loggeduser=\\App::make('authenticator')->getLoggedUser(); \n if(array_key_exists('_branch',$loggeduser->permissions)){\n \t $intrests=t_interestdetail::where('user_id',$loggeduser->id)\n\t ->where('planinterest_date','>',$start_date)\n\t ->where('planinterest_date','<=',$end_date)\n\t\t\t\t\t\t\t\t\t ->where('principal_money','=',0)\n\t\t\t\t\t\t\t\t\t ->where('have_intrests','=',0)\n\t ->get();\n\t\t\t}\n\t\t\telse{\n\t\t\t $intrests=t_interestdetail::where('planinterest_date','>',$start_date)\n\t\t\t ->where('principal_money','=',0)\n\t\t\t\t\t\t\t\t\t->where('have_intrests','=',0)\n\t ->where('planinterest_date','<=',$end_date)->get();\n\t\t\t\n\t\t\t}\n\t\t\t}\t\t\n\t\t else{\n\t\t\t\t $loggeduser=$loggeduser=\\App::make('authenticator')->getLoggedUser(); \n if(array_key_exists('_branch',$loggeduser->permissions)){\n \t $intrests=t_interestdetail::where('user_id',$loggeduser->id)\n\t ->where('planinterest_date','>',$start_date)\n\t\t\t\t\t\t\t\t\t ->where('principal_money','<>',0)\n\t\t\t\t\t\t\t\t\t ->where('have_intrests','=',0)\n\t ->where('planinterest_date','<=',$end_date)->get();\n\t\t\t}\n\t\t\telse{\n\t\t\t $intrests=t_interestdetail::where('planinterest_date','>',$start_date)\n\t\t\t ->where('principal_money','<>',0)\n\t\t\t ->where('have_intrests','=',0)\n\t ->where('planinterest_date','<=',$end_date)->get();\n\t\t\t\n\t\t\t}\n\t\t\t}\t\t\n\t\t}\t\t\t\t\t\t\t\n\t if($intrests->count())\n\t {\n\t \t $timerange=\"本时间段\";\n\t \t$filename=$intrests->first()->id . time();\n\t \\Excel::create($filename, function($excel) use ($intrests,$timerange) {\n $excel->sheet('New sheet', function($sheet) use ($intrests,$timerange) {\n $sheet->loadView('cusreports')\n\t\t\t ->withTimerange($timerange) \n ->withIntrests($intrests) ;\n\n });\n\n })->download('xls'); \n\t\t }\n\t else {\n\t\t\t\n\t\t\treturn Redirect::back()->withInput()->withErrors('本时间段无分红明细');\n\t }\n\t \n\t \n }", "public function product_wise_report()\n\t{\n\t\t$today = date('m-d-Y');\n\t\t$this->db->select(\"a.*,b.customer_id,b.customer_name\");\n\t\t$this->db->from('invoice a');\n\t\t$this->db->join('customer_information b','b.customer_id = a.customer_id');\n\t\t$this->db->where('a.date',$today);\n\t\t$this->db->order_by('a.invoice_id','desc');\n\t\t$this->db->limit('500');\n\t\t$query = $this->db->get();\t\n\t\treturn $query->result_array();\n\t}", "function export_pnh_sales_report()\r\n\t {\r\n\t \t\r\n\t \t$this->erpm->auth(PNH_EXECUTIVE_ROLE|FINANCE_ROLE);\r\n\t \t\r\n\t \t//ssql to generate franchise list \r\n\t \t$sql_f = \"select pnh_franchise_id,franchise_id,login_mobile1,login_mobile2,franchise_name,b.territory_name,c.town_name \r\n\t \t\t\t\t\t\tfrom pnh_m_franchise_info a \r\n\t \t\t\t\t\t\tjoin pnh_m_territory_info b on a.territory_id = b.id\r\n\t \t\t\t\t\t\tjoin pnh_towns c on c.id = a.town_id \r\n\t \t\t\t\t\t\torder by territory_name,town_name,franchise_name\";\r\n\t \t$res_f = $this->db->query($sql_f);\r\n\t \t\r\n\t \t$fr_sales_list = array();\r\n\t \t$fr_sales_list[] = '';\r\n\t \t$fr_sales_list[] = '\"Paynearhome Franchise Sales Summary Till - '.date('d/m/Y h:i a').'\"';\r\n\t \t$fr_sales_list[] = '';\r\n\t \t$fr_sales_list[] = '';\r\n\t \t$fr_sales_list[] = '\"Slno\",\"Territory\",\"Town\",\"Status\",\"FranciseID\",\"FranchiseName\",\"Contact no\",\"Ordered\",\"Shipped\",\"Invoiced Not Shipped\",\"Cancelled\",\"Paid Till Date\",\"UnCleared\",\"Corrections\",\"Credit Notes Raised\",\"Pending Payment\",\" Before 3 Days\",\"Before 5 Days\",\"Before 7 Day\",\"Before 10 Day\"';\r\n\t \t\r\n\t \t\r\n\t \tif($res_f->num_rows())\r\n\t \t{\r\n\t \t\t$i=0;\r\n\t \t\t// loop through all franchises \r\n\t \t\tforeach($res_f->result_array() as $row_f)\r\n\t \t\t{\r\n\t \t\t\t\r\n\t \t\t\t$fr_sales_det = array();\r\n\t \t\t\t$fr_sales_det[] = ++$i;\r\n\t\t\t\t$fr_sales_det[] = $row_f['territory_name'];\r\n\t\t\t\t$fr_sales_det[] = $row_f['town_name'];\r\n\t \t\t\t$fr_sales_det[] = $row_f['is_suspended']?'Suspended':'Active';\r\n\t\t\t\t$fr_sales_det[] = $row_f['pnh_franchise_id'];\r\n\t \t\t\t$fr_sales_det[] = ucwords($row_f['franchise_name']);\r\n\t \t\t\t\r\n\t\t\t\t$cnos = array($row_f['login_mobile1'],$row_f['login_mobile2']);\r\n\t \t\t\t$fr_sales_det[] = implode('/',array_filter($cnos));\r\n\t\t\t\t\r\n\t \t\t\t// get franchise total sales \r\n\t \t\t\t$ordered_tilldate = @$this->db->query(\"select round(sum((i_orgprice-(i_coup_discount+i_discount))*b.quantity),2) as amt \r\n\t\t\t\t\t\t\t\t\tfrom king_transactions a \r\n\t\t\t\t\t\t\t\t\tjoin king_orders b on a.transid = b.transid \r\n\t\t\t\t\t\t\t\t join pnh_m_franchise_info c on c.franchise_id = a.franchise_id \r\n\t\t\t\t\t\t\t\t\twhere a.franchise_id = ? \",$row_f['franchise_id'])->row()->amt*1;\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t$cancelled_tilldate = @$this->db->query(\"select round(sum((i_orgprice-(i_coup_discount+i_discount))*b.quantity),2) as amt \r\n\t\t\t\t\t\t\t\t\tfrom king_transactions a \r\n\t\t\t\t\t\t\t\t\tjoin king_orders b on a.transid = b.transid \r\n\t\t\t\t\t\t\t\t join pnh_m_franchise_info c on c.franchise_id = a.franchise_id \r\n\t\t\t\t\t\t\t\t\twhere a.franchise_id = ? and b.status = 3 \",$row_f['franchise_id'])->row()->amt*1;\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t$shipped_tilldate = @$this->db->query(\"SELECT round(sum((i_orgprice-(i_coup_discount+i_discount))*b.quantity),2) as amt \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM king_transactions a\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tJOIN king_orders b ON a.transid = b.transid\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tJOIN pnh_m_franchise_info c ON c.franchise_id = a.franchise_id\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tJOIN king_invoice d ON d.order_id = b.id\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tJOIN shipment_batch_process_invoice_link e ON e.invoice_no = d.invoice_no\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAND e.shipped =1 AND e.packed =1\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE a.franchise_id = ? AND d.invoice_status = 1 and b.status != 0 \r\n\t\t\t\t\t\t\t\t\t\t \",$row_f['franchise_id'])->row()->amt*1;\r\n\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t$sql = \"select sum(debit_amt-credit_amt) as amt \r\n\t\t\t\t\t\t\tfrom pnh_franchise_account_summary where action_type = 1 and franchise_id = ? \";\r\n\t\t\t\t$active_invoiced = $this->db->query($sql,array($row_f['franchise_id']))->row()->amt*1;\t\t\t\t\t\t \r\n\t\t\t\t\r\n\t\t\t\t// invoiced not shipped \r\n\t\t\t\t$not_shipped_amount = $this->db->query(\" select sum(t) as amt from (\r\n\t\t\t\t\t\t\t\t\t\t\tselect a.invoice_no,debit_amt as t \r\n\t\t\t\t\t\t\t\t\t\t\t\tfrom pnh_franchise_account_summary a \r\n\t\t\t\t\t\t\t\t\t\t\t\tjoin king_invoice c on c.invoice_no = a.invoice_no and invoice_status = 1 \r\n\t\t\t\t\t\t\t\t\t\t\t\twhere action_type = 1 \r\n\t\t\t\t\t\t\t\t\t\t\t\tand franchise_id = ? \r\n\t\t\t\t\t\t\t\t\t\t\tgroup by a.invoice_no ) as a \r\n\t\t\t\t\t\t\t\t\t\t\tjoin shipment_batch_process_invoice_link b on a.invoice_no = b.invoice_no and shipped = 0 \",$row_f['franchise_id'])->row()->amt*1;\r\n\t\t\t\t\r\n\t\t\t\t$shipped_tilldate = $active_invoiced-$not_shipped_amount;\t\t\t \r\n\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t//$cancelled_tilldate = $ordered_tilldate-$shipped_tilldate-$not_shipped_amount;\r\n\t\t\t\t\r\n\t\t\t\t$paid_tilldate = @$this->db->query(\"select sum(receipt_amount) as amt from pnh_t_receipt_info where receipt_type = 1 and status = 1 and franchise_id = ? \",$row_f['franchise_id'])->row()->amt*1;\r\n\t\t\t\t\r\n\t\t\t\t$sql = \"select sum(credit_amt-debit_amt) as amt \r\n\t\t\t\t\t\t\tfrom pnh_franchise_account_summary where action_type = 5 and franchise_id = ? \";\r\n\t\t\t\t$acc_adjustments_val = $this->db->query($sql,array($row_f['franchise_id']))->row()->amt*1;\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t$sql = \"select sum(credit_amt-debit_amt) as amt \r\n\t\t\t\t\t\t\tfrom pnh_franchise_account_summary where action_type = 7 and franchise_id = ? \";\r\n\t\t\t\t$ttl_credit_note_val = $this->db->query($sql,array($row_f['franchise_id']))->row()->amt;\r\n\t\t\t\t\r\n\t\t\t\t$uncleared_payment = @$this->db->query(\"select sum(receipt_amount) as amt from pnh_t_receipt_info where status = 0 and franchise_id = ? and receipt_type = 1 \",$row_f['franchise_id'])->row()->amt*1;\r\n\t\t\t\t\r\n\t\t\t\t$fr_sales_det[] = $ordered_tilldate;\r\n\t\t\t\t$fr_sales_det[] = $shipped_tilldate;\r\n\t\t\t\t$fr_sales_det[] = $not_shipped_amount;\r\n\t\t\t\t$fr_sales_det[] = $cancelled_tilldate;\r\n\t\t\t\t$fr_sales_det[] = $paid_tilldate;\r\n\t\t\t\t$fr_sales_det[] = $uncleared_payment;\r\n\t\t\t\t$fr_sales_det[] = $acc_adjustments_val;\r\n\t\t\t\t$fr_sales_det[] = $ttl_credit_note_val;\r\n\t\t\t\t$fr_sales_det[] = $shipped_tilldate-($paid_tilldate+$acc_adjustments_val+$ttl_credit_note_val);\r\n\t\t\t\t\r\n\t\t\t\t$past_sales_summ = array(3,5,7,10);\r\n\t\t\t\t\r\n\t\t\t\tforeach($past_sales_summ as $k)\r\n\t\t\t\t{\r\n\t\t\t\t\t$cond = ' and date(e.shipped_on) < date_add(curdate(),INTERVAL -'.$k.' day) ';\r\n\t\t\t\t\t$cond_pay = ' and date(from_unixtime(activated_on)) < date_add(curdate(),INTERVAL -'.$k.' day) ';\r\n\t\t\t\t\t\r\n\t\t\t\t\t$shipped_tilldate_byday = @$this->db->query(\"SELECT round(sum((i_orgprice-(i_coup_discount+i_discount))*b.quantity),2) as amt \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM king_transactions a\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tJOIN king_orders b ON a.transid = b.transid\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tJOIN pnh_m_franchise_info c ON c.franchise_id = a.franchise_id\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tJOIN king_invoice d ON d.order_id = b.id\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tJOIN shipment_batch_process_invoice_link e ON e.invoice_no = d.invoice_no\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAND e.shipped =1 AND e.packed = 1 \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE a.franchise_id = ? AND d.invoice_status = 1 and b.status != 0 $cond \r\n\t\t\t\t\t\t\t\t\t\t\t \",$row_f['franchise_id'])->row()->amt*1;\r\n\t\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t$paid_tilldate_byday = @$this->db->query(\"select sum(receipt_amount) as amt from pnh_t_receipt_info where receipt_type = 1 and status = 1 and franchise_id = ? \",$row_f['franchise_id'])->row()->amt*1;\r\n\t\t\t\t\t\r\n\t\t\t\t\t$pen_pay_byday = ($shipped_tilldate_byday-($paid_tilldate_byday+$acc_adjustments_val+$ttl_credit_note_val));\r\n\r\n\t\t\t\t\t$fr_sales_det[] = ($pen_pay_byday>0)?$pen_pay_byday:0;\r\n\t\t\t\t\t\r\n\t\t\t\t}\t\t\t\t\t\t \r\n\t\t\t\t\r\n\t\t\t\t$fr_sales_list[] = '\"'.implode('\",\"',$fr_sales_det).'\"';\r\n\t \t\t}\r\n\t \t} \r\n\t \t\r\n\t \theader('Content-Type: application/csv');\r\n\t\theader('Content-Disposition: attachment; filename=PNH_SALES_REPORT_'.date('d_m_Y_H_i').'.csv');\r\n\t\theader('Pragma: no-cache');\r\n\r\n\t \techo implode(\"\\r\\n\",$fr_sales_list);\r\n\t \t\r\n\t }", "public function product_wise_report()\n\t{\n\t\t$today = date('Y-m-d');\n\t\t$this->db->select(\"a.*,b.customer_id,b.customer_name\");\n\t\t$this->db->from('invoice a');\n\t\t$this->db->join('customer_information b','b.customer_id = a.customer_id');\n\t\t$this->db->where('a.date',$today);\n\t\t$this->db->order_by('a.invoice_id','desc');\n\t\t$this->db->limit('500');\n\t\t$query = $this->db->get();\t\n\t\treturn $query->result_array();\n\t}", "function sales_report_day($date){\n \t\t$this->db->select('products.PRODUCT, SUM(sales.QUANTITY_SOLD) SALES, products.COST_PRICE, products.SALES_PRICE, sales.SALES_DATE');\n \t\t$this->db->from('sales');\n \t\t$this->db->join('products', 'products.PRODUCT_ID=sales.PRODUCT_ID', 'left');\n \t\t$this->db->where('sales.SALES_DATE', $date);\n \t\t$this->db->where('sales.STATUS', 'Confirmed');\n \t\t$this->db->group_by('sales.PRODUCT_ID');\n \t\t$query=$this->db->get();\n \t\tif($query->num_rows()>0){\n \t\t\treturn $query->result();\n \t\t}\n \t\telse{\n \t\t\treturn false;\n \t\t}\n \t}", "function quantizer_expenses_user_report($user = null, $start_date= null, $end_date = null)\r\n\t\t{\r\n\t\t\t// ya que sino daria un error al generar el pdf.\r\n\t\t\tConfigure::write('debug',0);\r\n\r\n\t\t\t$resultado = $this->calculateQuantizerUsersExpenses($user, $start_date, $end_date);\r\n\t\t\t\r\n\t\t\t$resultado['Details']['start_date'] = $this->RequestAction('/external_functions/setDate/'.$start_date);\r\n\t\t\t$resultado['Details']['end_date'] = $this->RequestAction('/external_functions/setDate/'.$end_date);\r\n\t\t\t$resultado['Details']['date_today'] = date('d-m-Y H:i:s');\r\n\t\t\t\r\n\t\t\t$user = $this->RequestAction('/external_functions/getDataSession');\r\n\t\t\t\r\n\t\t\t$resultado['Details']['generated_by'] = $user['User']['name'].' '.$user['User']['first_lastname'];\r\n\r\n\t\t\t$this->set('data', $resultado);\r\n\t\t\t$this->layout = 'pdf';\r\n\t\t\t$this->render();\r\n\t\t}", "public function dailyReport()\n {\n return view('backend.invoice.daily-invoice-report');\n }" ]
[ "0.67331916", "0.66458374", "0.65866214", "0.64653", "0.6350249", "0.63116544", "0.62193227", "0.62185943", "0.6195381", "0.61095643", "0.6077952", "0.6049646", "0.60457355", "0.6018501", "0.5996672", "0.5992983", "0.59608483", "0.5937871", "0.59226084", "0.59129715", "0.5895059", "0.589356", "0.58862233", "0.5881569", "0.5815979", "0.58107954", "0.58100766", "0.5807674", "0.58071375", "0.57977074" ]
0.66466373
1
The annual rate that is charged for borrowing (or made by investing), expressed as a single percentage number that represents the actual yearly cost of funds over the term of a loan. This includes any fees or additional costs associated with the transaction.
public function annualPercentageRate($value) { $this->setProperty('annualPercentageRate', $value); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAnnualPrice(): float\n {\n $ratio = $this->getMonths() / 12;\n return $this->getPrice() / $ratio;\n }", "function it_returns_one_percent_for_one_payment_one_year_after_the_advance()\n {\n $this->addPayment(101, 365);\n\n $this->calculate()->shouldReturn(1.0);\n }", "public function getAmountAsPercentage();", "function getInterestFactor($interest)\n{\n $rate = $interest / 365.25;\n return $rate;\n}", "function get_annual_period_balance($cur='IDR',$acc=null,$eyear=null)\n {\n// transactions.debit, transactions.credit, transactions.vamount, gls.approved');\n \n $this->db->select_sum('transactions.vamount');\n $this->db->select_sum('transactions.debit');\n $this->db->select_sum('transactions.credit');\n \n $this->db->from('gls, transactions, accounts');\n $this->db->where('gls.id = transactions.gl_id');\n $this->db->where('transactions.account_id = accounts.id');\n $this->db->where('YEAR(dates)', $eyear);\n $this->db->where('gls.currency', $cur);\n $this->cek_null($acc,\"transactions.account_id\");\n $this->db->where('gls.approved', 1);\n $this->db->where('accounts.deleted', NULL);\n return $this->db->get(); \n }", "function get_payment_rate($subtotal) {}", "public function getLoanAmount(): float;", "public function getAmountRate()\n {\n return $this->amountRate;\n }", "public function toMoney()\n {\n return $this->rate;\n }", "function getOutletDiscountRate()\n {\n $dayOfMonth = date('j');\n return 20 + $dayOfMonth;\n }", "public function getMonthlyFee(): float { return 2.0; }", "public function getTaxRate();", "public function getCurrentBalanceInDollars()\n {\n return $this->getCurrentBalance()->getAmount() / 100;\n }", "public function getExternalTaxRate();", "public function getInterestRate()\n {\n return (1 + ((float) $this->_webserviceHelper->getConfigData('interest_rate') / 100));\n }", "function formatAsYears($paymentPeriods, $paymentTerm)\n{\n $days = $paymentPeriods * $paymentTerm;\n $years = round($days / 365, 1);\n return $years;\n}", "public function calculate(LoanApplication $application): float;", "function interestRate($item_id){\n\t\treturn 0.1;\n\t}", "private static function getAmortizationCoefficient(float $rate): float\n {\n // Life of assets (1/rate) Depreciation coefficient\n // Less than 3 years 1\n // Between 3 and 4 years 1.5\n // Between 5 and 6 years 2\n // More than 6 years 2.5\n $fUsePer = 1.0 / $rate;\n\n if ($fUsePer < 3.0) {\n return 1.0;\n } elseif ($fUsePer < 4.0) {\n return 1.5;\n } elseif ($fUsePer <= 6.0) {\n return 2.0;\n }\n\n return 2.5;\n }", "public function getTotalDiscount(): float;", "public function getBaseTotalRefunded();", "public function averageRatingAsPercentage() : float\n {\n $range = config('rateable.minimum') > 0 ? config('rateable.maximum') - config('rateable.minimum') : config('rateable.maximum');\n return ($this->ratings()->count() * $range) != 0 ? $this->sumRating() / ($this->ratings()->count() * $range) * 100 : 0;\n }", "public function getAvgRate()\n {\n $avg = 0;\n $nb = 0;\n if (!empty($this->getRates())) {\n foreach($this->getRates() as $rate) {\n $avg += $rate->getNbStar();\n $nb++;\n }\n $avg /= $nb;\n }\n return $avg;\n }", "public function getPerfection(): float\n {\n return round($this->getTotal() / 45, 3) * 100;\n }", "public function getBaseTotalPaid();", "public static function AMORLINC(\n $cost,\n $purchased,\n $firstPeriod,\n $salvage,\n $period,\n $rate,\n $basis = FinancialConstants::BASIS_DAYS_PER_YEAR_NASD\n ) {\n $cost = Functions::flattenSingleValue($cost);\n $purchased = Functions::flattenSingleValue($purchased);\n $firstPeriod = Functions::flattenSingleValue($firstPeriod);\n $salvage = Functions::flattenSingleValue($salvage);\n $period = Functions::flattenSingleValue($period);\n $rate = Functions::flattenSingleValue($rate);\n $basis = ($basis === null)\n ? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD\n : Functions::flattenSingleValue($basis);\n\n try {\n $cost = FinancialValidations::validateFloat($cost);\n $purchased = FinancialValidations::validateDate($purchased);\n $firstPeriod = FinancialValidations::validateDate($firstPeriod);\n $salvage = FinancialValidations::validateFloat($salvage);\n $period = FinancialValidations::validateFloat($period);\n $rate = FinancialValidations::validateFloat($rate);\n $basis = FinancialValidations::validateBasis($basis);\n } catch (Exception $e) {\n return $e->getMessage();\n }\n\n $fOneRate = $cost * $rate;\n $fCostDelta = $cost - $salvage;\n // Note, quirky variation for leap years on the YEARFRAC for this function\n $purchasedYear = DateTimeExcel\\DateParts::year($purchased);\n $yearFracx = DateTimeExcel\\YearFrac::fraction($purchased, $firstPeriod, $basis);\n if (is_string($yearFracx)) {\n return $yearFracx;\n }\n /** @var float */\n $yearFrac = $yearFracx;\n\n if (\n $basis == FinancialConstants::BASIS_DAYS_PER_YEAR_ACTUAL\n && $yearFrac < 1\n && DateTimeExcel\\Helpers::isLeapYear(Functions::scalar($purchasedYear))\n ) {\n $yearFrac *= 365 / 366;\n }\n\n $f0Rate = $yearFrac * $rate * $cost;\n $nNumOfFullPeriods = (int) (($cost - $salvage - $f0Rate) / $fOneRate);\n\n if ($period == 0) {\n return $f0Rate;\n } elseif ($period <= $nNumOfFullPeriods) {\n return $fOneRate;\n } elseif ($period == ($nNumOfFullPeriods + 1)) {\n return $fCostDelta - $fOneRate * $nNumOfFullPeriods - $f0Rate;\n }\n\n return 0.0;\n }", "public function getRate(Currency $currency);", "public function charge(DepositAccount $depositAccount): float;", "public function getDiscountTaxCompensationAmount();", "public function getBaseToGlobalRate();" ]
[ "0.7048916", "0.6441658", "0.62440926", "0.6178631", "0.616266", "0.61594385", "0.60861105", "0.60031074", "0.5999476", "0.59917885", "0.59478843", "0.5942794", "0.59083617", "0.5865003", "0.5848721", "0.58162296", "0.5784676", "0.5766853", "0.5723153", "0.5710646", "0.564306", "0.5635883", "0.5626945", "0.56106997", "0.5610244", "0.560411", "0.56033474", "0.55650765", "0.55641836", "0.554028" ]
0.67632556
1
get list of rules
public function getRules();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getRulesList(){\n return $this->_get(3);\n }", "public function getRules() {}", "abstract protected function getRules();", "public function getRules(): Collection;", "public static function getRules(): array;", "public function getRules(): array;", "public function getRules(): array;", "public function get_all_rules()\n {\n }", "public function getRules()\n {\n return $this->get(self::_RULES);\n }", "public function getRules()\n {\n }", "public function getRules()\n {\n }", "public function getRules()\n {\n }", "public function getRules() {\n\t\treturn $this->rules ?? [];\n\t}", "abstract public function getRules(): array;", "public function getRules(): array\n {\n return $this->rules;\n }", "public function getRules() {\n\t\t$out = array();\n\t\tforeach ($this->rules as $name => $rule) {\n\t\t\t$out[$name] = $rule->description;\n\t\t}\n\t\treturn $out;\n\t}", "public function getRules() : array\n {\n return $this->rules;\n }", "public function rules(): array;", "public function rules(): array;", "public function rules(){\n $rules = [];\n if(!empty($this->rules)){\n foreach ($this->rules as $action => $rule) {\n $regex = \"*\" . $action;\n if($this->is($regex)){\n $rules = $rule;\n break;\n }\n }\n }\n return $rules;\n }", "public function getRules()\r\n\t{\r\n\t\treturn $this->rules;\r\n\t}", "public function getRules()\n {\n return $this->rules;\n }", "public function getRules()\n {\n return $this->rules;\n }", "public function getRules()\n {\n return $this->rules;\n }", "public function getRules()\n {\n return $this->rules;\n }", "public function getRules() : array\n {\n return $this->getDaoRepository()->getRules();\n }", "public function rules();", "public function rules();", "public function rules();", "public function getRules()\r\n\t{\r\n\t\treturn $this->_rules;\r\n\t}" ]
[ "0.8531926", "0.8500616", "0.83190566", "0.8303848", "0.8300871", "0.8227738", "0.8227738", "0.8100199", "0.80676585", "0.80380654", "0.80380654", "0.80380654", "0.79961723", "0.7965298", "0.7877579", "0.78692764", "0.7777388", "0.77557963", "0.77557963", "0.77471775", "0.77195084", "0.7718094", "0.7718094", "0.7718094", "0.7718094", "0.77022475", "0.7699842", "0.7699842", "0.7699842", "0.7632009" ]
0.8726984
0
$this>path = new File($certificateFolder);
function __construct(String $certificateFolder) { $this->path = new FileLocator($certificateFolder); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct(string $file_path);", "public function __construct($file);", "function __construct($file_path)\n {\n $this->open($file_path);\n }", "public function __construct($path);", "public function getFile() {}", "public function getFile() {}", "public function __construct()\n {\n $this->fileSystem = new Filesystem();\n }", "public function __construct()\n {\n //\n\n\t echo new FakeFile( )\n }", "public static function getFile() {}", "function getFile(): object {\n return $this->file;\n }", "protected static function file()\n {\n }", "function __construct($path) {\n\t\t$this->path = $path;\t\t\n\t}", "public function __construct($file)\n {\n }", "public function __construct($file)\n {\n }", "protected function _construct() {\n\t\t$this->_fileObj = $this->fileObj();\n\t}", "public function __construct()\n {\n parent::__construct();\n $this->files = new Filesystem();\n }", "public function __construct($filename);", "public function __construct(){\r\n\t\t$dir = $this->dir;\r\n\t}", "abstract protected function getFile(): File;", "public function get_certificate_file() {\n return '../data/certificates/' . hash_secure($this->name) . '.crt';\n }", "function getCertificateFile()\n {\n return $this->_certificateFile;\n }", "public function __construct($path){\n\t\t$this->path = $path;\n\t\tif(!file_exists($path)){\n\t\t\t$this->createFile($path);\n\t\t}\n\t}", "function __construct($file = null){\n\t\t$this->file = $file;\n\t}", "public function __construct($path){\n $this->path = $path;\n }", "public function getFile ();", "public function __construct($path) {\n\t$this->path = $path;\n }", "public function __construct($file)\n {\n $this->file = $file;\n }", "public function __construct($file = \"\")\n {\n $this->file = $file;\n }", "public function __construct($file) {\n $this->file = $file;\n }", "function __construct($file=null) {\n $this->file = $file;\n }" ]
[ "0.6861805", "0.660397", "0.64530945", "0.63977253", "0.63536257", "0.6351859", "0.63486254", "0.6246805", "0.6214628", "0.61984205", "0.6184057", "0.61572343", "0.6137795", "0.61377895", "0.61106455", "0.61079943", "0.61064553", "0.60980433", "0.6095672", "0.60745305", "0.6030743", "0.60300845", "0.60196847", "0.6011931", "0.6005542", "0.5992895", "0.5985963", "0.5973122", "0.5955361", "0.59388965" ]
0.6901473
0
Desarrollar una funcion que reciba un array o un string, en un mismo parametro, e imprima el contenido de la varible en un archivo
function print_f($variable){ if(is_array($variable)){ //Si es un array, lo recorro y guardo el contenido en el archivo "datos.txt" foreach($variable as $valor){ $contenido = $contenido . $valor . "\n"; } file_put_contents("datos.txt", $contenido); } else{ //Entonces es string, guardo el contenido en el archivo "datos.txt" file_put_contents("datos.txt", $variable); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function readFileFromParam() {\n\t\tglobal $argv;\n\t\t$myArr = array();\n $myString = \"\";\n $len = 0;\n \n\t\tif (($file = fopen($argv[1], \"r\") or exit (\"Sorry - file not found.\")) != FALSE) {\n\t\t\twhile (($data = fgets($file)) != FALSE) {\n\t\t\t $myArr[$len] = $data;\n $len++; \n\t\t\t}\n\t\t}\t\n\t\tfclose($file);\n \n // make sure that we have input that we are expecting \n if ($len >= 2) {\n $this->width = intval($myArr[0]);\n for ($i = 1; $i < $len; $i++) {\n $myString.=$myArr[$i];\n }\n $this->originalArray = explode(\" \", $myString);\n } else die(\"Bad input - exiting.\");\n\n \n\t}", "function chooseFile($gender,$education,$height,$age){\n $result[0]=gender($gender);\n $result[1]=education($education);\n $result[2]=height($height);\n $result[3]=age($age);\n return $result;\n}", "function cargarDatostxt(){\n // Si no existe lo creo\n $tabla=[]; \n if (!is_readable(FILEUSER) ){\n // El directorio donde se crea tiene que tener permisos adecuados\n $fich = @fopen(FILEUSER,\"w\") or die (\"Error al crear el fichero.\");\n fclose($fich);\n }\n $fich = @fopen(FILEUSER, 'r') or die(\"ERROR al abrir fichero de usuarios\"); // abrimos el fichero para lectura\n \n while ($linea = fgets($fich)) {\n $partes = explode('|', trim($linea));\n // Escribimos la correspondiente fila en tabla\n $tabla[]= [ $partes[0],$partes[1],$partes[2],$partes[3]];\n }\n fclose($fich);\n return $tabla;\n}", "function ola(){\n\n$argumentos = func_get_args();// recupera todos os argumentos da variavel que é um array \nreturn $argumentos;\n}", "function funConverteData($data){\n\t//$data_americano = \"2009-04-29\";\n\t//$data_Brasileiro = \"29/04/2012\";\n\t//AGORA VAMOS EXPLODIR ELA PELOS HIFENS E SERÁ CRIADO UM ARRAY COM AS PARTES\n\t$partes_da_data = explode('/',$data);\n\n\t//AGORA REMONTAMOS A DATA NO FORMATO BRASILEIRO, OU SEJA,\n\t//INVERTENDO AS POSICOES E COLOCANDO AS BARRAS\n\t$data = $partes_da_data[2].'-'.$partes_da_data[1].'-'.$partes_da_data[0];\n\n\t//UFA! PRONTINHO, AGORA TEMOS A DATA NO BOM E VELHO FORMATO BRASILEIRO\n\treturn $data;\n}", "function GetData($path)\n{\n static $final_str = \"\";\n $file = fopen($path, 'r') or die(\"Не удалось открыть файл. Скорее всего путь к файлу задан не верно или его не существет.\");\n\n while(!feof($file))\n {\n $str = fgets($file);\n $final_str .= $str . \" \";\n }\n fclose($file);\n $arr = explode(\" \", $final_str);\n $final_str = \"\";\n return $arr;\n\n\n}", "function consultarFuncionalidad()\n\t\t{\n\t\t\t\t $file = fopen(\"../Archivos/ArrayConsultarFuncionalidad.php\", \"w\");\n\t\t\t\t fwrite($file,\"<?php class consult { function array_consultar(){\". PHP_EOL);\n\t\t\t\t fwrite($file,\"\\$form=array(\" . PHP_EOL);\n\n\t\t\t$mysqli=$this->conexionBD();\n\t\t\t$query=\"SELECT * FROM funcionalidades \";\n\t\t\t$resultado=$mysqli->query($query);\n\t\t\tif(mysqli_num_rows($resultado)){\n\t\t\t\twhile($fila = $resultado->fetch_array())\n\t\t\t{\n\t\t\t\t$filas[] = $fila;\n\t\t\t}\n\t\t\tforeach($filas as $fila)\n\t\t\t{ \n\t\t\t\t$nombre=$fila['NOMBRE_FUNCIONALIDAD'];\n\t\t\t\t$descripcion=$fila['DESCRIPCION'];\n\t\t\t\tfwrite($file,\"array(\\\"nombre\\\"=>'$nombre',\\\"descripcion\\\"=>'$descripcion'),\" . PHP_EOL);\n\t\t\t}\n\t\t\t}\n\t\t\t fwrite($file,\");return \\$form;}}?>\". PHP_EOL);\n\t\t\t\t fclose($file);\n\t\t\t\t $resultado->free();\n\t\t\t\t $mysqli->close();\n\t\t}", "public function saveData(string $fileName, array $data): string;", "function array2file($array, $filename) {\n\t$temp = '<?php\nclass ProcMap\n{\n private static $_procmap = '.var_export($array, TRUE).';\n\n public static function getProcAll()\n {\n return self::$_procmap;\n }\n\n public static function getProcFromSchema($schema_name)\n {\n return self::$_procmap[$schema_name];\n }\n\n}\n?>';\n\tfile_exists($filename) or touch($filename);\n\tfile_put_contents($filename, $temp);\n}", "function inscription(array $user){ \n \n //Recupere tous les utilisateurs du fichier sous forme de Tableau\n $arr_users=getAllUsers();\n // Ajoute le User dans le Tableau\n $arr_users[]=$user;\n //Convertir le Tableau en Chaine\n $str_user=json_encode($arr_users,JSON_PRETTY_PRINT);\n //Ajouter la chaine dans le Fichier\n file_put_contents(FILE_NAME,$str_user); \n\n }", "abstract protected function load(): array;", "function cargar_archivo($data) {\r\n // <editor-fold defaultstate=\"collapsed\" desc=\"init\">\r\n $ruta = $data[\"archivo\"];\r\n $tipo_archivo = $data[\"tipo_archivo\"];\r\n $lectura = false;\r\n $buffer = array();\r\n $canalTemp = \"\";\r\n $indicadorTemp = \"\";\r\n $fechaTemp = \"\";\r\n $horaInicioTemp = \"\";\r\n $horaFinTemp = \"\";\r\n $descripcionTemp = \"\";\r\n // </editor-fold>\r\n\r\n try {\r\n $archivo = new SplFileObject($ruta, \"r\");\r\n } catch (Exception $exc) {\r\n throw new Exception(\"No se pudo cargar el archivo.\");\r\n echo $exc->getTraceAsString();\r\n }\r\n\r\n switch ($tipo_archivo) {\r\n case self::tipo_archivo_emisiones:\r\n if (isset($archivo)) {\r\n foreach ($archivo as $linea) {\r\n $valores = explode(\"|\", $linea);\r\n if ($this->limpiar_valores($valores[0]) == \"Channel\") {\r\n // <editor-fold defaultstate=\"collapsed\" desc=\"comprobar estructura de archivo\">\r\n if (\r\n $this->limpiar_valores($valores[0]) != \"Channel\" ||\r\n $this->limpiar_valores($valores[1]) != \"Date\" ||\r\n $this->limpiar_valores($valores[2]) != \"Description\" ||\r\n $this->limpiar_valores($valores[4]) != \"Start time\" ||\r\n $this->limpiar_valores($valores[5]) != \"End time\" ||\r\n $this->limpiar_valores($valores[8]) != \"Target\\Variable\" ||\r\n $this->limpiar_valores($valores[9]) != \"SHR %\" ||\r\n $this->limpiar_valores($valores[10]) != \"AMR\" ||\r\n $this->limpiar_valores($valores[11]) != \"AMR %\" ||\r\n $this->limpiar_valores($valores[12]) != \"RCH [Not cons. - TH: 0min.]\" ||\r\n $this->limpiar_valores($valores[13]) != \"ATS\"\r\n ) {\r\n throw new Exception(\"Estructura de archivo Inválida\");\r\n }\r\n // </editor-fold>\r\n $lectura = true;\r\n }\r\n if ($lectura) {\r\n if (isset($valores[1])) {\r\n // <editor-fold defaultstate=\"collapsed\" desc=\"Canal\">\r\n if ($this->limpiar_canal($valores[0]) != \"\") {\r\n $valores[0] = $this->limpiar_canal($valores[0]);\r\n $canalTemp = $valores[0];\r\n } else {\r\n $valores[0] = $canalTemp;\r\n }\r\n // </editor-fold>\r\n // // <editor-fold defaultstate=\"collapsed\" desc=\"Fecha\">\r\n if (isset($valores[1]) && $valores[1] != \"\") {\r\n $valores[1] = $this->formatea_fecha($valores[1]);\r\n $fechaTemp = $valores[1];\r\n } else {\r\n $valores[1] = $fechaTemp;\r\n }\r\n // </editor-fold>\r\n // <editor-fold defaultstate=\"collapsed\" desc=\"descripcion programa\">\r\n if ($this->limpiar_canal($valores[2]) != \"\") {\r\n $valores[2] = $this->limpiar_canal($valores[2]);\r\n $descripcionTemp = $valores[2];\r\n } else {\r\n $valores[2] = $descripcionTemp;\r\n }// </editor-fold>\r\n // <editor-fold defaultstate=\"collapsed\" desc=\"hora inicio\">\r\n if ($this->limpiar_canal($valores[4]) != \"\") {\r\n $valores[4] = $this->limpiar_canal($valores[4]);\r\n $horaInicioTemp = $valores[4];\r\n } else {\r\n $valores[4] = $horaInicioTemp;\r\n }\r\n // </editor-fold>\r\n // <editor-fold defaultstate=\"collapsed\" desc=\"hora fin\">\r\n if ($this->limpiar_canal($valores[5]) != \"\") {\r\n $valores[5] = $this->limpiar_canal($valores[5]);\r\n $horaFinTemp = $valores[5];\r\n } else {\r\n $valores[5] = $horaFinTemp;\r\n }\r\n // </editor-fold>\r\n // <editor-fold defaultstate=\"collapsed\" desc=\"valores indicadores\">\r\n $valores[8] = $this->limpiar_canal($valores[8]); // indicador\r\n $valores[9] = $this->limpiar_valores($valores[9]); //shr %\r\n $valores[10] = $this->limpiar_valores($valores[10]); //amr\r\n $valores[11] = $this->limpiar_valores($valores[11]); //amr %\r\n $valores[12] = $this->limpiar_valores($valores[12]); //rch\r\n $valores[13] = $this->limpiar_valores($valores[13]); //ats\r\n // </editor-fold>\r\n array_push($buffer, $valores);\r\n }\r\n }\r\n }\r\n } else {\r\n throw new Exception(\"No se pudo cargar el archivo\");\r\n }\r\n break;\r\n case self::tipo_archivo_totales:\r\n if (isset($archivo)) {\r\n foreach ($archivo as $linea) {\r\n $valores = explode(\"|\", $linea);\r\n if ($this->limpiar_valores($valores[0]) == \"Channel\") {\r\n // <editor-fold defaultstate=\"collapsed\" desc=\"comprobar estructura de archivo\">\r\n if (\r\n $this->limpiar_valores($valores[0]) != 'Channel' ||\r\n $this->limpiar_valores($valores[1]) != 'Target' ||\r\n $this->limpiar_valores($valores[3]) != 'Date\\Variable' ||\r\n $this->limpiar_valores($valores[4]) != 'SHR %' ||\r\n $this->limpiar_valores($valores[5]) != 'AMR' ||\r\n $this->limpiar_valores($valores[6]) != 'AMR %' ||\r\n $this->limpiar_valores($valores[7]) != 'RCH [Not cons. - TH: 0min.]' ||\r\n $this->limpiar_valores($valores[8]) != 'ATS'\r\n ) {\r\n throw new Exception(\"Estructura de archivo Inválida\");\r\n }\r\n // </editor-fold>\r\n\r\n $lectura = true;\r\n }\r\n if ($lectura) {\r\n /* Verificando que la linea está completa */\r\n if (isset($valores[1])) {\r\n // <editor-fold defaultstate=\"collapsed\" desc=\"Canal\">\r\n if ($this->limpiar_canal($valores[0]) != \"\") {\r\n $valores[0] = $this->limpiar_canal($valores[0]);\r\n $canalTemp = $valores[0];\r\n } else {\r\n $valores[0] = $canalTemp;\r\n }\r\n // </editor-fold>\r\n // <editor-fold defaultstate=\"collapsed\" desc=\"Indicador\">\r\n if ($this->limpiar_canal($valores[1]) != \"\") {\r\n $valores[1] = $this->limpiar_canal($valores[1]);\r\n $indicadorTemp = $valores[1];\r\n } else {\r\n $valores[1] = $indicadorTemp;\r\n }\r\n // </editor-fold>\r\n // <editor-fold defaultstate=\"collapsed\" desc=\"Fecha\">\r\n if (isset($valores[3])) {\r\n $valores[3] = $this->formatea_fecha($valores[3]);\r\n $fechaTemp = $valores[3];\r\n } else {\r\n $valores[3] = $fechaTemp;\r\n }\r\n // </editor-fold>\r\n // <editor-fold defaultstate=\"collapsed\" desc=\"Valores indicador\">\r\n $valores[4] = $this->limpiar_valores($valores[4]);\r\n $valores[5] = $this->limpiar_valores($valores[5]);\r\n $valores[6] = $this->limpiar_valores($valores[6]);\r\n $valores[7] = $this->limpiar_valores($valores[7]);\r\n $valores[8] = $this->limpiar_valores($valores[8]);\r\n // </editor-fold>\r\n array_push($buffer, $valores);\r\n }\r\n }\r\n }\r\n /* Elimino la fila de encabezado */\r\n } else {\r\n throw new Exception(\"No se pudo cargar el archivo\");\r\n }\r\n break;\r\n case self::tipo_archivo_medias_horas:\r\n if (isset($archivo)) {\r\n foreach ($archivo as $linea) {\r\n $valores = explode(\"|\", $linea);\r\n if ($this->limpiar_valores($valores[0]) == \"Month\") {\r\n // <editor-fold defaultstate=\"collapsed\" desc=\"comprobar estructura de archivo\">\r\n if (\r\n $this->limpiar_valores($valores[1]) != 'Date' ||\r\n $this->limpiar_valores($valores[2]) != 'Channel' ||\r\n $this->limpiar_valores($valores[3]) != 'Target' ||\r\n $this->limpiar_valores($valores[4]) != 'Day Part\\Variable' ||\r\n $this->limpiar_valores($valores[5]) != 'SHR %' ||\r\n $this->limpiar_valores($valores[6]) != 'AMR' ||\r\n $this->limpiar_valores($valores[7]) != 'AMR %' ||\r\n $this->limpiar_valores($valores[8]) != 'RCH [Not cons. - TH: 0min.]' ||\r\n $this->limpiar_valores($valores[9]) != 'ATS'\r\n ) {\r\n throw new Exception(\"Estructura de archivo Inválida\");\r\n }\r\n // </editor-fold>\r\n\r\n $lectura = true;\r\n }\r\n if ($lectura) {\r\n /* Verificando que la linea está completa */\r\n if (isset($valores[1])) {\r\n // <editor-fold defaultstate=\"collapsed\" desc=\"Fecha\">\r\n if (isset($valores[1]) && $valores[1] != \"\") {\r\n $valores[1] = $this->formatea_fecha($valores[1]);\r\n $fechaTemp = $valores[1];\r\n } else {\r\n $valores[1] = $fechaTemp;\r\n }\r\n // </editor-fold>\r\n // <editor-fold defaultstate=\"collapsed\" desc=\"Canal\">\r\n if ($this->limpiar_canal($valores[2]) != \"\") {\r\n $valores[2] = $this->limpiar_canal($valores[2]);\r\n $canalTemp = $valores[2];\r\n } else {\r\n $valores[2] = $canalTemp;\r\n }\r\n // </editor-fold>\r\n // <editor-fold defaultstate=\"collapsed\" desc=\"Indicador\">\r\n if ($this->limpiar_canal($valores[3]) != \"\") {\r\n $valores[3] = $this->limpiar_canal($valores[3]);\r\n $indicadorTemp = $valores[3];\r\n } else {\r\n $valores[3] = $indicadorTemp;\r\n }\r\n // </editor-fold>\r\n // <editor-fold defaultstate=\"collapsed\" desc=\"Valores indicador\">\r\n $valores[4] = $this->limpiar_valores($valores[4]);\r\n $valores[5] = $this->limpiar_valores($valores[5]);\r\n $valores[6] = $this->limpiar_valores($valores[6]);\r\n $valores[7] = $this->limpiar_valores($valores[7]);\r\n $valores[8] = $this->limpiar_valores($valores[8]);\r\n $valores[9] = $this->limpiar_valores($valores[9]);\r\n // </editor-fold>\r\n array_push($buffer, $valores);\r\n }\r\n }\r\n }\r\n /* Elimino la fila de encabezado */\r\n } else {\r\n throw new Exception(\"No se pudo cargar el archivo\");\r\n }\r\n break;\r\n default :\r\n throw new Exception(\"Operacion invalida\");\r\n break;\r\n }\r\n /* Elimino encabezado de tabla */\r\n unset($buffer[0]);\r\n return $buffer;\r\n }", "function js($arquivo);", "function array_to_arrayfile($theArray, $filepath) {\n// The file may then be converted back into an array using the arrayfile_to_array() function\n\n if ($fp = fopen($filepath, \"w+\")) {\n $encoded = serialize($theArray);\n fwrite($fp, $encoded);\n fclose($fp);\n } else\n echo \"Unable to write array to $filepath\";\n}", "public function get_contents_array($file)\n {\n }", "public function get_contents_array($file)\n {\n }", "public function get_contents_array($file)\n {\n }", "public function get_contents_array($file)\n {\n }", "public function get_contents_array($file)\n {\n }", "function csv($fichier, $meteocode, $date, $code)\n{\n $lines2 = file($fichier);\n\n $id = $meteocode;\n // Affiche toutes les lignes du tableau comme code HTML, avec les numéros de ligne\n foreach($lines2 as $line_num2 => $line2)\n {\n $chaine2 = htmlspecialchars($line2);\n\n if(strpos($chaine2, $date['aa'] . '-' . $date['mm'] . '-' . $date['jj']))\n {\n /* * *************************************************\n * À regler le probleme de .0 dans la ligne suivante *\n * ************************************************** */\n\n if(strstr($chaine2, $id . '.0_' . $code . '_'))\n {\n $text = strpbrk($chaine2, '2');\n $x = strpos($text, 'v', 32);\n $lien = substr($text, 0, $x + 1);\n $parametre = substr($lien, -6, -4);\n switch($parametre)\n {\n case 'CC':$lien_cc = $lien;\n break;\n case 'PA':$lien_pa = $lien;\n break;\n case 'OP':$lien_pop = $lien;\n break;\n case 'TA':$lien_ta = $lien;\n break;\n case 'TD':$lien_td = $lien;\n break;\n case 'WS':$lien_ws = $lien;\n break;\n }\n }\n }\n }\n $lien_csv = array(\n 'lien_cc' => $lien_cc,\n 'lien_pa' => $lien_pa,\n 'lien_pop' => $lien_pop,\n 'lien_ta' => $lien_ta,\n 'lien_td' => $lien_td,\n 'lien_ws' => $lien_ws,\n );\n return($lien_csv);\n}", "protected abstract function getData(): array;", "function array_codproduto_foto($con){\r\n\t$param_cadastro_dirfotoprod = param(\"CADASTRO\", \"DIRFOTOPROD\", $con);\r\n\t$arr_codproduto = array();\r\n\tif(is_dir($param_cadastro_dirfotoprod)){\r\n\t\t$dir = opendir($param_cadastro_dirfotoprod);\r\n\t\twhile($file = readdir($dir)){\r\n\t\t\t$file = strtolower($file);\r\n\t\t\tif(strpos($file, \".jpg\") !== FALSE){\r\n\t\t\t\t$arr_codproduto[] = str_replace(\".jpg\", \"\", $file);\r\n\t\t\t}\r\n\t\t\tif(is_dir($file)){\r\n\t\t\t\tif(is_numeric($file)){\r\n\t\t\t\t\t$arr_codproduto[] = $file;\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn $arr_codproduto;\r\n}", "function ajout_fichier(array $array){\n $json = json_encode($array);\n file_put_contents(FILE_QUESTION, $json);\n}", "function writeToAFile(string $file,array $array)\n\t{\n\t\treturn file_put_contents($file, implode(\"\\n\",$array));\n\t}", "function st_get_content_from_func($function,$data = array(),$settings = array()){\r if(!function_exists($function) || !is_string($function)){\r return false;\r }\r\r ob_start();\r $old_cont = ob_get_contents();\r ob_end_clean();\r ob_start();\r call_user_func($function,$data,$settings);\r $content = ob_get_contents();\r ob_end_clean();\r echo $old_cont;\r return $content;\r\r}", "function import(array $data);", "function arrayToFile($oldList, $key, $value, $fileName, $name) {\n $oldList[\"$key\"] = $value;\n $newList = http_build_query($oldList, '', ', ');\n $newList = noAscii($newList);\n $newList = str_replace(\"=\", \"=>\", \"$newList\");\n $newList = '\"'.$newList;\n $newList = str_replace(\"=>\", '\"=>\"', $newList);\n $newList = str_replace(\", \", '\", \"', $newList);\n $arrayFile = fopen(\"$fileName\", \"w\");\n fwrite($arrayFile, \"<?php \".'$'.$name.' = array('.$newList.'\"); ?>');\n fclose($arrayFile);\n}", "function storeData(){\n global $data_file;\n $content = file_get_contents($data_file); //failo turinys\n $formData = implode(',', $_POST); //konvertuojame POST masyva i string\n $content .= $formData.\"\\n\"; //ivedame po kiekvieno submit pabaiga prie formos duomenu pridedame eilutes pabaigos zenkla\n file_put_contents($data_file, $content); //rasom i txt faila formos duomenis\n var_dump($content);\n}", "public function getData(): array;", "public function getData(): array;" ]
[ "0.60956895", "0.5862017", "0.5849489", "0.5704998", "0.567625", "0.5525777", "0.5523403", "0.547683", "0.54739606", "0.5453325", "0.5448067", "0.5427438", "0.53477925", "0.5330651", "0.5317426", "0.5317426", "0.5317426", "0.5316768", "0.5316578", "0.52904195", "0.52730924", "0.5250507", "0.5238502", "0.52379376", "0.5236041", "0.52359796", "0.52326035", "0.5212744", "0.5211714", "0.5211714" ]
0.6409371
0
Get the value of Id_batiment
public function getId_batiment() { return $this->Id_batiment; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getBidId(){\n return $this->bidId; \n }", "public function getBid()\n {\n return $this->getAttribute()->getBid();\n }", "public function getId_Boisson()\n {\n return $this->Id_Boisson;\n }", "public function setId_batiment($Id_batiment)\n {\n $this->Id_batiment = $Id_batiment;\n\n return $this;\n }", "public function getidBateau(){\r\n return $this->_idBateau;\r\n }", "public function getID_B()\n {\n return $this->ID_B;\n }", "public function getId_Boisson()\n{\nreturn $this->Id_Boisson;\n}", "public function getBachilleratoId()\n\t{\n\t\treturn $this->bachilleratoId;\n\t}", "public function getIdAttribute()\n {\n return $this->attributes['bag_id'];\n }", "public function getBentukLembagaId()\n {\n return $this->bentuk_lembaga_id;\n }", "public function getIdBangunan()\n {\n return $this->id_bangunan;\n }", "public function getPeminjamanBukuAttribute(){\n return $this->buku->pluck('id')->toArray();\n }", "public function getIdVit(){\n\t\treturn ($this->id);\n\t}", "public function get_bagian($id)\r\n\t\t{\r\n\t\t\t$hasil = $this->db->query(\"SELECT * FROM tbl_bagian WHERE id_unit='$id'\");\r\n\t\t\treturn $hasil->result(); \r\n\t\t}", "public function getId(){\n return $this->_data['id'];\n }", "function getStatusID() {\n\t\treturn $this->data_array['status_id'];\n\t}", "public function getBeritabyID($ID_BRT)\n {\n \n return $this->db->get_where('tb_berita', ['ID_BRT' => $ID_BRT])->row_array();\n }", "public function getBU()\n {\n $value = $this->get(self::BU);\n return $value === null ? (integer)$value : $value;\n }", "protected function cargaIdUbicacion() {\n $dao = new PGDAO();\n $strSql = $this->COLECCIONMAPEOUBICA . $this->propiedad->getId_ubica();\n $arrayDatos = $this->leeDBArray($dao->execSql($strSql));\n $id = $arrayDatos[0]['zpubica'];\n return $id;\n }", "public function getBarangId($id_barang)\n {\n return $this->db->get_where('tb_barang', ['id_barang' => $id_barang])->result_array();\n }", "public function getStatusId()\n {\n return $this->getValue('nb_icontact_prospect_status_id');\n }", "public function getId(){\n return (string) $this->film['id'];\n }", "public function getBankId()\n {\n return $this->bank_id;\n }", "public function get_batch_id()\n {\n $results = $this->results();\n\n return $results['SubmitNotificationBatchResult']->BatchID;\n }", "public function fetchBatchId ()\r\n {\r\n $member_id = $this->getMember_id(true);\r\n $student_class_object = new Acad_Model_StudentClass();\r\n $student_class_object->setMember_id($member_id);\r\n $batch_identifier_class_id = $student_class_object->fetchBatchIdentifierClassId();\r\n $class_object = new Acad_Model_Class();\r\n $class_object->setClass_id($batch_identifier_class_id);\r\n $class_object->fetchInfo();\r\n $batch_id = $class_object->getBatch_id();\r\n return $batch_id;\r\n }", "public function getBatchID()\n {\n return $this->BatchID;\n }", "public function getIdAct(){\n\t\treturn $this->idAct;\n\t}", "public function cekIdBayarLast()\n {\n\n $query = \"SELECT id_bayar FROM pembayaran order by id_bayar DESC limit 1\";\n\n return $this->db->query($query)->row_array();\n }", "public function retrieve_product_batchid()\n\t{\t\n\t\t$CI =& get_instance();\n\t\t$batch_id = $this->input->post('batch_id');\n\t\t$product_info = $CI->Invoices->get_total_product_batch($batch_id);\n\t\techo json_encode($product_info);\n\t}", "public function getId_book()\n {\n return $this->id_book;\n }" ]
[ "0.6747695", "0.66339815", "0.66311955", "0.658652", "0.643237", "0.6398355", "0.6224411", "0.6188837", "0.6156267", "0.6151657", "0.6064528", "0.58263236", "0.5734558", "0.57297283", "0.57233727", "0.56914264", "0.5638607", "0.56230545", "0.5612167", "0.56011236", "0.55915684", "0.5564997", "0.5541738", "0.5541446", "0.55357575", "0.55320555", "0.5532051", "0.5531287", "0.55252045", "0.55213165" ]
0.86391884
0
Set the value of Id_batiment
public function setId_batiment($Id_batiment) { $this->Id_batiment = $Id_batiment; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getId_batiment()\n {\n return $this->Id_batiment;\n }", "public function setId($IDabbonamento)\n {\n $this->id = $IDabbonamento;\n }", "function setId($value) {\n $this->_id = intval($value);\n }", "public function setId($id)\r\n {\r\n $this->data['itemid'] = (int) $id;\r\n }", "public function setId_Boisson($Id_Boisson)\n{\n$this->Id_Boisson = $Id_Boisson;\n\nreturn $this;\n}", "public function setIdVit($id){\n\t\t$this->id = $id;\n\t}", "function setBrfId($a_iBrfId)\n {\n $this->_iBrfId = (int) $a_iBrfId;\n $this->setSearchParameter('brf_id', $this->_iBrfId);\n }", "public function setId($id){\n $this->_id = $id;\n }", "public function setId($var){\n\t\t$this->id=$var;\n\t}", "function SetId($value) { $this->id=$value; }", "public function setId_book($id_book)\n {\n $id_book = (int) $id_book;\n if (is_int($id_book) && $id_book > 0) {\n $this->id_book = $id_book;\n }\n }", "function setId($id) {\r\n $this->_id = $id;\r\n }", "public function setId($id)\n {\n $this->_id = (int) $id;\n }", "function setId_situacion($iid_situacion = '')\n {\n $this->iid_situacion = (int)$iid_situacion;\n }", "public function setId($id){\n $this->id = $id;\n }", "public function setId($id){\n $this->id = $id;\n }", "public function setId($id){\n $this->id = $id;\n }", "public function setId($id)\r\n {\r\n $this->_id = (int) $id;\r\n }", "public function setId($id)\n {\n $this->id = $id;\n\n \n }", "function setId($id){\r\n\t\t$this->id = $id;\r\n\t}", "public function setId($id)\n {\n $this->_id = (int) $id;\n }", "public function getId_Boisson()\n{\nreturn $this->Id_Boisson;\n}", "function setId($id){\n\t\t$this->id = $id;\n\t}", "function setId($id) {\n\t\t$this->setData('id', $id);\n\t}", "public function setId($id){\n $this->id = $id;\n }", "public function setId($valor){\n\t\t\t$this->id = $valor;\n\t\t}", "public function setId($x) { $this->id = $x; }", "public function setId($id){ $this->id=$id;}", "public function setStatusIdAttribute($input)\n {\n $this->attributes['status_id'] = $input ? $input : null;\n }", "public function setId($id)\n {\n $this->id = $id;\n }" ]
[ "0.76356494", "0.6097018", "0.58651775", "0.57700163", "0.5764101", "0.57294595", "0.5657558", "0.5611514", "0.5577207", "0.55523413", "0.5541761", "0.5527859", "0.55245644", "0.551988", "0.55164087", "0.55164087", "0.55164087", "0.55041605", "0.5477404", "0.5474623", "0.5471434", "0.546898", "0.54667896", "0.5463918", "0.54605216", "0.545498", "0.5450288", "0.5438531", "0.5434222", "0.54227287" ]
0.8076125
0
Returns the order mapper
public function getOrderMapper() { if($this->orderMapper == null) { throw new \Exception('Please set the order mapper'); } return $this->orderMapper; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_order() {\n return $this->get_mapped_property('order');\n }", "public function generateOrder();", "public function getOrder();", "public function getOrder();", "public function getOrder();", "public function getOrder();", "public function getOrder();", "public function getOrder();", "public function getMapper()\n\t{\n\t\treturn parent::getMapper('Basico_Model_DicionarioDadosAssocclFkMapper');\n\t}", "public function getOrder()\n {\n return static::ORDER;\n }", "public function getOrder()\n {\n return static::ORDER;\n }", "public function getOrder()\n {\n return static::ORDER;\n }", "function getOrder();", "public function getMapper(){ \n $mapper = new Wf_Model_WfProcesso_Mapper();\n return $mapper;\n }", "protected function getMapper()\n {\n return $this->mapper;\n }", "public function getMapper()\n\t{\n\t\treturn parent::getMapper('Basico_Model_MetodoValidacaoMapper');\n\t}", "public function getMapper()\n\t{\n\t\treturn parent::getMapper('Basico_Model_FormularioDecoratorGrupoMapper');\n\t}", "public function getOrder()\n {\n //Note: order by parts are not \"named\" so it's all or nothing\n return $this->_get('_order');\n }", "function getMapper() {\n return $this->mapper;\n }", "protected function get_rel_mapper() {\n\t\t$rel_mapper = array();\n\n\t\t/*\n\t\t * replies\n\t\t * @link https://indieweb.org/in-reply-to\n\t\t */\n\t\t$rel_mapper['in-reply-to'] = 'comment';\n\t\t$rel_mapper['reply-of'] = 'comment';\n\n\t\t/*\n\t\t * bookmarks\n\t\t * @link https://microformats.org/wiki/rel-design-pattern#rel.3D.22bookmark.22\n\t\t */\n\t\t$rel_mapper['bookmark'] = 'bookmark';\n\n\t\t/*\n\t\t * tags\n\t\t * @link https://microformats.org/wiki/rel-tag\n\t\t */\n\t\t$rel_mapper['tag'] = 'tag';\n\n\t\treturn apply_filters( 'webmention_mf2_rel_mapper', $rel_mapper );\n\t}", "public function getMapper()\n\t{\n\t\t\n\t\treturn $this->__mapper;\n\t\t\n\t}", "public static function getInstance() {\n if (self::$instance == null) {\n self::$instance = new OrderMapper();\n }\n return self::$instance;\n }", "function get_mapper()\n {\n return $this->_mapper;\n }", "public static function getOrder(): int;", "public function getTransformer()\n {\n return new OrderTransformer();\n }", "private function getOrdering()\n {\n return [[\n 'column' => 0,\n 'dir' => 'asc',\n ]];\n }", "function getOrder()\n {\n return 1;\n }", "function getOrder()\n {\n return 1;\n }", "function getOrder()\n {\n return 1;\n }", "function getOrder()\n {\n return 1;\n }" ]
[ "0.6431113", "0.58484906", "0.58419657", "0.58419657", "0.58419657", "0.58419657", "0.58419657", "0.58419657", "0.58290136", "0.5786071", "0.5786071", "0.5786071", "0.5775523", "0.57736933", "0.5729906", "0.56842107", "0.56812525", "0.5652704", "0.5636372", "0.5636219", "0.56357247", "0.5615454", "0.5598317", "0.55869514", "0.5575028", "0.55346555", "0.55244035", "0.55244035", "0.55244035", "0.55244035" ]
0.7406881
0
Add a boolean param
public function addBoolean(string $name, bool $default = false) { $this->add('boolean', $name, func_get_args()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _setBoolean($name, $value) {}", "public function set_add($param)\n\t{\n\t\t$this->add = (bool)$param;\n\t\treturn $this;\n\t}", "public function putBool(string $name, ?bool $value, bool $mandatory = false): string;", "public function setBoolean($trueFalse);", "function post_bool($boolean_name) {\n\t$boolean = $_POST[$boolean_name];\n\tif ($boolean == \"true\")\n\t\treturn true;\n\n\treturn false;\n}", "public static function boolean() {}", "protected function addBoolProperty(\n SerializationVisitorInterface $visitor,\n string $prop,\n ?bool $value,\n bool $insertUnderscore = true): void\n {\n $visitor->visitProperty(\n new StaticPropertyMetadata('boolean', $this->propertyName($prop, $insertUnderscore), null),\n $value\n );\n }", "function &bool(bool $value, string $namespace = 'default'): bool\n{\n $var = new Variable\\BoolVariable($value);\n Repository::add($var, $namespace);\n return $var->getValue();\n}", "public function booleanValue($a = null)\n {\n throw new NotImplementedException(__METHOD__);\n }", "public function hasParam(){\n return $this->_has(2);\n }", "public function hasParam(){\n return $this->_has(2);\n }", "public function hasParam(){\n return $this->_has(2);\n }", "public function hasParam(){\n return $this->_has(2);\n }", "public function hasParam(){\n return $this->_has(2);\n }", "public function getBool(): bool;", "private static function getBool($param)\n {\n if ('true' == $param) {\n return true;\n }\n\n if ('false' == $param) {\n return false;\n }\n\n return (bool) $param;\n }", "protected function _setBooleanValue($key, $value) {}", "public function AddBoolData ($key, $bool_value) {\n\t\t$this->data[$key] = $bool_value ? \"true\" : \"false\";\n\t}", "public function updateBoolean( Inx_Api_Recipient_Attribute $attr, $blValue );", "function rest_is_boolean($maybe_bool)\n {\n }", "public function testBindBoolParameterNull()\n {\n self::$database->runTransaction(function (Transaction $t) {\n $t->executeUpdate(\n 'INSERT INTO ' . self::TABLE_NAME . '(id, name, registered, rating, age) '\n . 'VALUES($1, $2, $3, $4, $5)',\n [\n 'parameters' => [\n 'p1' => 3,\n 'p2' => 'Rock',\n 'p3' => null,\n 'p4' => 5.0,\n 'p5' => 26\n ],\n 'types' => [\n 'p3' => Database::TYPE_BOOL\n ]\n ]\n );\n $t->commit();\n });\n\n $res = self::$database->execute('SELECT * FROM ' . self::TABLE_NAME . ' WHERE registered IS NULL');\n\n $this->assertCount(1, iterator_to_array($res));\n }", "function PrepBool(&$bool,$blnNullable = true) {\n $bool = (integer)$bool;\n }", "public function setInternal($bool)\n {\n $this->arguments['internal'] = (bool) $bool;\n }", "abstract public function escapeBoolean($bool);", "public static function and_() {\n $result = new qti_variable('single', 'boolean', array('value' => true));\n $params = func_get_args();\n // Allow a single array as well as a parameter list\r\n if (count($params) == 1 && is_array($params[0])) {\r\n $params = $params[0];\r\n }\r\n foreach($params as $param) {\n if (!$param->value) {\n $result->value = false;\n return $result;\n }\n }\n return $result;\n }", "public function isBoolean();", "public function SetBool(string $key, bool $value) : void\r\n\t{\r\n\t\t$this->Set($key, $value);\r\n\t}", "public function hasParam($name);", "function wpsl_bool_check( $atts ) {\n\n foreach ( $atts as $key => $val ) {\n if ( in_array( $val, array( 'true', '1', 'yes', 'on' ) ) ) {\n $atts[$key] = true;\n } else if ( in_array( $val, array( 'false', '0', 'no', 'off' ) ) ) {\n $atts[$key] = false;\n }\n }\n\n return $atts;\n}", "public function showInformation($bool) {$this->_information = (bool) $bool;return $this;}" ]
[ "0.6995609", "0.6974047", "0.6896783", "0.6663273", "0.6496533", "0.6441607", "0.641299", "0.63380754", "0.6304253", "0.6259438", "0.6259438", "0.6259438", "0.6259438", "0.6259438", "0.6253668", "0.6182342", "0.61822045", "0.6175959", "0.61320627", "0.6130263", "0.6117875", "0.6063973", "0.600367", "0.59770596", "0.59707224", "0.59494096", "0.59247255", "0.5896289", "0.58552545", "0.58213496" ]
0.70515066
0
Get a list of members of a particular chamber in a particular Congress
public function listMembers(int $congress, string $chamber) { $this->congressValidator->isValidChamber($chamber); switch ($chamber) { case 'senate': $earliestCongress = 80; break; case 'house': default: $earliestCongress = 102; break; } $this->congressValidator->isValidCongress($congress, $earliestCongress); $uriStub = "{$congress}/{$chamber}/members.json"; return $this->performApiRequest($uriStub); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getChamberMembers($chamberID) {\r\n $sql = $this->db->prepare(\"SELECT UserID, firstname, lastname, email, businessname, expiry, archived, type\r\n FROM USER LEFT OUTER JOIN BUSINESS ON USER.businessID=BUSINESS.businessID WHERE USER.chamberID=:chamber_id\r\n ORDER BY lastname;\");\r\n if ($sql->execute(array(\r\n 'chamber_id' => $chamberID,\r\n ))) {\r\n return $sql->fetchall(PDO::FETCH_ASSOC);\r\n }\r\n return $chamberID;\r\n }", "function get_Child_Chambers($chamber){\r\n $sql = $this->db->prepare(\"SELECT chamberID from CHAMBER where parent_id=:myChamber;\");\r\n\r\n $result = $sql->execute(array(\r\n \"myChamber\" => $chamber\r\n ));\r\n\r\n if ($result){\r\n return $sql->fetchAll(PDO::FETCH_ASSOC);\r\n }\r\n else{\r\n return false;\r\n }\r\n }", "function getMembers() {\n\t\t$query = $this->createQuery();\n\t\t$query .= \"WHERE c2.status = '\" . KontakteData::$STATUS_MEMBER . \"'\";\n\t\t$query .= \" OR c2.status = '\" . KontakteData::$STATUS_ADMIN . \"' \";\n\t\t$query .= \"ORDER BY c2.name ASC\";\n\t\treturn $this->database->getSelection($query);\n\t}", "function getMemberListAdmin() {\n $sql = \"SELECT d.*\n FROM admin_building a,\n condo_building b,\n member_condo c,\n member d \n WHERE a.admin_id=? AND a.building_id = b.building_id AND b.condo_id= c.condo_id AND c.member_id = d.id AND b.building_id=? ORDER BY d.id ASC\";\n \n return getAll($sql, [getLogin()['uid'], getLogin()['bid']]);\n}", "public function getMemberList()\n {\n $memberList = '';\n foreach($this->Residents as $resident) {\n $memberList .= (string)$resident->get('Rooms') . ', ';\n //$memberList .= (string)$resident . ', ';\n }\n $memberList = substr($memberList, 0,-2);\n\n return $memberList;\n }", "function getMemberContractList() {\n $sql = \"SELECT b.* \n FROM user_contract a INNER JOIN contract b ON a.contract_id = b.id \n WHERE a.user_type = 'member' AND a.uid = ? \n ORDER BY b.id DESC\";\n return getAll($sql, [getLogin()['mid']]);\n}", "function get_Chamber_Emails($chamber){\r\n $sql = $this->db->prepare(\"SELECT email FROM USER WHERE chamberID = :chamberID;\");\r\n\r\n $result = $sql->execute(array(\r\n \"chamberID\" => $chamber\r\n ));\r\n\r\n if ($result){\r\n return $sql->fetchAll(PDO::FETCH_NUM);\r\n }\r\n else{\r\n return false;\r\n }\r\n }", "function getMemberList() {\n return getAll(\"SELECT * FROM member \");\n}", "function getMembers()\r\n {\r\n // define the query\r\n $sql = \"SELECT * FROM member ORDER BY lname\";\r\n // prepare statement\r\n $statement = $this->_dbh->prepare($sql);\r\n // execute statement\r\n $statement->execute();\r\n // get result\r\n return $statement->fetchAll(PDO::FETCH_ASSOC);\r\n }", "function getGroups($chamberId) {\r\n $sql = $this->db->prepare(\"SELECT groupID, name, mailchimp_list_id FROM GROUPS WHERE chamberID=:chamberID ORDER BY name\");\r\n if ($sql->execute(array(\r\n \"chamberID\" => $chamberId\r\n ))) {\r\n $row = $sql->fetchAll(PDO::FETCH_ASSOC);\r\n return $row;\r\n }\r\n return false;\r\n }", "function getMembers(){\n\t\treturn $this->members;\n\t}", "public function Roommates()\n\t{\n\t\t$res = $this->Residence();\n\t\t$roommates = array();\n\n\t\tif ($this->HasCustomResidence())\n\t\t{\n\t\t\t$addr = $res->Address;\n\t\t\t$city = $res->City;\n\t\t\t$state = $res->State;\n\t\t\t$zip = $res->PostalCode;\n\t\t\t$r = DB::Run(\"SELECT Members.ID FROM Members INNER JOIN Residences \".\n\t\t\t\t\t\t\"ON Members.ResidenceID=Residences.ID WHERE Residences.Address='$addr' \".\n\t\t\t\t\t\t\"AND Residences.City='$city' AND Residences.State='$state' \".\n\t\t\t\t\t\t\"AND Residences.PostalCode='$zip'\");\n\t\t\twhile ($row = mysql_fetch_array($r))\n\t\t\t\tif ($row['ID'] != $this->ID)\n\t\t\t\t\tarray_push($roommates, Member::Load($row['ID']));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$r = DB::Run(\"SELECT ID FROM Members WHERE ResidenceID='{$this->ResidenceID}' AND Apartment='{$this->Apartment}' LIMIT 9\");\n\t\t\twhile ($row = mysql_fetch_array($r))\n\t\t\t\tif ($row['ID'] != $this->ID)\n\t\t\t\t\tarray_push($roommates, Member::Load($row['ID']));\n\t\t}\n\n\t\treturn $roommates;\n\t}", "public function membres()\n {\n $this->membres = $this->Member->list($_SESSION['guild_id']);\n }", "function getMembers()\n {\n // define the query\n $sql = \"SELECT * FROM member ORDER BY lname, fname\";\n\n // prepare the statement\n $statement = $this->_dbh->prepare($sql);\n\n // no params to bind\n\n // execute the statement\n $statement->execute();\n\n // get the result\n return $statement->fetchAll(PDO::FETCH_ASSOC);\n }", "public function getMemberList($firstname, $surname, $address, $phonenum)\n {\n $firstname = db::escapechars(trim($firstname));\n $surname = db::escapechars(trim($surname));\n $address = db::escapechars(trim($address));\n $phonenum = db::escapechars(trim($phonenum));\n \n \n $sql = \"SELECT * FROM churchmembers WHERE 1=1 \";\n if($firstname != \"\"){\n $sql .= \"AND firstname LIKE '%$firstname%' \";\n }\n if($surname != \"\"){\n $sql .= \"AND surname LIKE '%$surname%' \";\n }\n if($address != \"\"){\n $sql .= \"AND ((address1 LIKE '%$address%') OR (address2 LIKE '%$address%') OR (address3 LIKE '%$address%') OR (address4 LIKE '%$address%')) \";\n }\n if($phonenum != \"\"){\n $sql .= \"AND phonenum LIKE '%$phonenum%' \";\n }\n \n $sql .= \"ORDER BY surname ASC, firstname ASC \";\n \n $result = db::returnallrows($sql);\n return $result;\n \n }", "function GetMembers()\n\t{\t$members = array();\n\t\t$where = array();\n\t\t$tables = array('students');\n\t\t\n\t\tif ($_GET['morf'])\n\t\t{\t$where[] = 'students.morf=\"' . $this->SQLSafe($_GET['morf']) . '\"';\n\t\t}\n\t\n\t\tif ($_GET['ctry'])\n\t\t{\t$where[] = 'students.country=\"' . $this->SQLSafe($_GET['ctry']) . '\"';\n\t\t}\n\t\t\n\t\tif ($name = $this->SQLSafe($_GET['name']))\n\t\t{\t$where[] = '(CONCAT(students.firstname, \" \", students.surname, \"|\", students.username) LIKE \"%' . $name . '%\")';\n\t\t}\n\t\t\n\t\t$sql = 'SELECT students.* FROM ' . implode(',', $tables);\n\t\tif ($wstr = implode(' AND ', $where))\n\t\t{\t$sql .= ' WHERE ' . $wstr;\n\t\t}\n\t\t$sql .= ' GROUP BY students.userid ORDER BY students.surname, students.firstname LIMIT 0, 1000';\n\t\t\n\t\tif ($result = $this->db->Query($sql))\n\t\t{\twhile ($row = $this->db->FetchArray($result))\n\t\t\t{\tif (!$row[\"country\"] || $this->user->CanAccessCountry($row[\"country\"]))\n\t\t\t\t{\t$members[] = $row;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $members;\n\t}", "function getChamber($user) {\r\n $sql = $this->db->prepare(\"SELECT chamberID FROM USER WHERE email='$user'\");\r\n if ($sql->execute()) {\r\n $result = $sql->fetch(PDO::FETCH_ASSOC);\r\n return $result['chamberID'];\r\n }\r\n return false;\r\n }", "public function getCurrentMembersByStateOrStateAndDistrict(string $chamber, string $state, int $district = null)\n {\n $this->congressValidator->isValidChamber($chamber);\n $this->stateValidator->isValidStateAbbreviation($state);\n\n $uriStub = \"members/{$chamber}/{$state}/\";\n\n if (! is_null($district)) {\n $uriStub .= \"{$district}/\";\n }\n\n $uriStub .= 'current.json';\n\n return $this->performApiRequest($uriStub);\n }", "function getOrganismsList();", "public function index()\n {\n $chambers=Chamber::where('doctor_id',Auth::guard('doctor')->user()->id)->get();\n return view('doctor.chamber.index',compact('chambers'));\n }", "public function get_members()\n\t{\n\t\treturn $this->members;\n\t}", "public function GetAllMembers()\n {\n $dbTalker = new DbTalker();\n return $dbTalker->GetAllMembers();\n }", "public function getMembers() {\n return $this->parseData($this->sql['mem']);\n }", "public function get_organisers(){\n $sql = \"SELECT DISTINCT * from members WHERE members.id IN \"\n .\"(SELECT organiserID FROM tournamentOrganisers WHERE tournamentID=$this->id)\";\n return Member::find_by_sql($sql);\n }", "public function get_members(){\n return $this->connected_clients;\n }", "public function compactList(){\n $output = array();\n $members = $this->members;\n foreach ($members as $value) {\n $member = array(\n 'id' => $value['id'],\n 'name' => $value['firstName'] . \" \" . $value['lastName'],\n 'num_boats' => count($value['boats'])\n );\n array_push($output, $member);\n }\n return $output;\n }", "function getMembers()\r\n {\r\n $sql = \"SELECT * FROM member\r\n ORDER BY lname, fname ASC\";\r\n\r\n //2. Prepare the statement\r\n $statement = $this->_dbh->prepare($sql);\r\n\r\n //3. Bind the parameter\r\n\r\n //4. Execute the statement\r\n $statement->execute();\r\n\r\n //5. Get the result\r\n $result = $statement->fetchAll(PDO::FETCH_ASSOC);\r\n return $result;\r\n }", "function get_chamber_business(){\r\n $sql = $this->db->prepare(\"SELECT businessID, businessname FROM BUSINESS WHERE chamberID = :chamberid;\");\r\n\r\n $result = $sql->execute(array(\r\n \"chamberid\" => $_SESSION['chamber'],\r\n ));\r\n\r\n if ($result)\r\n return $sql->fetchAll(PDO::FETCH_ASSOC);\r\n else\r\n return false;\r\n }", "function getGroupData($chamberId) {\r\n $sql = $this->db->prepare(\"SELECT DISTINCT(g.groupID), g.name, g.mailchimp_list_id, COUNT(gm.groupID) FROM GROUPS AS g LEFT OUTER JOIN GROUPMEMBERS as gm ON g.groupID = gm.groupID WHERE g.chamberID=:chamber_id GROUP BY g.groupID ORDER BY COUNT(gm.groupID) DESC\");\r\n if ($sql->execute(array(\r\n \"chamber_id\" => $chamberId\r\n ))) {\r\n $groups = $sql->fetchAll(PDO::FETCH_ASSOC);\r\n return $groups;\r\n }\r\n return false;\r\n }", "public function getMembersLeavingOffice(int $congress, string $chamber)\n {\n $earliestCongress = 111;\n\n $this->congressValidator->isValidCongress($congress, $earliestCongress);\n $this->congressValidator->isValidChamber($chamber);\n\n $uriStub = \"{$congress}/{$chamber}/members/leaving.json\";\n\n return $this->performApiRequest($uriStub);\n }" ]
[ "0.73190004", "0.6645987", "0.62595874", "0.59774035", "0.59544647", "0.5867948", "0.5847275", "0.5789874", "0.57801473", "0.5643668", "0.5597109", "0.55882555", "0.5572076", "0.5558976", "0.5558413", "0.55562127", "0.5533526", "0.55256444", "0.5503543", "0.550002", "0.5487516", "0.5478856", "0.546519", "0.5395297", "0.5318942", "0.5306312", "0.53052443", "0.5297382", "0.5268687", "0.5231279" ]
0.6867929
1
Get a list of the most recent new members of the current Congress
public function getNewMembers() { $uriStub = 'members/new.json'; return $this->performApiRequest($uriStub); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getNewMembers($limit = 10, $offset = -1)\n\t{\n\t\t$criteria = new CDbCriteria();\n\t\t$criteria->condition = \"superuser <> 1\";\n\t\t$criteria->limit = $limit;\n\t\t$criteria->offset = $offset;\n\t\t$criteria->order = \"created DESC\";\n\t\t$newMembers = ZoneUser::model()->findAll($criteria);\n\n\t\t// get info new member\n\t\t$arrayNewMember = array();\n\t\tif(!empty($newMembers)){\n\t\t\tforeach ($newMembers as $key => $user) {\n\t\t\t\tif ($user->id !== -1) {\n\t\t\t\t\t$user->setExtraInfo();\n\t\t\t\t\t$userInfo = ZoneApiResourceFormat::formatData('user', $user->toArray(true));\n\t\t\t\t\t$userInfo['stats'] = $user->stats;\n\t\t\t\t\tunset($userInfo['email']);\n\t\t\t\t\tunset($userInfo['location']);\n\t\t\t\t}\n\t\t\t\t$arrayNewMember[] = $userInfo;\n\t\t\t}\n\t\t}\n\t\treturn $arrayNewMember;\n\t}", "public function readNewMembers(){\r\n $results = array();\r\n\r\n if ( null !== $this->getDB() ) {\r\n $dbs = $this->getDB()->prepare('select * from Members, MemberStatus where members.MemberID = memberstatus.MemberID and StatusCode = \"A\" and DateNew = CURDATE()');\r\n\r\n if ( $dbs->execute() && $dbs->rowCount() > 0 ) {\r\n $results = $dbs->fetchAll(PDO::FETCH_ASSOC);\r\n }\r\n } \r\n return $results;\r\n }", "public function getListRecents(){\n\t\t$resultsUsers = [];\n\t\t$q = $this->pdo->query('SELECT * FROM utilisateur ORDER BY dateCreation DESC LIMIT 4');\n\t\twhile ($donnee = $q->fetch(PDO::FETCH_ASSOC)) {\n\t\t\t$resultsUsers[] = new Utilisateur($donnee);\n\t\t}\n\t\treturn $resultsUsers;\n\t}", "function getMembers() {\n\t\t$query = $this->createQuery();\n\t\t$query .= \"WHERE c2.status = '\" . KontakteData::$STATUS_MEMBER . \"'\";\n\t\t$query .= \" OR c2.status = '\" . KontakteData::$STATUS_ADMIN . \"' \";\n\t\t$query .= \"ORDER BY c2.name ASC\";\n\t\treturn $this->database->getSelection($query);\n\t}", "public function getExpiringMembers() {\n\t\t$date = new DateTime();\n\t\t$end = $date->setTimestamp(strtotime('+30 days'));\n\n\t\treturn Member::get()->filter(array(\n\t\t\t'MembershipStatus' => 'Verified',\n\t\t\t'ExpiryDate:LessThan' => $end->format('Y-m-d H:i:s'),\n\t\t\t'Notified' => 0\n\t\t));\n\t}", "public function get_recent_doctors(){\n $query = $this->m->port->p->query('SELECT * FROM quickblox WHERE regid !=\" '. $this->m->user_value('regid').'\" and role =\"'.M::ROLE_DOCTOR. '\" and (lastlogin>date_sub(now(), Interval 11 second) OR logout_time>date_sub(now(),Interval 10 second))');\n $doctors = array();\n $temp = array();\n foreach ($query->result() as $row){\n $temp['id'] = $row->id;\n $temp['regid'] = $row->regid;\n $temp['name'] = $row->name;\n $temp['status'] = $row->status;\n array_push($doctors, $temp);\n }\n return $doctors;\n }", "public function get_members(){\n return $this->connected_clients;\n }", "public function list_members() {\n\n\t\t//ignored users\n\t\t$stm = $this->db()->prepare('select \"to_big\" from \"member_settings\" where \"from_big\" = :current_member_big and \"chat_ignore\" = 1');\n\t\t$stm->execute(array(\n\t\t\t':current_member_big'\t=> $this->member_big,\n\t\t));\n\t\t$ignored_members_raw = $stm->fetchAll(PDO::FETCH_ASSOC);\n\t\t$ignored_members = array(0);\n\t\tforeach($ignored_members_raw as $member) {\n\t\t\t$ignored_members[] = $member['to_big'];\n\t\t}\n\t\t$ignored_members = implode(',', $ignored_members);\n\n\t\t//joined users\n\t\t$stm = $this->db()->prepare(\n\t\t\t'select distinct on (m.big) \"m\".\"big\", \"m\".\"name\"||\\' \\'||substring(\"m\".\"surname\" from 1 for 1)||\\'.\\' as \"name\", (case when \"c\".\"physical\"=1 then \\'onsite\\' else \\'online\\' end) as \"status\"\n\t\t\tfrom \"checkins\" \"c\"\n\t\t\t\tleft join \"members\" \"m\" on (\"c\".\"member_big\" = \"m\".\"big\")\n\t\t\twhere (\"c\".\"checkout\" is null or \"c\".\"checkout\" > now())\n\t\t\t\tand \"c\".\"event_big\" = (select \"event_big\" from \"checkins\" where \"member_big\" = :member_big and (\"checkout\" is null or \"checkout\" > now()) order by \"created\" desc limit 1)\n\t\t\t\tand (\"m\".\"last_web_activity\" > :online_timeout or \"m\".\"last_mobile_activity\" > :online_timeout)\n\t\t\t\tand \"m\".\"big\" != :member_big\n\t\t\t\tand \"m\".\"big\" not in ('.$ignored_members.')\n\t\t\torder by m.big, \"c\".\"created\" asc'\n\t\t);\n\t\t$stm->execute(array(\n\t\t\t':member_big'\t\t=> $this->member_big,\n\t\t\t':online_timeout'\t=> date('c', strtotime(ONLINE_TIMEOUT)),\n\t\t));\n\t\t$joined_members = $stm->fetchAll(PDO::FETCH_ASSOC);\n\n\t\t$joined_member_bigs = array(0);\n\t\tforeach($joined_members as $member) {\n\t\t\t$joined_member_bigs[] = $member['big'];\n\t\t}\n\t\t$joined_member_bigs = implode(',', $joined_member_bigs);\n\n\t\t//users we already had conversation with\n\t\t$stm = $this->db()->prepare(\n\t\t\t'select distinct on (m.big) \"m\".\"big\", \"m\".\"name\"||\\' \\'||substring(\"m\".\"surname\" from 1 for 1)||\\'.\\' as \"name\",\n\t\t\t\t(case when (\"m\".\"last_web_activity\" > :online_timeout or \"m\".\"last_mobile_activity\" > :online_timeout) then \\'online\\' else \\'offline\\' end) as \"status\"\n\t\t\tfrom \"member_rels\" \"r\"\n\t\t\t\tleft join \"members\" \"m\" on (\"m\".\"big\" = (case when \"r\".\"member1_big\"=:member_big then \"r\".\"member2_big\" else \"r\".\"member1_big\" end))\n\t\t\t\tleft join \"chat_messages\" as \"cm\" on (\"cm\".\"rel_id\" = \"r\".\"id\" and (case when \"cm\".\"from_big\"=:member_big then \"cm\".\"from_status\" else \"cm\".\"to_status\" end) = 1)\n\t\t\twhere \"m\".\"big\" != :member_big\n\t\t\t\tand (r.member1_big = :member_big OR r.member2_big = :member_big)\n\t\t\t\tand \"m\".\"big\" not in ('.$ignored_members.','.$joined_member_bigs.')\n\t\t\t\tand \"cm\".\"id\" > 0\n\t\t\torder by m.big'\n\t\t);\n\t\t$stm->execute(array(\n\t\t\t':member_big'\t\t=> $this->member_big,\n\t\t\t':online_timeout'\t=> date('c', strtotime(ONLINE_TIMEOUT)),\n\t\t));\n\t\t$history_members = $stm->fetchAll(PDO::FETCH_ASSOC);\n\n\t\tforeach($joined_members as $key=>$val) {\n\t\t\t$joined_members[$key]['img'] = ProfilePicture::get_resized($val['big'], 28, 28);\n\t\t}\n\n\t\tforeach($history_members as $key=>$val) {\n\t\t\t$history_members[$key]['img'] = ProfilePicture::get_resized($val['big'], 28, 28);\n\t\t}\n\n\n\t\treturn $this->reply(array(\n\t\t\t'joined' => $joined_members,\n\t\t\t'history' => $history_members,\n\t\t));\n\n\t}", "public function getRecentCreatedUsers()\n {\n $result = $this\n ->_model\n ->orderBy('created_at', 'desc')\n ->get();\n\n return $result;\n }", "public function compactList(){\n $output = array();\n $members = $this->members;\n foreach ($members as $value) {\n $member = array(\n 'id' => $value['id'],\n 'name' => $value['firstName'] . \" \" . $value['lastName'],\n 'num_boats' => count($value['boats'])\n );\n array_push($output, $member);\n }\n return $output;\n }", "public function actionLastMembers()\n {\n $dataProvider = new ActiveDataProvider(\n [\n 'query' => Member::getMembersWhoWaitingForConfirmEmail(),\n 'pagination' => [\n 'pageSize' => 0,\n ]\n ]);\n\n return $this->render('last-members', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "private function getLastUsers() {\n $last_five_users = array();\n $result = db_select('users_field_data', 'u')\n ->fields('u', array('uid', 'name', 'mail', 'created'))\n ->condition('u.created', REQUEST_TIME - 3600, '>')\n ->orderBy('created', 'DESC')\n ->range(0, 15)\n ->execute();\n\n $count = 0;\n foreach ($result as $record) {\n $last_five_users[$count]['uid'] = $record->uid;\n $last_five_users[$count]['name'] = $record->name;\n $last_five_users[$count]['email'] = $record->mail;\n $last_five_users[$count]['created'] = $record->created;\n $count++;\n }\n\n return $last_five_users;\n }", "function getFriendLastedPosting() {\n $sql = \"SELECT b.*,\n c.name \n FROM member_posting a\n INNER JOIN posting b \n ON b.id = a.posting_id\n INNER JOIN member c \n ON c.id = a.member_id\n WHERE a.member_id IN (\n SELECT friend_id FROM member_friend WHERE member_id = ?)\n ORDER BY b.last_update_time DESC LIMIT 10\";\n return getAll($sql, [getLogin()['mid']]);\n}", "public function getTopMembers(): array\n {\n $statement = \"SELECT * FROM \" . $this->table . \" ORDER BY id LIMIT \".self::MEMBERLIMIT;\n return $this->pdo->query($statement)->fetchAll();\n }", "public function findLastRegistered()\n {\n $qb = $this->createQueryBuilder('u')\n ->select('u')\n ->orderBy('u.createdAt', 'DESC')\n ->setMaxResults(4);\n\n return $qb->getQuery()->getResult();\n }", "public function getlatestCompanies()\n {\n $AdminDashboardModel = $this->model('AdminDashboardModel');\n $this->latestCompanies = $AdminDashboardModel->getLatestCompanies();\n }", "public static function latest($limit = 60){\n $key = self::$prefix['list'].\"latest\";\n $cartoons = [];\n if(Cache::exists($key)){\n $list = Cache::fetch($key);\n }else {\n $list = Functions::api_fetch(\"/cartoon/latest\");\n Cache::save($key, $list, RECENT_UPDATE_TIME);\n }\n $list = array_slice($list->cartoons,0,$limit);\n foreach ($list as $cartoon){\n $cartoons[] = Cartoon::get($cartoon->id);\n }\n return $cartoons;\n }", "public function verboseList(){\n $output = array();\n foreach ($this->members as $value) {\n }\n foreach ($this->members as $value) {\n $member = array(\n 'id' => $value['id'],\n 'firstName' => $value['firstName'],\n 'lastName' => $value['lastName'],\n 'birthNumber' => $value['birthNumber'],\n 'name' => $value['firstName'] . \" \" . $value['lastName'],\n 'boats' => $value['boats']\n );\n array_push($output, $member);\n }\n return $output;\n }", "function listOfUsers(){\n\t\n\t\t$users = [];\n\t\tforeach ($this->members as $obj){\n\t\t\t$user = array('name'=> $obj->getUserFullName(),'id'=>$obj->getUserID());\n\t\t\tarray_push($users, $user);\n\t\t}\n\t\treturn $users;\n\t}", "function getMembers(){\n\t\treturn $this->members;\n\t}", "function getMemberList() {\n return getAll(\"SELECT * FROM member \");\n}", "function getMembers()\r\n {\r\n // define the query\r\n $sql = \"SELECT * FROM member ORDER BY lname\";\r\n // prepare statement\r\n $statement = $this->_dbh->prepare($sql);\r\n // execute statement\r\n $statement->execute();\r\n // get result\r\n return $statement->fetchAll(PDO::FETCH_ASSOC);\r\n }", "public function getCreated_byList() {\n if ($this->cached['Created_by']) return array_values($this->cache['Created_by']);\n return XPClass::forName('de.uska.db.Player')\n ->getMethod('getPeer')\n ->invoke()\n ->doSelect(new Criteria(\n array('player_id', $this->getCreated_by(), EQUAL)\n ));\n }", "function membersemailist($memberquery){\n\t$f3=$this->f3;\n\t$members =\tnew Member($this->db);\n\t$memblist=$members->load();\n\t$membemails= $this->db->exec('SELECT distinct(email) as unqemail from members where u3ayear = '.'\"2015-2016\"'. ' and status =\"Active\" and email <> \"\" ' .$memberquery.' order by unqemail;');\n\t$output = iterator_to_array(new RecursiveIteratorIterator(\n new RecursiveArrayIterator($membemails)), FALSE);\n\treturn array_values($output);\n\t\n\t\n}", "public function iN_NewRegisteredUsers() {\n\t\t$query = mysqli_query($this->db, \"SELECT * FROM i_users ORDER BY iuid DESC LIMIT 5\") or die(mysqli_error($this->db));\n\t\twhile ($row = mysqli_fetch_array($query)) {\n\t\t\t$data[] = $row;\n\t\t}\n\t\tif (!empty($data)) {\n\t\t\treturn $data;\n\t\t}\n\t}", "public function countNewMembers()\n\t{\n\t\t$criteria = new CDbCriteria();\n\t\t$criteria->condition = \"superuser <> 1\";\n\t\t$criteria->order = \"created DESC\";\n\t\t$count = ZoneUser::model()->count($criteria);\n\t\treturn $count;\n\t}", "function fillMembers() \n\t{\n\t\t//\tselect members list\t\t\n\t\t$trs = db_query(\"select , from `ugmembers` order by ,\",$this->conn);\n\t\twhile($tdata = db_fetch_numarray($trs))\n\t\t{\n\t\t\t$this->members[] = array($tdata[1],$tdata[0]);\n\t\t}\n\t}", "function getRecent($limit) {\n $PDO = &DB::$PDO;\n static $recent;\n if (!$recent) {\n $mem = new cache;\n $mem->key = 'Recent';\n if (!$data = $mem->get()) {\n $rec = $PDO->query('SELECT u.username, u.country, a.time, a.size, c.name, c.id, a.passed, a.executed, c.active \n FROM attempts a, users u, challenges c \n WHERE a.user_id = u.id AND c.id=a.challenge_id AND active=\\'1\\'\n ORDER BY a.id DESC LIMIT 100');\n \n while (list($username,$country,$time,$size,$challenge_name,$challenge_id,$passed,$executed,$active)=$rec->fetch()) {\n if ($executed == 0) {\n $passed = 'pending';\n }\n else {\n $passed = $passed ? 'valid' : 'invalid';\n }\n $list[] = array('username' => $username,\n 'country' => $country,\n 'challenge_name' => $challenge_name,\n 'challenge_id' => $challenge_id,\n 'result' => $passed,\n 'time' => $time,\n 'size' => $size,\n 'challenge_active' => $active);\n \n }\n $mem->set(0,$list,MEMCACHE_COMPRESSED,1800);\n } else {\n $list = $data;\n $recent = $list;\n }\n } else {\n $list = $recent;\n }\n $list = array_slice($list,0,$limit,true);\n return $list;\n}", "private function makeActiveMemeberships() {\n\t\t$roles = array ();\n\t\t\n\t\tif ($this->memberships)\n\t\t\tforeach ( $this->memberships as $membership ) {\n\t\t\t\tif ($membership->end_date > time ())\n\t\t\t\t\t$roles [] = $membership->role;\n\t\t\t}\n\t\t\n\t\treturn $roles;\n\t}", "public function getRecentCreatedCourses()\n {\n $result = $this\n ->_model\n ->orderBy('created_at', 'desc')\n ->get();\n\n return $result;\n }" ]
[ "0.627372", "0.61850905", "0.6174401", "0.6114995", "0.6100552", "0.597774", "0.59293956", "0.5919237", "0.58966655", "0.5890074", "0.5864995", "0.5856403", "0.5777726", "0.5777397", "0.5717376", "0.57084703", "0.56799996", "0.56646717", "0.56153995", "0.5609165", "0.5596281", "0.55864877", "0.5570252", "0.55625904", "0.55567974", "0.54960907", "0.5484327", "0.5468498", "0.54673916", "0.5439153" ]
0.63905877
0
Compare bill sponsorship between two members who served in the same Congress and chamber
public function compareTwoMembersBillSponsorships(string $firstMemberId, string $secondMemberId, int $congress, string $chamber) { $this->formatValidator->isValidMemberIdFormat($firstMemberId); $this->formatValidator->isValidMemberIdFormat($secondMemberId); $this->congressValidator->isValidChamber($chamber); switch ($chamber) { case 'senate': $earliestCongress = 101; break; case 'house': default: $earliestCongress = 102; break; } $this->congressValidator->isValidCongress($congress, $earliestCongress); $uriStub = "members/{$firstMemberId}/bills/{$secondMemberId}/{$congress}/{$chamber}.json"; return $this->performApiRequest($uriStub); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compare_citations($x, $y)\n{\n\n if( !$x->sources[0]->citation->uuid){// && !$y->sources[0]->citation->uuid){\n $res = -1;\n //var_dump($y->sources[0]->citation->uuid);\n }elseif(!$y->sources[0]->citation->uuid){\n $res = 1;\n //var_dump($x->sources[0]->citation->uuid);\n }\n else{\n\n\n $author_team_x = cdm_ws_get(CDM_WS_REFERENCE_AUTHORTEAM, $x->sources[0]->citation->uuid);\n $author_team_y = cdm_ws_get(CDM_WS_REFERENCE_AUTHORTEAM, $y->sources[0]->citation->uuid);\n\n //same author, and different year\n if($author_team_x->titleCache == $author_team_y->titleCache){\n $x_year = substr(\n $x->sources[0]->citation->datePublished->start,\n 0,\n strpos($x->sources[0]->citation->datePublished->start,'-'));\n $y_year = substr(\n $y->sources[0]->citation->datePublished->start,\n 0,\n strpos($y->sources[0]->citation->datePublished->start,'-'));\n if ($x_year < $y_year){//the year of the first publication is smaller\n $res = -1;\n }\n else if($x_year == $y_year){ //if same year check the page\n $x_page = $x->sources[0]->citationMicroReference;\n $y_page = $y->sources[0]->citationMicroReference;\n if($x_page < $y_page){\n $res = -1;\n }\n else{\n $res = 1;\n }\n }else\n $res = 1;\n }\n //different author and the first one is alphabetically smaller\n //else if($x->sources[0]->citation->authorship->teamMembers[0]->lastname <\n //$y->sources[0]->citation->authorship->teamMembers[0]->lastname){\n else if ($author_team_x->titleCache < $author_team_y->titleCache)\t{\n $res = -1;\n }\n //different author and the second one is alphabetically smaller\n else{\n $res = 1;\n }\n\n }\n //var_dump($res);\n //var_dump(' ============ ');\n return $res;\n}", "public function checkCampaigns()\r\n\t{\r\n\t\t// get all the published campaigns and see if the customer satisfies any of them.\r\n\t\t$campaigns = (new \\Shop\\Models\\Campaigns)->setState('filter.published_today', true)->setState('filter.publication_status', 'published')->getList();\r\n\t\t//echo \"Published campaigns: \" . count($campaigns) . \"<br/>\";\r\n\r\n\t\t$indexed_campaigns = array();\r\n\t\tforeach ($campaigns as $campaign)\r\n\t\t{\r\n\t\t\ttry {\r\n\t\t\t\t$campaign->__user_qualifies = $campaign->customerQualifies( $this );\r\n\t\t\t\t$indexed_campaigns[(string) $campaign->id] = $campaign;\r\n\t\t\t} catch (\\Exception $e) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$matches = array();\r\n\r\n\t\t// if so, grant the customer the benefits, but only if the customer doesn't satisfy the rules of any descendants\r\n\r\n\t\t//echo \"Customer qualifies for this many campaigns: \" . count($indexed_campaigns) . \"<br/>\";\r\n\t\t//echo \"and they are: <br/>\";\r\n\t\tforeach ($indexed_campaigns as $key=>$indexed_campaign)\r\n\t\t{\r\n\t\t\t$next_match = $indexed_campaign;\r\n\r\n\t\t\t// Does the campaign have descendants?\r\n\t\t\tif ($indexed_campaign->__descendants = $indexed_campaign->ancestorsGetDescendants())\r\n\t\t\t{\r\n\t\t\t\tforeach ($indexed_campaign->__descendants as $descendant)\r\n\t\t\t\t{\r\n\t\t\t\t\tif (isset($indexed_campaigns[(string)$descendant->id]))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$next_match = $descendant;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$indexed_campaign->__replace_with = null;\r\n\t\t\tif ($next_match->id != $indexed_campaign->id)\r\n\t\t\t{\r\n\t\t\t\t$indexed_campaign->__replace_with = $next_match;\r\n\t\t\t}\r\n\r\n\t\t\tif (!array_key_exists((string) $next_match->id, $matches))\r\n\t\t\t{\r\n\t\t\t\t$matches[(string) $next_match->id] = $next_match;\r\n\t\t\t}\r\n\r\n\t\t\t//echo $indexed_campaign->title . \" (which has \" . count($indexed_campaign->__descendants) . \" descendants) <br/>\";\r\n\t\t}\r\n\r\n\t\t// Check all of the customer's current campaigns,\r\n\t\t// and if they have expired\r\n\t\t// OR if they are being replaced by a descendant,\r\n\t\t// expire the benefits\r\n\t\t$active_campaign_ids = array();\r\n\t\tif ($active_campaigns = (array) $this->{'shop.active_campaigns'})\r\n\t\t{\r\n\t\t\tforeach ($active_campaigns as $key=>$active_campaign_cast)\r\n\t\t\t{\r\n\t\t\t\t$active_campaign_id = (string) \\Dsc\\ArrayHelper::get($active_campaign_cast, 'id');\r\n\t\t\t\t$active_campaign_expires_time = \\Dsc\\ArrayHelper::get($active_campaign_cast, 'expires.time');\r\n\t\t\t\t$active_campaign = (new \\Shop\\Models\\Campaigns)->setState('filter.id', $active_campaign_id)->getItem();\r\n\r\n\t\t\t\t$replacing_with_descendant = false;\r\n\t\t\t\t// Does the campaign have descendants?\r\n\t\t\t\tif ($active_campaign->__descendants = $active_campaign->ancestorsGetDescendants())\r\n\t\t\t\t{\r\n\t\t\t\t\tforeach ($active_campaign->__descendants as $descendant)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (isset($matches[(string)$descendant->id]))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$replacing_with_descendant = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// are we replacing this? Has it expired?\r\n\t\t\t\tif ($active_campaign_expires_time < time() || $replacing_with_descendant)\r\n\t\t\t\t{\r\n\t\t\t\t\t// echo \"Removing customer from: \" . $active_campaign->title . \"<br/>\";\r\n\t\t\t\t\t$active_campaign->expireCustomerRewards( $this );\r\n\t\t\t\t\tunset($active_campaigns[$key]);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t// Only track this if it really is active\r\n\t\t\t\t\t$active_campaign_ids[] = $active_campaign_id;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\t//echo \"Customer's active campaigns: <br/>\";\r\n\t\t//echo \\Dsc\\Debug::dump($active_campaigns);\r\n\r\n\t\t//echo \"Customer should only be in these campaigns: <br/>\";\r\n\r\n\t\t// Now add the customer to any new campaigns they qualify for\r\n\t\tforeach ($matches as $match)\r\n\t\t{\r\n\t\t\t//echo $match->title . \"<br/>\";\r\n\r\n\t\t\tif (!in_array((string) $match->id, $active_campaign_ids))\r\n\t\t\t{\r\n\t\t\t\t$match->rewardCustomer( $this );\r\n\t\t\t\t//echo \"so Adding customer to: \" . $match->title . \"<br/>\";\r\n\t\t\t\t$active_campaigns[] = array(\r\n\t\t\t\t\t'id' => (string) $match->id,\r\n\t\t\t\t\t'title' => (string) $match->title,\r\n\t\t\t\t\t'activated' => \\Dsc\\Mongo\\Metastamp::getDate('now'),\r\n\t\t\t\t\t'expires' => \\Dsc\\Mongo\\Metastamp::getDate( $match->expires() ),\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Track current campaigns in the user object, shop.active_campaigns\r\n\t\t$this->{'shop.active_campaigns'} = array_values($active_campaigns);\r\n\r\n\t\treturn $this->save();\r\n\t}", "function matchingCommission($user_id, $userStatus)\n {\n \n global $obj_rep;\n \n $sqlcarry = mysql_fetch_assoc(mysql_query(\"select * from matching_income where user_id='\" . $user_id . \"' order by id desc limit 1\"));\n $carryLeft = $sqlcarry['carry_fwd_left'];\n $carryReft = $sqlcarry['carry_fwd_right'];\n \n $querys1 = mysql_fetch_array(mysql_query(\"select sum(mpv) as totalleftamount from manage_bv_history where status='0' and income_id='\" . $user_id . \"' and leg='left'\"));\n \n $currentleftTotal = mysql_fetch_array(mysql_query(\"select sum(mpv) as totalleft from manage_bv_history where income_id='\" . $user_id . \"' and leg='left'\"));\n \n \n \n \n ////////////////////////////////////////////////////total left with carry forward////////////// \n $leftTotal = $querys1['totalleftamount'] + $carryLeft;\n \n $querys12 = mysql_fetch_array(mysql_query(\"select sum(mpv) as totalrightamount from manage_bv_history where status='0' and income_id='\" . $user_id . \"' and leg='right'\"));\n \n $currentrightTotal = mysql_fetch_array(mysql_query(\"select sum(mpv) as totalright from manage_bv_history where income_id='\" . $user_id . \"' and leg='right'\"));\n \n \n \n ////////////////////////////////////////////////////total right with carry forward////////////// \n $rightTotal = $querys12['totalrightamount'] + $carryReft;\n \n $totalPair = min($leftTotal, $rightTotal);\n \n if ($totalPair >= 1000) {\n $totalPair = 1000;\n $leftCarryForward = 0;\n $rightCarryForward = 0;\n } else {\n $totalPair;\n \n if ($leftTotal < $rightTotal) {\n $leftCarryForward = 0;\n \n $rightCarryForward = $rightTotal - $leftTotal;\n \n }\n \n if ($rightTotal < $leftTotal) {\n $rightCarryForward = 0;\n $leftCarryForward = $leftTotal - $rightTotal;\n }\n \n if ($leftTotal == $rightTotal) {\n $leftCarryForward = 0;\n $rightCarryForward = 0;\n }\n \n }\n $commission = ($totalPair * (10 / 100)) * 1;\n $sts = ($userStatus == 3 ? 1 : 0);\n \n ////////////////////////////////insert record in table///////////////////\n if ($totalPair >= 100) {\n \n $sqlComission = array(\n 'user_id' => $user_id,\n 'carry_fwd_left' => $leftCarryForward,\n 'carry_fwd_right' => $rightCarryForward,\n 'match_left' => $totalPair,\n 'match_right' => $totalPair,\n 'income_pair' => $totalPair,\n 'all_pair' => $totalPair,\n 'lpair' => $currentleftTotal[totalleft],\n 'rpair' => $currentrightTotal[totalright],\n 'commission' => $commission,\n 'final_amount' => $commission,\n 'b_date' => date(\"Y-m-d\"),\n 'status' => $sts,\n 'remark' => 'Get Matching Commission pair wise'\n );\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t////////////////////mega matching Commission///////////////////////\n\t\t\t\n\t\t\t$sqlref=mysql_fetch_assoc(mysql_query(\"select * from user_registration where user_id='\".$user_id.\"'\"));\n\t\t\t$refId=$sqlref['ref_id'];\n\t\t\t\n\t\t\tif($refId!='cmp')\n\t\t\t{\n\t\t\t\t$sqlComissionmega = array(\n 'user_id' => $refId,\n 'carry_fwd_left' => $leftCarryForward,\n 'carry_fwd_right' => $rightCarryForward,\n 'match_left' => $totalPair,\n 'match_right' => $totalPair,\n 'income_pair' => $totalPair,\n 'all_pair' => $totalPair,\n 'lpair' => $currentleftTotal[totalleft],\n 'rpair' => $currentrightTotal[totalright],\n 'commission' => $commission,\n 'final_amount' => $commission,\n 'b_date' => date(\"Y-m-d\"),\n 'status' => $sts,\n 'remark' => 'Get Mega Matching Commission'\n );\n\t\t\t\n\t\t\t $lastIds = $obj_rep->insert_tbl($sqlComission, 'matching_income_mega');\n $fieldvalus = array(\n 'status' => 1\n );\n \n $condLevel6s = \" income_id='\" . $refId . \"' and status='0'\";\n $obj_rep->update_tbl($fieldvalus, 'manage_bv_history', $condLevel6s);\n \n $sqlmathicngs = mysql_query(\"select * from matching_income_mega where user_id = '\" . $refId . \"' and id='\" . $lastIds . \"' and status='1'\");\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t if (mysql_num_rows($sqlmathicngs) > 0) {\n \n $fetDatass = mysql_fetch_assoc($sqlmathicngs);\n /** update amount in final ewallet */\n mysql_query(\"update final_e_wallet set amount=(amount+$fetDatass[commission]) where user_id='\" . $refId . \"'\");\n \n \n /** get amount from final ewallet */\n $args_amount = mysql_fetch_assoc(mysql_query(\"select amount from final_e_wallet where user_id='\" . $refId . \"'\"));\n $Remarks = \" Get Mega Matching Commission\";\n \n /** Insert amount in credit_debit */\n $mega = \"INSERT INTO credit_debit SET user_id='\" . $refId . \"' , \n transaction_no='\" . $this->generate_transaction_number() . \"',\n credit_amt='\" . $fetDatass[commission] . \"',\n final_bal='\" . $args_amount['amount'] . \"',\n receiver_id='\" .$refId . \"',\n sender_id='$user_id',\n receive_date='\" . date(\"Y-m-d\") . \"',\n TranDescription = 'Get Matching commission',\n Remark='\" . $Remarks . \"'\n \";\n \n mysql_query($mega);\n \n }\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n \n $lastId = $obj_rep->insert_tbl($sqlComission, 'matching_income');\n $fieldvalu = array(\n 'status' => 1\n );\n \n $condLevel6 = \" income_id='\" . $user_id . \"' and status='0'\";\n $obj_rep->update_tbl($fieldvalu, 'manage_bv_history', $condLevel6);\n \n $sqlmathicng = mysql_query(\"select * from matching_income where user_id = '\" . $user_id . \"' and id='\" . $lastId . \"' and status='1'\");\n \n \n if (mysql_num_rows($sqlmathicng) > 0) {\n \n $fetDatas = mysql_fetch_assoc($sqlmathicng);\n /** update amount in final ewallet */\n mysql_query(\"update final_e_wallet set amount=(amount+$fetDatas[commission]) where user_id='\" . $user_id . \"'\");\n \n \n /** get amount from final ewallet */\n $args_amount = mysql_fetch_assoc(mysql_query(\"select amount from final_e_wallet where user_id='\" . $user_id . \"'\"));\n $Remark = \" Get Matching Commission\";\n \n /** Insert amount in credit_debit */\n $insert_cr_dr = \"INSERT INTO credit_debit SET user_id='\" . $user_id . \"' , \n transaction_no='\" . $this->generate_transaction_number() . \"',\n credit_amt='\" . $fetDatas[commission] . \"',\n final_bal='\" . $args_amount['amount'] . \"',\n receiver_id='\" . $user_id . \"',\n sender_id='',\n receive_date='\" . date(\"Y-m-d\") . \"',\n TranDescription = 'Get Matching commission',\n Remark='\" . $Remark . \"'\n \";\n \n mysql_query($insert_cr_dr);\n \n }\n\t\t\t\n\t\t\t\n\t\t\t/////////////////////////for voucher wallet information//////////////////////\n\t\t\t\n\t\t\t\t$voucherCom=$commission*(10/100);\n\t\t\t /** update amount in final ewallet */\n\t\t\t\tmysql_query(\"update voucher_e_wallet set amount=(amount+$voucherCom) where user_id='\" . $user_id . \"'\");\n \n \n /** get amount from final ewallet */\n $amoutnget = mysql_fetch_assoc(mysql_query(\"select amount from voucher_e_wallet where user_id='\" . $user_id . \"'\"));\n $Remarks = \" Get Voucher Bonus\";\n \n /** Insert amount in credit_debit */\n $invouhertable = \"INSERT INTO credit_debit_voucher SET user_id='\" . $user_id . \"' , \n transaction_no='\" . $this->generate_transaction_number_voucher() . \"',\n credit_amt='\" . $voucherCom . \"',\n final_bal='\" . $amoutnget['amount'] . \"',\n receiver_id='\" . $user_id . \"',\n sender_id='',\n receive_date='\" . date(\"Y-m-d\") . \"',\n TranDescription = 'Get Voucher Bonus',\n Remark='\" . $Remarks . \"'\n \";\n \n mysql_query($invouhertable);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//////////////////////////////////////end heree voucher /////////////////////////////////////\n\t\t\t\n\t\t\t\n\t\t}\n \n }", "function DiffStateAvail_AcceptOrigin($JobID) //if job accepted or not by any member at Origin\n {\n global $link;\n\n\t $str = \"Select tblmemberaction.MAID From tblmemberaction\n Inner Join tbljobs_location ON tblmemberaction.MAID = tbljobs_location.MAID\n Where tbljobs_location.Origin = '1' AND\n tblmemberaction.JobID = $JobID AND tblmemberaction.MID !=\" . $_SESSION['Member_Id'];\n\t\t\n\t $result_newQuery = mysql_query($str) or die(\"Query failed5\");\n $line = mysql_fetch_array($result_newQuery, MYSQL_ASSOC);\n $result = $line[MAID];\n \n\t if (count($result) > 0)\n\t {\n\t return 1;\n\t }\n\t else\n\t {\n\t return 0;\n\t }\n }", "function getChamberMembers($chamberID) {\r\n $sql = $this->db->prepare(\"SELECT UserID, firstname, lastname, email, businessname, expiry, archived, type\r\n FROM USER LEFT OUTER JOIN BUSINESS ON USER.businessID=BUSINESS.businessID WHERE USER.chamberID=:chamber_id\r\n ORDER BY lastname;\");\r\n if ($sql->execute(array(\r\n 'chamber_id' => $chamberID,\r\n ))) {\r\n return $sql->fetchall(PDO::FETCH_ASSOC);\r\n }\r\n return $chamberID;\r\n }", "function sort_members($a, $b){\n\t\t\t\t\t\t\t\t return (strtolower($a->organization) < strtolower($b->organization)) ? -1 : 1;\n\t\t\t\t\t\t\t\t}", "function bultoSimilar($bulto,$manifiesto)\n {\n $sql=<<<sql\n select bul_ref\n from manembxbulto\n where manemb_id=$manifiesto\nsql;\n\n $rs=&$this->con->Execute($sql);\n $cad=\"\";\n $sep=\",\";\n while(!$rs->EOF)\n {\n $cad.=\"'\".$rs->fields[0].\"'\".$sep;\n $rs->MoveNext();\n }\n \n //recuperar bultos quedados de igual origen y destino\n $oManEmb=new c_manifiesto_embarque($this->con,$this->usu_audit);\n $oManEmb->info($manifiesto);\n $sql=<<<sql\n select distinct(bq.bul_ref)\n from manembxbultoqueda bq, manembxbultoreal br\n where\n bq.bul_ref<>br.bul_ref\n and bq.manemb_id in \n (\n select distinct manemb_id from manifiesto_embarque\n where manemb_origen='$oManEmb->manemb_origen' and manemb_destino='$oManEmb->manemb_destino' ) \nsql;\n $rs=&$this->con->Execute($sql);\n while(!$rs->EOF)\n {\n $cad.=\"'\".$rs->fields[0].\"'\".$sep; \n $rs->MoveNext(); \n }\n $cad=substr($cad,0,(strlen($cad)-1));\n return($cad);\n }", "function rets_bsf_ismember ($roles, $agent1, $agency1, $agent2, $agency2) {\n\n $ismember1 = rets_bsf_ismember_agent ($roles, $agent1);\n $ismember2 = rets_bsf_ismember_agent ($roles, $agent2);\n\n if ($ismember1 == 'No' && $ismember2 == 'No') {\n return 'No';\n }\n\n // Set the variables for TYPE and UID so we don't error out\n if ($ismember1 == 'No') {\n $type1 = '';\n $uid1 = '';\n } else {\n $type1 = $ismember1[0];\n $uid1 = $ismember1[1];\n }\n if ($ismember2 == 'No') {\n $type2 = '';\n $uid2 = '';\n } else {\n $type2 = $ismember2[0];\n $uid2 = $ismember2[1];\n }\n \n $IsMember = array( \n 'ListAgentID' => $agent1,\n 'ListOfficeID' => $agency1,\n 'ListAgentType' => $type1,\n 'ListAgentUID' => $uid1,\n 'CoListAgentID' => $agent2,\n 'CoListOfficeID' => $agency2,\n 'CoListAgentType' => $type2,\n 'CoListAgentUID' => $uid2,\n );\n\n if ($ismember1 == 'No') {\n $IsMember['ListAgentID'] = $agent2;\n $IsMember['ListOfficeID'] = $agency2;\n $IsMember['ListAgentType'] = $type2;\n $IsMember['ListAgentUID'] = $uid2;\n $ismember2 = 'No';\n } \n if ($ismember2 == 'No') {\n $IsMember['CoListAgentID'] = '';\n $IsMember['CoListOfficeID'] = '';\n $IsMember['CoListAgentType'] = '';\n $IsMember['CoListAgentUID'] = '';\n\t$TeamMember = rets_bsf_get_teammember($roles,$IsMember['ListAgentUID']);\n\tif ($TeamMember<>'No') {\n\t $IsMember['CoListAgentID'] = $TeamMember[0];\n\t $IsMember['CoListOfficeID'] = $TeamMember[1];\n\t $IsMember['CoListAgentType'] = $TeamMember[2];\n\t $IsMember['CoListAgentUID'] = $TeamMember[3];\n\t}\n }\n return $IsMember;\n \n}", "function validateMember($member, $shareId, $balance) {\n\t\t$status = 1; // se inicializa el status y luego cambia si entra en las condiciones de bloqueo\n\t\t$message = '';\n\n\t\tif($balance < 0) {\n\t\t\t$balanceStatus = Config::get('partners.ACCESS_CONTROL_STATUS.SOCIO_ACCION_SALDO_DEUDOR'); // Archivo config\n\t\t\t// $status = $this->accessControlHelper->getAccesControlStatus($balanceStatus,$status);\n\t\t\t$status = $status - $balanceStatus;\n\t\t}\n\n\t\t$records = $this->recordRepository->getBlockedRecord($member);\n\t\tif(count($records)) {\n\t\t\tforeach ($records as $key => $value) {\n\t\t\t\t$recordStatus = Config::get('partners.ACCESS_CONTROL_STATUS.SOCIO_BLOQUEO_EXPEDIENTE');\n\t\t\t\t// $status = $this->accessControlHelper->getAccesControlStatus($recordStatus,$status);\n\t\t\t\t$status = $status - $recordStatus;\n\t\t\t\t$message .= 'Bloqueo activo por expediente :'.$value->id.', hasta la fecha '.$value->expiration_date.'<br>';\n\t\t\t}\n\t\t}\n\n\t\t$share = $this->shareRepository->find($shareId);\n\n\t\tif($share && $share->shareType && $share->shareType()->first()->access == 0) {\n\t\t\t$shareStatus = Config::get('partners.ACCESS_CONTROL_STATUS.SOCIO_ACCION_INACTIVA');\n\t\t\t$status = $status - $shareStatus;\n\t\t\t$message .= '* La Accion no posee acceso <br>';\n\t\t}\n\n\n\t\tif($share && $share->permit == 1) {\n\t\t\t$shareStatus = Config::get('partners.ACCESS_CONTROL_STATUS.SOCIO_ACCION_INACTIVA');\n\t\t\t$status = $status - $shareStatus;\n\t\t\t$message .= '* La accion '.$share->share_number.' tiene un permiso activo y no puede ingresar <br>';\n\t\t}\n\t\tif($share->status === 0) {\n\t\t\t$shareStatus = Config::get('partners.ACCESS_CONTROL_STATUS.SOCIO_ACCION_INACTIVA');\n\t\t\t// $status = $this->accessControlHelper->getAccesControlStatus($shareStatus,$status);\n\t\t\t$status = $status - $shareStatus;\n\t\t\t$message .= '* Accion Inactiva <br>';\n\t\t}\n\n\t\t$personStatus = $this->checkPersonStatus($member);\n\t\tif($personStatus === \"Inactivo\"){\n\t\t\t$personStatus = Config::get('partners.ACCESS_CONTROL_STATUS.SOCIO_INACTIVO');\n\t\t\t// $status = $this->getAccesControlStatus($personStatus,$status);\n\t\t\t$status = $status - $personStatus;\n\t\t\t$message .= '* Socio Inactivo <br>';\n\t\t}\n\t\tif($message !== '') {\n\t\t\t$currentPerson = $this->personModel->query(['name', 'last_name', 'rif_ci', 'card_number'])->where('id', $member)->first();\n\t\t\t$name = '<strong>'.$currentPerson->name.' '.$currentPerson->last_name.'</strong> Carnet: '.$currentPerson->card_number;\n\t\t\t$message = '<br><div><div>'.$name.'</div><div>'.$message.'</div></div>';\n\t\t}\n\t\t// se retorna el mensaje de error y el estatus , estos valores son usados para el registro final de cada miembro\n\t\treturn (object)[ 'message' => $message, 'status' => $status ];\n\t}", "function compareReports(CountyMarriage $r1, \n CountyMarriage $r2)\n{\n return $r1->compare($r2);\n}", "public function getSponsorname() {}", "function member_in_class($class, $member)\n{\n return $class->class_pin == $member->class->class_pin;\n}", "function intersection($searcher = array(), $candidate = array()){\r\n\t\t$set = array();\r\n\t\tforeach($searcher[\"MemberProfile\"] as $key_searchee=>$temp1){\r\n\t\t\tif ($key_searchee==\"member_id\"){\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tforeach($candidate[\"MemberProfile\"] as $key_candidate=>$temp2){\r\n\t\t\t\tif ($key_candidate==$key_searchee){\r\n\t\t\t\t\tif ($temp1[$key_searchee]==$temp2[$key_candidate]){\r\n\t\t\t\t\t\t$set[] = array($key_searchee=>$temp1);\t\t\t\t\t\r\n\t\t\t\t\t\tbreak;\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\t\t\r\n\t\t\t}\t\t\r\n\t\t}\r\n\t\treturn $set;\r\n\t}", "public function LoadSponsorIdsAndCredits() {\n $q = \"SELECT sponsorId,credits FROM DriverSponsorRelations WHERE driverId={$this->GetID()};\";\n $qresult = $this->db->sql->query($q);\n\n if ($qresult && $qresult->num_rows > 0) {\n for ($row = $qresult->fetch_assoc(); $row !== NULL; $row = $qresult->fetch_assoc()) {\n $id = $row[\"sponsorId\"];\n array_push($this->sponsorIds, $id);\n $this->credits[$id] = $row[\"credits\"];\n }\n\n $qresult->free();\n }\n else if (!$qresult) {\n return false;\n }\n\n return true;\n }", "public function searchCostBill() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n $criteria = new CDbCriteria;\n $criteria->order = 'id DESC';\n $criteria->compare('id', $this->id);\n $criteria->compare('bill_no', $this->bill_no, true);\n // $criteria->compare('bill_date', $this->bill_date, true);\n $criteria->compare('bill_from_date', $this->bill_from_date, true);\n $criteria->compare('bill_to_date', $this->bill_to_date, true);\n $criteria->compare('customer_id', $this->customer_id);\n // $criteria->compare('purchase_order_id', $this->purchase_order_id);\n $criteria->compare('item_id', $this->item_id);\n $criteria->compare('bill_type', $this->bill_type, true);\n $criteria->compare('print_type', $this->print_type, true);\n $criteria->compare('added_on', $this->added_on, true);\n $criteria->compare('particulars', $this->particulars, true);\n $criteria->condition=\"bill_type='cost_bill'\";\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "function getMemberContractList() {\n $sql = \"SELECT b.* \n FROM user_contract a INNER JOIN contract b ON a.contract_id = b.id \n WHERE a.user_type = 'member' AND a.uid = ? \n ORDER BY b.id DESC\";\n return getAll($sql, [getLogin()['mid']]);\n}", "function processPayment() {\n \n if ($this->creditPayment != 0.00){\n$fieldParse = new parseGatewayFields(); \n$fieldParse-> setCardName($this->cardName);\n$fieldParse-> setAchName($this->accountName);\n$fieldParse-> setCardType($this->cardType);\n$fieldParse-> setAccountType($this->accountType);\n$fieldParse-> setCardExpDate($this->cardYear);\n$fieldParse-> parsePaymentFields();\n\n //reassign vars for CS Credit Cards\n$ccFirstName = $fieldParse-> getCredtCardFirstName();\n$ccLastName = $fieldParse-> getCredtCardLastName();\n$ccCardType = $fieldParse-> getCardType();\n$ccCardYear = $fieldParse-> getCardYear(); \n$ccCardMonth = $this->cardMonth;\n$ccCardNumber = $this->cardNumber;\n$ccCardCvv = $this->cardCvv;\n\n\n \n$club_id = $_SESSION['location_id'];\n \n$dbMain = $this->dbconnect();\n\n\n$stmt = $dbMain->prepare(\"SELECT MIN(club_id) FROM club_info WHERE club_name != ''\");//>=\n$stmt->execute(); \n$stmt->store_result(); \n$stmt->bind_result($club_id); \n$stmt->fetch();\n$stmt->close();\n \n$stmt = $dbMain ->prepare(\"SELECT gateway_id, passwordfd FROM billing_gateway_fields WHERE club_id= '$club_id'\");\n$stmt->execute(); \n$stmt->store_result(); \n$stmt->bind_result($userName, $password);\n$stmt->fetch();\n$stmt->close();\n \n$amount = $this->creditPayment;\n \n //credit\"\";//\n$ccnumber = $ccCardNumber;//\"4111111111111111\";\n$ccexp = \"$this->cardMonth$this->cardYear\";//\"1010\";\n$cvv = \"$this->cardCvv\";\n //==================\n$reference = \"CMP Balance\";\n$vaultFunction = \"\";//'add_customer';//'add_customer' or 'update_customer'\n$orderId = \"$this->contractKey\";\n$merchField1 = \"$reference $this->contractKey\";\n$payTypeFlag = \"creditcard\";//\"creditcard\"; // '' or 'check'\nif(isset($_SESSION['track1'])){\n $track1 = $_SESSION['track1'];\n}else{\n $track1 = \"\";\n}\nif(isset($_SESSION['track2'])){\n $track2 = $_SESSION['track2'];\n}else{\n $track2 = \"\";\n}\n\n \n$gw = new gwapi;\n$gw->setLogin(\"$userName\", \"$password\");\n$r = $gw->doSale($amount, $ccnumber, $ccexp, $cvv, $payTypeFlag, $orderId, $merchField1, $track1, $track2, $ccFirstName, $ccLastName);\n$ccAuthDecision = $gw->responses['responsetext'];\n$vaultId = $gw->responses['customer_vault_id'];\n$authCode = $gw->responses['authcode']; \n$transactionId = $gw->responses['transactionid'];\n$ccAuthReasonCode = $gw->responses['response_code'];\n//echo \"fubar $ccAuthReasonCode\";\n // exit;\n\n if($ccAuthReasonCode != 100) {\n \n $this->paymentStatus = \"$ccAuthDecision: $ccAuthDecision\";\n //$this->transactionId = $ccAuthReasonCode; \n }else{ \n $_SESSION['cc_request_id'] = $authCode;\n $this->paymentStatus = 1;\n //$this->transactionId = $ccAuthRequestId;\n }\n }\n if ($this->creditPayment == 0.00){\n $this->paymentStatus = 1;\n }\n}", "function processAuthority($phone1,$phone2,$call) {\r\n\t$perms_contract = $phone1[4]; //move to uppercase\r\n\t//$perms_contract = \"2.1.S\"; //move to uppercase\r\n\t$perms_caller = $phone2[4]; //move to uppercase\r\n\t//$perms_caller = \"3.2.S\"; //move to uppercase\r\n\t$flagged = false;\r\n\t//die();\r\n\t\r\n\tif($perms_contract != \"A\") { // These two lines remove the A level, all the rest are judgable \r\n\t\tif($perms_caller != \"A\") {\r\n\t\tif($perms_caller != \"F\") {\r\n\t\t\t// Zone Leader Catch \r\n\t\t\tif(strlen($perms_contract) < 2 || strlen($perms_caller) < 2) { //Tests for a whole number 1, 2, 3..\r\n\t\t\t\tif(substr($perms_contract,0,1) != substr($perms_caller,0,1)) $flagged = true; // Checks if the (1).1 and (1) match, flags if not\r\n\t\t\t}\r\n\t\t\t// District Catch\r\n\t\t\telseif(strlen($perms_contract) < 4 || strlen($perms_caller) < 4) { // Test for a float 1.2, 3.4..\r\n\t\t\t\tif(substr($perms_contract,0,1) != substr($perms_caller,0,1)) $flagged = true; // Checks if the (1).1 and (1).8 match, flags if not\r\n\t\t\t\telseif($perms_contract == $perms_caller) $flagged = false;\r\n\t\t\t\t//elseif(substr($perms_contract,2,1) != substr($perms_caller,2,1) && substr($perms_contract,2,1) != \"\" || substr($perms_caller,2,1) != \"\") $flagged = true; // Checks if the 1.(1) and 2.(1) match, flags if not\r\n\t\t\t}\r\n\t\t\t// Sister Catch\r\n\t\t\tif(strpos($perms_contract, \"S\") !== false || strpos($perms_caller, \"S\") !== false) { //Tests for S\r\n\t\t\t\tif(strpos($perms_contract, \"S\") !== strpos($perms_caller, \"S\")) { //Tests for one of them not being a sister\r\n\t\t\t\t\tif(substr($perms_contract,0,1) != substr($perms_caller,0,1)) $flagged = true; // Checks if the (1).1 and (1).8 match, flags if not\r\n\t\t\t\t\telseif(($perms_contract + \".S\") == $perms_caller) $flagged = false;\r\n\t\t\t\t\t//elseif(substr($perms_contract,2,1) != substr($perms_caller,2,1) && substr($perms_contract,2,1) != \"\" || substr($perms_caller,2,1) != \"\") $flagged = true; // Checks if the 1.(1) and 2.(1) match, flags if not\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t}\r\n\t}\r\n\t\t// Duration Catch\r\n\tif(strtotime(substr($call[3],11,8)) > strtotime($GLOBALS['maximum_duration'])) $flagged = true;\r\n\t\r\n\t// Time Catch\r\n\tif(strtotime($call[2]) >= strtotime($GLOBALS['maximum_time'])) $flagged = true;\r\n\telseif(strtotime($call[2]) <= strtotime($GLOBALS['minimum_time'])) $flagged = true;\r\n\t\r\n\t// Flagged from Directory\r\n\tif($perms_contract == \"F\" || $perms_caller == \"F\") $flagged = true;\r\n\t//if(!$flagged) echo \"free! <br>\";\r\n\t/** REPORTING ***************/\r\n\tif($GLOBALS['reporting']) {\r\n\t\tif($flagged) addToReport($GLOBALS['report'], array_merge($phone2,$call), \"caller-flagged\",$GLOBALS['iterations']); \r\n\t\telse addToReport($GLOBALS['report'], array_merge($phone2,$call), \"caller-ok\",$GLOBALS['iterations']);\r\n\t}\r\n\t\r\n}", "function InfInsertMember($db, $inf_contact_id, $sponsor_id = false, $inf_product_id = false, $inf_payment_id = false, $inf_invoice_id = false) {\n\n\tif (DEBUG) EchoLn(\"ContactId: $inf_contact_id\");\n\n\t$contact = InfGetContactDetails($inf_contact_id);\n\n\t# Look up if the member already exists or not\n\t$query = \"SELECT m.member_id \n\t\t\t\tFROM members m\n\t\t\t\tWHERE inf_contact_id='{$contact['Id']}'\n\t\t\t\tLIMIT 1\";\n\tif (DEBUG) EchoLn($query);\n\t$result = mysqli_query($db, $query) or die(mysqli_error($db) . '. ' . $query);\n\tif ($row = mysqli_fetch_assoc($result)) {\n\t\t# FAILURE - Already exists\n\t\treturn array(\"member_id\" => \"\", \"username\" => \"\", \"passwd\" => \"\", \"email\" => \"\", \"name\" => \"\");\n\t}\n\n\t$member_id = false;\n\n\t# See if the customer (email) is an existing member - by checking email\n\t$query = \"SELECT member_id, inf_contact_id\n\t\t\t\tFROM members m\n\t\t\t\tLEFT JOIN member_emails me USING (member_id)\n\t\t\t\tWHERE m.email='{$contact['Email']}'\n\t\t\t\tOR me.alternate_email='{$contact['Email']}'\n\t\t\t\tORDER BY m.create_date ASC, me.create_date DESC\";\n\tif (DEBUG) EchoLn($query);\n\t$result = mysqli_query($db, $query) or die(mysqli_error($db) . '. ' . $query);\n\tif ($row = mysqli_fetch_assoc($result)) {\n\t\t$member_id = $row['member_id'];\n\t\t# If the member was found and didn't have an inf_contact_id, then give it to them.\n\t\tif (!$row['inf_contact_id']) {\n\t\t\t$query = \"UPDATE members \n\t\t\t\t\t\tSET inf_contact_id='{$payment['ContactId']}'\n\t\t\t\t\t\tWHERE member_id='$member_id\";\n\t\t\tif (DEBUG) EchoLn($query);\n\t\t\t$result = mysqli_query($db, $query) or die(mysqli_error($db) . '. ' . $query);\n\t\t\tcontinue;\n\t\t}\n\t}\n\t\n\tif ($sponsor_id) {\n\t\t$sponsor_array['sponsor_id'] = $sponsor_id;\n\t\t$sponsor_array['tracking'] = \"\";\n\t\t$sponsor_array['sponsor_unknown'] = 0;\n\t} else {\n\t\t$sponsor_array = InfGetSponsorDetails($db, $inf_contact_id, $contact);\n\t}\n\n\t# Create new username for the member\n\t# Keep creating them randomly until we find one not being used\n\tdo {\n\t\t$username = substr(str_shuffle(\"abcdefghijkmnopqrstuvwxyz\"), 0, 2).substr(str_shuffle(\"2346789\"), 0, 3);\n\t\t$query = \"SELECT member_id \n\t\t\t\t\tFROM members\n\t\t\t\t\tWHERE username='$username'\";\n\t\tif (DEBUG) EchoLn($query);\n\t\t$result = mysqli_query($db, $query) or die(mysqli_error($db) . '. ' . $query);\n\t} while (mysqli_fetch_assoc($result));\n\n\t$passwd = substr(str_shuffle(\"2346789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ\"), 0, 5);\n\t\n\t$sponsor_row = GetRowMemberDetails($db, $sponsor_array['sponsor_id']);\n\t\n\t# Assign their coaches \n\t$coach_id_setup = GetCoachId ($db, \"setup\");\n\tif (isset($sponsor_row['team_leader_id']) && $sponsor_row['team_leader_id'] <> 0) {\n\t\t// Special case for 173 (he's team leader closing strategy sales himself\n\t\t$coach_id_scale = $sponsor_row['team_leader_id'];\n\t} else {\n\t\t$coach_id_scale = GetCoachId ($db, \"scale\");\n\t}\n\t$coach_id_traffic = GetCoachId ($db, \"traffic\");\n\t$coach_id_success = GetCoachId ($db, \"success\");\n\t\n\t// If they are coming in at RISE and above then open up step 8 for them\n\t$step_sql = '';\n\tif (in_array($inf_product_id, array(INF_PRODUCT_ID_BAS_RIS_H, INF_PRODUCT_ID_BAS_RIS_C))) {\n\t\t$step_sql = \", steps_completed = 1.6\n\t\t\t\t\t, step_unlocked = 2.2\";\t\n\t\t$coach_id_startup = 0;\n\t\tEmailNewMemberCoach($db, \"S2\", $coach_id_setup, $member_row);\n\t} else {\n\t\tEmailNewMemberCoach($db, \"S1\", $coach_id_startup, $member_row);\n\t\t$coach_id_startup = GetCoachId ($db, \"startup\");\t\t\n\t}\n\n\t$date = date(\"Y-m-d H:i:s\", strtotime($contact['DateCreated']));\n// , inf_aff_id\t='$inf_aff_id'\n\t$query = \"INSERT INTO members\n\t\t\t\tSET inf_contact_id\t='{$contact['Id']}'\n\t\t\t\t, sponsor_id\t\t='{$sponsor_array['sponsor_id']}'\n\t\t\t\t, team_leader_id\t='{$sponsor_row['team_leader_id']}'\n\t\t\t\t, username\t\t\t='$username'\n\t\t\t\t, passwd\t\t\t='$passwd'\n\t\t\t\t, name\t\t\t='{$contact['FirstName']} {$contact['LastName']}'\n\t\t\t\t, email\t\t\t='{$contact['Email']}'\n\t\t\t\t, phone\t\t\t='{$contact['Phone1']}'\n\t\t\t\t, first_name\t='{$contact['FirstName']}'\n\t\t\t\t, last_name\t\t='{$contact['LastName']}'\n\t\t\t\t, address\t\t='{$contact['StreetAddress1']}'\n\t\t\t\t, city\t\t\t='{$contact['City']}'\n\t\t\t\t, state\t\t\t='{$contact['State']}'\n\t\t\t\t, zip\t\t\t='{$contact['PostalCode']}'\n\t\t\t\t, country\t\t='{$contact['Country']}'\n\t\t\t\t, t\t\t\t\t='{$sponsor_array['tracking']}'\n\t\t\t\t, ip\t\t\t='{$_SERVER['REMOTE_ADDR']}'\n\t\t\t\t$step_sql\n\t\t\t\t, sponsor_unknown\t='{$sponsor_array['sponsor_unknown']}'\n\t\t\t\t, join_date\t\t\t='$date'\n\t\t\t\t, create_date\t\t=NOW()\";\n\tif (DEBUG) EchoLn($query);\n\t$result = mysqli_query($db, $query) or die(mysqli_error($db) . '. ' . $query);\n\t$member_id = mysqli_insert_id($db);\n\n\t_InfGiveBonuses ($db, $inf_contact_id, $inf_product_id, $inf_payment_id, $inf_invoice_id, $card_id);\n\t\n\t# SUCCESS\n\t$query = \"INSERT INTO member_coaches\n\t\t\t\tSET member_id\t='$member_id'\n\t\t\t\t, coach_id_startup\t='$coach_id_startup'\n\t\t\t\t, coach_id_setup\t='$coach_id_setup'\n\t\t\t\t, coach_id_scale\t='$coach_id_scale'\n\t\t\t\t, coach_id_traffic\t='$coach_id_traffic'\n\t\t\t\t, coach_id_success\t='$coach_id_success'\n\t\t\t\t, start_date\t\t='$date'\";\n if (DEBUG) EchoLn($query);\n\t$result = mysqli_query($db, $query) or die(mysqli_error($db) . '. ' . $query);\n\n\t# Remove from GetResponse\n\tGRMoveContactCampaign($contact['Email']);\n\n\t$member_row = GetRowMember($db, $member_id);\n\t\n\t# Email Member, Welcome Coach, S1 Coach and Sponsor \n\tEmailNewMember($db, $member_id);\n\tEmailNewMemberCoach($db, \"Welcome\", $coach_id_setup, $member_row);\n\tEmailNewMemberSponsor($db, $sponsor_row, $member_row, $inf_product_id);\n\t\t\t\t\n\treturn $member_row;\n}", "function cc_bill($cc_info, $member, $amount, \n $currency, $product_description, \n $charge_type, $invoice, $payment){\n global $config;\n $log = array();\n //////////////////////// cc_bill /////////////////////////\n\n srand(time());\n if ($charge_type == CC_CHARGE_TYPE_TEST) \n $amount = \"1.00\";\n $vars = array(\n \"type\" => 'sale',\n \"username\" => $this->config['login'],\n \"password\" => $this->config['pass'],\n \"orderid\" => $payment['payment_id'],\n \"amount\" => $amount,\n \"orderdescription\" => $product_description\n );\n if($charge_type == CC_CHARGE_TYPE_RECURRING){\n $vars['customer_vault_id'] = $member['data']['inspirepay_customer_vault_id'];\n }else{\n $vars +=array(\n \"ccnumber\" => $cc_info['cc_number'],\n \"ccexp\" => $cc_info['cc-expire'],\n \"email\" => $member['email'],\n \"firstname\" => $cc_info['cc_name_f'],\n \"lastname\" => $cc_info['cc_name_l'],\n \"address1\" => $cc_info['cc_street'],\n \"city\" => $cc_info['cc_city'],\n \"state\" => $cc_info['cc_state'],\n \"zip\" => $cc_info['cc_zip'],\n \"country\" => $cc_info['cc_country'],\n \"ipaddress\" => $member['remote_addr'] ? $member['remote_addr'] : $_SERVER['REMOTE_ADDR'],\n \"phone\" => $cc_info['cc_phone']\n );\n if ($cc_info['cc_code'])\n $vars['cvv'] = $cc_info['cc_code'];\n }\n \n // prepare log record\n $vars_l = $vars; \n if($vars['ccnumber'])\n $vars_l['ccnumber'] = $cc_info['cc'];\n if ($vars['cvv'])\n $vars_l['cvv'] = preg_replace('/./', '*', $vars['cvv']);\n $log[] = $vars_l;\n /////\n $res = $this->run_transaction($vars);\n $log[] = $res;\n\n if ($res['response'] == '1'){ \n if ($charge_type == CC_CHARGE_TYPE_TEST)\n $this->void_transaction($res['transactionid'], $log);\n return array(CC_RESULT_SUCCESS, \"\", $res['transactionid'], $log);\n } elseif ($res['response'] == '2') {\n return array(CC_RESULT_DECLINE_PERM, $res['responsetext'], \"\", $log);\n } else {\n return array(CC_RESULT_INTERNAL_ERROR, $res['responsetext'], \"\", $log);\n }\n }", "public function verification_by_member($deal_id,$mem_id,&$response_msg){\n\t\t$db = new db();\n\t\t\n\t\t$q = \"select added_by_mem_id from \".TP.\"transaction where id='\".mysql_real_escape_string($deal_id).\"'\";\n\t\t$ok = $db->select_query($q);\n\t\tif(!$ok){\n\t\t\treturn false;\n\t\t}\n\t\t$row = $db->get_row();\n\t\tif($row['added_by_mem_id'] == $mem_id){\n\t\t\t$response_msg = \"As the submitter of this deal, you cannot verify it\";\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t$q = \"select count(*) as cnt from \".TP.\"transaction_verifiers where deal_id='\".mysql_real_escape_string($deal_id).\"' and mem_id='\".mysql_real_escape_string($mem_id).\"'\";\n\t\t$ok = $db->select_query($q);\n\t\tif(!$ok){\n\t\t\treturn false;\n\t\t}\n\t\t$row = $db->get_row();\n\t\tif($row['cnt'] > 0){\n\t\t\t/*******\n\t\t\tthis member has already verified the deal as ok\n\t\t\t*********/\n\t\t\t$response_msg = \"You have already confirmed the detail\";\n\t\t\treturn true;\n\t\t}\n\t\t$q = \"insert into \".TP.\"transaction_verifiers set deal_id='\".mysql_real_escape_string($deal_id).\"', mem_id='\".mysql_real_escape_string($mem_id).\"', date_verified='\".date('Y-m-d H:i:s').\"'\";\n\t\t$ok = $db->mod_query($q);\n\t\tif(!$ok){\n\t\t\treturn false;\n\t\t}\n\t\t$response_msg = \"Thank you for confirming the deal detail\";\n\t\treturn true;\n\t}", "public function checkOverlap()\n {\n global $zdb;\n\n try {\n $select = $zdb->select(self::TABLE, 'c');\n $select->columns(\n array('date_debut_cotis', 'date_fin_cotis')\n )->join(\n array('ct' => PREFIX_DB . ContributionsTypes::TABLE),\n 'c.' . ContributionsTypes::PK . '=ct.' . ContributionsTypes::PK,\n array()\n )->where(Adherent::PK . ' = ' . $this->_member)\n ->where(array('cotis_extension' => new Expression('true')))\n ->where->nest->nest\n ->greaterThanOrEqualTo('date_debut_cotis', $this->_begin_date)\n ->lessThan('date_debut_cotis', $this->_end_date)\n ->unnest\n ->or->nest\n ->greaterThan('date_fin_cotis', $this->_begin_date)\n ->lessThanOrEqualTo('date_fin_cotis', $this->_end_date);\n\n if ( $this->id != '' ) {\n $select->where(self::PK . ' != ' . $this->id);\n }\n\n $results = $zdb->execute($select);\n $result = $results->current();\n if ( $result !== false ) {\n $d = new \\DateTime($result->date_debut_cotis);\n\n return _T(\"- Membership period overlaps period starting at \") .\n $d->format(_T(\"Y-m-d\"));\n }\n return true;\n } catch (\\Exception $e) {\n Analog::log(\n 'An error occured checking overlaping fee. ' . $e->getMessage(),\n Analog::ERROR\n );\n return false;\n }\n }", "function cons_benef2($ced)\r\n\t{\r\n\t \t$sql=\"SELECT * FROM slc_benef WHERE ced_benf=\".$ced;\r\n\t\t$result=mysql_query($sql,$this->conexion);\r\n\t\t//echo $sql;\r\n\t\tif ($result)\r\n\t\t { \r\n\t\t\twhile($reg= mysql_fetch_row($result))\r\n\t\t\t {\r\n\t\t\t if($reg[2]==$ced)\r\n\t\t\t { $cad=$reg[1].\"**\".$reg[2].\"**\".$reg[3].\"**\".$reg[6].'**'.$reg[7];\r\n\t\t\t return $cad;\r\n\t\t\t\t }\r\n\t\t\t else\r\n\t\t\t\t return false; \t \r\n\t\t\t }\r\n\t\t }\t \r\n\t\telse\r\n\t\t\t return false;\r\n\t}", "function get_consumer_details() {\n\t\t$consumer_no = $_REQUEST['consumer_no'];\n\t\t$biller_id = $_REQUEST['biller_id'];\n\t\tif (!empty($consumer_no) && !empty($biller_id)) {\n\t\t\t$biller_in_id = 'biller_user.biller_customer_id_no';\n\t\t\t$records_consumer = $this -> conn -> join_two_table_where_two_field('biller_user', 'biller_details', 'biller_id', 'biller_id', $biller_in_id, $consumer_no, 'biller_user.biller_id', $biller_id);\n\n\t\t\tif (!empty($records_consumer)) {\n\t\t\t\t$biller_id = $records_consumer[0]['biller_id'];\n\t\t\t\t$biller_company = $records_consumer[0]['biller_company_name'];\n\t\t\t\t$biller_company_logo = biller_company_logo . $records_consumer[0]['biller_company_logo'];\n\t\t\t\t$biller_user_name = $records_consumer[0]['biller_user_name'];\n\t\t\t\t$biller_customer_id = $records_consumer[0]['biller_customer_id_no'];\n\t\t\t\t$bill_amount = $records_consumer[0]['bill_amount'];\n\t\t\t\t$bill_due_date = $records_consumer[0]['bill_due_date'];\n\t\t\t\t$biller_user_email = $records_consumer[0]['biller_user_email'];\n\t\t\t\t$biller_user_contact_no = $records_consumer[0]['biller_user_contact_no'];\n\t\t\t\t$bill_pay_status = $records_consumer[0]['bill_pay_status'];\n\t\t\t\t$bill_invoice_no = $records_consumer[0]['bill_invoice_no'];\n\t\t\t\t$current_date = date(\"Y-m-d\");\n\t\t\t\tif ($bill_due_date >= $current_date) {\n\t\t\t\t\tif ($bill_pay_status == '1') {\n\t\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Bill already paid\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$post = array('status' => 'true', \"biller_id\" => $biller_id, 'biller_company' => $biller_company, 'biller_logo' => $biller_company_logo, 'consumer_name' => $biller_user_name, 'consumer_id' => $biller_customer_id, 'bill_amount' => $bill_amount, 'due_date' => $bill_due_date, 'consumer_email' => $biller_user_email, 'consumer_contact_no' => $biller_user_contact_no, 'bill_pay_status' => $bill_pay_status, 'bill_invoice_no' => $bill_invoice_no);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Bill Paid date is expired\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$post = array('status' => \"false\", \"message\" => \"No Bill Found from this consumer no\");\n\t\t\t}\n\t\t} else {\n\t\t\t$post = array('status' => \"false\", \"message\" => \"Missing Parameter\", 'consumer_no' => $consumer_no, 'biller_id' => $biller_id);\n\t\t}\n\t\techo $this -> json($post);\n\n\t}", "function compairUserLink($d1,$d2) {\n if (isset($d1[\"lastname\"]) && isset($d2[\"lastname\"]) && isset($d1[\"firstname\"]) && isset($d2[\"firstname\"])) {\n return getPersonLink($d1[\"lastname\"],$d1[\"firstname\"])==getPersonLink($d2[\"lastname\"],$d2[\"firstname\"]);\n }\n else\n return false;\n}", "function compareStrainByDistance($strainA, $strainB)\n{\n // Same hamming distance to reference\n if ($strainA['dist_to_ref'] == $strainB['dist_to_ref'])\n {\n //sort by alphetical order\n if($strainA['name'] != $strainB['name'])\n {\n return ($strainA['name'] < $strainB['name']) ? -1 : 1;\n }\n // in the other case, they are equal\n return 0;\n }\n return ($strainA['dist_to_ref'] < $strainB['dist_to_ref']) ? -1 : 1;\n}", "public function has_competitor($memberid){\n $sql = \"SELECT * FROM tournamentCompetitors WHERE tournamentID=$this->id AND competitorID=$memberid\";\n $result = self::$database->query($sql);\n if (mysqli_num_rows($result)==1){\n return true;\n }\n return false;\n }", "function getCompatibleCandidates($searchee = array(), $criteria=array(), $limit=-1){\t\r\n\t\t$action=\"profile_search\";\r\n\t\t$registered_date=null;\r\n\t\tforeach($criteria as $key=>$value){ //plugs variables to place\r\n\t\t\tif ($key==\"action\"){\r\n\t\t\t\t$action = $value;\r\n\t\t\t}else if ($key==\"registered_date\"){\r\n\t\t\t\t$registered_date = $value;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($action==\"searchbydateprofile\"){\r\n\t\t\t\r\n\t\t\t$condition = array(\"DATE(Member.created) = '\".$registered_date.\"'\",\r\n\t\t\t\t\t\t\t\t \"gender_id\"=>$searchee[\"Member\"][\"looking_for_id\"], \"Member.id <> \".$searchee[\"Member\"][\"id\"]);\r\n\t\t\t\r\n\t\t}else if ($action==\"all\"){\r\n\t\t\t$condition = array(\"gender_id\"=>$searchee[\"Member\"][\"looking_for_id\"], \"Member.id <> \".$searchee[\"Member\"][\"id\"]);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t}\r\n\t\t$this->controller->Member->unbindModel(array(\"hasMany\"=>array(\"GiftAvailTransaction\", \"Notification\", \"CreditCard\", \"PrivateMessage\", \"SentGift\", \"SubscriptionTransaction\", \"MemberProfileAnswer\", \"Album\", \"InMyOwnWordsAnswer\", \"MembersInterest\", \"Connection\", \"ReceiveMessage\", \"ShoppedItem\")));\r\n\t\tif ($limit==-1){ \r\n\t\t\t$members = $this->controller->Member->find(\"all\", \r\n\t\t\t\t\t\tarray(\"conditions\"=>$condition));\r\n\t\t}else{\r\n\t\t\t$members = $this->controller->Member->find(\"all\", array(\"conditions\"=>$condition, \"limit\"=>$limit));\t\t\t\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t$matches = array();\r\n\t\tforeach ($members as $member){\r\n\r\n\t\t\t$passed = true;\r\n\t\t\tif (isset($searchee[\"MemberSetting\"])){\r\n\t\t\t\tif ($this->validAge($searchee,$member)&&$this->validDistance($searchee,$member)){\r\n\t\t\t\t\t$passed = true;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t$passed = true;\r\n\t\t\t}\r\n\t\t\tif ($passed){\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t$data[\"Match\"][\"matched_id\"] = $member[\"Member\"][\"id\"];\r\n\t\t\t\t$data[\"Match\"][\"member_id\"] = $searchee[\"Member\"][\"id\"];\r\n\t\t\t\t$data[\"Match\"][\"compatibility\"] = $this->getCompatibilityByWeight ($searchee, $member);\r\n\t\t\t\tif ($data[\"Match\"][\"compatibility\"]!=0){\r\n\t\t\t\t\t$matches[] = $this->controller->Match->save_match($data);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $matches;\t\r\n\t\t\r\n\t}", "function checkBookingRules_vangen( $memberBookings, $guestBookings, $cancels )\n\t{\n\t\t$bookingSession = getBookingSession( );\n\t\t$user = $bookingSession->getUser( );\n\t\t$userid = $user->getDbColTrim( \"userid\" );\n\n\t\t$bookingErrors = new Booking_message;\n\t\t$bookingErrors->setHtmlPreSuffix( booking_error_html_prefix, booking_error_html_suffix );\n\t\t$member = new Booking_user( );\n\t\t$room1 = new Booking_resource( );\n\t\t$room2 = new Booking_resource( );\n\t\t$ownbookingfound = FALSE;\n\n\t\t# Check for valid membership numbers\n\t\tif ( is_array( $memberBookings ) )\n\t\t{\n\t\t\twhile ( list( $key, $booking ) = each( $memberBookings ) )\n\t\t\t{\n\t\t\t\tif ( !$member->getValidMember( $booking->getDbCol( \"useridbooked\" ) ) )\n\t\t\t\t{\n\t\t\t\t\t$room1->getResource( $booking->getDbCol( \"arrangementid\" ), $booking->getDbCol( \"resourceid\" ) );\n\n\t\t\t\t\t$errormsg = \"Medlemsnummer: \" .$booking->getDbCol( \"useridbooked\" ) .\" på \"\n\t\t\t\t\t.$room1->getDbCol( \"name\" ) .\" plass \"\n\t\t\t\t\t.$memberBookings[ $key ]->getDbCol( \"placenum\" ) .\" er ugyldig.\";\n\t\t\t\t\t$bookingErrors->addMessage( $errormsg );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$ownbookingfound = ( $ownbookingfound || ( $userid == $booking->getDbColTrim( \"useridbooked\" ) ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t# If no errors present check for multiple bookings of the same member\n\t\tif ( $bookingErrors->isEmpty( ) )\n\t\t{\n\t\t\tif ( is_array( $memberBookings ) )\n\t\t\t{\n\t\t\t\tfor ( $i = 0; $i < count( $memberBookings ); $i++ )\n\t\t\t\t{\n\t\t\t\t\tfor ( $j = $i+1; $j < count( $memberBookings ); $j++ )\n\t\t\t\t\t{\n\t\t\t\t\t\tif ( $memberBookings[ $i ]->getDbCol( \"useridbooked\" ) == $memberBookings[ $j ]->getDbCol( \"useridbooked\" ) )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$room1->getResource( $memberBookings[ $i ]->getDbCol( \"arrangementid\" ), $memberBookings[ $i ]->getDbCol( \"resourceid\" ) );\n\t\t\t\t\t\t\t$room2->getResource( $memberBookings[ $j ]->getDbCol( \"arrangementid\" ), $memberBookings[ $j ]->getDbCol( \"resourceid\" ) );\n\n\t\t\t\t\t\t\t$errormsg = \"Medlemsnummer: \" .$memberBookings[ $i ]->getDbCol( \"useridbooked\" ) .\" er forsøkt booket flere ganger innenfor perioden. \"\n\t\t\t\t\t\t\t.$room1->getDbColTrim( \"name\" ) .\" plass \" .$memberBookings[ $i ]->getDbCol( \"placenum\" ) .\" og \"\n\t\t\t\t\t\t\t.$room2->getDbColTrim( \"name\" ) .\" plass \" .$memberBookings[ $j ]->getDbCol( \"placenum\" ) .\".\";\n\t\t\t\t\t\t\t$bookingErrors->addMessage( $errormsg );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\t# Check of guest bookings\n\t\tif ( $bookingErrors->isEmpty( ) && is_array( $guestBookings ) )\n\t\t{\n\t\t\t# Create array with members that are not bound by the guest booking rules\n\t\t\teval( \"\\$noGuestLimitations = array( \" .Booking_noGuestLimitations .\" );\" );\n\n\t\t\t# Check if guest booking limitations should apply\n\t\t\tif ( !array_key_exists( $userid, $noGuestLimitations ) )\n\t\t\t{\n\t\t\t\t# Check for guest bookings without own booking\n\t\t\t\tif ( !$ownbookingfound )\n\t\t\t\t{\n\t\t\t\t\t$errormsg = \"Du kan ikke booke gjester (booking hvor medlemsnummer ikke er registrert) uten å bo på Vangen selv i samme periode.\";\n\t\t\t\t\t$bookingErrors->addMessage( $errormsg );\n\t\t\t\t}\n\n\t\t\t\t# Check for too many guest bookings\n\t\t\t\tif ( $bookingErrors->isEmpty( ) && ( count( $guestBookings ) > Vangen_max_guest_bookings ) )\n\t\t\t\t{\n\t\t\t\t\t$errormsg = \" Du har booket for mange gjester (booking hvor medlemsnummer ikke er registrert). Maks antall gjester er \" .Vangen_max_guest_bookings .\".\";\n\t\t\t\t\t# $errormsg .= \"<br>\\n\" . count( $memberBookings ) .\"-\" .count( $guestBookings ) .\"-\" .count( $cancels );\n\t\t\t\t\t$bookingErrors->addMessage( $errormsg );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\treturn( $bookingErrors );\n\t}", "public function getSponsorContract(Sponsor $sponsor, Team $team, $start, $end, $status = -1, $year) {\r\n\t\t$contract = NULL;\r\n\t\t$tmpEnd = 0;\r\n\t\t// $sponsor;\r\n\t\t// echo $year;\r\n\t\t$sponsorContracts = $this->getSponsorContracts($sponsor, $team, $start, $end, $status, $year);\r\n\r\n\t\t/* search for the most recent contract */\t\r\n\t\tforeach($sponsorContracts as $sponsorContract) {\r\n\t\t\t/* check weather this contract is the latest */\r\n\t\t\tif($sponsorContract->getEnd() > $tmpEnd) {\r\n\t\t\t\t$contract = $sponsorContract;\r\n\t\t\t\t/* set new reference end date */\r\n\t\t\t\t$tmpEnd = $sponsorContract->getEnd();\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t\t/* return sponsor contract */\r\n\t\treturn $contract;\r\n\t}" ]
[ "0.5376475", "0.5031117", "0.49625513", "0.49073452", "0.48976406", "0.48951378", "0.48256844", "0.46761075", "0.46516463", "0.46340224", "0.46296656", "0.46080282", "0.4603489", "0.45780826", "0.4576223", "0.4570238", "0.4570038", "0.45478666", "0.45273718", "0.45207253", "0.4520071", "0.45158136", "0.45156378", "0.4504287", "0.45011324", "0.44981334", "0.44908896", "0.44809192", "0.44681722", "0.44653147" ]
0.66868687
0
Method returning list of attributes (data columns) in selected dataset
public function getPpAttributes(PpDataset $ppDataset) { $query=$this->db->prepare('SHOW COLUMNS IN `'.$ppDataset->id.'`;'); $query->execute(); $columns=$query->fetchAll(PDO::FETCH_CLASS); $result=[]; foreach ($columns as $column){ $result[]=new PpAttribute($column->Field, $ppDataset->id, null, $column->Field, self::encodeDbDataType($column->Type), null); } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getColumnsAttribute()\n {\n return $this->fetchData[self::COLUMNS];\n }", "public function getAttributesNames(){\n\t\t$this->_connect();\n\t\treturn ActiveRecordMetaData::getAttributes($this->_source, $this->_schema);\n\t}", "public function getData(){\n $values = array();\n $attributes = $this->defineAttributes();\n if(property_exists($this, 'handle') && property_exists($this, 'type')){\n $matrixAttributes = anu()->matrix->getMatrixByName($this->handle)->defineAttributes()[$this->type];\n $attributes = array_merge($attributes, $matrixAttributes);\n }\n\n foreach ($attributes as $k => $v){\n if(property_exists($this, $k)){\n $values[$k] = $this->$k;\n }\n }\n return $values;\n }", "public function attributes()\r\n {\r\n return array_keys($this->getDb()->getTableSchema($this->layoutName())->columns);\r\n }", "public static function getAttributeList() {\n $model = self::_getDataType();\n $LblNm = $model::_getLabelName();\n $table = self::_getDbTable();\n $rs = $table->fetchAll(\n $table->select($LblNm)\n );\n $labels = array();\n foreach($rs as $row) {\n array_push($labels, $row->$LblNm);\n }\n return $labels;\n }", "protected function attributes(): array\n {\n try {\n $attributes = [];\n $i = 0;\n foreach (static::$db_columns as $column) {\n $attributes[$column] = $this->$column;\n $i++;\n }\n return $attributes;\n } catch (Exception $e) {\n die(\"Error \" . $e);\n }\n }", "abstract public function attributeNames();", "private function getListCols(){\n $result = array();\n \n foreach($this->main->dataset['data'] as $item){\n if($item['list']){\n array_push($result, array(\n 'name' => $item['label'],\n 'col_name' => $item['name'],\n 'type' => $item['type'],\n 'options_custom' => $item['options_custom'],\n 'options_table' => $item['options_table'],\n 'options_source' => $item['options_source'],\n 'prefix' => null,\n 'suffix' => null,\n 'mode' => null\n ));\n };\n };\n\n return $result;\n }", "abstract public static function columnData();", "public function getColumnsList(){\n return $this->_get(3);\n }", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "protected function _getAttributes(){\n\t\treturn ActiveRecordMetaData::getAttributes($this->_source, $this->_schema);\n\t}", "public function getParameters()\n {\n return \\common\\models\\Attribute::find()->where(['id' => $this->getEntityAttributes()->select('attribute_id')]);\n }", "public function getAttributes()\n {\n return $this->where('isRelation', false)->pluck('attribute')->toArray();\n }", "public function getDatasetNameList() {\n return $this->_get(6);\n }", "public function getSelectDataFields();", "public function getColumns()\n {\n return $this->select_list;\n }", "public function getAttributes(): array;", "public function getAttributes(): array;", "public function getAttributes(): array;", "public function getAttributes(): array;", "public function getDatasetNameList() {\n return $this->_get(17);\n }" ]
[ "0.6912565", "0.67044073", "0.66587377", "0.6645676", "0.6625465", "0.6570991", "0.65597194", "0.6544039", "0.65066284", "0.64955425", "0.6456338", "0.6456338", "0.6456338", "0.6456338", "0.6456338", "0.6456338", "0.6456338", "0.6456338", "0.6456338", "0.63712233", "0.63390386", "0.6338144", "0.6322202", "0.6316808", "0.6299333", "0.62814295", "0.62814295", "0.62814295", "0.62814295", "0.6281254" ]
0.705272
0
Method returning list of available preprocessing types
public static function getSupportedPreprocessingTypes() { return [Preprocessing::TYPE_EACHONE, Preprocessing::TYPE_EQUIDISTANT_INTERVALS, Preprocessing::TYPE_INTERVAL_ENUMERATION, Preprocessing::TYPE_NOMINAL_ENUMERATION]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_desired_types();", "function wp_get_ext_types()\n {\n }", "public static function getTypes();", "public static function getStandardTypes()\n {\n }", "public static function get_possible_types()\n {\n }", "public static function get_possible_types()\n {\n }", "public static function get_possible_types()\n {\n }", "function getAvailableTypes() {\n return array('public' => 'public microtext',\n 'private' => 'private microtext',\n 'book' => 'microbuilder book microtext' );\n }", "private function get_post_types() {\n\n\t\t$output = 'names'; // names or objects, note names is the default\n\t\t$operator = 'and'; // 'and' or 'or'\n\n\t\t// Collate builtin and custom post-types\n\t\t$builtin_post_types = get_post_types( array( 'public' => true, '_builtin' => true ), $output, $operator );\n\t\t$custom_post_types = get_post_types( array( \n\t\t\t// Perhaps later introduce an option to select whether to include non-public CPTs as well.\n\t\t\t//'public' => true, \n\t\t\t'_builtin' => false \n\t\t\t), \n\t\t$output, $operator );\n\t\t$post_types = array_merge( $builtin_post_types, $custom_post_types );\n\n\t\treturn $post_types;\n\t}", "public function get_types()\n\t{\n\t\treturn array();\n\t}", "public function getProcessTypes() {\n return array(\n 'media_seller',\n 'ad_network',\n 'product',\n // Publisher is requested per publisher ID.\n 'publisher',\n );\n }", "function vcex_theme_post_types() {\n\tif ( function_exists( 'wpex_theme_post_types' ) ) {\n\t\treturn wpex_theme_post_types();\n\t}\n\treturn array();\n}", "protected function getTypes() {}", "public static function getStandardTypes() : array\n {\n }", "public function getTypes();", "public function getTypes();", "public function getTypes();", "public function getTypes();", "public static function getTypes(): array {\n\t\treturn ['pizza'];\n\t}", "public function getTypes(): array;", "public function getTypes(): array;", "public function getInputTypesWithOptions()\n {\n $types = [];\n foreach ($this->inputTypes as $code => $inputType) {\n if ($inputType->isManageOptions()) {\n $types[] = $code;\n }\n }\n\n return $types;\n }", "public function typeProvider()\n {\n return array(\n array(true, false),\n array(12, false),\n array(24.50, false),\n array(new \\stdClass(), false),\n array('string', true),\n );\n }", "function getSupportedSourceTypes() ;", "public static function returnAllowedInstallTypes() {}", "public function getCleanerTypes()\n\t{\n\t\treturn array(\n\t\t\t'str',\n\t\t\t'string',\n\t\t\t'str_notrim',\n\t\t);\n\t}", "protected function _listTypes()\n {\n global $config;\n $types = objects::types();\n\n $result = array();\n foreach ($types as $type) {\n $infos = objects::infos($type);\n $result[$type] = $infos['name'];\n }\n return $result;\n }", "public static function get_post_types_to_setup() {\n\n\t\treturn static::$post_types_to_set_up;\n\n\t}", "public static function getCodeTypes() {\n return array('B', 'P', 'PU', 'PR', 'CS', 'SA', 'SR', 'PG');\n }", "public function getPreRequisite() : array\n {\n $types = snake_case(request('types'));\n\n $types = (! is_array($types)) ? explode(\",\", $types) : $types;\n\n $data = ListHelper::getConfigLists($types);\n\n if (in_array('countries', $types)) {\n $data['countries'] = ListHelper::getCountries();\n }\n\n if (in_array('currencies', $types)) {\n $data['currencies'] = ListHelper::getCurrencies();\n }\n\n if (in_array('timezones', $types)) {\n $data['timezones'] = ListHelper::getTimezones();\n }\n\n if (in_array('frequencies', $types)) {\n $data['frequencies'] = ArrHelper::getTransList('frequencies', 'general');\n }\n\n if (in_array('locales', $types)) {\n $data['locales'] = $this->locale->getLocales();\n }\n\n return $data;\n }" ]
[ "0.6598652", "0.64527637", "0.64381003", "0.64247364", "0.6379551", "0.6379551", "0.6379551", "0.63713324", "0.63643444", "0.63504547", "0.6295311", "0.62837964", "0.6280552", "0.62575877", "0.62489337", "0.62489337", "0.62489337", "0.62489337", "0.62391174", "0.6199816", "0.6199816", "0.61953926", "0.6186851", "0.6145421", "0.61443895", "0.6136132", "0.60796434", "0.6073085", "0.6039097", "0.6036815" ]
0.7659145
0
This part is save houses data from API
public function saveHousesData($data) { $now = date('Y-m-d H:i:s'); $data['mdate'] = $now; file_put_contents('_save_house_model.txt', json_encode($data)); if (isset($data['id']) && intval($data['id'] <= 0)) { unset($data['id']); } if (!isset($data['id'])) { // if (empty($data['Housesname'])) { // return ['code' => -1, 'msg' => '请提供用户名']; // } // if (empty($data['password'])) { // return ['code' => -1, 'msg' => '请提供密码']; // } // if (self::get(['Housesname' => $data['Housesname']])) { // return ['code' => -1, 'msg' => '用户名已存在']; // } $data['cdate'] = $now; //添加房源编号new // $data['dsn'] = $this->gen_house_dsn($data['source'], $data['city']); $data['dsn'] = $this->gen_house_dsn_new(); $this->data = $data; //访问频繁 if (cache('add_house_'.$data['user_id'])) { $left_second = time() - cache('add_house_'.$data['user_id']); return ['code' => -1, 'msg' => '访问过于频繁,请'.$left_second.'s后再试']; } //防并发操作 解决ID重复的问题 #A# $fp = fopen(RUNTIME_PATH."lock.txt", "w+"); if(flock($fp,LOCK_EX | LOCK_NB)) { //..处理订单 flock($fp,LOCK_UN); $result = $this->save(); if ($result) { cache('add_house_'.$data['user_id'], time(),10); } }else{ fclose($fp); return ['code' => -1, 'msg' => '系统繁忙,请稍后再试']; } fclose($fp); //防并发操作 #A# if (false === $result) { return ['code' => -1, 'msg' => '添加数据失败']; } $data['id'] = $this->id; } else { $data['id'] = intval($data['id']); if ($data['id'] <= 0) { return ['code' => -1, 'msg' => 'id 必须大于0']; } // if (self::get(['Housesname' => $data['Housesname'], 'id' => ['neq', $data['id']]])) { // return ['code' => -1, 'msg' => '用户名已存在']; // } // if (isset($data['password']) && $data['password'] == '') { // unset($data['password']); // } $result = $this->save($data, ['id' => $data['id']]); if ($result === false) { return ['code' => -1, 'msg' => '修改数据失败']; } } //添加房源编号 //$this->set_house_dsn($data['id']); return ['code' => 0, 'msg' => 'ok', 'data' => $data]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store(Request $request)\n {\n\t\t$request->validate([\n\t\t\t'title' => 'required|max:250',\n\t\t\t'nr_of_rooms' => 'required|integer|min:0',\n\t\t\t'nr_of_beds' => 'required|integer|min:0',\n\t\t\t'nr_of_bathrooms' => 'integer|min:0|nullable',\n\t\t\t'square_mt' => 'integer|min:1|nullable',\n\t\t\t'address' => 'required',\n\t\t\t'image_path' => 'image|nullable',\n\t\t\t'description' => 'max:2000|nullable',\n\t\t]);\n\n\t\t//TODO: address manipulation\n\t\t$houseData = $request->all();//in mezzo ci sono sia le cose che vanno in houses che quelle che vanno in services -> SEPARARE I CAMPI!\n\t\t$newHouse = new House();\n\t\t$newHouse->fill($houseData);\n\t\tif(array_key_exists('image_path', $houseData)) {\n\t\t\t$newHouse->image_path = Storage::put('uploads', $houseData['image_path']);\n\t\t}\n\t\t$newHouse->save();\n\t\tif (!empty($houseData['services_ids'])) {\n\t\t\t$newHouse->services()->sync($houseData['services_ids']);\n \t}\n\n\t\treturn redirect()->route('upr.houses.index');\n\n }", "private function saveData() {\n // Create a new object with relevant information\n $data = new stdClass();\n $data->accessToken = $this->accessToken;\n $data->expirationDate = $this->expirationDate;\n $data->refreshToken = $this->refreshToken;\n\n // And save it to disk (will automatically create the file for us)\n file_put_contents(DATA_FILE, json_encode($data));\n }", "public function saveroomsinfo(Request $request){\n\t\t$data = array();\n\t\t$data['status'] = 0;\n\t\t$data['msg'] = 'Error';\n\t\t\n\t\t$input = $request->all();\n\t\t$propertyid = $input['propertyid'];\n\t\t$roomsinfo = $input['roomsinfo'];\n\t\t$hoursinfo = (isset($input['hoursinfo']) && $input['hoursinfo'] != NULL && !empty($input['hoursinfo'])) ? $input['hoursinfo'] : NULL;\n\t\t/*return response()->json($roomsinfo); \n\t\texit();*/\n\t\t\n\t\t$propertydata = Property::find($propertyid);\n\t\t\n\t\tif(empty($propertydata)){\n\t\t\t$data['msg'] = 'Invalid Property';\n\t\t}\n\t\telse{\n\t\t\t$roomsdata = PropertyRooms::where('property_id','=',$propertyid)->delete();\n\t\t\tforeach($roomsinfo as $room){\n\t\t\t\t$roomarray = array();\n\t\t\t\t$roomarray['studiooption_name'] = (trim($room['studiooption']) != \"\" && trim($room['studiooption']) != NULL) ? trim($room['studiooption']) : NULL;\n\t\t\t\t$roomarray['studiooption_value'] = (trim($room['studiocount']) != \"\" && trim($room['studiocount']) != NULL) ? trim($room['studiocount']) : 0;\n\t\t\t\t$roomarray['bedroomoption_name'] = (trim($room['bedroomoption']) != \"\" && trim($room['bedroomoption']) != NULL) ? trim($room['bedroomoption']) : NULL;\n\t\t\t\t$roomarray['bedroomoption_value'] = (trim($room['bedroomcount']) != \"\" && trim($room['bedroomcount']) != NULL) ? trim($room['bedroomcount']) : 0;\n\t\t\t\t$roomarray['bathoption_value'] = (trim($room['bathcount']) != \"\" && trim($room['bathcount']) != NULL) ? trim($room['bathcount']) : 0;\n\t\t\t\t$roomarray['price_startvalue'] = (trim($room['start_price']) != \"\" && trim($room['start_price']) != NULL) ? trim($room['start_price']) : 0;\n\t\t\t\t$roomarray['price_endvalue'] = (trim($room['end_price']) != \"\" && trim($room['end_price']) != NULL) ? trim($room['end_price']) : 0;\n\t\t\t\t$roomarray['property_id'] = trim($propertyid);\n\t\t\t\tPropertyRooms::create($roomarray);\n\t\t\t}\n\t\t\t\n\t\t\t$propertydata->property_officehours = serialize($hoursinfo);\n\n\t\t\tif($propertydata->update()){\n\t\t\t\t$data['status'] = 1;\n\t\t\t\t$data['msg'] = 'Property Data Saved';\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$data['msg'] = 'Error in save property details';\t\t\n\t\t\t}\n\t\t}\n\t\treturn response()->json($data); \n\t\texit();\n }", "public function saveHousesDataInternal($data) {\n $now = date('Y-m-d H:i:s');\n $id = intval(@$data['id']);\n // 获取旧数据\n if ($id > 0) {\n $oldInfo = $this->find($id);\n if (!$oldInfo) {\n return array('code' => -1, 'msg' => '文章不存在');\n }\n $old_thumbnail = $oldInfo['thumnail'];\n } else {\n $data['admin_id'] = session('id');\n $old_thumbnail = '';\n }\n\n // 移动标题图\n if ($data['thumnail']) { // 确保从tmp中移动出thumnail\n // 如果之前上传过缩略图,删除\n if ($old_thumbnail && $data['thumnail'] != $old_thumbnail) {\n deleteFile($old_thumbnail);\n }\n if (false === ($data['thumnail'] = $this->_move_thumbnail($data['thumnail']))) {\n return array('code' => -1, 'msg' => '移动缩略图位置失败');\n }\n }\n\n $data['cdate'] = $now;\n $data['mdate'] = $now;\n // Generate DSN for current situtation\n //$data['dsn'] = $this->gen_house_dsn($data['source'], $data['city']);\n $data['dsn'] = $this->gen_house_dsn_new();\n // 保存数据\n if ($data['id']) {\n $lines = $this->save($data, array('id' => $data['id']));\n if ($lines !== false) {\n $res = true;\n }\n } else {\n $insertId = $this->insertGetId($data);\n if ($insertId) {\n $data['id'] = $insertId;\n $res = true;\n }\n }\n\n if (!$res) {\n return array('code' => -1, 'msg' => $this->getDbError());\n }\n return array('code' => 0, 'msg' => 'ok', 'data' => $data);\n }", "public function run()\n {\n \n\n \\DB::table('houses')->delete();\n \n \\DB::table('houses')->insert(array (\n 0 => \n array (\n 'id' => 15,\n 'title' => '更好的风格和的风格',\n 'area' => 123.0,\n 'sub_title' => '风格撒的风格撒的发噶人',\n 'unit_price' => NULL,\n 'first_pay' => NULL,\n 'product_info' => '固定好身体也让我层 v 许诺',\n 'direction' => '北',\n 'location_id' => NULL,\n 'visiting_count' => 0,\n 'floor' => 4,\n 'floors' => 123,\n 'house_type' => NULL,\n 'house_img' => '{\"cover\": [{\"get\": \"http://localhost:1234/api/img?file=2018-02-08-16-18-49-14625a7c07e9f2708.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-08-16-18-49-14625a7c07e9f2708.jpeg\", \"name\": \"2018-02-08-16-18-49-14625a7c07e9f2708.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}], \"house\": [{\"get\": \"http://localhost:1234/api/img?file=2018-02-08-16-19-00-12975a7c07f4995f7.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-08-16-19-00-12975a7c07f4995f7.jpeg\", \"name\": \"2018-02-08-16-19-00-12975a7c07f4995f7.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-08-16-19-04-13435a7c07f88d571.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-08-16-19-04-13435a7c07f88d571.jpeg\", \"name\": \"2018-02-08-16-19-04-13435a7c07f88d571.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-08-16-19-07-16525a7c07fb9f001.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-08-16-19-07-16525a7c07fb9f001.jpeg\", \"name\": \"2018-02-08-16-19-07-16525a7c07fb9f001.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-08-16-19-10-11415a7c07fee96f9.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-08-16-19-10-11415a7c07fee96f9.jpeg\", \"name\": \"2018-02-08-16-19-10-11415a7c07fee96f9.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-08-16-19-16-18005a7c080428fab.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-08-16-19-16-18005a7c080428fab.jpeg\", \"name\": \"2018-02-08-16-19-16-18005a7c080428fab.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-08-16-19-19-10315a7c0807517c0.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-08-16-19-19-10315a7c0807517c0.jpeg\", \"name\": \"2018-02-08-16-19-19-10315a7c0807517c0.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-08-16-19-23-15295a7c080bac484.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-08-16-19-23-15295a7c080bac484.jpeg\", \"name\": \"2018-02-08-16-19-23-15295a7c080bac484.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-08-16-19-29-13755a7c081159bc3.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-08-16-19-29-13755a7c081159bc3.jpeg\", \"name\": \"2018-02-08-16-19-29-13755a7c081159bc3.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-08-16-19-36-13855a7c081861a7e.png\", \"url\": \"http://localhost:1234/storage/2018-02-08-16-19-36-13855a7c081861a7e.png\", \"name\": \"2018-02-08-16-19-36-13855a7c081861a7e.png\", \"size\": \"true\", \"type\": \"png\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-08-16-19-42-13065a7c081ec060f.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-08-16-19-42-13065a7c081ec060f.jpeg\", \"name\": \"2018-02-08-16-19-42-13065a7c081ec060f.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-08-16-19-53-12165a7c08294f7d8.gif\", \"url\": \"http://localhost:1234/storage/2018-02-08-16-19-53-12165a7c08294f7d8.gif\", \"name\": \"2018-02-08-16-19-53-12165a7c08294f7d8.gif\", \"size\": \"true\", \"type\": \"gif\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-08-16-20-01-10165a7c083154b32.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-08-16-20-01-10165a7c083154b32.jpeg\", \"name\": \"2018-02-08-16-20-01-10165a7c083154b32.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-08-16-20-09-16355a7c0839c3e20.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-08-16-20-09-16355a7c0839c3e20.jpeg\", \"name\": \"2018-02-08-16-20-09-16355a7c0839c3e20.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-08-16-20-24-17025a7c0848ee662.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-08-16-20-24-17025a7c0848ee662.jpeg\", \"name\": \"2018-02-08-16-20-24-17025a7c0848ee662.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-08-16-20-32-13235a7c085063e90.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-08-16-20-32-13235a7c085063e90.jpeg\", \"name\": \"2018-02-08-16-20-32-13235a7c085063e90.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}]}',\n 'Decoration' => '毛胚房',\n 'floor_age' => '213',\n 'supply_heating' => '无供暖',\n 'elevator' => '一梯3户',\n 'surroundings' => 'dfasdf',\n 'community_info' => 'dfasdfasdf',\n 'traffic' => 'asdfasdfas',\n 'house_age_limit' => '123',\n 'huxing_map_info' => '{\"hall\": {\"hall_1\": {\"arae\": \"123\", \"direction\": \"西南\"}}, \"balcony\": {\"balcony_1\": {\"arae\": \"123\", \"direction\": \"西\"}}, \"bedroom\": {\"bedroom_1\": {\"arae\": \"123\", \"direction\": \"北\"}}, \"kitchen\": {\"kitchen_1\": {\"arae\": \"123\", \"direction\": \"南\"}}, \"bathroom\": {\"bathroom_1\": {\"arae\": \"123\", \"direction\": \"北\"}, \"bathroom_2\": {\"arae\": \"213\", \"direction\": \"西\"}}}',\n 'tags' => '[\"新房\", \"学区房\", \"市中心\", \"随时看房\", \"地铁房\"]',\n 'created_at' => '2018-02-08 16:30:56',\n 'updated_at' => '2018-02-08 16:54:14',\n 'price' => 1343.0,\n 'room_count' => '{\"hall\": \"1\", \"balcony\": \"1\", \"bedroom\": \"1\", \"kitchen\": \"1\", \"bathroom\": \"2\"}',\n 'negative_floor' => '0',\n 'deed_info' => '[{\"get\": \"http://localhost:1234/api/img?file=2018-02-08-16-20-54-20195a7c0866ba467.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-08-16-20-54-20195a7c0866ba467.jpeg\", \"name\": \"2018-02-08-16-20-54-20195a7c0866ba467.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}]',\n 'user_id' => 1,\n 'unit_number' => '123',\n 'building_number' => '123',\n 'house_number' => '123',\n 'contact' => '啊实打实大',\n 'tel' => '123',\n 'expect_price' => '132',\n 'community' => '雅居乐',\n 'status' => 'sell',\n 'location' => '陕西省西安市雁塔区曲江街道雅居乐·御宾府',\n 'city' => '西安',\n 'hot' => 0,\n 'new' => 0,\n 'location_info' => '{\"lat\": \"34.016190\", \"lng\": \"108.580375\", \"city\": \"西安市\", \"level\": \"道路\", \"adcode\": \"610111\", \"citycode\": \"029\", \"district\": \"灞桥区\", \"location\": \"109.080375,34.216190\", \"province\": \"陕西省\", \"formatted_address\": \"陕西省西安市灞桥区白鹿西路南段\"}',\n ),\n 1 => \n array (\n 'id' => 16,\n 'title' => '啊实打实大',\n 'area' => 123.0,\n 'sub_title' => '阿斯顿',\n 'unit_price' => NULL,\n 'first_pay' => NULL,\n 'product_info' => '撒的啊撒睡大时代啊阿斯顿啊撒的阿斯顿撒大时代',\n 'direction' => '北',\n 'location_id' => NULL,\n 'visiting_count' => 0,\n 'floor' => 4,\n 'floors' => 123,\n 'house_type' => NULL,\n 'house_img' => '{\"cover\": [{\"get\": \"http://localhost:1234/api/img?file=2018-02-08-16-18-49-14625a7c07e9f2708.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-08-16-18-49-14625a7c07e9f2708.jpeg\", \"name\": \"2018-02-08-16-18-49-14625a7c07e9f2708.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}], \"house\": [{\"get\": \"http://localhost:1234/api/img?file=2018-02-08-16-19-00-12975a7c07f4995f7.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-08-16-19-00-12975a7c07f4995f7.jpeg\", \"name\": \"2018-02-08-16-19-00-12975a7c07f4995f7.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-08-16-19-04-13435a7c07f88d571.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-08-16-19-04-13435a7c07f88d571.jpeg\", \"name\": \"2018-02-08-16-19-04-13435a7c07f88d571.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-08-16-19-07-16525a7c07fb9f001.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-08-16-19-07-16525a7c07fb9f001.jpeg\", \"name\": \"2018-02-08-16-19-07-16525a7c07fb9f001.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-08-16-19-10-11415a7c07fee96f9.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-08-16-19-10-11415a7c07fee96f9.jpeg\", \"name\": \"2018-02-08-16-19-10-11415a7c07fee96f9.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-08-16-19-16-18005a7c080428fab.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-08-16-19-16-18005a7c080428fab.jpeg\", \"name\": \"2018-02-08-16-19-16-18005a7c080428fab.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-08-16-19-19-10315a7c0807517c0.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-08-16-19-19-10315a7c0807517c0.jpeg\", \"name\": \"2018-02-08-16-19-19-10315a7c0807517c0.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-08-16-19-23-15295a7c080bac484.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-08-16-19-23-15295a7c080bac484.jpeg\", \"name\": \"2018-02-08-16-19-23-15295a7c080bac484.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-08-16-19-29-13755a7c081159bc3.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-08-16-19-29-13755a7c081159bc3.jpeg\", \"name\": \"2018-02-08-16-19-29-13755a7c081159bc3.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-08-16-19-36-13855a7c081861a7e.png\", \"url\": \"http://localhost:1234/storage/2018-02-08-16-19-36-13855a7c081861a7e.png\", \"name\": \"2018-02-08-16-19-36-13855a7c081861a7e.png\", \"size\": \"true\", \"type\": \"png\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-08-16-19-42-13065a7c081ec060f.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-08-16-19-42-13065a7c081ec060f.jpeg\", \"name\": \"2018-02-08-16-19-42-13065a7c081ec060f.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-08-16-19-53-12165a7c08294f7d8.gif\", \"url\": \"http://localhost:1234/storage/2018-02-08-16-19-53-12165a7c08294f7d8.gif\", \"name\": \"2018-02-08-16-19-53-12165a7c08294f7d8.gif\", \"size\": \"true\", \"type\": \"gif\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-08-16-20-01-10165a7c083154b32.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-08-16-20-01-10165a7c083154b32.jpeg\", \"name\": \"2018-02-08-16-20-01-10165a7c083154b32.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-08-16-20-09-16355a7c0839c3e20.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-08-16-20-09-16355a7c0839c3e20.jpeg\", \"name\": \"2018-02-08-16-20-09-16355a7c0839c3e20.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-08-16-20-24-17025a7c0848ee662.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-08-16-20-24-17025a7c0848ee662.jpeg\", \"name\": \"2018-02-08-16-20-24-17025a7c0848ee662.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-08-16-20-32-13235a7c085063e90.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-08-16-20-32-13235a7c085063e90.jpeg\", \"name\": \"2018-02-08-16-20-32-13235a7c085063e90.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}]}',\n 'Decoration' => '毛胚房',\n 'floor_age' => '213',\n 'supply_heating' => '无供暖',\n 'elevator' => '一梯3户',\n 'surroundings' => 'dfasdf',\n 'community_info' => 'dfasdfasdf',\n 'traffic' => 'asdfasdfas',\n 'house_age_limit' => '123',\n 'huxing_map_info' => '{\"hall\": {\"hall_1\": {\"arae\": \"123\", \"direction\": \"西南\"}}, \"balcony\": {\"balcony_1\": {\"arae\": \"123\", \"direction\": \"西\"}}, \"bedroom\": {\"bedroom_1\": {\"arae\": \"123\", \"direction\": \"北\"}}, \"kitchen\": {\"kitchen_1\": {\"arae\": \"123\", \"direction\": \"南\"}}, \"bathroom\": {\"bathroom_1\": {\"arae\": \"123\", \"direction\": \"北\"}, \"bathroom_2\": {\"arae\": \"213\", \"direction\": \"西\"}}}',\n 'tags' => '[\"地铁房\", \"随时看房\", \"市中心\", \"学区房\"]',\n 'created_at' => '2018-02-08 16:33:43',\n 'updated_at' => '2018-02-08 16:53:44',\n 'price' => 213321.0,\n 'room_count' => '{\"hall\": \"1\", \"balcony\": \"1\", \"bedroom\": \"1\", \"kitchen\": \"1\", \"bathroom\": \"2\"}',\n 'negative_floor' => '0',\n 'deed_info' => '[{\"get\": \"http://localhost:1234/api/img?file=2018-02-08-16-20-54-20195a7c0866ba467.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-08-16-20-54-20195a7c0866ba467.jpeg\", \"name\": \"2018-02-08-16-20-54-20195a7c0866ba467.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}]',\n 'user_id' => 1,\n 'unit_number' => '123',\n 'building_number' => '123',\n 'house_number' => '123',\n 'contact' => '啊实打实大',\n 'tel' => '123',\n 'expect_price' => '132',\n 'community' => '雅居乐',\n 'status' => 'sell',\n 'location' => '陕西省西安市雁塔区曲江街道雅居乐·御宾府',\n 'city' => '西安',\n 'hot' => 0,\n 'new' => 0,\n 'location_info' => '{\"lat\": \"34.016190\", \"lng\": \"109.080375\", \"city\": \"西安市\", \"level\": \"道路\", \"adcode\": \"610111\", \"citycode\": \"029\", \"district\": \"灞桥区\", \"location\": \"109.080375,34.216190\", \"province\": \"陕西省\", \"formatted_address\": \"陕西省西安市灞桥区白鹿西路南段\"}',\n ),\n 2 => \n array (\n 'id' => 17,\n 'title' => '雅居乐 3是阿斯顿啊',\n 'area' => 123.0,\n 'sub_title' => '啊实打实的',\n 'unit_price' => NULL,\n 'first_pay' => NULL,\n 'product_info' => '撒的发撒的风格形成 v 了',\n 'direction' => '北',\n 'location_id' => NULL,\n 'visiting_count' => 0,\n 'floor' => 4,\n 'floors' => 123,\n 'house_type' => NULL,\n 'house_img' => '{\"cover\": [{\"get\": \"http://localhost:1234/api/img?file=2018-02-08-16-18-49-14625a7c07e9f2708.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-08-16-18-49-14625a7c07e9f2708.jpeg\", \"name\": \"2018-02-08-16-18-49-14625a7c07e9f2708.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}], \"house\": [{\"get\": \"http://localhost:1234/api/img?file=2018-02-08-16-19-00-12975a7c07f4995f7.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-08-16-19-00-12975a7c07f4995f7.jpeg\", \"name\": \"2018-02-08-16-19-00-12975a7c07f4995f7.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-08-16-19-04-13435a7c07f88d571.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-08-16-19-04-13435a7c07f88d571.jpeg\", \"name\": \"2018-02-08-16-19-04-13435a7c07f88d571.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-08-16-19-07-16525a7c07fb9f001.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-08-16-19-07-16525a7c07fb9f001.jpeg\", \"name\": \"2018-02-08-16-19-07-16525a7c07fb9f001.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-08-16-19-10-11415a7c07fee96f9.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-08-16-19-10-11415a7c07fee96f9.jpeg\", \"name\": \"2018-02-08-16-19-10-11415a7c07fee96f9.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-08-16-19-16-18005a7c080428fab.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-08-16-19-16-18005a7c080428fab.jpeg\", \"name\": \"2018-02-08-16-19-16-18005a7c080428fab.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-08-16-19-19-10315a7c0807517c0.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-08-16-19-19-10315a7c0807517c0.jpeg\", \"name\": \"2018-02-08-16-19-19-10315a7c0807517c0.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-08-16-19-23-15295a7c080bac484.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-08-16-19-23-15295a7c080bac484.jpeg\", \"name\": \"2018-02-08-16-19-23-15295a7c080bac484.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-08-16-19-29-13755a7c081159bc3.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-08-16-19-29-13755a7c081159bc3.jpeg\", \"name\": \"2018-02-08-16-19-29-13755a7c081159bc3.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-08-16-19-36-13855a7c081861a7e.png\", \"url\": \"http://localhost:1234/storage/2018-02-08-16-19-36-13855a7c081861a7e.png\", \"name\": \"2018-02-08-16-19-36-13855a7c081861a7e.png\", \"size\": \"true\", \"type\": \"png\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-08-16-19-42-13065a7c081ec060f.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-08-16-19-42-13065a7c081ec060f.jpeg\", \"name\": \"2018-02-08-16-19-42-13065a7c081ec060f.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-08-16-19-53-12165a7c08294f7d8.gif\", \"url\": \"http://localhost:1234/storage/2018-02-08-16-19-53-12165a7c08294f7d8.gif\", \"name\": \"2018-02-08-16-19-53-12165a7c08294f7d8.gif\", \"size\": \"true\", \"type\": \"gif\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-08-16-20-01-10165a7c083154b32.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-08-16-20-01-10165a7c083154b32.jpeg\", \"name\": \"2018-02-08-16-20-01-10165a7c083154b32.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-08-16-20-09-16355a7c0839c3e20.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-08-16-20-09-16355a7c0839c3e20.jpeg\", \"name\": \"2018-02-08-16-20-09-16355a7c0839c3e20.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-08-16-20-24-17025a7c0848ee662.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-08-16-20-24-17025a7c0848ee662.jpeg\", \"name\": \"2018-02-08-16-20-24-17025a7c0848ee662.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-08-16-20-32-13235a7c085063e90.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-08-16-20-32-13235a7c085063e90.jpeg\", \"name\": \"2018-02-08-16-20-32-13235a7c085063e90.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}]}',\n 'Decoration' => '毛胚房',\n 'floor_age' => '213',\n 'supply_heating' => '无供暖',\n 'elevator' => '一梯3户',\n 'surroundings' => 'dfasdf',\n 'community_info' => 'dfasdfasdf',\n 'traffic' => 'asdfasdfas',\n 'house_age_limit' => '123',\n 'huxing_map_info' => '{\"hall\": {\"hall_1\": {\"arae\": \"123\", \"direction\": \"西南\"}}, \"balcony\": {\"balcony_1\": {\"arae\": \"123\", \"direction\": \"西\"}}, \"bedroom\": {\"bedroom_1\": {\"arae\": \"123\", \"direction\": \"北\"}}, \"kitchen\": {\"kitchen_1\": {\"arae\": \"123\", \"direction\": \"南\"}}, \"bathroom\": {\"bathroom_1\": {\"arae\": \"123\", \"direction\": \"北\"}, \"bathroom_2\": {\"arae\": \"213\", \"direction\": \"西\"}}}',\n 'tags' => '[\"地铁房\", \"市中心\", \"学区房\", \"新房\", \"随时看房\"]',\n 'created_at' => '2018-02-08 16:35:04',\n 'updated_at' => '2018-02-08 16:46:54',\n 'price' => 12315.0,\n 'room_count' => '{\"hall\": \"1\", \"balcony\": \"1\", \"bedroom\": \"1\", \"kitchen\": \"1\", \"bathroom\": \"2\"}',\n 'negative_floor' => '0',\n 'deed_info' => '[{\"get\": \"http://localhost:1234/api/img?file=2018-02-08-16-20-54-20195a7c0866ba467.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-08-16-20-54-20195a7c0866ba467.jpeg\", \"name\": \"2018-02-08-16-20-54-20195a7c0866ba467.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}]',\n 'user_id' => 1,\n 'unit_number' => '123',\n 'building_number' => '123',\n 'house_number' => '123',\n 'contact' => '啊实打实大',\n 'tel' => '123',\n 'expect_price' => '132',\n 'community' => '雅居乐',\n 'status' => 'sell',\n 'location' => '陕西省西安市雁塔区曲江街道雅居乐·御宾府',\n 'city' => '西安',\n 'hot' => 0,\n 'new' => 0,\n 'location_info' => '{\"lat\": \"34.331929\", \"lng\": \"108.936741\", \"city\": \"西安市\", \"level\": \"道路\", \"adcode\": \"610111\", \"citycode\": \"029\", \"district\": \"灞桥区\", \"location\": \"109.080375,34.216190\", \"province\": \"陕西省\", \"formatted_address\": \"陕西省西安市灞桥区白鹿西路南段\"}',\n ),\n 3 => \n array (\n 'id' => 18,\n 'title' => '使用 Promise 和 ES6',\n 'area' => 123.0,\n 'sub_title' => '此钩子函数一个类型为切换对象的参数。',\n 'unit_price' => NULL,\n 'first_pay' => NULL,\n 'product_info' => 'I really want set title when I declare routes. e.g\n\nconst routes = [{ path: \\'/search\\', component: ActivityList, title: \\'Search\\' }]\nthen title will change by the vue-router.\n\nhow ?\n\nps, I see the pull issue closed. why?\n#526',\n 'direction' => '东南',\n 'location_id' => NULL,\n 'visiting_count' => 0,\n 'floor' => 2,\n 'floors' => 123,\n 'house_type' => NULL,\n 'house_img' => '{\"cover\": [{\"get\": \"http://localhost:1234/api/img?file=2018-02-09-15-17-44-15195a7d4b18e5147.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-09-15-17-44-15195a7d4b18e5147.jpeg\", \"name\": \"2018-02-09-15-17-44-15195a7d4b18e5147.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}], \"house\": [{\"get\": \"http://localhost:1234/api/img?file=2018-02-09-15-17-52-17545a7d4b2008570.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-09-15-17-52-17545a7d4b2008570.jpeg\", \"name\": \"2018-02-09-15-17-52-17545a7d4b2008570.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-09-15-17-55-14615a7d4b234ea20.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-09-15-17-55-14615a7d4b234ea20.jpeg\", \"name\": \"2018-02-09-15-17-55-14615a7d4b234ea20.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-09-15-17-59-18365a7d4b27078e2.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-09-15-17-59-18365a7d4b27078e2.jpeg\", \"name\": \"2018-02-09-15-17-59-18365a7d4b27078e2.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-09-15-18-03-12995a7d4b2b09d26.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-09-15-18-03-12995a7d4b2b09d26.jpeg\", \"name\": \"2018-02-09-15-18-03-12995a7d4b2b09d26.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-09-15-18-09-14265a7d4b3118192.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-09-15-18-09-14265a7d4b3118192.jpeg\", \"name\": \"2018-02-09-15-18-09-14265a7d4b3118192.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-09-15-18-14-15865a7d4b362a308.gif\", \"url\": \"http://localhost:1234/storage/2018-02-09-15-18-14-15865a7d4b362a308.gif\", \"name\": \"2018-02-09-15-18-14-15865a7d4b362a308.gif\", \"size\": \"true\", \"type\": \"gif\"}]}',\n 'Decoration' => '毛胚房',\n 'floor_age' => '213',\n 'supply_heating' => '个人供暖',\n 'elevator' => '一梯3户',\n 'surroundings' => '123',\n 'community_info' => '123123123123',\n 'traffic' => '123123',\n 'house_age_limit' => '213',\n 'huxing_map_info' => '{\"hall\": {\"hall_1\": {\"arae\": \"123\", \"direction\": \"西\"}}, \"balcony\": {\"balcony_1\": {\"arae\": \"123\", \"direction\": \"南\"}}, \"bedroom\": {\"bedroom_1\": {\"arae\": \"213\", \"direction\": \"西\"}}, \"kitchen\": {\"kitchen_1\": {\"arae\": \"123\", \"direction\": \"东\"}}, \"bathroom\": {\"bathroom_1\": {\"arae\": \"213\", \"direction\": \"南\"}, \"bathroom_2\": {\"arae\": \"213\", \"direction\": \"西南\"}}}',\n 'tags' => '[\"地铁房\", \"随时看房\", \"市中心\", \"学区房\", \"新房\"]',\n 'created_at' => '2018-02-09 15:19:48',\n 'updated_at' => '2018-02-19 12:57:27',\n 'price' => 213.0,\n 'room_count' => '{\"hall\": \"1\", \"balcony\": \"1\", \"bedroom\": \"1\", \"kitchen\": \"1\", \"bathroom\": \"2\"}',\n 'negative_floor' => '0',\n 'deed_info' => '[{\"get\": \"http://localhost:1234/api/img?file=2018-02-09-15-18-22-13055a7d4b3ed8f4d.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-09-15-18-22-13055a7d4b3ed8f4d.jpeg\", \"name\": \"2018-02-09-15-18-22-13055a7d4b3ed8f4d.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}]',\n 'user_id' => 1,\n 'unit_number' => '2131',\n 'building_number' => '123',\n 'house_number' => '213',\n 'contact' => '123',\n 'tel' => '213123',\n 'expect_price' => '213213',\n 'community' => '雅居乐',\n 'status' => 'sell',\n 'location' => '陕西省西安市灞桥区狄寨街道白鹿西路南段',\n 'city' => '西安',\n 'hot' => 0,\n 'new' => 0,\n 'location_info' => '{\"lat\": \"34.216190\", \"lng\": \"108.080375\", \"city\": \"西安市\", \"level\": \"道路\", \"adcode\": \"610111\", \"citycode\": \"029\", \"district\": \"灞桥区\", \"location\": \"109.080375,34.216190\", \"province\": \"陕西省\", \"formatted_address\": \"陕西省西安市灞桥区白鹿西路南段\"}',\n ),\n 4 => \n array (\n 'id' => 19,\n 'title' => '啊撒睡',\n 'area' => 213.0,\n 'sub_title' => '德萨发生的发',\n 'unit_price' => NULL,\n 'first_pay' => NULL,\n 'product_info' => '是否该说的风格是方法是撒的发生发生的发生分胜负爽肤水复古风格的复古风格家哥好机会你风格 v 吧形成 v不 v 不晓得该说的风格和时代感撒的风格撒的风格二哥二哥为根深蒂固说的话说更好风格和风格好是否根深蒂固和人突然说通过',\n 'direction' => '西',\n 'location_id' => NULL,\n 'visiting_count' => 0,\n 'floor' => 2,\n 'floors' => 123,\n 'house_type' => NULL,\n 'house_img' => '{\"cover\": [{\"get\": \"http://localhost:1234/api/img?file=2018-02-14-13-42-10-15745a83cc3277471.gif\", \"url\": \"http://localhost:1234/storage/2018-02-14-13-42-10-15745a83cc3277471.gif\", \"name\": \"2018-02-14-13-42-10-15745a83cc3277471.gif\", \"size\": \"true\", \"type\": \"gif\"}], \"house\": [{\"get\": \"http://localhost:1234/api/img?file=2018-02-14-13-42-21-12015a83cc3d0386a.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-14-13-42-21-12015a83cc3d0386a.jpeg\", \"name\": \"2018-02-14-13-42-21-12015a83cc3d0386a.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-14-13-42-24-11585a83cc40efdf9.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-14-13-42-24-11585a83cc40efdf9.jpeg\", \"name\": \"2018-02-14-13-42-24-11585a83cc40efdf9.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-14-13-42-30-19525a83cc46c9596.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-14-13-42-30-19525a83cc46c9596.jpeg\", \"name\": \"2018-02-14-13-42-30-19525a83cc46c9596.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-14-13-42-38-11255a83cc4ee62f0.png\", \"url\": \"http://localhost:1234/storage/2018-02-14-13-42-38-11255a83cc4ee62f0.png\", \"name\": \"2018-02-14-13-42-38-11255a83cc4ee62f0.png\", \"size\": \"true\", \"type\": \"png\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-14-13-42-44-18555a83cc543532a.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-14-13-42-44-18555a83cc543532a.jpeg\", \"name\": \"2018-02-14-13-42-44-18555a83cc543532a.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}]}',\n 'Decoration' => '简装',\n 'floor_age' => '213',\n 'supply_heating' => '个人供暖',\n 'elevator' => '其他',\n 'surroundings' => '西塞带哦',\n 'community_info' => '没考虑过的宝宝健康啦哥哥你快收藏 v 军绿色的发生 v崩坏开始v 不会考虑比较宽松的发',\n 'traffic' => '撒大的啊 许可名不虚传没考虑',\n 'house_age_limit' => '213',\n 'huxing_map_info' => '{\"hall\": {\"hall_1\": {\"arae\": \"123\", \"direction\": \"北\"}}, \"balcony\": {\"balcony_1\": {\"arae\": \"231\", \"direction\": \"南\"}}, \"bedroom\": {\"bedroom_1\": {\"arae\": \"213\", \"direction\": \"西北\"}}, \"kitchen\": {\"kitchen_1\": {\"arae\": \"213\", \"direction\": \"南\"}}, \"bathroom\": {\"bathroom_1\": {\"arae\": \"213\", \"direction\": \"东南\"}, \"bathroom_2\": {\"arae\": \"231\", \"direction\": \"西\"}}}',\n 'tags' => '[\"新房\", \"学区房\", \"市中心\", \"随时看房\", \"地铁房\"]',\n 'created_at' => '2018-02-14 13:43:45',\n 'updated_at' => '2018-02-15 18:12:04',\n 'price' => 213134.0,\n 'room_count' => '{\"hall\": \"1\", \"balcony\": \"1\", \"bedroom\": \"1\", \"kitchen\": \"1\", \"bathroom\": \"2\"}',\n 'negative_floor' => '0',\n 'deed_info' => '[{\"get\": \"http://localhost:1234/api/img?file=2018-02-14-13-43-10-14815a83cc6ed0f77.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-14-13-43-10-14815a83cc6ed0f77.jpeg\", \"name\": \"2018-02-14-13-43-10-14815a83cc6ed0f77.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}]',\n 'user_id' => 1,\n 'unit_number' => '123',\n 'building_number' => '123',\n 'house_number' => '123',\n 'contact' => '213',\n 'tel' => '123',\n 'expect_price' => '123',\n 'community' => '户',\n 'status' => 'sell',\n 'location' => '陕西省西安市未央区张家堡街道文景路风景御园',\n 'city' => '西安',\n 'hot' => 0,\n 'new' => 0,\n 'location_info' => '{\"lat\": \"34.339209\", \"lng\": \"108.940037\", \"city\": \"西安市\", \"level\": \"兴趣点\", \"adcode\": \"610112\", \"citycode\": \"029\", \"district\": \"未央区\", \"location\": \"108.940037,34.339209\", \"province\": \"陕西省\", \"formatted_address\": \"陕西省西安市未央区风景御园\"}',\n ),\n 5 => \n array (\n 'id' => 20,\n 'title' => 'action来发送请求,然后本意是想在then方法里面判断权限',\n 'area' => 123.0,\n 'sub_title' => '如果改用 async/await 呢,会是这样',\n 'unit_price' => NULL,\n 'first_pay' => NULL,\n 'product_info' => '2018 Lincoln Navigator : Full-Size Luxury SUVs - Lincoln.com',\n 'direction' => '北',\n 'location_id' => NULL,\n 'visiting_count' => 0,\n 'floor' => 3,\n 'floors' => 231,\n 'house_type' => NULL,\n 'house_img' => '{\"cover\": [{\"get\": \"http://localhost:1234/api/img?file=2018-02-19-12-58-51-15905a8a598bc04d7.png\", \"url\": \"http://localhost:1234/storage/2018-02-19-12-58-51-15905a8a598bc04d7.png\", \"name\": \"2018-02-19-12-58-51-15905a8a598bc04d7.png\", \"size\": \"true\", \"type\": \"png\"}], \"house\": [{\"get\": \"http://localhost:1234/api/img?file=2018-02-19-12-59-00-14465a8a5994acf6b.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-19-12-59-00-14465a8a5994acf6b.jpeg\", \"name\": \"2018-02-19-12-59-00-14465a8a5994acf6b.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-19-12-59-03-10905a8a5997e71ce.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-19-12-59-03-10905a8a5997e71ce.jpeg\", \"name\": \"2018-02-19-12-59-03-10905a8a5997e71ce.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-19-12-59-07-16095a8a599b36316.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-19-12-59-07-16095a8a599b36316.jpeg\", \"name\": \"2018-02-19-12-59-07-16095a8a599b36316.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-19-12-59-10-15415a8a599e3a1a3.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-19-12-59-10-15415a8a599e3a1a3.jpeg\", \"name\": \"2018-02-19-12-59-10-15415a8a599e3a1a3.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-19-12-59-15-12335a8a59a348283.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-19-12-59-15-12335a8a59a348283.jpeg\", \"name\": \"2018-02-19-12-59-15-12335a8a59a348283.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-19-12-59-18-19745a8a59a691c40.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-19-12-59-18-19745a8a59a691c40.jpeg\", \"name\": \"2018-02-19-12-59-18-19745a8a59a691c40.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-19-12-59-23-20165a8a59abc36c7.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-19-12-59-23-20165a8a59abc36c7.jpeg\", \"name\": \"2018-02-19-12-59-23-20165a8a59abc36c7.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-19-12-59-29-12935a8a59b1a27d1.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-19-12-59-29-12935a8a59b1a27d1.jpeg\", \"name\": \"2018-02-19-12-59-29-12935a8a59b1a27d1.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-19-12-59-35-17755a8a59b721b52.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-19-12-59-35-17755a8a59b721b52.jpeg\", \"name\": \"2018-02-19-12-59-35-17755a8a59b721b52.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-19-12-59-42-15635a8a59bea8fde.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-19-12-59-42-15635a8a59bea8fde.jpeg\", \"name\": \"2018-02-19-12-59-42-15635a8a59bea8fde.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-19-12-59-48-14155a8a59c464827.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-19-12-59-48-14155a8a59c464827.jpeg\", \"name\": \"2018-02-19-12-59-48-14155a8a59c464827.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-19-13-00-09-16375a8a59d9cc63d.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-19-13-00-09-16375a8a59d9cc63d.jpeg\", \"name\": \"2018-02-19-13-00-09-16375a8a59d9cc63d.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-19-13-00-16-15365a8a59e099090.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-19-13-00-16-15365a8a59e099090.jpeg\", \"name\": \"2018-02-19-13-00-16-15365a8a59e099090.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-19-13-00-24-17575a8a59e866db9.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-19-13-00-24-17575a8a59e866db9.jpeg\", \"name\": \"2018-02-19-13-00-24-17575a8a59e866db9.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-19-13-00-33-18965a8a59f115504.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-19-13-00-33-18965a8a59f115504.jpeg\", \"name\": \"2018-02-19-13-00-33-18965a8a59f115504.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-19-13-00-39-10805a8a59f7e5a06.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-19-13-00-39-10805a8a59f7e5a06.jpeg\", \"name\": \"2018-02-19-13-00-39-10805a8a59f7e5a06.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-19-13-00-50-11205a8a5a0247d56.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-19-13-00-50-11205a8a5a0247d56.jpeg\", \"name\": \"2018-02-19-13-00-50-11205a8a5a0247d56.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-19-13-01-00-14525a8a5a0c1aee7.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-19-13-01-00-14525a8a5a0c1aee7.jpeg\", \"name\": \"2018-02-19-13-01-00-14525a8a5a0c1aee7.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-19-13-01-05-12005a8a5a11c0f1b.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-19-13-01-05-12005a8a5a11c0f1b.jpeg\", \"name\": \"2018-02-19-13-01-05-12005a8a5a11c0f1b.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-19-13-01-11-18985a8a5a1735d56.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-19-13-01-11-18985a8a5a1735d56.jpeg\", \"name\": \"2018-02-19-13-01-11-18985a8a5a1735d56.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-19-13-01-15-13735a8a5a1b1ce21.png\", \"url\": \"http://localhost:1234/storage/2018-02-19-13-01-15-13735a8a5a1b1ce21.png\", \"name\": \"2018-02-19-13-01-15-13735a8a5a1b1ce21.png\", \"size\": \"true\", \"type\": \"png\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-19-13-01-19-13005a8a5a1fb1581.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-19-13-01-19-13005a8a5a1fb1581.jpeg\", \"name\": \"2018-02-19-13-01-19-13005a8a5a1fb1581.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-19-13-01-23-17155a8a5a2324e03.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-19-13-01-23-17155a8a5a2324e03.jpeg\", \"name\": \"2018-02-19-13-01-23-17155a8a5a2324e03.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-19-13-01-33-16905a8a5a2d101f7.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-19-13-01-33-16905a8a5a2d101f7.jpeg\", \"name\": \"2018-02-19-13-01-33-16905a8a5a2d101f7.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}, {\"get\": \"http://localhost:1234/api/img?file=2018-02-19-13-01-44-17105a8a5a3899e14.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-19-13-01-44-17105a8a5a3899e14.jpeg\", \"name\": \"2018-02-19-13-01-44-17105a8a5a3899e14.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}]}',\n 'Decoration' => '毛胚房',\n 'floor_age' => '231',\n 'supply_heating' => '个人供暖',\n 'elevator' => '一梯3户',\n 'surroundings' => '注意导航守卫并没有应用在跳转路由上,而仅仅应用在其目标上。在下面这个例子中,为 /a 路由添加一个 beforeEach 或 beforeLeave 守卫并不会有任何效果。\n\n其它高级用法,请参考例子。',\n 'community_info' => '『别名』的功能让你可以自由地将 UI 结构映射到任意的 URL,而不是受限于配置的嵌套路由结构。\n\n更多高级用法,请查看例子。',\n 'traffic' => '『重定向』的意思是,当用户访问 /a时,URL 将会被替换成 /b,然后匹配路由为 /b,那么『别名』又是什么呢?\n\n/a 的别名是 /b,意味着,当用户访问 /b 时,URL 会保持为 /b,但是路由匹配则为 /a,就像用户访问 /a 一样。\n\n上面对应的路由配置为:',\n 'house_age_limit' => '231',\n 'huxing_map_info' => '{\"hall\": {\"hall_1\": {\"arae\": \"213\", \"direction\": \"东南\"}}, \"balcony\": {\"balcony_1\": {\"arae\": \"231\", \"direction\": \"北\"}}, \"bedroom\": {\"bedroom_1\": {\"arae\": \"231\", \"direction\": \"北\"}}, \"kitchen\": {\"kitchen_1\": {\"arae\": \"231\", \"direction\": \"南\"}}, \"bathroom\": {\"bathroom_1\": {\"arae\": \"231\", \"direction\": \"北\"}, \"bathroom_2\": {\"arae\": \"231\", \"direction\": \"西\"}}}',\n 'tags' => '[\"地铁房\", \"随时看房\", \"市中心\", \"学区房\", \"新房\"]',\n 'created_at' => '2018-02-19 13:02:27',\n 'updated_at' => '2018-02-19 13:03:26',\n 'price' => 15150.0,\n 'room_count' => '{\"hall\": \"1\", \"balcony\": \"1\", \"bedroom\": \"1\", \"kitchen\": \"1\", \"bathroom\": \"2\"}',\n 'negative_floor' => '0',\n 'deed_info' => '[{\"get\": \"http://localhost:1234/api/img?file=2018-02-19-13-02-19-19485a8a5a5b124d5.jpeg\", \"url\": \"http://localhost:1234/storage/2018-02-19-13-02-19-19485a8a5a5b124d5.jpeg\", \"name\": \"2018-02-19-13-02-19-19485a8a5a5b124d5.jpeg\", \"size\": \"true\", \"type\": \"jpeg\"}]',\n 'user_id' => 1,\n 'unit_number' => '213',\n 'building_number' => '213',\n 'house_number' => '213',\n 'contact' => '231',\n 'tel' => '231',\n 'expect_price' => '321',\n 'community' => '延东小区',\n 'status' => 'sell',\n 'location' => '陕西省西安市未央区张家堡街道名栩茶业盐东小区',\n 'city' => '西安',\n 'hot' => 0,\n 'new' => 0,\n 'location_info' => '{\"lat\": \"108.933216\", \"lng\": \"34.341867\", \"city\": \"西安市\", \"level\": \"兴趣点\", \"adcode\": \"610112\", \"citycode\": \"029\", \"district\": \"未央区\", \"location\": \"108.933216,34.341867\", \"province\": \"陕西省\", \"formatted_address\": \"陕西省西安市未央区延东小区\"}',\n ),\n ));\n \n \n }", "public function save()\n {\n file_put_contents(\"address.json\", json_encode($this->content));\n }", "public function saveData()\r\n {\r\n \r\n }", "public function store(Request $request)\n {\n //Validation\n //File Upload if file exist\n //Store Data\n $house = new House;\n $house->user_id= request('name'); \n $house->township_id = request('township');\n $house->type_id = request('type');\n $house->title = request('title');\n $house->area= request('area'); \n $house->price = request('price');\n $house->room = request('room');\n $house->location= request('location'); \n $house->image = request('image');\n $house->phone = request('phone');\n $house->status = request('status');\n $house->description = request('des');\n $house->save();\n return redirect()->route('create.index');\n //Redirect\n }", "function save() {\n $all_fields = ['id' => $this->id] + ['data' => JSON::encode($this->getData(true))];\n if($this->_just_created) {\n $ps = DB::connect(isset(self::$external_dsn)?self::$external_dsn:null)->prepare(\"\n insert into \".static::$table.\"(\".implode(\",\", array_keys($all_fields)).\")\n values (\".implode(\", \", array_map(function($field) {return \":$field\";}, array_keys($all_fields))).\")\n \");\n } else {\n $ps = DB::connect(isset(self::$external_dsn)?self::$external_dsn:null)->prepare(\"\n update \".static::$table.\"\n set \".implode(\", \", array_map(function($field) {return \"$field = :$field\";}, array_keys($all_fields))).\"\n where id = :id\n \");\n }\n foreach ($all_fields as $field => $value) {\n if (is_bool($value)) {\n $ps->bindValue($field, $value, \\PDO::PARAM_BOOL);\n } else {\n $ps->bindValue($field, $value);\n }\n }\n // Little cheat to get calculated data to be displayed in api call request\n $this->data = $this->getData();\n $ps->execute();\n $this->_just_created = false;\n return $this;\n }", "public function store(Request $request)\n {\n //\n $data = $request->all();\n\n $validator = Validator::make($data, [\n 'mobile_no' => 'required',\n 'qr_code_id' => 'required',\n 'user_id' => 'required',\n 'building_id' => 'required',\n ]);\n \n\n if($validator->fails()){\n return response([ 'data' => null, 'message' => 'Required fields missing'], 200);\n }\n\n $building = \\App\\Building::where('building_number', $request->building_id)->first();\n\n if($building){\n\n $household = HouseholdDetail::where('mobile_no',$request->mobile_no)->first();\n\n\n $existing_qr = HouseholdDetail::where('qr_code_id',$request->qr_code_id)->first();\n\n if($existing_qr){\n return response([ 'data' => null, 'status_code' => 'ALREADY_USED', 'message' => 'Error adding household, try again'], 200);\n }\n if(!$household){\n\n $household = new HouseholdDetail;\n }\n\n $qr = \\App\\QrCode::find($request->qr_code_id);\n \n if($qr){\n $household->mobile_no = $request->mobile_no;\n $household->building_id = $building->id;\n $household->user_id = $request->user_id;\n $household->qr_code_id = $qr->id;\n $household->name = $request->name;\n $household->total_female = $request->total_female;\n $household->total_male = $request->total_male;\n $household->total_above_60 = $request->total_above_60;\n $household->total_below_10 = $request->total_below_10;\n $household->emergency_contact_no = $request->emergency_contact_no;\n $household->nationality = $request->nationality;\n \n $householdDetail = $household->save();\n\n if($householdDetail){\n\n $qr->status = \"active\";\n $qr->save();\n\n return response([ 'data' => new HouseholdDetailResource($household), 'status_code' => 'SUCCESS','message' => 'Added household successfully'], 200);\n }\n else{\n return response([ 'data' => null, 'status_code' => 'FAILED','message' => 'Error adding household, try again'], 200);\n } \n }\n else{\n return response([ 'data' => null, 'status_code' => 'FAILED','message' => 'Error adding household, try again'], 200);\n }\n }\n else{\n return response([ 'data' => null, 'status_code' => 'FAILED','message' => 'Building not found, please pick building from the map'], 200);\n }\n }", "public\n function store(Request $request)\n {\n if (!empty($request)) {\n $datatouSave = Array();\n $datatouSave['cost'] = 0;\n $data = json_decode($request->data);\n foreach ($data as $key => $value) {\n $datatouSave[$value->name] = $value->value;\n }\n //print_r($datatouSave);\n for ($i = 0; $i < $request->count; $i++) {\n $row = Array();\n $row['cost'] = $datatouSave['cost[' . $i . ']'];\n $row['time'] = $datatouSave['time[' . $i . ']'];\n if ($row['time'] == 60) {\n $datatouSave['cost'] = $row['time'];\n }\n unset($datatouSave['cost[' . $i . ']']);\n unset($datatouSave['time[' . $i . ']']);\n $datatouSave['costsofplace'][] = $row;\n }\n if (!isset($datatouSave['time']) || empty($datatouSave['time'])) {\n $datatouSave['time'] = new DateTime();\n }\n $datatouSave['lat'] = $request->lat;\n $datatouSave['long'] = $request->long;\n $datatouSave['loc'] = \\DB::raw(\"GeomFromText('POINT(\" . $request->lat . \" \" . $request->long . \")')\");\n $datatouSave['user_id'] = $request->user_id;\n if (!isset($datatouSave['provider_id']) || empty($datatouSave['provider_id'])) {\n $datatouSave['provider_id'] = $request->user_id;\n }\n if (!(isset($datatouSave['reportedcount']) && !empty($datatouSave['reportedcount']))) {\n $datatouSave['reportedcount'] = 100;\n }\n if (isset($datatouSave['occupied']) && !empty($datatouSave['occupied'])) {\n $datatouSave['emptyspaces'] = $datatouSave['reportedcount'] - $datatouSave['occupied'];\n }\n $datatouSave['empty'] = 0;\n if (!isset($datatouSave['avaliable']) || empty($datatouSave['avaliable'])) {\n $datatouSave['avaliable'] = 0;\n } else {\n $datatouSave['avaliable'] = 1;\n }\n if (!isset($datatouSave['validity']) || empty($datatouSave['validity'])) {\n $datatouSave['validity'] = 5;\n }\n $datatouSave['capacity'] = $datatouSave['reportedcount'];\n $datatouSave['source_id'] = 6;\n $datatouSave['opendata'] = 0;\n // $datatouSave['name']= $data->name;;\n //$datatouSave['cost']=$data->cost;;\n //print_r($datatouSave);\n $pricesandduration = Array();\n foreach ($datatouSave['costsofplace'] as $value) {\n $pricesandduration[$value['time']] = $value;\n }\n $park = new Places();\n foreach ($datatouSave as $key => $value) {\n if ($key != 'costsofplace') {\n $park->$key = $value;\n }\n }\n $exists = DB::select('SELECT checkIfParkingExists(' . $park->lat . ',' . $park->long . ') as checkifexists');\n if (empty($exists[0]->checkifexists)) {\n $park->save();\n foreach ($pricesandduration as $key => $valueInternal) {\n $pc = new PlacesCosts();\n $pc->cost = $valueInternal['cost'];\n $pc->time = $valueInternal['time'];\n $park->placesCosts()->save($pc);\n }\n //save activity\n $activity = new Activity();\n $activity->places_id = $park->id;\n $activity->parked = 1;\n $activity->user_id = $park->user_id;\n $activity->time = $park->time;\n $activity->save();\n } else {\n $existingparking = Places::find($exists[0]->checkifexists);\n $existingparking->name = $park->name;\n $existingparking->disabledcount = $park->disabledcount;\n $existingparking->empty = $park->empty;\n $existingparking->avaliable = $park->avaliable;\n $existingparking->user_id = $park->user_id;\n $existingparking->reportedcount = $park->reportedcount;\n $existingparking->validity = $park->validity;\n $existingparking->capacity = $park->capacity;\n $existingparking->time = $park->time;\n $existingparking->maximumduration = $park->maximumduration;\n $existingparking->source_id = $park->source_id;\n $existingparking->opendata = $park->opendata;\n $existingparking->lat = $park->lat;\n $existingparking->long = $park->long;\n $existingparking->loc = $park->loc;\n $existingparking->provider_id = $park->provider_id;\n $existingparking->save();\n $theplacesCosts = $existingparking->placesCosts;\n // d($theplacesCosts);\n foreach ($theplacesCosts as $keyInternal => $valueInternal) {\n // d($valueInternal->cost);\n if (isset($pricesandduration[$valueInternal->time])) {\n $valueInternal->cost = $pricesandduration[$valueInternal->time]['cost'];\n $valueInternal->save();\n unset($pricesandduration[$valueInternal->time]);\n } else {\n $valueInternal->delete();\n unset($theplacesCosts[$keyInternal]);\n }\n }\n foreach ($pricesandduration as $keyInternal => $valueInternal) {\n $pc = new PlacesCosts();\n $pc->cost = $valueInternal['cost'];\n $pc->time = $valueInternal['time'];\n $existingparking->placesCosts()->save($pc);\n }\n //save activity\n $activity = new Activity();\n $activity->places_id = $exists[0]->checkifexists;\n $activity->parked = 1;\n $activity->user_id = $park->user_id;\n $activity->time = $park->time;\n $activity->save();\n }\n\n return response('{\"content\":' . json_encode($datatouSave) . ',\"status\":\"success\"}', 200);\n } else {\n return response('{\"content\":' . $request->lat . \" \" . $request->long . ',\"status\":\"success\"}', 200);\n }\n }", "function saveData() {\n\n\t\t$this->getMapper()->saveData();\t\n\t\t\n\t\t\n\t}", "public function save()\n\t {\n\t\tif (isset($this->_advert->date) === true && isset($this->_advert->phone) === true)\n\t\t {\n\t\t\t$bigfile = new BigFile(\"base-\" . $this->_advert->phone, 10);\n\t\t\t$bigfile->addrecord($this->_advert->date);\n\t\t } //end if\n\n\t }", "public function save()\n {\n $this->save_meta_value('_sim_city_main_info', $this->city_main_info);\n\n $this->save_meta_value('_sim_city_shops', $this->city_shops);\n }", "public function updateDatabase(){\n $api_response = Http::get(config('urls.api'));\n //Place in database\n $this->postToDatabase($api_response);\n }", "public function save()\n {\n $this->variableApi->set('RKFineArtPhotographerModule', 'albumEntriesPerPage', $this->getAlbumEntriesPerPage());\n $this->variableApi->set('RKFineArtPhotographerModule', 'linkOwnAlbumsOnAccountPage', $this->getLinkOwnAlbumsOnAccountPage());\n $this->variableApi->set('RKFineArtPhotographerModule', 'albumItemEntriesPerPage', $this->getAlbumItemEntriesPerPage());\n $this->variableApi->set('RKFineArtPhotographerModule', 'linkOwnAlbumItemsOnAccountPage', $this->getLinkOwnAlbumItemsOnAccountPage());\n $this->variableApi->set('RKFineArtPhotographerModule', 'enableShrinkingForAlbumItemImage', $this->getEnableShrinkingForAlbumItemImage());\n $this->variableApi->set('RKFineArtPhotographerModule', 'shrinkWidthAlbumItemImage', $this->getShrinkWidthAlbumItemImage());\n $this->variableApi->set('RKFineArtPhotographerModule', 'shrinkHeightAlbumItemImage', $this->getShrinkHeightAlbumItemImage());\n $this->variableApi->set('RKFineArtPhotographerModule', 'thumbnailModeAlbumItemImage', $this->getThumbnailModeAlbumItemImage());\n $this->variableApi->set('RKFineArtPhotographerModule', 'thumbnailWidthAlbumItemImageView', $this->getThumbnailWidthAlbumItemImageView());\n $this->variableApi->set('RKFineArtPhotographerModule', 'thumbnailHeightAlbumItemImageView', $this->getThumbnailHeightAlbumItemImageView());\n $this->variableApi->set('RKFineArtPhotographerModule', 'thumbnailWidthAlbumItemImageDisplay', $this->getThumbnailWidthAlbumItemImageDisplay());\n $this->variableApi->set('RKFineArtPhotographerModule', 'thumbnailHeightAlbumItemImageDisplay', $this->getThumbnailHeightAlbumItemImageDisplay());\n $this->variableApi->set('RKFineArtPhotographerModule', 'thumbnailWidthAlbumItemImageEdit', $this->getThumbnailWidthAlbumItemImageEdit());\n $this->variableApi->set('RKFineArtPhotographerModule', 'thumbnailHeightAlbumItemImageEdit', $this->getThumbnailHeightAlbumItemImageEdit());\n $this->variableApi->set('RKFineArtPhotographerModule', 'enabledFinderTypes', $this->getEnabledFinderTypes());\n }", "function saveCiudad() {\n if ($_GET['action'] == 'ciudades') {\n //Decodifica un string de JSON\n $obj = json_decode(file_get_contents('php://input'));\n $objArr = (array) $obj;\n if (empty($objArr)) {\n $this->response(422, \"error\", \"Nothing to add. Check json\");\n } else if (isset($obj->name)) {\n $ciudad = new CiudadDB();\n $ciudad->insert($obj->name);\n $this->response(200, \"success\", \"Nuevo registro añadido exitosamente\");\n } else {\n $this->response(422, \"error\", \"The property is not defined\");\n }\n } else {\n $this->response(400);\n }\n }", "public function savePokemons(){\n try {\n $response = Http::get('https://pokeapi.co/api/v2/pokemon?limit=1118');\n $pokemons = $response->json()['results'];\n foreach($pokemons as $pokemon){\n $search = PokemonsModel::where('nombre', $pokemon['name'])->first();\n if(!isset($search)){\n $create = new PokemonsModel([\n 'nombre' => $pokemon['name'],\n 'detalle_url' => $pokemon['url']\n ]);\n $create->save();\n }\n }\n } catch (Exception $err) {\n return response()->json($err, 500);\n }\n \n return response()->json(['message' => 'Save success'], 200);;\n }", "public function save() {\r\n /** probably we should add a timestamp, Item ID and stuff */\r\n $stored_data = json_encode(array($this->name, $this->status), JSON_UNESCAPED_UNICODE);\r\n $this->db_write(\"objects\", \"Item_s11n\", $stored_data);\r\n print ($stored_data);\r\n }", "public function store(){\n\n apiwat::create(request(['title','author', 'price','publish_date', 'website', 'id']));\n\n return back();\n }", "public function store($id) /* Maria Rennemark - add a house to a specific booking*/\n\t{\n\t\t$house = new Houses(\n\t\t\tarray(\n\t\t\t\t'name' => Input::get('checkbox1') ));\n\t\t$booking = Bookings::find($id);\n\t\t$house = $booking->houses()->save($house);\n\n\t\treturn Redirect::to('verification'.$id);\n\n}", "public function store()\r\n\t{\r\n\t\t$jsonData = $this->getAll();\r\n\r\n\t $data = array(\r\n\t\t\t'username'=> $this->user->username,\r\n\t\t\t'post'=> $this->post,\r\n\t\t\t'date'=> $this->date,\r\n\t );\r\n\r\n\t\tarray_unshift($jsonData, $data);\r\n\r\n\t\t$this->save($jsonData);\r\n\t}", "public function store($data)\n {\n try {\n $store = new Listing;\n $store->user_id = $data['user_id'] ?? Auth::user()->id;\n $store->listing_category_id = $data['listing_category_id'];\n $store->listing_type = $data['listing_type'];\n $store->state_id = $data['state_id'];\n $store->city_id = $data['city_id'];\n $store->local_govt_id = $data['local_govt_id'];\n $store->title = $data['title'];\n $store->address = $data['address'];\n $store->description = $data['description'] ?? null;\n $store->room_policy = $data['room_policy'] ?? null;\n $store->service_option = $data['service_option'] ?? 'no';\n $store->service_description = $data['service_description'] ?? null;\n $store->baths = $data['baths'] ?? null;\n $store->rooms = $data['rooms'] ?? null;\n $store->pricing_type = $data['pricing_type'] ?? \"monthly\";\n $store->amount = $data['amount'] ?? 0;\n $store->amount = $data['step'] ?? 1;\n $store->save();\n activity()\n ->causedBy(Auth::user())\n ->performedOn($store)\n ->withProperties(['id' => $store->id])\n ->log('listing category created');\n if(!empty($data['property_amenities'])){\n $amenities = new Request(['listing_id' => $store->id, 'amenities'=> $data['property_amenities']]);\n ListingAmenitiesController::bulk_update($amenities);\n }\n return $store;\n } catch (Exception $e) {\n return $e->getMessage();\n }\n }", "function statuses_saveData() {\n\n\t// Get array with new data\n\t$fields = statuses_getData();\n\t$count = sizeof($fields); // count items\n\n\t// Construct URL\n\t$url = BASEURL . \"v1/statuses?count=\" . $count . \"&token=\" . getToken(1);\n\n\t// Get existing data\n\t$response = array_reverse(doGetRequest($url));\n\n\t// Iterate through all new items and if their ID isn't found in the request with the latest data, add them\n\tfor ($i=0; $i < 50; $i++) { \n\n\t\t$newId = $fields[$i]['org_id']; // original ID of a new item\n\t\t\n\t\tif($response['code'] == 404) {\n\t\t\tdoPostRequest($url, $fields[$i]);\n\t\t}\n\t\telseif(!in_array_r($newId, $response)) {\n\t\t\tdoPostRequest($url, $fields[$i]);\n\t\t}\n\t\n\t}\n\n}", "public function store(Request $request){\n $validator = Validator::make($request->all(), [\n 'sponsor_id' => 'numeric|exists:sponsors,id',\n 'apartment_id' => 'numeric|exists:apartments,id',\n ]);\n // se dati ricevuti non sono corretti, restituisco JSON di errore\n if ($validator->fails()) {\n return response()->json(['Messaggio'=>'Errore inserimento']);\n }\n // controllo se ultima data di fine per questo apartment_id è maggiore della data attuale\n // allora prendo ultima data fine come inizio della nuova sponsorizzazione\n $ora = Carbon::now();\n $ultimaDataFine = Carbon::parse(SponsorApartment::where('apartment_id',$request->apartment_id)->pluck('data_fine')->sortDesc()->first());\n if($ultimaDataFine->greaterThan($ora)){\n $request['data_inizio'] = $ultimaDataFine;\n } else {\n $request['data_inizio'] = $ora;\n };\n // aggiungo durata alla data inizio e calcolo data fine\n $durata = Sponsor::where('id',$request->sponsor_id)->pluck('durata')->first();\n $request['data_fine'] = Carbon::parse($request['data_inizio'])->addHours($durata);\n // scrivo dati su database e restituisco JSON di risposta\n $sponsorApartment = SponsorApartment::create($request->all());\n return response()->json($sponsorApartment,201);\n\n dd($sponsorApartment);\n\n }", "public function saveamenitiesinfo(Request $request){\n\t\t$data = array();\n\t\t$data['status'] = 0;\n\t\t$data['msg'] = 'Error';\n\t\t\n\t\t$input = $request->all();\n\t\t$propertyid = $input['propertyid'];\n\t\t$amenitiesinfo = $input['amenitiesinfo'];\n\t\t$featuresinfo = $input['featuresinfo'];\n\t\t/*return response()->json($roomsinfo); \n\t\texit();*/\n\t\t\n\t\t$propertydata = Property::find($propertyid);\n\t\t\n\t\tif(empty($propertydata)){\n\t\t\t$data['msg'] = 'Invalid Property';\n\t\t}\n\t\telse{\n\t\t\t$propertydata->property_amenities = json_encode($amenitiesinfo);\n\t\t\t$propertydata->property_features = json_encode($featuresinfo);\n\t\t\tif($propertydata->update()){\n\t\t\t\t$data['status'] = 1;\n\t\t\t\t$data['msg'] = 'Property Data Saved';\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$data['msg'] = 'Error in save property details';\t\t\n\t\t\t}\n\t\t}\n\t\treturn response()->json($data); \n\t\texit();\n }", "static function saveToDB() {\n try {\n $diff_id = self::arrayDiff()[\"diff_id\"];\n\n //errors handling\n } catch (\\Exception $e) {\n return [\"uploadedlist\"=>\"\",\"title\"=>$e->getMessage()];\n }\n\n\n\n try {\n $count = 0;\n if (empty($diff_id)) { throw new Exception(\"All items saved!\");}\n //for debugging only 100\n //$diff_id=array_slice($diff_id,0,300);\n foreach ($diff_id as $id) {\n $offer = self::getDataByID($id, $_SESSION[\"api_key\"]);\n //$offer = self::getDataByID(\"14646350\", $_SESSION[\"api_key\"]);\n //to get keys for checking\n $offer_keys = array_keys($offer);\n\n $model = new Offers();\n $isExists = [];\n //saving all items except for having prefix \"c\"\n foreach ($offer_keys as $k => $offer_key) {\n if ($model->hasProperty($offer_key)) {\n $model[$offer_key] = $offer[$offer_key];\n $isExists[] = true;\n }\n }\n //saving items having prefix \"c\"\n if (!empty($offer[\"characteristics_values\"])) {\n $offerChars = $offer[\"characteristics_values\"];\n $offer_keysChars = array_keys($offerChars);\n foreach ($offer_keysChars as $k => $offer_key) {\n if ($model->hasProperty(\"c\" . $offer_key)) {\n $model[\"c\" . $offer_key] = round($offerChars[$offer_key]);\n $isExists[] = true;\n }\n\n }\n //echo var_export($offer[\"characteristics_values\"]);\n\n\n //echo var_export(self::$charValuesArr);\n }\n\n //saving data about Agency\n if (!empty($offer[\"agency\"])) {\n $offerAgency = $offer[\"agency\"];\n $offer_keysAgency = array_keys($offerAgency);\n foreach ($offer_keysAgency as $k => $offer_key) {\n if ($model->hasProperty($offer_key)) {\n $model[$offer_key] = round($offerAgency[$offer_key]);\n $isExists[] = true;\n }\n\n }\n }\n //saving \"user\" and \"priceUSD\"\n //to add agency id like $model[\"agency_id\"] = $offer_keys[\"user\"][\"name\"];\n if (!empty($offer[\"priceArr\"])) {\n $model[\"priceUSD\"] = $offer[\"priceArr\"][1];\n }\n $model->save(false);\n $count++;\n }\n return [\"uploadedlist\" => $count . \" items uploaded\", \"title\" => \"Success\"];\n //echo var_dump($charValuesArr);\n //return [\"uploadedlist\" => $charValuesArr, \"title\" => \"Success\"];\n } catch (\\Exception $e) {\n return [\"uploadedlist\"=>$count .\" items uploaded, id=\".$id,\"title\"=>$e->getMessage()];\n\n //echo var_dump(self::$charValuesArr);\n //return [\"uploadedlist\"=>self::$charValuesArr,\"title\"=>$e->getMessage()];\n }\n /*\n 'admin_id' => 'Admin ID',\n 'street_name' => 'Street Name',\n 'price_item' => 'Price Item',\n 'rooms_count' => 'Rooms Count',\n 'type' => 'Type',\n 'is_commercial' => 'Is Commercial',\n 'state_name' => 'State Name',\n 'beautiful_url' => 'Beautiful Url',\n 'description' => 'Description',\n 'currency_type' => 'Currency Type',\n 'metro_station_name' => 'Metro Station Name',\n 'wall_type' => 'Wall Type',\n 'publishing_date' => 'Publishing Date',\n 'realty_type_name' => 'Realty Type Name',\n 'realty_sale_type' => 'Realty Sale Type',\n 'latitude' => 'Latitude',\n 'longitude' => 'Longitude',\n 'main_photo' => 'Main Photo',\n 'building_number_str' => 'Building Number Str',\n 'city_name' => 'City Name',\n 'living_square_meters' => 'Living Square Meters',\n 'realty_type_id' => 'Realty Type ID',\n 'floors_count' => 'Floors Count',\n 'kitchen_square_meters' => 'Kitchen Square Meters',\n 'flat_number' => 'Flat Number',\n 'total_square_meters' => 'Total Square Meters',\n 'realty_id' => 'Realty ID',\n 'date_end' => 'Date End',\n 'district_name' => 'District Name',\n 'advert_type_name' => 'Advert Type Name',\n 'advert_type_id' => 'Advert Type ID',\n 'price_type' => 'Price Type',\n 'created_at' => 'Created At',\n 'levels_expired' => 'Levels Expired',\n 'is_exchange' => 'Is Exchange',\n 'floor' => 'Floor',\n 'is_bargain' => 'Is Bargain',\n 'user' => 'User',\n 'priceUSD' => 'Price Usd',\n 'c1501' => 'C1501',\n 'c1502' => 'C1502',\n 'c1503' => 'C1503',\n 'c1504' => 'C1504',\n 'c443' => 'C443',\n 'c1607' => 'C1607',\n 'c1608' => 'C1608',\n 'c1011' => 'C1011',\n 'c1464' => 'C1464',\n 'c274' => 'C274',\n 'c265' => 'C265',\n 'c1437' => 'C1437',\n 'admin_time_entered' => 'Admin Time Entered',\n }\n */\n\n\n\n }", "public function save() {}", "public function save() {}", "public function save() {}" ]
[ "0.6158201", "0.61282796", "0.6126096", "0.6077741", "0.6012739", "0.59959525", "0.5984435", "0.59579444", "0.59231687", "0.588005", "0.58591515", "0.5828687", "0.5826385", "0.5815575", "0.57798016", "0.5759381", "0.57567835", "0.5684596", "0.56678474", "0.56493664", "0.56486434", "0.56415164", "0.5628133", "0.56122833", "0.56031436", "0.5581922", "0.55739546", "0.55649316", "0.55649316", "0.55623126" ]
0.7213015
0
Clear the list of booted models so they will be rebooted.
public static function clearBootedModels() { static::$booted = []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function clearBootedModels();", "public function clearModels();", "protected static function booted(): void\n {\n static::deleting(function (Model $model) {\n $model->removeAllImages();\n });\n }", "protected function forgetAddedModels()\n {\n $this->quantities = $this->modelPopulators = [];\n }", "public function resetModelMocks()\n {\n $this->_registeredModelMocks = array();\n }", "public static function clear()\n {\n self::$drivers = array();\n }", "public static function reset()\n {\n self::$toLoad = array();\n }", "public static function reset()\n {\n self::resetDefault();\n self::$instances = array();\n }", "public static function reset()\n\t{\n\t\tstatic::$instances = [];\n\t}", "protected static function boot()\n {\n \tparent::boot();\n\n \tstatic::deleting(function($model) {\n \t\t$model->attributes()->sync([]);\n \t});\n }", "public function deleteAll()\n {\n $this->ensureModels();\n foreach ($this->_models as $model) {\n $model->delete();\n }\n }", "public function clearAllDevices(){\n\t\t$db = Db::getInstance();\n\n\t\t$req = $db->prepare('DELETE FROM Devices');\n\t\t$req->execute();\n\t\t\n\n\n\t}", "public function cleanModuleList()\n {\n /**\n * @var \\Magento\\TestFramework\\ObjectManager $objectManager\n */\n $objectManager = \\Magento\\TestFramework\\Helper\\Bootstrap::getObjectManager();\n $objectManager->removeSharedInstance(ModuleList::class);\n $objectManager->removeSharedInstance(ModuleListInterface::class);\n }", "public static function resetAll(): void\n {\n static::getFacadeRoot()->resetAll();\n }", "public function resetCharacteristics() {\n\t\t$characteristics = array_combine(array(\n\t\t\t'contains_model', 'contains_datasource', 'contains_behavior', 'contains_controller',\n\t\t\t'contains_component', 'contains_view', 'contains_helper', 'contains_theme', 'contains_vendor',\n\t\t\t'contains_shell', 'contains_test', 'contains_lib', 'contains_resource', 'contains_config'\n\t\t), array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0));\n\n\t\t$this->out(__('Resetting all characteristics'));\n\t\t$this->Package->updateAll($characteristics);\n\n\t\t$this->out(__('* Successfully reset all characteristics'));\n\t\t$this->_stop();\n\t}", "public function reset() {\n\t\t$this->registered = array();\n\t}", "public static function reboot(): void\n {\n //====================================================================//\n // Clear Module Configuration Array\n if (isset(self::core()->conf)) {\n self::core()->conf = null;\n }\n //====================================================================//\n // Clear Webservice Configuration\n if (isset(self::core()->soap)) {\n self::core()->soap = null;\n }\n //====================================================================//\n // Clear Module Local Objects Classes\n if (isset(self::core()->objects)) {\n self::core()->objects = array();\n }\n //====================================================================//\n // Reset Commits Manager\n CommitsManager::reset();\n //====================================================================//\n // Clear Module Log\n self::log()->cleanLog();\n self::log()->deb('Splash Module Rebooted');\n }", "protected static function boot()\n {\n parent::boot();\n\n static::deleting(function($model) {\n $model->categories()->detach();\n $model->attributes()->detach();\n\n // Delete product images\n $disk = 'uploads';\n\n foreach ($model->images as $image) {\n // Delete image from disk\n\n Storage::disk($disk)->delete($image->name);\n\n\n // Delete image from db\n $image->delete();\n }\n });\n }", "public function clear() {\n\t\t$this->backends = [];\n\t\t$this->initializedBackends = [];\n\t}", "public function reset() : void\n {\n $this->getFilesystemLoader()->reset();\n }", "public function clearModels()\n {\n $this->_models = array();\n return $this;\n }", "protected static function boot()\n\t{\n\t\tparent::boot();\n\t\tModel::unguard();\n\t}", "private function reset()\n {\n $this->human->reset();\n $this->machine->reset();\n $this->memory->reset();\n }", "protected function bootIfNotBooted()\n {\n if (! isset(static::$booted[static::class])) {\n static::$booted[static::class] = true;\n\n $this->fireModelEvent('booting', false);\n\n static::boot();\n\n $this->fireModelEvent('booted', false);\n }\n }", "protected function reset(): void\n {\n $this->bot = null;\n $this->client = null;\n $this->device = null;\n $this->os = null;\n $this->brand = '';\n $this->model = '';\n $this->parsed = false;\n }", "public function resetDataModel() {\r\n $this->arrModel = array();\r\n $intPackageId = NULL;\r\n }", "protected function bootIfNotBooted()\n {\n if (! isset(static::$booted[static::class])) {\n static::$booted[static::class] = true;\n\n $this->fireModelEvent('booting', false);\n\n static::booting();\n static::boot();\n static::booted();\n\n $this->fireModelEvent('booted', false);\n }\n }", "protected static function boot()\n {\n parent::boot();\n\n static::deleting(function ($model) {\n $model->roles()->detach();\n $model->routes()->detach();\n $model->actions()->detach();\n });\n }", "public static function clear_all() {\n\t\tstatic::$cache = array();\n\t\tstatic::$mapping = array();\n\t}", "public function unsetAll() {\n\t\tparent::unsetAll();\n\t}" ]
[ "0.8700318", "0.72563404", "0.66823345", "0.66046894", "0.6544441", "0.63992864", "0.63572377", "0.6318385", "0.6299947", "0.62808114", "0.6279543", "0.6196935", "0.616978", "0.6148886", "0.6119523", "0.61061716", "0.6072173", "0.6064169", "0.6059776", "0.6058886", "0.6057026", "0.5983577", "0.59491426", "0.5946936", "0.5938106", "0.5931766", "0.5930907", "0.5925575", "0.59067714", "0.58825743" ]
0.89517516
1
Returns the directory name corresponding to the object type. For pages the directory name is "pages", for layouts "layouts", etc.
public function getObjectTypeDirName() { return $this->dirName; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function dirName()\n {\n return str_plural(strtolower($this->itemClass()));\n }", "private function _getTypeDirectory( $type )\n\t\t{\n\t\t\t$config = Config::getInstance();\n\t\t\t$directory = null;\n\t\t\tswitch ( $type ) {\n\t\t\t\tcase 'installed':\n\t\t\t\tcase 'uninstalled':\n\t\t\t\t\t$directory = $config->notification->libPluginDirectory;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'recently_installed':\n\t\t\t\tcase 'run_out':\n\t\t\t\tcase 'expired':\n\t\t\t\tcase 'trial_run_out':\n\t\t\t\tcase 'trial_expired':\n\t\t\t\t\t$directory = $config->notification->indexDirectory;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'current_month_overdraft':\n\t\t\t\tcase 'expired_overdraft':\n\t\t\t\tcase 'unpaid_overdraft':\n\t\t\t\t\t$directory = $config->notification->optionsDirectory;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'forgot':\n\t\t\t\t\t$directory = $config->notification->authDirectory;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\treturn $directory;\n\t\t}", "public function getDirname();", "public function get_directory_by_type ( $type = 'bundled' ) {\n\t\t$path = '';\n\t\tswitch ( $type ) {\n\t\t\tcase 'standalone':\n\t\t\t\t$path = trailingslashit( WP_PLUGIN_DIR );\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'downloadable':\n\t\t\t\t$path = $this->downloads_path;\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'bundled':\n\t\t\tdefault:\n\t\t\t\t$path = $this->components_path;\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\treturn $path;\n\t}", "protected function _dir(): string\n {\n if ($container = $this->_container()) {\n assert($container->hasId());\n return \"{$container}/\" . static::DIR;\n }\n return static::DIR;\n }", "protected function getJsonTypeFolder(): string\n {\n $path = self::getJsonFolder();\n return $path . DIRECTORY_SEPARATOR . $this->type;\n }", "private function _get_asset_type_dir($type)\n\t{\n\t\t$asset_dir = '';\n\t\t\n\t\t$asset_dir .= $this->_ci->config->item('bucket_assets_path');\n\t\t$asset_dir .= $this->_ci->config->item('bucket_assets_' . $type . '_path');\n\t\t\n\t\treturn $asset_dir;\n\t}", "protected function get_dir() {\r\n return dirname( ( new \\ReflectionClass( static::class ) )->getFileName());\r\n }", "public function getDirname()\n {\n return static::dirname($this->path);\n }", "protected function getDir()\n {\n $reflectionClass = new \\ReflectionClass(get_class($this));\n return dirname($reflectionClass->getFileName());\n }", "public function getModuleDir($type, $moduleName)\n {\n $codePool = (string)$this->getModuleConfig($moduleName)->codePool;\n $codePoolParts = explode(\"_\",$codePool);\n if( is_array($codePoolParts) && sizeof($codePoolParts) > 1 ) {\n $codePool = $codePoolParts[0].DS.$codePoolParts[1];\n }\n\n $dir = $this->getOptions()->getCodeDir().DS.$codePool.DS.uc_words($moduleName, DS);\n\n switch ($type) {\n case 'etc':\n $dir .= DS.'etc';\n break;\n\n case 'controllers':\n $dir .= DS.'controllers';\n break;\n }//switch\n\n $dir = str_replace('/', DS, $dir);\n\n return $dir;\n }", "protected function getObjectsDirectory()\n {\n return $this->cacheDirectory . self::DIR_OBJECTS . \"/\";\n }", "public function getDirName(): string\n {\n return $this->dirName;\n }", "public function getTypeString()\n {\n switch ( $this->fileStructure->type )\n {\n case self::IS_DIRECTORY:\n return \"d\";\n\n case self::IS_FILE:\n return \"-\";\n\n case self::IS_SYMBOLIC_LINK:\n return \"l\";\n\n case self::IS_LINK:\n return \"h\";\n\n default:\n return \"Z\";\n }\n }", "public function getDirname()\n {\n return dirname($this->getPath());\n }", "public function directoryName() \r\n {\r\n return $this->directory->fullName();\r\n }", "public function getType() {\n\t\tif ($this->getIsDir()) {\n\t\t\treturn '<DIR>';\n\t\t} else {\n\t\t\treturn $this->getExtension().' file';\n\t\t}\n\t}", "protected function getObjectType() {\n if ($this->objectType) return $this->objectType;\n $key = $this->getObjectTypePlural();\n if (substr($key, -3) == 'ies') return substr($key, 0, -3).'y';\n return substr($key, 0, -1);\n }", "public function getDirName()\n {\n return $this->dirName;\n }", "public function getObjectTypeName() \n\t{\n\t\treturn self::$object_type[$this->object_type];\n\t}", "private static function detectClassTypeDir(string $className): string\n {\n foreach (self::$classTypes as $classTypeName => $classTypeDirectory) {\n if (preg_match('~.*' . $classTypeName . '$~', $className)) {\n return $classTypeDirectory;\n }\n }\n return self::DEFAULT_CLASS_DIR;\n }", "public function getName()\n {\n return 'oo_folder';\n }", "public function directoryName($object, PropertyMapping $mapping): string\n {\n return $object->getCreatedAt()->format('Y-m-d');\n }", "public static function getFolderName() {\n // Remove '-test' if it is the last part of the folder name\n // return preg_replace('/-test$/', '', kebab_case(class_basename(__CLASS__)));\n return kebab_case(self::getBaseClassName());\n }", "protected function getObjectTypePlural() {\n $tmp = explode('\\\\', get_class($this));\n return $tmp[count($tmp)-2]; \n }", "private function instanceDirectory () : string {\n return dirname((new ReflectionClass(static::class))->getFileName());\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'documents';\n }", "private function make_class_name( $name, $type ) {\n\n\t\tif ( 'field' == $type ) {\n\t\t\t$namespace = '\\\\' . __NAMESPACE__ . '\\Admin\\Fields\\\\';\n\t\t} elseif ( 'page' == $type ) {\n\t\t\t$namespace = '\\\\' . __NAMESPACE__ . '\\Admin\\Pages\\\\';\n\t\t} else {\n\t\t\treturn '';\n\t\t}\n\n\t\t$class_name = implode( '_', array_map( 'ucfirst', explode( '-', $name ) ) );\n\n\t\treturn $namespace . $class_name;\n\t}", "protected static function classByType($type)\n {\n $type = preg_replace('/^icinga_/', '', $type);\n\n if (strpos($type, 'data') === false) {\n $prefix = 'Icinga';\n } else {\n $prefix = 'Director';\n }\n\n // TODO: Provide a more sophisticated solution\n if ($type === 'hostgroup') {\n $type = 'hostGroup';\n } elseif ($type === 'usergroup') {\n $type = 'userGroup';\n } elseif ($type === 'timeperiod') {\n $type = 'timePeriod';\n } elseif ($type === 'servicegroup') {\n $type = 'serviceGroup';\n } elseif ($type === 'apiuser') {\n $type = 'apiUser';\n }\n\n return 'Icinga\\\\Module\\\\Director\\\\Objects\\\\' . $prefix . ucfirst($type);\n }", "public function get_type_name() { \n\n\t\tswitch ($this->type) { \n\t\t\tcase 'xml-rpc': \n\t\t\tcase 'rpc':\n\t\t\t\treturn _('API/RPC');\n\t\t\tbreak;\n\t\t\tcase 'network':\n\t\t\t\treturn _('Local Network Definition');\n\t\t\tbreak;\n\t\t\tcase 'interface':\n\t\t\t\treturn _('Web Interface');\n\t\t\tbreak;\n\t\t\tcase 'stream':\n\t\t\tdefault: \n\t\t\t\treturn _('Stream Access');\n\t\t\tbreak;\n\t\t} // end switch\n\n\t}" ]
[ "0.69865394", "0.67635524", "0.6652575", "0.6649803", "0.66300887", "0.6527499", "0.6215122", "0.61566806", "0.61389947", "0.6063629", "0.6054397", "0.6043413", "0.60420436", "0.6017169", "0.60124964", "0.6008611", "0.59829533", "0.59541494", "0.59476876", "0.593549", "0.59182316", "0.59052956", "0.58581793", "0.58367056", "0.58239055", "0.58036304", "0.5798856", "0.5786422", "0.5770124", "0.5768877" ]
0.8279505
0
Returns the maximum directory nesting allowed by this template.
public function getMaxNesting() { return $this->maxNesting; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function maxDepth()\n {\n if ($this->maxDepth === null) {\n return static::DEFAULT_MAX_DEPTH;\n }\n\n return $this->maxDepth;\n }", "public static function getMaximumPathLength() {}", "public function getDepth(): int\n {\n return count(explode('/', $this->currentFileName)) - 1;\n }", "public function getMaxRecursionDepth() {\n\t\treturn $this->_maxRecursionDepth;\n\t}", "public function getMaxComponentDepth() {}", "public static function getMaxGraphicStateNestingLevel() {}", "public function getMaximumDepth()\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$query = 'SELECT MAX(depth) depth FROM '.$this->table_tree;\n\t\t$res = $ilDB->query($query);\t\t\n\t\t\n\t\t$row = $ilDB->fetchAssoc($res);\n\t\treturn $row['depth'];\n\t}", "public function getMaxDepth(): ?int;", "public function getMaxDepth(): ?int;", "function max_parent( $dirpath, $prefix )\n{\n $dirpath = rtrim ( $dirpath, \"/\" ); // Trim any trailing slash\n $position = strrpos( $dirpath, \"/\" );\n $dirpath = substr ( $dirpath, 0, $position );\n\n $lines = http_get_file( $dirpath );\n\n $regex_match = \"#${prefix}[\\d\\.]+/#\";\n $regex_replace = \"#^.*(${prefix}[\\d\\.]+)/.*$#\";\n $max = find_max( $lines, $regex_match, $regex_replace );\n\n return \"$dirpath/$max\";\n}", "public function getLevel()\n {\n return sizeof($this->getParentsID());\n }", "public function ancestorsGetDepth()\r\n {\r\n if (!isset($this->depth))\r\n {\r\n $this->depth = substr_count($this->path, \"/\");\r\n }\r\n \r\n return (int) $this->depth;\r\n }", "public function depth() {\n return $this->depth;\n }", "public function getDepthMaximum(): PositiveInteger;", "public function getNestingLevel()\n {\n $nested = $this->getNested();\n\n // another collection ... increase the level by 1\n if ($nested instanceof CollectionMapper) {\n return 1 + $nested->getNestingLevel();\n }\n\n // not another collection ... level is 1\n return 1;\n }", "protected function checkXdebugMaxNestingLevel() {}", "function calculate_folder_level($file)\n{\n$dir = \"\"; $count = 0;\nwhile(!file_exists($dir.$file)) {\n$dir .= \"../\"; $count++;\nif($count > 5) {\nreturn false;\n}\n}\ndefine(\"DIR_LEVEL\", $dir, true);\n}", "public function getDepth() {\n\t\tif ($this->depth === NULL) {\n\t\t\t$this->depth = NodePaths::getPathDepth($this->path);\n\t\t}\n\t\treturn $this->depth;\n\t}", "public function getNestingLevel();", "public function getNestingLevel()\n {\n return $this->nestingLevel;\n }", "protected function maxFiles()\n {\n if ($this->app->bound('config')) {\n return $this->app->make('config')->get('app.log_max_files', 5);\n }\n\n return 0;\n }", "public function setMaxComponentDepth($value) {}", "public function getDepth()\n {\n return ($this->isEmpty()) ? 0 : $this->root->getDepth() - 1;\n }", "public function getMaxNbChilds()\n {\n return $this->getOption('max', 0);\n }", "public function getAllowedMaxFileNumber() {\n return $this->allowedMaxFileNumber;\n }", "public static function maxLevel()\n\t{\n\t\tif (!auth()->check()) return 0;\n\t\t$member = \\PanicHDMember::find(auth()->user()->id);\n\t\tif ($member->isAdmin()){\n\t\t\treturn 3;\n\t\t}elseif($member->isAgent()){\n\t\t\treturn 2;\n\t\t}else\n\t\t\treturn 1;\n\t}", "public function getDepth() {\n\t\treturn $this->depth;\n\t}", "public function getDepth()\n {\n return $this->depth;\n }", "public function getDepth()\n {\n return $this->depth;\n }", "public function getDepth()\n {\n return $this->depth;\n }" ]
[ "0.6367185", "0.6237618", "0.6235076", "0.6183445", "0.6144252", "0.612431", "0.60825133", "0.59626013", "0.59626013", "0.5907675", "0.5822726", "0.5790901", "0.57689506", "0.57647324", "0.5746729", "0.572063", "0.56975687", "0.56738526", "0.56526834", "0.5572018", "0.55324924", "0.55259126", "0.5500723", "0.54615283", "0.5452428", "0.54447114", "0.5412892", "0.5410862", "0.5410862", "0.5410862" ]
0.7226511
0
Returns true if the object was loaded from the cache.
public function isLoadedFromCache() { return $this->loadedFromCache; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function loadCacheData()\n\t{\n\t\t//is it enabled?\n\t\tif ($this->useObjectCaching)\n\t\t{\n\t\t\t//get our cache data... is it there?\n\t\t\t$data = $this->getCache();\n\t\t\tif ($data)\n\t\t\t{\n\t\t\t\t//load it, and we're good.\n\t\t\t\t$this->hydrate($data);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public function isCached(): bool;", "public function isCached() {}", "public function isCached()\n {\n if ($this->cache->has($this->cacheKey)) {\n return true;\n }\n\n return false;\n }", "function cacheObjectExists ()\n {\n return is_file($this->cacheObjectId);\n }", "public function is_cached()\n\t\t{\n\t\t\treturn $this->cached;\n\t\t}", "protected function _loadCache()\n {\n return false;\n }", "public function hasCache(): bool\n {\n return isset($this->contents);\n }", "private function isCached()\n {\n return Cache::has($this->cacheKey());\n }", "public function isLoaded() {\n return is_object($this->result);\n }", "function isCached() {\r\n if ($this->_cachingEnabled) {\r\n $isCached = $this->_templateObject->isCached($this->_viewId);\r\n }\r\n else $isCached = false;\r\n return $isCached;\r\n }", "public static function hasCache() {\n\t\treturn false;\n\t}", "public function is_objectcache_add_in() {\n\t\tif ( !$this->objectcache_installed() )\n\t\t\treturn false;\n\n\t\treturn ( ( $script_data = @file_get_contents( W3TC_ADDIN_FILE_OBJECT_CACHE ) )\n\t\t\t&& strstr( $script_data, '//ObjectCache Version: 1.4' ) !== false );\n\t}", "public function isCached()\n\t{\n\t\treturn is_file($this->getCacheFile());\n\t}", "public function is_use_cache()\r\n {\r\n return $this->cache;\r\n }", "public function can_cache() {\n return $this->valid;\n }", "function exists() {\n \n return !empty($this->cache);\n \n }", "protected function _cached_exists()\n {\n return file_exists($this->cached_file);\n }", "public function objectcache_installed() {\n\t\treturn file_exists( W3TC_ADDIN_FILE_OBJECT_CACHE );\n\t}", "private function cached()\n {\n if (isset(self::$_cached)) {\n $this->_config = self::$_cached;\n return true;\n } else {\n return false;\n }\n }", "public function isCacheExists()\n {\n if(file_exists($this->cachedPath))\n return true;\n else\n return false;\n }", "public static function loadFromCache() {\n\t\tif (Server::isDebugModeEnabled()) {\n\t\t\t// in debug mode the server never uses caching\n\t\t\treturn false;\n\t\t}\n\n\t\t// If we are trying to load routing from cache, we must save cache after compilation for the next time\n\t\tself::$saveCache = true;\n\n\t\tif (self::isInitialized()) {\n\t\t\t// prevent calling this method a second time\n\t\t\treturn true;\n\t\t}\n\n\t\t$fileName = Server::getCacheDir() . DIRECTORY_SEPARATOR . self::CACHE_FILE_NAME;\n\n\t\tif (!is_file($fileName) || !is_readable($fileName)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (time() > (filemtime($fileName) + self::CACHE_LIFETIME)) {\n\t\t\t// cache file is expired, delete it and re-render routing table\n\t\t\tunlink($fileName);\n\n\t\t\treturn false;\n\t\t}\n\n\t\t$content = file_get_contents($fileName);\n\n\t\tif ($content) {\n\t\t\t$map = @unserialize($content);\n\n\t\t\tif (!empty($map) && is_array($map)) {\n\t\t\t\tself::$cachedMap = $map;\n\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\t// cache file contains wrong data\n\t\tunlink($fileName);\n\n\t\treturn false;\n\t}", "function should_cache() {\n return array_key_exists('cache', $this->options) && $this->options['cache'] === TRUE;\n }", "public function hasCacheStore(): bool;", "public function wasCached();", "private function hasCache()\n {\n if (!$this->isActive()) {\n return false;\n }\n\n return !empty($this->getCache(false));\n }", "public function isLazyLoadableObject()\n {\n return $this->lazyLoadable;\n }", "public function getCacheable() : bool {\n return $this->cacheable;\n }", "public function isCacheEnabled() {\n\t\treturn $this->cache;\n\t}", "private function _isLoaded() {\n return (bool) $this->id;\n }" ]
[ "0.8096812", "0.7640676", "0.7482657", "0.74748504", "0.74692136", "0.74615556", "0.74591196", "0.7450629", "0.7428408", "0.74026287", "0.7331308", "0.7271206", "0.72503763", "0.72425246", "0.7219823", "0.71931124", "0.7180526", "0.71777904", "0.71598095", "0.7149306", "0.71400625", "0.71140754", "0.7101518", "0.70972675", "0.70933545", "0.70446306", "0.70134735", "0.7007161", "0.6992733", "0.69880223" ]
0.8554659
0
Get the fillable attributes of a given array.
protected function fillableFromArray(array $attributes) { $defaults = ['fileName']; if (count($this->fillable) > 0) { return array_intersect_key( $attributes, array_flip(array_merge($defaults, $this->fillable)) ); } return $attributes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function fillableFromArray(array $attributes)\n {\n if (count($this->fillable) > 0 && !static::$unguarded)\n return array_intersect_key($attributes, array_flip($this->fillable));\n\n return $attributes;\n }", "protected function fillableFromArray(array $attributes)\n {\n if (count($this->getFillable()) > 0 && ! static::$unguarded) {\n return array_intersect_key($attributes, array_flip($this->getFillable()));\n }\n\n return $attributes;\n }", "public function getFillable()\n\t{\n\t\t$fillableColumns = $this->resource->columns->filter(function($item)\n\t\t{\n\t\t\treturn $item->fillable && $item->name;\n\t\t});\n\n\t\t$fillable = $fillableColumns\n\t\t\t->fetch('name')\n\t\t\t->all();\n\n\t\treturn $this->compileArray($fillable);\n\t}", "protected function getArrayableAttributes()\n {\n return $this->attributes;\n }", "protected function getArrayableAttributes()\n {\n return $this->attributes;\n }", "public function getModelFillable()\n {\n $fillable_arr = $this->getArrayKeyCreate();\n\n $string_result = \"['\".implode(\"', '\",$fillable_arr).\"']\"; // => ['a', 'b', 'c']\n\n return $string_result;\n }", "protected function listifyAttr( $array ) {\n\t\tksort( $array );\n\t\t$list = array();\n\t\tforeach ( $array as $name => $obj ) {\n\t\t\tif ( $obj === false ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$list[] = \"$name&nbsp;=&nbsp;<i>\" . $this->getClass( $obj, 'AttrDef_' ) . '</i>';\n\t\t}\n\n\t\treturn $this->listify( $list );\n\t}", "public function getAttributes(): array;", "public function getAttributes(): array;", "public function getAttributes(): array;", "public function getAttributes(): array;", "protected function getFillableScalars(array $attributes): array\n {\n return collect($attributes)->filter(function ($value, $key) {\n $fields = $this->getSchema()->getFillableFields()->keys();\n\n return $fields->contains($key);\n })->toArray();\n }", "public function getFillable() {\n\n if(sizeof($this->fillable) > 1) {\n unset($this->fillable[0]);\n }\n return $this->fillable;\n\n }", "protected function attributes() {\n\t $attributes = array();\n\t foreach(static::$table_fields as $field) {\n\t if(property_exists( $this, $field)) {\n\t $attributes[$field] = $this->$field;\n\t }\n\t }\n\t return $attributes;\n }", "public function sanitizeToModelFillable(array $data) {\n\n $fillable = $this->getFillable();\n\n $fillables = ! empty($fillable) \n ? $fillable \n : array_diff(\n array_diff(\n Schema::getColumnListing($this->getTable()), \n $this->getGuarded()\n ), \n $this->getHidden()\n );\n\n return array_intersect_key($data, array_flip($fillables));\n }", "public function attributes() // atribūtu savi nosaukumi\n {\n return[ \n 'fname' => 'Vārds',\n 'lname' => 'Uzvārds',\n 'email' => 'E-pasts',\n 'oldpassword' => 'Paroles lauks',\n 'password' => 'Jaunas paroles lauks',\n 'buttontitle' => 'Pogas virsraksts',\n 'buttonlink' => 'Pogas links',\n 'reciever' => 'Saņēmēju lauks',\n 'emailtitle' => 'Ziņas virsrsksts',\n 'emailtext' => 'Ziņas teksts',\n 'transport' => 'Pasākumu lauks'\n ];\n }", "public function getAttributesFields(): array\n {\n $fields = [];\n\n // Only fields without relations\n foreach ($this->fieldsArray(false) as $attribute) {\n $fields[$attribute] = [\n 'name' => $attribute,\n 'type' => $this->overrideMethod(\n 'set'.Str::studly($attribute).'Type',\n [$this, 'callGraphQLType'],\n $attribute\n ),\n 'privacy' => function (array $args) use ($attribute): bool {\n $method = 'get'.Str::studly($attribute).'Privacy';\n\n return $this->$method($args);\n },\n ];\n }\n\n return $fields;\n }", "public function fillable();", "public function getCustomAttributes(): array;", "public function getAttributes(array $only = null): array\n {\n if ($only === null || empty($only)) {\n return $this->attributes;\n }\n\n $attributes = [];\n foreach ($only as $key) {\n $attributes[$key] = $this->attributes[$key] ?? null;\n }\n\n return $attributes;\n }", "protected function attributes() {\n $attributes = array();\n foreach(static::$db_fields as $field) {\n if(property_exists($this, $field)) {\n $attributes[$field] = $this->$field;\n }\n }\n return $attributes;\n }", "protected function getArrayableAttributes()\n {\n return $this->getArrayableItems($this->attributes);\n }", "protected function attributes() {\n\t\t$attributes = array();\n\t\tforeach(self::$db_fields as $field) {\n\t\t\tif(property_exists($this, $field)){\n\t\t\t\t$attributes[$field] = $this->$field;\n\t\t\t}\n\t\t}\n\t\treturn $attributes;\n\t}", "protected function attributes() {\n\t\t$attributes = array();\n\t\tforeach (self::$db_fields as $field) {\n\t\t\tif (property_exists($this, $field)) {\n\t\t\t\t$attributes[$field] = $this->$field;\n\t\t\t}\n\t\t}\n\t\treturn $attributes;\n\t}", "public function attributes()\n {\n return collect(array_keys($this->rules()))\n ->mapWithKeys(function ($key) {\n return [$key => str_replace(['.', '_'], ' ', $key)];\n })\n ->toArray();\n }", "public function getFillables()\n {\n return $this->filterDatas(function ($data) {\n return isset($data->fillable) && $data->fillable;\n });\n }", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();" ]
[ "0.7485169", "0.7431268", "0.65387875", "0.6369011", "0.6369011", "0.61958706", "0.61957335", "0.61303127", "0.61303127", "0.61303127", "0.61303127", "0.61298674", "0.6035263", "0.60131687", "0.59887", "0.5970922", "0.5961864", "0.59574443", "0.59520197", "0.59307975", "0.5923269", "0.59168077", "0.58868074", "0.58820426", "0.5878693", "0.58726907", "0.58558804", "0.58558804", "0.58558804", "0.58558804" ]
0.7535031
0
Convert the model's attributes to an array.
public function attributesToArray() { $attributes = $this->attributes; $mutatedAttributes = $this->getMutatedAttributes(); // We want to spin through all the mutated attributes for this model and call // the mutator for the attribute. We cache off every mutated attributes so // we don't have to constantly check on attributes that actually change. foreach ($mutatedAttributes as $key) { if (!array_key_exists($key, $attributes)) { continue; } $attributes[$key] = $this->mutateAttributeForArray( $key, $attributes[$key] ); } // Here we will grab all of the appended, calculated attributes to this model // as these attributes are not really in the attributes array, but are run // when we need to array or JSON the model for convenience to the coder. foreach ($this->getArrayableAppends() as $key) { $attributes[$key] = $this->mutateAttributeForArray($key, null); } return $attributes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function attributesToArray()\n {\n $attributes = $this->getArrayableAttributes();\n\n return $attributes;\n }", "public function toArray()\n {\n return $this->attributesToArray();\n }", "public function toArray()\n {\n return $this->attributesToArray();\n }", "public function toArray(): array {\n return $this->attributes()->toArray();\n }", "public function toArray(): array\n {\n $data = $this->model->toArray();\n\n /**\n * Model's toArray method gives us raw entity data.\n * Here we replace some special attributes with human readable values.\n */\n foreach ($data as $key => $value) {\n $data[$key] = $this->getDisplayValue($key, $value);\n }\n\n return $data;\n }", "public function toArray()\n {\n return $this->attributes;\n }", "public function toArray()\n {\n return $this->attributes;\n }", "public function toArray()\n {\n return $this->attributes;\n }", "public function toArray()\n {\n return $this->attributes;\n }", "public function to_array() {\n\n $array = array();\n\n foreach ($this->collection as $model) {\n $model_to_array = $model->to_array($this->options);\n\n foreach ($model_to_array as &$attribute) {\n if ($attribute instanceof ModelCollection) {\n $attribute = $attribute->to_array($this->options);\n }\n }\n\n $array[] = $model_to_array;\n }\n\n return $array;\n }", "public function toArray()\n {\n return $this->getAttributes();\n }", "public function attributesToArray()\n {\n return Helper::toCamelCase($this->attributes());\n }", "public function toArray()\n {\n $attributes = $this->attributesToArray();\n\n return $attributes;\n }", "public function getAttributesAsArray()\n {\n $attributes = explode(',', $this->attributes);\n\n if ($attributes === false) {\n return [];\n }\n\n return $attributes;\n }", "public function attributesToArray()\n {\n $attributes = parent::attributesToArray();\n\n foreach ($attributes as $key => $value) {\n $attributes[$key] = $value instanceof ValueObject ? $this->fromValueObjectToArray($key, $value) : $value;\n }\n\n return $attributes;\n }", "protected function getArrayableAttributes()\n {\n return $this->attributes;\n }", "protected function getArrayableAttributes()\n {\n return $this->attributes;\n }", "public function toAPIArray()\n\t{\n\t\t$out = array();\n\n\t\tforeach($this as $i => $v)\n\t\t{\n\t\t\tif (method_exists($v, 'toApiArray'))\n\t\t\t{\n\t\t\t\t$out[$i] = $v->toApiArray();\n\t\t\t} else {\n\t\t\t\t$out[$i] = $v->attributes;\n\t\t\t}\n\t\t}\n\n\t\treturn $out;\n\t}", "public function toArray()\r\n\t{\r\n\t\t$attributes = parent::toArray();\r\n\r\n\t\tif (! $this->autoTranslations) return $attributes;\r\n\r\n\t\tforeach ($this->translatableAttributes as $field) {\r\n\t\t\t$attributes[$field] = $this->getTranslation($field);\r\n\t\t}\r\n\r\n\t\treturn $attributes;\r\n\t}", "public function toArray()\n {\n $attributes = $this->getConfiguredAttributes();\n\n $values = [];\n\n foreach (explode(',', $attributes) as $attribute) {\n $values[$attribute] = str_replace(' ','', $attribute);\n }\n\n return $values;\n }", "public function toArray()\n {\n return array_map(function ($attribute) {\n if ($attribute instanceof \\DateTimeInterface) {\n return $attribute->format('Y-m-d H:i:s.u');\n } \n elseif ($attribute instanceof \\JsonSerializable) {\n return $attribute->jsonSerialize();\n } \n elseif (is_iterable($attribute)) {\n return (array) $attribute;\n }\n return $attribute;\n }, $this->attributes);\n }", "public function to_array() {\n\t\t$attributes = array();\n\n\t\t// First we need to gather all of the regular attributes. If the attribute\n\t\t// exists in the array of \"hidden\" attributes, it will not be added to\n\t\t// the array so we can easily exclude things like passwords, etc.\n\t\tforeach (array_keys($this->attributes) as $attribute) {\n\t\t\tif ( ! in_array($attribute, static::$hidden)) {\n\t\t\t\t$attributes[$attribute] = $this->$attribute;\n\t\t\t}\n\t\t}\n\n\t\tforeach ($this->relationships as $name => $models) {\n\t\t\t// If the relationship is not a \"to-many\" relationship, we can just\n\t\t\t// to_array the related model and add it as an attribute to the\n\t\t\t// array of existing regular attributes we gathered.\n\t\t\tif ($models instanceof Model) {\n\t\t\t\t$attributes[$name] = $models->to_array();\n\t\t\t}\n\n\t\t\t// If the relationship is a \"to-many\" relationship we need to spin\n\t\t\t// through each of the related models and add each one with the\n\t\t\t// to_array method, keying them both by name and ID.\n\t\t\telseif (is_array($models)) {\n\t\t\t\t$attributes[$name] = array();\n\n\t\t\t\tforeach ($models as $id => $model) {\n\t\t\t\t\t$attributes[$name][$id] = $model->to_array();\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif (is_null($models)) {\n\t\t\t\t$attributes[$name] = $models;\n\t\t\t}\n\t\t}\n\n\t\treturn $attributes;\n\t}", "public function attributesToArray()\n {\n $attributes = $this->getArrayableAttributes();\n $mutatedAttributes = $this->getMutatedAttributes();\n\n foreach ($mutatedAttributes as $key)\n {\n if (!array_key_exists($key, $attributes))\n continue;\n\n $attributes[$key] = $this->mutateAttributeForArray(\n $key,\n $attributes[$key]\n );\n }\n\n foreach ($this->casts as $key => $value)\n {\n if (!array_key_exists($key, $attributes) ||\n in_array($key, $mutatedAttributes))\n {\n continue;\n }\n\n $attributes[$key] = $this->castAttribute(\n $key,\n $attributes[$key]\n );\n }\n\n foreach ($this->getArrayableAppends() as $key)\n $attributes[$key] = $this->mutateAttributeForArray($key, null);\n\n return $attributes;\n }", "public function toArray() {\n\t\treturn $this->tblAttributes;\n\t}", "public function toArray()\n {\n $attributes = $this->attributes;\n\n // If an attribute is a date, we will cast it to a string after converting it\n // to a DateTime / Carbon instance. This is so we will get some consistent\n // formatting while accessing attributes vs. arraying / JSONing a model.\n foreach ($this->getDates() as $key) {\n if (! isset($attributes[$key])) {\n continue;\n }\n\n if ($attributes[$key] instanceof DateTime) {\n $attributes[$key] = $attributes[$key]->format('Y-m-d\\TH:i:s\\Z');\n }\n }\n\n return $attributes;\n }", "protected function getArrayableAttributes()\n {\n return $this->getArrayableItems($this->attributes);\n }", "public function toArray()\n {\n //Skip modified attributes and get raw data in admin\n if (Admin::isAdmin()) {\n return array_merge(parent::attributesToArray(), $this->relationsToArray());\n }\n\n return array_merge($this->attributesToArray(), $this->relationsToArray());\n }", "public function toArray(): array\n {\n $attributes = collect($this->attributes);\n $relations = collect($this->relations)->map(function ($relation) {\n if (!$relation instanceof Arrayable) {\n return $relation;\n }\n\n return $relation->toArray();\n });\n return $attributes->merge($relations)->sortKeys()->toArray();\n }", "public function toArray()\n\t{\n\t\t$defaults = $this->reflectionClass->getDefaultProperties();\n\t\t$return = array();\n\t\t\n\t\tforeach($defaults as $var => $val)\n\t\t{\n\t\t\tif($this->$var instanceof Model)\n\t\t\t{\n\t\t\t\t$return[$var] = $this->$var->toArray();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$return[$var] = $this->$var;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $return;\n\t}", "public abstract function toArray($model);" ]
[ "0.80428535", "0.7896457", "0.7896457", "0.78604525", "0.7803931", "0.77749693", "0.77749693", "0.77749693", "0.77749693", "0.7734881", "0.77163154", "0.77087635", "0.7693619", "0.7691863", "0.763805", "0.7616516", "0.7616516", "0.7614991", "0.7529832", "0.7518526", "0.7460926", "0.74557275", "0.74311084", "0.741585", "0.74108195", "0.7394705", "0.7314169", "0.7300656", "0.72526234", "0.72482854" ]
0.80184025
1
Determine if a get mutator exists for an attribute.
public function hasGetMutator($key) { return $this->methodExists('get'.Str::studly($key).'Attribute'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasGetMutator($key)\n {\n return method_exists($this, 'get' . Str::studly($key) . 'Attribute');\n }", "public function hasGetMutator($key)\n {\n return method_exists($this, 'get' . studly_case($key) . 'Attribute');\n }", "public function hasGetMutator($key)\n {\n return method_exists($this, 'get'.Str::studly($key).'Attribute');\n }", "public function hasGetMutator($key)\n {\n return method_exists($this, 'get'.Str::studly($key).'Attribute');\n }", "public function hasAttributeGetMutator($key)\n {\n if ($this->isMutatorWhitelisted($key) === false) {\n return false;\n }\n\n return parent::hasAttributeGetMutator($key);\n }", "protected function hasGetMutator($key)\n {\n return method_exists($this, 'set' . $this->getMutatorName($key) . 'Attribute');\n }", "public function hasGetMutator($key)\n {\n return $this->hasField($key);\n }", "public function hasGetMutator($key)\n {\n if ($this->isMutatorWhitelisted($key) === false) {\n return false;\n }\n\n return parent::hasGetMutator($key);\n }", "protected function hasAccessor(string $key, ?string &$accessor = null): bool\n {\n $studly_key = str_replace(' ', '', ucwords(str_replace(['-', '_'], ' ', $key)));\n $accessor = 'get' . $studly_key . 'Property';\n\n return method_exists($this, $accessor);\n }", "public function hasSetMutator($key)\n {\n return method_exists($this, 'set' . Str::studly($key) . 'Attribute');\n }", "public function hasSetMutator($key)\n {\n return method_exists($this, 'set' . studly_case($key) . 'Attribute');\n }", "public function __isset($key)\n {\n return isset($this->attributes[$key]) ||\n (\n $this->hasGetMutator($key) &&\n !is_null($this->getAttribute($key))\n );\n }", "public function hasSetMutator($key)\n {\n return method_exists($this, 'set'.Str::studly($key).'Attribute');\n }", "public function hasSetMutator($key)\n {\n return method_exists($this, 'set'.Str::studly($key).'Attribute');\n }", "public function hasSetMutator($key)\n {\n return $this->methodExists('set'.Str::studly($key).'Attribute');\n }", "public function hasAttribute(): bool\n {\n return isset($this->attribute);\n }", "public function is_get() {\n return $this->method == 'get';\n }", "public function hasAttribute($key);", "public static function isGet(): bool {\r\n return static :: isMethod('get');\r\n }", "public function hasAttr ($attr) { return $this->hasAttribute($attr); }", "public function hasGet(string $name): bool {}", "public function hasAttr($attr);", "private function has_attribute($attribute) {\n // Will return true or false\n return array_key_exists($attribute, $this->attributes());\n }", "public function __isset($attribute) {\n return $this->hasAttribute($attribute);\n }", "private function has_attribute($attribute) {\n\t\t// Wil return true or false\n\t\t$object_vars = get_object_vars($this);\n\n\t\treturn array_key_exists($attribute, $object_vars);\n\t}", "public function hasAttribute(string $name): bool;", "public function __isset($key)\n {\n return (isset($this->attributes[$key]) || isset($this->relations[$key])) ||\n ($this->hasGetMutator($key) && !is_null($this->getAttributeValue($key)));\n }", "private function has_attribute($attribute) {\r\n // (incl. private ones!) as the keys and their current values as the value\r\n $object_vars = get_object_vars($this);\r\n // We don't care about the value, we just want to know if the key exists\r\n // Will return true or false\r\n return array_key_exists($attribute, $object_vars);\r\n }", "private function has_attribute($attribute) {\n\t // Will return true or false\n\t return array_key_exists($attribute, $this->attributes());\n\t}", "public function testModelAttributeExists()\n {\n // exists mutator\n $this->assertFalse($this->post->hasGetMutator('id'));\n $this->assertArrayHasKey('id', $this->post->getAttributes());\n\n // exists native\n $this->assertTrue($this->post->hasGetMutator('exits'));\n $this->assertArrayNotHasKey('exits', $this->post->getAttributes());\n\n // not exists\n $this->assertFalse($this->post->hasGetMutator('notExits'));\n $this->assertArrayNotHasKey('notExits', $this->post->getAttributes());\n }" ]
[ "0.7768784", "0.77530867", "0.7690894", "0.7690894", "0.7635883", "0.75039136", "0.72599494", "0.711803", "0.65001476", "0.64817536", "0.6368092", "0.63547635", "0.6345683", "0.6345683", "0.6326818", "0.62785614", "0.6278046", "0.62641793", "0.6239149", "0.62237495", "0.615508", "0.6146525", "0.61241883", "0.60715777", "0.6043055", "0.6042976", "0.6027482", "0.601844", "0.60154694", "0.5985118" ]
0.7816478
0
Determine if a set mutator exists for an attribute.
public function hasSetMutator($key) { return $this->methodExists('set'.Str::studly($key).'Attribute'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasSetMutator($key)\n {\n return method_exists($this, 'set' . Str::studly($key) . 'Attribute');\n }", "public function hasSetMutator($key)\n {\n return method_exists($this, 'set' . studly_case($key) . 'Attribute');\n }", "public function hasSetMutator($key)\n {\n return method_exists($this, 'set'.Str::studly($key).'Attribute');\n }", "public function hasSetMutator($key)\n {\n return method_exists($this, 'set'.Str::studly($key).'Attribute');\n }", "public function hasAttributeGetMutator($key)\n {\n if ($this->isMutatorWhitelisted($key) === false) {\n return false;\n }\n\n return parent::hasAttributeGetMutator($key);\n }", "protected function hasGetMutator($key)\n {\n return method_exists($this, 'set' . $this->getMutatorName($key) . 'Attribute');\n }", "public function hasGetMutator($key)\n {\n return method_exists($this, 'get' . studly_case($key) . 'Attribute');\n }", "public function hasGetMutator($key)\n {\n return method_exists($this, 'get' . Str::studly($key) . 'Attribute');\n }", "public function hasGetMutator($key)\n {\n return method_exists($this, 'get'.Str::studly($key).'Attribute');\n }", "public function hasGetMutator($key)\n {\n return method_exists($this, 'get'.Str::studly($key).'Attribute');\n }", "public function hasGetMutator($key)\n {\n return $this->methodExists('get'.Str::studly($key).'Attribute');\n }", "public function __isset($key)\n {\n return isset($this->attributes[$key]) ||\n (\n $this->hasGetMutator($key) &&\n !is_null($this->getAttribute($key))\n );\n }", "public function __isset($attribute) {\n return $this->hasAttribute($attribute);\n }", "private function has_attribute($attribute) {\r\n // (incl. private ones!) as the keys and their current values as the value\r\n $object_vars = get_object_vars($this);\r\n // We don't care about the value, we just want to know if the key exists\r\n // Will return true or false\r\n return array_key_exists($attribute, $object_vars);\r\n }", "private function has_attribute($attribute) {\n\t // (incl. private ones!) as the keys and their current values as the value\n\t $object_vars = get_object_vars($this);\n\t // We don't care about the value, we just want to know if the key exists\n\t // Will return true or false\n\t return array_key_exists($attribute, $object_vars);\n\t}", "private function has_attribute($attribute) {\n\t // (incl. private ones!) as the keys and their current values as the value\n\t $object_vars = get_object_vars($this);\n\t // We don't care about the value, we just want to know if the key exists\n\t // Will return true or false\n\t return array_key_exists($attribute, $object_vars);\n\t}", "private function has_attribute($attribute) {\n // Will return true or false\n return array_key_exists($attribute, $this->attributes());\n }", "private function has_attribute($attribute){\n // (including private ones) as the keys and their current values as the value\n $object_vars = get_object_vars($this);\n\n // We don't care about the value, we just want to know if the key exists\n // does $attribute(key) exist in $object_vars\n // Will return true or false\n return array_key_exists($attribute, $object_vars);\n }", "public function hasGetMutator($key)\n {\n return $this->hasField($key);\n }", "public function hasAttr($attr);", "public function hasAttribute(): bool\n {\n return isset($this->attribute);\n }", "private function has_attribute($attribute){\r\n\t // (incl. private ones!) as the keys and their current values as the value\r\n\t $object_vars = get_object_vars($this);\r\n\t // We don't care about the value, we just want to know if the key exists\r\n\t // Will return true or false\r\n\t return array_key_exists($attribute, $object_vars);\r\n }", "private function has_attribute($attribute){\n\t\t//(inlcuding private ones) as keys and current values as value.\n\t\t\n\t\t$object_vars = $this->attributes();\n\t\t//want to check key exists, dont care about value here\n\t\t//returns true or false\t\n\t\t\n\t\treturn array_key_exists($attribute, $object_vars);\n\t}", "private function has_attribute($attribute) {\n\t\t// Wil return true or false\n\t\t$object_vars = get_object_vars($this);\n\n\t\treturn array_key_exists($attribute, $object_vars);\n\t}", "public function has($attribute);", "public function hasAttribute($key);", "private function has_attribute($attribute) {\n\t // Will return true or false\n\t return array_key_exists($attribute, $this->attributes());\n\t}", "public function hasGetMutator($key)\n {\n if ($this->isMutatorWhitelisted($key) === false) {\n return false;\n }\n\n return parent::hasGetMutator($key);\n }", "public function hasAttribute(string $attribute): bool\n {\n return array_key_exists($attribute, $this->data);\n }", "private function has_attribute($attribute)\n\t\t{\n\t\t//(incl. private ones!) as the keys and their current values as the value\n\t\t$object_vars = get_object_vars($this);\n\t\t//we don't care about the value, we just want to know if the key exists \n\t\t//will return true or false\n\t\treturn array_key_exists($attribute, $object_vars);\n\t\t}" ]
[ "0.7262567", "0.72312343", "0.7197799", "0.7197799", "0.6677842", "0.664554", "0.6518645", "0.65154284", "0.64689076", "0.64689076", "0.64452624", "0.62474126", "0.6231419", "0.62125957", "0.6177204", "0.6177204", "0.61649835", "0.6161747", "0.6148717", "0.61353886", "0.6133223", "0.6125293", "0.61205715", "0.6111688", "0.6072066", "0.60423374", "0.60392445", "0.6037412", "0.6021556", "0.6014608" ]
0.7232248
1
Sync the original attributes with the current.
public function syncOriginal() { $this->original = $this->attributes; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "final public function sync() {\n\t\t$this->original = $this->attributes;\n\n\t\treturn true;\n\t}", "public function syncOriginal()\n {\n $this->original = $this->toArray();\n\n return $this;\n }", "public function syncOriginal(): Model\n {\n $this->original = $this->getAttributes();\n\n return $this;\n }", "public function syncOriginalAttributes($attributes): Model\n {\n $attributes = is_array($attributes) ? $attributes : func_get_args();\n\n $modelAttributes = $this->getAttributes();\n\n foreach ($attributes as $attribute) {\n $this->original[$attribute] = $modelAttributes[$attribute];\n }\n\n return $this;\n }", "public function updateOriginal()\n {\n // @todo Bug#1101: shouldn't just serialise this object\n // because some things change for the original\n // loaded_width\n // loaded_height\n $this->write($this->getOriginalSourceFilename());\n }", "public function setUpdated(): void\n {\n $this->originalData = $this->itemReflection->dehydrate($this->item);\n }", "public function backupOriginalAttributes()\n {\n $this->backup_original = $this->getRawOriginal() ?: [];\n\n return $this->getOriginal();\n }", "public function syncWith(array $attributes = [])\n {\n $this->original = $attributes;\n $this->attributes = $attributes;\n\n $this->synced();\n\n return $this;\n }", "protected function mergeTranslationsWithAttributes()\n\t{\n\t\t$this->attributes = array_merge($this->attributes, $this->translatedAttributes);\n\t}", "protected function _resetModifiedAttributesFlags() {\n\t\t$this->_modifiedAttributes = array();\n\t}", "public function syncOriginalAttribute($attribute)\n {\n $this->original[$attribute] = $this->attributes[$attribute];\n\n return $this;\n }", "public function copyAttributesToValues()\n\t{\n\t\tforeach( $this->values as $field=>$value )\n\t\t{\n\t\t\t$this->values[$field] = $this->$field ;\n\t\t}\n\t}", "public function afterSave()\r\n\t{\r\n\t\tif(count($this->serialAttributes)) {\r\n\t\t\tforeach($this->serialAttributes as $attribute) {\r\n\t\t\t\t$_att = $this->owner->$attribute;\r\n\t\t\t\tif(!empty($_att)\r\n\t\t\t\t && is_scalar($_att)) {\r\n\t\t\t\t\t$a = @unserialize($_att);\r\n\t\t\t\t\tif($a !== false) {\r\n\t\t\t\t\t\t$this->owner->$attribute = $a;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$this->owner->$attribute = null;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\t\t\t\r\n\t\t}\r\n\t}", "protected function sync()\n {\n $this->image =& $this->temp;\n unset($this->temp);\n }", "public function prepAttributesForSave()\n\t{\n\t\t$attributes = $this->defineAttributes();\n\t\t$attributes['dateUpdated'] = array('0' => AttributeType::DateTime, 'required' => true);\n\t\t$attributes['dateCreated'] = array('0' => AttributeType::DateTime, 'required' => true);\n\n\t\tforeach ($attributes as $name => $config)\n\t\t{\n\t\t\t$config = ModelHelper::normalizeAttributeConfig($config);\n\t\t\t$value = $this->getAttribute($name);\n\n\t\t\t$this->setAttribute($name, ModelHelper::packageAttributeValue($config, $value, true));\n\t\t}\n\n\t\t// Populate dateCreated and uid if this is a new record\n\t\tif ($this->isNewRecord())\n\t\t{\n\t\t\t$this->dateCreated = DateTimeHelper::currentTimeForDb();\n\t\t\t$this->uid = StringHelper::UUID();\n\t\t}\n\n\t\t// Update the dateUpdated\n\t\t$this->dateUpdated = DateTimeHelper::currentTimeForDb();\n\t}", "public function sync($attributes)\n {\n foreach ($attributes as $key => $attribute) {\n if ($key[0] !== '$') {\n $this->attributes[$key] = $attribute;\n }\n }\n\n if (isset($attributes['$id'])) {\n $this->attributes['$id'] = $attributes['$id'];\n $this->id = $attributes['$id'];\n }\n\n }", "public function updateAttributes(&$attributes)\n {\n if ($validator = $this->getValidator()) {\n \n if ($extra = $validator->getAttributesForField($this->owner)) {\n $attributes = array_merge($attributes, $extra);\n }\n \n }\n }", "public function setRawAttributes(array $attributes, $sync = false)\n {\n // merge dynamic properties to the base attributes\n if ($sync) {\n $attributes = array_merge($this->attributes, $attributes);\n }\n\n $this->attributes = $attributes;\n\n if ($sync) {\n $this->syncOriginal();\n }\n\n return $this;\n }", "public function __clone()\n {\n $this->_id = null;\n $this->_key = null;\n $this->_rev = null;\n // do not change the _changed flag here\n }", "public function syncOriginalAttribute($attribute)\n {\n if(is_object($this->attributes[$attribute])) {\n if($this->attributes[$attribute] instanceof Type) {\n $this->original[$attribute] = (string) $attribute;\n }\n elseif($this->attributes[$attribute] instanceof Arrayable) {\n $this->original[$attribute] = $this->attributes[$attribute]->getArray();\n }\n }\n else {\n $this->original[$attribute] = $this->attributes[$attribute];\n }\n\n return $this;\n }", "public function ApplyChanges()\n {\n parent::ApplyChanges();\n\n // Update data\n $this->Update();\n }", "protected function _prepareSyncFieldsMap()\n {\n $old2New = $this->_oldFieldsMap;\n $new2Old = array_flip ( $this->_oldFieldsMap );\n $this->_syncFieldsMap = array_merge ( $old2New, $new2Old );\n return $this;\n }", "function initializeObjectAttribute( $contentObjectAttribute, $currentVersion, $originalContentObjectAttribute )\n {\n if ( $currentVersion != false )\n {\n $dataText = $originalContentObjectAttribute->attribute( \"data_text\" );\n if( $dataText != '' )\n {\n // update the path top newest image version\n $contentObject = eZContentObject::fetch( $originalContentObjectAttribute->attribute( 'contentobject_id' ) );\n if( $contentObject instanceof eZContentObject && $dataText != NULL && $dataText != '' )\n {\n $data = $this->updateImagePath( $dataText, $contentObject, $originalContentObjectAttribute );\n $dataText = $data['data_text'];\n }\n $dataInt = $originalContentObjectAttribute->attribute( \"data_int\" );\n $contentObjectAttribute->setAttribute( \"data_text\", $dataText );\n $contentObjectAttribute->setAttribute( \"data_int\", $dataInt );\n }\n }\n }", "public function ApplyChanges()\n {\n parent::ApplyChanges();\n\n }", "public function __clone()\n {\n foreach ($this as $key => $val)\n {\n if (is_object($val) || is_array($val))\n $this->{$key} = unserialize(serialize($val));\n }\n }", "public function setOldAttributes($values)\n {\n $this->_oldAttributes = $values;\n }", "public function shuffle(): void\n {\n $keys = array_keys($this->attributes);\n shuffle($keys);\n $random = [];\n\n foreach ($keys as $key) {\n $random[$key] = $this->attributes[$key];\n }\n\n $this->attributes = $random;\n }", "protected function resetProperties() {}", "function initializeObjectAttribute( $contentObjectAttribute, $currentVersion, $originalContentObjectAttribute )\n {\n if ( $currentVersion != false )\n {\n $data = $originalContentObjectAttribute->attribute( \"content\" );\n $contentObjectID = $contentObjectAttribute->attribute( 'contentobject_id' );\n $originalContentObjectID = $originalContentObjectAttribute->attribute( 'contentobject_id' );\n \n if ( is_object( $data ) )\n {\n if ( $contentObjectID != $originalContentObjectID )\n {\n $gp = new xrowGISPosition( array( \n 'contentobject_attribute_id' => $contentObjectAttribute->attribute( 'id' ) , \n 'contentobject_attribute_version' => $contentObjectAttribute->attribute( 'version' ) , \n 'latitude' => $data->attribute( 'latitude' ) , \n 'longitude' => $data->attribute( 'longitude' ) , \n 'street' => $data->attribute( 'street' ) , \n 'zip' => $data->attribute( 'zip' ) , \n 'district' => $data->attribute( 'district' ) , \n 'city' => $data->attribute( 'city' ) , \n 'state' => $data->attribute( 'state' ) , \n 'country' => $data->attribute( 'country' ),\n 'accurate' => $data->attribute( 'accurate' )\n ) );\n $contentObjectAttribute->Content = $gp;\n }\n else\n {\n \n if ( $originalContentObjectAttribute->attribute( 'data_int' ) )\n {\n $contentObjectAttribute->setAttribute( 'data_int', $originalContentObjectAttribute->attribute( 'data_int' ) );\n $contentObjectAttribute->setAttribute( 'sort_key_int', $originalContentObjectAttribute->attribute( 'data_int' ) );\n }\n $data->setAttribute( 'contentobject_attribute_id', $contentObjectAttribute->attribute( 'id' ) );\n $data->setAttribute( 'contentobject_attribute_version', $contentObjectAttribute->attribute( 'version' ) );\n $contentObjectAttribute->setContent( $data );\n }\n $contentObjectAttribute->store();\n }\n else\n {\n $contentObjectAttribute->setContent( null );\n }\n }\n else\n {\n $contentObjectAttribute->setContent( null );\n }\n }", "public function fill(array $attributes)\n {\n $existingAttributes = get_object_vars($this);\n\n foreach ($existingAttributes as $attributeName => $oldAttributeValue) {\n array_key_exists($attributeName, $attributes) ? $this->$attributeName = $attributes[$attributeName] : NULL;\n }\n }" ]
[ "0.74845415", "0.680344", "0.6802746", "0.6786014", "0.63640785", "0.63399667", "0.63048583", "0.60904676", "0.6056318", "0.6033761", "0.590117", "0.5896081", "0.589403", "0.5851019", "0.58411443", "0.5820354", "0.5798619", "0.5727194", "0.57045454", "0.5635495", "0.56159526", "0.55982685", "0.5558804", "0.5554975", "0.55461925", "0.5545374", "0.5536428", "0.55276537", "0.54895294", "0.5479901" ]
0.74856496
0
Sync a single original attribute with its current value.
public function syncOriginalAttribute($attribute) { $this->original[$attribute] = $this->attributes[$attribute]; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "final public function sync() {\n\t\t$this->original = $this->attributes;\n\n\t\treturn true;\n\t}", "public function syncOriginal()\n {\n $this->original = $this->attributes;\n\n return $this;\n }", "public function syncOriginalAttribute(string $attribute): Model\n {\n return $this->syncOriginalAttributes($attribute);\n }", "public function syncOriginalAttribute($attribute)\n {\n if(is_object($this->attributes[$attribute])) {\n if($this->attributes[$attribute] instanceof Type) {\n $this->original[$attribute] = (string) $attribute;\n }\n elseif($this->attributes[$attribute] instanceof Arrayable) {\n $this->original[$attribute] = $this->attributes[$attribute]->getArray();\n }\n }\n else {\n $this->original[$attribute] = $this->attributes[$attribute];\n }\n\n return $this;\n }", "public function syncOriginal(): Model\n {\n $this->original = $this->getAttributes();\n\n return $this;\n }", "public function syncOriginalAttributes($attributes): Model\n {\n $attributes = is_array($attributes) ? $attributes : func_get_args();\n\n $modelAttributes = $this->getAttributes();\n\n foreach ($attributes as $attribute) {\n $this->original[$attribute] = $modelAttributes[$attribute];\n }\n\n return $this;\n }", "public function syncOriginal()\n {\n $this->original = $this->toArray();\n\n return $this;\n }", "public function testImmutable(): void\n {\n //Value is empty\n $this->category->setCustomAttribute('custom_layout_update', false);\n $this->category->setOrigData('custom_layout_update', null);\n $this->attribute->beforeSave($this->category);\n\n //New value\n $this->category->setCustomAttribute('custom_layout_update', 'test');\n $this->category->setOrigData('custom_layout_update', null);\n $caughtException = false;\n try {\n $this->attribute->beforeSave($this->category);\n } catch (LocalizedException $exception) {\n $caughtException = true;\n }\n $this->assertTrue($caughtException);\n $this->category->setCustomAttribute('custom_layout_update', 'testNew');\n $this->category->setOrigData('custom_layout_update', 'test');\n $caughtException = false;\n try {\n $this->attribute->beforeSave($this->category);\n } catch (LocalizedException $exception) {\n $caughtException = true;\n }\n $this->assertTrue($caughtException);\n\n //Removing a value\n $this->category->setCustomAttribute('custom_layout_update', '');\n $this->category->setOrigData('custom_layout_update', 'test');\n $this->attribute->beforeSave($this->category);\n $this->assertNull($this->category->getCustomAttribute('custom_layout_update')->getValue());\n\n //Using old stored value\n //Saving old value 1st\n $this->recreateCategory();\n $this->category->setOrigData('custom_layout_update', 'test');\n $this->category->setData('custom_layout_update', 'test');\n $this->category->save();\n $this->recreateCategory();\n $this->category = $this->categoryFactory->create(['data' => $this->category->getData()]);\n\n //Trying the same value.\n $this->category->setData('custom_layout_update', 'test');\n $this->attribute->beforeSave($this->category);\n //Trying new value\n $this->category->setData('custom_layout_update', 'test2');\n $caughtException = false;\n try {\n $this->attribute->beforeSave($this->category);\n } catch (LocalizedException $exception) {\n $caughtException = true;\n }\n $this->assertTrue($caughtException);\n //Empty value\n $this->category->setData('custom_layout_update', null);\n $this->attribute->beforeSave($this->category);\n }", "public function setOriginal($original) {\n $this->original = $original;\n }", "public function setUpdated(): void\n {\n $this->originalData = $this->itemReflection->dehydrate($this->item);\n }", "public function __SET($attr, $value){ //Establece valor y atributo\n\n\t\t\t$this->$attr=$value;\n\t\t}", "public function setModifiedValue()\n {\n $this->setModified(new \\DateTime());\n }", "function initializeObjectAttribute ( \n $contentObjectAttribute, \n $currentVersion, \n $originalContentObjectAttribute )\n {\n if ( $currentVersion != false )\n {\n // $contentObjectAttributeID = $contentObjectAttribute->attribute( \"id\" );\n // $currentObjectAttribute = eZContentObjectAttribute::fetch( $contentObjectAttributeID,\n // $currentVersion );\n $dataText = $originalContentObjectAttribute->attribute( \"data_text\" );\n $contentObjectAttribute->setAttribute( \"data_text\", $dataText );\n }\n }", "public function updateObject( Inx_Api_Recipient_Attribute $attr, $oValue );", "public function testChangeAttributeUseFillMethod()\n {\n // set value\n $this->post->tags = 'value1';\n $this->post->save();\n\n // change value\n $this->post->fill([\n 'tags' => $newValue = 'value2'\n ]);\n\n $this->post->save();\n\n // equals\n $this->assertEquals($this->post->tags, $newValue);\n }", "public function __set($attr, $value) {\n if ($this->isMeta($attr)) {\n if ($value === null || $value === '') {\n // UNSET VALUE\n if (isset($this->meta()->$attr)) {\n if (isset($this->_metaModified[$attr]) && $this->_metaModified[$attr] == self::META_ADDED) {\n // unset what's to be added - not to add it at all\n unset($this->_metaModified[$attr]);\n } else {\n // unset what was modified or initially existed\n $this->_metaModified[$attr] = self::META_UNSET;\n }\n unset($this->meta()->$attr);\n }\n } else {\n // SET VALUE\n if (isset($this->meta()->$attr)) {\n // field exists\n if (isset($this->_metaModified[$attr]) && ($this->_metaModified[$attr] == self::META_ADDED)) {\n // updating previously added field; do nothing - stay in add mode\n } else {\n // updating field that was deleted, modified before or initially loaded\n $this->_metaModified[$attr] = self::META_MODIFIED;\n }\n } else {\n // non-existing field\n if (isset($this->_metaModified[$attr]) && ($this->_metaModified[$attr] == self::META_UNSET)) {\n // field initially existed, but to be deleted. Modify instead\n $this->_metaModified[$attr] = self::META_MODIFIED;\n } else {\n // first access of non-existed field\n $this->_metaModified[$attr] = self::META_ADDED;\n }\n }\n $this->meta()->$attr = $value;\n }\n } else {\n parent::__set($attr, $value);\n }\n }", "public function syncToElement(ElementInterface &$target)\n {\n if (!is_a($target, self::class)) {\n return;\n }\n\n foreach ($this::defineComparableAttributes() as $attribute) {\n $target->$attribute = $this->$attribute;\n }\n }", "public function getRemoveOriginalValue();", "public function onUnsafeAttribute($name, $value)\n {\n $this->$name = $value;\n }", "public function sync($attributes)\n {\n foreach ($attributes as $key => $attribute) {\n if ($key[0] !== '$') {\n $this->attributes[$key] = $attribute;\n }\n }\n\n if (isset($attributes['$id'])) {\n $this->attributes['$id'] = $attributes['$id'];\n $this->id = $attributes['$id'];\n }\n\n }", "public function afterSave()\r\n\t{\r\n\t\tif(count($this->serialAttributes)) {\r\n\t\t\tforeach($this->serialAttributes as $attribute) {\r\n\t\t\t\t$_att = $this->owner->$attribute;\r\n\t\t\t\tif(!empty($_att)\r\n\t\t\t\t && is_scalar($_att)) {\r\n\t\t\t\t\t$a = @unserialize($_att);\r\n\t\t\t\t\tif($a !== false) {\r\n\t\t\t\t\t\t$this->owner->$attribute = $a;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$this->owner->$attribute = null;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\t\t\t\r\n\t\t}\r\n\t}", "public function __SET($att, $valor){\r\n $this->$att = $valor;\r\n}", "public function writeAttribute($attribute, $value) {}", "function initializeObjectAttribute( $contentObjectAttribute, $currentVersion, $originalContentObjectAttribute )\n {\n if ( $currentVersion != false )\n {\n $dataText = $originalContentObjectAttribute->content();\n $contentObjectAttribute->setContent( $dataText );\n }\n else\n {\n $default = array( 'value' => array() );\n $contentObjectAttribute->setContent( $default );\n }\n }", "public function updateOriginal()\n {\n // @todo Bug#1101: shouldn't just serialise this object\n // because some things change for the original\n // loaded_width\n // loaded_height\n $this->write($this->getOriginalSourceFilename());\n }", "public function __set($attribute, $value){\n\t\t$this->$attribute = $value;\n\t}", "public function assignAttribute($attribute, $data)\n {\n return $this->attributes()->save(\n Attribute::whereName($attribute)->firstOrFail(),\n ['data' => $data]\n );\n }", "function initializeObjectAttribute( $contentObjectAttribute, $currentVersion, $originalContentObjectAttribute )\n {\n if ( $currentVersion != false )\n {\n $dataText = $originalContentObjectAttribute->attribute( \"data_text\" );\n if( $dataText != '' )\n {\n // update the path top newest image version\n $contentObject = eZContentObject::fetch( $originalContentObjectAttribute->attribute( 'contentobject_id' ) );\n if( $contentObject instanceof eZContentObject && $dataText != NULL && $dataText != '' )\n {\n $data = $this->updateImagePath( $dataText, $contentObject, $originalContentObjectAttribute );\n $dataText = $data['data_text'];\n }\n $dataInt = $originalContentObjectAttribute->attribute( \"data_int\" );\n $contentObjectAttribute->setAttribute( \"data_text\", $dataText );\n $contentObjectAttribute->setAttribute( \"data_int\", $dataInt );\n }\n }\n }", "function initializeObjectAttribute( $contentObjectAttribute, $currentVersion, $originalContentObjectAttribute )\n {\n if ( $currentVersion != false )\n {\n $data = $originalContentObjectAttribute->attribute( \"content\" );\n $contentObjectID = $contentObjectAttribute->attribute( 'contentobject_id' );\n $originalContentObjectID = $originalContentObjectAttribute->attribute( 'contentobject_id' );\n \n if ( is_object( $data ) )\n {\n if ( $contentObjectID != $originalContentObjectID )\n {\n $gp = new xrowGISPosition( array( \n 'contentobject_attribute_id' => $contentObjectAttribute->attribute( 'id' ) , \n 'contentobject_attribute_version' => $contentObjectAttribute->attribute( 'version' ) , \n 'latitude' => $data->attribute( 'latitude' ) , \n 'longitude' => $data->attribute( 'longitude' ) , \n 'street' => $data->attribute( 'street' ) , \n 'zip' => $data->attribute( 'zip' ) , \n 'district' => $data->attribute( 'district' ) , \n 'city' => $data->attribute( 'city' ) , \n 'state' => $data->attribute( 'state' ) , \n 'country' => $data->attribute( 'country' ),\n 'accurate' => $data->attribute( 'accurate' )\n ) );\n $contentObjectAttribute->Content = $gp;\n }\n else\n {\n \n if ( $originalContentObjectAttribute->attribute( 'data_int' ) )\n {\n $contentObjectAttribute->setAttribute( 'data_int', $originalContentObjectAttribute->attribute( 'data_int' ) );\n $contentObjectAttribute->setAttribute( 'sort_key_int', $originalContentObjectAttribute->attribute( 'data_int' ) );\n }\n $data->setAttribute( 'contentobject_attribute_id', $contentObjectAttribute->attribute( 'id' ) );\n $data->setAttribute( 'contentobject_attribute_version', $contentObjectAttribute->attribute( 'version' ) );\n $contentObjectAttribute->setContent( $data );\n }\n $contentObjectAttribute->store();\n }\n else\n {\n $contentObjectAttribute->setContent( null );\n }\n }\n else\n {\n $contentObjectAttribute->setContent( null );\n }\n }", "public function beforeSave()\n {\n $value = $this->getValue();\n if (is_array($value)) {\n $value = $this->_helper->makeStorableArrayFieldValue($value);\n }\n \n $this->setValue($value);\n }" ]
[ "0.6735541", "0.64017737", "0.63092816", "0.6272924", "0.6106774", "0.5659271", "0.56214356", "0.5590092", "0.5521869", "0.5507411", "0.5492286", "0.546862", "0.54089236", "0.5399785", "0.53850245", "0.53487664", "0.532935", "0.53268903", "0.53224164", "0.53037477", "0.5280345", "0.5266407", "0.5243309", "0.5222541", "0.5218695", "0.52165335", "0.5211624", "0.5193041", "0.517983", "0.5155664" ]
0.6416313
1
Determine if the new and old values for a given key are numerically equivalent.
protected function originalIsNumericallyEquivalent($key) { $current = $this->attributes[$key]; $original = $this->original[$key]; return is_numeric($current) && is_numeric($original) && strcmp((string) $current, (string) $original) === 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function originalIsNumericallyEquivalent($key)\n {\n $current = $this->attributes[$key];\n $original = $this->original[$key];\n\n // Date comparison.\n if (in_array($key, $this->getDates())) {\n $current = $current instanceof Timestamp ? $this->asDateTime($current) : $current;\n $original = $original instanceof Timestamp ? $this->asDateTime($original) : $original;\n\n return $current == $original;\n }\n\n return parent::originalIsNumericallyEquivalent($key);\n }", "protected function compare($new, $old)\n {\n $numeric = is_numeric($new) && is_numeric($old);\n if ($numeric) {\n // numeric, compare loosely\n return $new == $old;\n } else {\n // non-numeric, compare strictly\n return $new === $old;\n }\n }", "public function testUpdateValuesContainNumbers(): void { }", "public function isNumeric()\n {\n if ($this->isEmpty()) {\n return false;\n }\n\n foreach ($this->getKeys() as $key) {\n if (!is_int($key)) {\n return false;\n }\n }\n\n return true;\n }", "private function isChangedElement(array $old, array $new): bool\n\t{\n\t\t$checkedFields = [\n\t\t\t'STORE_FROM' => 'intval',\n\t\t\t'STORE_TO' => 'intval',\n\t\t\t'ELEMENT_ID' => 'intval',\n\t\t\t'AMOUNT' => 'floatval',\n\t\t\t'PURCHASING_PRICE' => 'floatval',\n\t\t\t'BASE_PRICE' => 'floatval',\n\t\t\t'BASE_PRICE_EXTRA' => 'floatval',\n\t\t\t'BASE_PRICE_EXTRA_RATE' => 'strval',\n\t\t\t'COMMENT' => 'strval',\n\t\t];\n\n\t\tforeach ($checkedFields as $name => $typeCallback)\n\t\t{\n\t\t\t$oldValue = call_user_func($typeCallback, $old[$name] ?? null);\n\t\t\t$newValue = call_user_func($typeCallback, $new[$name] ?? null);\n\n\t\t\tif ($oldValue !== $newValue)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public function isEqual(string $key, $val) : bool;", "public static function compareParams(array $oldParams, array $newParams): bool\n\t{\n\t\t// todo: or compare just file ids?\n\t\tunset(\n\t\t\t$oldParams['valueBefore'], $newParams['valueBefore'],\n\t\t\t$oldParams['type'], $newParams['type']\n\t\t);\n\n\t\treturn $oldParams === $newParams;\n\t}", "public static function compareParams(array $oldParams, array $newParams): bool\n\t{\n\t\treturn $oldParams === $newParams;\n\t}", "function record_event_equal($old_data,$new_data) {\n\t\tforeach(array_reverse($old_data) as $i => $data) {\n\t\t\tif($data[\"record\"] == $new_data[\"record\"] && $data[\"event\"] == $new_data[\"event\"]) {\n\t\t\t\tif($data[\"field_name\"] == $new_data[\"field_name\"] && $data[\"value\"] == $new_data[\"value\"]) {return true;}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function compareDataTo($key, BL_CustomGrid_Object $object)\n {\n $value = $this->getData($key);\n $otherValue = $object->getData($key);\n return ($value > $otherValue ? 1: ($value < $otherValue ? -1 : 0));\n }", "function accept()\n {\n return is_numeric($this->key());\n }", "public function compareIntDataTo($key, BL_CustomGrid_Object $object)\n {\n $value = (int) $this->getData($key);\n $otherValue = (int) $object->getData($key);\n return ($value > $otherValue ? 1: ($value < $otherValue ? -1 : 0));\n }", "function _are_attrs_modified($old_slice, $new_slice) {\n return $old_slice['index'] != $new_slice['index'];\n }", "private function isInverseMatch(): bool\n {\n return is_int($this->min) and is_int($this->max) and ($this->min > $this->max);\n }", "protected function willChange($key)\n {\n return null !== $this->getCurrent($key);\n }", "public function getValueCompare();", "public function testIsNumeric() {\n $this->assertTrue(Hash::isNumeric(array('123', 456)));\n $this->assertTrue(Hash::isNumeric(array('foo' => 123, 'number' => '456')));\n\n $this->assertFalse(Hash::isNumeric(array('foo', 'bar')));\n $this->assertFalse(Hash::isNumeric(array('foo' => 'bar', 'number' => '123')));\n $this->assertFalse(Hash::isNumeric(array('bar', '123')));\n $this->assertFalse(Hash::isNumeric(array(null)));\n $this->assertFalse(Hash::isNumeric(array(true)));\n $this->assertFalse(Hash::isNumeric(array(false)));\n $this->assertFalse(Hash::isNumeric(array(array())));\n $this->assertFalse(Hash::isNumeric(array(new stdClass())));\n }", "public function testAssertEqualsWithDelta() {\n\t\t$this->assertEqualsWithDelta( 2.3, 2.5, 0.5 );\n\t}", "function d2d_public_key_eql($key1, $key2) {\n\t$key1 = d2d_clean_public_key($key1);\n\t$key2 = d2d_clean_public_key($key2);\n\treturn $key1 === $key2;\n}", "private function checkNumberField ($attribute)\n {\n $currentValue = $this->model->getAttribute($attribute);\n $originalValue = $this->model->getOriginal($attribute);\n\n if ( !( is_numeric($currentValue) || is_numeric($originalValue) ) ) return true;\n\n if ( round($currentValue, 2) == round($originalValue, 2) ) return false;\n\n return true;\n }", "function compare_array_item($setting, $existing) {\r\n\t$existing = (array)$existing;\r\n\tunset($setting['site_id']);\r\n\tunset($setting['_id']);\r\n\tunset($existing['_id']);\r\n\tunset($existing['site_id']);\r\n\tforeach($setting as $key => $value) {\r\n\t\tif(!is_array($setting[$key])) {\r\n\t\t\tif($setting[$key] != $existing[$key]){\r\n\t\t\t\techo \"setting key {$key} value {$value} differs from {$existing[$key]} - \";\r\n\t\t\t\t// print_r($setting);\r\n\t\t\t\tprint_r($existing);\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(is_array($setting[$key])) {\r\n\t\t\t$diff = array();\r\n\t\t\t$diff = array_diff_assoc($setting[$key], (array)$existing[$key]);\r\n\t\t\tif(!empty($diff)) {\r\n\t\t\t\techo \"setting subkey {$key} differs diff count \". count($diff).\"\\n\";\r\n\t\t\t\t// print_r($diff);\r\n\t\t\t\t// print_r($setting);\r\n\t\t\t\t// print_r($existing);\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}", "public function testKeyCasting()\n {\n $arr = [];\n $arr[] = 'a';\n $arr[\"1\"] = 'b';\n $arr[\"01\"] = 'c';\n $arr[true] = 'd';\n $arr[0.5] = 'e';\n $arr[false] = 'f';\n $arr[null] = 'g';\n\n // Which keys will have $arr\n //$this->assertEquals(?, array_keys($arr));\n\n // Which values will have $arr\n //$this->assertEquals(?, array_values($arr));\n }", "public function hasOldPrice(){\n return $this->_has(17);\n }", "public function checkDiff()\n {\n if ($this->tokensOriginal !== $this->tokensMutated) {\n return true;\n }\n\n return false;\n }", "final protected function shouldHaveNumericalKeys ($value) {\n\t\t$arguments = func_get_args();\n\t\tforeach ($arguments as $argument) {\n\t\t\tif (!is_array($argument)) {\n\t\t\t\treturn $this->fail();\n\t\t\t} else {\n\n\t\t\t\t// Fail if incorrect key found\n\t\t\t\tforeach (array_keys($argument) as $key) {\n\t\t\t\t\tif (!is_int($key)) {\n\t\t\t\t\t\treturn $this->fail();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\treturn $this->pass();\n\t}", "private function save_plus_minus_votes()\n {\n $result = true;\n foreach ($this->votes_plus as $vote) {\n if (! empty( $vote)) {\n if (! $this->save_one_vote( $vote, 1,0) ) {\n $result = false;\n }\n }\n }\n foreach ($this->votes_minus as $vote) {\n if (! empty( $vote)) {\n if (! $this->save_one_vote( $vote, 0,1)) {\n $result = false;\n };\n }\n }\n return $result;\n }", "public function isSameScoreDifference() {\n \n if (false === isset($this->intRealHomeScore) || false === isset($this->intBetHomeScore)) {\n throw new \\BadMethodCallException(\"Real and bet results must be set\");\n }\n \n return $this->intRealHomeScore - $this->intRealAwayScore === $this->intBetHomeScore - $this->intBetAwayScore;\n }", "protected function isEqual($key, $value1, $value2) {\n\t\tif($key) {} // intentional to avoid unused argument notice\n\t\t// $key intentionally not used here, but may be used by descending classes\n\t\treturn $value1 === $value2; \t\n\t}", "function SetupKeyValues($key) {\n\t\t$sKeyFld = $key;\n\t\tif (!is_numeric($sKeyFld))\n\t\t\treturn FALSE;\n\t\t$this->product_id->CurrentValue = $sKeyFld;\n\t\treturn TRUE;\n\t}", "public function renameNx(string $key, string $newKey): bool\n {\n return $this->redis->renameNx($key, $newKey);\n }" ]
[ "0.7722886", "0.60779005", "0.545446", "0.53319126", "0.5328782", "0.5290431", "0.51420885", "0.51365614", "0.5067573", "0.5048477", "0.49768052", "0.49618724", "0.49539602", "0.49462232", "0.49450853", "0.49256834", "0.49012312", "0.48968127", "0.48750275", "0.48686787", "0.48509765", "0.4843875", "0.48128283", "0.48067135", "0.48013717", "0.47966418", "0.47873354", "0.4781812", "0.478039", "0.4750325" ]
0.72838795
1
Register a model event with the dispatcher.
protected static function registerModelEvent($event, $callback, $priority = 0) { if (isset(static::$dispatcher)) { $name = get_called_class(); static::$dispatcher->listen("halcyon.{$event}: {$name}", $callback, $priority); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getModelEvents();", "public function registerDocumentModelEvent(ModelEvent $event)\n {\n if (!$this->enabled) {\n return;\n }\n if ((!($dbEvents = $this->getConfigValue('database', 'array')))) {\n return;\n }\n if (!in_array($event->getAction(), $dbEvents)) {\n return;\n }\n\n $data = (object) [\n 'class' => $event->getCollectionClass()\n ];\n\n /** @var AuditTracking $audit */\n $audit = new $this->documentName();\n $audit->setAction($event->getAction());\n $audit->setType('collection');\n $audit->setData($data);\n $audit->setLocation($this->globalRequestLocation);\n $audit->setCollectionId($event->getCollectionId());\n $audit->setCollectionName($event->getCollectionName());\n $audit->setCreatedAt(new \\DateTime());\n\n $this->events[] = $audit;\n }", "public function registerEvents() {\n $this->cx->getEvents()->addEvent('model/expired');\n $this->cx->getEvents()->addEvent('model/terminated');\n $this->cx->getEvents()->addEvent('model/payComplete');\n }", "protected function listenToModelEvent($event)\n\t{\n\t\t$this->eventDispatcher->listen(\"eloquent.{$event}: *\", function ($model, $data = null) use ($event) {\n\t\t\tif (is_string($model) && is_array($data)) { // Laravel 5.4 wildcard event\n\t\t\t\t$model = reset($data);\n\t\t\t}\n\n\t\t\t$this->collectModelEvent($event, $model);\n\t\t});\n\t}", "protected function fireModelEvent(Event $event)\n {\n static::getEventDispatcher()->fire($event);\n }", "protected function onModelCreated()\n {\n if ($this->addLeaf != null) {\n $this->addLeaf->setName(\"Add\");\n $this->model->addLeaf = $this->addLeaf;\n }\n\n // Hook up the event handler that returns a selection item for a given model.\n $this->model->getItemForModelEvent->attachHandler(function(Model $model){\n return $this->makeItemForValue($model->getUniqueIdentifier());\n });\n\n parent::onModelCreated();\n }", "protected function _registerEvent(Mage_Index_Model_Event $event)\n\t{\n\t\tif ($event->getEntity() == Asm_Solr_Model_Cms_Page::ENTITY\n\t\t\t&& $event->getType() == Mage_Index_Model_Event::TYPE_SAVE\n\t\t) {\n\t\t\t$event->setData('solr_update_page_id', $event->getDataObject()->getId());\n\t\t}\n\t}", "function eventRegister($eventName, EventListener $listener);", "public function setEvent(MvcEvent $event)\n\t{\n\t\t$this->viewModel = $event->getViewModel();\n\t}", "public function setModelDispatcher(ModelDispatcher $modelDispatcher)\n {\n $this->modelDispatcher = $modelDispatcher;\n }", "public function listenToEvents()\n\t{\n\t\tif ($scope = $this->getModelResolvingScope()) {\n\t\t\t$this->eventDispatcher->listen('eloquent.booted: *', function ($model, $data = null) use ($scope) {\n\t\t\t\tif (is_string($model) && is_array($data)) { // Laravel 5.4 wildcard event\n\t\t\t\t\t$model = reset($data);\n\t\t\t\t}\n\n\t\t\t\t$model->addGlobalScope($scope);\n\t\t\t});\n\t\t}\n\n\t\tif (class_exists(\\Illuminate\\Database\\Events\\QueryExecuted::class)) {\n\t\t\t// Laravel 5.2 and up\n\t\t\t$this->eventDispatcher->listen(\\Illuminate\\Database\\Events\\QueryExecuted::class, function ($event) {\n\t\t\t\t$this->registerQuery($event);\n\t\t\t});\n\t\t} else {\n\t\t\t// Laravel 5.0 to 5.1\n\t\t\t$this->eventDispatcher->listen('illuminate.query', function ($event) {\n\t\t\t\t$this->registerLegacyQuery($event);\n\t\t\t});\n\t\t}\n\n\t\t// register all event listeners individually so we don't have to regex the event type and support Laravel <5.4\n\t\t$this->listenToModelEvent('retrieved');\n\t\t$this->listenToModelEvent('created');\n\t\t$this->listenToModelEvent('updated');\n\t\t$this->listenToModelEvent('deleted');\n\t}", "public function event()\r\n {\r\n\r\n $event = new Event();\r\n $event->afterDelete = function (EyufScholar $model) {\r\n //User::deleteAll(['id' => $model->user_id]);\r\n };\r\n\r\n\r\n $event->beforeSave = function (EyufScholar $model) {\r\n /// Az::$app->App->eyuf->scholar->sendNotifyToAdmin($model);\r\n };\r\n /*\r\n $event->beforeDelete = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterDelete = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->beforeSave = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterSave = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->beforeValidate = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterValidate = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterRefresh = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterFind = function (EyufScholar $model) {\r\n return null;\r\n };\r\n */\r\n return $event;\r\n\r\n }", "public function setModelEndpoint($model);", "public static function bootBroadcastChanges()\n {\n static::created(function ($model) {\n $channel = strtolower(class_basename(get_class($model)));\n event(new ModelCreated($model, $channel));\n });\n\n static::updated(function ($model) {\n $channel = strtolower(class_basename(get_class($model)));\n event(new ModelChanged($model, $channel));\n });\n\n static::deleted(function ($model) {\n $channel = strtolower(class_basename(get_class($model)));\n event(new ModelTrashed($model, $channel));\n });\n }", "public function setEventDispatcher(IlluminateDispatcher $events)\n\t{\n\t\t$this->neoeloquent->setEventDispatcher(\\App::make(Dispatcher::class));\n\t}", "protected function registerEvents()\n {\n $events = $this->app->make(Dispatcher::class);\n\n foreach ($this->events as $event => $listeners) {\n foreach ($listeners as $listener) {\n $events->listen($event, $listener);\n }\n }\n }", "protected function registerModelBindings()\n {\n $this->app->bind(LogContract::class, Log::class);\n }", "public function registerEvent(EventInterface $event);", "protected static function boot()\n {\n parent::boot();\n\n static::created(function ($model) {\n $notification = self::find($model->id);\n broadcast(new SiteNotification($notification));\n });\n\n }", "protected static function boot()\r\n {\r\n parent::boot();\r\n\r\n foreach (static::$handleableEvents as $event) {\r\n static::$event(function($model) use ($event) {\r\n /** @var Model $model */\r\n return $model->handleEvent($event);\r\n });\r\n }\r\n }", "protected function _registerEvent(Mage_Index_Model_Event $event)\n {\n $event->addNewData(self::EVENT_MATCH_RESULT_KEY, TRUE);\n switch ($event->getEntity()) {\n case Mage_Catalog_Model_Product::ENTITY:\n $this->_registerCatalogProductEvent($event);\n break;\n case Mage_Catalog_Model_Category::ENTITY:\n $this->_registerCatalogCategoryEvent($event);\n break;\n case Mage_Catalog_Model_Convert_Adapter_Product::ENTITY:\n $event->addNewData('algoliasearch_reindex_all', TRUE);\n break;\n case Mage_Core_Model_Config_Data::ENTITY:\n $stores = TRUE;\n if ($event->getDataObject()->getScope() == 'stores') {\n $stores = array($event->getDataObject()->getScopeId());\n } else if ($event->getDataObject()->getScope() == 'websites') {\n $stores = Mage::app()->getWebsite($event->getDataObject()->getScopeId())->getStoreIds();\n }\n if (in_array($event->getDataObject()->getPath(), $this->_relatedConfigSettingsUpdate)) {\n $event->addNewData('algoliasearch_update_settings', $stores);\n } else if (in_array($event->getDataObject()->getPath(), $this->_relatedConfigSettingsReindex)) {\n $event->addNewData('algoliasearch_reindex_all', $stores);\n }\n break;\n case Mage_Core_Model_Store::ENTITY:\n case Mage_Catalog_Model_Resource_Eav_Attribute::ENTITY:\n case Mage_Core_Model_Store_Group::ENTITY:\n $event->addNewData('algoliasearch_reindex_all', TRUE);\n break;\n }\n }", "protected function collectModelEvent($event, $model)\n\t{\n\t\t$lastQuery = ($queryCount = count($this->queries)) ? $this->queries[$queryCount - 1] : null;\n\n\t\t$action = [\n\t\t\t'model' => $modelClass = get_class($model),\n\t\t\t'key' => $this->getModelKey($model),\n\t\t\t'action' => $event,\n\t\t\t'attributes' => $this->collectModelsRetrieved && $event == 'retrieved' ? $model->getOriginal() : [],\n\t\t\t'changes' => $this->collectModelsActions && method_exists($model, 'getChanges') ? $model->getChanges() : [],\n\t\t\t'time' => microtime(true) / 1000,\n\t\t\t'query' => $lastQuery ? $lastQuery['query'] : null,\n\t\t\t'duration' => $lastQuery ? $lastQuery['duration'] : null,\n\t\t\t'connection' => $lastQuery ? $lastQuery['connection'] : null,\n\t\t\t'trace' => null,\n\t\t\t'tags' => []\n\t\t];\n\n\t\tif ($lastQuery) $this->queries[$queryCount - 1]['model'] = $modelClass;\n\n\t\tif (! $this->passesFilters([ $action ], 'models-early')) return;\n\n\t\t$this->incrementModelsCount($action['action'], $action['model']);\n\n\t\tif (! $this->collectModelsActions) return;\n\t\tif (! $this->collectModelsRetrieved && $event == 'retrieved') return;\n\t\tif (! $this->passesFilters([ $action ], 'models')) return;\n\n\t\t$action['trace'] = (new Serializer)->trace(StackTrace::get()->resolveViewName());\n\n\t\t$this->modelsActions[] = $action;\n\t}", "function addEvent($event) {\n Event::addEvent($event);\n }", "public function add(Model $model) {\n $this->models[get_class($model)] = $model;\n }", "protected static function bootEvent()\n {\n static::saving(function (Item $model) {\n if (is_null($model->getAttributeFromArray('quantity_per_bundle'))) {\n $model->quantity_per_bundle = $model->getDenominationRelationValue()->quantity_per_bundle;\n }\n\n if (!$model->is_order_custom_quantity) {\n $model->quantity = $model->countQuantityAttribute();\n }\n });\n }", "public function register() : void\n {\n $this->registerDefaultEventSourcingBindings();\n $this->registerEventStore();\n }", "private function registerEventStore() : void\n {\n $this->app->bind(IlluminateEventStore::class, function ($app) {\n $connection = $app->make(Connection::class);\n $serializer = $app->make(Serializer::class);\n $eventStoreTable = $app->config->get('event_sourcing.event_store_table');\n\n return new IlluminateEventStore(\n $connection,\n $serializer,\n $eventStoreTable\n // decorators (we could decorate the stream with account_id)\n );\n });\n\n $this->app->bind(\n EventStore::class,\n IlluminateEventStore::class\n );\n }", "public function setEventDispatch(\\Montage\\Event\\Dispatch $dispatch);", "private function dispatchModelEvent($action, $collection)\n {\n if (!($this->repository instanceof DocumentRepository)) {\n return;\n }\n if (!method_exists($collection, 'getId')) {\n return;\n }\n\n $event = new ModelEvent();\n $event->setCollectionId($collection->getId());\n $event->setActionByDispatchName($action);\n $event->setCollectionName($this->repository->getClassMetadata()->getCollection());\n $event->setCollectionClass($this->repository->getClassName());\n $event->setCollection($collection);\n\n $this->eventDispatcher->dispatch($event, $action);\n }", "public function register(EventDispatcher $dispatcher)\n {\n $dispatcher->connect('core.exception', array($this, 'handle'));\n }" ]
[ "0.6501016", "0.6453853", "0.60835004", "0.60735255", "0.6029853", "0.56127524", "0.55811983", "0.5530698", "0.54611063", "0.5442325", "0.54347765", "0.5424129", "0.5386761", "0.53820634", "0.53743255", "0.53215265", "0.5313584", "0.5302551", "0.5290838", "0.5286662", "0.528395", "0.5282649", "0.5241718", "0.52376246", "0.52330583", "0.5231065", "0.52095956", "0.5189934", "0.51724184", "0.5128728" ]
0.6459546
1
Get the current datasource name for the model.
public function getDatasourceName() { return $this->datasource; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getDataSourceName() {\r\n // Example: Use a local SQLite3 database\r\n return 'sqlite:' . dirname(__FILE__) . '/counter.sqlite3';\r\n \r\n // Example use mySQL\r\n // return 'mysql:host=localhost;port=3306;dbname=demo';\r\n }", "public static function getDataSourceKey()\n {\n return self::getConfig()->get('dataSourceKey');\n }", "public function getDataSourceName()\n {\n return t(\"Test Data Source\");\n }", "public function getDatasource()\n {\n return $this->datasource;\n }", "public function getDatasource()\n {\n return $this->datasource;\n }", "public function datasource() {\n if (!isset($this->datasource)) {\n $this->datasource = search_api_get_datasource_controller($this->item_type);\n }\n return $this->datasource;\n }", "public function getModelName() {\n\t\treturn $this->getSourceName();\n\t}", "public function getDataSource()\n {\n /** @var Model $modelClass */\n $modelClass = get_class($this);\n $parentModelName = get_parent_class($modelClass);\n\n if ($parentModelName == Model_Defined::getClass() || $parentModelName == Model_Factory::getClass()) {\n return Data_Source::getInstance(Object::getName($parentModelName) . ':model/' . $modelClass);\n }\n\n return Data_Source::getInstance($modelClass::getDataSourceKey());\n }", "public function getModelName()\n {\n return $this->getConfig()->modelName;\n }", "public function getDatasource()\n {\n return static::resolveDatasource($this->datasource);\n }", "public function getName()\r\n\t{\r\n\t\treturn $this->_modelName;\r\n\r\n\t}", "public function getDataSourceDefinition()\n {\n return $this->data_source_definition;\n }", "public function getModelName()\n {\n return $this->getModel()->name;\n }", "public function getName()\n\t{\n\t\treturn $this->neoeloquent->getConfigOption('name');\n\t}", "protected function getActiveDatasource()\n {\n return $this->datasources[$this->activeDatasourceKey];\n }", "public function getModel()\n\t{\n\t\treturn $this->resource->name;\n\t}", "public function getSourceName() {\n return $this->source;\n }", "public function getDataSource()\n {\n return isset($this->DataSource) ? $this->DataSource : null;\n }", "public function getDataSource()\n\t{\n\t\treturn $this->dataSource;\n\t}", "public function key()\n\t{\n\t\treturn $this->datasource->key();\n\t}", "public function getName()\n {\n return empty($this->model->name) ? $this->id : $this->model->name;\n }", "public function getModelName() : string\n {\n $config_key = 'scheduleable.repositories.' . snake_case(class_basename(static::class)) . '.model_class';\n return config($config_key);\n }", "public function getDataSource() {\n\t\treturn $this->dataSource;\n\t}", "public function getConnectionName()\n {\n return config('profiler.storage.database.connection');\n }", "public function getName()\n {\n return $this->dataProvider;\n }", "public function getAdapterName()\n {\n return $this->adapterName;\n }", "function getDataSource() { return $this->_datasource; }", "public function getDataSourceType();", "public function modelName(): string\n {\n return class_basename($this->model);\n }", "public function getResourceName()\n {\n return static::$resource ?: strtolower($this->getEntityName());\n }" ]
[ "0.7160904", "0.7128389", "0.7120785", "0.6970749", "0.6970749", "0.686984", "0.6869673", "0.6817336", "0.67749864", "0.6697576", "0.65902865", "0.64754593", "0.64501506", "0.644604", "0.639903", "0.63811195", "0.6365092", "0.63477874", "0.634556", "0.63448626", "0.6340736", "0.6334531", "0.6331474", "0.6273526", "0.62717026", "0.6256558", "0.62561685", "0.62508696", "0.6246716", "0.6193622" ]
0.8409692
0
Resolve a datasource instance.
public static function resolveDatasource($datasource = null) { return static::$resolver->datasource($datasource); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getDatasourceResolver()\n {\n return static::$resolver;\n }", "public function getDatasource()\n {\n return static::resolveDatasource($this->datasource);\n }", "public static function getConnectionResolver();", "public static function getDataSource()\n {\n return static::$_dataSource;\n }", "public static function getConnectionResolver()\n {\n return static::$resolver;\n }", "public static function getConnectionResolver()\n {\n return static::$resolver;\n }", "public function datasource() {\n if (!isset($this->datasource)) {\n $this->datasource = search_api_get_datasource_controller($this->item_type);\n }\n return $this->datasource;\n }", "protected static function resolve_connection() {\n global $DB;\n\n switch ($DB->get_dbfamily()) {\n case 'mysql':\n return new mysql_connection($DB);\n default:\n throw new \\Exception('Unsupported database family: ' . $DB->get_dbfamily());\n }\n }", "public function getConnectionResolver()\n {\n return $this->resolver;\n }", "public function getResourceDataSource()\n\t{\n\t\tif ($this->_resourceDataSource === null)\n\t\t{\n\t\t\t$this->_resourceDataSource = new Application_Model_ResourceMapper;\n\t\t}\n\t\t\n\t\treturn $this->_resourceDataSource;\n\t}", "public function getDatasource()\n {\n return $this->datasource;\n }", "public function getDatasource()\n {\n return $this->datasource;\n }", "public function getDataSource()\n {\n return isset($this->DataSource) ? $this->DataSource : null;\n }", "public function getDataSource() {\n\t\treturn $this->dataSource;\n\t}", "public function getDataSource()\n\t{\n\t\treturn $this->dataSource;\n\t}", "private function detectDataSource()\n {\n $key = $this->config['datasource']['key'];\n $this->log(\"Detecting if there's a data source with key {$key}\");\n $this->dataSource = DataSource::where('key', $key)->get()->first();\n if (!$this->dataSource) {\n $this->info(\"No data source found. Proceeding to automatically create a data source\");\n $this->createDataSource();\n }\n\n $this->info(\"Importing to Data source {$this->dataSource->title}({$this->dataSource->data_source_id})...\");\n }", "function getDataSource() { return $this->_datasource; }", "public static function dataSource($args)\n\t{\n\t\t$args = func_get_args();\n\t\treturn self::getConnection()->dataSource($args);\n\t}", "function readDataSource() {return $this->_datasource;}", "protected function _useSourceDatasource() {\n\n // Instantiate source datasource if it's not already instantiated\n if (is_null($this->_externalNewsSourceDatasource)) {\n $this->_externalNewsSourceDatasource = new Datasource_Cms_ExternalNews_Source();\n }\n }", "public function resolveConnection() {\n if ( !is_null($this->redis) ) return $this->redis;\n\n $parameters = $this->parameters ?: getenv('REDIS_URL') ?: 'tcp://127.0.0.1/6379?database=0';\n\n $this->redis = new Client($parameters);\n\n return $this->redis;\n }", "public static function setDatasourceResolver(Resolver $resolver)\n {\n static::$resolver = $resolver;\n }", "protected function resolveFromConfigFile()\n {\n $config = null;\n\n if (file_exists($this->configFile)) {\n $config = require_once($this->configFile);\n }\n\n if ($config && $connectionString = $config['connection_string']) {\n static::setConnection(new PDO($connectionString));\n }\n }", "public function getDataSource()\n {\n /** @var Model $modelClass */\n $modelClass = get_class($this);\n $parentModelName = get_parent_class($modelClass);\n\n if ($parentModelName == Model_Defined::getClass() || $parentModelName == Model_Factory::getClass()) {\n return Data_Source::getInstance(Object::getName($parentModelName) . ':model/' . $modelClass);\n }\n\n return Data_Source::getInstance($modelClass::getDataSourceKey());\n }", "function getDataSource() {return $this->_datasource;}", "protected function getActiveDatasource()\n {\n return $this->datasources[$this->activeDatasourceKey];\n }", "public static function getConnection()\n {\n if (self::$resource == false)\n {\n self::$resource = plexcel_new(self::getLdapConfig(), array());\n if ( !is_resource(self::$resource))\n {\n throw new sfException(\"Connection error\");\n }\n }\n return self::$resource ;\n }", "public function getDatasourceRepository()\n {\n return $this->datasourceRepository;\n }", "public function dataSource($value) {\n return $this->setProperty('dataSource', $value);\n }", "public function dataSource($value) {\n return $this->setProperty('dataSource', $value);\n }" ]
[ "0.6254908", "0.5897958", "0.5827101", "0.5559807", "0.55424845", "0.55424845", "0.551143", "0.54690635", "0.54495233", "0.5303409", "0.53020084", "0.53020084", "0.52671164", "0.5264699", "0.5243511", "0.52429086", "0.52256596", "0.52160084", "0.520504", "0.509803", "0.5086399", "0.5079903", "0.50712985", "0.5047992", "0.50440633", "0.49935102", "0.49082577", "0.48936236", "0.4840996", "0.4840996" ]
0.73382974
0
Get the datasource resolver instance.
public static function getDatasourceResolver() { return static::$resolver; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getConnectionResolver()\n {\n return static::$resolver;\n }", "public static function getConnectionResolver()\n {\n return static::$resolver;\n }", "public function getConnectionResolver()\n {\n return $this->resolver;\n }", "public static function resolveDatasource($datasource = null)\n {\n return static::$resolver->datasource($datasource);\n }", "public function resolver() {\n return $this->resolver;\n }", "public function getDatasource()\n {\n return static::resolveDatasource($this->datasource);\n }", "public static function getDataSource()\n {\n return static::$_dataSource;\n }", "public function datasource() {\n if (!isset($this->datasource)) {\n $this->datasource = search_api_get_datasource_controller($this->item_type);\n }\n return $this->datasource;\n }", "protected function getResolver()\n {\n return $this->container->get('sylius.cart_resolver');\n }", "public function getResolver()\n {\n }", "protected function getConfigResolver()\n {\n if (is_null($this->configResolver) === false) {\n return $this->configResolver;\n }\n\n $resolver = new AttributesResolver();\n $resolver->setDefault('host', '0.0.0.0', 'string', true)\n ->setDefault('port', 4000, 'integer', true)\n ->setValidator('port', function ($value) {\n return $value >= 0;\n })\n ->setDefault('server_watch_ext', ['html'], 'array', true)\n ->setDefault('parsedown_activated', false, 'bool', true);\n\n $this->configResolver = $resolver;\n\n return $this->configResolver;\n }", "public function getDatasourceRepository()\n {\n return $this->datasourceRepository;\n }", "public function getDataFetcherRegistrar()\n {\n if (! $this->fetcherRegistrar) {\n $this->fetcherRegistrar = app(DataFetcherRegistrar::class)->setSchema($this);\n }\n\n return $this->fetcherRegistrar;\n }", "protected function getResolver()\n {\n $resolver = new AttributesResolver();\n $resolver->setDefault('name', '', 'string')\n ->setDefault('description', '', 'string')\n ->setDefault('author', '', 'string')\n ->setDefault('license', '', 'string');\n\n return $resolver;\n }", "public static function getConnectionResolver();", "public function getDatasource()\n {\n return $this->datasource;\n }", "public function getDatasource()\n {\n return $this->datasource;\n }", "public function getDataSource()\n {\n return isset($this->DataSource) ? $this->DataSource : null;\n }", "public function getResourceDataSource()\n\t{\n\t\tif ($this->_resourceDataSource === null)\n\t\t{\n\t\t\t$this->_resourceDataSource = new Application_Model_ResourceMapper;\n\t\t}\n\t\t\n\t\treturn $this->_resourceDataSource;\n\t}", "public function getDataSourceHandler()\n {\n return $this->DataSourceInstance->getDataSourceHandler();\n }", "public function getDataSource() {\n\t\treturn $this->dataSource;\n\t}", "protected function getEntityResolver()\n {\n return \\Yii::createObject('app\\modules\\queue\\components\\interfaces\\EntityResolverInterface');\n }", "public static function getResolver($driver)\n {\n return static::$resolvers[$driver] ?? null;\n }", "private function getStockResolverService(): ?StockResolverInterface\n {\n try {\n $stockResolver = $this->objectManager->get(StockResolverInterface::class);\n } catch (Throwable $e) {\n $stockResolver = null;\n }\n return $stockResolver;\n }", "public function getDataSource()\n\t{\n\t\treturn $this->dataSource;\n\t}", "public function getDataLoaderRegistrar()\n {\n if (! $this->loaderRegistrar) {\n $this->loaderRegistrar = app(DataLoaderRegistrar::class)->setSchema($this);\n }\n\n return $this->loaderRegistrar;\n }", "protected function getRouting_ResolverService()\n {\n return $this->services['routing.resolver'] = new \\phpbb\\routing\\loader_resolver(${($_ = isset($this->services['routing.loader.collection']) ? $this->services['routing.loader.collection'] : $this->getRouting_Loader_CollectionService()) && false ?: '_'});\n }", "public function getDataSource()\n {\n /** @var Model $modelClass */\n $modelClass = get_class($this);\n $parentModelName = get_parent_class($modelClass);\n\n if ($parentModelName == Model_Defined::getClass() || $parentModelName == Model_Factory::getClass()) {\n return Data_Source::getInstance(Object::getName($parentModelName) . ':model/' . $modelClass);\n }\n\n return Data_Source::getInstance($modelClass::getDataSourceKey());\n }", "private function getRessourceService()\n {\n if (!$this->ressourceService) {\n $this->ressourceService = $this->getServiceManager()->get('playgroundcms_ressource_service');\n }\n\n return $this->ressourceService;\n }", "public function create()\n {\n return new ConfigResolver();\n }" ]
[ "0.74746126", "0.74746126", "0.73314303", "0.7196785", "0.6959201", "0.6614767", "0.6291765", "0.61531407", "0.61505747", "0.6123957", "0.61236215", "0.6103618", "0.6086765", "0.6069854", "0.6024955", "0.6020866", "0.6020866", "0.5958177", "0.5931751", "0.5924971", "0.5905664", "0.5903495", "0.5890302", "0.5841891", "0.57964516", "0.57893825", "0.57383186", "0.57285446", "0.5725182", "0.5723371" ]
0.8466631
0
Set the datasource resolver instance.
public static function setDatasourceResolver(Resolver $resolver) { static::$resolver = $resolver; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function setConnectionResolver(Resolver $resolver);", "public function set_resolver(Resolver $resolver);", "public static function setConnectionResolver(Resolver $resolver)\n {\n static::$resolver = $resolver;\n }", "public static function getDatasourceResolver()\n {\n return static::$resolver;\n }", "public function setResolver(Resolver $resolver)\n {\n $this->resolver = $resolver;\n }", "public static function setConnectionResolver(ConnectionResolver $resolver)\n {\n static::$resolver = $resolver;\n }", "public static function setDalResolver(DalResolver $resolver)\n {\n static::$_resolver = $resolver;\n }", "public function setResolver(DriverResolver $resolver)\n {\n \n }", "public static function unsetDatasourceResolver()\n {\n static::$resolver = null;\n }", "public function getConnectionResolver()\n {\n return $this->resolver;\n }", "public static function getConnectionResolver()\n {\n return static::$resolver;\n }", "public static function getConnectionResolver()\n {\n return static::$resolver;\n }", "public function setDatasource($datasource)\n {\n $this->datasource = $datasource;\n }", "public static function resolveDatasource($datasource = null)\n {\n return static::$resolver->datasource($datasource);\n }", "public function setResolver(ResolverInterface $resolver)\n {\n $this->resolver = $resolver;\n return $this;\n }", "public function setResolver(LoaderResolverInterface $resolver)\n {\n }", "public function setResolver(ResolverInterface $resolver)\n {\n $this->resolver = $resolver;\n\n return $this;\n }", "public function resolver() {\n return $this->resolver;\n }", "public function setResolver(Resolver $resolver)\r\n\t{\r\n\t\treturn $this;\r\n\t}", "protected function registerResolver()\n {\n $this->app->bindShared('themify.resolver', function ($app) {\n return new Resolver($app);\n });\n }", "public function setDatasource($datasource = NULL)\n {\n\n //If there are no datasource, set it to an empty array\n if($datasource === NULL)\n {\n $datasource = array();\n }\n\n //Wrap the array into an iterator\n if(is_array($datasource))\n {\n $datasource = new \\ArrayIterator($datasource);\n }\n\n //Validate\n if(!($datasource instanceof \\Traversable))\n {\n throw new \\InvalidArgumentException('Datasource must be either an array or \\\\Traversable');\n }\n\n //Save the datasource\n $this->datasource = $datasource;\n \n }", "public function blueprintResolver(Closure $resolver)\n {\n $this->resolver = $resolver;\n }", "public function blueprintResolver(Closure $resolver)\n {\n $this->resolver = $resolver;\n }", "public static function withParameterResolver($resolver)\n {\n static::$parameterResolver = $resolver;\n }", "function SetDatasource($ds)\r\n\t{\r\n\t\t$this->Datasource = $ds;\r\n\t\r\n\t\t//$repeater_outer =& $this->FindControl(\"rptRows\");\r\n\t\t//$repeater_outer->SetDatasource($ds);\r\n\t}", "public function setResolver(ParameterInterface $resolver);", "public static function resolveAvailabilityUsing($resolver)\n {\n static::$availabilityResolver = $resolver;\n }", "public static function getConnectionResolver();", "protected function _useSourceDatasource() {\n\n // Instantiate source datasource if it's not already instantiated\n if (is_null($this->_externalNewsSourceDatasource)) {\n $this->_externalNewsSourceDatasource = new Datasource_Cms_ExternalNews_Source();\n }\n }", "public function setParameterResolver($resolver)\n {\n static::withParameterResolver($resolver);\n\n return $this;\n }" ]
[ "0.70538473", "0.6986677", "0.6957359", "0.6792438", "0.6722543", "0.66289234", "0.66157186", "0.6512312", "0.6101639", "0.5945581", "0.59298414", "0.59298414", "0.589466", "0.58686596", "0.58485174", "0.581797", "0.57792646", "0.5719786", "0.5640163", "0.5609125", "0.5604885", "0.5561649", "0.5561649", "0.5561528", "0.5485377", "0.5462566", "0.5362225", "0.5356651", "0.52986723", "0.5236213" ]
0.7941913
0
Unset the datasource resolver for models.
public static function unsetDatasourceResolver() { static::$resolver = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function unsetDalResolver()\n {\n static::$_resolver = null;\n }", "public static function unsetConnectionResolver()\n {\n static::$resolver = null;\n }", "public static function unsetConnectionResolver()\n {\n static::$resolver = null;\n }", "public static function unsetConnectionResolver();", "public function clearModels();", "public function tearDown() {\n $this->model = null;\n }", "public static function clearBootedModels();", "public function reset()\n {\n $this->models = null;\n return $this;\n }", "public function clearModels()\n {\n $this->_models = array();\n return $this;\n }", "public function testGettingClearDataSource()\n {\n $dataSource = new TestDataSource();\n $dataSource->setName('test');\n DataSourcesRegistry::registerDataSource($dataSource);\n DataSourcesRegistry::clearDataSource('test');\n DataSourcesRegistry::getDataSource('test');\n }", "public function testClearNonExistantDataSource()\n {\n DataSourcesRegistry::clearDataSource('test'); \n }", "public function uninstall() {\r\n\tforeach ($this->getModel() AS $model) {\r\n\t $this->getEntity($model->getName())->deleteTable();\r\n\t}\r\n }", "protected function tearDown ()\n {\n // TODO Auto-generated ModelTest::tearDown()\n\n $this->Model = null;\n\n parent::tearDown();\n }", "function unbindAll() {\n foreach (array(\n 'hasOne' => array_keys($this->hasOne),\n 'hasMany' => array_keys($this->hasMany),\n 'belongsTo' => array_keys($this->belongsTo),\n 'hasAndBelongsToMany' => array_keys($this->hasAndBelongsToMany)\n ) as $relation => $model) {\n $this->unbindModel(array($relation => $model));\n }\n }", "public function dropDatasource($source);", "private function _unsetSetup()\n\t{\n\t\tforeach ( $this->_setup as $setup )\n\t\t{\n\t\t\t$setup->disconnect();\n\t\t}\n\n\t\t$this->_setup = null;\n\t\t$this->_setup = array();\n\t}", "protected function tearDown(): void\n {\n foreach (['default'] as $connection) {\n $this->schema($connection)->drop('users');\n $this->schema($connection)->drop('friends');\n $this->schema($connection)->drop('posts');\n $this->schema($connection)->drop('photos');\n }\n\n Relation::morphMap([], false);\n }", "protected function tearDown()\n {\n $this->_model = null;\n parent::tearDown();\n }", "public function resetDataModel() {\r\n $this->arrModel = array();\r\n $intPackageId = NULL;\r\n }", "protected function tearDown() {\n\t\t\n\n\t\t$this->_modelBase = null;\n\t\t\n\t\tparent::tearDown ();\n\t}", "public function unsetClassResolver()\n {\n $this->classResolver = null;\n\n return $this;\n }", "public function resetLookupCollections()\n\t{\n\t\t$this->lookupCollections[] = null;\n\t}", "public static function clearBootedModels()\n {\n static::$booted = [];\n }", "public static function clearBootedModels()\n {\n static::$booted = [];\n }", "function clear() {\r\n /* clear datasource. you should call this before calling another populate() to avoid datasource gets appended\r\n */\r\n $this->ds = new DataSource;\r\n $this->db_count = 0;\r\n }", "protected function tearDown(): void\n {\n parent::tearDown();\n $this->clearPlugins();\n ConnectionManager::dropAlias('test1');\n ConnectionManager::dropAlias('test2');\n }", "public function resetModelMocks()\n {\n $this->_registeredModelMocks = array();\n }", "protected function tearDown() {\n\t\t// TODO Auto-generated AliasResolverTest::tearDown()\n\t\t$this->AliasResolver = null;\n\t\t\n\t\tparent::tearDown ();\n\t}", "public function unsetProvider();", "public function clearResults($modelName);" ]
[ "0.6991766", "0.67543536", "0.67543536", "0.65499735", "0.60841894", "0.5916611", "0.5754598", "0.5667877", "0.5643645", "0.56382513", "0.5610049", "0.5541841", "0.5490016", "0.5461307", "0.5368551", "0.53546363", "0.53523505", "0.5347345", "0.53370273", "0.53142", "0.53045297", "0.5302879", "0.52922195", "0.52922195", "0.52727014", "0.52698267", "0.526752", "0.52228504", "0.52179754", "0.5211016" ]
0.7958001
0
Get the event dispatcher instance.
public static function getEventDispatcher() { return static::$dispatcher; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getEventDispatcherService()\n {\n if (isset($this->shared['event_dispatcher'])) return $this->shared['event_dispatcher'];\n\n $class = $this->getParameter('event_dispatcher.class');\n $instance = new $class($this);\n $this->shared['event_dispatcher'] = $instance;\n\n return $instance;\n }", "protected function getEventDispatcher()\n {\n return $this->eventDispatcher;\n }", "public function getDispatcher(): Dispatcher\n {\n return $this->events;\n }", "public function getEventDispatcher()\n {\n if (!isset($this['pantono.event.dispatcher'])) {\n $this['pantono.event.dispatcher'] = new Dispatcher($this);\n }\n return $this['pantono.event.dispatcher'];\n }", "protected function getDispatcher()\n {\n return $this->di->getShared('dispatcher');\n }", "public function getEventDispatcher()\n {\n return $this->eventDispatcher;\n }", "static function getEventDispatcher() {\n\t\treturn self::getRegistry()->get(self::REGISTRY_EVENT_DISPATCHER);\n\t}", "public static function get() {\n\t\tstatic $singleton = NULL;\n\t\tis_null($singleton) && $singleton = new Dispatcher();\n\t\treturn $singleton;\n\t}", "public function getDispatcher(): EventDispatcherInterface;", "public function getEventDispatcher()\n {\n return $this->options['event_dispatcher'];\n }", "public function getEventDispatcher(): ?Dispatcher\n {\n if ($this->container->bound('events')) {\n return $this->container['events'];\n }\n\n return null;\n }", "public function getDispatcher() {\n return $this->dispatcher;\n }", "public function getEventDispatcher(): EventDispatcherInterface;", "public function getDispatcher(): DispatcherContract\n {\n return $this->events;\n }", "public static function getEventDispatcher()\n {\n if (static::$sharedInstance !== null) {\n return static::$sharedInstance;\n }\n\n global $app;\n\n $appEventDispatcher = null;\n if ($app instanceof Application) {\n static::$allowCodeceptionHooks = true;\n $appEventDispatcher = static::getAppEventDispatcher($app);\n } else {\n static::$allowCodeceptionHooks = false;\n $appEventDispatcher = new SymfonyEventDispatcher();\n }\n\n if (! $appEventDispatcher instanceof SymfonyEventDispatcher) {\n throw new TestRuntimeException(sprintf(\n '\\\\Codeception\\\\Codecept::$eventDispatcher property is not an instance of %s; value is instead: %s',\n SymfonyEventDispatcher::class,\n print_r($appEventDispatcher, true)\n ));\n }\n\n static::$sharedInstance = new self($appEventDispatcher);\n\n return static::$sharedInstance;\n }", "public static function getEventDispatcher()\n {\n }", "protected function getDispatcherListener()\n {\n return $this->di->getShared('dispatcherListener');\n }", "public function getEventDispatcher()\n\t{\n\t\treturn $this->neoeloquent->getEventDispatcher();\n\t}", "public function getEventDispatcher()\n {\n return $this->events;\n }", "public function getEventDispatcher()\n {\n return $this->events;\n }", "public static function getEventDispatcher(){\n\t\treturn \\Illuminate\\Log\\Writer::getEventDispatcher();\n\t}", "public function getEventDispatcher()\n\t{\n\t\treturn $this->events;\n\t}", "function &getDispatcher() {\n $dispatcher =& Registry::get('dispatcher', true, null);\n\n if (is_null($dispatcher)) {\n import('ikto.classes.core.ScienceJournalDispatcher');\n\n // Implicitly set dispatcher by ref in the registry\n $dispatcher = new ScienceJournalDispatcher();\n\n // Inject dependency\n $dispatcher->setApplication(PKPApplication::getApplication());\n\n // Inject router configuration\n $dispatcher->addRouterName('ikto.classes.core.ScienceJournalComponentRouter', ROUTE_COMPONENT);\n $dispatcher->addRouterName('ikto.classes.core.ScienceJournalPageRouter', ROUTE_PAGE);\n }\n\n return $dispatcher;\n }", "public static function get_instance() \n {\n if ( ! isset(self::$instance)) \n {\n self::$instance = new Event();\n }\n\n return self::$instance;\n }", "protected function getSignalSlotDispatcher() {\n\t\treturn $this->objectManager->get('TYPO3\\\\CMS\\\\Extbase\\\\SignalSlot\\\\Dispatcher');\n\t}", "public static function getSignalSlotDispatcher(): Dispatcher\n {\n return GeneralUtility::makeInstance(Dispatcher::class);\n }", "public function getDispatcher(): RequestHandlerInterface {\n return $this->dispatcher;\n }", "public function getDispatcherEvents()\n\t{\n\t\treturn $this->dispatcher;\n\t}", "public function getOriginalEventDispatcher()\n {\n return $this->eventDispatcher;\n }", "public function getDispatcher(): ?DispatcherInterface\n {\n return $this->dispatcher;\n }" ]
[ "0.81160486", "0.80278236", "0.79869395", "0.7969047", "0.7869225", "0.785308", "0.7763506", "0.77522147", "0.75496876", "0.75269914", "0.7480979", "0.7477476", "0.7353422", "0.72507995", "0.71986276", "0.71884865", "0.71487474", "0.70782775", "0.70391905", "0.70391905", "0.70169383", "0.6879971", "0.68737817", "0.68685246", "0.67760277", "0.6759505", "0.674209", "0.6699839", "0.66834545", "0.66175646" ]
0.80964833
1
Unset the event dispatcher for models.
public static function unsetEventDispatcher() { static::$dispatcher = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function unsetEventDispatcher()\n {\n $this->events = null;\n }", "public function unsetDispatcher(): void\n {\n $this->dispatcher = null;\n }", "public function reset() {\n $this->_events->reset();\n }", "public function unsetEventTypes(): void\n {\n $this->eventTypes = [];\n }", "private function uninstallEvents()\n {\n $this->load->model('setting/event');\n $this->model_setting_event->deleteEvent('payment_mundipagg');\n }", "public static function offAll()\n {\n self::$_events = [];\n self::$_eventWildcards = [];\n }", "public static function flushEventListeners()\n {\n if (!isset(static::$dispatcher)) {\n return;\n }\n\n $instance = new static;\n\n foreach ($instance->getObservableEvents() as $event) {\n static::$dispatcher->forget(\"halcyon.{$event}: \".get_called_class());\n }\n\n static::$eventsBooted = [];\n }", "protected static function boot()\n {\n \tparent::boot();\n\n \tstatic::deleting(function($model) {\n \t\t$model->attributes()->sync([]);\n \t});\n }", "function unbindAll() {\n foreach (array(\n 'hasOne' => array_keys($this->hasOne),\n 'hasMany' => array_keys($this->hasMany),\n 'belongsTo' => array_keys($this->belongsTo),\n 'hasAndBelongsToMany' => array_keys($this->hasAndBelongsToMany)\n ) as $relation => $model) {\n $this->unbindModel(array($relation => $model));\n }\n }", "protected function _unsubscribeFromEngineEvents()\n {\n $controller = $this->getController();\n $controller->removeEventListener(\n Streamwide_Engine_Events_Event::ENDOFFAX,\n array( 'callback' => array( $this, 'onEndOfFax' ) )\n );\n $controller->removeEventListener(\n Streamwide_Engine_Events_Event::FAXPAGE,\n array( 'callback' => array( $this, 'onFaxPage' ) )\n );\n }", "public function tear_down(): void {\n\t\t$this->dispatcher->execute();\n\t}", "public function tearDown() {\n $this->model = null;\n }", "protected static function boot()\n {\n parent::boot();\n\n static::deleting(function ($model) {\n $model->roles()->detach();\n $model->routes()->detach();\n $model->actions()->detach();\n });\n }", "protected static function booted(): void\n {\n static::deleting(function (Model $model) {\n $model->removeAllImages();\n });\n }", "public function clearModels();", "public function clearEvents()\n\t{\n\t\t$this->collEvents = null; // important to set this to NULL since that means it is uninitialized\n\t}", "public function clear(): void\n {\n $this->eventRegistry->dequeueEvents();\n }", "public function unsetScheduler() {}", "public function detach(): void\n\t{\n\t\t$this->events->detach($this->type, $this->hook);\n\t}", "public function clearBehaviors()\n\t{\n\t\tif($this->_m!==null)\n\t\t{\n\t\t\tforeach($this->_m->toArray() as $name=>$behavior)\n\t\t\t\t$this->detachBehavior($name);\n\t\t\t$this->_m=null;\n\t\t}\n\t}", "public function off($event);", "protected function _unsubscribeFromEngineEvents()\n {\n $events = array(\n Streamwide_Engine_Events_Event::SDP,\n Streamwide_Engine_Events_Event::CHILD,\n Streamwide_Engine_Events_Event::OKMOVED,\n Streamwide_Engine_Events_Event::MOVED,\n Streamwide_Engine_Events_Event::FAILMOVED\n );\n \n $controller = $this->getController();\n foreach ( $events as $event ) {\n $controller->removeEventListener( $event, array( 'callback' => array( $this, 'onSignalReceived' ) ) );\n }\n }", "protected function forgetAddedModels()\n {\n $this->quantities = $this->modelPopulators = [];\n }", "function UnInstallEvents()\n\t{\n\t}", "public function disable()\n\t{\n\t\t// Removes itself from the event queue\n\t\tEvent::clear('system.display', array($this, 'render'));\n\t}", "private function clearAutoResponses()\n {\n $this->getEventDispatcher()->addListener(\n 'kernel.terminate',\n [$this->getAutoResponseRuleRepository(), 'clearAutoResponses']\n );\n }", "public static function clearBootedModels();", "public function tearDown() {\n\t\tparent::tearDown();\n\t\tunset($this->Event, $this->EventClass);\n\t\tunset($this->ObjectEvent, $this->ControllerEvent, $this->ModelEvent, $this->ViewtEvent);\n\t\tunset($this->ModelObject, $this->ViewObject, $this->ControllerObject);\n\t}", "public function removeObserver() {\n //$this->__observers = array();\n foreach($this->__observers as $obj) {\n unset($obj);\n }\n }", "function off() {\n return $this;\n }" ]
[ "0.7311602", "0.67983913", "0.63313633", "0.62176996", "0.6075609", "0.6002631", "0.58648247", "0.57652485", "0.57640064", "0.57521355", "0.57027155", "0.5669808", "0.5664629", "0.5622729", "0.5581341", "0.55378693", "0.55290747", "0.5523264", "0.552272", "0.5500164", "0.54785365", "0.54449373", "0.5443314", "0.5400914", "0.5385189", "0.5381801", "0.5348892", "0.53390884", "0.5322969", "0.5301981" ]
0.71739745
1
Get the cache manager instance.
public static function getCacheManager() { return static::$cache; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getCacheManager()\n {\n if (!$this->cacheManager) {\n $this->cacheManager = $this->getContainer()->get('fos_http_cache.cache_manager');\n }\n\n return $this->cacheManager;\n }", "protected function cache(): CacheManager\n {\n $cache = cache();\n if ($cache->supportsTags()) {\n $cache->tags($this->tags);\n }\n\n return $cache;\n }", "protected function getObject()\n\t{\n\t\tif( !isset( $this->object ) ) {\n\t\t\t$this->object = \\Aimeos\\MAdmin\\Cache\\Manager\\Factory::createManager( $this->context )->getCache();\n\t\t}\n\n\t\treturn $this->object;\n\t}", "protected static function getCacheManager() {}", "public function getInstance()\n {\n if( !isset( $this->memcached ) )\n {\n $this->memcached = new Memcache();\n $this->memcached->connect( Config::read( 'memcached.host' ), Config::read( 'memcached.port' ) );\n }\n\n return $this->memcached;\n }", "public function getCache() {\n\n // return our instance of Cache\n return $this->oCache;\n }", "protected function getManager()\n {\n return $this->manager;\n }", "public static function getInstance()\n {\n if (!isset(self::$instance)) {\n switch (CACHE_TYPE) {\n case CacheType::apc:\n self::$cache = new APC();\n break;\n case CacheType::eaccelerator:\n self::$cache = new eAccelerator;\n break;\n case CacheType::xcache:\n self::$cache = new XCache;\n break;\n case CacheType::file:\n self::$cache = new File;\n break;\n\n case CacheType::none:\n default:\n self::$cache = new NoCache;\n break;\n }\n\n $c = __CLASS__;\n self::$instance = new $c;\n }\n\n return self::$instance;\n }", "public static function getCache()\n\t{\n\t\tif (null === self::$_cache) {\n\t\t\tself::setCache(Zend_Cache::factory(\n\t\t\t\tnew Core_Cache_Frontend_Runtime(),\n\t\t\t\tnew Core_Cache_Backend_Runtime()\n\t\t\t));\n\t\t}\n\t\n\t\treturn self::$_cache;\n\t}", "protected function getLiipImagine_Cache_ManagerService()\n {\n $this->services['liip_imagine.cache.manager'] = $instance = new \\Liip\\ImagineBundle\\Imagine\\Cache\\CacheManager($this->get('liip_imagine.filter.configuration'), $this->get('router'), $this->get('liip_imagine.cache.signer'), $this->get('event_dispatcher'), 'default');\n\n $instance->addResolver('default', $this->get('liip_imagine.cache.resolver.default'));\n $instance->addResolver('no_cache', $this->get('liip_imagine.cache.resolver.no_cache_web_path'));\n\n return $instance;\n }", "public function getCache(): Cache\n {\n return $this->cache;\n }", "public function getCache()\r\n\t{\r\n\t\treturn \\Bitrix\\Main\\Data\\Cache::createInstance();\r\n\t}", "protected function getCacheManager() {}", "protected function getCacheManager() {}", "public function getManager()\n {\n return $this->manager;\n }", "public function getManager()\n {\n return $this->manager;\n }", "public function getManager()\n {\n return $this->manager;\n }", "public function getCache() {\n\t\treturn $this->get('Cundd\\\\Rest\\\\Cache\\\\Cache');\n\t}", "public function getCache() {\n if( null === $this->_cache ) {\n $this->_cache = Zend_Cache::factory\n ( $this->_frontend\n , $this->_backend\n , $this->_frontendOptions\n , $this->_backendOptions\n );\n }\n return $this->_cache;\n }", "protected function _getCache()\n\t{\n\t\t/**\n\t\t * @todo needs to be adjusted for use with Zend_Cache_Manager\n\t\t */\n\t\treturn self::$_cache;\n\n\t}", "public function getResourceManager()\n {\n if (!$this->resourceManager) {\n $this->resourceManager = new MemcachedResourceManager();\n }\n return $this->resourceManager;\n }", "protected function getCache()\n {\n return $this->cache;\n }", "public function getManager() {\n return $this->manager;\n }", "private function instance()\n\t{\n\t\tif (!$this->instance) {\n\t\t\t$this->instance = new \\Memcache();\n\t\t\t\n\t\t\tforeach ($this->servers as $server) {\n\t\t\t\t$this->instance->addServer(\n\t\t\t\t\t$server->host(),\n\t\t\t\t\t$server->port(),\n\t\t\t\t\t$server->isPersistent(),\n\t\t\t\t\t$server->weight(),\n\t\t\t\t\t$server->timeout(),\n\t\t\t\t\t$server->retryInterval()\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $this->instance;\n\t}", "public static function getCache()\n\t{\n\t if (!self::$cache) {\n\t\t\t$frontendOptions = array('lifetime' => 604800, \n\t\t\t\t\t\t\t\t\t 'automatic_serialization' => true);\n\t\t\t$backendOptions = array('cache_dir' => APPLICATION_PATH . '/../data/cache');\n\t\t\tself::$cache \t = Zend_Cache::factory('Core', 'File', $frontendOptions, $backendOptions);\n\t }\n\t\treturn self::$cache;\n\t}", "public static function getCache()\n {\n return self::$_cache;\n }", "public static function getInstance() {\r\n if (!Website_Service_Cache::$instance instanceof self) {\r\n Website_Service_Cache::$instance = new self();\r\n }\r\n return Website_Service_Cache::$instance;\r\n }", "public function init()\n {\n $manager = $this->getCacheManager();\n Ezy_Cache_Manager::setInstance($manager);\n\n if(isset($_GET['CLEAR_CACHE']) && $_GET['allowme'] == 1){\n $cache = Ezy_Cache_Manager::getInstance()->getCache($_GET['CLEAR_CACHE']);\n $cache->clean(Zend_Cache::CLEANING_MODE_ALL);\n }\n \n return $manager;\n }", "public function getCache()\n\t{\n\t\tif( ! $this->cache_on)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif(isset($this->cache_obj))\n\t\t{\n\t\t\treturn $this->cache_obj;\n\t\t}\n\t\t\n\t\t$class = 'Db_Cache_'.$this->cachedrv;\n\t\t\n\t\t$this->cache_obj = new $class($this->cacheopt);\n\t\t\n\t\treturn $this->cache_obj;\n\t}", "public function getManagedCache()\r\n\t{\r\n\t\tif ($this->managedCache == null)\r\n\t\t\t$this->managedCache = new \\Bitrix\\Main\\Data\\ManagedCache();\r\n\t\treturn $this->managedCache;\r\n\t}" ]
[ "0.8094249", "0.76013684", "0.74770063", "0.72327316", "0.72218835", "0.7214601", "0.71625143", "0.71580964", "0.7146208", "0.70696044", "0.70076454", "0.6980484", "0.6976852", "0.69767827", "0.69588304", "0.69588304", "0.69588304", "0.69519055", "0.69373894", "0.68777776", "0.6857267", "0.68331826", "0.6832489", "0.67834324", "0.67736894", "0.67667735", "0.67405486", "0.673248", "0.6701088", "0.6699728" ]
0.78533554
1
Set the cache manager instance.
public static function setCacheManager($cache) { static::$cache = $cache; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setManager( $manager )\n {\n $this->manager = $manager;\n }", "public function setCache() {\n \n // Set our cache to an instance of Cache\n $this->oCache = Cache::getInstance();\n \n // Return instance\n return $this;\n }", "public function setCache( Zend_Cache $cache ) {\n $this->_cache = $cache;\n }", "public static function setCache($cache) {}", "public function init()\n {\n $manager = $this->getCacheManager();\n Ezy_Cache_Manager::setInstance($manager);\n\n if(isset($_GET['CLEAR_CACHE']) && $_GET['allowme'] == 1){\n $cache = Ezy_Cache_Manager::getInstance()->getCache($_GET['CLEAR_CACHE']);\n $cache->clean(Zend_Cache::CLEANING_MODE_ALL);\n }\n \n return $manager;\n }", "public function useManager(\\Doctrine_Manager $manager)\n {\n $this->settings->set(Doctrine1KnownSettingsEnum::MANAGER, $manager);\n return $this;\n }", "protected function getCacheManager()\n {\n if (!$this->cacheManager) {\n $this->cacheManager = $this->getContainer()->get('fos_http_cache.cache_manager');\n }\n\n return $this->cacheManager;\n }", "public function setCaching($cache);", "public function setCacher(CacheEngine $cacher)\n {\n $this->_cacher = $cacher;\n }", "private function setCache()\n\t{\n\t\t$this->_cache = new Cache('./', array('prefix' => 'pageReader'));\n\t}", "protected function getCacheManager() {}", "protected function getCacheManager() {}", "protected function getLiipImagine_Cache_ManagerService()\n {\n $this->services['liip_imagine.cache.manager'] = $instance = new \\Liip\\ImagineBundle\\Imagine\\Cache\\CacheManager($this->get('liip_imagine.filter.configuration'), $this->get('router'), $this->get('liip_imagine.cache.signer'), $this->get('event_dispatcher'), 'default');\n\n $instance->addResolver('default', $this->get('liip_imagine.cache.resolver.default'));\n $instance->addResolver('no_cache', $this->get('liip_imagine.cache.resolver.no_cache_web_path'));\n\n return $instance;\n }", "private function registerCacheManager()\n {\n $this->app->bind(\n 'CodeZero\\Courier\\Cache\\CacheManager',\n 'CodeZero\\Courier\\Cache\\LaravelCacheManager'\n );\n }", "protected static function getCacheManager() {}", "public function setEntityManager(EntityManagerInterface $manager);", "public function setCache(Db_Cache $cache_object)\n\t{\n\t\t$this->cache_obj = $cache_object;\n\t\t\n\t\treturn $this;\n\t}", "protected function cache(): CacheManager\n {\n $cache = cache();\n if ($cache->supportsTags()) {\n $cache->tags($this->tags);\n }\n\n return $cache;\n }", "public function setCache(Cache $cache)\n {\n $this->cache = $cache;\n $this->annotationReader = new CachedReader(new AnnotationReader(), $this->cache);\n }", "public function setLiipImagineCacheManager(CacheManager $cacheManager)\n {\n $this->liipImagineCacheManager = $cacheManager;\n }", "public static function setCache(Zend_Cache_Core $cache) {\n\t}", "public function setManager(Manager $manager)\n {\n $this->manager = $manager;\n\n return $this;\n }", "public function setCache($cache)\n {\n $this->cache = $cache;\n }", "public function setCache($cache)\n {\n $this->cache = $cache;\n }", "public function setCache($cache)\n {\n $this->cache = $cache;\n }", "public function setCache($cache)\n {\n $this->cache = $cache;\n }", "public function setCache($cache)\n {\n $this->cache = $cache;\n }", "static public function setCache(CacheAbstract $cache = null){\n static::$cache = $cache;\n }", "public static function setCache(Zend_Cache_Core $cache)\n {\n self::$_cache = $cache;\n }", "public function setCache(CacheInterface $cache): void\n {\n $this->cache = $cache;\n }" ]
[ "0.6428454", "0.63055575", "0.6299985", "0.6266025", "0.62029254", "0.6153924", "0.6131992", "0.6082044", "0.6079378", "0.60624725", "0.59687716", "0.59674877", "0.5965505", "0.5912485", "0.589939", "0.5892556", "0.5889972", "0.5887504", "0.588552", "0.58648443", "0.58599263", "0.5831067", "0.582807", "0.582807", "0.582807", "0.582807", "0.582807", "0.5822199", "0.58080214", "0.5796498" ]
0.6834452
0
Unset the cache manager for models.
public static function unsetCacheManager() { static::$cache = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _clearCache() {\n\t\t\tCache::clear(false, '_cake_model_');\n\t\t\tClassRegistry::flush();\n\t\t}", "public function clearCache()\n {\n flush_model_cache($this);\n }", "public static function clearCache(){\n\t\t\n\t\t\\GO::config()->getCacheFolder(false)->delete();\t\t\n\t\t\n\t\t\\GO::cache()->flush();\n\n\t\t\\GO\\Base\\Model::clearCache();\n\t}", "public function dettachCache()\n {\n if (!is_null($this->_cache)) {\n unset($this->_cache);\n }\n }", "public function clearModels();", "public static function reset_caches() {\n self::$instance = null;\n }", "public function clearCache()\n {\n $this->entities = null;\n $this->entitiesAreLoaded = false;\n $this->fields = [];\n\n $em = $this->getEntityManager();\n $em->clear('Oro\\Bundle\\EntityConfigBundle\\Entity\\FieldConfigModel');\n $em->clear('Oro\\Bundle\\EntityConfigBundle\\Entity\\EntityConfigModel');\n }", "protected function invalidateCaches()\n {\n // Forget the 'master' cache\n app('cache')->forget('build.colors.all');\n\n // Forget the individual color caches.\n foreach (Color::all() as $color) {\n app('cache')->forget('build.colors.' . $color->getKey());\n }\n }", "public function removeCache()\n {\n $this->getHttpClientBuilder()->removeCache();\n }", "function reset_caches() {\n \n $this->ext->reset_caches();\n \n }", "public function clearModels()\n {\n $this->_models = array();\n return $this;\n }", "private function __clearCacheModel(\\Model $model) {\n $modelName = get_class($model);\n if (isset($this->__listFiles[$modelName])) {\n foreach ($this->__listFiles[$modelName] as $key => $value) {\n Cache::delete($value);\n }\n }\n }", "public function clearCache()\n {\n $this->userAgentCache->clear();\n $this->deviceCache->clear();\n $this->clientCache->clear();\n }", "public static function cache_delete()\n\t{\n\t\t// Clear any cache for sure\n\t\tCache::instance('modules')->delete_all();\n\t\tCache::instance('menus')->delete_all();\n\t\tCache::instance('widgets')->delete_all();\n\t\tCache::instance('feeds')->delete_all();\n\t\tCache::instance('page')->delete_all();\n\t\tCache::instance('blog')->delete_all();\n\t\tCache::instance('roles')->delete_all();\n\n\t\t// For each cache instance\n\t\tforeach (Cache::$instances as $group => $instance)\n\t\t{\n\t\t\t/** @var $instance Cache */\n\t\t\t$instance->delete_all();\n\t\t}\n\t}", "public function forgetCache();", "protected function _clear_cache() {\n\t\t$this->_attrs = array();\n\t\t$this->_options = array();\n\t}", "protected function clearProxyCache()\n {\n $configuration = Shopware()->Models()->getConfiguration();\n $metaDataCache = $configuration->getMetadataCacheImpl();\n if (method_exists($metaDataCache, 'deleteAll')) {\n $metaDataCache->deleteAll();\n }\n\n // Clear Shopware Proxies\n Shopware()->Hooks()->getProxyFactory()->clearCache();\n\n // Clear classmap\n $classMap = Shopware()->Hooks()->getProxyFactory()->getProxyDir() . 'ClassMap_' . \\Shopware::REVISION . '.php';\n @unlink($classMap);\n\n // Clear Doctrine Proxies\n $files = new GlobIterator(\n $configuration->getProxyDir() . '*.php',\n FilesystemIterator::CURRENT_AS_PATHNAME\n );\n\n foreach ($files as $filePath) {\n @unlink($filePath);\n }\n\n // Clear Anotation file cache\n $files = new GlobIterator(\n $configuration->getFileCacheDir() . '*.php',\n FilesystemIterator::CURRENT_AS_PATHNAME\n );\n\n foreach ($files as $filePath) {\n @unlink($filePath);\n }\n }", "public function clearCache()\n {\n $this->cache->deleteAll();\n }", "private function clearCache() {\n\t\t\n\t\tCore\\Cache::clear();\n\t\t\n\t}", "public static function resetCache()\n\t{\n\t\tTagDependency::invalidate(Yii::$app->cache, static::getCacheTag());\n\t}", "public static function resetCache()\n\t{\n\t\tTagDependency::invalidate(Yii::$app->cache, static::getCacheTag());\n\t}", "public static function clearCache()\n {\n self::$cache = array();\n }", "public function clear_cache(): void;", "public function clear_cache() {\n\t\tif (file_exists($this->cache_path)) {\n\t\t\tunlink($this->cache_path);\n\t\t}\n\t}", "public function clearRelatedCache()\n {\n Cache::forget($this->getCachePrefix());\n $users = $this->getRelatedUsers();\n foreach ($users as $user) {\n $user->clearCachedRoles();\n $user->clearCachedPermissions();\n }\n }", "public function clear () {\n array_map('unlink', glob(CACHE.\"*.cache\"));\n /*\n $files = scandir(CACHE);\n foreach ($files as $file){\n if (pathinfo($file, PATHINFO_EXTENSION) == 'cache') @unlink(CACHE.$file);\n }\n */\n }", "public static function removeCache() {\n\t}", "public function removeCache() {\r\n $files = $this->caches;\r\n while (count($files) > 0) {\r\n @unlink(array_shift($files));\r\n }\r\n\r\n }", "public function clearCache()\n {\n $keys = array_keys($this->cache);\n\n foreach ($keys as $key) {\n unset($this->cache[$key]);\n }\n\n $this->cache = [];\n }", "public function reset() {\n $this->cache = array();\n $this->parent()->reset();\n }" ]
[ "0.6979484", "0.67925805", "0.67106956", "0.6576163", "0.6487907", "0.64638853", "0.63941264", "0.63070506", "0.6282042", "0.6263471", "0.62426007", "0.6231064", "0.61633855", "0.6141962", "0.613829", "0.6118608", "0.6101948", "0.6080217", "0.6071932", "0.60490143", "0.60490143", "0.60485214", "0.6045897", "0.6035205", "0.6029511", "0.6017785", "0.59927756", "0.59863824", "0.5980409", "0.5972718" ]
0.73109895
0
Get the mutated attributes for a given instance.
public function getMutatedAttributes() { $class = get_class($this); if (!isset(static::$mutatorCache[$class])) { static::cacheMutatedAttributes($class); } return static::$mutatorCache[$class]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getMutatedAttributes()\n {\n $class = get_class($this);\n\n if (!isset(static::$mutatorCache[$class]))\n static::cacheMutatedAttributes($class);\n\n return static::$mutatorCache[$class];\n }", "public function getMutatedAttributes()\n {\n $mutAt = $this->cacheMutatedAttributes2($this);\n\n return $mutAt;\n }", "public function getMutatedAttributes()\n {\n $class = static::class;\n\n if (! isset(static::$mutatorCache[$class])) {\n static::cacheMutatedAttributes($class);\n }\n\n return static::$mutatorCache[$class];\n }", "public function getMutatedAttributes()\n {\n $mutatedAttributes = parent::getMutatedAttributes();\n\n $whitelisted = $this->withoutMutators;\n if ( is_array($whitelisted) ){\n return array_intersect($whitelisted, $mutatedAttributes);\n }\n\n return $mutatedAttributes;\n }", "public static function attributes()\n {\n $class = self::loadDelegationClass();\n \n return call_user_func($class.'::attributes');\n }", "public function getAttributes()\n {\n $this->attributes['id'] = $this->getId();\n\n return $this->attributes;\n }", "public function getAttributes() {\n return array_merge($this->getFields(), $this->getProperties());\n }", "function attributes() {\n\t\t$this->load_attributes();\n\t\treturn $this->_attributes;\n\t}", "public function attributes() { return $this->attributes; }", "public static function cacheMutatedAttributes($class)\n {\n $mutatedAttributes = [];\n\n // Here we will extract all of the mutated attributes so that we can quickly\n // spin through them after we export models to their array form, which we\n // need to be fast. This'll let us know the attributes that can mutate.\n if (preg_match_all('/(?<=^|;)get([^;]+?)Attribute(;|$)/', implode(';', get_class_methods($class)), $matches)) {\n foreach ($matches[1] as $match) {\n if (static::$snakeAttributes) {\n $match = Str::snake($match);\n $match = lcfirst($match);\n } elseif (($match = lcfirst($match)) != ($snake = Str::snake($match))) {\n $mutatedAttributes[] = $snake;\n }\n\n $mutatedAttributes[] = $match;\n }\n }\n\n static::$mutatorCache[$class] = $mutatedAttributes;\n }", "public function getAttributes()\n {\n return $this->attributes;\n }", "public function getAttributes()\n {\n return $this->attributes;\n }", "public function getAttributes()\n {\n return $this->attributes;\n }", "public function getAttributes()\n {\n return $this->attributes;\n }", "public function getAttributes()\n {\n return $this->attributes;\n }", "public function getAttributes()\n {\n return $this->attributes;\n }", "public function getAttributes()\n {\n return $this->attributes;\n }", "public function getAttributes()\n {\n return $this->attributes;\n }", "public function getAttributes()\n {\n return $this->attributes;\n }", "public function getAttributes()\n {\n return $this->attributes;\n }", "public function getAttributes()\n {\n return $this->attributes;\n }", "public function getAttributes()\n {\n return $this->attributes;\n }", "public function getAttributes()\n {\n return $this->attributes;\n }", "public function getAttributes()\n {\n return $this->attributes;\n }", "public function getAttributes()\n {\n return $this->attributes;\n }", "public function getAttributes()\n {\n return $this->attributes;\n }", "public function getAttributes()\n {\n return $this->attributes;\n }", "public function getAttributes()\n {\n return $this->attributes;\n }", "public function getAttributes()\n {\n return $this->attributes;\n }", "public function getAttributes()\n {\n return $this->attributes;\n }" ]
[ "0.8180421", "0.7936646", "0.7774545", "0.72141427", "0.6458633", "0.6380718", "0.6332305", "0.6315623", "0.63148695", "0.6247602", "0.6207506", "0.6207506", "0.6207506", "0.6207506", "0.6207506", "0.6207506", "0.6207506", "0.6207506", "0.6207506", "0.6207506", "0.6207506", "0.6207506", "0.6207506", "0.6207506", "0.6207506", "0.6207506", "0.6207506", "0.6207506", "0.6207506", "0.6207506" ]
0.81447494
1
Extract and cache all the mutated attributes of a class.
public static function cacheMutatedAttributes($class) { $mutatedAttributes = []; // Here we will extract all of the mutated attributes so that we can quickly // spin through them after we export models to their array form, which we // need to be fast. This'll let us know the attributes that can mutate. if (preg_match_all('/(?<=^|;)get([^;]+?)Attribute(;|$)/', implode(';', get_class_methods($class)), $matches)) { foreach ($matches[1] as $match) { $mutatedAttributes[] = lcfirst($match); } } static::$mutatorCache[$class] = $mutatedAttributes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function cacheMutatedAttributes($class)\n {\n $mutatedAttributes = [];\n\n // Here we will extract all of the mutated attributes so that we can quickly\n // spin through them after we export models to their array form, which we\n // need to be fast. This'll let us know the attributes that can mutate.\n if (preg_match_all('/(?<=^|;)get([^;]+?)Attribute(;|$)/', implode(';', get_class_methods($class)), $matches)) {\n foreach ($matches[1] as $match) {\n if (static::$snakeAttributes) {\n $match = Str::snake($match);\n $match = lcfirst($match);\n } elseif (($match = lcfirst($match)) != ($snake = Str::snake($match))) {\n $mutatedAttributes[] = $snake;\n }\n\n $mutatedAttributes[] = $match;\n }\n }\n\n static::$mutatorCache[$class] = $mutatedAttributes;\n }", "public function getMutatedAttributes()\n {\n $class = get_class($this);\n\n if (!isset(static::$mutatorCache[$class]))\n static::cacheMutatedAttributes($class);\n\n return static::$mutatorCache[$class];\n }", "public function getMutatedAttributes()\n {\n $class = get_class($this);\n\n if (!isset(static::$mutatorCache[$class])) {\n static::cacheMutatedAttributes($class);\n }\n\n return static::$mutatorCache[$class];\n }", "public static function cacheMutatedAttributes($class)\n {\n $mutatedAttributes = [];\n\n if (preg_match_all('/(?<=^|;)get([^;]+?)Attribute(;|$)/', implode(';', get_class_methods($class)), $matches))\n {\n foreach ($matches[1] as $match)\n {\n if (static::$snakeAttributes)\n $match = Str::snake($match);\n\n $mutatedAttributes[] = lcfirst($match);\n }\n }\n\n static::$mutatorCache[$class] = $mutatedAttributes;\n }", "public function getMutatedAttributes()\n {\n $class = static::class;\n\n if (! isset(static::$mutatorCache[$class])) {\n static::cacheMutatedAttributes($class);\n }\n\n return static::$mutatorCache[$class];\n }", "public function getMutatedAttributes()\n {\n $mutAt = $this->cacheMutatedAttributes2($this);\n\n return $mutAt;\n }", "public static function cacheMutatedAttributes($classOrInstance)\n {\n parent::cacheMutatedAttributes($classOrInstance);\n\n $reflection = new ReflectionClass($classOrInstance);\n\n $class = $reflection->getName();\n\n if (property_exists($class, config('mutators.accessors_property'))) {\n static::$mutatorCache[$class] = array_merge(static::$mutatorCache[$class], array_keys(with(new $class())->{config('mutators.accessors_property')}));\n }\n }", "public function cacheMutatedAttributes2($obj)\n {\n return collect(static::getMutatorMethods2($obj))->map(function ($match) {\n return lcfirst(static::$snakeAttributes ? Str::snake($match) : $match);\n })->all();\n }", "public function getMutatedAttributes()\n {\n $mutatedAttributes = parent::getMutatedAttributes();\n\n $whitelisted = $this->withoutMutators;\n if ( is_array($whitelisted) ){\n return array_intersect($whitelisted, $mutatedAttributes);\n }\n\n return $mutatedAttributes;\n }", "protected function collect_attributes() {\n\t\tforeach ( $this->properties as $key => $val ) {\n\t\t\tif ( in_array($key, self::$global_attributes) || in_array($key, static::$element_attributes) ) {\n\t\t\t\t$this->attributes[ $key ] = $val;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// also check for compound attributes, such as data-src, aria-required, etc.\n\t\t\tforeach ( self::$global_attribute_pattern_prefixes as $prefix ) {\n\t\t\t\tif ( preg_match( '/'. $prefix .'[-]\\w+/', $key ) ) {\n\t\t\t\t\t$this->attributes[ $key ] = $val;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function getAllAtributes() {\r\n $class = get_class($this->getInvoker());\r\n return mdAttributeHandler::getAllAttributes($class);\r\n }", "function attributes() {\n\t\t$this->load_attributes();\n\t\treturn $this->_attributes;\n\t}", "public static function attributes()\n {\n $class = self::loadDelegationClass();\n \n return call_user_func($class.'::attributes');\n }", "public function attributes(){\r\n /*\r\n $attributes = array();\r\n foreach(self::$db_fields as $field){\r\n if(property_exists($this, $field)){\r\n\t $attributes[$field] = $this->$field;\r\n\t }\r\n }\r\n return $attributes;\r\n */\r\n \r\n //return get_object_vars($this);\r\n return $this->variables;\r\n }", "public function getAttributes() {\n\t\tif(NULL === $this->cachedAttributes) {\n\t\t\t$this->cachedAttributes = [];\n\t\t\tforeach($this->PDO->select(\"SELECT\n SKY_USER_ATTRIBUTE.id,\n valueType,\n SKY_USER_ATTRIBUTE.name,\n SKY_USER_ATTRIBUTE.description,\n icon,\n multiple,\n enabled,\n SKY_USER_ATTRIBUTE_GROUP.name as groupName,\n SKY_USER_ATTRIBUTE_GROUP.description as groupDescription,\n SKY_USER_ATTRIBUTE_GROUP.id as gid\nFROM SKY_USER_ATTRIBUTE\nLEFT JOIN SKY_USER_ATTRIBUTE_GROUP on attr_group = SKY_USER_ATTRIBUTE_GROUP.id\nORDER BY indexing, name\") as $record) {\n\t\t\t\t$attr = AbstractAttribute::create($record);\n\t\t\t\tif ($attr) {\n\t\t\t\t\t$this->cachedAttributes[$record[\"id\"] * 1] = $attr;\n\t\t\t\t\t$this->attributeName2ID[strtolower($record[\"name\"])] = $record[\"id\"] * 1;\n\n\t\t\t\t\tif($gid = $record[\"gid\"]) {\n\t\t\t\t\t\t$this->cachedAttributeGroups[$gid*1][\"name\"] = $name = $record[\"groupName\"];\n\t\t\t\t\t\t$this->cachedAttributeGroups[$gid*1][\"description\"] = $record[\"groupDescription\"];\n\t\t\t\t\t\t$this->cachedAttributeGroupNames2ID[strtolower($name)] = $gid*1;\n\t\t\t\t\t\t$this->attribute2Group[$attr->getId()] = $gid*1;\n\t\t\t\t\t\t$this->group2Attribute[$gid*1][] = $attr->getId();\n\t\t\t\t\t}\n\t\t\t\t} else\n\t\t\t\t\ttrigger_error(\"Can not create user attribute {$record[\"name\"]}\", E_USER_NOTICE);\n\t\t\t}\n\t\t}\n\t\treturn $this->cachedAttributes;\n\t}", "public function getAttributes() {\n return array_merge($this->getFields(), $this->getProperties());\n }", "private function getAttributes(string $class)\n {\n $reflection = new ReflectionClass($class);\n return $reflection->getAttributes();\n }", "public function getAttributes(): array\n {\n // Get all attributes using all the getters.\n $attributes = [];\n foreach(\\array_keys(\\get_object_vars($this)) as $attribute) {\n\n // Construct the getter name.\n $getter = \\lcfirst(\\str_replace('_', '', \\ucwords($attribute, '_')));\n\n // Get the attribute's value from the getter.\n $attributes[$attribute] = $this->{$getter}();\n }\n\n return $attributes;\n }", "public function attributesToArray()\n {\n $attributes = $this->attributes;\n\n $mutatedAttributes = $this->getMutatedAttributes();\n\n // We want to spin through all the mutated attributes for this model and call\n // the mutator for the attribute. We cache off every mutated attributes so\n // we don't have to constantly check on attributes that actually change.\n foreach ($mutatedAttributes as $key) {\n if (!array_key_exists($key, $attributes)) {\n continue;\n }\n\n $attributes[$key] = $this->mutateAttributeForArray(\n $key, $attributes[$key]\n );\n }\n\n // Here we will grab all of the appended, calculated attributes to this model\n // as these attributes are not really in the attributes array, but are run\n // when we need to array or JSON the model for convenience to the coder.\n foreach ($this->getArrayableAppends() as $key) {\n $attributes[$key] = $this->mutateAttributeForArray($key, null);\n }\n\n return $attributes;\n }", "public function getAttributes()\n {\n $return = [];\n foreach ($this->attr as $attr => $info) {\n $return[$attr] = $this->getAttribute($attr);\n }\n\n return $return;\n }", "protected function attributes() {\n $attributes = array();\n foreach(static::$db_fields as $field) {\n if(property_exists($this, $field)) {\n $attributes[$field] = $this->$field;\n }\n }\n return $attributes;\n }", "public function getSettersFromClass($class){\n \t\t$class = new $class;\n \t\treturn $class->getSetters();\n }", "public function getAttributes()\n {\n return collect(parent::getAttributes())\n ->except(array_keys($this->fieldAttributes()))\n ->toArray();\n }", "protected function attributes() {\n\t $attributes = array();\n\t foreach(static::$table_fields as $field) {\n\t if(property_exists( $this, $field)) {\n\t $attributes[$field] = $this->$field;\n\t }\n\t }\n\t return $attributes;\n }", "public function getAttributes() {}", "public function getAttributes() {}", "protected function getAttributeSavedMethods()\n {\n $attributes = [];\n foreach($this->getDirty() as $attribute => $value) {\n if($this->hasAttributeSavedMethod($attribute)) {\n $attributes[] = $attribute;\n }\n }\n return $attributes;\n }", "private function &getSerializableAttributeTypesFromCache(): array {\n $key = \\get_class($this);\n if (!isset(self::$__attrTypeCache[$key])) {\n self::$__attrTypeCache[$key] = $this->getSerializableAttributeTypes();\n }\n return self::$__attrTypeCache[$key];\n }", "public function getAttributes()\n {\n return array_merge(\n $this->attributes,\n [\n 'args' => $this->args(),\n 'type' => $this->type(),\n 'resolve' => $this->getResolver(),\n ]\n );\n }", "protected function attributes() {\n\t\t$attributes = array();\n\t\tforeach (self::$db_fields as $field) {\n\t\t\tif (property_exists($this, $field)) {\n\t\t\t\t$attributes[$field] = $this->$field;\n\t\t\t}\n\t\t}\n\t\treturn $attributes;\n\t}" ]
[ "0.79108083", "0.76778585", "0.7668186", "0.7661906", "0.74005735", "0.69607615", "0.6657722", "0.6311943", "0.6294863", "0.6174845", "0.6158515", "0.6082689", "0.60549265", "0.60042226", "0.5920544", "0.58771735", "0.5847044", "0.57913285", "0.5782104", "0.5662671", "0.56579363", "0.56486344", "0.5639716", "0.56193054", "0.56141156", "0.5611662", "0.5605164", "0.5577755", "0.55710846", "0.5570088" ]
0.79209965
0
Update Gal Image Caption
public function updateGalCaption($galImageID) { // Get user input $caption = $_POST['caption']; // Update DB $this->db->update('galImage', array('caption' => $caption), "`galImageID` = ".$galImageID); echo json_encode(array('error' => false)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function image_add_caption($html, $id, $caption, $title, $align, $url, $size, $alt = '')\n {\n }", "public function actionUpdateImageCaption() \r\n {\r\n extract($_POST);\r\n $res=0;\r\n \r\n\r\n $fileMaster= FileMaster::model()->findByPk($id);\r\n $fileMaster->Title = $caption;\r\n if($fileMaster->save()) $res=1;\r\n else print_r( $fileMaster->getErrors() );\r\n print CJSON::encode($res);\r\n }", "function wpse_74735_caption_shortcode( $attr, $content = NULL )\n{\n $caption = img_caption_shortcode( $attr, $content );\n $caption = str_replace( '<p class=\"wp-caption\"></p>', '<span class=\"wp-caption-text my_new_class', $caption );\n return $caption;\n}", "function _cleanup_image_add_caption($matches)\n {\n }", "function setCaption($cap) {\n\t\t$this->lobSub->lobCaption = $cap;\n\t}", "function set_caption($alt, $title, $iptc_caption, $filename)\n {\n $values = array($this->_params->get('caption_type_iptc') => $iptc_caption,\n $this->_params->get('caption_type_filename') => $filename,\n $this->_params->get('caption_type_title') => $title,\n $this->_params->get('caption_type_alt') => $alt);\n\n ksort($values);\n $caption = '';\n foreach ($values as $key => $val) {\n if ($key and $val) {\n $caption = $val;\n break;\n }\n }\n\n\n return $caption;\n }", "function getModifyCaption() \r\n \t{\r\n \t\treturn '';\r\n \t}", "private function addCaption(string $script, PhotoswipeConfig $config): string\n {\n if (false === $config->hasCaption()) {\n // Remove the caption placeholder from the lightbox script\n return str_replace('[[PSWP_CAPTION]]', '', $script);\n }\n\n $captionScript = <<<'CAPTION'\n // Adding new caption element .pswp--caption at the end of the photoswipe container\n [[PSWP_LIGHTBOX]].on('uiRegister', function() {\n [[PSWP_LIGHTBOX]].pswp.ui.registerElement({\n name: 'caption',\n order: 9,\n isButton: false,\n appendTo: 'root',\n html: 'Caption text',\n onInit: (el, pswp) => {\n [[PSWP_LIGHTBOX]].pswp.on('change', () => {\n const currSlideElement = [[PSWP_LIGHTBOX]].pswp.currSlide.data.element;\n let captionHTML = '';\n if (currSlideElement) {\n const caption = currSlideElement.querySelector('figcaption');\n if (caption) {\n captionHTML = caption.innerHTML;\n } else {\n captionHTML = currSlideElement.querySelector('img').getAttribute('alt');\n }\n }\n el.innerHTML = captionHTML || '';\n });\n }\n });\n });\n CAPTION;\n\n return str_replace('[[PSWP_CAPTION]]', $captionScript, $script);\n }", "function set_caption($caption)\n\t{\n\t\t$this->caption = $caption;\n\t}", "public function getCaption() {}", "function thb_album_cover_metabox_title( $translated_text, $text, $domain ) {\n\tif ( thb_is_admin_template( thb_get_theme_templates( 'gallery' ) ) ) {\n\t\tif ( $text == 'Featured Image' ) {\n\t\t\t$translated_text = __( 'Album cover', 'thb_text_domain' );\n\t\t}\n\t}\n\n\treturn $translated_text;\n}", "private function getCaption()\n\t{\n\t\t$buffer = '';\n\t\t\n\t\tif(!$this->aImg['sFilename'])\n\t\t\treturn $buffer;\n\t\t\n\t\t// button\n\t\t$link = $this->getCaptionButton();\n\t\t\n\t\t// caption\t\t\n\t\t$buffer .= '<textarea class=\"TextareaDisable\" disabled=\"disabled\">';\n\t\t$buffer .= stripslashes($this->aImg['sCaption']);\n\t\t$buffer .= '</textarea>';\n\t\t$buffer .= '<br /><br />';\n\t\t\t\n\t\t$buffer .= $link;\t\t\t\n\t\treturn $buffer;\t\t\n\t}", "public function get_description()\n {\n return 'Populate your image of the day gallery with 40 LOLCAT images. After installing the addon select the image of the day in the usual way by going to Admin zone > Content > Images of the day and select the image you want to display.';\n }", "public function addCaption($text)\n {\n $this->captionCount++;\n $this->captionStarted = $this->timer->elapsedAsSubripTime();\n $this->captionText = $text;\n }", "public static function edit_image()\n{\n\n\n\t/*\n\t* Change Background\n\t*/\n\n\t/*\n\t* Change other setting\n\t*/\n}", "function default_image_options() {\n update_option('image_default_align', 'center' );\n update_option('image_default_size', 'medium' );\n}", "function update_image_size_options() {\n\tupdate_option( 'thumbnail_size_w', 160 );\n\tupdate_option( 'thumbnail_size_h', 160 );\n\tupdate_option( 'thumbnail_crop', 1 );\n\tupdate_option( 'medium_size_w', 320 );\n\tupdate_option( 'medium_size_h', 9999 );\n\tupdate_option( 'medium_large_size_w', 512 ); // Assign this but usually not used.\n\tupdate_option( 'medium_large_size_h', 9999 );\n\tupdate_option( 'large_size_w', 768 );\n\tupdate_option( 'large_size_h', 9999 );\n}", "function custom_send_image_to_editor( $html, $id, $caption, $title, $align, $url, $size, $alt ) {\n\n\t$url = wp_get_attachment_url($id);\n\n\t$html_str = '<div class=\"align-' . esc_attr($align) . '\">';\n\n \t\t$html_str .= \"<p><img src='$url' alt='$title' /></p>\";\n\n\t\tif($caption) $html_str .= '\n\t\t<p class=\"wp-caption-text\">' . $caption . '</p>\n\t\t';\n\n\t$html_str .= '</div>';\n\n return $html_str;\n}", "function wpse_74735_replace_wp_caption_shortcode() {\n remove_shortcode( 'caption', 'img_caption_shortcode' );\n remove_shortcode( 'wp_caption', 'img_caption_shortcode' );\n add_shortcode( 'caption', 'wpse_74735_caption_shortcode' );\n add_shortcode( 'wp_caption', 'wpse_74735_caption_shortcode' );\n}", "function dblions_desc_img() {\n\t$img = esc_attr( get_option( 'desc_img' ) );\n\tcreate_input_field( array(\n\t\t\t'upload-btn', '', 'button', 'Upload Picture', \n\t\t\t'', 'button button-secondary'\n\t\t) );\n\tcreate_input_field( array(\n\t\t\t'desc-img', 'desc_img', \n\t\t\t'hidden', $img, '', ''\n\t\t) );\n}", "function get_caption($image) {\n\treturn $image->post_excerpt;\n}", "public function getCaption()\n {\n return $this->originalAsset->getCaption();\n }", "function editor_insert_image($html, $id, $caption, $title, $align, $url, $size) {\r\n\tlist($imgsrc) = image_downsize($id, 'hero-review');\r\n//\tlist($imgsrc) = image_downsize($id, $size);\r\n\r\n\t$html = \"<div class=\\\"photo-gallery\\\">\";\r\n\t$html .= \"<img src=\\\"$imgsrc\\\" alt=\\\"$caption\\\">\";\r\n\tif ($caption) {\r\n\t\t$html .= \"<div class=\\\"caption\\\">$caption</div>\";\r\n\t}\r\n\t$html .= \"</div><!-- photo-gallery -->\";\r\n\treturn $html;\r\n}", "function getCaption() {return $this->readCaption();}", "function get_caption($filepath) {\n // first look for a caption file in the same dir as the image\n include(\"set_paths.php\");\n\n if ( is_readable(\"$filepath.caption\") ) { \n $captionfile = \"$filepath.caption\" ; \n }\n elseif ( is_readable($imagedata/$filepath.caption\") ) {\n $captionfile = \"$imagedata/$filepath.caption\" ; \n }\n else return; \n \n $caption = file_get_contents($captionfile);\n $caption = htmlentities($caption);\n \n return $caption;\n}", "function _tts_preprocess_p_img_big(&$vars){\n $alt = (isset($vars['content']['field_img'][0]['#item']['title'])\n && !empty($vars['content']['field_img'][0]['#item']['title'])\n ? $vars['content']['field_img'][0]['#item']['title'] . ' - '\n : '') . 'Serramenti Torino';\n $vars['content']['field_img'][0]['#item']['alt'] = $alt;\n \n \n if ($vars['view_mode'] == 'full'){\n $vars['content']['field_img'] = array(\n '#prefix' => '<div class=\"wrapper-p-img margin-b-1\">',\n '#suffix' => '</div>',\n 'data' => $vars['content']['field_img'][0],\n );\n\n //_tts_add_fancy_svg($vars);\n\n if (isset($vars['content']['field_img']['data']['#item']['title']) && $vars['content']['field_img']['data']['#item']['title']!== ''){\n $title = $vars['content']['field_img']['data']['#item']['title'];\n $vars['content']['field_img']['desc'] = array(\n '#prefix' => '<div class=\"margin-t-05 margin-sm-h-2\"><p class=\"small\">',\n '#suffix' => '</p></div>',\n '#markup' => $title,\n '#weight' => 2,\n );\n }\n }\n}", "private function updateImgThumbnail(): void\n {\n //====================================================================//\n // Load Object Images List\n $allImages = Image::getImages(\n SLM::getDefaultLangId(),\n $this->ProductId,\n null,\n Shop::getContextShopID(true)\n );\n //====================================================================//\n // Walk on Object Images List\n foreach ($allImages as $image) {\n $imageObj = new Image($image['id_image']);\n $imagePath = _PS_PROD_IMG_DIR_.$imageObj->getExistingImgPath();\n if (!file_exists($imagePath.'.jpg')) {\n continue;\n }\n foreach (ImageType::getImagesTypes(\"products\") as $imageType) {\n $imgThumb = _PS_PROD_IMG_DIR_.$imageObj->getExistingImgPath();\n $imgThumb .= '-'.Tools::stripslashes($imageType['name']).'.jpg';\n if (!file_exists($imgThumb)) {\n ImageManager::resize(\n $imagePath.'.jpg',\n $imgThumb,\n (int)($imageType['width']),\n (int)($imageType['height'])\n );\n }\n }\n }\n }", "function dcwd_set_image_meta_upon_image_upload( $post_ID ) {\n\tif ( wp_attachment_is_image( $post_ID ) ) {\n\t\t$my_image_title = get_post( $post_ID )->post_title;\n\t\t$my_image_title = dcwd_title_to_words( $my_image_title );\n\t\t// Create an array with the image meta (Title, Caption, Description) to be updated\n\t\t// Note: comment out the Excerpt/Caption or Content/Description lines if not needed\n\t\t$my_image_meta = array(\n\t\t\t'ID' => $post_ID,\t\t\t// Specify the image (ID) to be updated\n\t\t\t'post_title' => $my_image_title,\t\t// Set image Title to sanitized title\n\t\t\t// Damien: Omit setting the caption as I rarely use captions when I insert images.\n\t\t\t//'post_excerpt' => $my_image_title,\t\t// Set image Caption (Excerpt) to sanitized title\n\t\t\t'post_content' => $my_image_title,\t\t// Set image Description (Content) to sanitized title\n\t\t);\n\t\t// Set the image Alt-Text\n\t\tupdate_post_meta( $post_ID, '_wp_attachment_image_alt', $my_image_title );\n\t\t// Set the image meta (e.g. Title, Excerpt, Content)\n\t\twp_update_post( $my_image_meta );\n\t} \n}", "private function updateImgThumbnail()\n {\n //====================================================================//\n // Load Object Images List\n foreach (Image::getImages(SLM::getDefaultLangId(), $this->ProductId) as $image) {\n $imageObj = new Image($image['id_image']);\n $imagePath = _PS_PROD_IMG_DIR_.$imageObj->getExistingImgPath();\n if (!file_exists($imagePath.'.jpg')) {\n continue;\n }\n foreach (ImageType::getImagesTypes(\"products\") as $imageType) {\n $imgThumb = _PS_PROD_IMG_DIR_.$imageObj->getExistingImgPath();\n $imgThumb .= '-'.Tools::stripslashes($imageType['name']).'.jpg';\n if (!file_exists($imgThumb)) {\n ImageManager::resize(\n $imagePath.'.jpg',\n $imgThumb,\n (int)($imageType['width']),\n (int)($imageType['height'])\n );\n }\n }\n }\n }", "protected function fetchFullTextImage(){\n $this->imageFullText = $this->getImageTypeFromImages('full');\n }" ]
[ "0.6862487", "0.65053725", "0.62238157", "0.61842364", "0.60865736", "0.6045289", "0.59946823", "0.59423345", "0.57884777", "0.57455033", "0.57424396", "0.57090324", "0.5696177", "0.5695939", "0.5677674", "0.564076", "0.56226057", "0.55413264", "0.5514369", "0.55143183", "0.5493023", "0.54710215", "0.54689837", "0.54569644", "0.5447279", "0.544087", "0.5430949", "0.5421838", "0.54212093", "0.54201084" ]
0.6788886
1
Generated from protobuf field repeated .grafeas.v1.Subject subject = 2;
public function setSubject($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Grafeas\V1\Subject::class); $this->subject = $arr; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setSubject($var)\n {\n GPBUtil::checkString($var, True);\n $this->subject = $var;\n\n return $this;\n }", "public function setSubject($var)\n {\n GPBUtil::checkString($var, True);\n $this->subject = $var;\n\n return $this;\n }", "function Subject( $subject )\r\n\t\t{\r\n//echo \"$subject\";\r\n\t\t$this->msubject = \"=?utf-8?B?\"\r\n\t\t\t. base64_encode( strtr( $subject, \"\\r\\n\" , \" \" ) )\r\n\t\t\t. \"?=\";\r\n\t\t}", "public function setSubject($subject);", "public function setSubject($subject);", "public function setSubject($subject);", "public function getSubject();", "public function getSubject();", "public function getSubject();", "public function getSubject();", "public function getSubject();", "public function getSubject();", "public function getSubject();", "public function getSubject() \r\n { \r\n return $this->_subject; \r\n }", "public function getSubject(): string;", "function setSubject($subject) {\n $this->fields['subject'] = $subject;\n return $this;\n }", "function getSubject(){\n\t\t\treturn $this->subject;\n\t\t}", "public function getSubject()\n {\n }", "public function getSubject()\n {\n return $this->subject;\n }", "public function getSubject()\n {\n return $this->subject;\n }", "public function getSubject()\n {\n return $this->subject;\n }", "public function getSubject()\n {\n return $this->subject;\n }", "public function getSubject()\n {\n return $this->subject;\n }", "public function getSubject()\n {\n return $this->subject;\n }", "public function getSubject()\n {\n return $this->subject;\n }", "public function getSubject()\n {\n return $this->subject;\n }", "public function getSubject()\n {\n return $this->subject;\n }", "public function getSubject()\n {\n return $this->subject;\n }", "public function getSubject()\n {\n return $this->subject;\n }", "public function getSubject()\n {\n return $this->subject;\n }" ]
[ "0.67051154", "0.67051154", "0.62397915", "0.61822516", "0.61822516", "0.61822516", "0.61764055", "0.61764055", "0.61764055", "0.61764055", "0.61764055", "0.61764055", "0.61764055", "0.6152795", "0.6084841", "0.6022674", "0.6022352", "0.60057884", "0.5988485", "0.5988485", "0.5988485", "0.5988485", "0.5988485", "0.5988485", "0.5988485", "0.5988485", "0.5988485", "0.5988485", "0.5988485", "0.5988485" ]
0.7399568
0
` for SlsaProvenance. Generated from protobuf field string predicate_type = 3;
public function getPredicateType() { return $this->predicate_type; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getXsiTypeName() {\n return \"Predicate\";\n }", "public function setPredicateType($var)\n {\n GPBUtil::checkString($var, True);\n $this->predicate_type = $var;\n\n return $this;\n }", "public function getSlsaProvenance()\n {\n return $this->readOneof(5);\n }", "public function setSlsaProvenance($var)\n {\n GPBUtil::checkMessage($var, \\Grafeas\\V1\\SlsaProvenance::class);\n $this->writeOneof(5, $var);\n\n return $this;\n }", "public function getXsiTypeName() {\n return \"Predicate.Operator\";\n }", "public function getPredicate();", "function lib4ridora_construct_publication_type_filter($form_state) {\n // Collect the selected values.\n $genres = array();\n foreach ($form_state['values']['pub_type'] as $genre) {\n if ($genre) {\n $genres[] = $genre;\n }\n }\n\n // Exit early if no check box was selected.\n if (empty($genres)) {\n return \"\";\n }\n\n module_load_include(\"inc\", \"islandora_solr\", \"includes/utilities\");\n $publication_type_field = islandora_solr_lesser_escape(variable_get('lib4ridora_solr_field_publication_type', 'mods_genre_ms'));\n\n $field_names = array_fill(0, count($genres), $publication_type_field);\n\n $filters = array_map(\"lib4ridora_construct_solr_statement\", $field_names, $genres);\n\n return lib4ridora_construct_filter_string_from_array($filters);\n}", "function get_predicate_literal_counts(){\n\t\n\tGLOBAL $cmd_pre;\n\tGLOBAL $cmd_post;\n\t\n\t$qry = \"select ?p (COUNT(?o) AS ?c) where { graph ?g { ?s ?p ?o . FILTER isLiteral(?o) . } FILTER regex(?g, \\\"bio2rdf\\\") } ORDER BY DESC(?c)\";\n\t\n\t$cmd = $cmd_pre.$qry.$cmd_post;\n\t\n\t$out = \"\";\n\t\n\ttry {\n\t\t$out = execute_isql_command($cmd);\n\t} catch (Exception $e){\n\t\techo 'iSQL error: ' .$e->getMessage();\n\t\treturn null;\n\t}\n\t\n\t$split_results = explode(\"Type HELP; for help and EXIT; to exit.\\n\", $out);\n\t$split_results_2 = explode(\"\\n\\n\", $split_results[1]);\n\t$results = trim($split_results_2[0]);\n\t\n\tif (preg_match(\"/^0 Rows./is\", $results) === 0) {\t\t\t\n\t\t$results_arr = array();\n\t\t\n\t\t$lines = explode(\"\\n\", $results);\n\t\tforeach($lines as $line){\n\t\t\t\t$split_line = preg_split('/[[:space:]]+/', $line);\n\t\t\t\t$results_arr[$split_line[0]] = $split_line[1];\n\t\t}\n\n\t\treturn $results_arr;\n\t} else {\n\t\t\treturn null;\n\t}\n}", "public function predicate() {\n\t\t\treturn $this->predicate;\n\t\t}", "private function processSentence($type) {\n for ($i = 0; $i < $this->queryManager->length; $i++) {\n if ($this->queryManager->isValidPosition($i)) {\n switch ($type) {\n case 'what':\n $this->processModifier($this->context->dictionary->get(RestoDictionary::QUANTITY_MODIFIER, $this->queryManager->words[$i]['word']), $this->whatProcessor, $i);\n break;\n case 'when':\n $this->processModifier($this->context->dictionary->get(RestoDictionary::TIME_MODIFIER, $this->queryManager->words[$i]['word']), $this->whenProcessor, $i);\n break;\n case 'where':\n $this->processModifier($this->context->dictionary->get(RestoDictionary::LOCATION_MODIFIER, $this->queryManager->words[$i]['word']), $this->whereProcessor, $i);\n break;\n }\n }\n }\n }", "function get_unique_subject_predicate_unique_object_literal_counts(){\n\t\n\tGLOBAL $cmd_pre;\n\tGLOBAL $cmd_post;\n\t\n\t$qry = \"select ?p COUNT(DISTINCT ?s) COUNT(DISTINCT ?o) where { graph ?g { ?s ?p ?o . FILTER isLiteral(?o) } FILTER regex(?g, \\\"bio2rdf\\\") }\";\n\t\n\t$cmd = $cmd_pre.$qry.$cmd_post;\n\t\n\t$out = \"\";\n\t\n\ttry {\n\t\t$out = execute_isql_command($cmd);\n\t} catch (Exception $e){\n\t\techo 'iSQL error: ' .$e->getMessage();\n\t\treturn null;\n\t}\n\t\n\t$split_results = explode(\"Type HELP; for help and EXIT; to exit.\\n\", $out);\n\t$split_results_2 = explode(\"\\n\\n\", $split_results[1]);\n\t\n\t$results = trim($split_results_2[0]);\n\t\n\tif (preg_match(\"/^0 Rows./is\", $results) === 0) {\t\n\t\t$results_arr = array();\n\t\t\n\t\t$lines = explode(\"\\n\", $results);\n\t\tforeach($lines as $line){\n\t\t\t\t$split_line = preg_split('/[[:space:]]+/', $line);\n\t\t\t\t$results_arr[$split_line[0]][\"count\"][\"subject_count\"] = $split_line[1];\n\t\t\t\t$results_arr[$split_line[0]][\"count\"][\"object_count\"] = $split_line[2];\n\t\t}\n\n\t\treturn $results_arr;\n\t} else {\n\t\treturn null;\n\t}\n\t\n}", "protected final function _type_from_payload ($payload) {\n return 'flg_'.$payload->name();\n }", "public function setPredicate(MString $predicate = null) {\n\t\t\t$this->predicate = $predicate;\n\t\t}", "public function getProvenance()\n {\n return $this->readOneof(4);\n }", "function get_des_predicate($itemUUID){\n\t\t$output = \"\";\n\t\t$db = $this->startDB();\n\t\t\n\t\t$sql = \"SELECT obs.subject_uuid, lo.labelVarUUID\n\t\tFROM observe AS obs\n\t\tJOIN properties AS props ON obs.property_uuid = props.property_uuid\n\t\tJOIN labeling_options AS lo ON lo.labelVarUUID = props.variable_uuid\n\t\tWHERE obs.subject_uuid = '$itemUUID'\n\t\tLIMIT 1;\n\t\t\";\n\t\t\n\t\t$result = $db->fetchAll($sql);\n\t\tif($result){\n\t\t\t$output = $result[0]['labelVarUUID'];\n\t\t}\n\t\treturn $output;\n\t}", "public function getType()\n {\n return \"publication\";\n }", "function _addToInference($statement)\r\n\t{\r\n\t\t$predicateLabel=$statement->getLabelPredicate();\r\n\t\t//get the position of the the statement in the model\r\n\t\tend($this->triples);\r\n\t\t$statementPosition=key($this->triples);\r\n\t\t\r\n\t\tswitch ($predicateLabel)\r\n\t\t{\r\n\t\t\tcase RDF_SCHEMA_URI.RDFS_SUBPROPERTYOF :\r\n\t\t\t\t//create a new rule\r\n\t\t\t\t$infRule=new InfRule();\r\n\t\t\t\t//set the trigger to match all statements, having a \r\n\t\t\t\t//predicate, that matches the subject of the statement that \r\n\t\t\t\t//created this rule.\r\n\t\t\t\t$infRule->setTrigger(null,$statement->getSubject(),null);\r\n\t\t\t\t//set the infrule to return a statement, having the same \r\n\t\t\t\t//subject and object as the statement, that asked for an \r\n\t\t\t\t//entailment, and having the object of the statement, \r\n\t\t\t\t//that created this rule as predicate.\r\n\t\t\t\t$infRule->setEntailment('<s>',$statement->getObject(),'<o>');\r\n\t\t\t\t//add the infule to Model, Statement/Rule-Index, \r\n\t\t\t\t//and Rule/Trigger (or Rule/Entailment) index\r\n\t\t\t\t$this->_addInfRule($infRule,$statementPosition);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase RDF_SCHEMA_URI.RDFS_SUBCLASSOF :\r\n\t\t\t\t$infRule=new InfRule();\r\n\t\t\t\t$infRule->setTrigger(null,new Resource(RDF_NAMESPACE_URI.RDF_TYPE),$statement->getSubject());\r\n\t\t\t\t$infRule->setEntailment('<s>',new Resource(RDF_NAMESPACE_URI.RDF_TYPE),$statement->getObject());\r\n\t\t\t\t$this->infRules[]=$infRule;\r\n\t\t\t\t$this->_addInfRule($infRule,$statementPosition);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase RDF_SCHEMA_URI.RDFS_DOMAIN :\r\n\t\t\t\t$infRule=new InfRule();\r\n\t\t\t\t$infRule->setTrigger(null,$statement->getSubject(),null);\r\n\t\t\t\t$infRule->setEntailment('<s>',new Resource(RDF_NAMESPACE_URI.RDF_TYPE),$statement->getObject());\r\n\t\t\t\t$this->infRules[]=$infRule;\r\n\t\t\t\t$this->_addInfRule($infRule,$statementPosition);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase RDF_SCHEMA_URI.RDFS_RANGE :\r\n\t\t\t\t$infRule=new InfRule();\r\n\t\t\t\t$infRule->setTrigger(null,$statement->getSubject(),null);\r\n\t\t\t\t$infRule->setEntailment('<o>',new Resource(RDF_NAMESPACE_URI.RDF_TYPE),$statement->getObject());\r\n\t\t\t\t$this->infRules[]=$infRule;\r\n\t\t\t\t$this->_addInfRule($infRule,$statementPosition);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase OWL_URI.OWL_INVERSE_OF :\r\n\t\t\t\t$infRule=new InfRule();\r\n\t\t\t\t$infRule->setTrigger(null,$statement->getSubject(),null);\r\n\t\t\t\t$infRule->setEntailment('<o>',$statement->getObject(),'<s>');\r\n\t\t\t\t$this->infRules[]=$infRule;\r\n\t\t\t\t$this->_addInfRule($infRule,$statementPosition);\r\n\t\t\t\r\n\t\t\t\t$infRule=new InfRule();\r\n\t\t\t\t$infRule->setTrigger(null,$statement->getObject(),null);\r\n\t\t\t\t$infRule->setEntailment('<o>',$statement->getSubject(),'<s>');\r\n\t\t\t\t$this->infRules[]=$infRule;\t\t\t\r\n\t\t\t\t$this->_addInfRule($infRule,$statementPosition);\t\t\t\t\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase OWL_URI.OWL_SAME_AS :\r\n\t\t\t\t$infRule=new InfRule();\r\n\t\t\t\t$infRule->setTrigger($statement->getSubject(),null,null);\r\n\t\t\t\t$infRule->setEntailment($statement->getObject(),'<p>','<o>');\r\n\t\t\t\t$this->_addInfRule($infRule,$statementPosition);\r\n\t\t\t\r\n\t\t\t\t$infRule=new InfRule();\r\n\t\t\t\t$infRule->setTrigger($statement->getObject(),null,null);\r\n\t\t\t\t$infRule->setEntailment($statement->getSubject(),'<p>','<o>');\r\n\t\t\t\t$this->_addInfRule($infRule,$statementPosition);\r\n\t\t\t\r\n\t\t\t\t$infRule=new InfRule();\r\n\t\t\t\t$infRule->setTrigger(null,$statement->getSubject(),null);\r\n\t\t\t\t$infRule->setEntailment('<s>',$statement->getObject(),'<o>');\r\n\t\t\t\t$this->_addInfRule($infRule,$statementPosition);\r\n\t\t\t\r\n\t\t\t\t$infRule=new InfRule();\r\n\t\t\t\t$infRule->setTrigger(null,$statement->getObject(),null);\r\n\t\t\t\t$infRule->setEntailment('<s>',$statement->getSubject(),'<o>');\r\n\t\t\t\t$this->_addInfRule($infRule,$statementPosition);\r\n\t\t\t\r\n\t\t\t\t$infRule=new InfRule();\r\n\t\t\t\t$infRule->setTrigger(null,null,$statement->getSubject());\r\n\t\t\t\t$infRule->setEntailment('<s>','<p>',$statement->getObject());\r\n\t\t\t\t$this->_addInfRule($infRule,$statementPosition);\r\n\t\t\t\r\n\t\t\t\t$infRule=new InfRule();\r\n\t\t\t\t$infRule->setTrigger(null,null,$statement->getObject());\r\n\t\t\t\t$infRule->setEntailment('<s>','<p>',$statement->getSubject());\r\n\t\t\t\t$this->_addInfRule($infRule,$statementPosition);\t\t\r\n\t\t\tbreak;\r\n\t\t};\t\r\n\t}", "public function getSlsaProvenanceZeroTwo()\n {\n return $this->readOneof(6);\n }", "function writeTripel($subject,$predicate,$object,$file='main',$object_is='r',$dtype=NULL,$lang=NULL)\r\n{\r\n\tglobal $parseResult;\r\n\r\n\tif ( $object_is == 'r' && !URI::validate(encodeLocalName($object)) ) {\r\n\t\treturn null;\r\n\t}\r\n\t// If $object_is == 'l', encodeLocalName shouldn't be used, the string will be encoded like e.g. \\uBC18\\uC57C\r\n\tif ( $object_is != 'l' ) {\r\n\t\t$object = encodeLocalName($object);\r\n\t}\r\n\r\n\t$predicate = encodeLocalName($predicate);\r\n\tif ( USE_PERCENT_ENCODING ) {\r\n\t\t$predicate = str_replace(\"%\",\"_percent_\",$predicate);\r\n\t} else if ( ereg(\"%([A-F0-9]{2})\", substr($predicate, -3)) ) {\r\n\t\t$predicate .= \"_\";\r\n\t}\r\n\r\n $parseResult[] = array(encodeLocalName($subject), $predicate, $object, $object_is, $dtype, $lang );\r\n}", "function geneshop_polypeptides() {\n module_load_include('inc', 'tripal_feature', 'tripal_feature.api');\n $sql = '\n SELECT FRM.subject_id as feature_id\n FROM {gene} G\n INNER JOIN {feature_relationship} FRM ON FRM.object_id = G.gene_id\n INNER JOIN {chado_feature} CHF ON CHF.feature_id = gene_id\n WHERE chf.nid = :nid\n ';\n $data = '';\n foreach ($_SESSION['basket']['items'] as $nid => $value) {\n $args = array(':nid' => $nid);\n $result = db_query($sql, $args)->fetchObject();\n $feature_id = $result->feature_id;\n $sequence = array();\n $sequence = tripal_get_feature_sequences(\n array(\n 'feature_id' => $feature_id,\n ),\n array(\n 'aggregate' => 1,\n 'relationship_type' => 'derives_from',\n 'relationship_part' => 'object',\n 'is_html' => 0\n )\n );\n if (count($sequence)>0) {\n $data .= \">\".$sequence[0][defline].\"\\n\";\n if ($sequence[0]['residues']) { //if there are sequences in residues\n $sequence[0]['residues'] = strtoupper($sequence[0]['residues']);\n $data .= $sequence[0]['residues'].\"\\n\";\n }\n }\n }\n drupal_add_http_header('Content-Type: text/plain');\n print $data;\n drupal_exit();\n}", "public function get_type()\n\t{\n\t\treturn 'notification.type.approve_post';\n\t}", "private static function constructTriplesFromPredicate($response, $predicate) {\n // convert json response to php object\n $spo_triples = json_decode($response);\n $triples = (array)$spo_triples->results->bindings;\n \n // format triples to a clean array\n $formattedTriples = array(); \n foreach($triples as $triple) {\n $formattedTriples = array_merge(\n $formattedTriples,\n array( array($triple->s->value, $predicate, $triple->o->value) )\n );\n }\n \n return $formattedTriples;\n }", "private function parseStatement(DOMNode $subjectNode) {\r\n $subject=false;\r\n // Has rdf:about\r\n $subject=new SimpleRdfResource;\r\n $subjectNode->getAttributeNS(NS_RDF, 'about') && $subject->setUri($subjectNode->getAttributeNS(NS_RDF, 'about'));\r\n $subjectNode->getAttributeNS(NS_RDF, 'nodeID') && $subject->setNodeId($subjectNode->getAttributeNS(NS_RDF, 'nodeID'));\r\n\r\n // @todo if (!$subject) then \"blank node [2.10]\" - should not happen when using simplerdf.xsl\r\n if (!$subject->getUri() && !$subject->getNodeId()) {\r\n trigger_error('SimpleRDF XSL is invalid... I do not know what to do with this node: '.\"\\n\".$this->dom->saveXML($subjectNode), E_USER_ERROR);\r\n return false;\r\n }\r\n\r\n // Find all Predicates\r\n if (!$list=$this->xpath->query('*', $subjectNode)) {\r\n trigger_error('No predictes foud: '.\"\\n\".$this->dom->saveXML($subjectNode), E_USER_WARNING);\r\n return false; // No predicates found.\r\n }\r\n\r\n // After simplerdf.xsl there will be only one subelement\r\n $predicateNode=$list->item(0);\r\n $predicate=$predicateNode->namespaceURI.$predicateNode->localName;\r\n\r\n // Find Object\r\n if ($predicateNode->hasAttributeNS(NS_RDF, 'resource')) { // Is Resource\r\n $object=$predicateNode->getAttributeNS(NS_RDF, 'resource');\r\n } elseif ($predicateNode->hasAttributeNS(NS_RDF, 'nodeID')) { // Is Resource\r\n $objectNodeId=$predicateNode->getAttributeNS(NS_RDF, 'nodeID');\r\n $object=SimpleRdf::getResourceByNodeId($objectNodeId, true);\r\n } else { // Is Literal: should be @rdf:parseType='Literal'\r\n $object=new SimpleRdfLiteral;\r\n $object->setLang($subjectNode->getAttribute('lang')); // @xml:lang\r\n // Save the content (may contain XML elements...)\r\n foreach($predicateNode->childNodes as $child) {\r\n\t$object->appendValue($this->dom->saveXML($child));\r\n }\r\n }\r\n\r\n // Now we have Subject, Predicate, Object - let's create Statement.\r\n return $this->makeStatement($subject, $predicate, $object);\r\n }", "function get_predicate_object_counts(){\n\t\n\tGLOBAL $cmd_pre;\n\tGLOBAL $cmd_post;\n\t\n\t$qry = \"select ?p (COUNT(?o) AS ?c) where { graph ?g { ?s ?p ?o . FILTER isIRI(?o) . } FILTER regex(?g, \\\"bio2rdf\\\") } ORDER BY DESC(?c)\";\n\t\n\t$cmd = $cmd_pre.$qry.$cmd_post;\n\t\n\t$out = \"\";\n\t\n\ttry {\n\t\t$out = execute_isql_command($cmd);\n\t} catch (Exception $e){\n\t\techo 'iSQL error: ' .$e->getMessage();\n\t\treturn null;\n\t}\n\t\n\t$split_results = explode(\"Type HELP; for help and EXIT; to exit.\\n\", $out);\n\t$split_results_2 = explode(\"\\n\\n\", $split_results[1]);\n\t\n\t$results = trim($split_results_2[0]);\n\t\n\tif (preg_match(\"/^0 Rows./is\", $results) === 0) {\t\n\t\t$results_arr = array();\n\t\t\n\t\t$lines = explode(\"\\n\", $results);\n\t\tforeach($lines as $line){\n\t\t\t\t$split_line = preg_split('/[[:space:]]+/', $line);\n\t\t\t\t$results_arr[$split_line[0]] = $split_line[1];\n\t\t}\n\n\t\treturn $results_arr;\n\t} else {\n\t\treturn null;\n\t}\n}", "function getPType(){\n\treturn 'normal';\n}", "public function getType(): string\n {\n return Client::QUERY_ANALYSIS_FIELD;\n }", "public function setSlsaProvenanceZeroTwo($var)\n {\n GPBUtil::checkMessage($var, \\Grafeas\\V1\\SlsaProvenanceZeroTwo::class);\n $this->writeOneof(6, $var);\n\n return $this;\n }", "function entity_type_label_single_lc($entity_type) {\n $controller = entity_toolbox_controller($entity_type);\n $helper = $controller->getToolboxHelper();\n\n return $helper->labelSingleLowerCase();\n}", "function set_pred_type($name,$type) {\n $pred=$this->get_pred($name);\n if( !$this->write_mode ) {\n $pred['type']=$type;\n $this->pred_cache[$name]=$pred;\n } else if( !is_null($pred['type']) ) {\n if( $pred['type']!=$type ) {\n $this->update_pred($name,$type);\n $old_type=$pred['type'];\n $pred['type']=$type;\n $this->pred_cache[$name]=$pred;\n $list=$this->get_triple_list(array($old_type),null,$name,null,null,null);\n $list->rewind();\n while( $list->valid() ) {\n $triple=$list->current();\n $this->normalize_triple($triple,$old_type);\n $node=$this->get_node($triple['sub']);\n $this->remove_triple_from_node($node,$triple);\n $this->cast_datum($triple['ob'],$old_type,$type);\n if( $type==='node' ) $triple['sub_ok']=$triple['id'];\n else unset( $triple['sub_ok'] );\n $triple['type']=$type;\n $this->add_triple_to_node($node,$triple);\n $this->insert_triple( $triple );\n $this->remove_triple($triple['id'],$old_type);\n $list->next();\n }\n }\n } else {\n $pred['type']=$type;\n $this->insert_pred($name,$type);\n $this->pred_cache[$name]=$pred;\n }\n return $pred;\n }", "private function get_assoc_type($assoc_type)\n {\n if(stripos($assoc_type, \"RO_0002453\") !== false) return \"http://purl.obolibrary.org/obo/RO_0002453\"; //string is found\n exit(\"\\n-----\\nUndefined association type (Memoirs): [$assoc_type]\\n-----\\n\");\n return false;\n }" ]
[ "0.60628766", "0.59220856", "0.5573107", "0.4837793", "0.45543426", "0.44325393", "0.4421502", "0.43902925", "0.42896333", "0.42843154", "0.4241898", "0.42232013", "0.41924918", "0.4179866", "0.41772372", "0.41759098", "0.4161281", "0.41504654", "0.4114715", "0.41031533", "0.4088926", "0.4069685", "0.40507284", "0.40433663", "0.403545", "0.40212703", "0.39987323", "0.39833567", "0.39804348", "0.39705926" ]
0.59416854
1
Generated from protobuf field .grafeas.v1.InTotoProvenance provenance = 4;
public function getProvenance() { return $this->readOneof(4); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setProvenance($var)\n {\n GPBUtil::checkMessage($var, \\Grafeas\\V1\\InTotoProvenance::class);\n $this->writeOneof(4, $var);\n\n return $this;\n }", "public function getSlsaProvenance()\n {\n return $this->readOneof(5);\n }", "public function show(Provenance $provenance)\n {\n //\n }", "public function update(Request $request, Provenance $provenance)\n {\n //\n }", "public function setSlsaProvenance($var)\n {\n GPBUtil::checkMessage($var, \\Grafeas\\V1\\SlsaProvenance::class);\n $this->writeOneof(5, $var);\n\n return $this;\n }", "public function getSlsaProvenanceZeroTwo()\n {\n return $this->readOneof(6);\n }", "public function getProteinContent()\n {\n return $this->proteinContent;\n }", "public function setProteinContent($value)\n {\n $this->proteinContent = $value;\n }", "public function setEventWithProof($var)\n {\n GPBUtil::checkMessage($var, \\Types\\EventWithProof::class);\n $this->event_with_proof = $var;\n\n return $this;\n }", "public function setProofs($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::BYTES);\n $this->proofs = $arr;\n\n return $this;\n }", "public function setProvincia($provincia) {\n\t\t$this->provincia = $provincia;\n\t}", "public function setProof($var)\n {\n GPBUtil::checkString($var, False);\n $this->proof = $var;\n\n return $this;\n }", "public function getEventWithProof()\n {\n return $this->event_with_proof;\n }", "public function getProof()\n {\n return $this->proof;\n }", "public function destroy(Provenance $provenance)\n {\n //\n }", "public function getAgentVersion(): ?Provenance\n {\n $url = $this->getUrlQuery($this->getDataUrl(), false, false, false, true);\n $result = $this->executeGet($url);\n return $result->getVersion();\n }", "public function getCodProy() {\n return $this->codProy;\n }", "public function setProyectorActivo( $proyector ) {\n $this->proyector_activo=$proyector;\n $proyecActual=new Properties();\n $proyecActual->load(file_get_contents(\"./pantallaActiva.properties\"));\n if(strcmp($proyector, \"\")==0)\n $this->proyector_activo=$proyecActual->getProperty(\"Proyector.activo\");\n $proyecActual->setProperty(\"Proyector.activo\",$this->proyector_activo);\n file_put_contents('./pantallaActiva.properties', $proyecActual->toString(true));\n }", "public function getPrologue()\n {\n return $this->prologue;\n }", "public function getProcedimento () {\n return $this->oProcedimento; \n }", "public function protein()\n\t{\n\t\treturn $this->macronutrients()['protein'];\n\t}", "public function getStatPro()\n\t{\n\t\treturn $this->statpro;\n\t}", "public function getCodProy() {\n return $this->codProy;\n }", "public function getProvincia() {\n\t\treturn $this -> provincia;\n\t}", "public function getInvoiceInfo()\n {\n return $this->get(self::INVOICEINFO);\n }", "public function getProofVal()\n {\n return $this->proofVal;\n }", "public function individuaVoto($utente){\n $voto=null;\n foreach ($this->valutazioni as $v){\n if($v->getAutore()==$utente->getUsername())\n $voto=$v->getVoto();\n }\n return $voto;\n }", "public function getPros()\r\n {\r\n return $this->_pros;\r\n }", "public function testAddGeneProteins() {\n\t\techo (\"\\n********************Test AddGeneProteins()**************************************************\\n\");\n\t\n\t\t$result = - 1;\n\t\n\t\t$this->gene->addGeneProteins( $this->protein );\n\t\t$result = $this->gene->getGeneProteins()->count ();\n\t\n\t\t$this->assertEquals ( 1, $result );\n\t}", "public function getPrecioVenta()\n\t{\n\t\treturn $this->precio_venta;\n\t}" ]
[ "0.86480546", "0.6265936", "0.5119285", "0.4937678", "0.47725877", "0.47548842", "0.45455673", "0.4478809", "0.43322435", "0.43037298", "0.42801547", "0.42291778", "0.42053944", "0.4181276", "0.41480342", "0.41445112", "0.4117383", "0.4081836", "0.40627143", "0.40520898", "0.40448815", "0.40299726", "0.40189907", "0.39958987", "0.39879555", "0.3955118", "0.39277855", "0.39272767", "0.39209425", "0.39179683" ]
0.68928325
1
Generated from protobuf field .grafeas.v1.InTotoProvenance provenance = 4;
public function setProvenance($var) { GPBUtil::checkMessage($var, \Grafeas\V1\InTotoProvenance::class); $this->writeOneof(4, $var); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getProvenance()\n {\n return $this->readOneof(4);\n }", "public function getSlsaProvenance()\n {\n return $this->readOneof(5);\n }", "public function show(Provenance $provenance)\n {\n //\n }", "public function update(Request $request, Provenance $provenance)\n {\n //\n }", "public function setSlsaProvenance($var)\n {\n GPBUtil::checkMessage($var, \\Grafeas\\V1\\SlsaProvenance::class);\n $this->writeOneof(5, $var);\n\n return $this;\n }", "public function getSlsaProvenanceZeroTwo()\n {\n return $this->readOneof(6);\n }", "public function getProteinContent()\n {\n return $this->proteinContent;\n }", "public function setProteinContent($value)\n {\n $this->proteinContent = $value;\n }", "public function setEventWithProof($var)\n {\n GPBUtil::checkMessage($var, \\Types\\EventWithProof::class);\n $this->event_with_proof = $var;\n\n return $this;\n }", "public function setProofs($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::BYTES);\n $this->proofs = $arr;\n\n return $this;\n }", "public function setProvincia($provincia) {\n\t\t$this->provincia = $provincia;\n\t}", "public function setProof($var)\n {\n GPBUtil::checkString($var, False);\n $this->proof = $var;\n\n return $this;\n }", "public function getEventWithProof()\n {\n return $this->event_with_proof;\n }", "public function getProof()\n {\n return $this->proof;\n }", "public function destroy(Provenance $provenance)\n {\n //\n }", "public function getAgentVersion(): ?Provenance\n {\n $url = $this->getUrlQuery($this->getDataUrl(), false, false, false, true);\n $result = $this->executeGet($url);\n return $result->getVersion();\n }", "public function getCodProy() {\n return $this->codProy;\n }", "public function setProyectorActivo( $proyector ) {\n $this->proyector_activo=$proyector;\n $proyecActual=new Properties();\n $proyecActual->load(file_get_contents(\"./pantallaActiva.properties\"));\n if(strcmp($proyector, \"\")==0)\n $this->proyector_activo=$proyecActual->getProperty(\"Proyector.activo\");\n $proyecActual->setProperty(\"Proyector.activo\",$this->proyector_activo);\n file_put_contents('./pantallaActiva.properties', $proyecActual->toString(true));\n }", "public function getPrologue()\n {\n return $this->prologue;\n }", "public function getProcedimento () {\n return $this->oProcedimento; \n }", "public function protein()\n\t{\n\t\treturn $this->macronutrients()['protein'];\n\t}", "public function getStatPro()\n\t{\n\t\treturn $this->statpro;\n\t}", "public function getCodProy() {\n return $this->codProy;\n }", "public function getProvincia() {\n\t\treturn $this -> provincia;\n\t}", "public function getInvoiceInfo()\n {\n return $this->get(self::INVOICEINFO);\n }", "public function getProofVal()\n {\n return $this->proofVal;\n }", "public function individuaVoto($utente){\n $voto=null;\n foreach ($this->valutazioni as $v){\n if($v->getAutore()==$utente->getUsername())\n $voto=$v->getVoto();\n }\n return $voto;\n }", "public function getPros()\r\n {\r\n return $this->_pros;\r\n }", "public function testAddGeneProteins() {\n\t\techo (\"\\n********************Test AddGeneProteins()**************************************************\\n\");\n\t\n\t\t$result = - 1;\n\t\n\t\t$this->gene->addGeneProteins( $this->protein );\n\t\t$result = $this->gene->getGeneProteins()->count ();\n\t\n\t\t$this->assertEquals ( 1, $result );\n\t}", "public function getPrecioVenta()\n\t{\n\t\treturn $this->precio_venta;\n\t}" ]
[ "0.6892416", "0.62663794", "0.5119239", "0.4937939", "0.4773753", "0.47563207", "0.45458546", "0.44798374", "0.43313125", "0.43037367", "0.42821127", "0.4229252", "0.42054564", "0.41815272", "0.41488364", "0.4144229", "0.41187602", "0.40831792", "0.40640992", "0.40542245", "0.40460417", "0.4032307", "0.4020433", "0.39972803", "0.39887714", "0.39559373", "0.39294407", "0.39291123", "0.39236948", "0.3919007" ]
0.8648496
0
Generated from protobuf field .grafeas.v1.SlsaProvenance slsa_provenance = 5;
public function getSlsaProvenance() { return $this->readOneof(5); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setSlsaProvenance($var)\n {\n GPBUtil::checkMessage($var, \\Grafeas\\V1\\SlsaProvenance::class);\n $this->writeOneof(5, $var);\n\n return $this;\n }", "public function setSlsaProvenanceZeroTwo($var)\n {\n GPBUtil::checkMessage($var, \\Grafeas\\V1\\SlsaProvenanceZeroTwo::class);\n $this->writeOneof(6, $var);\n\n return $this;\n }", "public function getProvenance()\n {\n return $this->readOneof(4);\n }", "public function getSlsaProvenanceZeroTwo()\n {\n return $this->readOneof(6);\n }", "public function setProvenance($var)\n {\n GPBUtil::checkMessage($var, \\Grafeas\\V1\\InTotoProvenance::class);\n $this->writeOneof(4, $var);\n\n return $this;\n }", "public function show(Provenance $provenance)\n {\n //\n }", "public function setPros($pros)\r\n {\r\n $this->_pros = $pros;\r\n }", "public function setSigla(string $sigla)\n {\n $this->sigla = $sigla;\n }", "public function getSsn()\n {\n return $this->ssn;\n }", "public function getSN() {\n return $this->sn;\n }", "function setRawLogSeq($value)\n {\n $this->_props['RawLogSeq'] = $value;\n }", "public function getAgentVersion(): ?Provenance\n {\n $url = $this->getUrlQuery($this->getDataUrl(), false, false, false, true);\n $result = $this->executeGet($url);\n return $result->getVersion();\n }", "public function getSigla()\n {\n return $this->sigla;\n }", "public function getSigla()\n {\n return $this->sigla;\n }", "public function getSvCode()\n {\n return $this->sv_code;\n }", "public function setSignature($var)\n {\n GPBUtil::checkString($var, False);\n $this->signature = $var;\n }", "public function update(Request $request, Provenance $provenance)\n {\n //\n }", "public function destroy(Provenance $provenance)\n {\n //\n }", "public function setProofs($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::BYTES);\n $this->proofs = $arr;\n\n return $this;\n }", "public function getNOMBREEMPRESA_PROVEEDORES(){\n return $this->NOMBREEMPRESA_PROVEEDORES;\n }", "public function setNOMBREEMPRESA_PROVEEDORES($nOMBREEMPRESA_PROVEEDORES){\n $this->NOMBREEMPRESA_PROVEEDORES = $nOMBREEMPRESA_PROVEEDORES;\n }", "public function setSlr($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->slr !== $v) {\n $this->slr = $v;\n $this->modifiedColumns[AliMemberTableMap::COL_SLR] = true;\n }\n\n return $this;\n }", "function getSId() {\n return $this->sId;\n }", "private function generateAndSetProvenanceURI($datasetModel) {\n $year = date(\"Y\");\n $datasetModel->uriProvenance = Yii::$app->params['baseURI'] . $year . \"/pv\" . substr($year, 2, 3) . time();\n }", "public function getSourceScoId()\n {\n return $this->sourceScoId;\n }", "public function getPvL()\n {\n return $this->pv_l;\n }", "public function setProvincia($provincia) {\n\t\t$this->provincia = $provincia;\n\t}", "public function getSpouseAttribute()\n {\n return $this->families()->where('type', 'spouse')->first();\n }", "public function getCLSa() {\n\t\treturn $this->clsa;\n\t}", "public function getPrologue()\n {\n return $this->prologue;\n }" ]
[ "0.82513446", "0.59556067", "0.57351255", "0.56474423", "0.533182", "0.49478623", "0.44876257", "0.42357317", "0.39970246", "0.39701355", "0.39572632", "0.39508253", "0.39434958", "0.39434958", "0.39381585", "0.3903843", "0.38975328", "0.38828385", "0.3871688", "0.38629025", "0.38621244", "0.38563094", "0.3842356", "0.38298762", "0.38098937", "0.37859902", "0.3782254", "0.37641096", "0.37629843", "0.37592778" ]
0.8110073
1
Generated from protobuf field .grafeas.v1.SlsaProvenance slsa_provenance = 5;
public function setSlsaProvenance($var) { GPBUtil::checkMessage($var, \Grafeas\V1\SlsaProvenance::class); $this->writeOneof(5, $var); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSlsaProvenance()\n {\n return $this->readOneof(5);\n }", "public function setSlsaProvenanceZeroTwo($var)\n {\n GPBUtil::checkMessage($var, \\Grafeas\\V1\\SlsaProvenanceZeroTwo::class);\n $this->writeOneof(6, $var);\n\n return $this;\n }", "public function getProvenance()\n {\n return $this->readOneof(4);\n }", "public function getSlsaProvenanceZeroTwo()\n {\n return $this->readOneof(6);\n }", "public function setProvenance($var)\n {\n GPBUtil::checkMessage($var, \\Grafeas\\V1\\InTotoProvenance::class);\n $this->writeOneof(4, $var);\n\n return $this;\n }", "public function show(Provenance $provenance)\n {\n //\n }", "public function setPros($pros)\r\n {\r\n $this->_pros = $pros;\r\n }", "public function setSigla(string $sigla)\n {\n $this->sigla = $sigla;\n }", "public function getSsn()\n {\n return $this->ssn;\n }", "public function getSN() {\n return $this->sn;\n }", "function setRawLogSeq($value)\n {\n $this->_props['RawLogSeq'] = $value;\n }", "public function getAgentVersion(): ?Provenance\n {\n $url = $this->getUrlQuery($this->getDataUrl(), false, false, false, true);\n $result = $this->executeGet($url);\n return $result->getVersion();\n }", "public function getSigla()\n {\n return $this->sigla;\n }", "public function getSigla()\n {\n return $this->sigla;\n }", "public function getSvCode()\n {\n return $this->sv_code;\n }", "public function setSignature($var)\n {\n GPBUtil::checkString($var, False);\n $this->signature = $var;\n }", "public function update(Request $request, Provenance $provenance)\n {\n //\n }", "public function destroy(Provenance $provenance)\n {\n //\n }", "public function setProofs($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::BYTES);\n $this->proofs = $arr;\n\n return $this;\n }", "public function getNOMBREEMPRESA_PROVEEDORES(){\n return $this->NOMBREEMPRESA_PROVEEDORES;\n }", "public function setNOMBREEMPRESA_PROVEEDORES($nOMBREEMPRESA_PROVEEDORES){\n $this->NOMBREEMPRESA_PROVEEDORES = $nOMBREEMPRESA_PROVEEDORES;\n }", "public function setSlr($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->slr !== $v) {\n $this->slr = $v;\n $this->modifiedColumns[AliMemberTableMap::COL_SLR] = true;\n }\n\n return $this;\n }", "function getSId() {\n return $this->sId;\n }", "private function generateAndSetProvenanceURI($datasetModel) {\n $year = date(\"Y\");\n $datasetModel->uriProvenance = Yii::$app->params['baseURI'] . $year . \"/pv\" . substr($year, 2, 3) . time();\n }", "public function getSourceScoId()\n {\n return $this->sourceScoId;\n }", "public function getPvL()\n {\n return $this->pv_l;\n }", "public function setProvincia($provincia) {\n\t\t$this->provincia = $provincia;\n\t}", "public function getSpouseAttribute()\n {\n return $this->families()->where('type', 'spouse')->first();\n }", "public function getCLSa() {\n\t\treturn $this->clsa;\n\t}", "public function getPrologue()\n {\n return $this->prologue;\n }" ]
[ "0.8110073", "0.59556067", "0.57351255", "0.56474423", "0.533182", "0.49478623", "0.44876257", "0.42357317", "0.39970246", "0.39701355", "0.39572632", "0.39508253", "0.39434958", "0.39434958", "0.39381585", "0.3903843", "0.38975328", "0.38828385", "0.3871688", "0.38629025", "0.38621244", "0.38563094", "0.3842356", "0.38298762", "0.38098937", "0.37859902", "0.3782254", "0.37641096", "0.37629843", "0.37592778" ]
0.82513446
0
Generated from protobuf field .grafeas.v1.SlsaProvenanceZeroTwo slsa_provenance_zero_two = 6;
public function getSlsaProvenanceZeroTwo() { return $this->readOneof(6); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setSlsaProvenanceZeroTwo($var)\n {\n GPBUtil::checkMessage($var, \\Grafeas\\V1\\SlsaProvenanceZeroTwo::class);\n $this->writeOneof(6, $var);\n\n return $this;\n }", "public function getSlsaProvenance()\n {\n return $this->readOneof(5);\n }", "public function setSlsaProvenance($var)\n {\n GPBUtil::checkMessage($var, \\Grafeas\\V1\\SlsaProvenance::class);\n $this->writeOneof(5, $var);\n\n return $this;\n }", "public function getMsv0()\n {\n return $this->hasOne(TblSinhvien::className(), ['msv' => 'msv']);\n }", "public function getProvenance()\n {\n return $this->readOneof(4);\n }", "public function getSpCode2()\n {\n return $this->sp_code2;\n }", "public function setAddress2(string $address_2 = null) : CNabuDataObject\n {\n $this->setValue('nb_icontact_prospect_address_2', $address_2);\n \n return $this;\n }", "public function setSpCode2($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->sp_code2 !== $v) {\n $this->sp_code2 = $v;\n $this->modifiedColumns[AliMemberTableMap::COL_SP_CODE2] = true;\n }\n\n return $this;\n }", "public function getPoisson()\n {\n return $this->readOneof(2);\n }", "public function setSp2($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->sp2 !== $v) {\n $this->sp2 = $v;\n $this->modifiedColumns[OrdrhedTableMap::COL_SP2] = true;\n }\n\n return $this;\n }", "public function getStreetAddress2()\n {\n return $this->street_address_2;\n }", "public function getSp2()\n {\n return $this->sp2;\n }", "public function street2($street2) {\n $this->data['attachment']['payload']['address']['street_2'] = $street2;\n\n return $this;\n }", "public function getAddress2()\n {\n return $this->getValue('nb_icontact_prospect_address_2');\n }", "public function getPayerAddressStreet2() {\n\t\treturn $this->_getField(self::$PAYER_ADDRESS_STREET_2);\n\t}", "public function setProofs($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::BYTES);\n $this->proofs = $arr;\n\n return $this;\n }", "public function setShipaddress2($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->shipaddress2 !== $v) {\n $this->shipaddress2 = $v;\n $this->modifiedColumns[OrdrhedTableMap::COL_SHIPADDRESS2] = true;\n }\n\n return $this;\n }", "public function shouldGetNO2(): void\n {\n $this->assertPollutantLevel('getNO2', $this->faker->randomFloat(2, 0, 500));\n }", "public function setShntkey2($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->shntkey2 !== $v) {\n $this->shntkey2 = $v;\n $this->modifiedColumns[SalesHistoryNotesTableMap::COL_SHNTKEY2] = true;\n }\n\n return $this;\n }", "public function setNOMBREEMPRESA_PROVEEDORES($nOMBREEMPRESA_PROVEEDORES){\n $this->NOMBREEMPRESA_PROVEEDORES = $nOMBREEMPRESA_PROVEEDORES;\n }", "public function getNOMBREEMPRESA_PROVEEDORES(){\n return $this->NOMBREEMPRESA_PROVEEDORES;\n }", "public function setStreet2(string $street2): void\n {\n $this->_street2 = $street2;\n }", "public function set_address_2( $address ) {\n\t\t$this->set_prop( 'address_2', $address );\n\t}", "public function shouldGetNullIfNoSO2(): void\n {\n $this->assertNoPollutantReading('getSO2');\n }", "public function getStreet2(): ?string\n {\n return $this->_street2;\n }", "public function testSLongBig()\n {\n $this->markTestIncomplete('Does not work on 64bit systems!');\n\n $o = PelConvert::BIG_ENDIAN;\n\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 0, $o), 0x00 << 24 | 0x00 << 16 | 0x00 << 8 | 0x00);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 1, $o), 0x00 << 24 | 0x00 << 16 | 0x00 << 8 | 0x01);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 2, $o), 0x00 << 24 | 0x00 << 16 | 0x01 << 8 | 0x23);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 3, $o), 0x00 << 24 | 0x01 << 16 | 0x23 << 8 | 0x45);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 4, $o), 0x01 << 24 | 0x23 << 16 | 0x45 << 8 | 0x67);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 5, $o), 0x23 << 24 | 0x45 << 16 | 0x67 << 8 | 0x89);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 6, $o), 0x45 << 24 | 0x67 << 16 | 0x89 << 8 | 0xAB);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 7, $o), 0x67 << 24 | 0x89 << 16 | 0xAB << 8 | 0xCD);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 8, $o), 0x89 << 24 | 0xAB << 16 | 0xCD << 8 | 0xEF);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 9, $o), 0xAB << 24 | 0xCD << 16 | 0xEF << 8 | 0xFF);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 10, $o), 0xCD << 24 | 0xEF << 16 | 0xFF << 8 | 0xFF);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 11, $o), 0xEF << 24 | 0xFF << 16 | 0xFF << 8 | 0xFF);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 12, $o), 0xFF << 24 | 0xFF << 16 | 0xFF << 8 | 0xFF);\n }", "public function shouldGetSO2(): void\n {\n $this->assertPollutantLevel('getSO2', $this->faker->randomFloat(2, 0, 500));\n }", "public function setStreetAddress2($street_address_2)\n {\n $this->street_address_2 = $street_address_2;\n\n return $this;\n }", "public function sony_psp()\n\t{\n\t\tif (preg_match('/^\\(\\d+\\/\\d+\\) \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e0 .\n\t\t\t\t\t ' - \\d+([.,]\\d+ [kKmMgG])?[bB] yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(20444) FIFA_12_EUR_GERMAN_PSP-ABSTRAKT [01/50] - \"as-f12g.nfo\" yEnc\n\t\tif (preg_match('/^\\(\\d+\\) ([a-zA-Z0-9 -_\\.]+) \\[\\d+\\/(\\d+\\]) - \".+?' . $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\treturn array(\n\t\t\t\"cleansubject\" => $this->releaseCleanerHelper($this->subject), \"properlynamed\" => false\n\t\t);\n\t}", "private function initializeSecondLine()\n {\n foreach ($this->arrDefFromXmlFile['Field'] as $value) {\n $this->strSecondLine .= $value['Label'] . ';';\n }\n\n // Letztes Semikolon abschneiden.\n $this->strSecondLine = substr($this->strSecondLine, 0, -1);\n\n // Zeilenende einfügen.\n $this->strSecondLine = $this->strSecondLine . PHP_EOL;\n\n }" ]
[ "0.885856", "0.598365", "0.5416365", "0.43689844", "0.4243492", "0.4190934", "0.41383106", "0.41075718", "0.41056344", "0.40692857", "0.40600303", "0.40562642", "0.4025134", "0.40137738", "0.39824584", "0.39663893", "0.3960904", "0.3954369", "0.39019033", "0.3899117", "0.3898387", "0.38950008", "0.3888322", "0.3876841", "0.3860792", "0.38537467", "0.38267237", "0.382665", "0.38262", "0.38241056" ]
0.8590598
1
Generated from protobuf field .grafeas.v1.SlsaProvenanceZeroTwo slsa_provenance_zero_two = 6;
public function setSlsaProvenanceZeroTwo($var) { GPBUtil::checkMessage($var, \Grafeas\V1\SlsaProvenanceZeroTwo::class); $this->writeOneof(6, $var); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSlsaProvenanceZeroTwo()\n {\n return $this->readOneof(6);\n }", "public function getSlsaProvenance()\n {\n return $this->readOneof(5);\n }", "public function setSlsaProvenance($var)\n {\n GPBUtil::checkMessage($var, \\Grafeas\\V1\\SlsaProvenance::class);\n $this->writeOneof(5, $var);\n\n return $this;\n }", "public function getMsv0()\n {\n return $this->hasOne(TblSinhvien::className(), ['msv' => 'msv']);\n }", "public function getProvenance()\n {\n return $this->readOneof(4);\n }", "public function getSpCode2()\n {\n return $this->sp_code2;\n }", "public function setAddress2(string $address_2 = null) : CNabuDataObject\n {\n $this->setValue('nb_icontact_prospect_address_2', $address_2);\n \n return $this;\n }", "public function getPoisson()\n {\n return $this->readOneof(2);\n }", "public function setSpCode2($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->sp_code2 !== $v) {\n $this->sp_code2 = $v;\n $this->modifiedColumns[AliMemberTableMap::COL_SP_CODE2] = true;\n }\n\n return $this;\n }", "public function setSp2($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->sp2 !== $v) {\n $this->sp2 = $v;\n $this->modifiedColumns[OrdrhedTableMap::COL_SP2] = true;\n }\n\n return $this;\n }", "public function getStreetAddress2()\n {\n return $this->street_address_2;\n }", "public function getSp2()\n {\n return $this->sp2;\n }", "public function street2($street2) {\n $this->data['attachment']['payload']['address']['street_2'] = $street2;\n\n return $this;\n }", "public function getAddress2()\n {\n return $this->getValue('nb_icontact_prospect_address_2');\n }", "public function getPayerAddressStreet2() {\n\t\treturn $this->_getField(self::$PAYER_ADDRESS_STREET_2);\n\t}", "public function setProofs($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::BYTES);\n $this->proofs = $arr;\n\n return $this;\n }", "public function setShipaddress2($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->shipaddress2 !== $v) {\n $this->shipaddress2 = $v;\n $this->modifiedColumns[OrdrhedTableMap::COL_SHIPADDRESS2] = true;\n }\n\n return $this;\n }", "public function shouldGetNO2(): void\n {\n $this->assertPollutantLevel('getNO2', $this->faker->randomFloat(2, 0, 500));\n }", "public function setShntkey2($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->shntkey2 !== $v) {\n $this->shntkey2 = $v;\n $this->modifiedColumns[SalesHistoryNotesTableMap::COL_SHNTKEY2] = true;\n }\n\n return $this;\n }", "public function setNOMBREEMPRESA_PROVEEDORES($nOMBREEMPRESA_PROVEEDORES){\n $this->NOMBREEMPRESA_PROVEEDORES = $nOMBREEMPRESA_PROVEEDORES;\n }", "public function getNOMBREEMPRESA_PROVEEDORES(){\n return $this->NOMBREEMPRESA_PROVEEDORES;\n }", "public function setStreet2(string $street2): void\n {\n $this->_street2 = $street2;\n }", "public function set_address_2( $address ) {\n\t\t$this->set_prop( 'address_2', $address );\n\t}", "public function shouldGetNullIfNoSO2(): void\n {\n $this->assertNoPollutantReading('getSO2');\n }", "public function getStreet2(): ?string\n {\n return $this->_street2;\n }", "public function testSLongBig()\n {\n $this->markTestIncomplete('Does not work on 64bit systems!');\n\n $o = PelConvert::BIG_ENDIAN;\n\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 0, $o), 0x00 << 24 | 0x00 << 16 | 0x00 << 8 | 0x00);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 1, $o), 0x00 << 24 | 0x00 << 16 | 0x00 << 8 | 0x01);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 2, $o), 0x00 << 24 | 0x00 << 16 | 0x01 << 8 | 0x23);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 3, $o), 0x00 << 24 | 0x01 << 16 | 0x23 << 8 | 0x45);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 4, $o), 0x01 << 24 | 0x23 << 16 | 0x45 << 8 | 0x67);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 5, $o), 0x23 << 24 | 0x45 << 16 | 0x67 << 8 | 0x89);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 6, $o), 0x45 << 24 | 0x67 << 16 | 0x89 << 8 | 0xAB);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 7, $o), 0x67 << 24 | 0x89 << 16 | 0xAB << 8 | 0xCD);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 8, $o), 0x89 << 24 | 0xAB << 16 | 0xCD << 8 | 0xEF);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 9, $o), 0xAB << 24 | 0xCD << 16 | 0xEF << 8 | 0xFF);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 10, $o), 0xCD << 24 | 0xEF << 16 | 0xFF << 8 | 0xFF);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 11, $o), 0xEF << 24 | 0xFF << 16 | 0xFF << 8 | 0xFF);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 12, $o), 0xFF << 24 | 0xFF << 16 | 0xFF << 8 | 0xFF);\n }", "public function sony_psp()\n\t{\n\t\tif (preg_match('/^\\(\\d+\\/\\d+\\) \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e0 .\n\t\t\t\t\t ' - \\d+([.,]\\d+ [kKmMgG])?[bB] yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(20444) FIFA_12_EUR_GERMAN_PSP-ABSTRAKT [01/50] - \"as-f12g.nfo\" yEnc\n\t\tif (preg_match('/^\\(\\d+\\) ([a-zA-Z0-9 -_\\.]+) \\[\\d+\\/(\\d+\\]) - \".+?' . $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\treturn array(\n\t\t\t\"cleansubject\" => $this->releaseCleanerHelper($this->subject), \"properlynamed\" => false\n\t\t);\n\t}", "public function shouldGetSO2(): void\n {\n $this->assertPollutantLevel('getSO2', $this->faker->randomFloat(2, 0, 500));\n }", "public function setStreetAddress2($street_address_2)\n {\n $this->street_address_2 = $street_address_2;\n\n return $this;\n }", "private function initializeSecondLine()\n {\n foreach ($this->arrDefFromXmlFile['Field'] as $value) {\n $this->strSecondLine .= $value['Label'] . ';';\n }\n\n // Letztes Semikolon abschneiden.\n $this->strSecondLine = substr($this->strSecondLine, 0, -1);\n\n // Zeilenende einfügen.\n $this->strSecondLine = $this->strSecondLine . PHP_EOL;\n\n }" ]
[ "0.8590371", "0.59883463", "0.5419901", "0.43704906", "0.42466873", "0.41912127", "0.41371742", "0.41075215", "0.4107362", "0.4069287", "0.4058884", "0.40563935", "0.40237805", "0.40135035", "0.39819425", "0.39711174", "0.3960179", "0.3952438", "0.39012656", "0.39007732", "0.39003798", "0.3892241", "0.38873425", "0.3874758", "0.38598", "0.38564998", "0.3829035", "0.38255802", "0.3824715", "0.38237593" ]
0.8856708
0
Function: reads all publications from the current pubtype list and creates an array with previous and next links for browsing through the publications. The first and the last link go the the list of the pubtype. Usage: Customize the settings below. There's a customization area below. Don't edit anything outside of this area. Put at the top of the pubtypefull.html template. This function returns an array with 2 values: Place , where you want the link to the previous pub be located Place , where you want the link to the previous pub be located Author: Thomas Smiatek
function smarty_function_pagesetter_pubBrowser($args, &$smarty) { //***************************************** // Customization area //***************************************** // Define the text attributes for the links (size, color...) $style = "color: black; text-decoration: none;"; // Define a symbol. It is displayed left of the previous link. You can leave it blank, if you don't need it. $prevSymbol = "&lt;&lt; "; // Define a symbol. It is displayed right of the next link. You can leave it blank, if you don't need it. $nextSymbol = " &gt;&gt;"; // The previous link of the first publication links to the list of the current pub type. Define the text here. $back2overview_left = "back to overview"; // The next link of the last publication links to the list of the current pub type. Define the text here. $back2overview_right = "back to overview"; //***************************************** // End of customization area //***************************************** $core = $smarty->get_template_vars('core'); $id = $core['id']; if (!isset($language)) $language = pnUserGetLang(); // Get stuff that exists in core $page = isset($args['page']) ? intval($args['page']) : intval($core['page']); $baseURL = isset($args['baseURL']) ? $args['baseURL'] : $core['baseURL']; //Build filter array and filter string //this will get filter, filter1,...,filtern from the url //note: the filter string will use filters starting from filter1 $filterStrSet = pagesetterGetFilters(array(), $dummyArgs); if(count($filterStrSet) != 0) { $temp = array(); foreach( $filterStrSet as $key => $item ) { $i = $key + 1; $temp[] = "filter$i=" . $item; } $filterStr = "&amp;" . implode("&amp;", $temp); } else $filterStr = ""; $baseURL .= $filterStr; $pubList = pnModAPIFunc( 'pagesetter', 'user', 'getPubList', array( 'tid' => $core['tid'], 'language' => $language, 'filterSet' => $filterStrSet, 'noOfItems' => -1 ) );//EM: added 'noOfItems' => -1 $pinfo = pnModAPIFunc( 'pagesetter', 'admin', 'getPubTypeInfo', array( 'tid' => $core['tid'], 'noOfItems' => 999 ) ); $perpage = $pinfo['publication']['listCount']; $perpage = isset($args['pageSize']) ? $args['pageSize'] : $perpage; $html = ''; $counter = 0; $navhtml['prev'] = '<a href="index.php?module=pagesetter&amp;tid='.$core['tid'].'" style="'.$style.'">'.$prevSymbol.$back2overview_left.'</a>'; $navhtml['next'] = '<a href="index.php?module=pagesetter&amp;tid='.$core['tid'].'" style="'.$style.'">'.$nextSymbol.$back2overview_right.'</a>'; $foundprev = false; $foundnext = false; foreach ($pubList['publications'] as $pub) { $counter++; if (($pub['id'] != $id) && ($foundprev == false)) { $link = htmlspecialchars( pnModURL('pagesetter','user','viewpub',array('tid' => $core['tid'], 'pid' => $pub['pid'] ))); $navhtml['prev'] = '<a href="'.$link.'" style="'.$style.'">'.$prevSymbol.$pub['title'].'</a>'; } if ($pub['id'] == $id) { $foundprev = true; $page = ceil($counter / $perpage); $link = htmlspecialchars( pnModURL('pagesetter','user','view',array('tid' => $core['tid'], 'page' => $page ))); $navhtml['list'] = '[&nbsp;<a href="'.$link.'" style="'.$style.'">Liste</a>&nbsp;]'; } if (($pub['id'] != $id) && ($foundprev == true) && ($foundnext == false)) { $foundnext = true; $link = htmlspecialchars( pnModURL( 'pagesetter', 'user', 'viewpub', array( 'tid' => $core['tid'], 'pid' => $pub['pid'] ))); $navhtml['next'] = '<a href="'.$link.'" style="'.$style.'">'.$pub['title'].$nextSymbol.'</a>'; } } $smarty->assign('nav', $navhtml ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPagePublishableList($page = 1, $format = 0, $msv=1){\n\t\t\n\t\tglobal $db;\n\t\t//print \"gppL($page, $format, $msv)<br />\";\n\t\t$this->from = $this->getPerPage()*($this->getPage()-1);\n\t\t$this->to = $this->getPerPage()*$this->getPage();\n\t\t\n\t\tswitch($format){\n\t\t\tcase 'panel':\n\t\t\tcase 'panels':\n\t\t\tcase 1:\n\t\t\t\t$template = 2;\n\t\t\t\tbreak;\n\t\t\t/*\n\t\t\tcase 'pages':\n\t\t\tcase 'page':\n\t\t\tcase 0:\n\t\t\tcase 'gallery':\n\t\t\tcase 'galleries':\n\t\t\tcase 2:\n\t\t\t*/\n\t\t\tdefault:\n\t\t\t\t$template = 1;\n\t\t\t\tbreak;\n\t\t}\n\t\t$query = \"SELECT * FROM get_page_content_properties \n\t\t\tWHERE revision_id = 1 AND template_type = '$template' AND msv=$msv AND parent>0 \n\t\t\tGROUP BY guid\";\n\t\t$db->query($query);\n\t\t$this->setTotal($db->num_rows);\n\t\t\n\t\t$query .= \" ORDER BY date_modified DESC, date_created DESC LIMIT \". $this->from .\",\". $this->getPerPage();\n \t\t//print \"$query <br>\\n\";\n\n\t\t$files = $db->get_results($query);\n\n\t\t$this->setTotal=sizeof($files);\n \n\t\tif(sizeof($files)>0) return $files;\n\t\telse return false;\n\t\t\n\t}", "public function drawPagePublishableList($page = 1, $format = 0){\n\n \tglobal $site;\n\t\t//print \"dPPL($page, $format)<br>\\n\";\n\t\t$this->setPerPage(10);\n\t\t$this->setPage($page);\n\n\t\tif($results = $this->getPagePublishableList($page, $format, $site->id) ){\n\t\t\tswitch($format){\n\t\t\t\tcase '0':\n\t\t\t\tcase 'pages':\n\t\t\t\t\t$format = 'pages';\n\t\t\t\t\tbreak;\n\t\t\t\tcase '1':\n\t\t\t\tcase 'panels':\n\t\t\t\t\t$format = 'panels';\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$format = '';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t$html = '<table class=\"treeline\">\n<caption>Publishable '.$format.'</caption>\n\t<thead>\n\t<tr>\n\t\t<th scope=\"col\">Preview</th>\n\t\t<th scope=\"col\">Title</th>\n\t\t<th scope=\"col\">Author</th>\n\t\t<th scope=\"col\">Created On</th>\n\t\t<th scope=\"col\">Publish</th>\n\t\t<th scope=\"col\">Reject</th>\n\t</tr>\n\t</thead>\n<tbody>\n';\n\t\t\tforeach($results as $thispage){\n\t\t\t\t$html .= \"<tr>\\n\";\n\t\t\t\t$html .= '<td class=\"action preview\"><a href=\"'. $this->drawLinkByGUID($thispage->guid) .'?mode=preview&amp;KeepThis=true&amp;TB_iframe=true&amp;height=520&amp;width='.$site->getConfig(\"site_page_width\").'\" class=\"thickbox\" title=\"Preview this\">Preview this</a></td>'.\"\\n\";\n\t\t\t\t$html .=\"<td><strong>\".$thispage->title .'</strong>';\n\t\t\t\tif($thispage->template == 'panelrss.php'){\n\t\t\t\t\t$html .= ' <em style=\"color:#3a3\">[RSS Panel]</em>';\n\t\t\t\t}\n\t\t\t\t$html .= '</td>'.\"\\n\";\n\t\t\t\t$html .= '<td><a href=\"mailto:'.$thispage->created_by_email .'\" title=\"Email '.$thispage->created_by.'\">'. $thispage->created_by_username .'</a></td>'.\"\\n\";\n\t\t\t\t$html .= '<td>'.$thispage->date_created.\"</td>\\n\";\n\t\t\t\t\n\t\t\t\tif ($thispage->template == 'gallery.php') {\n\t\t\t\t\t$format = 'galleries';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$html .= '<td class=\"action publish\"><a href=\"/treeline/'.$format.'/?action=publish&amp;guid='.$thispage->guid.'\" title=\"Publish this item\">Publish this item</a></td>'.\"\\n\";\n\t\t\t\t$html .= '<td class=\"action delete\"><a href=\"/treeline/'.$format.'/?action=reject&amp;guid='.$thispage->guid.'\" title=\"Reject this edit\">Reject this edit</a></td>'.\"\\n\".'</tr>'.\"\\n\";\n\t\t\t}\n\t\t\t$html .= \"</tbody>\\n</table>\\n\";\n\t\t\t//$html .= $this->getPagination($page, $action, $cat, $term);\n\t\t\t//$html .= $this->drawPagination('/treeline/'.$format.'/?action=publish', $this->getTotal(), 10, $page);\n\t\t\t$html .= drawPagination($this->getTotal(), 10, $page, '/treeline/'.$format.'/?action=publish');\n\t\t\t\n\t\t\treturn $html;\n\t\t\t\n\t\t}\n\t\telse return \"<p>There are no $format to display</p>\";\n\t}", "public function getPagesLinks()\r\n\t{\r\n\t\t$app = JFactory::getApplication();\r\n\t\t// Yjsg instance\r\n\t\t$yjsg = Yjsg::getInstance(); \r\n\t\t\r\n\t\t// Build the page navigation list.\r\n\t\t$data = $this->_buildDataObject();\r\n\r\n\t\t$list = array();\r\n\t\t$list['prefix'] = $this->prefix;\r\n\r\n\t\t$itemOverride = false;\r\n\t\t$listOverride = false;\r\n\r\n\t\t$chromePath \t= JPATH_THEMES . '/' . $app->getTemplate() . '/html/pagination.php';\r\n\t\t//yjsg start\r\n\t\tif (!file_exists($chromePath)){\r\n\t\t\tif($yjsg->preplugin()){\r\n\t\t\t\r\n\t\t\t\t$chromePath = YJSGPATH . 'legacy' . YJDS . 'html' . YJDS . 'pagination.php';\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\t\r\n\t\t\t\t$chromePath = YJSGPATH . 'includes' . YJDS . 'html' . YJDS . 'pagination.php';\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t//yjsg end\r\n\t\tif (file_exists($chromePath))\r\n\t\t{\r\n\t\t\tinclude_once $chromePath;\r\n\t\t\tif (function_exists('pagination_item_active') && function_exists('pagination_item_inactive'))\r\n\t\t\t{\r\n\t\t\t\t$itemOverride = true;\r\n\t\t\t}\r\n\t\t\tif (function_exists('pagination_list_render'))\r\n\t\t\t{\r\n\t\t\t\t$listOverride = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Build the select list\r\n\t\tif ($data->all->base !== null)\r\n\t\t{\r\n\t\t\t$list['all']['active'] = true;\r\n\t\t\t$list['all']['data'] = ($itemOverride) ? pagination_item_active($data->all) : $this->_item_active($data->all);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$list['all']['active'] = false;\r\n\t\t\t$list['all']['data'] = ($itemOverride) ? pagination_item_inactive($data->all) : $this->_item_inactive($data->all);\r\n\t\t}\r\n\r\n\t\tif ($data->start->base !== null)\r\n\t\t{\r\n\t\t\t$list['start']['active'] = true;\r\n\t\t\t$list['start']['data'] = ($itemOverride) ? pagination_item_active($data->start) : $this->_item_active($data->start);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$list['start']['active'] = false;\r\n\t\t\t$list['start']['data'] = ($itemOverride) ? pagination_item_inactive($data->start) : $this->_item_inactive($data->start);\r\n\t\t}\r\n\t\tif ($data->previous->base !== null)\r\n\t\t{\r\n\t\t\t$list['previous']['active'] = true;\r\n\t\t\t$list['previous']['data'] = ($itemOverride) ? pagination_item_active($data->previous) : $this->_item_active($data->previous);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$list['previous']['active'] = false;\r\n\t\t\t$list['previous']['data'] = ($itemOverride) ? pagination_item_inactive($data->previous) : $this->_item_inactive($data->previous);\r\n\t\t}\r\n\r\n\t\t$list['pages'] = array(); //make sure it exists\r\n\t\tforeach ($data->pages as $i => $page)\r\n\t\t{\r\n\t\t\tif ($page->base !== null)\r\n\t\t\t{\r\n\t\t\t\t$list['pages'][$i]['active'] = true;\r\n\t\t\t\t$list['pages'][$i]['data'] = ($itemOverride) ? pagination_item_active($page) : $this->_item_active($page);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$list['pages'][$i]['active'] = false;\r\n\t\t\t\t$list['pages'][$i]['data'] = ($itemOverride) ? pagination_item_inactive($page) : $this->_item_inactive($page);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif ($data->next->base !== null)\r\n\t\t{\r\n\t\t\t$list['next']['active'] = true;\r\n\t\t\t$list['next']['data'] = ($itemOverride) ? pagination_item_active($data->next) : $this->_item_active($data->next);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$list['next']['active'] = false;\r\n\t\t\t$list['next']['data'] = ($itemOverride) ? pagination_item_inactive($data->next) : $this->_item_inactive($data->next);\r\n\t\t}\r\n\r\n\t\tif ($data->end->base !== null)\r\n\t\t{\r\n\t\t\t$list['end']['active'] = true;\r\n\t\t\t$list['end']['data'] = ($itemOverride) ? pagination_item_active($data->end) : $this->_item_active($data->end);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$list['end']['active'] = false;\r\n\t\t\t$list['end']['data'] = ($itemOverride) ? pagination_item_inactive($data->end) : $this->_item_inactive($data->end);\r\n\t\t}\r\n\r\n\t\tif ($this->total > $this->limit)\r\n\t\t{\r\n\t\t\treturn ($listOverride) ? pagination_list_render($list) : $this->_list_render($list);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn '';\r\n\t\t}\r\n\t}", "static function page_list($startpage, $config, $first2last=true)\n {\n global $bodyreader;\n if ($first2last) $continue = \"next\"; \n else $continue = \"previous\";\n $items = $bodyreader->parse_advance($startpage, $config, array($continue));\n $pages[] = $startpage; \n while (!empty($items[0][$continue]))\n {\n $link = static::match_url($startpage, $items[0][$continue]);\n $pages[] = $link;\n $items = $bodyreader->parse_advance($link, $config, array($continue));\n }\n \n return $pages;\n }", "function getPagesLinks()\n\t{\n\t\tglobal $mainframe;\n\n\t\t$lang =& JFactory::getLanguage();\n\n\t\t// Build the page navigation list\n\t\t$data = $this->_buildDataObject();\n\n\t\t$list = array();\n\n\t\t$itemOverride = false;\n\t\t$listOverride = false;\n\n\t\t$chromePath = JPATH_THEMES.DS.$mainframe->getTemplate().DS.'html'.DS.'pagination.php';\n\t\tif (file_exists($chromePath))\n\t\t{\n\t\t\trequire_once ($chromePath);\n\t\t\tif (function_exists('pagination_item_active') && function_exists('pagination_item_inactive')) {\n\t\t\t\t$itemOverride = true;\n\t\t\t}\n\t\t\tif (function_exists('pagination_list_render')) {\n\t\t\t\t$listOverride = true;\n\t\t\t}\n\t\t}\n\n\t\t// Build the select list\n\t\tif ($data->all->base !== null) {\n\t\t\t$list['all']['active'] = true;\n\t\t\t$list['all']['data'] = ($itemOverride) ? pagination_item_active($data->all) : $this->_item_active($data->all);\n\t\t} else {\n\t\t\t$list['all']['active'] = false;\n\t\t\t$list['all']['data'] = ($itemOverride) ? pagination_item_inactive($data->all) : $this->_item_inactive($data->all);\n\t\t}\n\n\t\tif ($data->start->base !== null) {\n\t\t\t$list['start']['active'] = true;\n\t\t\t$list['start']['data'] = ($itemOverride) ? pagination_item_active($data->start) : $this->_item_active($data->start);\n\t\t} else {\n\t\t\t$list['start']['active'] = false;\n\t\t\t$list['start']['data'] = ($itemOverride) ? pagination_item_inactive($data->start) : $this->_item_inactive($data->start);\n\t\t}\n\t\tif ($data->previous->base !== null) {\n\t\t\t$list['previous']['active'] = true;\n\t\t\t$list['previous']['data'] = ($itemOverride) ? pagination_item_active($data->previous) : $this->_item_active($data->previous);\n\t\t} else {\n\t\t\t$list['previous']['active'] = false;\n\t\t\t$list['previous']['data'] = ($itemOverride) ? pagination_item_inactive($data->previous) : $this->_item_inactive($data->previous);\n\t\t}\n\n\t\t$list['pages'] = array(); //make sure it exists\n\t\tforeach ($data->pages as $i => $page)\n\t\t{\n\t\t\tif ($page->base !== null) {\n\t\t\t\t$list['pages'][$i]['active'] = true;\n\t\t\t\t$list['pages'][$i]['data'] = ($itemOverride) ? pagination_item_active($page) : $this->_item_active($page);\n\t\t\t} else {\n\t\t\t\t$list['pages'][$i]['active'] = false;\n\t\t\t\t$list['pages'][$i]['data'] = ($itemOverride) ? pagination_item_inactive($page) : $this->_item_inactive($page);\n\t\t\t}\n\t\t}\n\n\t\tif ($data->next->base !== null) {\n\t\t\t$list['next']['active'] = true;\n\t\t\t$list['next']['data'] = ($itemOverride) ? pagination_item_active($data->next) : $this->_item_active($data->next);\n\t\t} else {\n\t\t\t$list['next']['active'] = false;\n\t\t\t$list['next']['data'] = ($itemOverride) ? pagination_item_inactive($data->next) : $this->_item_inactive($data->next);\n\t\t}\n\t\tif ($data->end->base !== null) {\n\t\t\t$list['end']['active'] = true;\n\t\t\t$list['end']['data'] = ($itemOverride) ? pagination_item_active($data->end) : $this->_item_active($data->end);\n\t\t} else {\n\t\t\t$list['end']['active'] = false;\n\t\t\t$list['end']['data'] = ($itemOverride) ? pagination_item_inactive($data->end) : $this->_item_inactive($data->end);\n\t\t}\n\n\t\tif($this->total > $this->limit){\n\t\t\treturn ($listOverride) ? pagination_list_render($list) : $this->_list_render($list);\n\t\t}\n\t\telse{\n\t\t\treturn '';\n\t\t}\n\t}", "public function p_pub_display() {\n\t\t// Build the output to return for use by the shortcode.\n\t\tob_start();\n\t\t?>\n\n\t\t<div class=\"loop\">\n\t\t\t<?php\n\t\t\t$args = array(\n\t\t\t\t'posts_per_page' => 4,\n\t\t\t\t'offset'=> 0,\n\t\t\t\t'post_type' => 'wsuwp_uc_publication',\n\t\t\t\t'tax_query' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'taxonomy' => 'category',\n\t\t\t\t\t\t'field' => 'slug',\n\t\t\t\t\t\t'terms' => 'polymeric-materials-publications'\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t);\n\n\t\t\t$my_posts = new WP_Query( $args );\n\n\t\t\tif ( $my_posts->have_posts() ) : while( $my_posts->have_posts() ) : $my_posts->the_post();\n\t\t\t\t?>\n\t\t\t\t\n\t\t\t\t\t<p><a href=\"<?php the_permalink(); ?>\"><?php the_title(); ?></a></p>\n\t\t\t<?php endwhile; endif;\n\t\t\twp_reset_query();\n\t\t\t?>\n\n\t\t</div>\n\n\t\t<?php\n\t\t$content = ob_get_contents();\n\t\tob_end_clean();\n\n\t\treturn $content;\n\t}", "public function wmel_pub_display() {\n\t\t// Build the output to return for use by the shortcode.\n\t\tob_start();\n\t\t?>\n\n\t\t<div class=\"loop\">\n\t\t\t<?php\n\t\t\t$args = array(\n\t\t\t\t'posts_per_page' => 4,\n\t\t\t\t'offset'=> 0,\n\t\t\t\t'post_type' => 'wsuwp_uc_publication',\n\t\t\t\t'tax_query' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'taxonomy' => 'category',\n\t\t\t\t\t\t'field' => 'slug',\n\t\t\t\t\t\t'terms' => 'wmel-publications'\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t);\n\n\t\t\t$my_posts = new WP_Query( $args );\n\n\t\t\tif ( $my_posts->have_posts() ) : while( $my_posts->have_posts() ) : $my_posts->the_post();\n\t\t\t\t?>\n\t\t\t\t\n\t\t\t\t\t<p><a href=\"<?php the_permalink(); ?>\"><?php the_title(); ?></a></p>\n\t\t\t<?php endwhile; endif;\n\t\t\twp_reset_query();\n\t\t\t?>\n\n\t\t</div>\n\n\t\t<?php\n\t\t$content = ob_get_contents();\n\t\tob_end_clean();\n\n\t\treturn $content;\n\t}", "private function generateLinks()\n\t{\n\t\t// Additional pages are the total minus the current page\n\t\t$iAdditional\t= $this->iToShow - 1;\n\n\t\t// Figure out how many additional pages to show\n\t\t$iToShow\t\t= ($this->iTotal <= $iAdditional) ? ($this->iTotal - 1) : $iAdditional;\n\n\t\t// Get the pre and post lengths\n\t\tif($iToShow % 2 == 0) {\n\t\t\t$iPre\t= $iToShow / 2;\n\t\t\t$iPost\t= $iPre;\n\t\t} else {\n\t\t\t$iPre\t= floor($iToShow / 2);\n\t\t\t$iPost\t= $iPre + 1;\n\t\t}\n\n\t\t// If the current page is less than the pre pages\n\t\tif($this->iPage <= $iPre)\n\t\t{\n\t\t\t$iPre\t= $this->iPage - 1;\n\t\t\t$iPost\t= $iToShow - $iPre;\n\t\t}\n\t\t// Else if the total pages minus the current page is less than the\n\t\t//\tpost pages\n\t\tif($this->iTotal - $this->iPage <= $iPost)\n\t\t{\n\t\t\t$iPost\t= $this->iTotal - $this->iPage;\n\t\t\t$iPre\t= $iToShow - $iPost;\n\t\t}\n\n\t\t// Init the links array\n\t\t$this->aLinks\t= array(\n\t\t\t'previous'\t\t=> false,\n\t\t\t'first'\t\t\t=> false,\n\t\t\t'pre'\t\t\t=> array(),\n\t\t\t'current'\t\t=> '',\n\t\t\t'post'\t\t\t=> array(),\n\t\t\t'last'\t\t\t=> false,\n\t\t\t'next'\t\t\t=> false\n\t\t);\n\n\t\t// If the page isn't 1\n\t\tif($this->iPage > 1)\n\t\t{\n\t\t\t// Add the previous button\n\t\t\t$this->aLinks['previous'] = array(\n\t\t\t\t'text'\t=> $this->iPage - 1,\n\t\t\t\t'url'\t=> (($this->iPage - 1 == 1) ? $this->aOptions['primary_url'] : $this->sURL . ($this->iPage - 1) . '/') . $this->sQuery,\n\t\t\t\t'index' => (($this->iPage - 1) > $this->aOptions['index_limit']) ? false : true\n\t\t\t);\n\t\t}\n\n\t\t// If the page is greater than the pre length\n\t\tif($this->iPage - 1 > $iPre)\n\t\t{\n\t\t\t// Add the first page\n\t\t\t$this->aLinks['first'] = array(\n\t\t\t\t'text'\t=> 1,\n\t\t\t\t'url'\t=> $this->aOptions['primary_url'] . $this->sQuery,\n\t\t\t\t'index' => (1 > $this->aOptions['index_limit']) ? false : true\n\t\t\t);\n\t\t}\n\n\t\t// Add the previous pages\n\t\tfor($i = $this->iPage - $iPre; $i < $this->iPage; ++$i)\n\t\t{\n\t\t\t$this->aLinks['pre'][]\t= array(\n\t\t\t\t'text'\t=> $i,\n\t\t\t\t'url'\t=> (($i == 1) ? $this->aOptions['primary_url'] : $this->sURL . $i . '/') . $this->sQuery,\n\t\t\t\t'index' => ($i > $this->aOptions['index_limit']) ? false : true\n\t\t\t);\n\t\t}\n\n\t\t// Add the current page\n\t\t$this->aLinks['current'] = array(\n\t\t\t'text'\t=> $this->iPage,\n\t\t\t'url'\t=> (($i == 1) ? $this->aOptions['primary_url'] : $this->sURL . $i . '/') . $this->sQuery,\n\t\t\t'index' => ($this->iPage > $this->aOptions['index_limit']) ? false : true\n\t\t);\n\n\t\t// Add the next pages\n\t\t$iForCond\t= $this->iPage + $iPost + 1;\n\t\tfor($i = $this->iPage + 1; $i < $iForCond; ++$i)\n\t\t{\n\t\t\t$this->aLinks['post'][] = array(\n\t\t\t\t'text'\t=> $i,\n\t\t\t\t'url'\t=> (($i == 1) ? $this->aOptions['primary_url'] : $this->sURL . $i . '/') . $this->sQuery,\n\t\t\t\t'index' => ($i > $this->aOptions['index_limit']) ? false : true\n\t\t\t);\n\t\t}\n\n\t\t// If the last page isn't visible\n\t\tif($this->iTotal > $this->iPage + $iPost)\n\t\t{\n\t\t\t// And the last page\n\t\t\t$this->aLinks['last']\t= array(\n\t\t\t\t'text'\t=> $this->iTotal,\n\t\t\t\t'url'\t=> $this->sURL . $this->iTotal . '/' . $this->sQuery,\n\t\t\t\t'index' => ($this->iTotal > $this->aOptions['index_limit']) ? false : true\n\t\t\t);\n\t\t}\n\n\t\t// If the current page isn't the last page\n\t\tif($this->iTotal != $this->iPage)\n\t\t{\n\t\t\t// Show the next page\n\t\t\t$this->aLinks['next']\t= array(\n\t\t\t\t'text'\t=> $this->iPage + 1,\n\t\t\t\t'url'\t=> $this->sURL . ($this->iPage + 1) . '/' . $this->sQuery,\n\t\t\t\t'index' => (($this->iPage + 1) > $this->aOptions['index_limit']) ? false : true\n\t\t\t);\n\t\t}\n\t}", "public function getLinks($currentUrl = null) {\n\t\t$links = parent::getLinks($currentUrl);\n\t\t$currentDate = null;\n\t\t$items = array();\n\n\t\t$currentYear = null;\n\n\t\tforeach ($links as $link) {\n\t\t\t//print_r($link);\n\t\t\t$date = isset($link['Date']) ? $link['Date'] : null;\n\n\t\t\t// check if the link has a new date.\n\t\t\t// add it to the items list an reset the date.\n\t\t\tif ($date && $currentDate != $date) {\n\t\t\t\tif ($currentYear && (!empty($currentYear['Typed']) || !empty($currentYear['Project']))) {\n\t\t\t\t\t// append previous year\n\t\t\t\t\t$items[] = $currentYear['Year'];\n\n\t\t\t\t\t$types = [];\n\t\t\t\t\tforeach ($currentYear['Typed'] as $typed) {\n\t\t\t\t\t\tif (!in_array($typed['Type'], $types)) {\n\t\t\t\t\t\t\tif (is_array($typed['Type'])) {\n\t\t\t\t\t\t\t\tforeach ($typed['Type'] as $t) {\n\t\t\t\t\t\t\t\t\tif (!in_array($t, $types)) {\n\t\t\t\t\t\t\t\t\t\t$types[] = $t;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$types[] = $typed['Type'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tforeach ($types as $key => $type) {\n\t\t\t\t\t\t$types[$key] = $type . 's';\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!empty($currentYear['Typed'])) {\n\t\t\t\t\t\t$items[] = array(\n\t\t\t\t\t\t\t'Title' => join(' // ', $types),\n\t\t\t\t\t\t\t'IsSubHeadline' => true,\n\t\t\t\t\t\t\t'Type' => 'subheadline'\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tforeach ($currentYear['Typed'] as $typed) {\n\t\t\t\t\t\t\t$items[] = $typed;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!empty($currentYear['Project'])) {\n\t\t\t\t\t\t$items[] = array(\n\t\t\t\t\t\t\t'Title' => 'Projects',\n\t\t\t\t\t\t\t'IsSubHeadline' => true,\n\t\t\t\t\t\t\t'Type' => 'subheadline'\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tforeach ($currentYear['Project'] as $project) {\n\t\t\t\t\t\t\t$items[] = $project;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$currentYear = array(\n\t\t\t\t\t'Year' => array(\n\t\t\t\t\t\t'Title' => $date,\n\t\t\t\t\t\t'IsDate' => true,\n\t\t\t\t\t\t'Type' => 'date'\n\t\t\t\t\t),\n\t\t\t\t\t'Typed' => array(),\n\t\t\t\t\t'Project' => array()\n\t\t\t\t);\n\n\t\t\t\t$currentDate = $date;\n\t\t\t}\n\n\t\t\t// push link to items array\n\t\t\t$typed = isset($link['Type']) && $link['Type'] ? 'Typed' : 'Project';\n\t\t\t$currentYear[$typed][] = $link;\n\t\t}\n\n\t\treturn $items;\n\t}", "function usergenviz_list_saved($viztype = '') {\n global $user;\n $page_contents = \"\";\n\n switch ($viztype) {\n case 'timeline':\n $saveditems = usergenviz_get_saved($user->uid, 'timeline');\n break; \n\n case 'map':\n $saveditems = usergenviz_get_saved($user->uid, 'map');\n break;\n }\n\n $links = array();\n foreach ($saveditems as $saveditem) {\n $params = unserialize($saveditem['usergen_timeline_saved_value']);\n\n $url = url('usergen/' . $viztype . '/results') . \"?\" . http_build_query($params);\n\n\n $alltypes = usergenviz_getcontenttypes();\n\n $type_name = $alltypes[$params['types']]['name'];\n unset($alltypes);\n\n $datasource_info = usergenviz_getfields($params['sources']);\n $datasource_name = $datasource_info['widget']['label'];\n unset($datasource_info);\n\n $criteria = sprintf(t(\"Pages of type %s, using the data source %s\"), $type_name, $datasource_name);\n if (isset($params['fromdate'])) {\n $criteria .= \" \" . sprintf(t(\"from %s\"), $params['fromdate']);\n }\n if (isset($params['todate'])) {\n $criteria .= \" \" . sprintf(t(\"to %s\"), $params['todate']);\n }\n\n $links[$i]['save'] = '<a href=\"' . $url . '\">' . $criteria . '</a>';\n $links[$i]['delete'] = '<a href=\"' . url('usergen/' . $viztype . '/remove') . '?' . http_build_query($params) . '\" title=\"' . t('Forget this {$viztype}') . '\">[x]</a>';\n $i++;\n }\n\n if (sizeof($links) > 0) {\n $page_contents .= '<ul id=\"saved_' . $viztype . ' class=\"list\">';\n foreach ($links as $link) {\n $page_contents .= \"<li>{$link['save']} {$link['delete']}</li>\";\n }\n $page_contents .= \"</ul>\";\n }\n else {\n $page_contents .= \"<p>\" . t('No saved timelines found.') . ' <a href=\"' . url('usergen/timeline') . '\">' . t('Build another timeline') . '?</a></p>';\n }\n\n return $page_contents;\n\n}", "public function se_pub_display() {\n\t\t// Build the output to return for use by the shortcode.\n\t\tob_start();\n\t\t?>\n\n\t\t<div class=\"loop\">\n\t\t\t<?php\n\t\t\t$args = array(\n\t\t\t\t'posts_per_page' => 4,\n\t\t\t\t'offset'=> 0,\n\t\t\t\t'post_type' => 'wsuwp_uc_publication',\n\t\t\t\t'tax_query' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'taxonomy' => 'category',\n\t\t\t\t\t\t'field' => 'slug',\n\t\t\t\t\t\t'terms' => 'structural-engineering-publications'\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t);\n\n\t\t\t$my_posts = new WP_Query( $args );\n\n\t\t\tif ( $my_posts->have_posts() ) : while( $my_posts->have_posts() ) : $my_posts->the_post();\n\t\t\t\t?>\n\t\t\t\t\n\t\t\t\t\t<p><a href=\"<?php the_permalink(); ?>\"><?php the_title(); ?></a></p>\n\t\t\t<?php endwhile; endif;\n\t\t\twp_reset_query();\n\t\t\t?>\n\n\t\t</div>\n\n\t\t<?php\n\t\t$content = ob_get_contents();\n\t\tob_end_clean();\n\n\t\treturn $content;\n\t}", "function getPages() {\r\n\tglobal $S;\r\n\tif (!is_array($S->arbo)) {\r\n\t\trequire_once('../lib/class/class_arbo.php');\r\n\t\t$S =& new ARBO();\r\n\t\t$S->fields = array('id', 'pid', 'type_id', 'titre_fr');\r\n\t\t$S->buildArbo();\r\n\t}\r\n\t$options = array();\r\n\tforeach($S->arbo as $rid=>$tmp) {\r\n\t\t$options[urlencode($S->arbo[$rid]['url'])] = $S->arbo[$rid]['titre_fr'].' (#'.$rid.')';\r\n\t}\r\n\treturn $options;\r\n}", "function paginationLinks($page = 1, $page_count, $query = \"\")\n{\n // base page url\n $url = \"collection\";\n\n // first page link, which doesn't have a page data in url (no page=1)\n $first_page = $url . $query;\n\n // checking if other variables exist in query and adding needed characters\n $query .= (strpos($query, \"=\") !== FALSE) ? \"&\" : \"?\";\n $query .= \"page=\";\n\n // last page is always a max = page_count\n $last_page = $url . $query . $page_count;\n\n // pages before and after current page\n $previous = $url . $query . ($page-1);\n $next = $url . $query . ($page+1);\n\n // setting the three buttons values, middle one is current\n $first = $previous;\n $second = $url . $query . $page;\n $third = $next;\n\n // changing page links in special circumstances\n if($page == 1){\n $first = $first_page;\n $second = $next;\n $third = $url . $query . ($page+2);\n }elseif($page == 2){\n $first = $first_page;\n $previous = $first_page;\n }elseif($page == $page_count){\n $first = $url . $query . ($page_count-2);\n $second = $url . $query . ($page_count-1);\n $third = $last_page;\n }\n\n return [\n 'first_page' => $first_page,\n 'last_page' => $last_page,\n 'previous' => $previous,\n 'next' => $next, \n 'first' => $first,\n 'second' => $second,\n 'third' => $third\n ];\n}", "function pmpromrss_pmpro_member_links_bottom()\r\n{\t\r\n\t//show links to RSS feeds (format is title => url)\r\n\t$feeds = apply_filters(\"pmpromrss_feeds\", array(\"Recent Posts Feed\" => get_bloginfo('rss_url')));\r\n\t\r\n\t//show URLs\r\n\tforeach($feeds as $title => $feed)\r\n\t{\r\n\t?>\r\n\t\t<li><a href=\"<?php echo pmpromrss_url($feed);?>\"><?php echo $title;?></a></li>\r\n\t<?php\r\n\t}\r\n}", "public function cbm_pub_display() {\n\t\t// Build the output to return for use by the shortcode.\n\t\tob_start();\n\t\t?>\n\n\t\t<div class=\"loop\">\n\t\t\t<?php\n\t\t\t$args = array(\n\t\t\t\t'posts_per_page' => 4,\n\t\t\t\t'offset'=> 0,\n\t\t\t\t'post_type' => 'wsuwp_uc_publication',\n\t\t\t\t'tax_query' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'taxonomy' => 'category',\n\t\t\t\t\t\t'field' => 'slug',\n\t\t\t\t\t\t'terms' => 'cbm-publications'\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t);\n\n\t\t\t$my_posts = new WP_Query( $args );\n\n\t\t\tif ( $my_posts->have_posts() ) : while( $my_posts->have_posts() ) : $my_posts->the_post();\n\t\t\t\t?>\n\t\t\t\t\n\t\t\t\t\t<p><a href=\"<?php the_permalink(); ?>\"><?php the_title(); ?></a></p>\n\t\t\t<?php endwhile; endif;\n\t\t\twp_reset_query();\n\t\t\t?>\n\n\t\t</div>\n\n\t\t<?php\n\t\t$content = ob_get_contents();\n\t\tob_end_clean();\n\n\t\treturn $content;\n\t}", "function __construct(){\n\t\t$out='';\n\t\t$_SESSION['Titles']['title'].=' / Публикации';\n\t\t$_SESSION['Road'].='Публикации';\n\t\t$nowPage = isset($_GET['page'])?(int)$_GET['page']:1;\n\t\tif ($nowPage<1){\n\t\t\t$nowPage = 1;\n\t\t}\n\t\t$page = $nowPage-1;\n\t\t$limit = 7;\n\t\t$start = abs($limit*$page);\n\t\t$sql = mysql_query(\"select * from `files` where `active`='1' order by `pos` limit {$start}, {$limit}\");\n\t\tif (is_resource($sql) && mysql_num_rows($sql)>0){\n\t\t\t$out.='<ul class=\"list2\">';\n\t\t\twhile (($row = mysql_fetch_assoc($sql))!=false){\n\t\t\t\tif (file_exists('files/publications/'.$row['fileName'].'_'.$row['id'].'.'.$row['ext'].'')){\n\t\t\t\t$out.='<li>\n\t\t\t\t\t\t<h5>'.$row['name'].'</h5>\n\t\t\t\t\t\t<h6>'.$row['shortdesc'].'</h6>\n\t\t\t\t\t\t<p>'.strip_tags($row['fulldesc'],'<a><br><span><font><sup><b><strong>').'</p>\n\t\t\t\t\t\t<span><a target=\"_blank\" href=\"files/publications/'.$row['fileName'].'_'.$row['id'].'.'.$row['ext'].'\"><img alt=\"\" src=\"template/default/img/icon31.gif\">Подробнее</a>('.strtoupper($row['ext']).'; '.number_format(filesize('files/publications/'.$row['fileName'].'_'.$row['id'].'.'.$row['ext'].'')/1024, 0).' КБ)</span>\n\t\t\t\t\t</li>';\n\t\t\t\t}\n\t\t\t}\n\t\t\t$out.='</ul>';\n\t\t\t$count = mysql_result(mysql_query(\"select count(*) from `files` where `active`='1'\"),0);\n\t\t\t$total = ceil($count/$limit);\n\t\t\tif ($total>1){\n\t\t\t\t$out.='<p align=\"center\">Страницы: ';\n\t\t\t\t$pages = array();\n\t\t\t\tfor ($i=1; $i<=$total; $i++){\n\t\t\t\t\tif ($i==1){\n\t\t\t\t\t\t$link = '?publications';\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$link = \"?publications&page={$i}\";\n\t\t\t\t\t}\n\t\t\t\t\tif ($i==$nowPage){\n\t\t\t\t\t\t$pages[] = \"<strong>{$i}<strong>\";\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$pages[] = \"<a href='{$link}'>{$i}</a>\";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t$out.=implode(\"&nbsp;|&nbsp;\", $pages);\n\t\t\t\t$out.='</p>';\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$out.='<p align=\"center\">Нет ни одной записи</p>';\n\t\t}\n\t\t$this->over = $out;\n\t}", "function PubList($folder, $criterion) {\n\n\t// Check whether we have the required trailing slash\n\tif (substr($folder, -1) != '/') {\n\t\t$folder = $folder . '/';\n\t}\n\n\t$lsla = opendir($folder);\n\n\t// Load all the folder content into our local arrays\n\twhile($file = readdir($lsla)) {\n\n\t\t$publication = new Publication();\n\t\t$publication->Build($folder, $file);\n\n\t\tswitch (strtoupper($publication->getExtension())) { // Sort the different files found according to their extension\n\n\t\t\tcase 'BIB';\n\t\t\t\t$citation = New Citation();\n\t\t\t\t$citation->Build($publication);\n\t\t\t\t$BIBs[$publication->getBasename()] = $citation;\n\t\t\t\tbreak;\n\n\t\t\tcase 'PDF';\n\t\t\t\t$PDFs[$publication->getBasename()] = $publication;\n\t\t\t\tbreak;\n\n\t\t\tcase 'DVI';\n\t\t\t\t$DVIs[$publication->getBasename()] = $publication;\n\t\t\t\tbreak;\n\n\t\t\tcase 'PS';\n\t\t\t\t$PSs[$publication->getBasename()] = $publication;\n\t\t\t\tbreak;\n\n\t\t\tcase 'GZ';\n\t\t\t\t$PSZs[$publication->getBasename()] = $publication;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tforeach ($BIBs as $paper => $citation) { // We are using the name without its extension as the index of these arrays\n\n\t\t$item = '<b>' . $citation->getTitle() . '.</b> ' . $citation->getAuthor();\n if ( $citation->getJournal() ) {\n\t\t\t$item = $item . '. <i>' . $citation->getJournal() . '</i>, ' . $citation->getVolume() . '(' . $citation->getNumber() . ')' . ', ';\n\t\t} else {\n\t\t\t$item = $item . '. In <i>' . $citation->getBooktitle() . '</i>, ';\n\t\t}\n\t\t$item = $item . $citation->getYear() . '. Available as:';\n\n\t\t$links='';\n\t\tif (!empty($PDFs) && isset($PDFs[$paper])) {\n\t\t\t$links=$links . ' <A HREF=\"' . $PDFs[$paper]->getFullname() . '\">[PDF]</A>';\n\t\t}\n\t\tif (!empty($PSs) && isset($PSs[$paper])) {\n\t\t\t$links=$links . ' <A HREF=\"' . $PSs[$paper]->getFullname() . '\">[PS]</A>';\n\t\t}\n\t\tif (!empty($PSZs) && isset($PSZs[$paper])) {\n\t\t\t$links=$links . ' <A HREF=\"' . $PSZs[$paper]->getFullname() . '\">[PSZ]</A>';\n\t\t}\n\t\tif (!empty($DVIs) && isset($DVIs[$paper])) {\n\t\t\t$links=$links . ' <A HREF=\"' . $DVIs[$paper]->getFullname() . '\">[DVI]</A>';\n\t\t}\n\n $bibfile = $citation->getPublication();\n\t\t$links = $links . ' <A HREF=\"' . $bibfile->getFullname() . '\">[BiBTeX]</A>';\n\t\t\n\t\t$items[] = array($citation->getYear(), $item . $links); // Keep the HTML code in an array for easy reordering\n\t}\n\n\tusort($items, $criterion); // Apply the supplied criterion\n\n\t// Here we can output the content of the publication list as we see fit... happy hacking!\n\techo \"<UL>\\n\";\n\tforeach ($items as $index => $entry)\n\t\techo \"<li>$entry[1]</li>\\n\";\n\techo \"</UL>\\n\";\n}", "public function getAllPublishedMore($limit = 0, $start = 0, $checkRight = false, $topic = 0, $ihome = 0, $asobject = true, $order = 'published', $topic_frontpage = false, $subs = false)\n {\n //global $xoopsDB;\n\n $db = XoopsDatabaseFactory::getDatabaseConnection();\n\n $myts = MyTextSanitizer::getInstance();\n\n $ret = [];\n\n $critadd = '';\n\n //if subs is true\n\n if (true === $subs) {\n $sqlz = 'SELECT topic_id FROM ' . $db->prefix('topics') . ' WHERE (topic_pid=' . $topic . ')';\n\n $resultz = $db->query($sqlz);\n\n while ($topicz = $db->fetchArray($resultz)) {\n $critadd .= ' OR topicid=' . $topicz['topic_id'] . ' ';\n }\n\n //$critadd .= \")\";\n }\n\n $sql = 'SELECT s.*, t.* FROM ' . $db->prefix('stories') . ' s, ' . $db->prefix('topics') . ' t WHERE (published > 0 AND published <= ' . time() . ') AND (expired = 0 OR expired > ' . time() . ') AND (s.topicid=t.topic_id) ';\n\n if (0 != $topic) {\n if (!is_array($topic)) {\n if ($checkRight) {\n $topics = MygetItemIds('news_view');\n\n if (!in_array($topic, $topics, true)) {\n return null;\n } \n\n $sql .= ' AND (topicid=' . (int)$topic . ' ' . $critadd . ') AND (ihome=1 OR ihome=0)';\n } else {\n $sql .= ' AND topicid=' . (int)$topic . ' AND (ihome=1 OR ihome=0)';\n }\n } else {\n if ($checkRight) {\n $topics = MygetItemIds('news_view');\n\n $topic = array_intersect($topic, $topics);\n }\n\n if (count($topic) > 0) {\n $sql .= ' AND topicid IN (' . implode(',', $topic) . ')';\n } else {\n return null;\n }\n }\n } else {\n if ($checkRight) {\n $topics = MygetItemIds('news_view');\n\n if (count($topics) > 0) {\n $topics = implode(',', $topics);\n\n $sql .= ' AND topicid IN (' . $topics . ')';\n } else {\n return null;\n }\n }\n\n if (0 == (int)$ihome) {\n $sql .= ' AND ihome=0';\n }\n }\n\n if ($topic_frontpage) {\n $sql .= ' AND t.topic_frontpage=1';\n }\n\n $sql .= \" ORDER BY s.$order DESC\";\n\n $result = $db->query($sql, (int)$limit, (int)$start);\n\n while ($myrow = $db->fetchArray($result)) {\n if ($asobject) {\n $ret[] = new NewsStory($myrow);\n } else {\n $ret[$myrow['storyid']] = htmlspecialchars($myrow['title'], ENT_QUOTES | ENT_HTML5);\n }\n }\n\n return $ret;\n }", "function add_navigation($tp, $page, $npages, $order, $mode, $extra_params)\n{\n #\n # Display links to change mode or ordering\n #\n $params = [\n 'page' => 1,\n 'order' => $order,\n ];\n $params = array_merge($params, $extra_params);\n\n if ($mode == \"thumbnail\") {\n $params[\"mode\"] = \"listing\";\n $tp['alt_display_label'] = 'Listing';\n } else {\n $params[\"mode\"] = \"thumbnail\";\n $tp['alt_display_label'] = 'Thumbnails';\n }\n $tp['ne_alt_display_url'] = encode_argv_url($params);\n\n $params = [\n 'page' => 1,\n 'mode' => $mode,\n ];\n $params = array_merge($params, $extra_params);\n\n if ($order == \"location\") {\n $params[\"order\"] = \"year\";\n $tp['alt_order_label'] = 'Year';\n } else {\n $params[\"order\"] = \"location\";\n $tp['alt_order_label'] = 'Location';\n }\n $tp['ne_alt_order_url'] = encode_argv_url($params);\n\n if ($npages <= 1) {\n return $tp;\n }\n\n if ($mode == \"thumbnail\") {\n #\n # Instantiate the page navigation templates for the top and bottom of\n # the page\n #\n $tp['page'] = $page;\n $tp['npages'] = $npages;\n\n $params = [\n 'mode' => $mode,\n 'order' => $order,\n ];\n $params = array_merge($params, $extra_params);\n\n if ($page > 1) {\n $params['page'] = 1;\n $tp['ne_nav_first_page_url'] = encode_argv_url($params);\n $params['page'] = $page - 1;\n $tp['ne_nav_prev_page_url'] = encode_argv_url($params);\n }\n\n if ($page < $npages) {\n $params['page'] = $page + 1;\n $tp['ne_nav_next_page_url'] = encode_argv_url($params);\n $params['page'] = $npages;\n $tp['ne_nav_last_page_url'] = encode_argv_url($params);\n }\n }\n\n return $tp;\n}", "function getPreferenceLinks()\n {\n }", "function getContent($type, $entries, $imgLink=false, $mainTitles){\n\t$html='';\n if(count($entries)) {\n \tuasort($entries,'compare_bib_entry_by_year');\n \t// uasort($entries,'compare_bib_entry_by_name');\n\t\t$numberImg = 0;\n\t\t\n\t\tforeach ($entries as $bibentry) {\n\t\t\tif($bibentry->getType() == $type) {\n\t\t\t\n\t\t\t\t// Make the float of div - left or right\n\t\t\t\tif($numberImg%2 == 0) { $classImg = 'Right'; $classContent = 'Left'; }\n\t\t\t\telse { $classImg = 'Left'; $classContent = 'Right';}\n\t\t\t\t\n\t\t\t\t// Title\n\t\t\t\t$title = $bibentry->getTitle();\n\t\t\t\t$title = str_replace(\"\\\\textbf\",\"\", $title);\n\t\t\t\t\n\t\t\t\t// URL OR FILE\n\t\t\t\t$html .= \"<div id=\\'\" . $type . \"\\'><div class=\\'prContent\" . $classContent . \"\\'> \".\n\t\t\t\t\t\"<p><b>\" . $bibentry->getField(\"Chapter\") . \"</b></p>\".\n\t\t\t\t\t\"<p class=\\'title\\' >\" ;\n\t\t\t\tif($bibentry->getField(\"url\") != \"\") {\n\t\t\t\t\t$html .= \"<a target=\\'_blank\\' href=\\'\" . $bibentry->getField(\"url\") . \"\\'> \"\n\t\t\t\t\t. $title . \"</p></a>\";\n\t\t\t\t} \n\t\t\t\telse if($bibentry->getField(\"file\") != \"\" ) {\n\t\t\t\t\t$html .= \"<a target=\\'_blank\\' href=\\'\" . $bibentry->getField(\"file\") . \"\\'> \"\n\t\t\t\t\t. $title . \"</p></a>\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$html .= $title . \"</p>\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Author\n\t\t\t\tif ($bibentry->getAuthor() != \"\") {\n\t\t\t\t\t$authorName = authorToStr($bibentry->getAuthor(), $mainTitles[\"app\"]) ; \n\t\t\t\t\t$html .= \"<p>\" . $authorName . \"</p>\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Project partner\n\t\t\t\t$html .= \"<p>\" . $mainTitles[\"pp\"] . \": \" . $bibentry->getField(\"editor\") . \"</p>\";\n\t\t\t\t // Funds Projects \n\t\t\t\t$html .= \"<p class=\\'year\\'>\" . $mainTitles[\"year\"] . \": \" . $bibentry->getField(\"publisher\") . \"</p>\";\n\t\t\t\t\n\t\t\t\t// Project staff\n\t\t\t\tif ($bibentry->getField(\"note\") != \"\")\n\t\t\t\t\t$html .= \"<p>\" . authorToStr($bibentry->getField(\"note\"), $mainTitles[\"ps\"]) . \"</p>\";\n\t\t\t\t\n\t\t\t\t// WEB\n\t\t\t\t//if( $bibentry->getField(\"url\")!= \"\")\n\t\t\t\t//\t$html .= \"<p>\" . $mainTitles[\"web\"] . \": <a href=\\'\" . $bibentry->getField(\"url\") . \"\\'> \" . $bibentry->getField(\"url\") . \"</a></p></div>\";\n\t\t\t\t//else $html .= \"</div>\";\n\t\t\t\t$html .= \"</div>\";\n\t\t\t\t// Image \n\t\t\t\t//if (url_check(\"https://github.com/environmentalinformatics-marburg/cvs/blob/master/projects/graphics/\".$bibentry->getKey().\".png\")) {\n\t\t\t\t\t//if ($imgLink) {\n\t\t\t\t\t$html .= \"<div class=\\'prImg\" .$classImg . \n\t\t\t\t\t\t\"\\'><img width=\\\"205\\\" height=\\\"180\\\" src=\\\"https://github.com/environmentalinformatics-marburg/cvs/blob/master/projects/graphics/\"\n\t\t\t\t\t\t. $bibentry->getKey() .\".png?raw=true\\\" /> </div></div>\";\n\t\t\t\t\t//}\n\t\t\t\t\t//else {\n\t\t\t\t\t//\t$html .= \"<div class=\\'prImg\" .$classImg . \"\\'></div></div>\";\n\t\t\t\t\t//} \n\n\t\t\t\t // Comment\n\t\t\t\t $html .= \"<div id=\\'commentContent\\'><p class=\\'comment\\'>\" . $bibentry->getField(\"comment\") . \"<a href=\\'\" . $bibentry->getField(\"url\") . \"\\'> ...</a></p></div>\";\n\t\t\t\t//}\n\t\t\t\t$numberImg += 1;\n\t\t\t}\n\t\t}\n\t}\n\treturn $html;\n}", "function &urlList( $type, $category = 0, $offset = 0 )\r\n {\r\n $ini =& INIFile::globalINI();\r\n $ret = false;\r\n switch( $type )\r\n {\r\n case \"article\":\r\n {\r\n include_once( \"ezarticle/classes/ezarticle.php\" );\r\n include_once( \"ezarticle/classes/ezarticlecategory.php\" );\r\n $limit = $ini->read_var( \"eZArticleMain\", \"AdminListLimit\" );\r\n $cat = new eZArticleCategory( $category );\r\n $categories = $cat->getByParent( $cat, false, \"name\" );\r\n $articles = $cat->articles( \"alpha\", false, true, $offset, $limit );\r\n $num_articles = $cat->articleCount( false, true );\r\n $path = $cat->path( $category );\r\n $category_path = array();\r\n foreach( $path as $path_item )\r\n {\r\n $category_path[] = array( \"id\" => $path_item[0],\r\n \"name\" => $path_item[1] );\r\n }\r\n $category_array = array();\r\n $category_url = \"/article/archive\";\r\n foreach( $categories as $category )\r\n {\r\n $id = $category->id();\r\n $url = \"$category_url/$id\";\r\n $category_array[] = array( \"name\" => $category->name(),\r\n \"id\" => $id,\r\n \"url\" => $url );\r\n }\r\n $article_array = array();\r\n $article_url = \"/article/view\";\r\n foreach( $articles as $article )\r\n {\r\n $id = $article->id();\r\n $cat = $article->categoryDefinition();\r\n $cat = $cat->id();\r\n $url = \"$article_url/$id/$cat/1\";\r\n $article_array[] = array( \"name\" => $article->name(),\r\n \"id\" => $id,\r\n \"url\" => $url );\r\n }\r\n $ret = array();\r\n $ret[\"path\"] = $category_path;\r\n $ret[\"categories\"] = $category_array;\r\n $ret[\"items\"] = $article_array;\r\n $ret[\"item_total_count\"] = $num_articles;\r\n $ret[\"max_items_shown\"] = $limit;\r\n break;\r\n }\r\n }\r\n return $ret;\r\n }", "function get_prev_sponsors_list($value='')\r{?>\r\r<ul class=\"media-grid\">\r <li>\r <li>\r <a href=\"http://www.reebok.com/en-IN/\" target=\"_blank\" class=\"external\">\r <img class=\"thumbnail\" src=\"./media/sponsors/icons/logo_reebok.png\" alt=\"\">\r </a>\r </li>\r <a href=\"http://www.aircel.com\" target=\"_blank\" class=\"external\">\r <img class=\"thumbnail\" src=\"./media/sponsors/icons/logoAircel.JPG\" alt=\"\">\r </a>\r </li>\r <li>\r <a href=\"http://www.wipro.com\" target=\"_blank\" class=\"external\">\r <img class=\"thumbnail\" src=\"./media/sponsors/icons/logoWipro.jpg\" alt=\"\">\r </a>\r </li>\r <li>\r <a href=\"http://www.deedee.co.in/\" target=\"_blank\" class=\"external\">\r <img class=\"thumbnail\" src=\"./media/sponsors/icons/logo_deedee.jpg\" alt=\"\">\r </a>\r </li>\r <li>\r <a href=\"http://in.redhat.com\" target=\"_blank\" class=\"external\">\r <img class=\"thumbnail\" src=\"./media/sponsors/icons/logo_redhat.jpg\" alt=\"\">\r </a>\r </li>\r <li>\r <a href=\"http://www.tataindicom.com\" target=\"_blank\" class=\"external\">\r <img class=\"thumbnail\" src=\"./media/sponsors/icons/logo_tata.gif\" alt=\"\">\r </a>\r </li>\r\r</ul>\r\r\r<?php \r }", "function get_parade_social_links_paragraphs_type_data() {\n $fields = [\n ['Anchor', 'parade_anchor', 'Text (plain)'],\n ['Color scheme', 'parade_color_scheme', 'Entity reference'],\n ['Social links', 'parade_social_link', 'Link'],\n ['Title', 'parade_title', 'Text (plain)'],\n ];\n\n $views = [\n 'default' => [\n ['Content'],\n ['Title', '- Hidden -', 'Plain text'],\n ['Social links', '- Visually Hidden -', 'Link'],\n ['Anchor', 'Above', 'Plain text'],\n ['Color scheme', 'Above', 'Label'],\n ],\n ];\n\n $forms = [];\n\n return [\n 'fields' => $fields,\n 'views' => $views,\n 'forms' => $forms,\n ];\n}", "public function links_listing() {\n\t$single_list = array();\n\t$regexa = '/^(http:|https:|mailto:|ftp:|#)/';\n\t$regexb = '/^(' . preg_quote($this->_domain, '/') . ')/';\n\tforeach ($this->_html->find('a') as $links) {\n\t $any_link = $links->href;\n\t if (!preg_match($regexa, $any_link) || preg_match($regexb, $any_link)) {\n\t\t$single_list[] = $any_link;\n\t }\n\t}\n\tvar_dump($this->_domain);\n\t//Associating each link to the page list array if it's not part of it yet\n\tforeach ($single_list as $value) {\n\t\tif (!preg_match('/^.*\\.(jpg|jpeg|png|gif|JPG|JPEG|GIF|pdf|PDF|wrd|wrdx|mp3)$/i', $value)) {\n\n\t\t\t//Checking of the link found starts with either http or / in which case we fix the url to absolute\n\t\t\t$a = strpos($value, 'http', 0);\n\t\t\t$b = strpos($value, '/', 0);\n\t\t\t$c = strpos($value, '../', 0);\n\t\t\tif ($a === 0) {\n\t\t\t\t$tvalue = $value;\n\t\t\t} elseif ($b === 0) {\n\t\t\t\t$tvalue = $this->_domain . $value;\n\t\t\t} elseif ($c === 0) {\n\t\t\t\t$tvalue = $this->_domain;\n\t\t\t} else {\n\t\t\t\t$tvalue = $this->_domain . '/' . $value;\n\t\t\t}\t\n\t\t\tif (!in_array($tvalue, $_SESSION['page_list'])) {\n\t\t\t\t if (!in_array($tvalue, $_SESSION['page_list_done']) && $tvalue != @$_SESSION['next_page']) {\n\t\t\t\t\tarray_push($_SESSION['page_list'], $tvalue);\n\t\t\t\t}\n\t\t\t}\t\t\n\t\t}\n\t}\n }", "function mos_greviews_settings_link($links) { \n $settings_link = '<a href=\"'.MOS_GREVIEWS_SETTINGS.'\">Settings</a>'; \n array_unshift($links, $settings_link); \n return $links; \n}", "private function getFooterNavLinks(){\n $sidebar = $this->getSidebar();\n // returns content from wiki/Mediawiki:Sidebar \n // plus a few internal defaults like SEARCH, LANGUAGES, TOOLBOX and TOOLBOXEND\n unset($sidebar['SEARCH']);\n unset($sidebar['LANGUAGES']);\n unset($sidebar['TOOLBOXEND']); //show \"Duplicate this page\" link occasionally?\n \n $html = '';\n foreach ($sidebar as $category => $linkGroup){\n if (!$linkGroup['content']){\n continue;\n }else{\n //force to array\n $linkGroup['content'] = is_array($linkGroup['content'])? $linkGroup['content'] : array($linkGroup['content']);\n }\n $html .= '<div class=\"footer-links\">'.\"\\n\";\n //$html .= ' <h4>'.$linkGroup['header'].'</h4>'.\"\\n\";\n $html .= ' <ul>'.\"\\n\";\n foreach ($linkGroup['content'] as $key => $linkObj){\n if (is_string($linkObj)){\n $html .= $linkObj;\n } else {\n $html .= $this->makeListItem($key, $linkObj);\n }\n }\n $html .= ' </ul>'.\"\\n\";\n $html .= '</div>';\n }\n\n return $html;\n }", "public static function getAllPublication() :array {\n \tglobal $base, $login, $password;\n\n $publicationGW = new PublicationGateway(new Connection($base, $login, $password));\n $results = $publicationGW->getAllPublications(); \n $data = array();\n foreach ($results as $row){\n $data[]=new Publication ($row['ID'], $row['reference'], $row['authors'], $row['title'], $row['date'], $row['journal'], $row['volume'], $row['number'], $row['pages'], $row['note'], $row['abstract'], $row['keywords'], $row['series'], $row['localite'], $row['publisher'], $row['editor'], $row['pdf'], $row['date_display'], $row['categorie_id']);\n }\n \n return $data;\n }", "function getNavs() {\n\t$pageData = getPageData();\n\t$li = '';\n\tforeach($pageData as $k => $v) {\n\t\t$li .= '<li><a href=\"' . COVER_PAGE . '?show=' . $k .'\">' . $k . '</a></li>' . \"\\n\";\n\t}\n\treturn $li;\n}", "function build_pagelinks($data)\n\t{\n\t\t$data['leave_out'] = isset($data['leave_out']) ? $data['leave_out'] : '';\n\t\t$data['no_dropdown'] = isset($data['no_dropdown']) ? intval( $data['no_dropdown'] ) : 0;\n\t\t$data['USE_ST']\t\t = isset($data['USE_ST'])\t? $data['USE_ST']\t : '';\n\t\t$work = array( 'pages' => 0, 'page_span' => '', 'st_dots' => '', 'end_dots' => '' );\n\t\t\n\t\t$section = !$data['leave_out'] ? 2 : $data['leave_out']; // Number of pages to show per section( either side of current), IE: 1 ... 4 5 [6] 7 8 ... 10\n\t\t\n\t\t$use_st = !$data['USE_ST'] ? 'st' : $data['USE_ST'];\n\t\t\n\t\t//-----------------------------------------\n\t\t// Get the number of pages\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( $data['TOTAL_POSS'] > 0 )\n\t\t{\n\t\t\t$work['pages'] = ceil( $data['TOTAL_POSS'] / $data['PER_PAGE'] );\n\t\t}\n\t\t\n\t\t$work['pages'] = $work['pages'] ? $work['pages'] : 1;\n\t\t\n\t\t//-----------------------------------------\n\t\t// Set up\n\t\t//-----------------------------------------\n\t\t\n\t\t$work['total_page'] = $work['pages'];\n\t\t$work['current_page'] = $data['CUR_ST_VAL'] > 0 ? ($data['CUR_ST_VAL'] / $data['PER_PAGE']) + 1 : 1;\n\t\t\n\t\t//-----------------------------------------\n\t\t// Next / Previous page linkie poos\n\t\t//-----------------------------------------\n\t\t\n\t\t$previous_link = \"\";\n\t\t$next_link = \"\";\n\t\t\n\t\tif ( $work['current_page'] > 1 )\n\t\t{\n\t\t\t$start = $data['CUR_ST_VAL'] - $data['PER_PAGE'];\n\t\t\t$previous_link = $this->compiled_templates['skin_global']->pagination_previous_link(\"{$data['BASE_URL']}&amp;$use_st=$start\");\n\t\t}\n\t\t\n\t\tif ( $work['current_page'] < $work['pages'] )\n\t\t{\n\t\t\t$start = $data['CUR_ST_VAL'] + $data['PER_PAGE'];\n\t\t\t$next_link = $this->compiled_templates['skin_global']->pagination_next_link(\"{$data['BASE_URL']}&amp;$use_st=$start\");\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Loppy loo\n\t\t//-----------------------------------------\n\t\t\n\t\tif ($work['pages'] > 1)\n\t\t{\n\t\t\t$work['first_page'] = $this->compiled_templates['skin_global']->pagination_make_jump($work['pages'], $data['no_dropdown']);\n\t\t\t\n\t\t\tif ( 1 < ($work['current_page'] - $section))\n\t\t\t{\n\t\t\t\t$work['st_dots'] = $this->compiled_templates['skin_global']->pagination_start_dots($data['BASE_URL']);\n\t\t\t}\n\t\t\t\n\t\t\tfor( $i = 0, $j= $work['pages'] - 1; $i <= $j; ++$i )\n\t\t\t{\n\t\t\t\t$RealNo = $i * $data['PER_PAGE'];\n\t\t\t\t$PageNo = $i+1;\n\t\t\t\t\n\t\t\t\tif ($RealNo == $data['CUR_ST_VAL'])\n\t\t\t\t{\n\t\t\t\t\t$work['page_span'] .= $this->compiled_templates['skin_global']->pagination_current_page( ceil( $PageNo ) );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif ($PageNo < ($work['current_page'] - $section))\n\t\t\t\t\t{\n\t\t\t\t\t\t// Instead of just looping as many times as necessary doing nothing to get to the next appropriate number, let's just skip there now\n\t\t\t\t\t\t$i = $work['current_page'] - $section - 2;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// If the next page is out of our section range, add some dotty dots!\n\t\t\t\t\t\n\t\t\t\t\tif ($PageNo > ($work['current_page'] + $section))\n\t\t\t\t\t{\n\t\t\t\t\t\t$work['end_dots'] = $this->compiled_templates['skin_global']->pagination_end_dots(\"{$data['BASE_URL']}&amp;$use_st=\".($work['pages']-1) * $data['PER_PAGE']);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$work['page_span'] .= $this->compiled_templates['skin_global']->pagination_page_link(\"{$data['BASE_URL']}&amp;$use_st={$RealNo}\", ceil( $PageNo ) );\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$work['return'] = $this->compiled_templates['skin_global']->pagination_compile($work['first_page'],$previous_link,$work['st_dots'],$work['page_span'],$work['end_dots'],$next_link,$data['TOTAL_POSS'],$data['PER_PAGE'], $data['BASE_URL'], $data['no_dropdown'], $use_st);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$work['return'] = $data['L_SINGLE'];\n\t\t}\n\t\n\t\treturn $work['return'];\n\t}" ]
[ "0.5744485", "0.57262945", "0.57041144", "0.5616822", "0.5608698", "0.5559315", "0.55447", "0.5514282", "0.5469317", "0.5389588", "0.5385524", "0.5381958", "0.5378772", "0.53763646", "0.5365509", "0.5351702", "0.5324719", "0.52980936", "0.5293411", "0.5272681", "0.526629", "0.525956", "0.5249529", "0.52446723", "0.52346843", "0.5229045", "0.52197427", "0.52161163", "0.5214983", "0.5212767" ]
0.6487439
0
Set if the payment method should be enforced. This field can be used to send or, after a failed payment, the consumer can or can not select another payment method to still pay the payment. Valid values are: static::PAYMENT_METHOD_ENFORCE_ONCE static::PAYMENT_METHOD_ENFORCE_ALWAYS In the case of FORCE_ONCE, the indicated paymentMethod is only enforced on the first transaction. If this fails, the consumer can still choose another payment method. When FORCE_ALWAYS is chosen, the consumer can not choose another payment method
public function setEnforcePaymentMethod($value) { return $this->setParameter('enforcePaymentMethod', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setDefaultActivePaymentMethod()\n {\n $criteria = new CDbCriteria;\n $criteria->select = 't.name, t.value';\n $criteria->condition = \"t.name LIKE 'payment_method_%' AND t.value = 1\";\n\n $data = Option::model()->findAll($criteria);\n\n $payment_method_options = array();\n\n foreach($data as $option) {\n if($option->name == 'payment_method_paypal') $payment_method_options[] = self::PAYMENT_METHOD_PAY_PAL;\n if($option->name == 'payment_method_skrill') $payment_method_options[] = self::PAYMENT_METHOD_MONEY_BOOKERS;\n if($option->name == 'payment_method_wiretransfer') $payment_method_options[] = self::PAYMENT_METHOD_WIRE_TRANSFER;\n if($option->name == 'payment_method_check') $payment_method_options[] = self::PAYMENT_METHOD_CHECK;\n if($option->name == 'payment_method_no_payment') $payment_method_options[] = self::PAYMENT_METHOD_NO_PAYMENT;\n }\n\n if(empty($payment_method_options))\n $payment_method_options[] = self::PAYMENT_METHOD_PAY_PAL;\n\n if(!in_array($this->payment_method, $payment_method_options))\n $this->payment_method = $payment_method_options[0];\n }", "public function setIsForced($forced = true)\n {\n $this->isForced = (bool) $forced;\n }", "public function setForceDelivery($force) {\n $this->setParam('force', $force);\n return $this;\n }", "public function setForce($var)\n {\n GPBUtil::checkBool($var);\n $this->force = $var;\n\n return $this;\n }", "public function setForce(bool $force = null)\n {\n $this->force = $force;\n\n return $this;\n }", "public function setForce($force) {\n $this->_force = $force;\n return $this;\n }", "public function setIsForced($isForced) {\n $this->isForced = $isForced;\n }", "public function payment_method_is_required() {\n\t\treturn true;\n\t}", "public function isForce()\n {\n return $this->force;\n }", "public function isForced()\n {\n return $this->forced;\n }", "public function isForced()\n {\n return $this->isForced;\n }", "public function isForced() {\n return $this->isForced;\n }", "public function forceApprove(): self\n {\n $this->googleClient->setApprovalPrompt(self::FORCE);\n\n return $this;\n }", "protected function _initPaymentMethod($paymentMethod)\n {\n /**\n *\n * @note Check if quote is free\n *\n */\n if ($this->_isFreeQuote()) {\n /**\n *\n * @note If it is a free quote then use free payment method\n *\n */\n $paymentMethod = Free::PAYMENT_METHOD_FREE_CODE;\n }\n\n /**\n *\n * @note Add payment method\n *\n */\n $data[PaymentInterface::KEY_METHOD] = $paymentMethod;\n\n /**\n *\n * @note Save payment information\n *\n */\n $this->savePayment($data);\n }", "public function setOrderMethod($value)\n {\n $this->order_method = $value;\n $this->setSettingValue('retailcrm_order_method', $value);\n }", "public function getIsForced()\n {\n return $this->isForced;\n }", "public function setPaymentMethod($paymentMethod = 'CC') {\n $method = array(\n 'x_method'=>strtoupper($paymentMethod),\n );\n $this->NVP = array_merge($this->NVP, $method); \n }", "public function setForcedShipmentWithInvoice($forcedShipmentWithInvoice);", "public function setIsAutomatic($isAutomatic)\n {\n $this->isAutomatic = $isAutomatic;\n }", "public function isSetPaymentMethod()\n {\n return !is_null($this->_fields['PaymentMethod']['FieldValue']);\n }", "function updatePaymentMethodOptions() {\n try {\n $payments_table = TABLE_PREFIX . 'payments';\n\n if (!in_array('method', $this->listTableFields($payments_table))) {\n DB::execute(\"ALTER TABLE $payments_table ADD method VARCHAR(100) DEFAULT '' AFTER comment\");\n } // if\n\n DB::execute('INSERT INTO ' . TABLE_PREFIX . \"config_options (name, module, value) VALUES ('payment_methods_common', 'payments', ?)\", serialize(array('Bank Deposit','Check','Cash','Credit','Debit')));\n DB::execute('INSERT INTO ' . TABLE_PREFIX . \"config_options (name, module, value) VALUES ('payment_methods_credit_card', 'payments', ?)\", serialize(array('Credit Card','Credit Card (Visa)','Credit Card (Mastercard)','Credit Card (Discover)','Credit Card (American Express)','Credit Card (Diners)')));\n DB::execute('INSERT INTO ' . TABLE_PREFIX . \"config_options (name, module, value) VALUES ('payment_methods_online', 'payments', ?)\", serialize(array('Online Payment', 'Online Payment (PayPal)', 'Online Payment (Authorize)')));\n\n } catch(Exception $e) {\n return $e->getMessage();\n } // try\n\n return true;\n }", "public function initPaymentMethod()\n {\n $helper = Mage::helper('onestepcheckout/payment');\n // check if payment saved to quote\n if (!$this->getQuote()->getPayment()->getMethod()) {\n $data = array();\n $paymentMethods = $helper->getPaymentMethods();\n if ((count($paymentMethods) == 1)) {\n $currentPaymentMethod = current($paymentMethods);\n $data['method'] = $currentPaymentMethod->getCode();\n } elseif ($lastPaymentMethod = $helper->getLastPaymentMethod()) {\n $data['method'] = $lastPaymentMethod;\n } elseif ($defaultPaymentMethod = Mage::helper('onestepcheckout/config')->getDefaultPaymentMethod()) {\n $data['method'] = $defaultPaymentMethod;\n }\n if (!empty($data)) {\n try {\n $this->getOnepage()->savePayment($data);\n } catch (Exception $e) {\n // catch this exception\n }\n }\n }\n }", "public function isForced() : bool {\n return $this->isForced;\n }", "public function setStrictEnforcement(?bool $value): void {\n $this->getBackingStore()->set('strictEnforcement', $value);\n }", "public function force($flag = true) {\n\t\t$this->force = (boolean) $flag;\n\t\treturn $this;\n\t}", "public function force($flag = true) {\n\t\t$this->force = (boolean) $flag;\n\t\treturn $this;\n\t}", "public static function setHttpMethodOverride($override = true)\n {\n self::$_httpMethodOverride = $override;\n }", "public static function setMethod($val) \n { \n emailSettings::$method = $val; \n }", "public function setFormMethod($_method=false){\n return $this->_method = (\n (is_bool($_method))\n ?$this->_method_default[(int)$_method]\n :($this->_method_default[0])\n );\n }", "public function setPaymentMethod($paymentMethod){\n return $this->setData(self::PAYMENT_METHOD, $paymentMethod);\n }" ]
[ "0.5388515", "0.534212", "0.52513963", "0.5211061", "0.51993185", "0.5190853", "0.50417364", "0.5037711", "0.50114244", "0.48525178", "0.4734758", "0.47331938", "0.47291714", "0.470839", "0.47006637", "0.46893728", "0.46621343", "0.46448672", "0.46322578", "0.46276504", "0.4613779", "0.46069404", "0.45885658", "0.4553217", "0.44791523", "0.44791523", "0.44441435", "0.4442366", "0.44168913", "0.44157562" ]
0.6538562
0
The the input, rules and custom messages. The class, custom and config messages will be merged at this point.
public function __construct($input, $rules, $messages = array()) { $this->input = $input; $this->rules = $rules; $this->messages = array_merge($this->messages, (array) Config::get('validator'), $messages); $this->process(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function setupRules()\n {\n // Validator::extend('rule', 'App\\Support\\Rules\\Rule@validate');\n // Validator::replacer('rule', 'App\\Support\\Rules\\Rule@message');\n }", "public function __construct()\n {\n $lines = require __DIR__ .DS .'messages.php';\n\n $this->messages = array('validation' => $lines);\n }", "protected function get_inputs_rules(){return $this->input['inputs_rules'];}", "function readInputData() {\n\t\t$this->readUserVars(array('monographId', 'decision', 'personalMessage'));\n\t}", "public function get_validation_messages() {\n\t\t$field = $this->field;\n\t\t$id = $this->get_id( $field );\n\t\t$is_required = $this->is_required( $field );\n\t\t$messages = '';\n\n\t\t$post_title = self::get_property( 'post_title', $field, '' );\n\t\t$post_content = self::get_property( 'post_content', $field, '' );\n\t\t$post_excerpt = self::get_property( 'post_excerpt', $field, '' );\n\t\t$post_image = self::get_property( 'post_image', $field, '' );\n\t\t$setting_required_message = self::get_property( 'required_message', $field, '' );\n\t\t$post_type = self::get_property( 'post_type', $field, 'post' );\n\n\t\t$post_title_enabled = ! empty( $post_title );\n\t\t$post_content_enabled = ! empty( $post_content );\n\t\t$post_excerpt_enabled = ! empty( $post_excerpt );\n\t\t$post_image_enabled = ! empty( $post_image );\n\t\t$category_list = forminator_post_categories( $post_type );\n\n\t\tif ( $is_required ) {\n\t\t\tif ( $post_title_enabled ) {\n\t\t\t\t$messages .= '\"' . $id . '-post-title\": {' . \"\\n\";\n\n\t\t\t\t$required_message = apply_filters(\n\t\t\t\t\t'forminator_postdata_field_post_title_validation_message',\n\t\t\t\t\t( ! empty( $setting_required_message ) ? $setting_required_message : __( 'This field is required. Please enter the post title', Forminator::DOMAIN ) ),\n\t\t\t\t\t$id,\n\t\t\t\t\t$field\n\t\t\t\t);\n\t\t\t\t$messages = $messages . '\"required\": \"' . forminator_addcslashes( $required_message ) . '\",' . \"\\n\";\n\n\t\t\t\t$messages .= '},' . \"\\n\";\n\t\t\t}\n\t\t\tif ( $post_content_enabled ) {\n\t\t\t\t$messages .= '\"' . $id . '-post-content\": {' . \"\\n\";\n\n\t\t\t\t$required_message = apply_filters(\n\t\t\t\t\t'forminator_postdata_field_post_content_validation_message',\n\t\t\t\t\t( ! empty( $setting_required_message ) ? $setting_required_message : __( 'This field is required. Please enter the post content', Forminator::DOMAIN ) ),\n\t\t\t\t\t$id,\n\t\t\t\t\t$field\n\t\t\t\t);\n\t\t\t\t$messages = $messages . '\"required\": \"' . forminator_addcslashes( $required_message ) . '\",' . \"\\n\";\n\n\t\t\t\t$messages .= '},' . \"\\n\";\n\t\t\t}\n\t\t\tif ( $post_excerpt_enabled ) {\n\t\t\t\t$messages .= '\"' . $id . '-post-excerpt\": {' . \"\\n\";\n\n\t\t\t\t$required_message = apply_filters(\n\t\t\t\t\t'forminator_postdata_field_post_excerpt_validation_message',\n\t\t\t\t\t( ! empty( $setting_required_message ) ? $setting_required_message : __( 'This field is required. Please enter the post excerpt', Forminator::DOMAIN ) ),\n\t\t\t\t\t$id,\n\t\t\t\t\t$field\n\t\t\t\t);\n\t\t\t\t$messages = $messages . '\"required\": \"' . forminator_addcslashes( $required_message ) . '\",' . \"\\n\";\n\n\t\t\t\t$messages .= '},' . \"\\n\";\n\t\t\t}\n\t\t\tif ( $post_image_enabled ) {\n\t\t\t\t$messages .= '\"' . $id . '-post-image\": {' . \"\\n\";\n\n\t\t\t\t$required_message = apply_filters(\n\t\t\t\t\t'forminator_postdata_field_post_image_validation_message',\n\t\t\t\t\t( ! empty( $setting_required_message ) ? $setting_required_message : __( 'This field is required. Please upload a post image', Forminator::DOMAIN ) ),\n\t\t\t\t\t$id,\n\t\t\t\t\t$field\n\t\t\t\t);\n\t\t\t\t$messages = $messages . '\"required\": \"' . forminator_addcslashes( $required_message ) . '\",' . \"\\n\";\n\n\t\t\t\t$messages .= '},' . \"\\n\";\n\t\t\t}\n\t\t\tif( ! empty( $category_list ) ) {\n\t\t\t\tforeach ( $category_list as $category ) {\n\t\t\t\t\t$post_category_enabled = self::get_property( $category['value'], $field, '' );\n\t\t\t\t\tif ( $post_category_enabled ) {\n\t\t\t\t\t\t$post_category_multiple = self::get_property( $category['value'].'_multiple', $field, '' );\n\t\t\t\t\t\tif( $post_category_multiple ){\n\t\t\t\t\t\t\t$messages .= '\"' . $id . '-' . $category['value'] . '[]\": {' . \"\\n\";\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$messages .= '\"' . $id . '-' . $category['value'] . '\": {' . \"\\n\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$required_message = apply_filters(\n\t\t\t\t\t\t\t'forminator_postdata_field_' . $category['value'] . '_validation_message',\n\t\t\t\t\t\t\t( ! empty( $setting_required_message ) ? $setting_required_message : __( 'This field is required. Please select a '. $category['singular'], Forminator::DOMAIN ) ),\n\t\t\t\t\t\t\t$id,\n\t\t\t\t\t\t\t$field\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$messages = $messages . '\"required\": \"' . forminator_addcslashes( $required_message ) . '\",' . \"\\n\";\n\n\t\t\t\t\t\t$messages .= '},' . \"\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $messages;\n\t}", "protected function __construct(){\n\t\t$this->inputs();\n\t}", "public function __construct(){\r\n\t\t$this->errors = [];\r\n\t\t$this->general_messages = [];\r\n\t\t$this->all_messages = [];\r\n\t}", "function __construct($input) {\n \n $this->textMessage = $input['entry'][0]['messaging'][0]['message']['text'];\n $this->buttonMessage = $input['entry'][0]['messaging'][0]['postback']['payload'];\n $this->quickReplyMessage = $input['entry'][0]['messaging'][0]['message']['quick_reply']['payload'];\n $this->attachmentMessage = $input['entry'][0]['messaging'][0]['message']['attachments'][0]['type'];\n\n\n }", "protected function _set_custom_stuff() {\n //setup our custom error messages\n // $this->setCustomMessages( $this->_custom_messages );\n }", "public function __construct() {\n\n $this->inputmanager = new Validator();\n\n $this->config = $this->configuration();\n\n $this->validation = $this->validate(); \n\n }", "private function proccess()\n {\n foreach ($this->validate as $name => $value) {\n $rules = $this->rules[$name];\n \n /* Let's see is this value a required, e.g not empty */\n if (preg_match('~req~', $rules)) {\n if ($this->isEmpty($value)) {\n $this->errors[] = $this->filterName($name) . ' can\\'t be empty, please enter required data.';\n continue; // We will display only one error per input\n }\n }\n \n /**\n * Let's see is this value needs to be integer\n */\n if (preg_match('~int~', $rules)) {\n if (!$this->isInt($value)) {\n $this->errors[] = $this->filterName($name) . ' is not number, please enter number.';\n continue; // We will display only one error per input\n }\n }\n \n /**\n * Let's see is this value needs to be text\n */\n if (preg_match('~text~', $rules)) {\n if (!$this->isText($value)) {\n $this->errors[] = $this->filterName($name) . ' is not text, please enter only letters.';\n continue; // We will display only one error per input\n }\n }\n \n /* This is good input */\n $this->data[$name] = $value;\n }\n }", "private function process()\n {\n foreach ($this->rules as $key => $rule)\n {\n $exp = explode('|', $rule);\n\n foreach ($exp as $method)\n {\n if (strstr($method, ':')) list($method, $param) = explode(':', $method, 2);\n else $param = '';\n \n $input = array_get($this->input, $key);\n\n if (method_exists($this, \"process_$method\") === false)\n {\n if (!$input) continue;\n \n if (array_key_exists($method, self::$custom))\n {\n if (call_user_func(self::$custom[$method], $input, $param, $this) !== true) $this->set_error($key, $method);\n } else {\n throw new ValidatorNotFound(\"No validator exists for [$method]\");\n }\n } else {\n if (($input || $method == 'required') && $this->{\"process_$method\"}($input, $param, $this) !== true) $this->set_error($key, $method);\n }\n }\n }\n }", "protected function _set_custom_stuff()\n\t{\n\t\t//setup our custom error messages\n\t\t$this->setCustomMessages($this->_custom_messages);\n\t}", "public function messages() {\n $messages['title.required'] = trans('common.error_messages.req_this_field');\n \n $messages['f_name.required'] = trans('common.error_messages.req_this_field');\n $messages['f_name.regex']=trans('common.error_messages.alphnum_hyp_uscore');\n $messages['f_name.max'] = trans('common.error_messages.max_60_chars');\n $messages['f_name.min'] = trans('common.error_messages.least_3_chars');\n \n $messages['l_name.required'] = trans('error_messages.req_this_field');\n $messages['l_name.regex']=trans('common.error_messages.alphnum_hyp_uscore'); \n $messages['l_name.max'] = trans('common.error_messages.max_60_chars');\n $messages['l_name.min'] = trans('common.error_messages.least_3_chars');\n \n $messages['m_name.regex']=trans('common.error_messages.alphnum_hyp_uscore');\n $messages['m_name.max'] = trans('common.error_messages.max_60_chars');\n $messages['m_name.min'] = trans('common.error_messages.least_3_chars');\n \n $messages['gender.required'] = trans('common.error_messages.req_this_field');\n $messages['date_of_birth.required'] = trans('common.error_messages.req_this_field');\n \n \n $messages['father_name.required'] = trans('common.error_messages.req_this_field');\n $messages['father_name.regex'] = trans('common.error_messages.alphnum_hyp_uscore_space'); \n $messages['father_name.max'] = trans('common.error_messages.max_60_chars');\n $messages['father_name.min'] = trans('common.error_messages.least_3_chars');\n \n $messages['mother_f_name.required'] = trans('error_messages.req_this_field');\n $messages['mother_f_name.regex'] = trans('common.error_messages.alphnum_hyp_uscore');\n $messages['mother_f_name.max'] = trans('common.error_messages.max_60_chars');\n $messages['mother_f_name.min'] = trans('common.error_messages.least_3_chars');\n \n $messages['mother_m_name.required'] = trans('error_messages.req_this_field');\n $messages['mother_m_name.regex'] = trans('common.error_messages.alphnum_hyp_uscore');\n $messages['mother_m_name.max'] = trans('common.error_messages.max_60_chars');\n $messages['mother_m_name.min'] = trans('common.error_messages.least_3_chars');\n \n $messages['birth_country_id.required'] = trans('error_messages.req_this_field');\n\n $messages['birth_city_id.required'] = trans('common.error_messages.req_this_field');\n $messages['birth_city_id.regex'] = trans('common.error_messages.alphnum_hyp_uscore_space');\n $messages['birth_city_id.max'] = trans('common.error_messages.max_60_chars');\n $messages['birth_city_id.min'] = trans('common.error_messages.least_3_chars');\n \n \n $messages['reg_no.alpha_num'] = trans('common.error_messages.alpha_num');\n $messages['reg_no.max'] = trans('common.error_messages.max_60_chars');\n\n \n \n $messages['reg_place.regex'] = trans('common.error_messages.alphnum_hyp_uscore_space');\n $messages['reg_place.max'] = trans('common.error_messages.max_60_chars');\n $messages['reg_place.min'] = trans('common.error_messages.least_3_chars');\n \n $messages['f_nationality_id.required'] = trans('common.error_messages.req_this_field');\n $messages['residence_status.required'] = trans('common.error_messages.req_this_field');\n $messages['family_status.required'] = trans('common.error_messages.req_this_field');\n $messages['educational_level.required'] = trans('common.error_messages.req_this_field');\n $messages['is_residency_card.required'] = trans('common.error_messages.req_this_field');\n\n $messages['legal_maturity_date.required'] = trans('common.error_messages.req_this_field');\n\n\n $messages['document_type_id.*.required'] = trans('common.error_messages.req_this_field');\n $messages['social_media_id.*.required'] = trans('common.error_messages.req_this_field');\n \n $messages['social_media_link.*.url'] = trans('common.error_messages.enter_valid_url');\n $messages['social_media_link.*.max'] = trans('common.error_messages.max_120_chars');\n \n $messages['document_number.*.alpha_num'] = trans('common.error_messages.alpha_num');\n $messages['document_number.*.max'] = trans('common.error_messages.max_20_chars');\n \n \n return $messages;\n }", "protected function mainValidation()\n {\n $this->validator->add(\n 'title',\n new StringLength([\n 'max' => 50\n ])\n );\n\n $this->validator->add(\n 'description',\n new StringLength([\n 'max' => 200,\n 'allowEmpty' => true\n ])\n );\n }", "public function initMessages()\n {\n $this->messages = [\n 'alpha' => '{{name}} must only contain alphabetic characters.',\n 'alnum' => '{{name}} must only contain alpha numeric characters and dashes.',\n 'noWhitespace' => '{{name}} must not contain white spaces.',\n 'length' => '{{name}} must length between {{minValue}} and {{maxValue}}.',\n 'email' => 'Please make sure you typed a correct email address.'\n ];\n }", "public static function getMessageRule(){\n return [\n 'title.required' => 'Please input the title',\n 'cat_id.required' => 'Please chose a category',\n 'country_id.required' => 'Please chose a country',\n ];\n }", "public function validation()\n {\n $data = [\n 'username' => null,\n 'password' => 'password',\n ];\n $rules = new Rules( $data );\n\n /* Add source */\n $rules->addSource( 'phone', '081234' );\n $rules->addSource( 'address', 'Lorem ipsum dolor sit.' );\n\n /* Add validation rule */\n $rules->addRule(\n 'username',\n 'Username',\n 'minLength[2]',\n [ 'minLength' => ':attribute Should Be More Than :params', 'required' => ':attribute Required' ]\n );\n $rules->addRule( 'password', 'Password', 'maxLength[2]', ':attribute should be less than :params' );\n\n /* Add multiple rules */\n $rules->addRules(\n [\n [\n 'field' => 'phone',\n 'label' => 'Phone',\n 'rules' => 'required',\n 'messages' => 'Phone Required',\n ],\n [\n 'field' => 'address',\n 'label' => 'Address',\n 'rules' => 'required',\n 'messages' => 'Address Required',\n ],\n ]\n );\n\n /* Validate rules */\n $validate = $rules->validate();\n\n print_out(\n [\n 'validate' => ( $validate == true ? 1 : 0 ),\n 'errors' => $rules->getErrors(),\n ]\n );\n }", "public static function extraRules(){\n\t\t// will receive user inputs.\n\t\treturn array(\n array('total_number_meta, total_number_resource, object_slug','safe'),\n\t\t\tarray('object_name, object_mainmenu', 'required'),\n array('object_content','length','min'=>10),\n array('object_excerpt,guid','safe'),\n\t\t\tarray('object_date, object_date_gmt, object_status, comment_status, allow_enquiry, allow_reserve, allow_index, allow_follow, object_modified, object_modified_gmt, lang, total_number_meta, total_number_resource, object_view, like, dislike, rating_scores', 'numerical', 'integerOnly'=>true),\n\t\t\tarray('rating_average', 'numerical'),\n\t\t\tarray('object_author, object_password, object_parent, object_type, comment_count', 'length', 'max'=>20),\n\t\t\tarray('object_title','length','min'=>15),\n\t\t\t\n\t\t\tarray('object_description','length','min'=>100),\n\t\t\t\n\t\t\tarray('object_canonical, object_h1, object_h2, object_bingcode, object_googlecode, offer_desc','length','min'=>10),\n\t\t\tarray('guid, object_keywords, object_author_name', 'length', 'max'=>255),\n\t\t\tarray('layout', 'length', 'max'=>125),\n\t\t\tarray('tags', 'checkTags'),\n\t\t\tarray('tags', 'normalizeTags'),\n array('person', 'safe'),\n\t\t\tarray('object_footermenu, object_breadcrumbs', 'length','min'=>3),\n\t\t\t\n\t\t\t// The following rule is used by search().\n\t\t\t// Please remove those attributes that should not be searched.\n\t\t\tarray('object_id, object_author, object_date, object_content, object_title, object_status, object_name', 'safe', \n 'on'=>'search,draft,published,pending'),\n\t\t);\n }", "public function run() {\n \n foreach( $this->validation_rules as $var=>$opt) {\n \n /*\n $default_opt = [\n 'min' => false,\n 'max' => false,\n 'required' => false,\n ];\n $opt = array_merge($default_opt,$opt);\n */\n \n //if compulsary field is not set then no point validating further\n if(isset($opt['set']) && !$this->is_set($var)) {\n continue;\n } \n \n /* Trim whitespace from beginning and end of variable */\n if( array_key_exists('trim', $opt) ) {\n $this->source[$var] = trim( $this->source[$var] );\n }\n \n $is_required = false;\n \n //if required field is empty then no point validating further\n if( isset($opt['required']) && !$this->not_empty($var) ) {\n continue;\n }\n \n if( isset($opt['required']) ) {\n unset($opt['required']);\n $is_required = true;\n }\n \n if( isset($opt['set']) )\n unset($opt['set']);\n \n if( isset($opt['trim']) )\n unset($opt['trim']);\n \n foreach( $opt as $rule_type=>$rule_val ) {\n $raw_field_value = isset($this->source[$var]) ? $this->source[$var] : false;\n \n /*\n if(is_string($raw_field_value) && strlen($raw_field_value) == 0 && !$is_required)\n continue;\n */\n $result = true;\n if( method_exists($this, 'validate_'.$rule_type) ) {\n $t_params = is_array($rule_val) ? array_merge([$var], $rule_val) : [$var, $rule_val];\n //$result = call_user_func_array([$this, 'validate_'.$rule_type], [$var, $rule_val]);\n $result = call_user_func_array([$this, 'validate_'.$rule_type], $t_params);\n }\n elseif( method_exists($this->caller_obj, $rule_type) ) {\n $t_params = is_array($rule_val) ? array_merge([$this, $raw_field_value], $rule_val) : [$this, $raw_field_value, $rule_val];\n $result = call_user_func_array([$this->caller_obj, $rule_type], $t_params);\n }\n elseif( function_exists($rule_type) ) {\n $t_params = is_array($rule_val) ? array_merge([$this, $raw_field_value], $rule_val) : [$this, $raw_field_value, $rule_val];\n $result = call_user_func_array($rule_type, $t_params);\n }\n \n if($result === false)\n break;\n }\n }\n }", "public function __construct() {\n\n\t\t//Call the parent constructor\n\t\tparent::__construct(); \n\t\t\n\t\t$this->validate = array_merge(\n\t\t\t\t\t$this->validate\n\t\t\t\t);\t\t\n\n\t}", "function readInputData() {\n\t\t$this->readUserVars(array('enableUploadCode', 'uploadCode', 'thesisOrder', 'thesisName', 'thesisEmail', 'thesisPhone', 'thesisFax', 'thesisMailingAddress', 'thesisIntroduction'));\n\n\t\tif (!empty($this->_data['enableUploadCode'])) {\n\t\t\t$this->addCheck(new FormValidator($this, 'uploadCode', 'required', 'plugins.generic.thesis.settings.uploadCodeRequired'));\n\t\t}\n\t}", "protected function _childValidation() {\n\n\t\t$languages = Language::getLanguages(true);\n\n\t\t// if action == 'message', related message required\n\n\t\tif (Tools::getValue('action_sender') === 'message') {\n\n\t\t\tforeach ($languages as $language) {\n\t\t\t\t$value = Tools::getValue('message_sender_' . $language['id_lang']);\n\n\t\t\t\tif (empty($value)) {\n\t\t\t\t\t$this->errors[] = $this->la('Please indicate a message to send to the sender.');\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\t// if action == 'message', related message required\n\n\t\tif (Tools::getValue('action_admin') === 'message') {\n\n\t\t\tforeach ($languages as $language) {\n\t\t\t\t$value = Tools::getValue('message_admin_' . $language['id_lang']);\n\n\t\t\t\tif (empty($value)) {\n\t\t\t\t\t$this->errors[] = $this->la('Please indicate the message to send to the admin(s).');\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\t// check every admin email,\n\t\t$send_mail_to = Tools::getValue('send_mail_to');\n\n\t\tif (empty($send_mail_to)) {\n\t\t\t$this->errors[] = $this->la('\"Send form to\" field is required.');\n\t\t} else {\n\t\t\t$emails = explode(',', Tools::getValue('send_mail_to'));\n\n\t\t\tforeach ($emails as $email) {\n\t\t\t\t$email = trim($email);\n\n\t\t\t\tif (!filter_var($email, FILTER_VALIDATE_EMAIL)) {\n\t\t\t\t\t$this->errors[] = $this->la('Invalid email provided in \"Send form to\". (Please separate emails with a comma)');\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\t$fields = [];\n\n\t\tforeach (PFGFieldModel::findFields(Tools::getValue('id_pfg')) as $field) {\n\t\t\t$fields[] = $field['name'];\n\t\t}\n\n\t\tforeach (['subject_sender', 'subject_admin', 'success', 'message_sender', 'message_admin'] as $variable_name) {\n\n\t\t\tforeach ($languages as $language) {\n\t\t\t\t$matches = [];\n\n\t\t\t\tpreg_match_all('/(\\{\\$([a-z0-9_]+)(\\[\\])?\\})/', Tools::getValue($variable_name . '_' . $language['id_lang']), $matches, PREG_SET_ORDER);\n\n\t\t\t\tif (count($matches) > 0) {\n\t\t\t\t\t$matches = $this->pregMatchReorder($matches);\n\n\t\t\t\t\tforeach ($matches as $match) {\n\n\t\t\t\t\t\tif (!in_array($match, $fields)) {\n\t\t\t\t\t\t\t$this->errors[] = sprintf($this->la('Invalid variable \"%s\". This name does not exists. (You need to create the field first)'), $match);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}", "public function messages()\n {\n return array_merge(trans('news::validation'), trans('news::validation.custom'));\n }", "public function __construct(\n FormRules $rules,\n FormInput $input,\n Dispatcher $events,\n FormExtender $extender,\n FormMessages $messages,\n FormAttributes $attributes\n ) {\n $this->rules = $rules;\n $this->input = $input;\n $this->events = $events;\n $this->extender = $extender;\n $this->messages = $messages;\n $this->attributes = $attributes;\n }", "public function messages()\n {\n return VALIDATION_MESSAGE;\n }", "public function messages()\n {\n return VALIDATION_MESSAGE;\n }", "public function rules()\n {\n $flowRepository = new FlowRepository();\n if ($this->has('step_run_id') && intval($this->step_run_id)) {\n //通过 预提交\n $this->step = $flowRepository->getCurrentStep($this->step_run_id);\n } else {\n //发起 预提交\n $this->step = $flowRepository->getFlowFirstStep($this->flow_id);\n }\n\n $basicRules = [\n 'flow_id'=>[\n Rule::exists('flows','id')->where('is_active',1)\n ],\n 'step_run_id' => [\n Rule::exists('step_run', 'id')->where('flow_id', $this->flow_id)\n ],\n 'form_data' => [\n 'present',\n 'array',\n ],\n ];\n $fieldsRules = app('validation')->makeStepFormValidationRules($this->step,$this);\n return array_collapse([$basicRules, $fieldsRules]);\n }", "protected function importValidationMessages()\n {\n return [];\n }", "public function rules()\n {\n if( $this->is('category/store') ) {\n return $this->createRules();\n return $this->messages();\n } \n elseif ( $this->is('category/update/{id}') ) {\n return $this->updateRules();\n return $this->messages();\n }\n }" ]
[ "0.5571182", "0.5570542", "0.53720295", "0.5334528", "0.53065085", "0.5226777", "0.52040917", "0.51960176", "0.51867706", "0.5170089", "0.51700413", "0.5146467", "0.5121792", "0.50972146", "0.5080358", "0.5079079", "0.5071267", "0.50671375", "0.5060158", "0.50416815", "0.50161916", "0.4997721", "0.4969082", "0.49663055", "0.49579442", "0.49548718", "0.49548718", "0.49408597", "0.49297076", "0.4929" ]
0.58393407
0
Get all errors for a specfic key. Add formatting to $wrap to have output 'wrapped' (the original message will be replaced at :message): // Example using required: $validator>get('username', 'Failed: :message'); // Yields: Failed: The username field is required
public function get($key, $wrap = ':message') { $result = array(); foreach (($this->has($key) ? $this->errors[$key] : array()) as $error) { $result[] = str_replace(':message', $error, $wrap); } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get($key = null)\n {\n return $key ? $this->errors[$key] : $this->errors;\n }", "public function all($wrap = ':message')\n {\n $result = array();\n\n foreach ($this->errors as $key => $error)\n {\n $result[$key] = $this->get($key, $wrap);\n }\n\n return $result;\n }", "public function getMessages($key)\n {\n return isset($this->errors[$key]) ? $this->errors[$key] : [];\n }", "function get_error($key) {\n // Ambil errors pada $_GET\n // kalau nggak ada isi dengan array kosong aja.\n $errors = isset($_GET['errors']) ? (array) $_GET['errors'] : [];\n \n // Ambil pesan error\n $error = isset($errors[$key]) ? $errors[$key] : null;\n \n // Kalau memang ada error, \n // harusnya $error disini masih berupa array [\"rule\" => \"pesan\"]\n // Karena kita hanya mau mengambil pesan pertamanya aja,\n // Jadi kita ambil via array_values($error)[0]\n $first_message = is_array($error) ? array_values($error)[0] : null;\n\n // Kembalikan pesan error\n return $first_message;\n}", "public function getError($key = null)\n {\n if ($key) {\n return $this->error[$key];\n }\n\n return $this->error;\n }", "public function getError( string $key, $first = false ) {\n\t\t$found = array_filter( $this->getErrors(), function ( $error ) use ( $key ) {\n\t\t\treturn $error[ 'key' ] === $key;\n\t\t} );\n\n\t\t$found = array_values( $found );\n\n\t\tif ( $first ) {\n\t\t\treturn array_shift( $found );\n\t\t}\n\n\t\treturn $found;\n\t}", "public function _getValidationErrors(): array\n\t{\n\t\t$errs = parent::_getValidationErrors();\n\t\t$validationRules = $this->_getValidationRules();\n\t\tif (null !== ($v = $this->getUrl())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_URL] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getIdentifier())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_IDENTIFIER, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getVersion())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_VERSION] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getName())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_NAME] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getDisplay())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_DISPLAY] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getStatus())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_STATUS] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getExperimental())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_EXPERIMENTAL] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getPublisher())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_PUBLISHER] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getContact())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_CONTACT, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getDate())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_DATE] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getDescription())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_DESCRIPTION] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getUseContext())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_USE_CONTEXT, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getRequirements())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_REQUIREMENTS] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getCopyright())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_COPYRIGHT] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getCode())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_CODE, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getFhirVersion())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_FHIR_VERSION] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getMapping())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_MAPPING, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getKind())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_KIND] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getConstrainedType())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_CONSTRAINED_TYPE] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getAbstract())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_ABSTRACT] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getContextType())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_CONTEXT_TYPE] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getContext())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_CONTEXT, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getBase())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_BASE] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getSnapshot())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_SNAPSHOT] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getDifferential())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_DIFFERENTIAL] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_URL])) {\n\t\t\t$v = $this->getUrl();\n\t\t\tforeach ($validationRules[self::FIELD_URL] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_URL,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_URL])) {\n\t\t\t\t\t\t$errs[self::FIELD_URL] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_URL][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_IDENTIFIER])) {\n\t\t\t$v = $this->getIdentifier();\n\t\t\tforeach ($validationRules[self::FIELD_IDENTIFIER] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_IDENTIFIER,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_IDENTIFIER])) {\n\t\t\t\t\t\t$errs[self::FIELD_IDENTIFIER] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_IDENTIFIER][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_VERSION])) {\n\t\t\t$v = $this->getVersion();\n\t\t\tforeach ($validationRules[self::FIELD_VERSION] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_VERSION,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_VERSION])) {\n\t\t\t\t\t\t$errs[self::FIELD_VERSION] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_VERSION][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_NAME])) {\n\t\t\t$v = $this->getName();\n\t\t\tforeach ($validationRules[self::FIELD_NAME] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_NAME,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_NAME])) {\n\t\t\t\t\t\t$errs[self::FIELD_NAME] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_NAME][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_DISPLAY])) {\n\t\t\t$v = $this->getDisplay();\n\t\t\tforeach ($validationRules[self::FIELD_DISPLAY] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_DISPLAY,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_DISPLAY])) {\n\t\t\t\t\t\t$errs[self::FIELD_DISPLAY] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_DISPLAY][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_STATUS])) {\n\t\t\t$v = $this->getStatus();\n\t\t\tforeach ($validationRules[self::FIELD_STATUS] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_STATUS,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_STATUS])) {\n\t\t\t\t\t\t$errs[self::FIELD_STATUS] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_STATUS][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_EXPERIMENTAL])) {\n\t\t\t$v = $this->getExperimental();\n\t\t\tforeach ($validationRules[self::FIELD_EXPERIMENTAL] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_EXPERIMENTAL,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_EXPERIMENTAL])) {\n\t\t\t\t\t\t$errs[self::FIELD_EXPERIMENTAL] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_EXPERIMENTAL][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_PUBLISHER])) {\n\t\t\t$v = $this->getPublisher();\n\t\t\tforeach ($validationRules[self::FIELD_PUBLISHER] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_PUBLISHER,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_PUBLISHER])) {\n\t\t\t\t\t\t$errs[self::FIELD_PUBLISHER] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_PUBLISHER][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CONTACT])) {\n\t\t\t$v = $this->getContact();\n\t\t\tforeach ($validationRules[self::FIELD_CONTACT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_CONTACT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CONTACT])) {\n\t\t\t\t\t\t$errs[self::FIELD_CONTACT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CONTACT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_DATE])) {\n\t\t\t$v = $this->getDate();\n\t\t\tforeach ($validationRules[self::FIELD_DATE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_DATE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_DATE])) {\n\t\t\t\t\t\t$errs[self::FIELD_DATE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_DATE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_DESCRIPTION])) {\n\t\t\t$v = $this->getDescription();\n\t\t\tforeach ($validationRules[self::FIELD_DESCRIPTION] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_DESCRIPTION,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_DESCRIPTION])) {\n\t\t\t\t\t\t$errs[self::FIELD_DESCRIPTION] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_DESCRIPTION][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_USE_CONTEXT])) {\n\t\t\t$v = $this->getUseContext();\n\t\t\tforeach ($validationRules[self::FIELD_USE_CONTEXT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_USE_CONTEXT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_USE_CONTEXT])) {\n\t\t\t\t\t\t$errs[self::FIELD_USE_CONTEXT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_USE_CONTEXT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_REQUIREMENTS])) {\n\t\t\t$v = $this->getRequirements();\n\t\t\tforeach ($validationRules[self::FIELD_REQUIREMENTS] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_REQUIREMENTS,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_REQUIREMENTS])) {\n\t\t\t\t\t\t$errs[self::FIELD_REQUIREMENTS] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_REQUIREMENTS][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_COPYRIGHT])) {\n\t\t\t$v = $this->getCopyright();\n\t\t\tforeach ($validationRules[self::FIELD_COPYRIGHT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_COPYRIGHT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_COPYRIGHT])) {\n\t\t\t\t\t\t$errs[self::FIELD_COPYRIGHT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_COPYRIGHT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CODE])) {\n\t\t\t$v = $this->getCode();\n\t\t\tforeach ($validationRules[self::FIELD_CODE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_CODE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CODE])) {\n\t\t\t\t\t\t$errs[self::FIELD_CODE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CODE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_FHIR_VERSION])) {\n\t\t\t$v = $this->getFhirVersion();\n\t\t\tforeach ($validationRules[self::FIELD_FHIR_VERSION] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_FHIR_VERSION,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_FHIR_VERSION])) {\n\t\t\t\t\t\t$errs[self::FIELD_FHIR_VERSION] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_FHIR_VERSION][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_MAPPING])) {\n\t\t\t$v = $this->getMapping();\n\t\t\tforeach ($validationRules[self::FIELD_MAPPING] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_MAPPING,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_MAPPING])) {\n\t\t\t\t\t\t$errs[self::FIELD_MAPPING] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_MAPPING][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_KIND])) {\n\t\t\t$v = $this->getKind();\n\t\t\tforeach ($validationRules[self::FIELD_KIND] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_KIND,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_KIND])) {\n\t\t\t\t\t\t$errs[self::FIELD_KIND] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_KIND][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CONSTRAINED_TYPE])) {\n\t\t\t$v = $this->getConstrainedType();\n\t\t\tforeach ($validationRules[self::FIELD_CONSTRAINED_TYPE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_CONSTRAINED_TYPE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CONSTRAINED_TYPE])) {\n\t\t\t\t\t\t$errs[self::FIELD_CONSTRAINED_TYPE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CONSTRAINED_TYPE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_ABSTRACT])) {\n\t\t\t$v = $this->getAbstract();\n\t\t\tforeach ($validationRules[self::FIELD_ABSTRACT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_ABSTRACT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_ABSTRACT])) {\n\t\t\t\t\t\t$errs[self::FIELD_ABSTRACT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_ABSTRACT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CONTEXT_TYPE])) {\n\t\t\t$v = $this->getContextType();\n\t\t\tforeach ($validationRules[self::FIELD_CONTEXT_TYPE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_CONTEXT_TYPE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CONTEXT_TYPE])) {\n\t\t\t\t\t\t$errs[self::FIELD_CONTEXT_TYPE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CONTEXT_TYPE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CONTEXT])) {\n\t\t\t$v = $this->getContext();\n\t\t\tforeach ($validationRules[self::FIELD_CONTEXT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_CONTEXT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CONTEXT])) {\n\t\t\t\t\t\t$errs[self::FIELD_CONTEXT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CONTEXT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_BASE])) {\n\t\t\t$v = $this->getBase();\n\t\t\tforeach ($validationRules[self::FIELD_BASE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_BASE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_BASE])) {\n\t\t\t\t\t\t$errs[self::FIELD_BASE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_BASE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_SNAPSHOT])) {\n\t\t\t$v = $this->getSnapshot();\n\t\t\tforeach ($validationRules[self::FIELD_SNAPSHOT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_SNAPSHOT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_SNAPSHOT])) {\n\t\t\t\t\t\t$errs[self::FIELD_SNAPSHOT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_SNAPSHOT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_DIFFERENTIAL])) {\n\t\t\t$v = $this->getDifferential();\n\t\t\tforeach ($validationRules[self::FIELD_DIFFERENTIAL] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_DIFFERENTIAL,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_DIFFERENTIAL])) {\n\t\t\t\t\t\t$errs[self::FIELD_DIFFERENTIAL] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_DIFFERENTIAL][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_TEXT])) {\n\t\t\t$v = $this->getText();\n\t\t\tforeach ($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE,\n\t\t\t\t\tself::FIELD_TEXT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_TEXT])) {\n\t\t\t\t\t\t$errs[self::FIELD_TEXT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_TEXT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CONTAINED])) {\n\t\t\t$v = $this->getContained();\n\t\t\tforeach ($validationRules[self::FIELD_CONTAINED] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE,\n\t\t\t\t\tself::FIELD_CONTAINED,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CONTAINED])) {\n\t\t\t\t\t\t$errs[self::FIELD_CONTAINED] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CONTAINED][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_EXTENSION])) {\n\t\t\t$v = $this->getExtension();\n\t\t\tforeach ($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE,\n\t\t\t\t\tself::FIELD_EXTENSION,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_EXTENSION])) {\n\t\t\t\t\t\t$errs[self::FIELD_EXTENSION] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_EXTENSION][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_MODIFIER_EXTENSION])) {\n\t\t\t$v = $this->getModifierExtension();\n\t\t\tforeach ($validationRules[self::FIELD_MODIFIER_EXTENSION] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE,\n\t\t\t\t\tself::FIELD_MODIFIER_EXTENSION,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_MODIFIER_EXTENSION])) {\n\t\t\t\t\t\t$errs[self::FIELD_MODIFIER_EXTENSION] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_MODIFIER_EXTENSION][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_ID])) {\n\t\t\t$v = $this->getId();\n\t\t\tforeach ($validationRules[self::FIELD_ID] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_RESOURCE,\n\t\t\t\t\tself::FIELD_ID,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_ID])) {\n\t\t\t\t\t\t$errs[self::FIELD_ID] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_ID][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_META])) {\n\t\t\t$v = $this->getMeta();\n\t\t\tforeach ($validationRules[self::FIELD_META] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_RESOURCE,\n\t\t\t\t\tself::FIELD_META,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_META])) {\n\t\t\t\t\t\t$errs[self::FIELD_META] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_META][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_IMPLICIT_RULES])) {\n\t\t\t$v = $this->getImplicitRules();\n\t\t\tforeach ($validationRules[self::FIELD_IMPLICIT_RULES] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_RESOURCE,\n\t\t\t\t\tself::FIELD_IMPLICIT_RULES,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_IMPLICIT_RULES])) {\n\t\t\t\t\t\t$errs[self::FIELD_IMPLICIT_RULES] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_IMPLICIT_RULES][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_LANGUAGE])) {\n\t\t\t$v = $this->getLanguage();\n\t\t\tforeach ($validationRules[self::FIELD_LANGUAGE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_RESOURCE,\n\t\t\t\t\tself::FIELD_LANGUAGE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_LANGUAGE])) {\n\t\t\t\t\t\t$errs[self::FIELD_LANGUAGE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_LANGUAGE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $errs;\n\t}", "public function _getValidationErrors()\n {\n $errs = parent::_getValidationErrors();\n $validationRules = $this->_getValidationRules();\n if ([] !== ($vs = $this->getDataRequirement())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_DATA_REQUIREMENT, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getEncounter())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ENCOUNTER] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getEvaluationMessage())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_EVALUATION_MESSAGE, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getIdentifier())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_IDENTIFIER, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getModuleCanonical())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_MODULE_CANONICAL] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getModuleCodeableConcept())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_MODULE_CODEABLE_CONCEPT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getModuleUri())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_MODULE_URI] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getNote())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_NOTE, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getOccurrenceDateTime())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_OCCURRENCE_DATE_TIME] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getOutputParameters())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_OUTPUT_PARAMETERS] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPerformer())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PERFORMER] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getReasonCode())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_REASON_CODE, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getReasonReference())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_REASON_REFERENCE, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getRequestIdentifier())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_REQUEST_IDENTIFIER] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getResult())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_RESULT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getStatus())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_STATUS] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getSubject())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_SUBJECT] = $fieldErrs;\n }\n }\n if (isset($validationRules[self::FIELD_DATA_REQUIREMENT])) {\n $v = $this->getDataRequirement();\n foreach($validationRules[self::FIELD_DATA_REQUIREMENT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_DATA_REQUIREMENT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DATA_REQUIREMENT])) {\n $errs[self::FIELD_DATA_REQUIREMENT] = [];\n }\n $errs[self::FIELD_DATA_REQUIREMENT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ENCOUNTER])) {\n $v = $this->getEncounter();\n foreach($validationRules[self::FIELD_ENCOUNTER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_ENCOUNTER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ENCOUNTER])) {\n $errs[self::FIELD_ENCOUNTER] = [];\n }\n $errs[self::FIELD_ENCOUNTER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EVALUATION_MESSAGE])) {\n $v = $this->getEvaluationMessage();\n foreach($validationRules[self::FIELD_EVALUATION_MESSAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_EVALUATION_MESSAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EVALUATION_MESSAGE])) {\n $errs[self::FIELD_EVALUATION_MESSAGE] = [];\n }\n $errs[self::FIELD_EVALUATION_MESSAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IDENTIFIER])) {\n $v = $this->getIdentifier();\n foreach($validationRules[self::FIELD_IDENTIFIER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_IDENTIFIER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IDENTIFIER])) {\n $errs[self::FIELD_IDENTIFIER] = [];\n }\n $errs[self::FIELD_IDENTIFIER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODULE_CANONICAL])) {\n $v = $this->getModuleCanonical();\n foreach($validationRules[self::FIELD_MODULE_CANONICAL] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_MODULE_CANONICAL, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODULE_CANONICAL])) {\n $errs[self::FIELD_MODULE_CANONICAL] = [];\n }\n $errs[self::FIELD_MODULE_CANONICAL][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODULE_CODEABLE_CONCEPT])) {\n $v = $this->getModuleCodeableConcept();\n foreach($validationRules[self::FIELD_MODULE_CODEABLE_CONCEPT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_MODULE_CODEABLE_CONCEPT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODULE_CODEABLE_CONCEPT])) {\n $errs[self::FIELD_MODULE_CODEABLE_CONCEPT] = [];\n }\n $errs[self::FIELD_MODULE_CODEABLE_CONCEPT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODULE_URI])) {\n $v = $this->getModuleUri();\n foreach($validationRules[self::FIELD_MODULE_URI] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_MODULE_URI, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODULE_URI])) {\n $errs[self::FIELD_MODULE_URI] = [];\n }\n $errs[self::FIELD_MODULE_URI][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_NOTE])) {\n $v = $this->getNote();\n foreach($validationRules[self::FIELD_NOTE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_NOTE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_NOTE])) {\n $errs[self::FIELD_NOTE] = [];\n }\n $errs[self::FIELD_NOTE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_OCCURRENCE_DATE_TIME])) {\n $v = $this->getOccurrenceDateTime();\n foreach($validationRules[self::FIELD_OCCURRENCE_DATE_TIME] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_OCCURRENCE_DATE_TIME, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_OCCURRENCE_DATE_TIME])) {\n $errs[self::FIELD_OCCURRENCE_DATE_TIME] = [];\n }\n $errs[self::FIELD_OCCURRENCE_DATE_TIME][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_OUTPUT_PARAMETERS])) {\n $v = $this->getOutputParameters();\n foreach($validationRules[self::FIELD_OUTPUT_PARAMETERS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_OUTPUT_PARAMETERS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_OUTPUT_PARAMETERS])) {\n $errs[self::FIELD_OUTPUT_PARAMETERS] = [];\n }\n $errs[self::FIELD_OUTPUT_PARAMETERS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PERFORMER])) {\n $v = $this->getPerformer();\n foreach($validationRules[self::FIELD_PERFORMER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_PERFORMER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PERFORMER])) {\n $errs[self::FIELD_PERFORMER] = [];\n }\n $errs[self::FIELD_PERFORMER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REASON_CODE])) {\n $v = $this->getReasonCode();\n foreach($validationRules[self::FIELD_REASON_CODE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_REASON_CODE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REASON_CODE])) {\n $errs[self::FIELD_REASON_CODE] = [];\n }\n $errs[self::FIELD_REASON_CODE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REASON_REFERENCE])) {\n $v = $this->getReasonReference();\n foreach($validationRules[self::FIELD_REASON_REFERENCE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_REASON_REFERENCE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REASON_REFERENCE])) {\n $errs[self::FIELD_REASON_REFERENCE] = [];\n }\n $errs[self::FIELD_REASON_REFERENCE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REQUEST_IDENTIFIER])) {\n $v = $this->getRequestIdentifier();\n foreach($validationRules[self::FIELD_REQUEST_IDENTIFIER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_REQUEST_IDENTIFIER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REQUEST_IDENTIFIER])) {\n $errs[self::FIELD_REQUEST_IDENTIFIER] = [];\n }\n $errs[self::FIELD_REQUEST_IDENTIFIER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_RESULT])) {\n $v = $this->getResult();\n foreach($validationRules[self::FIELD_RESULT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_RESULT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_RESULT])) {\n $errs[self::FIELD_RESULT] = [];\n }\n $errs[self::FIELD_RESULT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_STATUS])) {\n $v = $this->getStatus();\n foreach($validationRules[self::FIELD_STATUS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_STATUS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_STATUS])) {\n $errs[self::FIELD_STATUS] = [];\n }\n $errs[self::FIELD_STATUS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_SUBJECT])) {\n $v = $this->getSubject();\n foreach($validationRules[self::FIELD_SUBJECT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_SUBJECT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_SUBJECT])) {\n $errs[self::FIELD_SUBJECT] = [];\n }\n $errs[self::FIELD_SUBJECT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CONTAINED])) {\n $v = $this->getContained();\n foreach($validationRules[self::FIELD_CONTAINED] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_CONTAINED, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CONTAINED])) {\n $errs[self::FIELD_CONTAINED] = [];\n }\n $errs[self::FIELD_CONTAINED][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXTENSION])) {\n $v = $this->getExtension();\n foreach($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXTENSION])) {\n $errs[self::FIELD_EXTENSION] = [];\n }\n $errs[self::FIELD_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODIFIER_EXTENSION])) {\n $v = $this->getModifierExtension();\n foreach($validationRules[self::FIELD_MODIFIER_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_MODIFIER_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODIFIER_EXTENSION])) {\n $errs[self::FIELD_MODIFIER_EXTENSION] = [];\n }\n $errs[self::FIELD_MODIFIER_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TEXT])) {\n $v = $this->getText();\n foreach($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_TEXT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TEXT])) {\n $errs[self::FIELD_TEXT] = [];\n }\n $errs[self::FIELD_TEXT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ID])) {\n $v = $this->getId();\n foreach($validationRules[self::FIELD_ID] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_ID, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ID])) {\n $errs[self::FIELD_ID] = [];\n }\n $errs[self::FIELD_ID][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IMPLICIT_RULES])) {\n $v = $this->getImplicitRules();\n foreach($validationRules[self::FIELD_IMPLICIT_RULES] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_IMPLICIT_RULES, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IMPLICIT_RULES])) {\n $errs[self::FIELD_IMPLICIT_RULES] = [];\n }\n $errs[self::FIELD_IMPLICIT_RULES][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LANGUAGE])) {\n $v = $this->getLanguage();\n foreach($validationRules[self::FIELD_LANGUAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_LANGUAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LANGUAGE])) {\n $errs[self::FIELD_LANGUAGE] = [];\n }\n $errs[self::FIELD_LANGUAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_META])) {\n $v = $this->getMeta();\n foreach($validationRules[self::FIELD_META] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_META, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_META])) {\n $errs[self::FIELD_META] = [];\n }\n $errs[self::FIELD_META][$rule] = $err;\n }\n }\n }\n return $errs;\n }", "protected function errors($name, $errors = null, $wrap = '<span class=\"help-block\">:message</span>') {\n\t\t$return = '';\n\n\t\tif ($errors && $errors->has($name)) {\n\t\t\t$return .= $errors->first($name, $wrap) . \"\\n\";\n\t\t}\n\n\t\treturn $return;\n\t}", "public function getErrors() {\n\n if (!$this->errors || count($this->errors === 0)) {\n return '';\n }\n $html = '';\n $pattern = '<li>%s</li>';\n $html .= '<ul>';\n\n foreach ($this->errors as $error) {\n $html .= sprintf($pattern, $error);\n }\n $html .= '</ul>';\n return sprintf($this->getWrapperPattern(self::ERRORS), $html);\n }", "function validate_form($key) {\n $errors = Session::getErrors();\n if ($errors !== NULL) {\n if (array_key_exists($key, $errors)) {\n echo $errors[$key];\n }\n }\n}", "public function getErrors();", "public function getErrors();", "public function getErrors();", "public function getErrors();", "public function first($key = null)\n {\n return $this->errors[$key][0];\n }", "public function _getValidationErrors()\n {\n $errs = parent::_getValidationErrors();\n $validationRules = $this->_getValidationRules();\n if ([] !== ($vs = $this->getCountry())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_COUNTRY, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getDataExclusivityPeriod())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_DATA_EXCLUSIVITY_PERIOD] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getDateOfFirstAuthorization())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_DATE_OF_FIRST_AUTHORIZATION] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getHolder())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_HOLDER] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getIdentifier())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_IDENTIFIER, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getInternationalBirthDate())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_INTERNATIONAL_BIRTH_DATE] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getJurisdiction())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_JURISDICTION, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getJurisdictionalAuthorization())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_JURISDICTIONAL_AUTHORIZATION, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getLegalBasis())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_LEGAL_BASIS] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getProcedure())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PROCEDURE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getRegulator())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_REGULATOR] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getRestoreDate())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_RESTORE_DATE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getStatus())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_STATUS] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getStatusDate())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_STATUS_DATE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getSubject())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_SUBJECT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getValidityPeriod())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_VALIDITY_PERIOD] = $fieldErrs;\n }\n }\n if (isset($validationRules[self::FIELD_COUNTRY])) {\n $v = $this->getCountry();\n foreach($validationRules[self::FIELD_COUNTRY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_COUNTRY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_COUNTRY])) {\n $errs[self::FIELD_COUNTRY] = [];\n }\n $errs[self::FIELD_COUNTRY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_DATA_EXCLUSIVITY_PERIOD])) {\n $v = $this->getDataExclusivityPeriod();\n foreach($validationRules[self::FIELD_DATA_EXCLUSIVITY_PERIOD] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_DATA_EXCLUSIVITY_PERIOD, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DATA_EXCLUSIVITY_PERIOD])) {\n $errs[self::FIELD_DATA_EXCLUSIVITY_PERIOD] = [];\n }\n $errs[self::FIELD_DATA_EXCLUSIVITY_PERIOD][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_DATE_OF_FIRST_AUTHORIZATION])) {\n $v = $this->getDateOfFirstAuthorization();\n foreach($validationRules[self::FIELD_DATE_OF_FIRST_AUTHORIZATION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_DATE_OF_FIRST_AUTHORIZATION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DATE_OF_FIRST_AUTHORIZATION])) {\n $errs[self::FIELD_DATE_OF_FIRST_AUTHORIZATION] = [];\n }\n $errs[self::FIELD_DATE_OF_FIRST_AUTHORIZATION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_HOLDER])) {\n $v = $this->getHolder();\n foreach($validationRules[self::FIELD_HOLDER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_HOLDER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_HOLDER])) {\n $errs[self::FIELD_HOLDER] = [];\n }\n $errs[self::FIELD_HOLDER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IDENTIFIER])) {\n $v = $this->getIdentifier();\n foreach($validationRules[self::FIELD_IDENTIFIER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_IDENTIFIER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IDENTIFIER])) {\n $errs[self::FIELD_IDENTIFIER] = [];\n }\n $errs[self::FIELD_IDENTIFIER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_INTERNATIONAL_BIRTH_DATE])) {\n $v = $this->getInternationalBirthDate();\n foreach($validationRules[self::FIELD_INTERNATIONAL_BIRTH_DATE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_INTERNATIONAL_BIRTH_DATE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_INTERNATIONAL_BIRTH_DATE])) {\n $errs[self::FIELD_INTERNATIONAL_BIRTH_DATE] = [];\n }\n $errs[self::FIELD_INTERNATIONAL_BIRTH_DATE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_JURISDICTION])) {\n $v = $this->getJurisdiction();\n foreach($validationRules[self::FIELD_JURISDICTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_JURISDICTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_JURISDICTION])) {\n $errs[self::FIELD_JURISDICTION] = [];\n }\n $errs[self::FIELD_JURISDICTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_JURISDICTIONAL_AUTHORIZATION])) {\n $v = $this->getJurisdictionalAuthorization();\n foreach($validationRules[self::FIELD_JURISDICTIONAL_AUTHORIZATION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_JURISDICTIONAL_AUTHORIZATION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_JURISDICTIONAL_AUTHORIZATION])) {\n $errs[self::FIELD_JURISDICTIONAL_AUTHORIZATION] = [];\n }\n $errs[self::FIELD_JURISDICTIONAL_AUTHORIZATION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LEGAL_BASIS])) {\n $v = $this->getLegalBasis();\n foreach($validationRules[self::FIELD_LEGAL_BASIS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_LEGAL_BASIS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LEGAL_BASIS])) {\n $errs[self::FIELD_LEGAL_BASIS] = [];\n }\n $errs[self::FIELD_LEGAL_BASIS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PROCEDURE])) {\n $v = $this->getProcedure();\n foreach($validationRules[self::FIELD_PROCEDURE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_PROCEDURE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PROCEDURE])) {\n $errs[self::FIELD_PROCEDURE] = [];\n }\n $errs[self::FIELD_PROCEDURE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REGULATOR])) {\n $v = $this->getRegulator();\n foreach($validationRules[self::FIELD_REGULATOR] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_REGULATOR, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REGULATOR])) {\n $errs[self::FIELD_REGULATOR] = [];\n }\n $errs[self::FIELD_REGULATOR][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_RESTORE_DATE])) {\n $v = $this->getRestoreDate();\n foreach($validationRules[self::FIELD_RESTORE_DATE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_RESTORE_DATE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_RESTORE_DATE])) {\n $errs[self::FIELD_RESTORE_DATE] = [];\n }\n $errs[self::FIELD_RESTORE_DATE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_STATUS])) {\n $v = $this->getStatus();\n foreach($validationRules[self::FIELD_STATUS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_STATUS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_STATUS])) {\n $errs[self::FIELD_STATUS] = [];\n }\n $errs[self::FIELD_STATUS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_STATUS_DATE])) {\n $v = $this->getStatusDate();\n foreach($validationRules[self::FIELD_STATUS_DATE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_STATUS_DATE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_STATUS_DATE])) {\n $errs[self::FIELD_STATUS_DATE] = [];\n }\n $errs[self::FIELD_STATUS_DATE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_SUBJECT])) {\n $v = $this->getSubject();\n foreach($validationRules[self::FIELD_SUBJECT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_SUBJECT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_SUBJECT])) {\n $errs[self::FIELD_SUBJECT] = [];\n }\n $errs[self::FIELD_SUBJECT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_VALIDITY_PERIOD])) {\n $v = $this->getValidityPeriod();\n foreach($validationRules[self::FIELD_VALIDITY_PERIOD] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_VALIDITY_PERIOD, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_VALIDITY_PERIOD])) {\n $errs[self::FIELD_VALIDITY_PERIOD] = [];\n }\n $errs[self::FIELD_VALIDITY_PERIOD][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CONTAINED])) {\n $v = $this->getContained();\n foreach($validationRules[self::FIELD_CONTAINED] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_CONTAINED, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CONTAINED])) {\n $errs[self::FIELD_CONTAINED] = [];\n }\n $errs[self::FIELD_CONTAINED][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXTENSION])) {\n $v = $this->getExtension();\n foreach($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXTENSION])) {\n $errs[self::FIELD_EXTENSION] = [];\n }\n $errs[self::FIELD_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODIFIER_EXTENSION])) {\n $v = $this->getModifierExtension();\n foreach($validationRules[self::FIELD_MODIFIER_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_MODIFIER_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODIFIER_EXTENSION])) {\n $errs[self::FIELD_MODIFIER_EXTENSION] = [];\n }\n $errs[self::FIELD_MODIFIER_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TEXT])) {\n $v = $this->getText();\n foreach($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_TEXT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TEXT])) {\n $errs[self::FIELD_TEXT] = [];\n }\n $errs[self::FIELD_TEXT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ID])) {\n $v = $this->getId();\n foreach($validationRules[self::FIELD_ID] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_ID, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ID])) {\n $errs[self::FIELD_ID] = [];\n }\n $errs[self::FIELD_ID][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IMPLICIT_RULES])) {\n $v = $this->getImplicitRules();\n foreach($validationRules[self::FIELD_IMPLICIT_RULES] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_IMPLICIT_RULES, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IMPLICIT_RULES])) {\n $errs[self::FIELD_IMPLICIT_RULES] = [];\n }\n $errs[self::FIELD_IMPLICIT_RULES][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LANGUAGE])) {\n $v = $this->getLanguage();\n foreach($validationRules[self::FIELD_LANGUAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_LANGUAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LANGUAGE])) {\n $errs[self::FIELD_LANGUAGE] = [];\n }\n $errs[self::FIELD_LANGUAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_META])) {\n $v = $this->getMeta();\n foreach($validationRules[self::FIELD_META] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_META, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_META])) {\n $errs[self::FIELD_META] = [];\n }\n $errs[self::FIELD_META][$rule] = $err;\n }\n }\n }\n return $errs;\n }", "public function getFieldErrors($group_id, $field_id)\n\t{\n\t\treturn $this->getArrayItemByPath($this->field_errors, $group_id,\n\t\t\tisset($this->group_keys_prefix[$group_id]) ? $this->group_keys_prefix[$group_id] : null,\n\t\t\tisset($this->group_keys[$group_id]) ? $this->group_keys[$group_id] : null,\n\t\t\t$field_id);\n\t}", "public function getValidationMessages($key)\n\t{\n\t\t$path = ROOT_DIR.\"/library/Bloomfi/App/Messages/validationMessages.ini\";\n\t\treturn $this->getIniMessages($path,$key);\n\t}", "public function getValidationErrors();", "public function getValidationErrors();", "public function renderError( $key )\n {\n if ( !empty( $this->errors[ $key ] ) )\n echo \"<p class=\\\"error\\\">\" . $this->errors[ $key ] . \"</p>\\n\";\n }", "public function _getValidationErrors()\n {\n $errs = parent::_getValidationErrors();\n $validationRules = $this->_getValidationRules();\n if (null !== ($v = $this->getAccident())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ACCIDENT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getAccidentType())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ACCIDENT_TYPE] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getAdditionalMaterials())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_ADDITIONAL_MATERIALS, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getCondition())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_CONDITION, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getCoverage())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_COVERAGE, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getCreated())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_CREATED] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getDiagnosis())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_DIAGNOSIS, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getEnterer())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ENTERER] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getException())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_EXCEPTION, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getFacility())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_FACILITY] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getFundsReserve())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_FUNDS_RESERVE] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getIdentifier())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_IDENTIFIER, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getInterventionException())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_INTERVENTION_EXCEPTION, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getItem())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_ITEM, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getMissingTeeth())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_MISSING_TEETH, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getOrganization())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ORGANIZATION] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getOriginalPrescription())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ORIGINAL_PRESCRIPTION] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getOriginalRuleset())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ORIGINAL_RULESET] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPatient())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PATIENT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPayee())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PAYEE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPrescription())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PRESCRIPTION] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPriority())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PRIORITY] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getProvider())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PROVIDER] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getReferral())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_REFERRAL] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getRuleset())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_RULESET] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getSchool())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_SCHOOL] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getTarget())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_TARGET] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getType())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_TYPE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getUse())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_USE] = $fieldErrs;\n }\n }\n if (isset($validationRules[self::FIELD_ACCIDENT])) {\n $v = $this->getAccident();\n foreach($validationRules[self::FIELD_ACCIDENT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ACCIDENT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ACCIDENT])) {\n $errs[self::FIELD_ACCIDENT] = [];\n }\n $errs[self::FIELD_ACCIDENT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ACCIDENT_TYPE])) {\n $v = $this->getAccidentType();\n foreach($validationRules[self::FIELD_ACCIDENT_TYPE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ACCIDENT_TYPE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ACCIDENT_TYPE])) {\n $errs[self::FIELD_ACCIDENT_TYPE] = [];\n }\n $errs[self::FIELD_ACCIDENT_TYPE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ADDITIONAL_MATERIALS])) {\n $v = $this->getAdditionalMaterials();\n foreach($validationRules[self::FIELD_ADDITIONAL_MATERIALS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ADDITIONAL_MATERIALS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ADDITIONAL_MATERIALS])) {\n $errs[self::FIELD_ADDITIONAL_MATERIALS] = [];\n }\n $errs[self::FIELD_ADDITIONAL_MATERIALS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CONDITION])) {\n $v = $this->getCondition();\n foreach($validationRules[self::FIELD_CONDITION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_CONDITION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CONDITION])) {\n $errs[self::FIELD_CONDITION] = [];\n }\n $errs[self::FIELD_CONDITION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_COVERAGE])) {\n $v = $this->getCoverage();\n foreach($validationRules[self::FIELD_COVERAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_COVERAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_COVERAGE])) {\n $errs[self::FIELD_COVERAGE] = [];\n }\n $errs[self::FIELD_COVERAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CREATED])) {\n $v = $this->getCreated();\n foreach($validationRules[self::FIELD_CREATED] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_CREATED, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CREATED])) {\n $errs[self::FIELD_CREATED] = [];\n }\n $errs[self::FIELD_CREATED][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_DIAGNOSIS])) {\n $v = $this->getDiagnosis();\n foreach($validationRules[self::FIELD_DIAGNOSIS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_DIAGNOSIS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DIAGNOSIS])) {\n $errs[self::FIELD_DIAGNOSIS] = [];\n }\n $errs[self::FIELD_DIAGNOSIS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ENTERER])) {\n $v = $this->getEnterer();\n foreach($validationRules[self::FIELD_ENTERER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ENTERER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ENTERER])) {\n $errs[self::FIELD_ENTERER] = [];\n }\n $errs[self::FIELD_ENTERER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXCEPTION])) {\n $v = $this->getException();\n foreach($validationRules[self::FIELD_EXCEPTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_EXCEPTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXCEPTION])) {\n $errs[self::FIELD_EXCEPTION] = [];\n }\n $errs[self::FIELD_EXCEPTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_FACILITY])) {\n $v = $this->getFacility();\n foreach($validationRules[self::FIELD_FACILITY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_FACILITY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_FACILITY])) {\n $errs[self::FIELD_FACILITY] = [];\n }\n $errs[self::FIELD_FACILITY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_FUNDS_RESERVE])) {\n $v = $this->getFundsReserve();\n foreach($validationRules[self::FIELD_FUNDS_RESERVE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_FUNDS_RESERVE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_FUNDS_RESERVE])) {\n $errs[self::FIELD_FUNDS_RESERVE] = [];\n }\n $errs[self::FIELD_FUNDS_RESERVE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IDENTIFIER])) {\n $v = $this->getIdentifier();\n foreach($validationRules[self::FIELD_IDENTIFIER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_IDENTIFIER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IDENTIFIER])) {\n $errs[self::FIELD_IDENTIFIER] = [];\n }\n $errs[self::FIELD_IDENTIFIER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_INTERVENTION_EXCEPTION])) {\n $v = $this->getInterventionException();\n foreach($validationRules[self::FIELD_INTERVENTION_EXCEPTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_INTERVENTION_EXCEPTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_INTERVENTION_EXCEPTION])) {\n $errs[self::FIELD_INTERVENTION_EXCEPTION] = [];\n }\n $errs[self::FIELD_INTERVENTION_EXCEPTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ITEM])) {\n $v = $this->getItem();\n foreach($validationRules[self::FIELD_ITEM] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ITEM, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ITEM])) {\n $errs[self::FIELD_ITEM] = [];\n }\n $errs[self::FIELD_ITEM][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MISSING_TEETH])) {\n $v = $this->getMissingTeeth();\n foreach($validationRules[self::FIELD_MISSING_TEETH] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_MISSING_TEETH, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MISSING_TEETH])) {\n $errs[self::FIELD_MISSING_TEETH] = [];\n }\n $errs[self::FIELD_MISSING_TEETH][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ORGANIZATION])) {\n $v = $this->getOrganization();\n foreach($validationRules[self::FIELD_ORGANIZATION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ORGANIZATION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ORGANIZATION])) {\n $errs[self::FIELD_ORGANIZATION] = [];\n }\n $errs[self::FIELD_ORGANIZATION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ORIGINAL_PRESCRIPTION])) {\n $v = $this->getOriginalPrescription();\n foreach($validationRules[self::FIELD_ORIGINAL_PRESCRIPTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ORIGINAL_PRESCRIPTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ORIGINAL_PRESCRIPTION])) {\n $errs[self::FIELD_ORIGINAL_PRESCRIPTION] = [];\n }\n $errs[self::FIELD_ORIGINAL_PRESCRIPTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ORIGINAL_RULESET])) {\n $v = $this->getOriginalRuleset();\n foreach($validationRules[self::FIELD_ORIGINAL_RULESET] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ORIGINAL_RULESET, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ORIGINAL_RULESET])) {\n $errs[self::FIELD_ORIGINAL_RULESET] = [];\n }\n $errs[self::FIELD_ORIGINAL_RULESET][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PATIENT])) {\n $v = $this->getPatient();\n foreach($validationRules[self::FIELD_PATIENT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PATIENT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PATIENT])) {\n $errs[self::FIELD_PATIENT] = [];\n }\n $errs[self::FIELD_PATIENT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PAYEE])) {\n $v = $this->getPayee();\n foreach($validationRules[self::FIELD_PAYEE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PAYEE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PAYEE])) {\n $errs[self::FIELD_PAYEE] = [];\n }\n $errs[self::FIELD_PAYEE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PRESCRIPTION])) {\n $v = $this->getPrescription();\n foreach($validationRules[self::FIELD_PRESCRIPTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PRESCRIPTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PRESCRIPTION])) {\n $errs[self::FIELD_PRESCRIPTION] = [];\n }\n $errs[self::FIELD_PRESCRIPTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PRIORITY])) {\n $v = $this->getPriority();\n foreach($validationRules[self::FIELD_PRIORITY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PRIORITY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PRIORITY])) {\n $errs[self::FIELD_PRIORITY] = [];\n }\n $errs[self::FIELD_PRIORITY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PROVIDER])) {\n $v = $this->getProvider();\n foreach($validationRules[self::FIELD_PROVIDER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PROVIDER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PROVIDER])) {\n $errs[self::FIELD_PROVIDER] = [];\n }\n $errs[self::FIELD_PROVIDER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REFERRAL])) {\n $v = $this->getReferral();\n foreach($validationRules[self::FIELD_REFERRAL] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_REFERRAL, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REFERRAL])) {\n $errs[self::FIELD_REFERRAL] = [];\n }\n $errs[self::FIELD_REFERRAL][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_RULESET])) {\n $v = $this->getRuleset();\n foreach($validationRules[self::FIELD_RULESET] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_RULESET, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_RULESET])) {\n $errs[self::FIELD_RULESET] = [];\n }\n $errs[self::FIELD_RULESET][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_SCHOOL])) {\n $v = $this->getSchool();\n foreach($validationRules[self::FIELD_SCHOOL] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_SCHOOL, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_SCHOOL])) {\n $errs[self::FIELD_SCHOOL] = [];\n }\n $errs[self::FIELD_SCHOOL][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TARGET])) {\n $v = $this->getTarget();\n foreach($validationRules[self::FIELD_TARGET] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_TARGET, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TARGET])) {\n $errs[self::FIELD_TARGET] = [];\n }\n $errs[self::FIELD_TARGET][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TYPE])) {\n $v = $this->getType();\n foreach($validationRules[self::FIELD_TYPE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_TYPE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TYPE])) {\n $errs[self::FIELD_TYPE] = [];\n }\n $errs[self::FIELD_TYPE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_USE])) {\n $v = $this->getUse();\n foreach($validationRules[self::FIELD_USE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_USE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_USE])) {\n $errs[self::FIELD_USE] = [];\n }\n $errs[self::FIELD_USE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CONTAINED])) {\n $v = $this->getContained();\n foreach($validationRules[self::FIELD_CONTAINED] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_CONTAINED, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CONTAINED])) {\n $errs[self::FIELD_CONTAINED] = [];\n }\n $errs[self::FIELD_CONTAINED][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXTENSION])) {\n $v = $this->getExtension();\n foreach($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXTENSION])) {\n $errs[self::FIELD_EXTENSION] = [];\n }\n $errs[self::FIELD_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODIFIER_EXTENSION])) {\n $v = $this->getModifierExtension();\n foreach($validationRules[self::FIELD_MODIFIER_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_MODIFIER_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODIFIER_EXTENSION])) {\n $errs[self::FIELD_MODIFIER_EXTENSION] = [];\n }\n $errs[self::FIELD_MODIFIER_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TEXT])) {\n $v = $this->getText();\n foreach($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_TEXT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TEXT])) {\n $errs[self::FIELD_TEXT] = [];\n }\n $errs[self::FIELD_TEXT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ID])) {\n $v = $this->getId();\n foreach($validationRules[self::FIELD_ID] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_ID, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ID])) {\n $errs[self::FIELD_ID] = [];\n }\n $errs[self::FIELD_ID][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IMPLICIT_RULES])) {\n $v = $this->getImplicitRules();\n foreach($validationRules[self::FIELD_IMPLICIT_RULES] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_IMPLICIT_RULES, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IMPLICIT_RULES])) {\n $errs[self::FIELD_IMPLICIT_RULES] = [];\n }\n $errs[self::FIELD_IMPLICIT_RULES][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LANGUAGE])) {\n $v = $this->getLanguage();\n foreach($validationRules[self::FIELD_LANGUAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_LANGUAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LANGUAGE])) {\n $errs[self::FIELD_LANGUAGE] = [];\n }\n $errs[self::FIELD_LANGUAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_META])) {\n $v = $this->getMeta();\n foreach($validationRules[self::FIELD_META] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_META, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_META])) {\n $errs[self::FIELD_META] = [];\n }\n $errs[self::FIELD_META][$rule] = $err;\n }\n }\n }\n return $errs;\n }", "protected function getErrorsFromAncestor($key)\n {\n if ($ancestor = $this->getControlBlockContainer()) {\n return $ancestor->getErrors($key);\n }\n\n return [];\n }", "public function validationErrors() {\n\t\t$return = array();\n\n\t\t$models = ClassRegistry::keys();\n\t\tforeach ($models as $currentModel) {\n\t\t\t$currentObject = ClassRegistry::getObject($currentModel);\n\t\t\tif ($currentObject instanceof Model) {\n\t\t\t\t$return[$currentObject->alias] = $currentObject->validationErrors;\n\t\t\t}\n\t\t}\n\n\t\treturn $return;\n\t}", "public function getErrors() {\n /** @var Table $this */\n $errors = $this->entity->getErrors();\n\n $getThis = function ($association, $path, &$current, &$previous) {\n $key = array_pop($path);\n\n foreach ($current as $k => $v) {\n\n if ($association == 'embedded') {\n\n if (is_scalar($v)) {\n return;\n }\n $k = \"$key.$k\";\n }\n $previous[$k] = $v;\n }\n unset($previous[$key]);\n };\n\n $this->walkWithAssociated($errors, $getThis);\n $result = [];\n\n foreach ($errors as $field => $error) {\n $alias = $this->getAliasByField($field);\n\n foreach ($error as $key => $value) {\n // hasMany\n if (is_numeric($key)) {\n $result[$alias . \"[$key].\" . key($value)] = array_values(array_values($value)[0])[0];\n }\n else {\n $result[$alias] = $value;\n break;\n }\n }\n }\n\n return $result;\n }", "public function errors($file = NULL)\n\t{\n\t\tif ($file === NULL)\n\t\t{\n\t\t\t$errors = array();\n\t\t\tforeach($this->errors as $field => $error)\n\t\t\t{\n\t\t\t\t$errors[$field] = $error[0];\n\t\t\t}\n\t\t\treturn $errors;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$errors = array();\n\t\t\tforeach ($this->errors as $input => $error)\n\t\t\t{\n\t\t\t\t// Locations to check for error messages\n\t\t\t\t$error_locations = array\n\t\t\t\t(\n\t\t\t\t\t\"validation/{$file}.{$input}.{$error[0]}\",\n\t\t\t\t\t\"validation/{$file}.{$input}.default\",\n\t\t\t\t\t\"validation/default.{$error[0]}\"\n\t\t\t\t);\n\n\t\t\t\tif (($message = Kohana::message($error_locations[0])) !== $error_locations[0])\n\t\t\t\t{\n\t\t\t\t\t// Found a message for this field and error\n\t\t\t\t}\n\t\t\t\telseif (($message = Kohana::message($error_locations[1])) !== $error_locations[1])\n\t\t\t\t{\n\t\t\t\t\t// Found a default message for this field\n\t\t\t\t}\n\t\t\t\telseif (($message = Kohana::message($error_locations[2])) !== $error_locations[2])\n\t\t\t\t{\n\t\t\t\t\t// Found a default message for this error\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// No message exists, display the path expected\n\t\t\t\t\t$message = \"validation/{$file}.{$input}.{$error[0]}\";\n\t\t\t\t}\n\n\t\t\t\t// Start the translation values list\n\t\t\t\t$values = array(':field' => __($this->labels[$input]));\n\n\t\t\t\tif ( ! empty($error[1]))\n\t\t\t\t{\n\t\t\t\t\tforeach ($error[1] as $key => $value)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Add each parameter as a numbered value, starting from 1\n\t\t\t\t\t\t$values[':param'.($key + 1)] = __($value);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Translate the message using the default language\n\t\t\t\t$errors[$input] = __($message, $values);\n\t\t\t}\n\n\t\t\treturn $errors;\n\t\t}\n\t}", "public function getErrors()\n {\n if (array_key_exists(\"errors\", $this->_propDict)) {\n return $this->_propDict[\"errors\"];\n } else {\n return null;\n }\n }", "public static function getErrorObject($key){\n $arr = [\n\n //----------------------------------------------------------------------------------------------------------\n // success messeges : 200\n 'Login_success' => [\n 'msg' => 'logging in successfuly',\n 'code' => 200\n ],\n 'Register_success' => [\n 'msg' => 'you have been registered successfuly',\n 'code' => 200\n ],\n 'VerifyAccount_success' => [\n 'msg' => 'your account has been verified successfuly!',\n 'code' => 200\n ],\n 'ChangePassword_success' => [\n 'msg' => 'password has been changed successfuly!',\n 'code' => 200\n ],\n 'editUser_success' => [\n 'msg' => 'user has been edited successfuly!',\n 'code' => 200\n ],\n 'logout_success' => [\n 'msg' => 'user has been logged out successfuly!',\n 'code' => 200\n ],\n 'getUserProfile_success' => [\n 'msg' => 'getting your profile successfuly!',\n 'code' => 200\n ],\n 'resetPassword_success' => [\n 'msg' => 'your password has been set successfuly!',\n 'code' => 200\n ],\n 'verificationCode_success' => [\n 'msg' => 'the verification code has been sent to you successfuly!',\n 'code' => 200\n ],\n //----------------------------------------------------------------------------------------------------------\n\n\n //----------------------------------------------------------------------------------------------------------\n // General Messeges : -1 -> -3\n 'missingVal' => [\n 'msg' => '',\n 'code' => -1\n ],\n 'GeneralError' => [\n 'msg' => 'something went wrong!',\n 'code' => -2\n ],\n 'Session_Offline' => [\n 'msg' => 'this action cant be done offline!',\n 'code' => -3\n ],\n //----------------------------------------------------------------------------------------------------------\n\n\n //----------------------------------------------------------------------------------------------------------\n // login messeges : -4 -> -9\n 'wrongPassword' => [ ////////////////////////////////////////////\n 'msg' => 'wrong Password!',\n 'code' => -4\n ],\n 'Login_verifyNeeded' => [\n 'msg' => 'you need to verify your account before logging in!',\n 'code' => -5\n ],\n 'userNameNotExist' => [ ////////////////////////////////////////////\n 'msg' => 'userName is not exist!',\n 'code' => -6\n ],\n 'Login_Blocked' => [\n 'msg' => 'you cant logged in by blocked account',\n 'code' => -7\n ],\n 'Login_SessionError' => [\n 'msg' => 'this session cant be opened cause of some error',\n 'code' => -8\n ],\n 'Login_VerificationCode' => [\n 'msg' => 'verification code cant be added',\n 'code' => -9\n ],\n //----------------------------------------------------------------------------------------------------------\n\n\n //----------------------------------------------------------------------------------------------------------\n // register messeges : -10\n 'Register_repeatedElement' => [\n 'msg' => '',\n 'code' => -10\n ],\n //----------------------------------------------------------------------------------------------------------\n\n\n //----------------------------------------------------------------------------------------------------------\n // VerifyAccount messeges : -11 -> -13\n 'VerifyAccount_verifiedbefore' => [\n 'msg' => 'your account is verified before!',\n 'code' => -11\n ],\n 'VerifyAccount_Blocked' => [\n 'msg' => 'you cant verify your account if you are blocked!',\n 'code' => -13\n ],\n //----------------------------------------------------------------------------------------------------------\n\n\n //----------------------------------------------------------------------------------------------------------\n // VerifyResetingPassword messeges : -14 -> -16\n 'VerifyResetingPassword_Blocked' => [\n 'msg' => 'you cant reset your password if your account are blocked',\n 'code' => -14\n ],\n 'VerifyResetingPassword_unverified' => [\n 'msg' => 'you cant reset your password if your account are unverified',\n 'code' => -16\n ],\n //----------------------------------------------------------------------------------------------------------\n\n\n //----------------------------------------------------------------------------------------------------------\n // ChangePassword messeges : -15 -> -17\n 'ChangePassword_unverifiedAccount' => [\n 'msg' => 'you need to verify your account to change your password!',\n 'code' => -15\n ],\n 'ChangePassword_blockedAccount' => [\n 'msg' => 'you cant change your password if your account is blocked!',\n 'code' => -16\n ],\n 'ChangePassword_loggedoutAccount' => [\n 'msg' => 'you cant change your password if your are offline!',\n 'code' => -17\n ],\n //----------------------------------------------------------------------------------------------------------\n\n\n //----------------------------------------------------------------------------------------------------------\n // sendVerificationCodeRegistering messeges : -18 -> -19\n 'sendVerificationCodeRegistering_unverified' => [\n 'msg' => 'you cant resend verification code if your account is verified',\n 'code' => -18\n ],\n 'sendVerificationCodeRegistering_Blocked' => [\n 'msg' => 'you cant resend verification code if your account is blocked',\n 'code' => -19\n ],\n //----------------------------------------------------------------------------------------------------------\n\n\n //----------------------------------------------------------------------------------------------------------\n // sendVerificationCodeResetingPasssword messeges : -20 -> -21\n 'sendVerificationCodeResetingPasssword_unverified' => [\n 'msg' => 'your cant resend verification code if your account isnt verified yet!',\n 'code' => -20\n ],\n 'sendVerificationCodeResetingPasssword_Blocked' => [\n 'msg' => 'your cant resend verification code if your account isnt blocked!',\n 'code' => -21\n ],\n //----------------------------------------------------------------------------------------------------------\n\n\n //----------------------------------------------------------------------------------------------------------\n // logout messeges : -22\n 'logout_loggedoutbefore' => [\n 'msg' => 'you are logged out before!',\n 'code' => -22\n ],\n //----------------------------------------------------------------------------------------------------------\n\n\n //----------------------------------------------------------------------------------------------------------\n // resetpassword messeges : -23 -> -24\n 'reset_verifyNeeded' => [\n 'msg' => 'you need to verify your account before reseting password!',\n 'code' => -23\n ],\n 'reset_Blocked' => [\n 'msg' => 'you cant reset your password if your account is blocked',\n 'code' => -24\n ],\n //----------------------------------------------------------------------------------------------------------\n\n\n //----------------------------------------------------------------------------------------------------------\n // editUser messeges : -25\n 'editUser_repeatedVal' => [\n 'msg' => '',\n 'code' => -25\n ],\n //----------------------------------------------------------------------------------------------------------\n\n\n\n ];\n return $arr[$key];\n }", "public function failures($key)\n {\n return $this->cache->get($key, 0);\n }" ]
[ "0.6994177", "0.65171075", "0.62357885", "0.61995965", "0.6124119", "0.59410465", "0.5878711", "0.5747908", "0.5709658", "0.5597807", "0.55976063", "0.55904186", "0.55904186", "0.55904186", "0.55904186", "0.55863374", "0.55746555", "0.5570421", "0.5558939", "0.55123585", "0.55123585", "0.55090106", "0.5469522", "0.5457663", "0.5450971", "0.54505324", "0.5420152", "0.54015875", "0.53684986", "0.5364735" ]
0.79381937
0
Does a value only contain alphanumeric characters and hyphen $rule = array('username' => 'alphanumhyphen');
private function process_alphanumhyphen($value) { return ! preg_match('/[^a-zA-Z0-9-]/', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected static function _alphaNumeric(){\n if (self::$_ruleValue) {\n $str = trim(self::$_elementValue);\n if (!preg_match('/[a-zA-z0-9]/', $str)) {\n self:: setErrorMessage(\"Alphanumeric only\");\n self::setInvalidFlag(true);\n } else {\n self::setInvalidFlag(false);\n }\n }\n }", "function non_karakter($a){\n if(preg_match(\"/^[A-Za-z0-9 -]*$/\",$a)){\n return false;\n }\n return true;\n}", "function isValid($username) {\n\treturn !preg_match('/[^a-z0-9.\\-_]/i', $username);\n}", "protected static function validate_alphanumeric( $value ){\n\t\treturn true;\n\t}", "static public function is_alphanum($value) {\n\t\treturn !preg_match(\"/[^a-zA-Z_-\\s0-9]/\",$value);\n\t}", "private function process_alphanum($value)\n {\n return ! preg_match('/[^a-zA-Z0-9]/', $value);\n }", "function valid_username($username)\n{\n\t$filter = preg_replace(\"/[^a-z\\d\\-=\\?!@:\\.]/i\", \"\", $username);\n\t\n\tif($filter == $username){\n\t\treturn $username; //preg_match('#^[a-z]{1,2}[a-z0-9-_.-]+$#i', $username);\n\t}\n}", "public function isValidUsername($username)\n {\n return ctype_alnum($username);\n }", "private function isAlphanumeric($field)\n {\n return preg_match('/^([a-zA-Z0-9\\-])+$/', $field) ? true : false;\n\n }", "function regexcheckusername($username){\n\t$regex_pattern=\"/^\\s*([a-zA-Z0-9]+[a-zA-Z0-9_-]*)+[a-zA-Z0-9]\\s*$/\"; //the displayname must begin and end with alphanumeric\n\treturn preg_match($regex_pattern,$username);//returns 1 if the username was valid\n}", "function validate(){\n if($this->value!=''){\n if(!preg_match (\"/^[a-zA-Z\\s]+$/\",$this->value)) {\n $this->displayFieldError('Must Be Alphabets only');\n }\n }\n return parent::validate();\n }", "function regex_username($uname){\n return preg_match('/^[a-zA-Z0-9]+$/',$uname);\n}", "function test_names($data){\n\tif (!preg_match(\"/^[a-zA-Z-' ]*$/\",$data)) {\n \t\treturn \"Only letters and white space allowed\";\n\t}\n\treturn $data;\n}", "function alpha_space_only($str)\n {\n if (!preg_match(\"/^[a-zA-Z- ]+$/\",$str))\n {\n $this->form_validation->set_message('alpha_space_only', 'Le champs %s ne doit contenir que des lettres, tiret (-) et espace.');\n return FALSE;\n }\n else\n {\n return TRUE;\n }\n }", "function mycheck_alphadash($str)\n{\n if (preg_match('/^[a-z0-9_-]+$/i', $str)) {\n return true;\n } else {\n return false;\n }\n}", "static public function is_alpha($value) {\n\t\treturn !preg_match(\"/[^a-zA-Z_-\\s]/\",$value);\n\t}", "public function validate( $value )\n\t{\n\t\treturn ctype_alnum( $value );\n\t}", "private function validateUsername() {\r\n $val = trim($this->data['username');\r\n \r\n if( empty($val) ) { \r\n $this->addError('username', 'username cannot be empty');\r\n } else {\r\n if(preg_match('/^[a-aA-Z0-9]{6,12}$/', $val)) {\r\n $this->addError('username', 'username must 6-12 chars $ alphanumeric')\r\n }\r\n } \r\n }", "function alpha_space_only($str){\n\t\tif (!preg_match(\"/^[a-zA-Z ]+$/\",$str)){\n\t\t\t$this->form_validation->set_message('alpha_space_only', 'The %s field must contain only alphabets and space');\n\t\t\treturn FALSE;\n\t\t}\n\t\telse{\n\t\t\treturn TRUE;\n\t\t}\n\t}", "function alpha_extra($str) {\n $this->CI->form_validation->set_message('alpha_extra', 'The %s may only contain alpha-numeric characters, spaces, periods, underscores & dashes.');\n return ( ! preg_match(\"/^([\\.\\s-a-z0-9_-])+$/i\", $str)) ? FALSE : TRUE;\n }", "function validate_alphanumeric() {\n # Check Value is Alphanumeric\n if (ctype_alnum($this->cur_val)) {\n # Remove any existing error message\n $this->error_message = \"\";\n\n # Return Value\n return $this->cur_val;\n }\n else {\n # Set Error Message\n $this->set_error(\"Validation for alphanumeric ({$this->cur_val}) failed. This is type \" . gettype($this->cur_val));\n\n # Return AlphaNumeric version of value.\n return preg_replace(\"#[^a-zA-Z0-9_]#i\", \"\", $this->cur_val);\n }\n }", "function alpha_space_only($str) {\n if (!preg_match(\"/^[a-zA-Z ]+$/\",$str)) {\n $this->form_validation->set_message('alpha_space_only', 'The %s field must contain only alphabets and space');\n return FALSE;\n } else {\n return TRUE;\n }\n }", "function alpha_space_only($str)\r\n {\r\n if (!preg_match(\"/^[a-zA-Z ]+$/\",$str))\r\n {\r\n $this->form_validation->set_message('alpha_space_only', 'The %s field must contain only alphabets and space');\r\n return FALSE;\r\n }\r\n else\r\n {\r\n return TRUE;\r\n }\r\n }", "protected function validateAlphaDash($value){\n\t\treturn preg_match('/^[\\pL\\pM\\pN_-]+$/u', $value);\n\t}", "function validate_username($field)\n\t{\n\t\tif ($field == \"\") return \"No Username was entered.<br>\";\n\t\telse if (strlen($field) < 5)\n\t\t\treturn \"Username must be at least 5 characters.<br>\";\n\t\telse if (preg_match(\"/[^a-zA-Z0-9_-]/\",$field))\n\t\t\treturn \"Only a-z, A-Z,0-9,- and _ allowed in Usernames.<br>\";\n\t\treturn \"\";\n\t}", "function alpha_space_only($str)\n {\n if (!preg_match(\"/^[a-zA-Z ]+$/\",$str))\n {\n $this->form_validation->set_message('alpha_space_only', 'The %s field must contain only alphabets and space');\n return FALSE;\n }\n else\n {\n return TRUE;\n }\n }", "public function testValidateSpecialChars(): void\n {\n $this->assertFalse($this->validate('some-text-123'));\n }", "protected function validateAlphaDashSpaces( $attribute, $value ) {\n return (bool) preg_match( \"/^[A-Za-z\\s-_]+$/\", $value );\n }", "function filterName($field){\n // Sanitize user name\n $field = filter_var(trim($field), FILTER_SANITIZE_STRING);\n\n // Validate user name\n if(filter_var($field, FILTER_VALIDATE_REGEXP, array(\"options\"=>array(\"regexp\"=>\"/^[a-zA-Z\\s]+/\")))){\n return $field;\n }else{\n return FALSE;\n }\n}", "function validateAlphanum($value) {\n\tif(ereg(\"^[a-zA-Z0-9]+$\", $value, $regs)) {\n\t\techo \"true\";\n\t} else {\n\t\techo \"false\";\n\t}\n}" ]
[ "0.72674924", "0.72103804", "0.71864104", "0.7124771", "0.71141285", "0.7093402", "0.700634", "0.70035607", "0.6901776", "0.68929225", "0.68920124", "0.6830163", "0.6808117", "0.6805563", "0.67930293", "0.67650265", "0.6763107", "0.67511755", "0.67378145", "0.6731889", "0.6691134", "0.66667193", "0.6629858", "0.6629687", "0.6616347", "0.65901524", "0.6578213", "0.6575182", "0.65592897", "0.6558217" ]
0.742126
0
Wrapper for is_array $rule = array('ids' => array('1','2','3');
private function process_array($value) { return is_array($value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function makeIsArrayValidator() : Closure\n {\n return function ($value) {\n if (!is_array($value)) {\n return [\n 'message' => \"{$value} is not an array\",\n 'result' => false\n ];\n } else {\n return [\n 'result' => true\n ];\n }\n };\n }", "function acf_is_array($array)\n{\n}", "function isArray ($value)\r\n{\r\n\treturn is_array ($value);\r\n}", "protected function validateArray($value){\n\t\treturn is_array($value);\n\t}", "private function _getArrayRule($field, $rules, $isNested = false)\n {\n $arrayRuleName = 'array';\n $hasNullableRule = false;\n\n // check the rule of array if found\n $arrayRule = array_filter(explode('|', $rules), function ($item) use ($arrayRuleName, &$hasNullableRule) {\n $hasNullableRule = $item == 'nullable';\n return substr($item, 0, strlen($arrayRuleName)) == $arrayRuleName;\n });\n\n if (!empty($arrayRule)) {\n try {\n $valueChecked = $this->_getValueChecked($field, $isNested);\n } catch (Exception $e) { // field not exist\n $this->set_message($field, 'The {field} field is not found.');\n return ['required', function ($value) use ($hasNullableRule) {\n return $hasNullableRule;\n }];\n }\n\n $subrules = $this->_extractSubRules($this->_getSubRules($arrayRule));\n\n // Note: CI will ignore the field that its value is an empty array.\n // So, to fix this when the subrules exist and the value is an empty array,\n // set its value to null\n if (!empty($subrules) && empty($valueChecked)) {\n $this->set_null($field);\n /* we do not need to check the error (field not exist) because it was checked above.\n if ($this->set_null($field) === false) {\n return ['required', function ($value) use ($hasNullableRule) {\n return $hasNullableRule;\n }];\n }*/\n }\n\n return [$arrayRuleName, function ($value) use ($valueChecked, $subrules, $arrayRuleName) {\n // check it is an array\n if (!is_array($valueChecked)) {\n $this->set_message($arrayRuleName, 'The {field} field must be an array.');\n return false;\n }\n // validate the subrules of array (min, max, size) if found\n return $this->_validateArraySubrules($valueChecked, $subrules, $arrayRuleName);\n }];\n }\n return null;\n }", "public function rules(): array\n {\n return [\n 'ids' => 'required',\n 'ids.*' => 'exists:'.$this->target::entityTableName().','.config('sx.primary'),\n ];\n }", "public function validArrayForArrayConfigurationProvider() {}", "function rest_is_array($maybe_array)\n {\n }", "protected function validate_array( $array, $prop, $schema ) {\n\t\tif ( ! wp_is_numeric_array( $array ) ) {\n\t\t\t$this->errors->add(\n\t\t\t\t$prop,\n\t\t\t\t__( 'This must be an array.', 'wporg' )\n\t\t\t);\n\t\t\t$this->append_error_data( $prop, 'error' );\n\n\t\t\treturn false;\n\t\t}\n\n\t\t$results = array();\n\n\t\tif ( isset( $schema['minItems'] ) ) {\n\t\t\tif ( count( $array ) < $schema['minItems'] ) {\n\t\t\t\t$this->errors->add(\n\t\t\t\t\t$prop,\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t'This must contain at least %d item.',\n\t\t\t\t\t\t\t'This must contain at least %d items.',\n\t\t\t\t\t\t\tabsint( $schema['minItems'] ),\n\t\t\t\t\t\t\t'wporg'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tnumber_format_i18n( floatval( $schema['minItems'] ) )\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t$this->append_error_data( $prop, 'error' );\n\t\t\t\t$results[] = false;\n\t\t\t}\n\t\t}\n\n\t\tif ( isset( $schema['maxItems'] ) ) {\n\t\t\tif ( count( $array ) > $schema['maxItems'] ) {\n\t\t\t\t$this->errors->add(\n\t\t\t\t\t$prop,\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t'This must contain at most %d item.',\n\t\t\t\t\t\t\t'This must contain at most %d items.',\n\t\t\t\t\t\t\tabsint( $schema['minItems'] ),\n\t\t\t\t\t\t\t'wporg'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tnumber_format_i18n( floatval( $schema['maxItems'] ) )\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t$this->append_error_data( $prop, 'error' );\n\t\t\t\t$results[] = false;\n\t\t\t}\n\t\t}\n\n\t\tif ( isset( $schema['items']['type'] ) ) {\n\t\t\t$index = 0;\n\n\t\t\tforeach ( $array as $item ) {\n\t\t\t\t$results[] = $this->route_validation_for_type(\n\t\t\t\t\t$schema['items']['type'],\n\t\t\t\t\t$item,\n\t\t\t\t\t$prop . \"[$index]\",\n\t\t\t\t\t$schema['items']\n\t\t\t\t);\n\t\t\t\t$index ++;\n\t\t\t}\n\t\t}\n\n\t\treturn ! in_array( false, $results, true );\n\t}", "function acf_is_sequential_array($array)\n{\n}", "function arrayAccessible($value)\n {\n return is_array($value);\n }", "function sanitize_array( $array = array(), $sanitize_rule = array() ){\n if ( ! is_array( $array ) || count( $array ) == 0 ) {\n return array();\n }\n\n foreach ( $array as $k => $v ) {\n if ( ! is_array( $v ) ) {\n\n $default_sanitize_rule = (is_numeric( $k )) ? 'html' : 'text';\n $sanitize_type = isset( $sanitize_rule[ $k ] ) ? $sanitize_rule[ $k ] : $default_sanitize_rule;\n $array[ $k ] = $this -> sanitize_value( $v, $sanitize_type );\n }\n if ( is_array( $v ) ) {\n $array[ $k ] = $this -> sanitize_array( $v, $sanitize_rule );\n }\n }\n\n return $array;\n }", "public function testCheckArray() {\n\t\t$iniFile = CAKE . 'Test' . DS . 'test_app' . DS . 'Config'. DS . 'acl.ini.php';\n\n\t\t$Ini = new IniAcl();\n\t\t$Ini->config = $Ini->readConfigFile($iniFile);\n\t\t$Ini->userPath = 'User.username';\n\n\t\t$user = array(\n\t\t\t'User' => array('username' => 'admin')\n\t\t);\n\t\t$this->assertTrue($Ini->check($user, 'posts'));\n\t}", "public function rules()\n {\n return [\n 'ids' => 'required|array',\n 'ids.*' => 'exists:comments,id',\n ];\n }", "public function validate(array $data);", "public function validate(array $data);", "function yy_r124(){$this->_retvalue = 'in_array('.$this->yystack[$this->yyidx + -2]->minor.',(array)'.$this->yystack[$this->yyidx + 0]->minor.')'; }", "protected function rules()\n {\n return [\n 'id' => 'required|array',\n 'id.*' => 'required|integer'\n ];\n }", "public function check_meta_is_array($value, $request, $param)\n {\n }", "abstract public function rules(): array;", "abstract public function rules(): array;", "abstract public function rules(): array;", "private function arrayValidator()\n {\n\n\n\n $rules = [\n 'name' => ['required', 'string'],\n 'email' => ['required', 'string', 'unique:users'],\n 'ConfigPassword' => ['required', 'string', 'min:8'],\n 'password' => ['required_with:ConfigPassword', 'same:ConfigPassword', 'min:8'],\n 'phone' => ['required'],\n 'nickname' => ['required'],\n \"gender\" => ['required'],\n \"profile_picture\" => ['required', 'mimes:jpeg,bmp,png,jpg'],\n \"birthday\" => ['required'],\n \"position\" => ['required'],\n \"weight\" => ['required'],\n \"height\" => ['required'],\n \"footPlay\" => ['required'],\n \"living_location\" => ['required'],\n \"previous_clubs\" => ['required'],\n \"strength_point\" => ['required'],\n \"scientificl_level\" => ['required'],\n \"level\" => ['required'],\n\n\n ];\n\n return $rules;\n }", "public function validIdsArray ()\r\n {\r\n return array (\r\n LegalDocumentType::TYPE_SSS,\r\n LegalDocumentType::TYPE_PAG_IBIG,\r\n LegalDocumentType::TYPE_POSTAL,\r\n LegalDocumentType::TYPE_PASSPORT,\r\n LegalDocumentType::TYPE_DRIVERS_LICENSE,\r\n LegalDocumentType::TYPE_PRC,\r\n LegalDocumentType::TYPE_VOTERS_ID,\r\n LegalDocumentType::TYPE_SCHOOL_ID,\r\n LegalDocumentType::TYPE_TIN\r\n );\r\n }", "protected function validate_array( $array, $prop, $schema ) {\n\t\tif ( ! is_array( $array ) ) {\n\t\t\t$this->messages->add(\n\t\t\t\t'error',\n\t\t\t\tsprintf(\n\t\t\t\t\t__( 'The %s property must contain an array value.', 'wporg-plugins' ),\n\t\t\t\t\t'<code>' . $prop . '</code>'\n\t\t\t\t)\n\t\t\t);\n\t\t\t$this->append_error_data( $prop, 'error' );\n\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( isset( $schema['items']['type'] ) ) {\n\t\t\t$results = array();\n\t\t\t$index = 0;\n\n\t\t\tforeach ( $array as $item ) {\n\t\t\t\t$results[] = $this->route_validation_for_type(\n\t\t\t\t\t$schema['items']['type'],\n\t\t\t\t\t$item,\n\t\t\t\t\t$prop . \"[$index]\",\n\t\t\t\t\t$schema['items']\n\t\t\t\t);\n\t\t\t\t$index ++;\n\t\t\t}\n\n\t\t\treturn ! in_array( false, $results, true );\n\t\t}\n\n\t\treturn true;\n\t}", "public function testIsArray() {\n\t\t$array = array('one' => 1, 'two' => 2);\n\t\t$result = _::isArray($array);\n\t\t$this->assertTrue($result);\n\n\t\t// test that an object is not an array\n\t\t$object = (object)$array;\n\t\t$result = _::isArray($object);\n\t\t$this->assertFalse($result);\n\t}", "public function rules()\n {\n return [\n 'ids' => 'required|array',\n 'ids.*' => 'exists:products,id',\n ];\n }", "public function getAnswers(array $ids) : array\n {\n\n }", "static function idValueArray(array $input) \n\t{\n\t\t$return = array();\n\t\tforeach ($input as $key => $value) {\n\n\n\t\t\tif (is_array($value))\n\t\t\t\t$value = self::idValueArray($value);\n\n\t\t\t$return[] = ['id' => $key, 'value' => $value];\n\t\t}\n\n\t\treturn $return;\n\t}", "public function rules(array $arg = []): ?array\n {\n if (count($arg) <= 0) {\n return $this->rules;\n }\n foreach ($arg as $selector => $rules) {\n if (!is_array($rules)) {\n return null;\n }\n foreach ($rules as $property => $declarations) {\n if (isset($this->rules)) {\n $this->rules[$selector][$property] = $declarations;\n } else {\n $this->rules = [\n $selector => [\n $property => $declarations\n ]\n ];\n }\n }\n }\n return $this->rules;\n }" ]
[ "0.60809493", "0.5999555", "0.5885403", "0.5848715", "0.58381534", "0.5760799", "0.574287", "0.5729256", "0.57115895", "0.5694543", "0.563859", "0.56356615", "0.5593658", "0.554811", "0.5513434", "0.5513434", "0.5480104", "0.5462608", "0.54562473", "0.54333705", "0.54333705", "0.54333705", "0.5432283", "0.5427787", "0.5422385", "0.53744704", "0.5373403", "0.53255355", "0.53232783", "0.5320347" ]
0.61283475
0
Is a value 'in' a given set of values $rule = array('id' => 'in:1,2,3');
private function process_in($value, $param = null) { return in_array($value, explode(',', $param)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function in(array $values);", "function has_inclusion_in($value,$set) {\n\t\treturn in_array($value,$set);\n\t\t}", "function has_inclusion_in($value, $set) {\n\treturn in_array($value, $set);\n}", "function has_inclusion_in($value, $set) {\n\treturn in_array($value, $set);\n}", "public function in($column,$val);", "public function whereIn($values);", "public function in($value, $list): bool\n\t{\n return in_array($value, explode(',', $list), true);\n }", "function has_inclusion_in($value, $set) {\r\n\treturn in_array($value, $set);\r\n}", "protected function validateIn($value, $parameters){\n\t\treturn in_array((string) $value, $parameters);\n\t}", "function is_in(...$args)\n{\n\t$needle = array_shift($args);\n\treturn in_array($needle,$args);\n}", "public static function validationRule()\n {\n return 'in:'. implode(',', static::getConstants());\n }", "function has_inclusion_of($value, $set) {\n return in_array($value, $set);\n}", "function in(...$options) {\n return function ($value) use ($options) {\n return in_array($value, $options);\n };\n}", "final public function in(...$values):bool\n {\n return Base\\Arrs::ins($this->prepareValues(...$values),$this->arr(),$this->isSensitive());\n }", "function has_inclusion_of( $value, $set ) {\n return in_array( $value, $set );\n}", "function enLista($valor, $set = [])\r\n{\r\n return in_array($valor, $set);\r\n}", "function in($value, $comp) {\n\t\t$comp = str_replace(\"\\\\,\", \"__WE_COMMA__\", $comp);\n\t\t$arr = explode(\",\", $comp);\n\t\t$l = count($arr);\n\t\tfor ($i=0; $i<$l; $i++) {\n\t\t\t$arr[$i] = str_replace(\"__WE_COMMA__\", \",\", $arr[$i]);\n\t\t}\n\t\treturn in_array($value, $arr);\n\t}", "public function in(array $list): array\n\t{\n\t\t$result = [];\n\n\t\tif (isset($list) && !empty($list))\n\t\t{\n\t\t\t$result = ['$in' => $list];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->error('One required non empty array argument should be passed to method', __METHOD__);\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "public function in($expression, $arrayExpression): static;", "public function whereIn($column, $values);", "function in_list ($str, $val)\n\t{\n\t\t//if ( $str == '' or is_null( $str ) ) return FALSE;\n\t\t$aList = split(\",\", $val);\n\t\treturn ( in_array( $str, $aList ) ) ? TRUE : FALSE;\n\t}", "function value_is_in_set($value, $array) {\n return in_array($value, $array);\n }", "public function whereIn(string $field, array $values, array $options = []);", "function contained_in_ids($collection, $item)\n {\n foreach($collection as $look)\n {\n if($look->id == $item->id) return true;\n }\n return false;\n }", "public function orIn($column,$val);", "private static function whereInRule(array $params)\n {\n return [\n \"filter\" => [\n \"bool\" => [\n \"must\" => [\n [\n \"terms\" => [\n \"id\" => $params\n ]\n ]\n ]\n ]\n ]\n ];\n }", "function contains_id($id, $data){\n return in_array($id, array_column($data, 'id'));\n}", "public static function inArray($value, array $values, $message = '');", "public function whereIn($column, $value)\n {\n }", "public static function whereIn($column, array $values);" ]
[ "0.73466647", "0.6641783", "0.66189027", "0.66189027", "0.66184", "0.658305", "0.6574956", "0.65687126", "0.6516381", "0.6437039", "0.63461596", "0.63260674", "0.62862796", "0.6252471", "0.62310106", "0.6228441", "0.61634755", "0.61172915", "0.61148363", "0.61049634", "0.6091173", "0.6064319", "0.60371953", "0.6024696", "0.6021387", "0.59426", "0.59276235", "0.59272593", "0.5926131", "0.5889663" ]
0.6676657
1