query
stringlengths 10
8.11k
| document
stringlengths 17
398k
| negatives
sequencelengths 19
20
| metadata
dict |
---|---|---|---|
/ DELETE ROUND TRIP PACKAGE | function round_package_delete($data){
$id = $data['id'];
$this->db->where('id', $id);
$query=$this->db->delete('round_trip_package');
if($query){
echo 1;
}else{
echo 0;
}
} | [
"function B1T7_delP3($B1T7P3) {\n\n\tB1T_DelPleId(\"7\", $B1T7P3, \"3\");\n/*\n$db = new SQLite_prj(DIRDB1DB);\n\n\t$db->Del(\"B1T7\", \"B1T7P3 = \" . $B1T7P3);\n\n$db->Close();\nunset($db);*/\n}",
"function remove_data()\n{\n\trequire('unidress_narola_uninstall.php');\n}",
"public function remove()\n {\n secupay_log($this->sp_log, \"remove\");\n xtc_db_query(\"DELETE FROM \" . TABLE_CONFIGURATION . \" WHERE configuration_key IN ('\" . implode(\n \"', '\",\n $this->keys()\n ) . \"','MODULE_PAYMENT_SECUPAY_SK_XTC_ALLOWED') AND configuration_key NOT IN ('MODULE_PAYMENT_SECUPAY_APIKEY','MODULE_PAYMENT_SECUPAY_EXPERIENCE','MODULE_PAYMENT_SECUPAY_TAUTOSEND','MODULE_PAYMENT_SECUPAY_ORDER_BEFORE_PAYMENT','MODULE_PAYMENT_SECUPAY_SESSION')\");\n\n //check for other secupay payment module\n $qry = xtc_db_query(\"SELECT * FROM \" . TABLE_CONFIGURATION . \" WHERE configuration_key LIKE 'MODULE_PAYMENT_SP%_SORT_ORDER';\");\n\n if (xtc_db_num_rows($qry) == 0) {\n //no other secupay payment module installed, remove apikey\n secupay_log($this->sp_log, \"remove apikey\");\n xtc_db_query(\"DELETE FROM \" . TABLE_CONFIGURATION . \" WHERE configuration_key = 'MODULE_PAYMENT_SECUPAY_APIKEY'\");\n xtc_db_query(\"DELETE FROM \" . TABLE_CONFIGURATION . \" WHERE configuration_key = 'MODULE_PAYMENT_SECUPAY_TAUTOSEND'\");\n xtc_db_query(\"DELETE FROM \" . TABLE_CONFIGURATION . \" WHERE configuration_key = 'MODULE_PAYMENT_SECUPAY_EXPERIENCE'\");\n xtc_db_query(\"DELETE FROM \" . TABLE_CONFIGURATION . \" WHERE configuration_key = 'MODULE_PAYMENT_SECUPAY_ORDER_BEFORE_PAYMENT'\");\n xtc_db_query(\"DELETE FROM \" . TABLE_CONFIGURATION . \" WHERE configuration_key = 'MODULE_PAYMENT_SECUPAY_SESSION'\");\n }\n }",
"public function deleteMiner();",
"public function testDeletePackingPlanFile()\n {\n }",
"public function testDeletePackingPlan()\n {\n }",
"public function testDeleteAppPackage()\n {\n\n }",
"function drush_btranslator_btr_project_delete() {\n $origin = drush_get_option('origin');\n $project = drush_get_option('project');\n _btranslator_drush_check_params($origin, $project);\n\n $erase = drush_get_option('erase');\n $erase = ($erase == 'false' ? FALSE : TRUE);\n\n $purge = drush_get_option('purge');\n $purge = ($purge == 'false' ? FALSE : TRUE);\n\n btr::project_del($origin, $project, $erase, $purge);\n}",
"function remove() {\n\n global $db;\n\n $db->Execute(\"delete from \" . TABLE_CONFIGURATION . \" where configuration_key LIKE 'MODULE\\_PAYMENT\\_CCBILL\\_%'\");\n\n $tcSql = 'drop table if exists ccbill';\n\n $db->Execute($tcSql);\n\n $tcSql = 'ALTER TABLE orders DROP COLUMN ccbill_id';\n\n $db->Execute($tcSql);\n\n $this->notify('NOTIFY_PAYMENT_CCBILL_UNINSTALLED');\n\n //$messsageStack->add_session('CCBill payment module successfully removed.', 'error');\n //zen_redirect(zen_href_link(FILENAME_MODULES, 'set=payment', 'NONSSL'));\n\n }",
"public function delete() {\n\t\t$removemod = rex_sql::factory();\n\t\t$removemod->setTable(\\rex::getTablePrefix() . 'module');\n\t\t$removemod->setWhere(['id' => $this->d2u_module_id]);\n\t\t$removemod->delete();\n\n\t\t// remove addon config\n\t\tif($this->rex_addon->hasConfig(\"module_\". $this->d2u_module_id)) {\n\t\t\t$this->rex_addon->removeConfig(\"module_\". $this->d2u_module_id);\n\t\t}\n\n\t\t// uninstall action\n\t\tif(file_exists($this->module_folder .\"uninstall.php\")) {\n\t\t\tinclude $this->module_folder .\"uninstall.php\";\n\t\t}\n\t}",
"static public function ctrBorrarPropietario(){\n\t\tif (isset($_POST['idPropietario'])) {\n\t\t\tif ($_POST['fotoPropietario'] != \"\") {\n\t\t\t\tunlink($_POST[\"fotoPropietario\"]);\n\t\t\t\trmdir('Views/img/propietarios/'.$_POST['propietario']);\n\t\t\t}\n\t\t$answer=adminph\\Propietary::find($_POST['idPropietario']);\n\t\t$answer->delete();\n\t\t}\n\t}",
"function uninstall()\n {\n $query = new DB_Table_Delete(Payment_Module_Gc::getTables());\n global $application;\n $application->db->getDB_Result($query);\n }",
"public function testDeletePackage() {\n $this->objFromFixture('Member', 'apiuser')->login();\n \n \n //Test deleting a package with a user with api access\n $response=$this->getAMFResponse('Snippets.deletePackage', array(\n 'id'=>$this->objFromFixture('SnippetPackage', 'package1')->ID\n ));\n \n \n //Validate the response\n $this->assertEquals('HELO', $response['status'], 'Response status should have been HELO');\n }",
"public function delete() {\n $proxy = $this->steam_object->get_attribute(\"UNIT_POINTLIST_PROXY\");\n if (is_object($proxy)) $proxy->delete();\n $tg = $this->steam_object->get_attribute(\"UNIT_POINTLIST_TUTORIALGROUP\");\n if (is_object($tg)) $tg->set_attribute(\"UNIT_POINTLIST\", 0);\n \t\t$this->steam_object->delete();\n }",
"function delete_package_item($item_kit_id)\n {\n return $this->db->delete('item_kits_tours', array('item_kit_id' => $item_kit_id)); \n }",
"function pkg_delete($pkg_name) {\n\tglobal $g;\n\n\t$shortname = $pkg_name;\n\tpkg_remove_prefix($shortname);\n\n\tpkg_debug(\"Removing package {$shortname}\\n\");\n\tif (is_pkg_installed($pkg_name)) {\n\t\tpkg_call(\"delete -y \" . $pkg_name);\n\t\t/* Cleanup unnecessary dependencies */\n\t\tpkg_call(\"autoremove -y\");\n\t}\n}",
"function delStichRate($rid)\r\n\t{\r\n\t\t\r\n\t\t//delete from product\r\n\t\t$delete1 = \"DELETE FROM stich_rate WHERE rate_id='$rid'\";\r\n\t\t\r\n\t\t//execute quary\r\n\t\t$query1\t= mysql_query($delete1);\r\n\t\t\r\n\t}",
"function deletePaperTree() {\n\t\tparent::rmtree($this->filesDir);\n\t}",
"public function uninstall()\n {\n// $code_dir = Mage::getBaseDir('app') . '/code/local/Bintime/Icecatimport';\n $design_layout = Mage::getBaseDir('app') . '/design/frontend/base/default/layout/IcecatGroupAttributes.xml';\n $template_dir = Mage::getBaseDir('app') . '/design/frontend/base/default/template/icecatlive';\n// $etc_bintime_xml = Mage::getBaseDir('app') . '/etc/modules/Bintime_Icecatimport.xml';\n $package_bintime_xml = Mage::getBaseDir('var') . '/package/IcecatLive-1.5.0.xml';\n $cache_iceshop_dir = Mage::getBaseDir('var') . '/iceshop';\n\n $this->remove_dir($cache_iceshop_dir);\n// $this->remove_dir($code_dir);\n $this->remove_dir($template_dir);\n $this->remove_file($design_layout);\n// $this->remove_file($etc_bintime_xml);\n $this->remove_file($package_bintime_xml);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Page Count: PDF using FPDF and FPDI | public function PageCount_PDF()
{
//absolute path for file
$path = getcwd();
$f = $path . "/" . $this->file;
$pageCount = 0;
if (file_exists($f)) {
require_once('lib/fpdf/fpdf.php');
require_once('lib/fpdi/fpdi.php');
$pdf = new FPDI();
$pageCount = $pdf->setSourceFile($f); // returns page count
}
return $pageCount;
} | [
"function numeroPaginasPdf($archivoPDF)\n{\n $stream = fopen($archivoPDF, \"r\");\n $content = fread ($stream, filesize($archivoPDF));\n \n if(!$stream || !$content)\n return 0;\n \n $count = 0;\n \n $regex = \"/\\/Count\\s+(\\d+)/\";\n $regex2 = \"/\\/Page\\W*(\\d+)/\";\n $regex3 = \"/\\/N\\s+(\\d+)/\";\n \n if(preg_match_all($regex, $content, $matches))\n $count = max($matches);\n \n return $count[0];\n}",
"public function GetPageCount()\r\n {\r\n\t\t\t //build URI\r\n\t\t\t$strURI = Product::$BaseProductUri . \"/pdf/\" . $this->FileName . \"/pages\";\r\n \r\n\t\t\t//sign URI\r\n\t\t\t$signedURI = Utils::Sign($strURI);\r\n \r\n\t\t\t//get response stream\r\n\t\t\t$responseStream = Utils::ProcessCommand($signedURI, \"GET\", \"\");\t\t\r\n\t\t\t\r\n\t\t\t$json = json_decode($responseStream);\r\n\t\t\t \r\n\t\t\t return count($json->Pages->List); \r\n }",
"public function countPages(): int;",
"public function getNumberOfPages();",
"function countPages($file_path) {\r\n $pdftext = file_get_contents($file_path);\r\n $num = preg_match_all(\"/\\/Page\\W/\", $pdftext, $dummy);\r\n return $num;\r\n }",
"function get_page_count($resource,$alternative=-1)\n {\n # also handle alternative file multipage previews by switching $resource array if necessary\n # $alternative specifies an actual alternative file\n $ref=$resource['ref'];\n if ($alternative!=-1)\n {\n $pagecount=sql_value(\"select page_count value from resource_alt_files where ref=$alternative\",\"\");\n $resource=get_alternative_file($ref,$alternative);\n }\n else\n {\n $pagecount=sql_value(\"select page_count value from resource_dimensions where resource=$ref\",\"\");\n }\n if (!empty($pagecount)) { return $pagecount; }\n # or, populate this column with exiftool or image magick (for installations with many pdfs already\n\t# previewed and indexed, this allows pagecount updates on the fly when needed):\n # use exiftool. \n\tif ($resource['file_extension']==\"pdf\" && $alternative==-1)\n\t\t{\n\t\t$file=get_resource_path($ref,true,\"\",false,\"pdf\");\n\t\t}\n\telse if ($alternative==-1)\n\t\t{\n\t\t# some unoconv files are not pdfs but this needs to use the auto-alt file\n\t\t$alt_ref=sql_value(\"select ref value from resource_alt_files where resource=$ref and unoconv=1\",\"\");\n\t\t$file=get_resource_path($ref,true,\"\",false,\"pdf\",-1,1,false,\"\",$alt_ref);\n\t\t}\n\telse\n\t\t{\n\t\t$file=get_resource_path($ref,true,\"\",false,\"pdf\",-1,1,false,\"\",$alternative);\n\t\t}\n\n\t# locate exiftool\n $exiftool_fullpath = get_utility_path(\"exiftool\");\n if ($exiftool_fullpath==false)\n\t\t{\n\t\t# Try with ImageMagick instead\n\t\t$command = get_utility_path(\"im-identify\") . ' -format %n ' . $file;\n\t\t$pages = trim(run_command($command));\n\t\t}\n else\n {\n $command = $exiftool_fullpath;\n \t\n $command=$command.\" -sss -pagecount $file\";\n $output=run_command($command);\n $pages=str_replace(\"Page Count\",\"\",$output);\n $pages=str_replace(\":\",\"\",$pages);\n $pages=trim($pages);\n\t\t}\n\n\tif (!is_numeric($pages)){ $pages = 1; } // default to 1 page if we didn't get anything back\n\n\tif ($alternative!=-1)\n\t\t{\n\t\tsql_query(\"update resource_alt_files set page_count='$pages' where ref=$alternative\");\n\t\t}\n\telse\n\t\t{\n\t\tsql_query(\"update resource_dimensions set page_count='$pages' where resource=$ref\");\n\t\t}\n\treturn $pages;\n\t}",
"function getPageCount(){\n return $this -> ppt -> getSlideCount();\n }",
"public function getTotalPages(): int;",
"public function getPdfPageCount($path)\n {\n if (isset($this->pdfPages[$path])) {\n return $this->pdfPages[$path];\n }\n \n $im = new \\Imagick();\n $im->setresolution(3, 3);\n if (! $im->readimage($path)) {\n throw new NotFoundHttpException('PDF does not exist.');\n }\n $this->pdfPages[$path] = $im->getNumberImages();\n return $this->pdfPages[$path];\n }",
"function pageCount()\r\n {\r\n return 1;\r\n }",
"public function Total_pages();",
"public function countPages()\n {\n return (int) static::getResponse()->getHeaders()[self::$headers['header_total_pages']];\n }",
"public function PageCount_DOCX()\n {\n $pageCount = 0;\n\n $zip = new ZipArchive();\n\n $path = getcwd();\n $f = $path . \"/\" . $this->file;\n\n if ($zip->open($f) === true) {\n if (($index = $zip->locateName('docProps/app.xml')) !== false) {\n $data = $zip->getFromIndex($index);\n $zip->close();\n $xml = new SimpleXMLElement($data);\n $pageCount = $xml->Pages;\n }\n }\n\n return intval($pageCount);\n }",
"public function countPages($path)\n {\n $pdftext = file_get_contents($path);\n $num = preg_match_all(\"/\\/Page\\W/\", $pdftext, $dummy);\n return $num;\n }",
"public function getPageNumberByPageObject(\\SetaPDF_Core_Document_Page $page) {}",
"public function getFragmentCount($pageNumber)\n {\n\n\n $strURI = Product::$baseProductUri . '/pdf/' . $this->getFileName() . '/pages/' . $pageNumber . '/fragments';\n\n $signedURI = Utils::sign($strURI);\n\n $responseStream = Utils::processCommand($signedURI, 'GET', '', '');\n\n $json = json_decode($responseStream);\n\n return count($json->TextItems->List);\n }",
"public function numberOfSoftKeyPages();",
"public function testEditPdfGetPdfTextByPages()\n {\n }",
"public function totalElementsOnCurrentPage() : int;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests if JwtUserProvider::loadUserByJWT returns the expected User instance created with information from the decoded JSON Web Token. | public function testLoadUserByJWT()
{
$jwt = new stdClass();
$jwt->sub = 'username';
$jwt->token = 'validToken';
$expectedUser = new User('username', 'validToken', ['ROLE_JWT_AUTHENTICATED']);
$this->assertEquals(
$expectedUser,
$this->userProvider->loadUserByJWT($jwt)
);
} | [
"public function testLoadUserByJWTWithoutTokenProperty()\n {\n $jwt = new stdClass();\n $jwt->sub = 'username';\n\n $expectedUser = new User('username', null, ['ROLE_JWT_AUTHENTICATED']);\n\n $this->assertEquals(\n $expectedUser,\n $this->userProvider->loadUserByJWT($jwt)\n );\n }",
"public function testLoadUserByJWTWithScopeProperty()\n {\n $jwt = new stdClass();\n $jwt->sub = 'username';\n $jwt->scope = 'read:messages write:messages';\n $jwt->token = 'validToken';\n\n $expectedUser = new User(\n 'username',\n 'validToken',\n ['ROLE_JWT_AUTHENTICATED', 'ROLE_JWT_SCOPE_READ_MESSAGES', 'ROLE_JWT_SCOPE_WRITE_MESSAGES']\n );\n\n $this->assertEquals(\n $expectedUser,\n $this->userProvider->loadUserByJWT($jwt)\n );\n }",
"private function decode($jwt)\n {\n $publicKey = file_get_contents(storage_path('oauth-public.key'));\n\n try {\n $res = JWT::decode($jwt, $publicKey, array('RS256'));\n return $this->user = new GenericUser(json_decode(json_encode($res->user), true));\n } catch (\\Exception $e) {\n return null;\n }\n }",
"public function testValidToken()\n {\n $user = new User();\n $this->jwsService->shouldReceive('isValid')->with('token')->andReturn(true);\n $this->jwsService->shouldReceive('getUser')->with('token')->andReturn($user);\n $userFound = $this->tokenProvider->loadUserByUsername('token');\n\n Assert::assertEquals($user, $userFound);\n }",
"function getAlmaUser(object $jwt_payload): User\n{\n $alma = new AlmaClient(ALMA_API_KEY, ALMA_REGION);\n $user_id = $jwt_payload->userName;\n $user = $alma->users->get($user_id);\n return $user;\n}",
"public function get_user() {\n try {\n $user = JWTAuth::parseToken()->toUser();\n $user = UserRepository::get_single_user($user->id);\n $response = [\n 'status' => false\n ];\n if (isset($user) && !empty($user) > 0) {\n $response['status'] = TRUE;\n $response['user'] = $user;\n return response()->json($response, 201);\n } else {\n $response['user'] = [];\n return response()->json($response, 201);\n }\n } catch (\\Exception $e) {\n $response['status'] = FALSE;\n $response['errors'] = TRUE;\n $response['message'] = $e->getMessage();\n return response()->json($response, 500);\n }\n }",
"function validateJWT($jwt)\r\n {\r\n if ($decoded = JWT::decode($jwt, \"63-trUY^f4ER\", array('HS256'))) {\r\n return $decoded->data->username;\r\n } else return null;\r\n }",
"protected function getJWT()\n {\n if ($user = $this->auth->check()) {\n return \\JWTAuth::fromUser($user);\n }\n }",
"protected function registerJwtAuth()\n {\n Auth::viaRequest('jwt-auth', function ($request) {\n\n // Get token from header or url query\n $token = $request->bearerToken() ?: $request->input('token');\n $secret = config('jwt.secret_key');\n \n // Unauthorized request\n if (empty($token)) { return null; }\n\n // Decode token\n try {\n JWT::$leeway = 60;\n $credentials = JWT::decode($token, $secret, ['HS256']);\n }\n catch(ExpiredException $e) { return null; }\n catch(Exception $e) { return null; }\n\n // Return user instance\n return User::findOrFail($credentials->sub);\n });\n }",
"public function testAuthenticatedUserIsReturned()\n {\n $response = $this->actingAs( $this->adminUser, 'api' )\n ->get( 'api/me' );\n\n $response->assertStatus( 200 )\n ->assertExactJson([\n 'id' => $this->adminUser->id,\n 'name' => $this->adminUser->name,\n 'email_address' => $this->adminUser->email\n ]);\n }",
"public function testTokenWithNoUserIdInPayload()\n {\n $this->expectException(UsernameNotFoundException::class);\n $this->jwsService->shouldReceive('isValid')->with('token')->andReturn(true);\n $this->jwsService->shouldReceive('getPayload')->with('token')->andReturn(['id' => 33]);\n\n $this->tokenProvider->loadUserByUsername('token');\n }",
"public static function user() {\n $token = json_decode(session('decodedToken'));\n return $token->user;\n }",
"public function findUserWithAccessToken($jwt)\n {\n $accessToken = $this->jwt->parse($jwt)->getClaim('jti');\n\n return $this->tokens->find($accessToken)->user()->first();\n }",
"public function test_it_can_get_user()\n {\n $user = factory(\\App\\User::class)->create();\n Passport::actingAs($user);\n\n $this->json('GET', '/api/user')\n ->assertStatus(200)\n ->assertJsonStructure($this->json_structure_user())\n ->assertJson([\n 'id' => $user->id,\n 'name' => $user->name,\n 'email' => $user->email,\n ]);\n }",
"public function getTokenUser()\n {\n // Fetch token\n $tokenStr = $this->tokenFetcher->fetchToken();\n // Get user from token\n $user = $this->tokenRepo->getUser($tokenStr);\n\n return $user;\n }",
"protected function createApiUser()\n {\n if (null !== static::$userId) {\n return;\n }\n\n $response = $this->getDataProvider()->client->request(\n 'GET', $this->apiUserEndpoint, [\n 'cookies' => $jar = new CookieJar,\n ]\n );\n\n foreach ($jar->toArray() as $cookie) {\n static::$cookies[$cookie['Name']] = $cookie['Value'];\n }\n\n $user = json_decode($response->getBody()->getContents());\n\n if (!$user) {\n return;\n }\n\n static::$userId = $user->userIdentifier;\n static::$CSRFToken = $response->getHeader('X-CSRF-TOKEN');\n }",
"private function getUser()\n {\n if (null !== request()->bearerToken()) {\n $clientId = (new Parser())->parse(request()->bearerToken())->getClaim('aud');\n $client = $this->clientRepository->find($clientId);\n\n return $this->userService->repository->find((int) $client->user_id);\n }\n\n return null;\n }",
"private function getUserInfo(){\n $authenticationHeader = $this->request->getServer('HTTP_AUTHORIZATION');\n helper('jwt');\n $encodedToken = getJWTFromRequest($authenticationHeader);\n $key = Services::getSecretKey();\n $decodedToken = JWT::decode($encodedToken, $key, ['HS256']);\n return $this->service->findUserByEmailAddress($decodedToken->email);\n }",
"private function findUserByToken()\n {\n if(class_exists($this->token_location)) {\n // Got class\n $token_class = $this->token_location::where('token', $this->getToken())\n ->where('expiration', '>=', Carbon::now()->toDateTimeString())\n ->where('type', 'api')\n ->first();\n\n if(is_object($token_class)) {\n return $this->user_class::find($token_class->user_id);\n }\n\n return false;\n }\n\n // Got field\n try {\n return $this->user_class::where($this->token_location, $this->token)->first();\n } catch(QueryException $e) {\n return false;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns an array of all related objects that need to be persisted after clone. | public function getRelatedObjectsToPersist(&$objects = [])
{
return [];
} | [
"protected function collectRelatedToSave(): array\n {\n }",
"public function getRelatedObjectsToPersist(&$objects = array()) {\n return array();\n }",
"public function getRelatedObjectsToPersist(&$objects = [])\n {\n return [];\n }",
"public function getRelatedObjectsToPersist(array &$objects = []): array\n {\n return [];\n }",
"public function getReverseRelatedObjects();",
"public function relatedModels(): array\n {\n return $this->relatedModels;\n }",
"public function getRelatedObjects()\n {\n return isset($this->RelatedObjects) ? $this->RelatedObjects : null;\n }",
"public final function getRelatedModels()\n {\n return $this->metadata->get_related_models($this->my_class);\n }",
"public function eagerLoadableRelations(): array;",
"protected function _loadRelatedData()\n {\n return array();\n }",
"public function relationsToArray()\n {\n if (in_array($this, static::$recursiveRelations)) {\n return [];\n }\n\n static::$recursiveRelations[] = $this;\n\n $relations = parent::relationsToArray();\n $meta = static::getMeta();\n\n foreach ($relations as $key => $value) {\n if ($meta->hasField($key, RelationField::class)) {\n $relations[$key] = static::getMeta()->getField($key, RelationField::class)->serialize($value);\n }\n }\n\n unset(static::$recursiveRelations[array_search($this, static::$recursiveRelations)]);\n\n return $relations;\n }",
"function getFullRelatedModels(){\n\t\t//if we've already called this function and assigned the classes in the relatedModels array, just use it\n\t\t$firstRelatedModel = reset($this->relatedModels);\n\t\tif(array_key_exists('class',$firstRelatedModel)){\n\t\t\treturn $this->relatedModels;\n\t\t}\n\t\t$relatedModels=array();\n\t\tforeach($this->relatedModels as $modelName=>$relatedModel){\n\t\t\t$relatedModels[$modelName]['modelName']=$modelName;\n\t\t\t$relatedModels[$modelName]['modelNamePlural']=$relatedModel['modelNamePlural'];\n\t\t\t$relatedModels[$modelName]['hasMany']=$relatedModel['hasMany'];\n\t\t\t$relatedModels[$modelName]['class']=EspressoAPI_ClassLoader::load($relatedModel['modelNamePlural'],'Resource');\n\t\t}\n\t\t$this->relatedModels=$relatedModels;\n\t\treturn $relatedModels;\n\t}",
"public function getReferencedObjects() : array\n {\n return $this->referencedObjects;\n }",
"public function getRelatedEntities()\n {\n return $this->relatedEntities;\n }",
"public function flushRelations()\n {\n return [\n 'tags',\n 'favorites',\n 'calendarUsers'\n ];\n }",
"protected function getRelationsToProxy()\n {\n $proxies = [];\n $attributes = $this->getEntityAttributes();\n\n foreach ($this->entityMap->getNonEmbeddedRelationships() as $relation) {\n //foreach ($this->entityMap->getRelationships() as $relation) {\n\n if (!array_key_exists($relation, $attributes) || is_null($attributes[$relation])) {\n $proxies[] = $relation;\n }\n }\n\n return $proxies;\n }",
"public function getRelatedJoryResources(): array\n {\n if (! $this->relatedJoryResources) {\n $this->relatedJoryResources = [];\n\n foreach ($this->jory->getRelations() as $relation) {\n $relatedJoryResource = $this->getConfig()->getRelation($relation)->getJoryResource()->fresh();\n\n $relatedJoryResource->setJory($relation->getJory());\n\n $this->relatedJoryResources[$relation->getName()] = $relatedJoryResource;\n }\n }\n\n return $this->relatedJoryResources;\n }",
"public function managedObjects() {\n\t\t\treturn $this->managedObjects->allKeys();\n\t\t}",
"public function getPersisted(): array\n {\n return $this->persistedEntities;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the contentTypesEnabled property value. If true, indicates that content types are enabled for this list. | public function getContentTypesEnabled(): ?bool {
$val = $this->getBackingStore()->get('contentTypesEnabled');
if (is_null($val) || is_bool($val)) {
return $val;
}
throw new \UnexpectedValueException("Invalid type found in backing store for 'contentTypesEnabled'");
} | [
"public function setContentTypesEnabled($val)\n {\n $this->_propDict[\"contentTypesEnabled\"] = $val;\n return $this;\n }",
"private function getAllowedContenttypes()\n {\n\n // App\n $app = $this->getContainer();\n\n // Get configs\n $all_contenttypes = $app['config']->get('contenttypes');\n $config_contenttypes = $this->getConfigValue('contenttypes');\n\n // Use all contenttypes\n $allowed_contenttypes = $all_contenttypes;\n\n if (!empty($config_contenttypes)) {\n // If config has been defined, remove any that are not included\n foreach ($all_contenttypes as $key => $type) {\n if (!in_array($key, $config_contenttypes)) {\n unset($allowed_contenttypes[$key]);\n }\n }\n }\n\n $this->allowed_contenttypes = $allowed_contenttypes;\n\n return $this->allowed_contenttypes;\n }",
"public static function getContentTypes()\n {\n return self::$_contentTypes;\n }",
"public function getContentTypes(): array\n {\n return $this->contentTypes;\n }",
"public function get_content_types() {\n\n \t$content_types = array();\n\n \treturn apply_filters( 'blox_content_type', $content_types );\n }",
"function &ListContentTypes()\n\t{\n\t\tglobal $gCms;\n\t\t$contenttypes =& $gCms->contenttypes;\n\t\t\n\t\tif (isset($gCms->variables['contenttypes']))\n\t\t{\n\t\t\t$variables =& $gCms->variables;\n\t\t\treturn $variables['contenttypes'];\n\t\t}\n\t\t\n\t\t$result = array();\n\t\t\n\t\treset($contenttypes);\n\t\twhile (list($key) = each($contenttypes))\n\t\t{\n\t\t\t$value =& $contenttypes[$key];\n\t\t\t$result[] = $value->type;\n\t\t}\n\t\t\n\t\t$variables =& $gCms->variables;\n\t\t$variables['contenttypes'] =& $result;\n\n\t\treturn $result;\n\t}",
"function user_roles_content_permissions_enabled() {\n\n\treturn apply_filters( 'user_roles_content_permissions_enabled', user_roles_get_setting( 'content_permissions' ) );\n}",
"public function getContentTypePermissions()\n {\n return $this->contentTypePermissions;\n }",
"public function setContentTypesEnabled(?bool $value): void {\n $this->getBackingStore()->set('contentTypesEnabled', $value);\n }",
"public function getContentViewsEnabled()\n {\n return $this->content_views_enabled;\n }",
"public function get_allowed_content_object_types()\n {\n return $this->getParentApplication()->get_allowed_content_object_types();\n }",
"public function getContentTypes(): array;",
"public function isPermittedContentType()\n {\n $content_type = $this->getResponseContenType();\n\n if ($content_type) {\n $permitted_types = array_keys($this->permitted_content_types);\n return in_array($content_type, $permitted_types);\n }\n\n return false;\n }",
"function contentTypes()\n {\n return new ContentTypes($this->accessToken, $this->spaceId, $this->cacher);\n }",
"public function pluralContentTypes()\n {\n return $this->configAssert('contenttypes', false);\n }",
"function getContentType()\n {\n $formatExtension = $this->getFormatExtension();\n\n return isset($this->environment->contentTypes[$formatExtension])\n ? $this->environment->contentTypes[$formatExtension]\n : false;\n }",
"public function getContentStreamAllowed()\n {\n $def = eZCMISTypeHandler::getTypeDefinition( $this->getObjectTypeId() );\n\n return isset( $def[0]['contentStreamAllowed'] ) ? $def[0]['contentStreamAllowed'] : '';\n }",
"public function getEnabledContentExperiences()\n {\n if (array_key_exists(\"enabledContentExperiences\", $this->_propDict)) {\n if (is_a($this->_propDict[\"enabledContentExperiences\"], \"\\Beta\\Microsoft\\Graph\\ExternalConnectors\\Model\\ContentExperienceType\") || is_null($this->_propDict[\"enabledContentExperiences\"])) {\n return $this->_propDict[\"enabledContentExperiences\"];\n } else {\n $this->_propDict[\"enabledContentExperiences\"] = new ContentExperienceType($this->_propDict[\"enabledContentExperiences\"]);\n return $this->_propDict[\"enabledContentExperiences\"];\n }\n }\n return null;\n }",
"public function is_enabled_content() {\n\n\t\treturn (bool) Options::init()->get( 'logs', 'log_email_content' );\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generates the response for successful LOCK requests. | protected function generateLockResponse(LockInfo $lockInfo) {
$contextUri = $this->server->getBaseUri();
return $this->server->xml->write('{DAV:}prop', [
'{DAV:}lockdiscovery' => new LockDiscovery([$lockInfo]),
], $contextUri);
} | [
"public function locked(): Response\n {\n $company = InstanceHelper::getLoggedCompany();\n $employees = $company->employees()\n ->where('locked', true)\n ->orderBy('last_name', 'asc')\n ->get();\n\n return Inertia::render('Adminland/Employee/IndexLocked', [\n 'notifications' => NotificationHelper::getNotifications(InstanceHelper::getLoggedEmployee()),\n 'employees' => AdminEmployeeViewHelper::all($employees, $company),\n ]);\n }",
"public function unlockAction()\n {\n /* Disable view renderer and layout. */\n $this->_helper->viewRenderer->setNoRender();\n $this->_helper->layout()->disableLayout();\n\n $params = $this->_request->getParams();\n\n $client = Sahara_Soap::getSchedServerPermissionsClient();\n $response = $client->unlockUserLock( array(\n 'userID' => array('userQName' => $this->_auth->getIdentity()),\n 'permissionID' => array('permissionID' => $params['permission']),\n 'lockKey' => $params['passkey']\n ));\n\n echo $this->view->json(array('successful' => $response->successful));\n }",
"private function send_lock_cmd($cmd) {\r\n\t\tglobal $DB, $_INPUT;\r\n\r\n\t\tif ( $cmd == 'LOCK' || $cmd == 'UNLOCK' ) {\r\n\t\t\t$cmdcombo = $cmd.','.STATICSERVERIDENTIFIER.','.trim($_INPUT['role']);\r\n\t\t} else {\r\n\t\t\t$cmdcombo = $cmd;\r\n\t\t}\r\n//\t\t$n = $this->socket_request($cmd, '123.59.81.183', 9999);\r\n\t\t$nresp = $this->socket_request($cmdcombo);\r\n//\t\t$this->debugInfo .= \"Raw response: \".$nresp;\r\n/*\r\n\t\tif ( strpos($nresp,',') === FALSE ) {\r\n\t\t\t$n = $nresp;\r\n\t\t\t$R = '';\r\n\t\t} else {\r\n\t\t\t$nresp = explode(',', $nresp);\r\n\t\t\t$n = $nresp[0];\r\n\t\t\t$R = $nresp[1];\r\n\t\t}\r\n*/\r\n\t\t// Random N is not 27 digits long\r\n\t\tif ( strlen($nresp) != 27 )\r\n\t\t\t$this->show_error(300, 'N='.$nresp);\r\n\t\t\r\n\t\t// Lock role undefined\r\n\t\t/*\r\n\t\tif ( ($cmd == 'LOCK' || $cmd == 'UNLOCK') && !$R )\r\n\t\t\t$this->show_error(305);\r\n\t\t*/\r\n\t\t\r\n\t\tif ( $cmd == 'LOCK' || $cmd == 'UNLOCK' )\r\n\t\t\t$hashtext = $nresp.trim($_INPUT['role']).STATICSERVERIDENTIFIER.$cmd;\r\n\t\telse\r\n\t\t\t$hashtext = $nresp;\r\n\t\t$hashtext = strtoupper($hashtext);\r\n\t\t$hash = $this->generate_key_hash($hashtext);\r\n\r\n\t\t$res = $this->socket_request($hash);\r\n\t\t// Wrong hash\r\n\t\tif ( $res == 'X' )\r\n\t\t\t$this->show_error(301);\r\n\t\t// \r\n\t\tif ( $res == 'Z' )\r\n\t\t\t$this->show_error(400);\r\n\r\n\t\t$DB->query_unbuffered(\"UPDATE \".TABLE_PREFIX.\"room SET lockState = \".($res=='Y'?1:0).\" WHERE roomNum = \".$this->roomData['roomNum']);\r\n\r\n\t\t$respond = trim($_INPUT['action']).'|'.$res;\r\n\t\t\r\n\t\tif ( $this->debugMode && $this->debugInfo )\r\n\t\t\t$respond .= \"\\n\".$this->debugInfo;\r\n\r\n\t\techo $respond;\r\n\t}",
"public function testLockedResult()\n\t{\n\t\t$client = $this->getMockClient(OLP_ECashClient_Authentication::STATUS_LOCKED);\n\t\t\n\t\t$this->assertFalse($client->validate(1, '5555555555', '12/31/1969'));\n\t\t$this->assertTrue($client->isLocked(1));\n\t}",
"public function lockSuccessful()\n\t{\n\t\treturn true;\n\t}",
"public function getUserLockAction()\n {\n $this->authorize();\n\n $datas = UserSerialization::serializeUserFullLesss($this->getUser()->getLocks());\n\n return $this->view(array('locked' => $datas), Codes::HTTP_OK);\n }",
"protected function sendLockoutResponse()\n {\n $seconds = $this->secondsRemainingOnLockout();\n return redirect('/cabinet/otp')->withErrors($this->getLockoutErrorMessage($seconds));\n }",
"public function testRespondsToLock()\n {\n $this->scenario->given(function () {\n $this->scenario->serverLastSent(['ver'=>'1', 'nut'=>'newNut', 'tif'=>'5', 'qry'=>'sqrl?nut=newNut']);\n $this->scenario->serverKnowsKey('validIdentityKey', SqrlStoreInterface::IDENTITY_ACTIVE);\n $this->scenario->serverKnowsNut('newNut', SqrlValidateInterface::VALID_NUT, 'validIdentityKey');\n $this->scenario->nutConnectedToIp('192.168.0.5');\n })->when(function () {\n $this->scenario->clientSendsNut('newNut');\n $this->scenario->clientSendsOriginalServer();\n $this->scenario->clientSendsRequest(['ver'=>'1', 'cmd'=>'lock', 'idk'=>'validIdentityKey']);\n $this->scenario->clientSendsSignature('validIdentityKey', 'valid signature', true);\n $this->scenario->clientRequestsFromIp('192.168.0.5');\n $this->scenario->clientRequestIsSecure();\n })->then(function () {\n $this->scenario->expectTif(0xD);\n $this->scenario->expectNewNut('newerNut');\n $this->scenario->expectServerParamValid();\n $this->scenario->expectLock('validIdentityKey');\n $this->scenario->expectLogout('newNut');\n $this->scenario->checkResponse();\n });\n }",
"function lock() {\n if (!$this->active_object->can_have_comments) {\n $this->httpError(HTTP_ERR_NOT_FOUND, null, true, $this->request->isApiCall());\n } // if\n \n if (!$this->active_object->canChangeLockedState($this->logged_user)) {\n $this->httpError(HTTP_ERR_FORBIDDEN, null, true, $this->request->isApiCall());\n } // if\n \n $this->executeOnActiveObject('lock', array($this->logged_user), \n lang(':type \":name\" has been locked', array('type' => $this->active_object->getVerboseType(), 'name' => $this->active_object->getName())), \n lang('Failed to lock :type \":name\"', array('type' => $this->active_object->getVerboseType(true), 'name' => $this->active_object->getName()))\n );\n }",
"public function executeLockLicense(sfWebRequest $request) {\n\n try {\n $empNumber = $request->getParameter('empNumber', false);\n $seqNo = $request->getParameter('seqNo', false);\n\n $conHandler = new ConcurrencyHandler();\n $recordLocked = $conHandler->setTableLock('hs_hr_emp_licenses', array($empNumber, $seqNo), 1);\n\n echo json_encode(array('recordLocked' => $recordLocked));\n die;\n } catch (Exception $e) {\n $errMsg = new CommonException($e->getMessage(), $e->getCode());\n $this->setMessage('WARNING', $errMsg->display());\n }\n }",
"function lockdiscovery($path)\n {\n // no lock support without checklock() method\n if (!method_exists($this, \"checklock\")) {\n return \"\";\n }\n\n // collect response here\n $activelocks = \"\";\n\n // get checklock() reply\n $lock = $this->checklock($path);\n\n // generate <activelock> block for returned data\n if (is_array($lock) && count($lock)) {\n // check for 'timeout' or 'expires'\n if (!empty($lock[\"expires\"])) {\n $timeout = \"Second-\".($lock[\"expires\"] - time());\n } else if (!empty($lock[\"timeout\"])) {\n $timeout = \"Second-$lock[timeout]\";\n } else {\n $timeout = \"Infinite\";\n }\n\n // genreate response block\n $activelocks.= \"\n <D:activelock>\n <D:lockscope><D:$lock[scope]/></D:lockscope>\n <D:locktype><D:$lock[type]/></D:locktype>\n <D:depth>$lock[depth]</D:depth>\n <D:owner>$lock[owner]</D:owner>\n <D:timeout>$timeout</D:timeout>\n <D:locktoken><D:href>$lock[token]</D:href></D:locktoken>\n </D:activelock>\n \";\n }\n\n // return generated response\n return $activelocks;\n }",
"public function generateSuccessResponse()\n {\n die($this->getSuccessResponse());\n }",
"public function doSync() {\n $securedRoot = FileSecured::getSecuredRoot();\n $message = SecuredFilesystem::sync_secured($securedRoot->ID);\n $this->response->addHeader('X-Status', rawurlencode($message));\n return;\n }",
"protected function httpLock($uri) {\n\n $lastLock = null;\n if (!$this->validateLock($uri,$lastLock)) {\n\n // If the existing lock was an exclusive lock, we need to fail\n if (!$lastLock || $lastLock->scope == LockInfo::EXCLUSIVE) {\n //var_dump($lastLock);\n throw new DAV\\Exception\\ConflictingLock($lastLock);\n }\n\n }\n\n if ($body = $this->server->httpRequest->getBody(true)) {\n // This is a new lock request\n $lockInfo = $this->parseLockRequest($body);\n $lockInfo->depth = $this->server->getHTTPDepth();\n $lockInfo->uri = $uri;\n if($lastLock && $lockInfo->scope != LockInfo::SHARED) throw new DAV\\Exception\\ConflictingLock($lastLock);\n\n } elseif ($lastLock) {\n\n // This must have been a lock refresh\n $lockInfo = $lastLock;\n\n // The resource could have been locked through another uri.\n if ($uri!=$lockInfo->uri) $uri = $lockInfo->uri;\n\n } else {\n\n // There was neither a lock refresh nor a new lock request\n throw new DAV\\Exception\\BadRequest('An xml body is required for lock requests');\n\n }\n\n if ($timeout = $this->getTimeoutHeader()) $lockInfo->timeout = $timeout;\n\n $newFile = false;\n\n // If we got this far.. we should go check if this node actually exists. If this is not the case, we need to create it first\n try {\n $this->server->tree->getNodeForPath($uri);\n\n // We need to call the beforeWriteContent event for RFC3744\n // Edit: looks like this is not used, and causing problems now.\n //\n // See Issue 222\n // $this->server->broadcastEvent('beforeWriteContent',array($uri));\n\n } catch (DAV\\Exception\\NotFound $e) {\n\n // It didn't, lets create it\n $this->server->createFile($uri,fopen('php://memory','r'));\n $newFile = true;\n\n }\n\n $this->lockNode($uri,$lockInfo);\n\n $this->server->httpResponse->setHeader('Content-Type','application/xml; charset=utf-8');\n $this->server->httpResponse->setHeader('Lock-Token','<opaquelocktoken:' . $lockInfo->token . '>');\n $this->server->httpResponse->sendStatus($newFile?201:200);\n $this->server->httpResponse->sendBody($this->generateLockResponse($lockInfo));\n\n }",
"public function local_lock(Request $request)\n {\n\n $locker = RHCourseLock::findMe();\n\n if (!empty($locker)) {\n $locker->delete();\n\n return json_encode(['button' => 'Lock']);\n\n } else {\n RHCourseLock::create([\n 'student' => session('student'),\n 'semester' => session('semester'),\n ]);\n\n return json_encode(['button' => 'Unlock']);\n }\n }",
"public function syncingLockAquire( $name = \"\" ){ if( $call = $this->APICall('0.9.1/', array( 'syncingLockAquire' => $name ) ) ){ return json_decode( $call, true ); }else{ commandResult( 500, \"Could not release the sync lock for \" . $name ); } }",
"protected function returnOkResponse()\n {\n ob_start();\n header('Connection: close');\n header('Content-Length: ' . ob_get_length());\n ob_end_flush();\n ob_flush();\n flush();\n }",
"protected function httpLock($uri) {\n \n \t$lastLock = null;\n \tif (!$this->validateLock($uri,$lastLock)) {\n \n \t\t// If the existing lock was an exclusive lock, we need to fail\n \t\tif (!$lastLock || $lastLock->scope == LockInfo::EXCLUSIVE) {\n \t\t\t//var_dump($lastLock);\n \t\t\tthrow new DAV\\Exception\\ConflictingLock($lastLock);\n \t\t}\n \n \t}\n \n \tif ($body = $this->body) {\n \t\t// This is a new lock request\n \t\t$lockInfo = $this->parseLockRequest($body);\n \t\t$lockInfo->depth = $this->server->getHTTPDepth();\n \t\t$lockInfo->uri = $uri;\n \t\tif($lastLock && $lockInfo->scope != LockInfo::SHARED) throw new DAV\\Exception\\ConflictingLock($lastLock);\n \n \t} elseif ($lastLock) {\n \n \t\t// This must have been a lock refresh\n \t\t$lockInfo = $lastLock;\n \n \t\t// The resource could have been locked through another uri.\n \t\tif ($uri!=$lockInfo->uri) $uri = $lockInfo->uri;\n \n \t} else {\n \n \t\t// There was neither a lock refresh nor a new lock request\n \t\tthrow new DAV\\Exception\\BadRequest('An xml body is required for lock requests');\n \n \t}\n \n \tif ($timeout = $this->getTimeoutHeader()) $lockInfo->timeout = $timeout;\n \n \t$newFile = false;\n \n \t// If we got this far.. we should go check if this node actually exists. If this is not the case, we need to create it first\n \ttry {\n \t\t$this->server->tree->getNodeForPath($uri);\n \n \t\t// We need to call the beforeWriteContent event for RFC3744\n \t\t// Edit: looks like this is not used, and causing problems now.\n \t\t//\n \t\t// See Issue 222\n \t\t// $this->server->broadcastEvent('beforeWriteContent',array($uri));\n \n \t} catch (DAV\\Exception\\NotFound $e) {\n \n \t\t// It didn't, lets create it\n \t\t$this->server->createFile($uri,fopen('php://memory','r'));\n \t\t$newFile = true;\n \n \t\t}\n \n \t\t$this->lockNode($uri,$lockInfo);\n \n \t\t$this->server->httpResponse->setHeader('Content-Type','application/xml; charset=utf-8');\n \t\t$this->server->httpResponse->setHeader('Lock-Token','<opaquelocktoken:' . $lockInfo->token . '>');\n \t\t$this->server->httpResponse->sendStatus($newFile?201:200);\n \t\t\t\t$this->server->httpResponse->sendBody($this->generateLockResponse($lockInfo));\n \n }",
"public function locked();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Replace placeholders for before rule. | protected function _replaceBefore($message, $input, $rule, $parameters)
{
return str_replace('(:date)', $parameters[0], $message);
} | [
"public function before($content){ $this->before=$content; return $this; }",
"public function setTemplateBefore($templateBefore) {}",
"function addBefore() {\n\n\t}",
"public function before(string $patternName): void;",
"protected function replaceStartsWith($message, $attribute, $rule, $parameters)\n {\n foreach ($parameters as &$parameter) {\n $parameter = $this->getDisplayableValue($attribute, $parameter);\n }\n\n return str_replace(':values', implode(', ', $parameters), $message);\n }",
"public function prepare()\n\t{\n\t\t/* are there tokens in the string that need replacement */\n\t\tif ($this->totalPlaceholders)\n\t\t{\n\t\t\t/**\n\t\t\t * Need to make sure that we have all of the replacement values needed\n\t\t\t * for the query. If we are missing tokens we will throw an exception.\n\t\t\t */\n\t\t\tpreg_match_all($this->getTokenRegex(), $this->sql, $_matches);\n\n\t\t\t/**\n\t\t\t * We may reuse the parameters in the query\n\t\t\t */\n\t\t\t$_uniqueQueryTokens = array_unique($_matches[0]);\n\n\t\t\t/**\n\t\t\t * Are we missing any\n\t\t\t */\n\t\t\tif (array_diff($_uniqueQueryTokens, array_keys($this->replacements)))\n\t\t\t{\n\t\t\t\tthrow new MissingParameterException('Expecting: ' . $_uniqueQueryTokens . 'tokens');\n\t\t\t}\n\n\t\t\t$_str = strtr($this->sql, $this->replacements);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$_str = $this->sql;\n\t\t}\n\n\t\treturn $_str;\n\t}",
"protected function replaceTranslationPlaceholders()\n {\n $locales = $this->getTranslationLocales();\n $placeholder = $this->getTranslatedRulePlaceHolder();\n $processed = [];\n\n // Detect and duplicate special rules for translated locales\n foreach ($this->rules as $key => $ruleSet) {\n\n if (false === strpos($key, $placeholder)) {\n $processed[ $key ] = $ruleSet;\n continue;\n }\n\n // Add the rule for each translatable locale separately\n foreach ($locales as $locale) {\n\n $localizedKey = str_replace($placeholder, $locale, $key);\n $localizedRule = $ruleSet;\n\n // Replace placeholders for rulesets, whether they formatted as string or array\n if (is_array($localizedRule)) {\n\n $localizedRule = array_map(\n function ($part) use ($placeholder, $locale) {\n return str_replace($placeholder, $locale, $part);\n },\n $localizedRule\n );\n\n } else {\n\n $localizedRule = str_replace($placeholder, $locale, $localizedRule);\n }\n\n $processed[ $localizedKey ] = $localizedRule;\n }\n }\n\n $this->rules = $processed;\n\n return $this;\n }",
"public function replaceInsertIntoPrefix($input);",
"public function testPrepend()\n {\n $value = Util::prepend('something', 'pre_');\n $this->assertEquals($value, 'pre_something');\n\n $value = Util::prepend('pre_something', 'pre_');\n $this->assertEquals($value, 'pre_something');\n\n $value = Util::prepend('somethingpre_.else', 'pre_');\n $this->assertEquals($value, 'pre_somethingpre_.else');\n }",
"public function setBeforeTitle($before_title)\n {\n $this->before_title = $before_title;\n\n return $this;\n }",
"public function addFieldBefore($fieldName,$safeName,$value,$location) {\n foreach($this->displaySource as $i => $row) {\n if(array_key_exists($location,$row)) {\n $tmp = array();\n preg_match_all('/{.*?}/',$value,$out);\n $nVal = '';\n foreach($row as $field=>$val) {\n if($location == $field) {\n if(count($out[0]) > 0) {\n if($nVal == '') $nVal = $value;\n foreach($out[0] as $x => $match) {\n $key = substr(substr($match,0,-1),1);\n $nVal = str_replace($out[0][$x],$this->dataSource[$i][$key],$nVal);\n }\n }\n\n $tmp[$safeName] = $nVal;\n $nVal = '';\n $tmp[$field] = $val;\n }\n else {\n $tmp[$field] = $val;\n }\n }\n $this->displaySource[$i] = $tmp;\n $this->addDisplayField($safeName,$fieldName,array('before'=>$location));\n }\n }\n }",
"public static function before() {}",
"public function before_field( string $before_field ): self {\n\t\t$this->before_field = $before_field;\n\t\treturn $this;\n\t}",
"public function insertBefore($nodesToInsert, HtmlNode $beforeNode)\n\t{\n\t\t$pos = $this->findNodePosition($beforeNode);\n\n\t\tif(is_array($nodesToInsert) === false)\n\t\t\t$nodesToInsert = array($nodesToInsert);\n\n\t\tarray_splice($this->childNodes, $pos, 0, $nodesToInsert);\n\n\t\t$this->childNodes = array_values($this->childNodes);\n\t}",
"protected final function prependPattern($pattern, $replacement)\n {\n $pattern = array($pattern => $replacement);\n $this->_patterns = array_merge($pattern, $this->_patterns);\n }",
"function GetReplacement($placeholder);",
"public function before($selector, $content, $markup, array $options = array()) {\n\t\t$options['action'] = 'before';\n\t\treturn $this->replace($selector, $content, $markup, $options);\n\t}",
"public function getBeforeMatch()\n {\n }",
"public function getBeforeMatch();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Resolves the IP address of the object by trying to ping the host. automatically updates the pingable status of the object if not disabled. | public function resolveIPv4AddressByPing($autoset=true, $autoUpdateIpAddresses=true)
{
$hostname = $this->_hostname;
if(!$hostname) {
/**
* @uses Parsonline_Exception_ContextException
*/
require_once('Parsonline/Exception/ContextException.php');
throw new Parsonline_Exception_ContextException("failed to resolve the IPv4 address. no hostname is specified",1);
}
$ip = false;
$pinger = $this->getPingRequester();
if (!$pinger) {
/**
* @uses Parsonline_Exception_ContextException
*/
require_once('Parsonline/Exception/ContextException.php');
throw new Parsonline_Exception_ContextException("failed to resolve IPv4 by ping. no ping requester is set for the host object",2);
}
// use output bufferring to make sure no data from PING command output
// is sent to PHP output
$obContents = ob_get_contents();
$obEnabled = ($obContents !== false);
if ($obContents) ob_clean();
ob_start();
$response = @$pinger->ping($hostname);
ob_clean();
if ($obEnabled) {
// re-send the previous output buffer data
echo $obContents;
}
unset($obContents, $obEnabled);
$pingable = false;
if ( PEAR::isError($response) || !$response ) {
$pingable = false;
} elseif (is_object($response) && ($response instanceof Net_Ping_Result)) {
$ip = $response->getTargetIp();
$pingable = true;
} else {
/**
* @uses Parsonline_Exception
*/
require_once('Parsonline_Exception.php');
throw new Parsonline_Exception( sprintf("failed to reslove the IPv4 address of '%s' by ping. Net_Ping::ping returned: $%s"), $hostname, var_export($response, bool));
}
if ($autoset) $this->setPingable($pingable);
if ($autoUpdateIpAddresses && $ip) $this->addIPv4Addresses($ip);
return $ip;
} | [
"function isPingable($hostname, $flags = OBS_DNS_ALL)\n{\n global $config;\n\n $ping_debug = isset($config['ping']['debug']) && $config['ping']['debug'];\n $try_a = is_flag_set(OBS_DNS_A, $flags);\n\n if (is_flag_set(OBS_PING_SKIP, $flags))\n {\n return 0.001; // Ping is skipped, just return 1ms\n }\n\n $timeout = (isset($config['ping']['timeout']) ? (int)$config['ping']['timeout'] : 500);\n if ($timeout < 50) { $timeout = 50; }\n else if ($timeout > 2000) { $timeout = 2000; }\n\n $retries = (isset($config['ping']['retries']) ? (int)$config['ping']['retries'] : 3);\n if ($retries < 1) { $retries = 3; }\n else if ($retries > 10) { $retries = 10; }\n\n $sleep = floor(1000000 / $retries); // interval between retries, max 1 sec\n\n if ($ip_version = get_ip_version($hostname))\n {\n // Ping by IP\n if ($ip_version === 6)\n {\n $cmd = $config['fping6'] . \" -t $timeout -c 1 -q $hostname 2>&1\";\n } else {\n if (!$try_a)\n {\n if ($ping_debug) { logfile('debug.log', __FUNCTION__ . \"() | DEVICE: $hostname | Passed IPv4 address but device use IPv6 transport\"); }\n print_debug('Into function ' . __FUNCTION__ . '() passed IPv4 address ('.$hostname.'but device use IPv6 transport');\n return 0;\n }\n // Forced check for actual IPv4 address\n $cmd = $config['fping'] . \" -t $timeout -c 1 -q $hostname 2>&1\";\n }\n } else {\n // First try IPv4\n $ip = ($try_a ? gethostbyname($hostname) : FALSE); // Do not check IPv4 if transport IPv6\n if ($ip && $ip != $hostname)\n {\n $cmd = $config['fping'] . \" -t $timeout -c 1 -q $ip 2>&1\";\n } else {\n $ip = gethostbyname6($hostname, OBS_DNS_AAAA);\n // Second try IPv6\n if ($ip)\n {\n $cmd = $config['fping6'] . \" -t $timeout -c 1 -q $ip 2>&1\";\n } else {\n // No DNS records\n if ($ping_debug) { logfile('debug.log', __FUNCTION__ . \"() | DEVICE: $hostname | NO DNS record found\"); }\n return 0;\n }\n }\n }\n\n for ($i=1; $i <= $retries; $i++)\n {\n $output = external_exec($cmd);\n if ($GLOBALS['exec_status']['exitcode'] === 0)\n {\n // normal $output = '8.8.8.8 : xmt/rcv/%loss = 1/1/0%, min/avg/max = 1.21/1.21/1.21'\n $tmp = explode('/', $output);\n $ping = $tmp[7];\n if (!$ping) { $ping = 0.001; } // Protection from zero (exclude false status)\n } else {\n $ping = 0;\n }\n if ($ping) { break; }\n\n if ($ping_debug)\n {\n logfile('debug.log', __FUNCTION__ . \"() | DEVICE: $hostname | FPING OUT ($i): \" . $output[0]);\n if ($i == $retries)\n {\n $mtr = $config['mtr'] . \" -r -n -c 5 $ip\";\n logfile('debug.log', __FUNCTION__ . \"() | DEVICE: $hostname | MTR OUT:\\n\" . external_exec($mtr));\n }\n }\n\n if ($i < $retries) usleep($sleep);\n }\n\n return $ping;\n}",
"public function ping();",
"public function ping(): void\n {\n $this->internal->ping();\n }",
"protected function ping()\n\t{\n\t\t$this->client->enquireLink();\n\t}",
"private function get_host_ip_info()\n {\n $this->host_ip_info = $this->get_ip_info($this->wireguard_interface['Address']);\n }",
"public static function performIpResolving($force = false){\n\t\t$conn = PingdomStatus_DB::getConnection();\n\n\t\t//\n\t\t// Get settings from pingdom status database\n\t\t$settingsTable = $conn->getTable('PingdomPsSettings');\n\t\t$settingsArray = $settingsTable->findAll();\n\t\t$settings = $settingsArray[0];\n\n\t\t// We need a doctrine sensor object, too\n\t\t$sensorObj = $conn->getTable('PingdomPsSensor');\n\n\t\t// Get all public sensors\n\t\t$sensors = $sensorObj->findByDql(\"is_public = 1\");\n\n\t\t//\n\t\t// For each sensor figure out if we need to resolve the ip\n\t\tforeach($sensors as $sensor){\n\t\t\t$resolve = false;\n\t\t\tif($force || mktime() > $sensor->next_ip_resolving_time){\n\t\t\t\t$resolve = true;\n\t\t\t}\n\t\t\tif($resolve){\n\t\t\t\ttry{\n\t\t\t\t\t//\n\t\t\t\t\t// Save next resolve time and prevent concurrent resolving\n\t\t\t\t\t$sensor->next_ip_resolving_time = mktime() + $settings->ip_resolving_period;\n\n\t\t\t\t\t// Resolve ip\n\t\t\t\t\t$sensor->ip = gethostbyname(trim($sensor->target));\n\n\t\t\t\t\t// Save sensor\n\t\t\t\t\t$sensor->save();\n\n\t\t\t\t\tPingdomDataProvider::log(\"Resolving performed for sensor with id: \" . $sensor->id);\n\t\t\t\t}\n\t\t\t\tcatch(Exception $ex){\n\t\t\t\t\tPingdomDataProvider::log(\"Error resolving ips: \" . $ex->getMessage());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function ping()\n {\n $this->setRequestAddress(\"ping\", $this->monitoringPort);\n try {\n return $this->executeRequest();\n } catch (EllipticsException $e) {\n Yii::log($e->getMessage(), CLogger::LEVEL_WARNING, __METHOD__);\n return false;\n }\n }",
"public function ping() {\n $this->lastPing = time();\n }",
"public function checkLockToIP() {}",
"function host_resolve($method,$host) {\n global $wins_host;\n global $bcast_address;\n global $ethers;\n switch ($method) {\n\tcase 'dns':\n\t $tmp_output = `host -W 1 $host`;\n\t $tmp_array = parse_hostlookup($tmp_output);\n\t if ($tmp_array[1] == $host) {\n\t # add ip address onto $ethers record for this host\n\t $ethers[$host][2] = chop($tmp_array[0]);\n\t return true;\n\t } else {\n\t return false;\n\t }\n\t break;\n\tcase 'wins':\n\t #echo \"nmblookup -U $wins_host -R $host | grep -v '^querying'\";\n\t $tmp_output = `nmblookup -U $wins_host -R $host | grep -v '^querying'`;\n\t $tmp_array = parse_nmblookup($tmp_output);\n\t if ($tmp_array[1] == $host) {\n\t # add ip address onto $ethers record for this host\n\t $ethers[$host][2] = $tmp_array[0];\n\t return true;\n\t } else {\n\t return false;\n\t }\n\t break;\n\tcase 'broadcast':\n\t #echo \"nmblookup $host<br \\>\";\n\t $tmp_output = `nmblookup $host`;\n\t $tmp_array = parse_nmblookup($tmp_output);\n\t if ($tmp_array[1] == $host) {\n\t # add ip address onto $ethers record for this host\n\t $ethers[$host][2] = $tmp_array[0];\n\t return true;\n\t } else {\n\t return false;\n\t }\n\t break;\n }\n }",
"public function ping() {\n\n $args = $this->args;\n $args[ \"method\" ] = __FUNCTION__;\n\n $res = $this->call($args);\n if ($res)\n return $res[ \"result\" ];\n }",
"function autoDiscovery($lower, $upper){\n\t$genericSnmpPath = $_SERVER[\"DOCUMENT_ROOT\"] . \"/vanguardhe/php_scripts/oidget/genericSnmp.php\";\n\trequire_once($genericSnmpPath); // to initialize snmp \n // to do: 1) get all of ip into a list\n // 2) iterator over the ip list, and check the pingable.\n //3) in the pingable list, use public/PUBLIC, if has something, restore to the datasa\n\n \t$reachableIpList = getAllOnlineDevice(getAllIp($lower, $upper));\n //$reachableIpList = getAllIp($lower, $upper);\n\n for ($i=0; $i < sizeof($reachableIpList); $i++) { \n\n \t# code...\n \t$o = snmpget_smallp($reachableIpList[$i], \".1.3.6.1.2.1.1.2.0\"); // oid \n \t$comm = \"public\";\n \tif (substr($o, 0, 2)==\"No\") {\n \t\t# code...\n \t\t$o = snmpget_bigP($reachableIpList[$i], \".1.3.6.1.2.1.1.2.0\"); // oid \n \t\t$comm = \"PUBLIC\";\n \t}\n\n \tif (substr($o, 0, 2)!=\"No\") {\n \t\t# code...\n \t\twriteToDatabase($reachableIpList[$i], $comm);\n \t\techo $reachableIpList[$i]. \" : \" . $comm . \" has been added into the database.<br>\";\n\n\n \t}\n\n }\n}",
"private function doUpdatePing(): void\n {\n\n $pkt = MineceitUtil::constructCustomPkt([\"GetPing\", $this->getName()]);\n RequestPool::addRequest(Request::TYPE_PING, $this, $pkt->buffer, function ($data, $uuid) {\n if (($player = MineceitUtil::getPlayerFromUUID($uuid)) != null && $player instanceof MineceitPlayer) {\n $player->completePingUpdate($data['ping']);\n }\n });\n $this->dataPacket($pkt);\n }",
"public function ping()\r\n\t{\r\n\t\t$cmd = $this->elasticHost;\r\n\t\t$response = $this->sendRequest($cmd, 'GET');\r\n\t\treturn $response;\r\n\t}",
"public function resolveHostname($force = false) {\n if ($force === true || $this->ipAddress === null || $this->ipAddress === '') {\n $ip = gethostbyname($this->hostname);\n if ($ip !== $this->hostname) {\n $this->ipAddress = $ip;\n }\n }\n }",
"public function testSitecheckResultObjectShouldContainCheckedIp()\n {\n $result = $this->sitecheck->check('www.iping.nl');\n \n $this->assertEquals('94.75.237.71', $result->getIpAddress('ipv4'));\n }",
"protected function resolve($type, $tag) {\n\n if ($dnsCache = $this->getCache($type, $tag)) {\n return $dnsCache['ip'];\n } else {\n $ec2host = new ec2host(clone $this->ec2, $tag);\n\n if ($ec2host->instances) {\n $ip = gethostbyname($ec2host->instances[0]['dnsName']);\n $this->setCache($type, $tag, $ip);\n\n return $ip;\n } else {\n return false;\n }\n\n }\n\n }",
"public function autoPingConnect()\n {\n $link = $this->autoConnect();\n $this->autoPing();\n return $link;\n }",
"function ping($ip_addr)\n\t{\n\t\t$result = shell_exec(\"ping $ip_addr\");\n\n\t\t/*if($debug >= 1)\n\t\t{\n\t\t\techo $result;\n\t\t\techo '<br />';\n\t\t\techo '<br />';\n\t\t}*/\n\n\t\tif (strpos($result, 'Request timed out') !== false) return false; // failed\n\t\telse return true; // success\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test case for getSignupPage Get signup page. | public function testGetSignupPage()
{
} | [
"public function testCreateSignupPage()\n {\n }",
"public function testSignup()\n {\n $this->visit('/')\n ->click('Register as Job Seejer')\n ->seePageIs('/register')\n ->see('Register');\n }",
"private function _signUpPageRequested()\n {\n $this->utility->redirect('signup');\n }",
"public function testSuccessfulSignup() {\n $testUser=uniqid('SignupTest_');\n $this->visit('/auth/register')\n ->type($testUser, 'name')\n ->type($testUser . '@gmail.com', 'email')\n ->type('somePassword', 'password')\n ->type('somePassword', 'password_confirmation')\n ->type('Dummy security question answer', 'recovery')\n ->press('Sign Up')\n ->see('Hello, ' . $testUser);\n }",
"public function getSignup()\n\t{\n\t\t$this->load->view('auth/register');\n\t}",
"public static function signup() {\n self::render_view('user/signup.html');\n }",
"public function signup()\r\n\t{\r\n\t\t$this->setView('new');\r\n\t\t$this->view->set('title', 'Create an account'); \r\n\t\treturn $this->view->output();\r\n\t}",
"function ContentSignUpPage(){\r\n\t\r\n\treturn $this->renderPartial(\"signup\",array(),true);\r\n\t\r\n\t}",
"function request_signup()\r\n\t{\r\n\t\t$this->authx->request_signup();\r\n\t}",
"public function signup() {\n $this->template->content = View::instance('v_users_signup');\n\n echo $this->template;\n }",
"function signup_get() {\n\t\t$this->load->view('signup.php');\n\t}",
"public function testDeleteSignupPage()\n {\n }",
"public function clickOnSignUp()\n {\n $I = $this;\n $I->amonPage(LoginPage::$URL);\n $I->click(LoginPage::$signUp);\n $I->comment(\"Click Succes!\");\n }",
"public function actionSignup()\n {\n \n if(!Yii::$app->user->isGuest){\n return $this->goHome();\n }\n\n if(!Yii::$app->team->isGuest){\n $this->actionActiveround();\n }\n\n //throw new ForbiddenHttpException(\"You cannot signup for this site.\");\n\n $model = new SignupForm();\n\n if($model->load(Yii::$app->request->post()) && $model->signup()){\n return $this->redirect('home');\n }\n\n return $this->render('signup', [\n 'model' => $model,\n ]);\n\n }",
"public function showSignup()\n {\n //load sign up view\n $this->load->view('signup_form');\n }",
"function signUpUrlPath()\n{\t\n return '/signup';\n}",
"public function actionSignup() {\n\t\t$this->render('signup');\n\t}",
"public function testUserSignupSuccess()\n {\n $this->clearDB();\n\n $response = $this->post('/api/v1/auth/signup', $this->staticUserDetails);\n\n $response->assertStatus(201);\n\n $response = $response->json();\n\n $this->assertEquals($response['user']['email'], $this->staticUserDetails['email']);\n }",
"public function anySignup() {\n /* Redirect to the first signup page */\n return Redirect::route('signup-wizard.authentication');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
$inputToSet The web element for the input being set. Ie, Listing Begin $monthYear The month and year as it appears atop the calendar widget $dayOfMonth The day of the month we are setting the date to $formattedDate The date as it appears in the input once date is set $pastOrFuture 'past' = this date is in the past. 'future' = this date is in the future This function opens the calendar, sets the date, then verifies the formatted date is showing up. It does not save the date. | public function setDate(AcceptanceTester $I, $inputToSet, $monthYear, $dayOfMonth, $formattedDate, $pastOrFuture) {
$I->amGoingTo('Open calendar');
$I->wait(5);
$I->scrollTo($inputToSet);
$I->click($inputToSet);
$I->waitForElementVisible(ContentPage::$calendar_main, 30);
if (ContentUtils::isFuture($dayOfMonth . ' ' . $monthYear, $I->grabValueFrom($inputToSet))) {
$button = ContentPage::$calendar_nextBtn;
} else {
$button = ContentPage::$calendar_prevBtn;
}
$I->amGoingTo('Set the date for ' . $dayOfMonth . 'th of ' . $monthYear);
$calendar = $I->findElement(ContentPage::$calendar_main_xpath);
$caption = $I->findElementInElement($calendar, ContentPage::$calendar_caption_xpath);
for ($u=0; $u < 24; $u++) {
$I->see($caption->getText());
if(!AcceptanceUtils::checkIfElementVisible($I, "//div[contains(text(), '" . $monthYear . "')]")) {
$I->scrollTo($button);
$I->click($button);
$I->wait(3);
} else {
$I->wait(10); //Avoid stale elements
break;
}
}
$I->click("//div[contains(@class, 'DayPicker-Body')]//div[text()='" . $dayOfMonth . "']");
$I->expect('Correct date shows up in field.');
$I->wait(5);
$I->seeInField($inputToSet, $formattedDate);
$I->wait(1);
$I->amGoingTo('Click OK on the calendar.');
$I->click(ContentPage::$calendar_confirm);
} | [
"private function setDate(){\n\t// Validate incoming parameters\n\t\t$this->di->logger->stamp(__CLASS__, __METHOD__, '');\n\tif (isset($_GET['month'])) {\n\t\tis_numeric($_GET['month']) or die('month has to be numeric');\n\t}\n\tif (isset($_GET['year'])) {\n\t\tis_numeric($_GET['year']) or die('year has to be numeric');\n\t}\n\n\t// Set new date\n\t$this->newMonth = isset($_GET['month']) ? ($_GET['month']) : $this->currentMonth;\n\t$this->newYear = isset($_GET['year']) ? ($_GET['year']) : $this->currentYear;\n\n\tif ($this->newMonth > 12) {\n\t\t$this->newYear = $this->newYear +1;\n\t\t$this->newMonth = 1;\n\t\t$_GET['month'] = 1;\n\n\t}\n\telse if ($this->newMonth < 1) {\n\t\t$this->newYear = $this->newYear -1;\n\t\t$this->newMonth = 12;\n\t\t$_GET['month'] = 12;\n\t}\n\t\n\t}",
"function SetLocalDate( $input ) {\n $this->_text = $input;\n $this->_PartsFromText();\n $this->_EpochFromParts();\n }",
"public function fillInDateInTheCalendar()\n {\n $this->getElement('Datepicker')->click();\n $values = $this->findAll('css', 'a.ui-state-default');\n $values[0]->click();\n }",
"function print_date_selection_set( $p_name, $p_format, $p_date = 0, $p_default_disable = false, $p_allow_blank = false, $p_year_start = 0, $p_year_end = 0, $p_input_css = \"input-sm\" ) {\n\tif( $p_date != 0 ) {\n\t\t$t_date = date( $p_format, $p_date );\n\t} else {\n\t\t$t_date = '';\n\t}\n\n\t$t_disable = '';\n\tif( $p_default_disable == true ) {\n\t\t$t_disable = ' readonly=\"readonly\"';\n\t}\n\n \techo '<input ' . helper_get_tab_index() . ' type=\"text\" name=\"' . $p_name . '_date\" ' .\n\t\t' class=\"datetimepicker ' . $p_input_css . '\" ' . $t_disable .\n\t\t' data-picker-locale=\"' . lang_get_current_datetime_locale() . '\"' .\n\t\t' data-picker-format=\"' . convert_date_format_to_momentjs( $p_format ) . '\"' .\n\t\t' size=\"16\" maxlength=\"20\" value=\"' . $t_date . '\" />';\n\techo '<i class=\"fa fa-calendar fa-xlg datetimepicker\"></i>';\n}",
"public function setDateAttribute($input)\r\n {\r\n if($input != '') {\r\n $this->attributes['date'] = Carbon::createFromFormat(config('quickadmin.date_format'), $input)->format('Y-m-d');\r\n }else{\r\n $this->attributes['date'] = '';\r\n }\r\n }",
"function dateForm($current=array(), $useTime = false){\r\n if (count($current) == 1){ $startOnly = true; }\r\n if ($useTime == true){\r\n if ($current[0] != ''){ $current[0] .= \" 00:00\"; }\r\n else { $current[0] = date(\"m/d/Y\") . \" 00:00\"; }\r\n if ($current[1] != ''){ $current[1] .= \" 23:59\"; }\r\n else { $current[1] = date(\"m/d/Y\") . \" 23:59\"; }\r\n }\r\n \r\n $text .= \"<style type=\\\"text/css\\\">@import url(templates/calendar-blue.css);</style>\";\r\n $text .= \"<script type=\\\"text/javascript\\\" src=\\\"javascript/calendar.js\\\"></script>\";\r\n $text .= \"<script type=\\\"text/javascript\\\" src=\\\"javascript/calendar-en.js\\\"></script>\";\r\n $text .= \"<script type=\\\"text/javascript\\\" src=\\\"javascript/calendar-setup.js\\\"></script>\\r\\n\"; \r\n if ($startOnly){\r\n $text .= \"Date: \";\r\n $text .= \"<input type='text' name='dateStart' id='dateStart' value='\" . $current[0] . \"' /> \";\r\n $text .= \"<img src='images/cal.gif' id='dateStartImage' style=\\\"cursor: pointer;\\\" title=\\\"Date selector\\\" /> \";\r\n $text .= \"<script type=\\\"text/javascript\\\">\";\r\n if ($useTime == true){\r\n $text .= \"Calendar.setup({ inputField : \\\"dateStart\\\", ifFormat : \\\"%m/%d/%Y %H:%M\\\", button : \\\"dateStartImage\\\", singleClick : true, weekNumbers : false, showOthers : true, step : 1, showsTime : true});\";\r\n }\r\n else {\r\n $text .= \"Calendar.setup({ inputField : \\\"dateStart\\\", ifFormat : \\\"%m/%d/%Y\\\", button : \\\"dateStartImage\\\", singleClick : true, weekNumbers : false, showOthers : true, step : 1});\";\r\n }\r\n $text .= \"</script>\"; \r\n }\r\n else {\r\n $text .= \"Date from: \";\r\n $text .= \"<input type='text' name='dateStart' id='dateStart' value='\" . $current[0] . \"' /> \";\r\n $text .= \"<img src='images/cal.gif' id='dateStartImage' style=\\\"cursor: pointer;\\\" title=\\\"Date selector\\\" />\";\r\n $text .= \" to \"; \r\n $text .= \"<input type='text' name='dateEnd' id='dateEnd' value='\" . $current[1] . \"' /> \";\r\n\r\n $text .= \"<img src='images/cal.gif' id='dateEndImage' style=\\\"cursor: pointer;\\\" title=\\\"Date selector\\\" /> \"; \r\n $text .= \"<script type=\\\"text/javascript\\\">\";\r\n if ($useTime == true){\r\n \r\n $text .= \"Calendar.setup({ inputField : \\\"dateStart\\\", ifFormat : \\\"%m/%d/%Y %H:%M\\\", button : \\\"dateStartImage\\\", singleClick : true, weekNumbers : false, showOthers : true, step : 1, showsTime : true});\";\r\n $text .= \"Calendar.setup({ inputField : \\\"dateEnd\\\", ifFormat : \\\"%m/%d/%Y %H:%M\\\", button : \\\"dateEndImage\\\", singleClick : true, weekNumbers : false, showOthers : true, step : 1, showsTime : true});\";\r\n }\r\n else {\r\n $text .= \"Calendar.setup({ inputField : \\\"dateStart\\\", ifFormat : \\\"%m/%d/%Y\\\", button : \\\"dateStartImage\\\", singleClick : true, weekNumbers : false, showOthers : true, step : 1});\";\r\n $text .= \"Calendar.setup({ inputField : \\\"dateEnd\\\", ifFormat : \\\"%m/%d/%Y\\\", button : \\\"dateEndImage\\\", singleClick : true, weekNumbers : false, showOthers : true, step : 1});\";\r\n }\r\n $text .= \"</script>\"; \r\n }\r\n $this->dateFormText = $text;\r\n \r\n \r\n }",
"function recsys_wb_project_opening_form_submit($form, &$form_state) {\n $date = $form_state['values']['project_opening_date']['year'];\n \n if ( $form_state['values']['project_opening_date']['month'] < 10 ) {\n $date .= \"-0\" . $form_state['values']['project_opening_date']['month'];\n } else {\n $date .= \"-\" . $form_state['values']['project_opening_date']['month'];\n }\n \n if ( $form_state['values']['project_opening_date']['day'] < 10 ) {\n $date .= \"-0\" . $form_state['values']['project_opening_date']['day'];\n } else {\n $date .= \"-\" . $form_state['values']['project_opening_date']['day'];\n }\n\n $date .= \" \" . $form_state['values']['project_opening_time'];\n\n variable_set('project_opening',$date);\n drupal_set_message(\"Project opening date set to: \" . $date);\n}",
"function dateSelector()\n{\n\t$today = date('Y-m-d');\n\n\techo '<br>Start Date:<br>';\n\n\t//Saves the date in the in selector view\n\tif(!isset($_POST['startdate']))\n\t\techo '<input type=\"date\" name=\"startdate\" value=\"2015-01-01\">';\n\telse\n\t\techo '<input type=\"date\" name=\"startdate\" value=\"' . $_POST['startdate'] . '\">';\n\n\techo '<br>End Date:<br>';\n\n\tif(!isset($_POST['enddate']))\n\t\techo '<input type=\"date\" name=\"enddate\" value=\"' . $today. '\">';\n\telse\n\t\techo '<input type=\"date\" name=\"enddate\" value=\"' . $_POST['enddate'] . '\">';\n}",
"function input_date($field_data){\n\t\tglobal $i18n_std;\n\t//\tp2($field_data)\t;\t\t\tp2($this,'red');\n\t\t$txt=\"<nobr>\";\n\t\t$d=explode(' ',$field_data['value']);\n\t\t$d1=explode('-',$d[0]);\n\t\t$d2=explode(':',$d[1]);\n\n\t\tif(!array_key_exists('year_range',$field_data)){\n\t\t\t$field_data[\"year_range\"]=range(1900,2099);\n\t\t}\n\t\tif(substr($field_data['name'],strlen($field_data['name'])-2,2)=='[]'){\n\t\t\t$field_data['name']=substr($field_data['name'],0,strlen($field_data['name'])-2);\n\t\t\t$field_append = \"[]\";\n\t\t}else{\n\t\t\t$field_append='';\n\t\t}\n\t\t$txt.=$this->input_list(\n\t\t\tarray(\n\t\t\t\t'name'=>$field_data['name'].'_year'.$field_append,\n\t\t\t\t'type'=>'list',\n\t\t\t\t'options'=>$this->aa($field_data[\"year_range\"]),\n\t\t\t\t'value'=>$d1[0],\n\t\t\t\t'cdata'=>$field_data['cdata'].' id=\"'.$field_data['name'].'_year'.\"\\\" \",\n\t\t\t));\n\n\t\t$txt.=$this->input_list(\n\t\t\tarray(\n\t\t\t\t'name'=>$field_data['name'].'_month'.$field_append,\n\t\t\t\t'type'=>'list',\n\t\t\t\t'options'=>$i18n_std['months'],\n\t\t\t\t'value'=>$d1[1],\n\t\t\t\t'cdata'=>$field_data['cdata'].' id=\"'.$field_data['name'].'_month'.\"\\\" \",\n\t\t\t));\n\n\t\t$txt.=$this->input_list(\n\t\t\tarray(\n\t\t\t\t'name'=>$field_data['name'].'_date'.$field_append,\n\t\t\t\t'type'=>'list',\n\t\t\t\t'options'=>$this->aa(range(1,31)),\n\t\t\t\t'value'=>$d1[2],\n\t\t\t\t'cdata'=>$field_data['cdata'].' id=\"'.$field_data['name'].'_date'.\"\\\" \",\n\t\t\t));\n\t\tif((!array_key_exists('today',$field_data)) ||$field_data['today']!=0){\n\t\t\t$txt.=' <a class=\"today_link standard_link\" href=\"#\" onclick=\"std_set_today(\\''.$field_data['name'].'\\')\">'.$i18n_std['today'].'</a>';\n\t\t}\n\t\treturn($txt.'</nobr>');\n\t}",
"private function set_date()\r\n\t{\r\n\t\tif ($this->month > 12)\r\n\t\t{\r\n\t\t\t$this->month=1;\r\n\t\t\t$this->year++;\r\n\t\t}\r\n\r\n\t\tif ($this->month < 1)\r\n\t\t{\r\n\t\t\t$this->month=12;\r\n\t\t\t$this->year--;\r\n\t\t}\r\n\r\n\t\tif ($this->year > 2037) $this->year = 2037;\r\n\t\tif ($this->year < 1971) $this->year = 1971;\r\n\t}",
"function inspector_set_date(){\n\t\tif($this->session->userdata('isLogged') == false){\n redirect('login');\n }\n\t\t\n\t\t$assignId = $this->uri->segment(2);\n\t\tif(!$assignId){\n\t\t\texit;\n\t\t}\n\t\t$post = array(\n\t\t\t'InspectionIsSet' => 1,\n\t\t\t'InspectionDate' => isset($_GET['date']) ? $_GET['date'] : date('Y-m-d'),\n\t\t\t'InspectionTime' => isset($_GET['start']) ? $_GET['start'] : date('H:i g'),\n\t\t\t'InspectionTimeEnd' => isset($_GET['end']) ? $_GET['end'] : date('H:i g')\n\t\t);\n\t\t$this->main_model->update('tbl_user_assignment', $post, $assignId);\n\t}",
"function setDate($value = '') {\n $this->date = ($value == '' ? DateManager::get_Date() : DateManager::format_Date($value));\n }",
"function testDrawInputCallsDateForDateType() {\n //arrange\n\t\t$field = new TestValidDateField();\n $HTML = $this->getMockBuilder( '\\CFPB\\Utils\\MetaBox\\HTML' )\n ->setMethods( array( 'date', 'displayTags' ) )\n ->getMock();\n $HTML->expects( $this->once() )\n ->method( 'date' )\n ->will( $this->returnValue( true ) );\n\n //act\n\t\t$HTML->draw_input( $field->fields['category'] );\n\n //assert\n // Passes when date() is called once\n }",
"public function input_date($date, $options);",
"function editDatetime ($name, $title, $content, $description, $required, $rangeFrom, $rangeTo) {\n\n\t$today = time();\n\t$day = date('d', $today);\n\t$month = date('m', $today);\n\t$year = date('Y', $today);\n\t$hour = date('H', $today);\n\t$minute = date('i', $today);\n\n\tif ($description != '') $description = '<br /><span class=\"help\">' . $description . '</span>';\n\tif ($required != '') $required = '*';\n\tif ($rangeFrom == '') $rangeFrom = $year-3;\n\tif ($rangeTo == '') $rangeTo = $year+3;\n\n\t?>\n<tr>\n\t<td class=\"name\"><?php echo $title . $description; ?></td>\n\t<td class=\"required\"><?php echo $required; ?></td>\n\t<td><select id=\"<?php echo $name; ?>Day\" name=\"<?php echo $name; ?>Day\"><option value=\"\"></option>\n\t\t<?php\n\t\t\tfor ($i = 1; $i <= 31; $i++) :\n\t\t\t\techo '<option value=\"' . $i . '\"';\n\t\t\t\tif ($i == substr($content,8,2)) echo ' selected=\"selected\"';\n\t\t\t\techo ' >' . $i . '</option>';\n\t\t\tendfor;\n\t\t?>\n\t\t</select> ⁄\n\t\t<select id=\"<?php echo $name; ?>Month\" name=\"<?php echo $name; ?>Month\"><option value=\"\"></option>\n\t\t<?php\n\t\t\tfor ($i = 1; $i <= 12; $i++) :\n\t\t\t\techo '<option value=\"' . $i . '\"';\n\t\t\t\tif ($i == substr($content,5,2)) echo ' selected=\"selected\"';\n\t\t\t\techo ' >' . monthITA($i) . '</option>';\n\t\t\tendfor;\n\t\t?>\n\t\t</select> ⁄\n\t\t<select id=\"<?php echo $name; ?>Year\" name=\"<?php echo $name; ?>Year\"><option value=\"\"></option>\n\t\t<?php\n\t\t\tfor ($i = $rangeTo; $i >= $rangeFrom; $i--) :\n\t\t\t\techo '<option value=\"' . $i . '\"';\n\t\t\t\tif ($i == substr($content,0,4)) echo ' selected=\"selected\"';\n\t\t\t\techo ' >' . $i . '</option>';\n\t\t\tendfor;\n\t\t?>\n\t</select> \n\t<select id=\"<?php echo $name; ?>Hour\" name=\"<?php echo $name; ?>Hour\"><option value=\"\"></option>\n\t\t<?php\n\t\t\tfor ($i = 0; $i <= 23; $i++) :\n\t\t\t\tif(strlen($i) == 1) $i = '0'.$i;\n\t\t\t\techo '<option value=\"' . $i . '\"';\n\t\t\t\tif ($i == substr($content,11,2)) echo ' selected=\"selected\"';\n\t\t\t\techo ' >' . $i . '</option>';\n\t\t\tendfor;\n\t\t?>\n\t</select> :\n\t<select id=\"<?php echo $name; ?>Minute\" name=\"<?php echo $name; ?>Minute\"><option value=\"\"></option>\n\t\t<?php\n\t\t\tfor ($i = 0; $i <= 59; $i++) :\n\t\t\t\tif(strlen($i) == 1) $i = '0'.$i;\n\t\t\t\techo '<option value=\"' . $i . '\"';\n\t\t\t\tif ($i == substr($content,14,2)) echo ' selected=\"selected\"';\n\t\t\t\techo ' >' . $i . '</option>';\n\t\t\tendfor;\n\t\t?>\n\t</select>\n\t</td>\n</tr>\n\t<?php\n\n}",
"function date_selector($submit_ident, $future=1) {\n // ID to ensure unique forms\n static $id = 0;\n $id++;\n\n /* BLOCK: Initialize local variables\n * We generate unique identifiers for the forms using the id\n * variable.\n * We also need to initialize some arrays that will\n * be used to generate both the month and day dropdowns\n * */\n $year_ident = \"selectYearDateSelector\" . $id;\n $month_ident = \"selectMonthDateSelector\" . $id;\n $day_ident = \"selectDayDateSelector\" . $id;\n $months = array(\"January\" => 1, \"February\" => 2, \"March\" => 3, \"April\" => 4, \"May\" => 5, \"June\" => 6,\n \"July\" => 7, \"August\" => 8, \"September\" => 9, \"October\" => 10, \"November\" => 11, \"December\" => 12);\n $months31 = array(1, 3, 5, 7, 8, 10, 12);\n // END BLOCK\n\n /* BLOCK: Create year dropdown\n * First we echo the html code for a select form.\n * Next we use the current date offset by the $future variable to\n * determine the year furthest in the future we will accept.\n * Our minimum year is the year PSU was founded.\n * Next we use a for loop to construct the year options for the\n * dropdown taking care to select the previously selected month\n * if an update occured after dropdown was already changed\n * Finally we end the select block\n */\n echo \"<select name=\\\"\" . $year_ident . \"\\\" onchange=\\\"this.form.submit()\\\">\\n\";\n $thisyear = intval((new DateTime(\"now\"))->modify(\"+\" . $future . \" year\")->format(\"Y\"));\n for ($year=$thisyear; $year>=1946; $year--) {\n if (isset($_POST[$year_ident]) and $_POST[$year_ident] == $year) {\n echo \"<option value=\" . $year . \" selected >\" . $year . \"</option>\\n\";\n } else {\n echo \"<option value=\" . $year . \">\" . $year . \"</option>\\n\";\n }\n }\n echo \"</select>\\n\";\n // END BLOCK\n\n /* BLOCK: Create month dropdown\n * First ewe echo the html code for a select form\n * Next we set the forms $_POST entry if it was not already set\n * so it can be used by the day dropdown to determine the\n * number of days to display\n * Next we use a for loop to construct the month options for the\n * dropdown taking care to select the previously selected month\n * if an update occured after the dropdown was changed\n * Finally we end the select block\n */\n echo \"<select name=\\\"\" . $month_ident . \"\\\" onchange=\\\"this.form.submit()\\\">\\n\";\n if (!isset($_POST[$month_ident])) {\n $_POST[$month_ident] = 1;\n }\n foreach ($months as $name => $number) {\n if (isset($_POST[$month_ident]) and $_POST[$month_ident] == $number) {\n echo \"<option value=\\\"\" . $number . \"\\\" selected>\" . $name . \"</option\\n>\";\n } else {\n echo \"<option value=\\\"\" . $number . \"\\\">\" . $name . \"</option\\n>\";\n }\n }\n echo \"</select>\\n\";\n // END BLOCK\n\n /* BLOCK: Create day dropdown\n * First we echo the html code for a select form\n * Next we determine the number of days necessary to display.\n * If the month was February we check for leap years otherwise\n * we see of the date was in $months31 for 31 days, 30 otherwise\n * Next for loops construct the day options for the dropdown taking\n * care to select the previously selected day if an update\n * occured after the dropdown was changed\n * Finally we end the select block\n */\n echo \"<select name=\\\"\" . $day_ident . \"\\\">\\n\";\n if ($_POST[$month_ident] == $months[\"February\"]) {\n $intyear = intval($_POST[$year_ident]);\n if (($intyear % 4 == 0 and $intyear % 100 != 0) or $intyear % 400 == 0) {\n for ($day=1; $day<=29; $day++) {\n if (isset($_POST[$day_ident]) and $_POST[$day_ident] == $day) {\n echo \"<option value=\" . $day . \" selected>\" . $day . \"</option>\\n\";\n } else {\n echo \"<option value=\" . $day . \">\" . $day . \"</option>\\n\";\n }\n }\n } else {\n for ($day=1; $day<=28; $day++) {\n if (isset($_POST[$day_ident]) and $_POST[$day_ident] == $day) {\n echo \"<option value=\" . $day . \" selected>\" . $day . \"</option>\\n\";\n } else {\n echo \"<option value=\" . $day . \">\" . $day . \"</option>\\n\";\n }\n }\n }\n } else if (in_array($_POST[$month_ident], $months31)) {\n for ($day=1; $day<=31; $day++) {\n if (isset($_POST[$day_ident]) and $_POST[$day_ident] == $day) {\n echo \"<option value=\" . $day . \" selected>\" . $day . \"</option>\\n\";\n } else {\n echo \"<option value=\" . $day . \">\" . $day . \"</option>\\n\";\n }\n }\n } else {\n for ($day=1; $day<=30; $day++) {\n if (isset($_POST[$day_ident]) and $_POST[$day_ident] == $day) {\n echo \"<option value=\" . $day . \" selected>\" . $day . \"</option>\\n\";\n } else {\n echo \"<option value=\" . $day . \">\" . $day . \"</option>\\n\";\n }\n }\n }\n echo \"</select>\";\n\n // Check if submission criteria are met and return\n if (isset($_POST[$submit_ident])) {\n $selected_year = $_POST[$year_ident];\n $selected_month = $_POST[$month_ident];\n $selected_day = $_POST[$day_ident];\n\n if (!empty($selected_year) and !empty($selected_month) and !empty($selected_day)) {\n $datestr = implode(\"-\", array($selected_year, $selected_month, $selected_day));\n $ret = new DateTime($datestr);\n return $ret;\n }\n }\n}",
"function setDate( $value )\r\n {\r\n $this->Date = $value;\r\n }",
"protected function setDates()\n {\n parent::setDates();\n // modify endDate to selected month range after the graph is already built\n $this->endDate = clone $this->requestedDate;\n $this->endDate\n ->modify(\"first day of this month\")\n ->modify(\"+\" . $this->blockVars['pcbeventsrange'] . \" months\");\n }",
"function setDate( $value )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n $this->Date = $value;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Validates subnet by Id | private function validate_subnet_id () {
// numberic
if(!is_numeric($this->_params->id)) { $this->Response->throw_exception(409, "Subnet Id must be numeric (".$this->_params->id.")"); }
// check subnet
if($this->Subnets->fetch_subnet ("id", $this->_params->id)===false) { $this->Response->throw_exception(404, "Invalid subnet Id (".$this->_params->id.")"); }
} | [
"private function validate_cidr () {\n\t\t// not for folder\n\t\tif($this->_params->isFolder!=1) {\n\t\t\t// check\n\t\t\tif(strlen($err = $this->Subnets->verify_cidr_address($this->_params->subnet.\"/\".$this->_params->mask))>1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{ $this->Response->throw_exception(409, $err); }\n\t\t}\n\t}",
"public function validate_subnet($entry)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (! Network_Utils::is_valid_network($entry))\n return lang('network_ip_range_invalid');\n $pieces = explode('/', $entry);\n $ipsegment = $pieces[0];\n $subnet = $pieces[1];\n if (! Network_Utils::is_private_ip($ipsegment))\n return lang('static_vpn_not_private_subnet');\n }",
"function validate_subnet($subnet) {\n\t\t\tif (preg_match(\"/^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:[.](?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}\\/(?:3[0-2]|[1-2]\\d|\\d)$/\", $subnet))\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}",
"#[@test]\n public function inSubnet() {\n $this->assertTrue(create(new Inet4Address('192.168.2.1'))->inSubnet(new Network(new Inet4Address('192.168.2'), 24)));\n }",
"public function isValidated($networkId = null);",
"#[@test]\n public function inSubnet() {\n $this->assertTrue(create(new Inet6Address('::1'))->inSubnet(new Network(new Inet6Address('::1'), 120)));\n }",
"public function setSubnetId($var)\n {\n GPBUtil::checkString($var, True);\n $this->subnet_id = $var;\n\n return $this;\n }",
"public function add_subnet_id($id)\n {\n $this->m_subnet_ids[] = $id;\n }",
"function validate_subnet($subnet) {\n\t\t\t$parts = explode(\"/\", $subnet);\n\t\t\tif (count($parts) != 2)\n\t\t\t\treturn false;\n\n\t\t\tif (!IPv6::validate_ip($parts[0]) || !IPv6::validate_cidr($parts[1]))\n\t\t\t\treturn false;\n\t\t\telse\n\t\t\t\treturn true;\n\t\t}",
"public function getSubnet($id)\n\t{\n\t\treturn $this->getResourceChildObject('subnets', $id);\n\t}",
"function ip_in_subnet($ip, $subnet)\n{\n // Converts a human-readable IP address into its binary representation\n $binary_ip = inet_pton($ip);\n\n // Converts the binary IP into a string of bits.\n // We can't convert the IP to an int (using, for example ip2long()) because php only\n // natively supports unsigned 32 bit ints, while an ipv6 address is 128 bits.\n // If we want, we could make use of some php libraries (e.g. BC Math or GMP) to create a 128\n // bit int, but this is not necessary because we don't need to perform any math operations\n // on this int anyway.\n // Instead, we just convert the IP to a string which is sufficient because we only need to\n // use it for a single string comparison later.\n $ip_bits = inet_to_bits($binary_ip);\n\n // Get the bit string for the subnet address, as well as the length of the subnet mask (in bits)\n list($range, $netmask_len) = explode('/', $subnet, 2); //$netmask_len is aka. the CIDR prefix\n $binary_range = inet_pton($range);\n $range_bits = inet_to_bits($binary_range);\n\n // Get the network bits of the given IP address and the subnet address\n $ip_net_bits = substr($ip_bits, 0, $netmask_len);\n $range_net_bits = substr($range_bits, 0, $netmask_len);\n\n // If the network bits are identical, then this IP is part of the subnet\n return ($ip_net_bits == $range_net_bits);\n}",
"public function is_linked ($subnetId) {\n \tif(!is_numeric($subnetId)) {\n \treturn false;\n \t}\n \telse {\n \t\ttry { $subnets = $this->Database->getObjectsQuery(\"select * from subnets where `linked_subnet` = ?\", array($subnetId)); }\n \t\tcatch (Exception $e) {\n \t\t\t$this->Result->show(\"danger\", _(\"Error: \").$e->getMessage());\n \t\t\treturn false;\n \t\t}\n \t\t// check\n \t\tif (sizeof($subnets)>0) {\n \t\tforeach ($subnets as $s) {\n $this->cache_write (\"subnets\", $s->id, $s);\n \t\t}\n \t\treturn $subnets;\n \t\t}\n \t\telse {\n \t\treturn false;\n \t\t}\n \t}\n\t}",
"public function getSubnetId()\n {\n return $this->subnet_id;\n }",
"function subnet_check_ipv6($ip, $cidr) {\n list($subnet, $bits) = explode('/', $cidr);\n $char = (128 - $bits) / 4;\n \n $hex_subnet = substr(bin2hex(inet_pton($subnet)), 0, 0 - $char);\n $hex_ipaddr = substr(bin2hex(inet_pton($ip)), 0, 0 - $char);\n \n return $hex_ipaddr === $hex_subnet ? 1 : 0;\n}",
"function subnet ($ip=NULL, $subnet=NULL)\n\t{\n\n\t\t// assign defaults\n\t\tif (is_null($ip))\n\t\t\t$ip = $_SERVER['REMOTE_ADDR'];\n\n\t\t// default to REMOTE_ADDR\n\t\tif (!is_null($subnet))\n\t\t{\n\t\t\t$explodeip = explode('.', $ip);\n\t\t\t$subnetip = explode('.', substr($subnet, 0, strpos($subnet, '/')));\n\t\t\t$subnetmask = substr($subnet, strpos($subnet, '/') + 1);\n\t\t\tif ($subnetmask == 32)\n\t\t\t{\n\t\t\t\tif (substr($subnet, 0, strpos($subnet, '/')) == $ip)\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} elseif ($subnetmask < 32 && $subnetmask >= 24)\n\t\t\t{\n\t\t\t\t$start = $subnetip[3];\n\t\t\t\t$check = 32;\n\t\t\t\t$top = 254;\n\t\t\t\t$checkip = $explodeip[3];\n\t\t\t} elseif ($subnetmask < 24 && $subnetmask >= 16)\n\t\t\t{\n\t\t\t\t$start = $subnetip[2];\n\t\t\t\t$check = 24;\n\t\t\t\t$top = 255;\n\t\t\t\t$checkip = $explodeip[2];\n\t\t\t} elseif ($subnetmask < 16 && $subnetmask >= 8)\n\t\t\t{\n\t\t\t\t$start = $subnetip[1];\n\t\t\t\t$check = 16;\n\t\t\t\t$top = 255;\n\t\t\t\t$checkip = $explodeip[1];\n\t\t\t} elseif ($subnetmask < 8)\n\t\t\t{\n\t\t\t\t$start = $subnetip[0];\n\t\t\t\t$check = 8;\n\t\t\t\t$top = 254;\n\t\t\t\t$checkip = $explodeip[0];\n\t\t\t}\n\t\t\t$end = $start + pow(2, ($check - $subnetmask));\n\t\t\tif ($end > $top) $end = $top;\n\t\t\tif ($checkip >= $start && $checkip <= $end)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t\t\n\t\t} else {\t\t\t\t\n\t\t\t\t\n\t\t\t// wow hard\n\t\t\t$subnet = substr($ip, 0, strrpos($ip, '.')).\".0/24\";\n\t\n\t\t\treturn $subnet;\n\t\t}\n\t}",
"private function subnet_resize ($subnetId, $subnet, $mask) {\n\t\t# save old values\n\t\t$old_subnet = $this->fetch_subnet (null, $subnetId);\n\t\t# execute\n\t\ttry { $this->Database->updateObject(\"subnets\", array(\"id\"=>$subnetId, \"subnet\"=>$subnet, \"mask\"=>$mask), \"id\"); }\n\t\tcatch (Exception $e) {\n\t\t\t$this->Result->show(\"danger\", _(\"Error: \").$e->getMessage(), false);\n\t\t\t$this->Log->write( \"Subnet edit\", \"Failed to resize subnet $old_subnet->description id $old_subnet->id<hr>\".$e->getMessage(), 2);\n\t\t\treturn false;\n\t\t}\n\t\t# ok\n\t\t$this->Log->write( \"Subnet resize\", \"Subnet $old_subnet->description id $old_subnet->id resized<hr>\".$this->array_to_log(array(\"id\"=>$subnetId, \"mask\"=>$mask)), 0);\n\t\treturn true;\n\t}",
"public static function validIpOrCidr($cidr)\n {\n if (!preg_match(\"/^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}(\\/[0-9]{1,2})?$/\", $cidr)) {\n $return = false;\n } else {\n $return = true;\n }\n\n if ($return == true) {\n $parts = explode(\"/\", $cidr);\n $ip = $parts[0];\n $netmask = '';\n\n if (isset($parts[1])) {\n $netmask = $parts[1];\n }\n\n $octets = explode(\".\", $ip);\n\n foreach ($octets as $octet) {\n if ($octet > 255) {\n $return = false;\n }\n }\n\n if (($netmask != \"\") && ($netmask > 32)) {\n $return = false;\n }\n } else if (preg_match(\"/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(\\/[0-9]{1,2})?$/\", $cidr)) {\n // Seems invalid, check if valid ipv6\n $return = true;\n }\n\n return $return;\n }",
"private function validate($id)\n\t{\n\t\tif($id > 8)\n\t\t{\n\t\t\t$this->is_valid = false;\n\t\t\t$this->error = $id.' is not a valid UCInetID';\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif(!(preg_match('/^[a-zA-Z0-9]+$/', $id , $array, PREG_OFFSET_CAPTURE)))\n\t\t{\n\t\t\t$this->is_valid = false;\n\t\t\t$this->error = $id.' is not a valid UCInetID';\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"function validate_ip($ip, $validIps)\n{\n $validIps = (array)$validIps;\n\n if (filter_var($ip, FILTER_VALIDATE_IP)) {\n $ip = ip2long($ip);\n\n foreach ($validIps as $validIp) {\n if (is_scalar($validIp)) {\n $ipParts = explode('/', $validIp);\n $subnet = ip2long($ipParts[0]);\n $size = min(isset($ipParts[1]) ? (int)$ipParts[1] : 32, 32);\n $mask = (pow(2, $size) - 1) << (32 - $size);\n\n if (($ip & $mask) === ($subnet & $mask)) {\n return true;\n }\n }\n }\n }\n\n return false;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get ancillary services of a medical center | public function getMedicalCenterServices(InstitutionMedicalCenter $institutionMedicalCenter)
{
$ancilliaryServices = $this->doctrine->getRepository('InstitutionBundle:InstitutionMedicalCenterProperty')->getAllServicesByInstitutionMedicalCenter($institutionMedicalCenter);
return $ancilliaryServices;
} | [
"function getClinicalServices() {\n return array(self::MEDONC => self::MEDONC);\n }",
"public function services_get(){\n\t\ttry {\n\t\t\t$services = $this->IM->getAll('services', array(\n\t\t\t\t'institution_id' => $this->input->get('institution_id'),\n\t\t\t));\n\t\t\t\n\t\t\t$this->response(array(\n\t\t\t\t'status' => 'TRUE',\n\t\t\t\t'labs' => ($this->input->get('json'))?json_encode($services):$services,\n\t\t\t));\n\t\t}catch(Exception $e){\n\t\t\t$this->response(array(\n\t\t\t\t'status' => 'FALSE',\n\t\t\t\t'message' => $e->getMessage(),\n\t\t\t));\n\t\t}\n\t}",
"public function getServices( $datacenter ) {\n\t\treturn $this->services[$datacenter];\n\t}",
"protected function getExtractionServices() {}",
"public function get_services_domestic() {\n\t\treturn array(\n\t\t\t'REG' => 'Layanan Reguler',\n\t\t\t'BEST' => 'Besok Sampai Tujuan',\n\t\t\t'Cargo' => 'Cargo',\n\t\t);\n\t}",
"public function getFooterServices() {\r\n\t\t$db = $this->getMapper()->getDbTable();\r\n\t\r\n\t\t// main query\r\n\t\t$select = $db->select()->setIntegrityCheck(false)\r\n\t\t\t->from(array('a' => 'po_services')\r\n\t\t)\r\n\t\r\n\t\t// get service name\r\n\t\t->joinLeft(array('c1' => 'po_attributes'), \"c1.attribute_set_id = a.attribute_set_id AND SUBSTRING(c1.code, -5) = '_name'\", array())\r\n\t\t->joinLeft(array('d1' => 'po_attribute_entity_varchar'), \"d1.attribute_id = c1.id AND a.id = d1.entity_id\", array('name' => 'value'))\n\t\t\t\n\t\t// get service owner\n\t\t->joinLeft(\n\t\t\t\tarray('u' => 'po_users'), \n\t\t\t\t\"a.user_id = u.id\",\n\t\t\t\tarray('user_name' => 'name', 'zipcode', 'location'));\r\n\t\r\n\t\t// group afterwards\r\n\t\t$select->group(\"a.id\");\r\n\t\r\n\t\t// make sure the user is active and not banned\r\n\t\t$select->where(\"u.active = 1 AND u.is_banned != 1 AND a.deleted != 1\");\r\n\t\r\n\t\t// order\r\n\t\t$select->order(\"RAND()\");\r\n\t\r\n\t\t// limit\r\n\t\t$select->limit(6);\r\n\r\n\t\t// return array\r\n\t\treturn $db->fetchAll($select)->toArray();\r\n\t}",
"function get_services() \n\t{\n $query = $this->db->get('tbl_service_master');\n return $query->result_array();\n }",
"function get_services()\n{\n\t// nmap-services equivalent table, used for portscan\n\t$services = \n\t'QlpoNDFBWSZTWb4sy/0AGvbfgEAAEAN/+D+n3EC////6YCSaAAAfQKeeQNw+vDtuqdvXS3dqR3Zubb2O4TGkCKgqIp3DA5QCqvnz'.\n\t'6u2qElJArWQgpRUPoMoK7ahNaqFUiqiGsVKhUGpggAIE0TRCmjU0PUA9TTaaINT0DIqlNQAA0AAAAACKeTUYjJAGgGgNBk0aDTCA'.\n\t'1PCBVBKnqeiAAAAAAAEmpGhFU2mUNAAAAAAACREAgjQjRKn6FAyAAGgNFAx6BpGxkLge556q5ZXiGiQR6eoskPp2l5fY4EAxlCrK'.\n\t'gXDRJjBle+F3vZD2/VMR2z/Z5LiJP5lxBkCQMTMv6uiStDnmlKzj/Scyx/9WkaSMWumCokSAkToRzBQp1mVcixAmBHs5haF0mHxJ'.\n\t'37ZSWx9eC6b3K+YFFf7EZFLO3zkSaDhtHZKFMhBTVjqX1E/Nj9GYg3pU7q+3Zjg86XmMi87Ncqz8VehFLeAfmxapwUfiLj1UypRj'.\n\t'L9tWtSNVBInC6tv5/H+X5eoQvTzYVbz9deXIzo/LIOpih03e+ymG8sgrSPMscmZ0c7DEJS7krH5+rQ+Sxlmh8fayRpj4th4hoxEr'.\n\t'NXX08I8s8fbrIo8vFFofrxn7dmyvmhaJi5f9FrfalZdV4rb7EeEYKO9pNvZ0JfiiJOPsuT89efv+T/FdEVPF22S6liGkCR+MK8lj'.\n\t'8c+QXj/0pcccdKqqqquuBDVtzuWRB7d/QlreMfj34EBWEPW/izyg8smFbtlkcxWljhHUznEF96xl+TKQL7rbUJ40d+4n1ea5y8JO'.\n\t'+cwJoKo4H2enUTmpzpTRjYK/Etz8zlyvg5S57shyO5k/gvHdrPg78CWbWosGf9SXZ8xON6hpSpDi3E0z6xRdHe0qdZygvOW5ZpRE'.\n\t'hbMVINx3BKnRBQ+bjieB1hhOcGQVhkXMRt1PrnqNt8m978xmQTW5JqIi/vv8e/y+udc1XlNsbjoReg+7I4TXnoMPPCyhW8JH6Cj5'.\n\t'KhSe4VKWMCkYmzxdE9kAwsUqRZzdviSJkd/JP+oZLYx6Sn0IbfuXWNBqCO6zNt1y0Sgc37xi9S5OO795HP7GRPIHFAJXmPo8leCZ'.\n\t'hhq/ZZhDoI948wAEP4X05Y1iWiuNu/PEOyL06pNM/Vv3AkkARQp351zzq9liCHsyhXqqm9khNHWdcNLcGINIuVWjY49BwShCFn5K'.\n\t'/KBoTI+ifJKCetQM5ZW2DmUSCMwrGMYJIMP4IE+WoPESqFjxNShTRZ3mdpDxecRplyucof74DTJ3FI8xlxd94neeN1hKT1rbxS0N'.\n\t'AhDqEaMJvo357XUllarzmc366rBn96ao1reuR0cMQuS4+wwa8R83Eg0n7bPleFxCcH1UPnsx5L8xr9G+tERFLHi6L09MNgENSGvH'.\n\t'l4Pvr2pjTTbMzWlJIQsBcztj5fq8P3Wl40NPVDQx/JFpd/4g91vIE1Xff3+fnfUB3z3E/x4D+SWKcqqhTCZTusWMEli3jKcU5iJT'.\n\t'8fxuIed+jUAfOUYIjn8v8/xmWf59tapW7tPVuXnUG1C2oGnqaatT2ApubW3Lm2XjD9xxTFBDvR+Ts+rbO7oUUrUzA9hGNHVukWCj'.\n\t'EbJzdV4d2wXYw0QRcQQSZz1swGdNYpDlbCOEEkg8bTzQlbXRHkq1WvI7EAjTPa5L9tay9dkUZYkQyksQdkkm8KBBEzNd3fmDD03b'.\n\t'GahCjmWkGiexONAXBs3bvUOzWSMN9srw96yPeAEvyXJCt5XVGnNjvVLRqPMWULfUlevCNQnTO2QKoXZGPVyx2arTgzYUZEQroPiM'.\n\t'PlpQJy1NpyRySV0jRpMHxZDej/P+mxDJcle2R/LS2fAgE/M2e6IlLnmPHUzLFDhi1TM0abFSkylMzLYS6MEC71nq7dJmXFo19/+Z'.\n\t'LPLNYmSKTKR6YJKwjrVt23vTMXtXNN+rXYNpbNaZhmmkgma4cKdcZuUeHDQBZpJNiSMTzms0rm0IDaF15sSKQWQwgVqpKQFJxCSZ'.\n\t'1e60xFedsIIYjDEQ0Is0Cm+qZrXELLAKn3jaFZCjUPeR8FjnHVcsAHzEEEnx6PamdBQ3lZswdPoiCQAJIcK3N0B4AX6e4SSOIToj'.\n\t'NEX8bF6NahOUWImIJjVQoTuSbVbsGMZuzM6RBGXG0T13ZNnt0hgxRESzi8lfBjN82OUiJmPi9/05QX8Gft48c/jmH3IdfR21X9+/'.\n\t'8mCrEffuEHxMCA+hnv5+7Y+6xbFepSKNE+JJvFjDwIg7ADww1VTAxahd36ZSN3sdXoq81BMaHN38vGpNdcrHCt5zDtAVFZE3gt0P'.\n\t'BHugPw99y0I2zvZQUUVYnMSges75e6pIoCyRQOYL3RrHW8nm126xvKGSeyIvpz9hrbiMz4EWYhjlIrG4ioDBFlTFT1sTorGsVnIk'.\n\t'VCXnmp2vVuM21Ylfidq8ffn48Ax9y7/zjvjxF3z4ij/IcDUDjqRBCBAZQwmfR65grrmqSXp0esbvMQtAKtu6K5setrQMBASxzA5V'.\n\t'Ei2ljJEWGPBdkggkhRTFY2exeLzeRFRRVRrG8TLA4lOnwU0MCbsIg6RAIJURZTqGH+uhhJILHjKqiqb1TmlYkViIqMiogKqJIqIg'.\n\t'ILGMRCKKRgwUbf2t+F1XUXBiExIZeMVfxx3r+2/dOW5cX3Xdk3nxy1FVVbd0kCRjy2qxrSrYhzRLjJ5h6PZJHFkJP0dyPtB3eu2x'.\n\t'pSqQqdky9VUGREHLSieGPSfHGG7GKKqiovKlLq65jacxC/yKIIJBBJyLLheXEUWmYmwSQojpHOGx3VBi1GNeTMQ7yUsUTG+wSI0A'.\n\t'yCSQRqSQQZMTv1RwkG0gCSIcQzDGa1IEEkgnNyXkVueXiSCaVnV3nG73qr0orEVXF7NYu9VKRSCoikVYKKCxGLAQVIxixiCKxGRE'.\n\t'RIIMSMigMTfO67NdcrrkEya6EqciqMvtMB4InQ92puNNQ0kyAmZpSZDaEHyVEZSjGIRRJoLibV48PXzg/ubssOZ8M5jiq8mosRW/'.\n\t'N422bry1rxzyZdj52mIqiDnjvp6svXNucKvv1QrF23rWcJ0hBAgrCI4wSCWst4hkBEEHwcRECEikTIMmpUkiCfIj0hqNzKp+Hyfe'.\n\t'ar0ngEEyjlUANuTFuzEfe4H0PgZY7awgnEFEYIwFFiqRVkgskYCQfeJ8BN/TRORMM1zqtUSy+x6qV4NGA1ZgUt4jVLdDlbkiB1Qb'.\n\t'jELXSacvJzN/O7/qgRfEDG2NkM3vqszxvSsbXAHa18Us3duj4g43EDLxZTZiPMhRL+WHbQg5R0JEsPfPfEewSFbWYcQMwJyRA9JZ'.\n\t'iSYNox6MpkZZGKgZv5YzlJp2FBwaxmdkCo1rHLvrvvJ2goEUUJIsJE1nVdb5dVXdsnwi2tN2ysmzL2EFbGVT0ceeoIruL6qqZeJS'.\n\t'Xt6unvr7/P8838AkkkkEkohfhth/hMDvuifq6+6yOUyQdX43WTV4Q/HCLsiqs07XtZcx6ndkAF7lOkfCovIT8FiKizgld56zjHOX'.\n\t'vSoqqs5rvq7ZXKcUvffOcvjNc71d4ZTJFICySAoSs767Tq1FXF6qpWocrFzeRNLOjZ7phCGZozj4qRFmqJB6po6r1wVGrSK3dW6a'.\n\t'+XxJHrJILMeDe8D8PIt3iwLwPrWcswwcjcWZDK6VWdmsR7g+YUnZuN1ESUzdtXRFHYg0LtdxXlcTDSq51t64EqSACfeAHt6ypJi+'.\n\t'V70dW5eTNvJUGLYTxkRS1LS6m5Zx5GjptrMRD3p47h2lmknqxx02X9/dfV/SFuSMk/KXmRv1fzqoq34D9eK5UunW1dcKbuoUPpfY'.\n\t'e3AzeEQuUpUXhVSRLevDKzGUJEY0hKYJShCU9Vc0aJFokokEkEGtWSUvS1G4S6jytyd37UAAHtPvDaF2xX1Vdy+BltZUusiWfLj7'.\n\t'tmpnjlNi3Tq6qNW2okRhzmFaRqur3R12DfX807nxGKK3q2RXhZAJyeN5toap1hm9gQCTAh+xHRQSCC3RuekTsoucwlTjk0Ms5pEo'.\n\t'3JuQdfgheVgQIyiCJu27tpVnJIsKTui1QQcpOUYU3eZMirrchUUhEa9ytfl45jozdF9XaKFuCPJYKEqV6Q0mzl8hz9ZW3F1Q3tAh'.\n\t'IUYER69QuXhvgl3URcMWaabrC5OybdCHIs26grQtYoVrj2OxXqNvdQhcrxI1n1DBatHV3pupAt+AWadCe7M1Y7A2liAFS+DfR8ti'.\n\t'xDGtG+xs3liLtxmwC1npuYxX5aDIy3d69pU8CmcTLtTu7IrtA7rlG/SnGRbsUTbF3OC2PDcNCd8o2j4St3xHt9WmhUqCSRIxJ2Db'.\n\t'tbiq5FOaTLxs4Lzw1ehOivWcF4nah0xhyJpMTkAznpCLfqUOoZgpG8FpiAioLAdmlZosNaaFJ1IKjczNNWqRFF3VOaqF0Byunwym'.\n\t'8y0Mq79nUMvWMt5ORwnp6VafmYiVcVSj4BgHH7cclCVMO9q/HzGLG0qsRkous0167wzCzJjcMG2A62huMUvdfDEa1TaoUy3s2lXB'.\n\t'bJMe0W69WegFR8w3ky7wU6WMDCKjKOkzMmZz+iQj+VnKQCYIYhJoQxIEIAkkEhIMAiQIwIkgwZIggCMCKYQJKZAgg0yEhQQg0hIS'.\n\t'pJCVUAkWSUECVQBCoEkqiECpJJGkkCpCEqoQlSEI34AAAeAGY++NK+7ajRVIr5s1Rs19KreuIfbgx93HeKuDZvEi6IW9tbhXUyHT'.\n\t'TVp31VTHCbS512k8+a1XpVUIjRUrkJUmEq4+Zbu1TuSsqjT2+y7l8aVdo4XokqlTs70roDyNIi5j3q3OV3doiCNZVb0ey6eTa57e'.\n\t'K8Lut5tM7Tu7iXH9suKCmHVm4kzMdh7N7arXhoZzrsMTseWy0pylUDOp3XGpUtzsuc19r3RnRzFXlxi0q4ulcYPxmPoqS1uByuCs'.\n\t'Osp4SL3N10pfQhuKRFDLWbeFRoN1WuSoKDFBypbt1U7uQtgEKNSqppJn0B1SvSUjFbu496Y17kLsKq4upzpUyYVAnx4rKBy6Naxq'.\n\t'v1RjmAddkZOTqvMWA4mTlPYYKgiquYjVIUy4E5LRWmaPZburruRytyJjhrbfQrSNYxalmroVl1m+w4tsRqWxsWy70WjW5FsZOQjc'.\n\t'uPZDndYpmLSsrCFjuabtc0KjsMbPY+88mOh7FDRKhiDl3uw1UUFmF4L4OOF24+tQ0sM7Y27q7t7fC8fYOEiZYOJsi2ozaSsOw07i'.\n\t'jVbio3iq7q7cppVe00pZrH6XlzKCWJPnqs7VFc7r4aGLHK6Rl3kVhCxbFRiSSPKLwuC4nFeC4eVVu3iraOx3cs4aa3FNyw6+f6/8'.\n\t'R+lv9b/YLaXbBjrtU+6kJgJYnQBOg1VTUW1pAHM00sYjrFzqgtw4kFgkoWcg4iSqIO3I2AUqGsfaHg33pkmuE0EZKAUn0uPWX+0W'.\n\t'T/C9UjGmSbaaBB/4tIjYgj7IwMOH7FvwA06f9mLDaCEK4t1ATi6Jrc2GxATe64NiDtjGEfKDcRcZ42gFvazhcPk6mDcGdytrWz3+'.\n\t'KnFgUPZ1KocDGkClmvc7SiMIhYuYlyQhOLadJ17npszevF8mv4WXSLs2aJcojvrO1CuxxJl8aIoZUKmaH5/CJSsvxQUcX5T5OzS4'.\n\t'kB8V4N5+ofoa1/21o9FzjoSLBODCeE1Ab3Fq4yosbqoQhw4cJvExb1Le/fbaFydf/W+fxfZku28sozBsKrT8RTbTPMHS6wdnV5P4'.\n\t'gznQvvIneW6Qf04C79Xy7f9iEqntd8QPTEFCkPPkRv4K4Hq8Z/78YJL8MqtUuGvE4Fc4g5EcTvVAcHOLp0WCAdkIUxU/5ubGg/3e'.\n\t'OCtoRtdRh7qlOmzhXAsKxWCv9Vlj45hJKgYLnHFwxokUJH0gloSJAgN7nGtYM9p8szlbsgef0JgEW8DuVSvPCRcNycA+98wB7bud'.\n\t'dPU4NN1JFhRmm4akxItpbTGzlkeM7ooZONkWO0WZGJc0Zc3HFb0pniN70yN0ut9+Kaja3qoRMYzzDZhwmmTtKF8MJfvELtAOSV2w'.\n\t'uVeAjynHtJB3TwDFzC0mjnJI80cYX2R0kYqpkCdQzPed52Hksb7oIEPBIRcmJA2pXvEbtZjjmt/BWGdeslZ9XpinGfOmkWcgy0/m'.\n\t'UoBHGpxIFXY6pO5hqeUEKptUlxwUhncSjCImm0bPOxH7TB1RciTwzmMSMlMkCh6uhuxK/ifc9FOXGj406VrdMpfmCRu8x3Z23hZz'.\n\t'Aedykijl8KXTjD4gs1ZSmojXaxz31Ywfkgh6hew9AcFaQUmIjQYoiCpgcxqr38jILDm8sABhCpUggKRcF5ydytOD7t2beIiPj9VS'.\n\t'wkIEW3CSZTSR68BJtIqg10xV6zpbg3n8IYDzPZA8tV+Ee+QhKmCW1XlOTTjY/e6xeV30ZjKdYnZ8hEoSoDRZZiFaLjMicbxZB2NS'.\n\t'/qEdfzAE4ok4kMFIlj1z35fwe10wADbkau5yNfrilIPjc7glIWlyggmyBlM4OMkybmEognqqrO0tfMKa/kvRWMnc8ZnnOrdyEZM9'.\n\t'dSzURXn3sjFt3AbhSOb4DleCcIQ1HQlS7n6AqTdkOGoCpPaTfg/PP5SiWfaAIL/I/uH6KM8EvyIYLQHHNYUSU+VAg8SA8ixOm7jH'.\n\t'KS4lijjAJjNupAIvCHjzOTswAvzfzy99UPNLIW0xiS3hL1qE4pDikm5SPl3oUYBgYI+gIULj6lCn0wMNYYAd2djRuegcG0bjcLID'.\n\t'MHHNoM4DAXwBO3NO7jJMt7nuI2vArBSEyxDp5+R6MXh5s0ZMf90soqTE4BHnDZgYcmjPnCc6YEmaWtkPDhGBlI/klwBUEIXsZ3Rz'.\n\t'sAiGPplcU6zdn34N77ZGFiGZoGl8Aw2uCa7ZvU72Q+d4oqBe+vzQhm9Fpwgu63mjxmAiuO3BfNzTLOw7CkvxSdeZxf3VU74jaDy2'.\n\t'8NEPomP0sEgV2rA85fckvmlpwjraaX1tRj7zV1KYVAsUqjtP5uFLQi8c48rhWbaaUlVaUX7nXqo8+ZIeO/8f4gAID8eOA+QLw+IS'.\n\t'feN37HyCVgewSGYBzwPDm2fB1O52FAkaRtABmpOVIfL4wNt7edkKPqdXfvX3qz1nqkFfwR3p2SH68m6wwczWvPn7PPW27ZeUjjqE'.\n\t'LPqh1db2v9pjbblgwCkZl5HP1uzO4bpSE8++NhgdCYgnmQ2QFMxshRDXwqw7/UM9ImPheV23te/z6mlBmt37fa0OI6YHIGbd/vPG'.\n\t'3v6Mk19c7lToHEMq0rOrFxNqL3vBJ82msA8KpTNfvvgO9a/sfM65+JlL0pSihB3kHBb6V8mIGALjHMg8Co3/UHqB+EBhFNiJ9Xaa'.\n\t'imq77arM0cyFOxahes43nDRhr1XB694s6PzGnBTAckkm/7eXQgma7s8IzBoIaktzUgb8zgUMlAh3SIr2EHX4pSdwb+EmtsqVRzMc'.\n\t'LTcqXFvfl7/uYdwWZTfoeCYcI0enyEDCu40y4zrdYjDiKW+WvQzBWhQ6q69Ge7ZwCSgCl8nYBFfQrjU4RE8XMpRe/Xle/pvB5xVF'.\n\t'nVXiPCQ9CE4k8kQO9Fvlkx0TAc28utzXaBPcxvX0Tw+C8tFgcx40YtgO3jK/IK6jiPpCu8TUC0e+IdgXjme6pMl43RwQqkA4yYg5'.\n\t'1pGYuW/MJJSOLzuFNw2I5UQebbOaXqcSYr9XWOSNHpoxhLgiBEROfqA4BPTA32IeTg56nzDLwHvfkx4G3Mltd+p8sFetHKUx5qjg'.\n\t'zNubhzEE8LPoUS7WC7o6MvvCFao38XQt57TfYnqItHjOHEbiMNYnoau4gg1eZkghfH7R88HzberZRG24wxQ9P6F4HceOaiF93hZF'.\n\t'LTetcdPpwajlpihOFA4tvExUhNt/EUleT4pWpMVOCnnNPDWuw9HSw1SYpM98kSmW5+J1zmQG0Nt6jt8wacdDCD2138uD8dp1vret'.\n\t'EQ+fBmvfzN+R+6saWsCtFSXLlrW0Qiak1iFC3NVqsZpnnXY4O9p4+r2eyQTqPTXDRhpB2GY8yjQFCILcQQynRI4NwrwCIkNUtpWQ'.\n\t'QE+yCqTdChukFYHiYivSiNInxZX66G6q1IHEHzYx2C0FnxeCeoXZSUqOgn5JAn0Jkch9rh/YP5ZnmMIPkh+gQRn2B1TLovpjXUdc'.\n\t'q94g5oM1gsjlI0LLi8OvDdyfJiBF8nSx6qS39wtmzvipapW69RmMfrj1XSuimdMFoiFhwMuvJilzBDHQYcPdv5ycX5pVFxAtgk3B'.\n\t'2ngG8j9uHB9QoOu15pbxpnmtRVDbfxxUP3PteAv89llh5Nqt8yGwu/cKVtVGXxUVuVBERy1gsuJfxEfA7zbhAY/Sez/HpR34cNze'.\n\t'Ar5pKtmWyDo/Hv9MIos5gMEN2Xvr7rX6ub24ChV9yEGGj5jTdydaDgwS5HkGT7b924iGgCK0IiZKTZgKraznkCIyQwj1jd7RlNHk'.\n\t'+B1TFOKQg4mWuljCkUqjmfeMfMr8T36L1MNL7+HlO5acofVD6f6XV4T5J0PgRMEQUwVSLjrg+1ft6FhF3zuVaBMRGkuVCDllNomx'.\n\t'9zwpjqa2/Q0WWVDivyVamua4ln8PFshQI3HygEiLNTcNhazaiGBdu2lY8B9vWMDixgVzKXD4KeP1jrCMY34jewfDF2xw7weYInlp'.\n\t'HxMff6G4IJHtKDOHAY8zvq8REqEEvqDhvlDg5mDHQugvs/bvTWjNJv+s7DsCZcfy47hFBxWsJGdoUNHy4aUYcDaCRlnLQpaIgKnq'.\n\t'KcxD8RC8AyHw1TyUqU3meFv64/uobTY/FIHqu3Qeyi3Ru5e69W8TIu17NqkG9YIc53Ile3eCIpDoPqYgBWX1I9xzR9I0wzIARNXO'.\n\t'upMXAq6UhLdEBQNf22rsZqXpc/b/HYlOirAHjhhjteY9+7ZMvGYYxikMlCBhQr0LqhthHXlvzAfFRvigDAPmdCcRALfrfntCRDB/'.\n\t'WqVtOwTaTac0KZDHFCwjBaERMO0UlZid4WBsG2MaYmArOEWUcbG8MUqW2UdL0QkmZx8PgXeZUXzRXrVE3BQ2Skjel805SaRrNl+u'.\n\t'UqCO7eV7tuM56hHGxQz6m8WK07870xFhS76K7oeJxq8p++tc/czMyEq22neNDMLqj4wbhNqDNd7/F6aHxubzshYv2py1LW166+a6'.\n\t'48aEcf0oAEAJOntNpXppMQ9iNfaUUPQBSdBsKi7GkfSPR7SFZoDBs5iOvrPnnHi92oMKClTwzce1reNW9I/ajOUbzS6gybbJxe38'.\n\t'd/GtnvB8NseUMi4bS+78lPYvFzsUV5IO0OZzd+gp5qxhXvz87cWO2zhbnskk7/eSlnW4md6KY3e+LLvYOfTKVrJIGd5kkaONRy+V'.\n\t'iL1pTlVrCgQM47XNvXNyJy2a+p2MPseUkQKBO3AK5M/CVE4yMbYkigc/wPpG1mbvlTkYMat02CYv8WyUg8EGcJUEVf91otJB8LTR'.\n\t'Vc8sNUjgvfIKKl20KsbAICQnDyQcthW2WFUZxp1I3QfBHGs9zrVplDxe7V8cTabZLEpIiPToomznQ0rRIirfpzima/Ofqz4+ey/d'.\n\t'81g+bMCFYAJjn3jrU08goUQJGbh5orOwTpqetO33hKE8QsyIU/Bue6ColAiWuzNaPz6vXvntOYI7cSzamN4AifVM+GRSrO45nC74'.\n\t'LTp93ZWrzcp5ajjm0FFiVpRHHCbZ41W2MPVxgRDMe1LLknf1BEo+axpmELZg5IQpXYkJ11oY4QZuJxrJ9Knugqlpu11hpeztF2/N'.\n\t'GpjPb1o4g6dOYhsBts61zql7Q6hFuHlka8kYF42chWkNBb4B0DM+cpLs/CSlEZepUXpznWry4TsoEbwEwAO5iO9xmiYqAYHg2jhs'.\n\t'H28Cel0KtdbuILUfPsqoPW/okXbHfnrqkmAwSnc10HCiHjFcXq8hQEQkHHwaP0IXIQWYONAG3nMoL2NU6z6uMjhIknK7IpSyPLSl'.\n\t'h0/OxzIx7U+WMYyYMTIYotrM4t48EzGs4MOdslUIeRxbw7lKK6i0QXQmcUjznBJ243lBfFY/N72DdVxGLEW689/z5l9CNSEdcN0Z'.\n\t'MK8L65KlfIZ/CuwYhQnkJEAvHpQGnUwYlt9v57dXn7A3pezum8iCemkRSIM/rmfrx8S8OF+90nN4U0QR6Yt5KeqS/mADj1f4lPye'.\n\t'zIEKZBIG6RBYKiTg72NFzA7vcOWNzBpQkjBw6+ahJDDCyOLQdsU/3/H/4u5IpwoSF8WZf6A=';\n\n\treturn unserialize(bzdecompress(base64_decode($services)));\n}",
"public function getAllairlineServicesDetails()\r\n {\r\n $this->load->model('airline_services_model');\r\n\r\n $allgetAllairlineServicesDetails = $this->airline_services_model->select('airline_service');\r\n\r\n if(null != $allgetAllairlineServicesDetails && $allgetAllairlineServicesDetails != \"\")\r\n {\r\n return $allgetAllairlineServicesDetails;\r\n } \r\n\r\n }",
"public function centers()\n {\n $st = $this->db->prepare(\"SELECT collecting_center.center_id, collecting_center.center_name, district.ds_name FROM collecting_center INNER JOIN district ON collecting_center.district_id = district.district_id\");\n $st->execute();\n return $st->fetchAll();\n }",
"public function get_services_domestic() {\n\t\treturn array(\n\t\t\t'REG' => 'Regular Service',\n\t\t\t'ECO' => 'Economy Service',\n\t\t\t'ONS' => 'Over Night Service',\n\t\t\t'SDS' => 'Same Day Service',\n\t\t\t'HDS' => 'Holiday Services',\n\t\t\t'TRC' => 'Trucking Service',\n\t\t);\n\t}",
"public function services() {\n $req = $this->curl_req(\"{$this->shodan_shodan}/services?key={$this->apikey}\");\n return json_decode($req, RETURN_TYPE);\n }",
"function discovery_get_services($identifier, $openid = FALSE) {\n $identifier = discovery_normalize($identifier);\n $url = discovery_get_url($identifier);\n \n $xrds = discovery_get_xrds($url);\n\n if ($xrds) {\n return discovery_parse_xrds($xrds);\n } else {\n if ($openid) return discovery_get_openid_services($url);\n return array();\n }\n}",
"function getCentersById() {\n\t\tif ( !$this->aranax_auth->is_logged_in() || !$this->aranax_auth->has_access() ) {\n\t\t\tredirect(\"unauthorised\");\n\t\t}\n\t\telse {\n\t\t\t$centers_val = $this->centersmodel->getCentersValueById($this->uri->segment(3));\n\t\t\tforeach($centers_val as $center_val) {\n\t\t\t\techo $center_val->center_name.','.$center_val->center_address.','.$center_val->center_phone.','.$center_val->center_email.','.\n\t\t\t\t$center_val->center_header.','.$center_val->center_footer;\n\t\t\t}\n\t\t\t//echo json_encode($department_val);\n\t\t}\n\t}",
"public function get_c_services(){ return $this->c_services; }",
"public function services($center)\n {\n $template_list = GenericTemplate::create()->addImageAspectRatio(GenericTemplate::RATIO_HORIZONTAL);\n\n foreach ($center->services as $service) {\n $url = null;\n\n if ($service->thumbnail)\n $url = env('AWS_URL') . '/' . $service->thumbnail;\n else\n $url = 'https://eshangazi.sfo2.digitaloceanspaces.com/public/item-category-thumbnails/6N9wsmAiiTlXkZicoBYMXHaZ7kGJpQb2j4YzwzMc.jpeg';\n\n $template_list->addElements([\n Element::create($service->name)\n ->subtitle($service->description)\n ->image($url)\n ->addButton(ElementButton::create('Fahamu zaidi')\n ->payload($service->name)->type('postback'))\n ]);\n }\n\n return $template_list;\n }",
"abstract public function getNeededServicesList();",
"public function get_service(){\n\t\t\t\n\t\t\treturn $this->data_map->get_service();\n\t\t\t\n\t\t}",
"public static function getServices()\n {\n \t$results = array();\n \t$services = auth()->user()->accounts()->select('service_id')->groupBy('service_id')->get();\n\n\t\tforeach($services as $service) {\n\t\t\tarray_push($results, Service::find($service->service_id));\n\t\t}\n\n\t\treturn $results;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update ES index of this business | public function updateIndex()
{
$indexer = new BusinessIndexer($this);
$indexer->index();
} | [
"public function updateIndex()\n {\n return $this->getIndexRepository()->update($this);\n }",
"public function updateIndex()\n\t{\n\t\t$params = $this->getBasicEsParams();\n\t\t// By default all writes to index will be synchronous\n\t\t$params['custom'] = ['refresh' => true];\n\n\t\t// Get our document body data.\n\t\t$params['body']['doc'] = $this->getIndexDocumentData();\n\n\t\treturn $this->getElasticSearchClient()->update($params);\n\t}",
"public function updateIndex() {\n $this->index->commit();\n $this->index->optimize();\n }",
"public function updateIndex()\n {\n $this->index->commit();\n $this->index->optimize();\n }",
"public function update_indexables()\n {\n }",
"public function updateIndex()\n {\n if ($this->es_index_helper) {\n call_user_func($this->es_index_helper, $this);\n }\n }",
"public function index_put()\n {\n }",
"public function triggerReindex()\n {\n if (!$this->owner->ID) {\n return;\n }\n\n $id = $this->owner->ID;\n $class = $this->owner->ClassName;\n $state = SearchVariant::current_state($class);\n $base = DataObject::getSchema()->baseDataClass($class);\n $key = \"$id:$base:\" . serialize($state);\n\n $statefulids = array(array(\n 'id' => $id,\n 'state' => $state\n ));\n\n $writes = array(\n $key => array(\n 'base' => $base,\n 'class' => $class,\n 'id' => $id,\n 'statefulids' => $statefulids,\n 'fields' => array()\n )\n );\n\n SearchUpdater::process_writes($writes);\n }",
"public function update()\r\n {\r\n $body = $this->getBody('PUT');\r\n $client = $this->initialize();\r\n # set elastic query\r\n $params = [\r\n 'index' => $body['database'],\r\n 'type' => $body['table'],\r\n 'id' => $body['key'],\r\n 'body' => [\r\n 'doc' => $body['fields']\r\n ]\r\n ];\r\n\r\n # update\r\n $response = $client->update($params);\r\n\r\n # set version\r\n $result = ['version' => $response['_version']];\r\n\r\n # return result\r\n $this->result(true, $result, null, null);\r\n }",
"private function _updateIndexes()\n\t{\n\t\t$class = get_called_class();\n\t\tforeach($this->_data as $k => $v)\n\t\t{\n\t\t\tif(@in_array($k, $class::$_indexes))\n\t\t\t{\n\t\t\t\t$f = new Factory();\n\t\t\t\t$f->insert()\n\t\t\t\t\t->table('indexes')\n\t\t\t\t\t->fields(array(\n\t\t\t\t\t\t\t'id',\n\t\t\t\t\t\t\t'name',\n\t\t\t\t\t\t\t'value',\n\t\t\t\t\t\t\t'object',\n\t\t\t\t\t\t\t'objectType',\n\t\t\t\t\t\t\t'user'\n\t\t\t\t\t\t\t\n\t\t\t\t\t))\n\t\t\t\t\t->values(array(\n\t\t\t\t\t\t\t'',\n\t\t\t\t\t\t\t$k,\n\t\t\t\t\t\t\t$v,\n\t\t\t\t\t\t\t$this->_id,\n\t\t\t\t\t\t\t$this->_type,\n\t\t\t\t\t\t\t$this->_user\n\t\t\t\t\t))\n\t\t\t\t\t->onDuplicateUpdate(array(\n\t\t\t\t\t\t\t'value' => $v\n\t\t\t\t\t));\n\t\t\t\t\t\n\t\t\t\tCoreDB::query($f);\n\t\t\t}\n\t\t}\n\t}",
"public function updateIndex()\n {\n if (isset($this->name)) {\n $this->normalize();\n exec($this->path . \"bin/indexer --rotate \" . $this->Dname . \" --config \" . $this->path . \"bin/sphinx.conf\", $o);\n print_r($o);\n } else {\n exec($this->path . \"bin/indexer --rotate --all --config \" . $this->path . \"bin/sphinx.conf\", $o);\n print_r($o);\n }\n }",
"public function rebuildIndex()\n {\n $this->elastic->deleteIndex(self::INDEX);\n $this->elastic->addIndexCompanion(self::INDEX);\n }",
"public abstract function reindex(): void;",
"public function updateSearchIndex()\n{\n SearchIndexQuery::create()\n ->filterByQuestionId($this->getId())\n ->delete(); \n \n // create a new entry for each of the words of the question\n foreach ($this->getWords() as $word => $weight)\n {\n $index = new SearchIndex();\n $index->setQuestionId($this->getId());\n $index->setWord($word);\n $index->setWeight($weight);\n $index->save();\n }\n}",
"public function updateSearchIndex()\n {\n $searchIndex =\n $this->getFullName()\n . ' '\n . $this->getEmail();\n \n $this->setSearchIndex($searchIndex);\n }",
"function rebuild_index() {\n FWP()->indexer->index();\n exit;\n }",
"function hook_search_api_index_reindex(SearchApiIndex $index, $clear = FALSE) {\n db_insert('example_search_index_reindexed')\n ->fields(array(\n 'index' => $index->id,\n 'update_time' => REQUEST_TIME,\n ))\n ->execute();\n}",
"public function doReindex()\n {\n $this->pushToSolr($this->owner);\n }",
"public function optimizeIndex()\n {\n // either open or create the index\n $this->index = $this->openIndex(APPLICATION_PATH . '/data/search/jobs');\n $this->index->optimize();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Html Helper charset function Return a valid html charset meta tag | function html_charset() {
return html__output('<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />');
} | [
"public static function charset()\n {\n \tHTML::$attributes['charset'] = \\Mooo\\System\\Core\\Mooo::get_charset();\n \t\n \treturn '<meta ' . Html::compile() . '>';\n }",
"protected function charsetMetaTag()\n\t{\n\t\treturn \"<meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html\" . ((Config(\"PROJECT_CHARSET\") != \"\") ? \"; charset=\" . Config(\"PROJECT_CHARSET\") : \"\") . \"\\\">\\r\\n\";\n\t}",
"function charset_meta() {\n\techo '<meta charset=\"utf-8\">' . \"\\n\";\n}",
"public function get_charset () {}",
"public function getCharset();",
"protected function create_charset_element() {\n\t\treturn AMP_DOM_Utils::create_node(\n\t\t\t$this->dom,\n\t\t\tTag::META,\n\t\t\t[\n\t\t\t\tAttribute::CHARSET => Document::AMP_ENCODING,\n\t\t\t]\n\t\t);\n\t}",
"public abstract function getCharset();",
"function get_meta_charset($meta_tags) {\n foreach ($meta_tags as $meta_tag) {\n foreach ($meta_tag as $attr => $value) {\n if (strtolower($attr) == 'charset') {\n return normalise_encoding($value);\n }\n }\n }\n // Not found:\n return FALSE;\n}",
"public function getCharset() : string\n {\n return $this->getContentType(true)['charset'];\n }",
"public static function renderCharset($return = false)\n {\n $charset = self::getCharset();\n $tag = null;\n if(is_string($charset))\n {\n $tag = (new HTMLTag(\"meta\", false, self::getEncodingXHTML()))\n ->setAttribute(\"charset\",$charset);\n }\n\n if($return)\n {\n return $tag;\n }\n\n echo $tag;\n return self::getInstance();\n }",
"public function trigger_charset() {\n echo '<meta charset=\"' . $this->charset . '\" />';\n }",
"function print_theme_charset()\n{\n\techo '<meta charset=\"' . get_bloginfo('charset') . '\" />';\n}",
"public function getAcceptCharset(): string\n {\n return $this[$this::ACCEPT_CHARSET] ?? '';\n }",
"public function getCharset()\r\n {\r\n return $this->charset;\r\n }",
"public function getContentTypeCharset(): string\n {\n $charset = strtoupper($this->charset);\n if (array_key_exists($charset, $this->contentTypeCharset)) {\n return strtoupper($this->contentTypeCharset[$charset]);\n }\n\n return strtoupper($this->charset);\n }",
"function atkGetCharset()\n{\n\treturn atkconfig('default_charset',atktext('charset','atk'));\n}",
"public function getCharset()\n {\n return $this->response->getCharset();\n }",
"public function charset()\n {\n return $this->_charset;\n }",
"function get_charset($language) {\n\n\tglobal $db, $cache2;\n\n\t$language = $cache2->getLanguage($language);\n\treturn ifr($language['contenttype'], 'ISO-8859-1');\n\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the row of .env file by given key | private function getRow(string $key): ?string
{
foreach ($this->envContent as $index => $row) {
if (preg_match('/^' . $key . '/', $index)) {
return $key . '=' . preg_quote($row, '/');
}
}
return null;
} | [
"public function get($key)\n {\n if (isset($this->envData[$key])) {\n return trim($this->envData[$key], \"\\\"\"); // Remove surrounding double quotes if present\n }\n return null; // Return null if the key is not found\n }",
"public static function get($key)\n {\n self::load();\n return getenv($key);\n }",
"private function readKeyValuePair(string $envFileContent, string $key): ?string\n {\n // Match the given key at the beginning of a line\n if (preg_match(\"#^ *{$key} *= *[^\\r\\n]*$#uimU\", $envFileContent, $matches)) {\n return $matches[0];\n }\n\n return null;\n }",
"public static function readfile() {\n $env_file = implode(DS, [\n static::$config['config_path'], \n static::$config['env_dir'], \n static::$config['env_key'],\n ]);\n $env =@ trim(fgets(fopen($env_file, 'r')));\n if (empty($env)) {\n throw new \\Exception(\"File does not exist or it is empty: $env_file\");\n }\n return $env;\n }",
"public function getEnvironmentVariable(string $key): string;",
"public function readKeyValuePair(string $envFileContent, string $key): ?string\n {\n // Match the given key at the beginning of a line\n if (preg_match(\"#^ *{$key} *= *[^\\r\\n]*$#uimU\", $envFileContent, $matches)) {\n return $matches[0];\n }\n\n return null;\n }",
"private static function getValueFromFile($file, $key) {\n $configs = ConfigUtil::parseConfigFile($file);\r\n return $configs[$key];\n }",
"public function getValue($key)\n\t{\n\t\treturn array_get($this->getDeploymentsFile(), $key, false);\n\t}",
"public static function getScriptsConfigValue($key, $file = FALSE) {\n if (getenv('USE_ENV_CONFIG') && empty($file)) {\n return getenv($key);\n }\n if (empty($file)) {\n $file = '../scripts/os2subsites_provision/config.sh';\n }\n $complete_command = 'bash -c \\'source ' . $file . ' && echo $' . $key . '\\'';\n exec($complete_command, $op, $return_var);\n return isset($op[0]) ? $op[0] : NULL ;\n }",
"public function getEnvVar($key) {\n $key = implode(\"/\", $this->_EnvStack). \"/\" . $key;\n if(array_key_exists($key, $this->_EnvVars)) {\n return $this->_EnvVars[$key];\n }\n return false;\n }",
"abstract public function getEnvironmentKey();",
"public function read($key, $default = null) {\n\t\t$value = env($key);\n\t\tif ($value !== null) {\n\t\t\treturn $value;\n\t\t}\n\n\t\t$value = Configure::read($key);\n\t\tif ($value !== null) {\n\t\t\treturn $value;\n\t\t}\n\n\t\treturn $default;\n\t}",
"public function readConfigData($key){\n\t\tglobal $configFileName;\n\t\t$ini_array = parse_ini_file($this->configFileName);\n\t\treturn $ini_array[$key];\n\t}",
"public static function requireKeyfile($env)\n {\n $env = is_array($env) ? $env : [$env];\n\n foreach ($env as $var) {\n if (!getenv($var)) {\n throw new \\RuntimeException(sprintf(\n 'Please set the \\'%s\\' env var to run the tests',\n $var\n ));\n }\n\n $path = getenv($var);\n if (!file_exists($path)) {\n throw new \\RuntimeException(sprintf(\n 'The path \\`%s\\` specified in environment variable `%s` does not exist.',\n $path,\n $var\n ));\n }\n }\n }",
"private static function readEnvFile() {\n\t\t$targetFiles = array(\n\t\t\tpath('.env')\n\t\t);\n\n\t\tforeach ($targetFiles as $targetFilePath) {\n\t\t\tif (file_exists($targetFilePath) && is_readable($targetFilePath)) {\n\t\t\t\tstatic::injectDotEnvString(file_get_contents($targetFilePath));\n\t\t\t}\n\t\t}\n\t}",
"function load_env($path){\n\nif(!is_readable($path)){\n return false;\n}\n\n$lines = file($path,FILE_IGNORE_NEW_LINES |FILE_SKIP_EMPTY_LINES);\n\nforeach($lines as $line){\n $_ENV[trim(explode(\"=\",$line)[0])] = trim(explode(\"=\",$line)[1]);\n}\n\nreturn true;\n}",
"public static function get($key)\n {\n if (empty(self::$_config)) {\n self::$_config = require_once APP_CONFIG_FILE;\n }\n return (array_key_exists($key, self::$_config) ? self::$_config[$key] : null);\n }",
"function env($setting) {\n $settings = json_decode(file_get_contents(PROJECT_ROOT . \"/env.json\"), true);\n if(isset($settings[$setting])) {\n return $settings[$setting];\n } \n }",
"function getParameter($key, $default = null) {\n $keyFile = $key . 'File';\n if (!empty(getenv($keyFile))) {\n return file_exists($keyFile) ? file_get_contents($keyFile) : $default;\n }\n\n // Getenv returns an empty string for non-existant variables (Y U NO null?).\n return getenv($key) ?: $_GET[$key] ?? $default;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Templating function. Displays a post gallery. | function the_gallery( $post_id = null )
{
post_gallery()->{'_c_void_GalleryController@show'}( $post_id );
} | [
"public function gallery() {\n\t\t$c = 1;\n\t\t$columns = $this->settings['columns'];\n\t\t$default_button_text = $this->settings['default_button_text'];\n\t\t$blocks = md_post_meta( array( 'gallery_blocks', 'blocks' ) );\n\t\t$title = md_post_meta( array( 'gallery_blocks', 'title' ) );\n\t\t$text = md_post_meta( array( 'gallery_blocks', 'text' ) );\n\t\tinclude( 'template.php' );\n\t}",
"public function gallery()\n {\n $posts = Post::where('public', true)->orderByDesc('created_at', 'DESC')->simplePaginate(50);\n\n return view('post/gallery', [\n 'posts' => $posts,\n ]);\n }",
"function ipress_loop_content_gallery() {\n\t\tget_template_part( 'templates/loop/content-gallery' );\n\t}",
"public function gallery()\n\t{\n\t\t$this->data['heading_title'] = $this->config['site_name'].' | Gallery';\n\t\tRequest::session()->put('active_menu', 'gallery');\n\t\t$this->data['modules'][] = app('App\\Http\\Controllers\\ModulesController')->pinterest($visible = 1);\n return view('pages.gallery', $this->data);\n\t}",
"private function show() {\n\t\tglobal $MEDIA_DIRECTORY, $controller, $WT_TREE;\n\t\t$gallery_header_description = '';\n\t\t$item_id = webtrees\\Filter::get('album_id');\n\t\t$controller = new webtrees\\Controller\\PageController();\n\t\t$controller\n\t\t\t->setPageTitle(webtrees\\I18N::translate('Picture galleries'))\n\t\t\t->pageHeader()\n\t\t\t->addExternalJavaScript(WT_STATIC_URL . WT_MODULES_DIR . $this->getName() . '/galleria/galleria-1.4.2.min.js')\n\t\t\t->addExternalJavaScript(WT_STATIC_URL . WT_MODULES_DIR . $this->getName() . '/galleria/plugins/flickr/galleria.flickr.min.js')\n\t\t\t->addExternalJavaScript(WT_STATIC_URL . WT_MODULES_DIR . $this->getName() . '/galleria/plugins/picasa/galleria.picasa.min.js')\n\t\t\t->addInlineJavaScript($this->getJavaScript($item_id));\n\t\t?>\n\t\t<div id=\"gallery-page\">\n\t\t\t<div id=\"gallery-container\">\n\t\t\t\t<h2><?php echo $controller->getPageTitle(); ?></h2>\n\t\t\t\t<?php echo $gallery_header_description; ?>\n\t\t\t\t<div style=\"clear:both;\"></div>\n\t\t\t\t<div id=\"gallery_tabs\" class=\"ui-tabs ui-widget ui-widget-content ui-corner-all\">\n\t\t\t\t\t<ul class=\"ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all\">\n\t\t\t\t\t<?php \n\t\t\t\t\t\t$item_list = $this->getAlbumList();\n\t\t\t\t\t\tforeach ($item_list as $item) {\n\t\t\t\t\t\t\t$languages = $this->getBlockSetting($item->block_id, 'languages');\n\t\t\t\t\t\t\tif ((!$languages || in_array(WT_LOCALE, explode(',', $languages))) && $item->album_access >= webtrees\\Auth::accessLevel($WT_TREE)) { ?>\n\t\t\t\t\t\t\t\t<li class=\"ui-state-default ui-corner-top <?php echo ($item_id == $item->block_id ? ' ui-tabs-selected ui-state-active' : ''); ?>\">\n\t\t\t\t\t\t\t\t\t<a href=\"module.php?mod=<?php echo $this->getName(); ?>&mod_action=show&album_id=<?php echo $item->block_id; ?>\">\n\t\t\t\t\t\t\t\t\t\t<span title=\"<?php echo webtrees\\I18N::translate($item->album_title); ?>\"><?php echo webtrees\\I18N::translate($item->album_title); ?></span>\n\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t<?php \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</ul>\n\t\t\t\t\t<div id=\"outer_gallery_container\" style=\"padding: 1em;\">\n\t\t\t\t\t<?php \n\t\t\t\t\t\tforeach ($item_list as $item) {\n\t\t\t\t\t\t\t$languages = $this->getBlockSetting($item->block_id, 'languages');\n\t\t\t\t\t\t\tif ((!$languages || in_array(WT_LOCALE, explode(',', $languages))) && $item_id == $item->block_id && $item->album_access >= webtrees\\Auth::accessLevel($WT_TREE)) {\n\t\t\t\t\t\t\t\t$item_gallery='<h4>' . webtrees\\I18N::translate($item->album_description) . '</h4>' . $this->mediaDisplay($item->album_folder_w, $item_id);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!isset($item_gallery)) {\n\t\t\t\t\t\t\techo '<h4>' . webtrees\\I18N::translate('Image collections related to our family') . '</h4>' . $this->mediaDisplay('//', $item_id);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\techo $item_gallery;\n\t\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<?php\n\t}",
"function _dt_gallery_page_view($node, $file = NULL) {\n // If /gallery is accessed without parameters return 404.\n if (!$node) {\n return MENU_NOT_FOUND;\n }\n\n $gallery_wrapper = new DTGalleryWrapper($node);\n // If not a gallery node return 404.\n if (!$gallery_wrapper->isGallery()) {\n return MENU_NOT_FOUND;\n }\n\n $gallery = $gallery_wrapper->getGalleryItems();\n // File is in the gallery.\n if ($file) {\n if (!$current = $gallery->find($file->fid)) {\n // File not part of this gallery, potential URL hack.\n return MENU_NOT_FOUND;\n }\n }\n // If no file is set explicitly display the first as default.\n else {\n $current = $gallery->rewind();\n }\n\n $navigation = $gallery->getNavigation();\n // Build the media render array and other type specific elements.\n switch ($current->getType()) {\n case 'image':\n $media = [\n '#theme' => 'picture',\n '#uri' => $current->getUri(),\n '#style_name' => 'gallery_full',\n '#breakpoints' => picture_get_mapping_breakpoints(picture_mapping_load('gallery_full')),\n '#attributes' => [\n 'title' => $current->getTitle(),\n 'alt' => $current->getAlt(),\n ],\n ];\n // Create download link.\n $download_options = [\n 'attributes' => [\n 'class' => ['btn', 'btn--condensed', 'file__btn is-internal'],\n ],\n ];\n $download = l(t('Download photo'), file_create_url($current->getUri()), $download_options);\n break;\n\n case 'video':\n $media = file_view_file($current->getFile());\n // Videos are not downloadable.\n $download = '';\n break;\n }\n\n // Set up the variables for the template.\n $item_key = $current->getOriginalKey() + 1;\n $previous_link = !$navigation['previous'] ? FALSE : l(t('Previous'), $navigation['previous']->getGalleryItemLink($node));\n $next_link = !$navigation['next'] ? FALSE : l(t('Next'), $navigation['next']->getGalleryItemLink($node));\n // Close links back to the host node (for no js mostly).\n $close_link = l(t('Close'), url('node/' . $node->nid));\n\n // Assemble the component markup.\n $render_array = [\n '#theme' => 'gallery_overlay',\n '#previous' => $previous_link,\n '#next' => $next_link,\n '#media' => drupal_render($media),\n '#type' => $current->getType(),\n '#description' => $current->getCaption(),\n '#count' => t('!current of !total', ['!current' => $item_key, '!total' => $gallery->count()]),\n '#close' => $close_link,\n '#download' => $download,\n '#share' => '',\n ];\n\n // @TODO: Exact title pattern to be defined.\n drupal_set_title(t('Gallery of the page: !title - !current of !total', [\n '!title' => $node->title,\n '!current' => $item_key,\n '!total' => $gallery->count(),\n ]));\n\n return $render_array;\n}",
"function renderGalleries()\n\t{\n\t\tglobal $modx;\n\n\t\t// Retrieve chunks/default templates from disk\n\t\t$tpl = ($this->config['tpl'] == '') ? file_get_contents($this->config['snippetPath'] . $this->config['type'] . '/tpl.default.txt') : $modx->getChunk($this->config['tpl']);\n\t\t$item_tpl = ($this->config['itemTpl'] == '') ? file_get_contents($this->config['snippetPath'] . $this->config['type'] . '/tpl.item.default.txt') : $modx->getChunk($this->config['itemTpl']);\n\t\t$item_tpl_first = ($this->config['itemTplFirst'] == '') ? @file_get_contents($this->config['snippetPath'] . $this->config['type'] . '/tpl.item.first.txt') : $modx->getChunk($this->config['itemTplFirst']);\n\t\t$item_tpl_alt = ($this->config['itemTplAlt'] == '') ? @file_get_contents($this->config['snippetPath'] . $this->config['type'] . '/tpl.item.alt.txt') : $modx->getChunk($this->config['itemTplAlt']);\n\t\t$item_tpl_last = ($this->config['itemTplLast'] == '') ? @file_get_contents($this->config['snippetPath'] . $this->config['type'] . '/tpl.item.last.txt') : $modx->getChunk($this->config['itemTplLast']);\n\n\t\t// Hide/show docs based on configuration\n\t\t$docSelect = '';\n\t\tif ($this->config['docId'] != '*' && !empty($this->config['docId']))\n\t\t{\n\t\t\tif (strpos($this->config['docId'], ',') !== false)\n\t\t\t{\n\t\t\t\t$docSelect = '(';\n\t\t\t\tforeach (explode(',', $this->config['docId']) as $docId)\n\t\t\t\t\t$docSelect .= \"parent = '\" . $docId . \"' OR\";\n\t\t\t\t$docSelect = rtrim($docSelect, ' OR ') . ') AND ';\n\t\t\t}\n\t\t\telse\n\t\t\t\t$docSelect = \"parent = '\" . $this->config['docId'] . \"' AND \";\n\t\t}\n\t\tif ($this->config['excludeDocs'] > 0)\n\t\t{\n\t\t\tif (strpos($this->config['excludeDocs'], ',') !== false)\n\t\t\t{\n\t\t\t\tforeach (explode(',', $this->config['excludeDocs']) as $docId)\n\t\t\t\t\t$docSelect .= \"parent != '\" . $docId . \"' AND \";\n\t\t\t}\n\t\t\telse\n\t\t\t\t$docSelect .= \"parent != '\" . $this->config['excludeDocs'] . \"' AND \";\n\t\t}\n\n\t\t$phx = new PHxParser(); // Instantiate PHx\n\n\t\t$items = '';\n\n\t\t// Retrieve list of documents under the requested id\n\t\t$filter = \"published = '1' AND type = 'document' AND \" . $docSelect . \" hidemenu <= '\" . $this->config['ignoreHidden'] . \"'\";\n\t\t$result = $modx->db->select(\"id, pagetitle, longtitle, description, alias, pub_date, introtext, editedby, editedon, publishedon, publishedby, menutitle\", $modx->getFullTableName('site_content'), $filter, $this->config['gallerySortBy'] . ' ' . $this->config['gallerySortDir'],(!empty($this->config['limit']) ? $this->config['limit'] : \"\"));\n $recordCount = $modx->db->getRecordCount($result);\n\t\tif ($recordCount > 0)\n\t\t{\n\t\t $count = 1;\n\t\t\twhile ($row = $modx->fetchRow($result))\n\t\t\t{\n\t\t\t\t$item_phx = new PHxParser();\n\n\t\t\t\t// Get total number of images for total placeholder\n\t\t\t\t$total_result = $modx->db->select(\"filename\", $modx->getFullTableName($this->galleriesTable), \"content_id = '\" . $row['id'] . \"'\");\n $total = $modx->db->getRecordCount($total_result);\n \n\t\t\t\t// Fetch first image for each gallery, using the image sort order/direction\n\t\t\t\t$image_result = $modx->db->select(\"filename\", $modx->getFullTableName($this->galleriesTable), \"content_id = '\" . $row['id'] . \"'\", $this->config['sortBy'] . ' ' . $this->config['sortDir'], '1');\n\t\t\t\tif ($modx->db->getRecordCount($image_result) > 0)\n\t\t\t\t{\n\t\t\t\t\t$image = $modx->fetchRow($image_result);\n\t\t\t\t\tforeach ($image as $name => $value)\n\t\t\t\t\t\t$item_phx->setPHxVariable($name, trim($value));\n\t\t\t\t\t$item_phx->setPHxVariable('images_dir', $this->config['galleriesUrl'] . $row['id'] . '/');\n\t\t\t\t\t$item_phx->setPHxVariable('thumbs_dir', $this->config['galleriesUrl'] . $row['id'] . '/thumbs/');\n\n\t\t\t\t\tforeach ($row as $name => $value)\n\t\t\t\t\t\t$item_phx->setPHxVariable($name, trim($value));\n \n // Get template variable output for row and set variables as needed\n $row_tvs = $modx->getTemplateVarOutput('*',$row['id']);\n\t\t\t\t\tforeach ($row_tvs as $name => $value)\n\t\t\t\t\t\t$item_phx->setPHxVariable($name, trim($value));\n\n\t\t\t\t\t$item_phx->setPHxVariable('total', $total);\n\n \t\t\t\tif(!empty($item_tpl_first) && $count == 1){\n \t\t\t\t$items .= $item_phx->Parse($item_tpl_first);\n \t\t\t\t} else if(!empty($item_tpl_last) && $count == $recordCount){\n \t\t\t\t$items .= $item_phx->Parse($item_tpl_last);\n \t\t\t\t} else if(!empty($item_tpl_alt) && $count % $this->config['itemAltNum'] == 0){\n \t\t\t\t$items .= $item_phx->Parse($item_tpl_alt);\n \t\t\t\t} else {\n \t\t\t\t$items .= $item_phx->Parse($item_tpl);\n \t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\t$count++;\n\t\t\t}\n\t\t}\n\n\t\t$phx->setPHxVariable('items', $items);\n\n\t\treturn $phx->Parse($tpl); // Pass through PHx;\n\t}",
"public function showGallery()\n {\n return view('frontend/pages/gallery');\n }",
"public function galleryScreen()\n {\n add_action('bp_template_title', array($this, 'title'));\n add_action('bp_template_content', array($this, 'displayControl'));\n bp_core_load_template(apply_filters('bp_core_template_plugin', 'members/single/plugins'));\n }",
"function vntd_post_gallery($type,$thumb_size) {\n\t\t\n\tglobal $post;\n\n\t$gallery_images = get_post_meta($post->ID, 'gallery_images', true);\n\t\n\tif(!$gallery_images && has_post_thumbnail()) { // No Gallery Images\t\n\t\t$url = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), $thumb_size);\n\t\treturn '<img src=\"'.$url[0].'\" alt=\"'.get_the_title($post->ID).'\">';\n\t}\n\t\n\techo '<div class=\"vntd-post-gallery vntd-post-gallery-'.$type.'\">';\t\n\t\t\t\t\n\tif($type == \"slider\") { // Slider Gallery\n\t\t\n\t\techo '<div class=\"flexslider vntd-flexslider\"><ul class=\"slides\">';\n\t\t\t\t\t\n\t\t$ids = explode(\",\", $gallery_images);\t\t\t\t\n\t\tforeach($ids as $id){\n\t\t\t$image_url = wp_get_attachment_image_src($id, $thumb_size);\n\t\t\techo '<li><img src=\"'.esc_url($image_url[0]).'\" alt></li>';\n\t\t}\n\t\t\t\t\t\t\t\n\t\techo '</ul></div>';\t\t\t\t\n\t\t\n\t} elseif($type == \"list\" || $type == \"list_lightbox\") {\n\t\t\n\t\t$ids = explode(\",\", $gallery_images);\t\t\t\t\n\t\tforeach($ids as $id){\n\t\t\t//global $post = $post=>$id;\n\t\t\t$image_url = wp_get_attachment_image_src($id, $thumb_size);\n\t\t\t$big_url = wp_get_attachment_image_src($id, 'fullwidth-auto');\n\t\t\techo '<div class=\"vntd-gallery-item\">';\n\t\t\tif($type == \"list_lightbox\") echo '<a href=\"'.esc_url($big_url[0]).'\" class=\"hover-item\" rel=\"gallery[gallery'.$post->ID.']\" title=\"'.get_post($id)->post_excerpt.'\"><span class=\"hover-overlay\"></span><span class=\"hover-icon hover-icon-zoom\"></span>';\t\t\t\n\t\t\techo '<img src=\"'.esc_url($image_url[0]).'\" alt>';\n\t\t\tif($type == \"list_lightbox\") echo '</a>';\n\t\t\techo '</div>';\n\t\t}\t\n\t\n\t} else {\t\n\t\t// If Lightbox Gallery\n\t\techo '<div class=\"featured-image-holder\"><div class=\"gallery clearfix\">';\n\t\t\n\t\t$ids = explode(\",\", $gallery_images);\n\t\tif($gallery_images) $id = array_shift(array_values($ids));\n\t\t$image_url = wp_get_attachment_image_src($id, $thumb_size);\n\t\t$large_url = wp_get_attachment_image_src($id, 'large');\n\t\techo '<a class=\"hover-item\" href=\"'.esc_url($large_url[0]).'\" rel=\"gallery[gallery'.$post->ID.']\"><img src=\"'.esc_url($image_url[0]).'\"><span class=\"hover-overlay\"></span><span class=\"hover-icon hover-icon-zoom\"></span></a>';\n\t\t\t\n\t\t\tif($gallery_images){\n\t\t\t\n\t\t\t\techo '<div class=\"lightbox-hidden\">';\t\t\t\t\t\t\t\t\n\t\t\t\tforeach(array_slice($ids,1) as $id){\n\t\t\t\t\techo '<a href=\"'.wp_get_attachment_url($id).'\" rel=\"gallery[gallery'. $post->ID .']\"></a>';\n\t\t\t\t}\n\t\t\t\techo '</div>';\n\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\techo '</div></div>';\n\t\t\n\t}\n\t\n\techo '</div>';\n}",
"public function galleryView() {\n $view = new View('gallery');\n $gallery = [];\n $piecesLink = $this->gallery->getPiecesLink()->fetchAll();\n foreach($piecesLink as $row):\n $links = explode(',', $row['linkPieces']);\n foreach($links as $link):\n $gallery[$row['SEC_SECTION']][] = $link;\n endforeach;\n endforeach;\n $view->generate(['gallery' => $gallery]);\n }",
"function get_post_galleries_images($post = 0)\n {\n }",
"function gallery_display($content_to_display)\n {\n \t$pattern_recog = array(\n \t \"left\" => array(\"{\",\"{\"), \n \t \"right\" => array(\"}\",\"}\"), \n \t \"center\" => array(\"{\",\"}\")\n );\n \n \tforeach ($pattern_recog as $float => $direction) {\n \t\t\n \t\t$galleryPattern = \"*\".$direction[0].\"{2}(gallery:[A-Za-z0-9_ \\-]+)\".$direction[1].\"{2}*\";\n \t\t$gallerySlugs = getFilterIds($content_to_display, $galleryPattern);\n \t\t$galleries = Array();\n \t\t\n \t\tif ( count($gallerySlugs)>0 ) {\n \t\t\t$galleriesTagged = Array();\n \t\t\t\n \t\t\tforeach ( $gallerySlugs as $slug ) {\n \t\t\t\t\n \t\t\t\t// check to see if the gallery is followed by a closing 'p' tag\n \t\t\t\t$tag_check = substr($content_to_display, strpos($content_to_display, $slug) + strlen($slug), 6);\n \t\t\t\tif (substr_count($tag_check, \"</p>\")) { $galleriesTagged[] = true; } else { $galleriesTagged[] = false; }\n \t\t\t\t\n \t\t\t\t$sploded = explode(\":\", $slug);\n \t\t\t\t$galleries[] = Galleries::FindBySlug( $sploded[1] );\n \t\t\t}\n \t\t}\n \n foreach ( $galleries as $key => $gallery ) {\n \t\t\t\n \t\t\tif ( is_object($gallery) ) {\n \t\t\t\t$replacement = '<figure id=\"js-gallery_'.$gallery->slug.'\" class=\"hcd-photo hcd-photo__'.$float.' js-gallery\" >';\n \t\t\t\t$first = true;\n \t\t\t\t\n \t\t\t\tforeach ( $gallery->get_photos() as $photo ) {\n \t\t\t\t\t\n \t\t\t\t\tif ($first) { $class=\"hcd-photo--link__show\"; $first = false; } else { $class=\"hcd-photo--link__hide\"; }\n \t\t\t\t\t\n \t\t\t\t\t$url = $photo->getPublicUrl(); \n \t\t\t\t\t$caption = cleanupSpecialChars($photo->caption); \n \t\t\t\t\t\n \t\t\t\t\t$replacement .= '<a class=\"hcd-photo--link '.$class.' js-popup\" href=\"'.$url.'\" title=\"'.$caption.'\"><img src=\"'.$url.'\" alt=\"'.$caption.'\" /></a>';\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\t$replacement .= '<figcaption class=\"hcd-photo--caption\">'.$gallery->name.' (Click for more)</figcaption></figure>';\n \t\t\t\t$content_to_display = updateContent( $content_to_display, \"*\".$direction[0].\"{2}gallery:{$gallery->slug}\".$direction[1].\"{2}*\", $replacement );\n \t\t\t\n \t\t\t} else {\n \t\t\t\t$content_to_display = \"<span class=\\\"database_error\\\">HCd>CMS Warning: Gallery “{$sploded[1]}” not found!</span> \".$content_to_display; \n \t\t\t}\n \t\t}\n \t}\n \treturn($content_to_display);\n }",
"function get_post_galleries_images($post = 0)\n{\n}",
"public static function render_gallery_navigation() {\n\t\tif ( ! self::is_post_gallery() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$nav = self::get_nav();\n\t\t$parent_post = $nav->parent;\n\n\t\twp_enqueue_script( 'post-gallery' );\n\n\t\t$context = array(\n\t\t\t'next_url' => $nav->next_permalink . '#content',\n\t\t\t'prev_url' => $nav->prev_permalink . '#content',\n\t\t\t'current' => $nav->current,\n\t\t\t'total' => $nav->total,\n\t\t\t'post_gallery_urls' => implode( ' ', $nav->attachments ),\n\n\t\t);\n\t\treturn Sprig::render( 'post-gallery-navigation.twig', $context );\n\t}",
"private function output_gallery( $atts ) {\n $data = self::get_data( $atts['username'] );\n $loop = 0;\n $content = '';\n \n foreach( $data->medias as $photo ) {\n $caption = esc_attr( preg_replace( '/\\s#\\w+/', '', $photo->caption ) );\n $src = $photo->thumbnails[3]->src;\n \n $content .= \"<a href='{$photo->displaySrc}' title='{$caption}'>\n <img src='{$src}'>\n </a>\";\n\n $loop++;\n if( $loop >= $atts['items'] ) { break; }\n }\n\n echo \"<div class='h-instafeed-gallery' data-count='{$atts['items']}'>\n {$content}\n </div>\";\n }",
"public function gallery_loop() {\n //make sure the query string is available\n global $query_string;\n\n $args = wp_parse_args($query_string);\n\n $query = array(\n 'tax_query' => array(\n 'relation' => 'OR',\n array(\n 'taxonomy' => 'post_format',\n 'terms' => array('post-format-gallery'),\n 'field' => 'slug',\n ),\n array(\n 'taxonomy' => 'category',\n 'terms' => array('gallery'),\n 'field' => 'slug',\n ),\n ),\n 'paged' => $args['paged'],\n 'post_type' => $this->post_type,\n );\n\n $this->set_query($query);\n\n $this->loop();\n }",
"public function ShowGallery()\n {\n $gallery = Gallery::all();\n return view('backend.backend-pages.gallery.admin-gallery', [\n 'gallery' => $gallery,\n ]);\n }",
"public function images_display( $type = 'default', $post = false ) {\n\n\t\t// Output a unique hidden field for settings save testing for each type of slider.\n\t\techo '<input type=\"hidden\" name=\"_envira_gallery[type_' . esc_attr( $type ) . ']\" value=\"1\" />';\n\n\t\t// Output the display based on the type of slider available.\n\t\tswitch ( $type ) {\n\t\t\tcase 'default':\n\t\t\t\t$this->do_default_display( $post );\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tdo_action( 'envira_gallery_display_' . $type, $post );\n\t\t\t\tbreak;\n\t\t}\n\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Lists all EvaluationSection models. | public function actionIndex()
{
$searchModel = new EvaluationSectionSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
} | [
"public function actionIndex()\n {\n $searchModel = new EvaluationSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function actionIndex()\n {\n $searchModel = new SectionsSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n \n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider\n ]);\n }",
"public function sections()\n {\n return $this->hasMany('Alloy\\Models\\Section', 'course_id', 'id');\n }",
"public function evaluations() {\n return $this->hasMany('App\\Evaluation');\n }",
"public function allEvaluationReport()\n {\n $data = DB::table('evaluationresults')\n ->orderBy('tid','asc')\n ->orderBy('courseid','asc')->get();\n return view('admin.all_evaluation_report')->with('data',$data);\n }",
"public function listallAction()\n {\n $em = $this->getDoctrine()->getManager();\n $section = $em->getRepository('AppBundle:Section')->findOneByTitle('Course');\n\n $entities = $em->getRepository('AppBundle:Course')->findAllSorted();\n\n\n return array(\n 'entities' => $entities,\n 'section' => $section,\n );\n }",
"public function getList()\n {\n return AssessmentModel::get();\n }",
"public function index()\n {\n return $this->expert->all();\n\n }",
"public function indexAction() {\n $em = $this->getDoctrine()->getManager();\n\n $evaluations = $em->getRepository('NoteBundle:Evaluation')->findAll();\n\n return $this->render('evaluation/index.html.twig', array(\n 'evaluations' => $evaluations,\n ));\n }",
"public function all()\n {\n return $this->work_experience->all();\n }",
"public function all() {\n return $this->app->entityManager->getRepository($this->model_name)->findAll();\n }",
"public function GetAllEnquiries()\n\t{\n\t\t$data['title'] = \"All Enquiries\";\n\t\t$data['AllEnquiries'] = $this->admin->get_all_enquiries();\n\n\t\t$this->load->view('admin/enquiryData/all_enquiries.view.php',$data);\n\t}",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $critereEvaluations = $em->getRepository('BonPlanBundle:CritereEvaluation')->findAll();\n return $this->render('EtablissementBundle:critereevaluation:index.html.twig', array(\n 'critereEvaluations' => $critereEvaluations,\n ));\n }",
"public function actionIndex()\n {\n $searchModel = new IblockSectionSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function all()\n {\n $theoryId = Category::getCategories('exam.category', 'theory');\n\n return Exam::with(['questions' => function (HasMany $query) {\n $query->getBaseQuery()->select(['id', 'uuid', 'exam_id']);\n }])\n ->where('category_id', $theoryId)\n ->where('enable', true)\n ->get(['id', 'name']);\n }",
"public function index()\n {\n $product_sections = ProductSection::all();\n return view('product_sections.product_sections',compact('product_sections'));\n }",
"public function indexAction() {\n $this->denyAccessUnlessGranted(\"ROLE_SUPER_ADMIN\");\n $em = $this->getDoctrine()->getManager();\n\n $sections = $em->getRepository('PNDynamicFormBundle:Section')->findAll();\n\n return $this->render('@PNDynamicForm/Administration/Section/index.html.twig', array(\n 'sections' => $sections,\n ));\n }",
"public function actionIndex()\n {\n $searchModel = new EstimationsSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function all()\n {\n return $this->db->query(\"select * from courses\");\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the name of the categories relation field | public function getRelationFieldName()
{
return $this->relationFieldName;
} | [
"public function getCategoryName() {\n return $this->getCurrent()->findParentRow('Yourdelivery_Model_DbTable_Meal_Categories')->name;\n }",
"public function getCategoryFields()\n\t{\n\t\treturn $this->getFields('#__jem_categories');\n\t}",
"public function getRelatedFieldName()\n {\n return $this->relatedFieldName;\n }",
"public function getCategories_reference_field()\n {\n $this->addFieldCache('categories');\n\n if (!isset($this->data['fields']['categories_reference_field']) &&\n !$this->isFieldInQuery('categories_reference_field'))\n {\n $this->loadFull();\n }\n // Still not set? It can only be null\n if (!isset($this->data['fields']['categories_reference_field'])) {\n $this->data['fields']['categories_reference_field'] = null;\n }\n\n return $this->data['fields']['categories_reference_field'];\n }",
"public function getNameAndCategory()\n {\n return '[' . $this->category->getName() . '] ' . $this->name;\n }",
"public function getCategoryName()\n {\n return $this->categoryName;\n }",
"public function getNameWithCategoryName()\n {\n return ''.$this->getCategoryName().' > '.$this->name;\n }",
"public function getCategoryName()\r\n {\r\n return $this->categoryName;\r\n }",
"public function getCategoryName()\n {\n $refUrl = explode(\"/\", $this->_redirectInterface->getRefererUrl());\n $cat_url = explode(\".\", end($refUrl));\n if (isset($cat_url)) {\n return null;\n }\n $category = $this->_categoryFactory->create();\n /** @var CategoryCollection $collection */\n $collection = $category->getCollection();\n if ($collection) {\n $collection->addAttributeToFilter('url_key', $cat_url[0]);\n $collection->addAttributeToSelect(['name', 'path']);\n }\n\n return $collection ? $collection->getFirstItem(): null;\n }",
"public function getCategoryName()\n {\n $refUrl = explode(\"/\", $this->_redirectInterface->getRefererUrl());\n $cat_url = explode(\".\", end($refUrl));\n if (!$cat_url) {\n return null;\n }\n $category = $this->_categoryFactory->create();\n /** @var CategoryCollection $collection */\n $collection = $category->getCollection();\n if ($collection) {\n $collection->addAttributeToFilter('url_key', $cat_url[0]);\n $collection->addAttributeToSelect(['name', 'path']);\n }\n\n return $collection ? $collection->getFirstItem() : null;\n }",
"public function getCategoryTranslationName()\n {\n return $this->category_translation_name;\n }",
"public function getNameCat()\n {\n return $this->name_cat;\n }",
"public function getProductCategoryName() \n {\n return $this->_fields['ProductCategoryName']['FieldValue'];\n }",
"public function getParentCategoryNameAttribute()\n {\n return optional($this->parent)->name;\n }",
"public function getRelatedName(): string\n {\n return __(Str::of($this->name)->singular()->headline()->value());\n }",
"public function getCategoryName() {\n return $this->pluginDefinition['category'] ?? '';\n }",
"public function getNome_categoria()\n {\n return $this->nome_categoria;\n }",
"public function getNomCategorie() {\n return $this->nomCategorie;\n }",
"public function getCategory(): string\n {\n return $this->category;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Use the Tbcampus relation Tbcampus object | public function useTbcampusQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinTbcampus($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Tbcampus', 'TbcampusQuery');
} | [
"public function setTbcampus(Tbcampus $v = null)\n\t{\n\t\tif ($v === null) {\n\t\t\t$this->setIdCampus(NULL);\n\t\t} else {\n\t\t\t$this->setIdCampus($v->getIdCampus());\n\t\t}\n\n\t\t$this->aTbcampus = $v;\n\n\t\t// Add binding for other direction of this n:n relationship.\n\t\t// If this object has already been added to the Tbcampus object, it will not be re-added.\n\t\tif ($v !== null) {\n\t\t\t$v->addTbcursoversao($this);\n\t\t}\n\n\t\treturn $this;\n\t}",
"public function getTuRelation ()\n {\n return $this->tu_relation;\n }",
"public function getTrancheBbna() {\n return $this->trancheBbna;\n }",
"public function getTrancheB() {\n return $this->trancheB;\n }",
"public function getTrBIrcantec() {\n return $this->trBIrcantec;\n }",
"public function bncc_components()\n {\n return $this->belongsToMany('C2Y\\BnccComponent', 'lesson_bncc_component');\n }",
"public function sumberDanaTbp()\n {\n return $this->hasMany(TbpSumberDana::class);\n }",
"public function getBab()\n {\n return $this->hasOne(RefBab::className(), ['id_bab' => 'id_bab']);\n }",
"public function getCBU()\r\n {\r\n return $this->CBU;\r\n }",
"public function setTrancheBbanl($trancheBbanl) {\n $this->trancheBbanl = $trancheBbanl;\n return $this;\n }",
"public function get_table_b() {\n\t\treturn $this->table_b;\n\t}",
"public function getTbTradutorObs(){\n\treturn $this->tbTradutorObs;\n}",
"public function testSetAdBtbtq() {\n\n $obj = new BonTravPrev();\n\n $obj->setAdBtbtq(\"adBtbtq\");\n $this->assertEquals(\"adBtbtq\", $obj->getAdBtbtq());\n }",
"public function setTrancheCbna($trancheCbna) {\n $this->trancheCbna = $trancheCbna;\n return $this;\n }",
"function makeControl($table=''){\n\t\tif(!$table && !$this->TCA){\n\t\t\tt3lib_div::loadTCA($this->table);\n\t\t\t$this->TCA = $GLOBALS['TCA'][$this->table];\n\t\t}\n\t\tif(!$table){\n\t\t\treturn $this->TCA;\n\t\t}\n\t\n\t\tt3lib_div::loadTCA($table);\n\t\t$localTCA = $GLOBALS['TCA'][$table];\n\t\treturn $localTCA;\n\t}",
"public function getTrancheCbanl() {\n return $this->trancheCbanl;\n }",
"public function getTbPaisId(){\n\treturn $this->tbPaisId;\n}",
"public function testSetBtq() {\n\n $obj = new Collaborateurs();\n\n $obj->setBtq(\"btq\");\n $this->assertEquals(\"btq\", $obj->getBtq());\n }",
"public function getBete()\n {\n return $this->bete;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the single scalar result of the query. Alias for getSingleResult(HYDRATE_SINGLE_SCALAR). | public function getSingleScalarResult(): mixed
{
return $this->getSingleResult(self::HYDRATE_SINGLE_SCALAR);
} | [
"public function getSingleScalarResult()\n {\n return $this->getQuery()->getSingleScalarResult();\n }",
"public function fetchSingleScalar()\n {\n return $this->execute(RecordManager::FETCH_SINGLE_SCALAR);\n }",
"public function getSingleResult();",
"public function getScalarHydrationValue()\n {\n $ref = new \\ReflectionClass($this->query_class);\n\n return $ref->getConstant($this->query_scalar_hydration_mode);\n }",
"public function getSingleResult() {\n return mysql_fetch_array($this->result);\n }",
"public function fetchSingleScalar();",
"public function getSingleResult()\n {\n }",
"public function getScalar()\n\t{\n\t}",
"function fetchSingle() {\r\n\t\t$result = null;\r\n\t\tif(!is_null($this->__result)) {\r\n\t\t\t$result = @pg_fetch_row($this->__result);\r\n\t\t\tif($result)\r\n\t\t\t\t$result = $result[0];\r\n\t\t\telse\r\n\t\t\t\t$this->__result = null;\r\n\t\t}\r\n\t\treturn $result;\r\n\t}",
"public function get_one()\n\t{\n if ( $r = call_user_func_array([$this, 'query'], func_get_args()) ){\n return $r->fetchColumn(0);\n\t\t}\n return false;\n\t}",
"public function get_one(){\n if ( $r = call_user_func_array([$this, 'query'], func_get_args()) ){\n return $r->fetchColumn(0);\n }\n return false;\n }",
"public function getSingle()\n {\n return $this->singleRow ;\n }",
"public function getSingleResult($statement, $params = array())\n {\n $result = $this->getResults($statement, $params);\n\n if (!sizeof($result)) {\n return null;\n }\n\n return $result[0];\n }",
"public function Single(){\n\t\t$this->executeQuery();\n\n\t\treturn $this->query->fetch(PDO::FETCH_ASSOC);\n\t}",
"public function getOne() {\n\t\t$query = $this->prepareQuery(func_get_args());\n\t\tif ($res = $this->rawQuery($query)) {\n\t\t\t$row = $this->fetch($res);\n\t\t\tif (is_array($row)) {\n\t\t\t\treturn reset($row);\n\t\t\t}\n\t\t\t$this->free($res);\n\t\t}\n\t\treturn FALSE;\n\t}",
"public function singleval()\n\t{\n\t\t$results = $this->as_assoc()->singleton();\n\t\treturn (count($results) === 1) ? current($results) : null;\n\t}",
"protected function addHydrateScalar()\n {\n $this->resultHydration = Query::HYDRATE_SCALAR;\n }",
"public function fetchOne()\n {\n $result = null;\n\n if ($this->statement->rowCount() > 0) {\n $result = $this->statement->fetch();\n $this->statement->closeCursor();\n }\n\n return $result;\n }",
"public function getSingleColumnResult(): array\n {\n return $this->execute(null, self::HYDRATE_SCALAR_COLUMN);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Email address of the payer. Character length and limitations: 127 singlebyte characters | public function getPayerEmail(); | [
"private function _getEmailAddress()\n {\n return date(\"YmdHis\") . \"@zandotest.co.za\";\n }",
"public function EncodedEmail()\n {\n // return CleanUtils::html_obfuscate($this->owner->Email);\n return Email::obfuscate($this->owner->Email, 'hex');\n }",
"public function getEMailAddress()\n {\n return $this->getAsString('email');\n }",
"public function getEncodedEmail() {\n\t\treturn StringUtil::encodeAllChars($this->email);\n\t}",
"public function getEmailAddress() : string\n {\n return $this->emailAddress;\n }",
"private function get_payer_email()\n\t{\n\t\treturn $this->payer_email;\n\t}",
"function osc_premium_contact_email() {\n return (string) osc_premium_field(\"s_contact_email\");\n }",
"public function getEmail() {\n\t\t$v = $this->getField('email');\n\t\treturn $v === null ? null : (string) $v;\n\t}",
"public function getEmail() {\n return strval($this->email);\n }",
"function getReturnEmailAddress() {\n\n\t\t$address = '';\n\t\tif (forge_get_config('use_gateways')) {\n\t\t\t$address .= strtolower($this->getUnixName());\n\t\t} else {\n\t\t\t$address .= 'noreply';\n\t\t}\n\t\t$address .= '@'.forge_get_config('web_host');\n\t\treturn $address;\n\t}",
"public function ObfuscatedEmail()\n {\n return ($this->Email) ? Email::obfuscate($this->Email, 'hex') : null;\n }",
"public function emailRecipient();",
"public function getPayerEmail() {\n\t\treturn $this->_getField(self::$PAYER_EMAIL);\n\t}",
"function osc_item_contact_email() {\n return (string) osc_item_field(\"s_contact_email\");\n }",
"public function getObfuscatedEmail()\n {\n $email = $this->getEmail();\n if (false !== $pos = strpos($email, '@')) {\n $email = '...' . substr($email, $pos);\n }\n\n return $email;\n }",
"public function getPayerEmail()\n {\n return $this->_getField(self::$PAYER_EMAIL);\n }",
"public function getStringEmail() {\n return $this->stringEmail;\n }",
"public function getCustomerEmail();",
"abstract protected function get_local_customer_email();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ desc: change a version string to a numeric "0.1" => "0.1" "5" => "5" "5.1.0" => "5.10" "5.0.2" => "5.02" "5.11.23" => "5.92995" "5.9.10" => "5.9091" "5.9.18" => "5.9099" "5.22" => "5.994" "5.1.36" => "5.994" | static function version2numeric($version)
{
$subArr = explode('.', $version);
$main_ver = array_shift($subArr); //主版本
if(!$subArr)return floatval($main_ver);
$subverstring = '';
foreach($subArr as $sub_ver){
$sub_ver = intval($sub_ver); //把当前字版本号变为整型数值
$subverstring .= str_repeat('9',$sub_ver/9); //字符'9'的个数
$remainder = $sub_ver%9; //当前字版本号的余数(把它接到后面)
$subverstring .= (string)$remainder;
}
return floatval($main_ver .'.'. $subverstring);
} | [
"function version_parse($version)\n{\n return str_replace(\n array('-stable', '-git'),\n array('.0', '.99'),\n $version\n );\n}",
"function COM_versionConvert($version)\n{\n $version = strtolower($version);\n\n // Check if it's a bugfix release first\n $dash = strpos($version, '-');\n if ($dash !== false) {\n // Sometimes the bugfix part is not placed in the version number\n // according to the documentation and this needs to be accounted for\n $rearrange = true; // Assume incorrect formatting\n $b = strpos($version, 'b');\n $rc = strpos($version, 'rc');\n $sr = strpos($version, 'sr');\n if ($b && $b<$dash) {\n $pos = $b;\n } else if ($rc && $rc<$dash) {\n $pos = $rc;\n } else if ($sr && $sr<$dash) {\n $pos = $sr;\n } else {\n // Version is correctly formatted\n $rearrange = false;\n }\n\n // Rearrange the version number, if needed\n if ($rearrange) {\n $ver = substr($version, 0, $pos);\n $cod = substr($version, $pos, $dash-$pos);\n $bug = substr($version, $dash+1);\n $version = $ver . '.' . $bug . $cod;\n } else { // This bugfix release version is correctly formatted\n // So there is an extra number in the version\n $version = str_replace('-', '.', $version);\n }\n $bugfix = '';\n } else {\n // Not a bugfix release, so we add a zero to compensate for the extra number\n $bugfix = '.0';\n }\n\n // We change the non-numerical part in the \"versions\" that were passed into the function\n // beta -> 1\n // rc -> 2\n // hg -> ignore\n // stable (e.g: no letters) -> 3\n // sr -> 4\n if (strpos($version, 'b') !== false) {\n $version = str_replace('b', $bugfix . '.1.', $version);\n } else if (strpos($version, 'rc') !== false) {\n $version = str_replace('rc', $bugfix . '.2.', $version);\n } else if (strpos($version, 'sr') !== false) {\n $version = str_replace('sr', $bugfix . '.4.', $version);\n } else { // must be a stable version then...\n // we always ignore the 'hg' bit\n $version = str_replace('hg', '', $version);\n $version .= $bugfix . '.3.0';\n }\n\n return $version;\n}",
"function versionAsNumber($version) {\n $tokens = preg_split('/\\\\./', $version);\n return $tokens[0] * 10000 + $tokens[1] * 100 + $tokens[2];\n}",
"function getVersion2 ($version=\"\") {\n\t\n\t$states = array (\n\t\t'1' => \"alpha\",\n\t\t'2' => \"beta\",\n\t\t'4' => \"rc\",\n\t\t'8' => \"final\"\t\n\t);\n\n\t$version = strtolower($version);\n\t\n\tforeach($states as $value=>$keys) $version = str_replace($keys, $value, $version);\n\n\t$version = str_replace(\" \", \"\", $version);\n\n\treturn $version;\n}",
"private function normalize_version_number( $version ) {\n\t\tif ( preg_match( '`^\\d+\\.\\d+$`', $version ) ) {\n\t\t\t$version .= '.0';\n\t\t}\n\n\t\treturn $version;\n\t}",
"function serialize_version( $version ){\n\t\n\tif( $version === '0.1.0' ) {\n\t\t//first release - beta\n\t\treturn 1;\n\t} else if ( $version === '0.2.0' ) {\n\t\t//second release - beta\n\t\treturn 2;\n\t} else {\n\t\t//unknown\n\t\treturn 0;\n\t}\n\t\n}",
"static function number2version($number, $isApp = false){\n\t\tt_e('deprecated');\n\n\t\t$mynumber = \"$number\";\n\t\t$numbers = array();\n\n\t\tif($isApp){\n\t\t\tif($number < 1){\n\t\t\t\tif($number < 0.1){\n\t\t\t\t\t$mynumber = str_replace('.0', '.', $mynumber);\n\t\t\t\t\t$version = $mynumber;\n\t\t\t\t} else {\n\t\t\t\t\t$version = $mynumber;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$intnumber = floor($number);\n\t\t\t\t$decimal = $number - $intnumber;\n\t\t\t\t$mynumber = \"$intnumber\";\n\t\t\t\tfor($i = 0; $i < strlen($mynumber) - 1; $i++){\n\t\t\t\t\tif($i = 2 && isset($mynumber[3])){\n\t\t\t\t\t\t$numbers[] = $mynumber[2] . $numbers[] = $mynumber[3];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$numbers[] = $mynumber[$i];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif($decimal != 0){\n\t\t\t\t\t$version = implode('.', $numbers) . $decimal;\n\t\t\t\t} else {\n\t\t\t\t\t$version = implode('.', $numbers);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif($number > 6999){\n\t\t\t\t$intnumber = floor($number);\n\t\t\t\t$decimal = $number - $intnumber;\n\t\t\t\t$mynumber = \"$intnumber\";\n\t\t\t\tfor($i = 0; $i < strlen($mynumber) - 1; $i++){\n\t\t\t\t\tif($i = 2 && isset($mynumber[3])){\n\t\t\t\t\t\t$numbers[] = $mynumber[2] . $numbers[] = $mynumber[3];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$numbers[] = $mynumber[$i];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif($decimal != 0){\n\t\t\t\t\t$version = implode('.', $numbers) . $decimal;\n\t\t\t\t} else {\n\t\t\t\t\t$version = implode('.', $numbers);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor($i = 0; $i < 4; $i++){\n\t\t\t\t\t$numbers[] = $number[$i];\n\t\t\t\t}\n\t\t\t\t$version = implode('.', $numbers);\n\t\t\t}\n\t\t}\n\t\treturn $version;\n\t}",
"private function fill_numbers( $version ) {\n\n\t\tif ( preg_match( '~^\\d+\\.\\d+\\.\\d+~', $version ) ) {\n\t\t\treturn $version;\n\t\t}\n\n\t\t$parts = explode( '.', $version );\n\t\t$new = array();\n\t\t$append = array();\n\n\t\tforeach ( $parts as $part ) {\n\t\t\t$this->sort_values( $part, $new, $append );\n\t\t}\n\n\t\t$new = $this->pad_with_zero( $new );\n\t\t$new = array_merge( $new, $append );\n\n\t\treturn join( '.', $new );\n\t}",
"function expand_version($version) {\n\t$major = substr($version, 0, 2);\n\t$minor = substr($version, 2, 2);\n\t$bugfix = substr($version, 4, 2);\n\tif (intval($bugfix) != 0) {\n\t\t\t$new_ver = $major . \".\" . $minor . \".\" . $bugfix;\n\t} else if (intval($minor) != 0) {\n\t\t\t$new_ver = $major . \".\" . $minor;\n\t} else {\n\t\t$new_ver = $major;\n\t}\n\treturn $new_ver;\n}",
"function build_version_string() {\n\t$numbers = func_get_args();\n\tif (count($numbers) === 1 && is_array($numbers[0])) {\n\t\t$numbers = $numbers[0];\n\t}\n\tforeach ($numbers as $key => $number) {\n\t\tif (is_numeric($number) && $number < 10 && (int) $number[0] != 0) {\n\t\t\t$numbers[$key] = '0' . $number;\n\t\t}\n\t}\n\treturn implode('.', $numbers);\n}",
"function DISTR_releaseVersionTranslator($release)\n{\n\t//Ubuntu\n\t$r['warty']=\"4.10\";\n\t$r['hoary']=\"5.04\";\n\t$r['breezy']=\"5.10\";\n\t$r['dapper']=\"6.06 LTS\";\n\t$r['edgy']=\"6.10\";\n\t$r['feisty']=\"7.04\";\n\t$r['gutsy']=\"7.10\";\n\t$r['hardy']=\"8.04 LTS\";\n\t$r['intrepid']=\"8.10\";\n\t$r['lucid']=\"10.04 LTS\";\n\t$r['precise']=\"12.04 LTS\";\n\n\t//Debian\n\t$r['sarge']=\"3.1\";\n\t$r['etch']=\"4.0\";\n\t$r['lenny']=\"5.0\";\n\t$r['squeeze']=\"6.0\";\n\n\treturn(ucfirst($release).\" \".$r[$release]);\n}",
"private function normalizeVersion(string $version): string\n {\n if (!is_numeric($version)) {\n return $version;\n }\n return sprintf('Neos\\Flow\\Persistence\\Doctrine\\Migrations\\Version%s', $version);\n }",
"private function _computeVersionValue($verStr)\n\t{\n\t\t list ($ver_maj, $ver_min, $ver_rel ) = explode(\".\",$verStr);\n\t\t return ( 100 * $ver_maj ) + ( 10 * $ver_min ) + ( $ver_rel );\n\t}",
"function pods_point_to_version($point) {\n $version_tmp = explode('.', $point);\n $version = '';\n for ($x = 0; $x < 3; $x++) { // 3 points max - MAJOR.MINOR.PATCH\n if (!isset($version_tmp[$x]) || strlen($version_tmp[$x]) < 1)\n $version_tmp[$x] = '000';\n $version_temp = str_split($version_tmp[$x]);\n if (3 == count($version_temp))\n $version .= $version_tmp[$x];\n elseif (2 == count($version_temp))\n $version .= '0' . $version_tmp[$x];\n elseif (1 == count($version_temp))\n $version .= '00' . $version_tmp[$x];\n }\n $version = (int) $version;\n return $version;\n}",
"public function _update_version_number_function() {\n\n\t\t\tglobal $wpdb;\n\t\t\t$data = array(\n\t\t\t\t'extensionversions' => $this->new_string,\n\t\t\t);\n\t\t\t$format = array( '%s' );\n\t\t\t$where = array( 'ID' => 1 );\n\t\t\t$where_format = array( '%d' );\n\t\t\t$wpdb->update( $wpdb->prefix . 'gamedev_jre_user_options', $data, $where, $format, $where_format );\n\t\t}",
"function DISTR_releaseVersionTranslator($release)\n{\n\t//Ubuntu\n\t$r['warty']=\"4.10\";\n\t$r['hoary']=\"5.04\";\n\t$r['breezy']=\"5.10\";\n\t$r['dapper']=\"6.06 LTS\";\n\t$r['edgy']=\"6.10\";\n\t$r['feisty']=\"7.04\";\n\t$r['gutsy']=\"7.10\";\n\t$r['hardy']=\"8.04 LTS\";\n\t$r['intrepid']=\"8.10\";\n\t$r['lucid']=\"10.04 LTS\";\n\t$r['precise']=\"12.04 LTS\";\n\t$r['trusty']=\"14.04 LTS\";\n\t$r['xenial']=\"16.04 LTS\";\n\t$r['bionic']=\"18.04 LTS\";\n\t$r['focal']=\"20.04 LTS\";\n\n\t//Debian\n\t$r['sarge']=\"3.1\";\n\t$r['etch']=\"4.0\";\n\t$r['lenny']=\"5.0\";\n\t$r['squeeze']=\"6.0\";\n\t$r['wheezy']=\"7.x\";\n\t$r['jessie']=\"8.x\";\n\t$r['stretch']=\"9.x\";\n\t$r['buster']=\"10.x\";\n\t\n\t// Devuan\n\t$r['devuanjessie'] = '1.x';\n\n\n\treturn(isset($r[$release]) ? ucfirst($release).\" \".$r[$release] : '');\n}",
"function increment_version( $current_version, $new_version ) {\n }",
"function getVersionNumber();",
"public function transformVersionToNumeric($text)\n {\n $array = explode('.', $text);\n if (count($array) != 3) {\n throw new Zend_Exception('The version format shoud be 1.2.3. You set:'.$text);\n }\n\n return (int) $array[0] * 1000000 + (int) $array[1] * 1000 + (int) $array[2];\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
retrieves app description for given object | private function readAppDescription($object): string
{
$annotations = annotationsOf($object);
if (!$annotations->contain('AppDescription')) {
return '';
}
return $annotations->firstNamed('AppDescription')->getValue() . "\n";
} | [
"public function getAppDescription()\n {\n if (array_key_exists(\"appDescription\", $this->_propDict)) {\n return $this->_propDict[\"appDescription\"];\n } else {\n return null;\n }\n }",
"public function getApplicationDescription()\n {\n return $this->applicationDescription;\n }",
"public function getApplicationDescription()\n {\n return $this->_applicationDescription;\n }",
"public function getDescription() : String\n {\n return $this->getRequest()->getAttribute(\"appDescription\", \"This is a Basicis framework App!\");\n }",
"public static function getDescription()\n {\n global $application_description;\n return $application_description;\n }",
"function get_api_catalog_description( $program ) {\n\t$retval = '';\n\n\tif ( ! class_exists( 'UCF_Degree_Config' ) ) {\n\t\treturn $retval;\n\t}\n\n\t// Determine the catalog description type's ID\n\t$description_types = UCF_Degree_Config::get_description_types();\n\t$catalog_desc_type_id = null;\n\n\tif ( $description_types ) {\n\t\tforeach ( $description_types as $desc_id => $desc_name ) {\n\t\t\tif ( stripos( $desc_name, 'Catalog Description' ) !== false ) {\n\t\t\t\t$catalog_desc_type_id = $desc_id;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Find the program's description by the catalog description type ID\n\t$descriptions = $program->descriptions;\n\n\tif ( !empty( $descriptions ) && $catalog_desc_type_id ) {\n\t\tforeach ( $descriptions as $d ) {\n\t\t\tif ( $d->description_type->id === $catalog_desc_type_id ) {\n\t\t\t\t$retval = $d->description;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $retval;\n}",
"function getAppDetails() {\n echo \"<span>\".self::APP_NAME.\"</span></br>\";\n echo \"<span>\".self::APP_VERSION.\"</span></br>\";\n echo \"<span>\".self::APP_AUTHOR.\"</span></br>\";\n }",
"public function getApplicationInfo($application_id);",
"public function setAppDescription($val)\n {\n $this->_propDict[\"appDescription\"] = $val;\n return $this;\n }",
"public function getCompanyMainActivityDescription()\n {\n return $this->getIfSet('description', $this->data->company->mainActivity);\n }",
"public function getFeedItemDescription();",
"public function getDescription()\n {\n if ($this->_description === null)\n $this->_description = \\Yii::t('resource', '{name} Web Application', array('{name}' => $this->name));\n return $this->_description;\n }",
"public function get_app_info()\n\t{\n\t\tif (is_object($this->fcbk)) {\n\t\t\ttry {\n\t\t\t\t$app_info = $this->fcbk->api('/' . $this->options['app_id']);\n\t\t\t\t$this->options['app_infos'] = $this->optionsManager->updateOption('app_infos', $app_info, true);\n\t\t\t} catch (Exception $e) {\n\t\t\t\t$this->options['app_infos'] = $this->optionsManager->updateOption('app_infos', array(), true);\n\t\t\t\t$error = new WP_Error($e->getCode(), $e->getMessage());\n\t\t\t\t$this->display_messages($error->get_error_message(), 'error', false);\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"function getApplicationTypeDescription() {\n \treturn LookupType::getLookupValueDescription(\"APPLICATION_TYPE\", $this->getApplicationType()); \n }",
"public function app_info() {\n \n // Load the app's language files\n $this->CI->lang->load( 'facebook_ads_user', $this->CI->config->item('language'), FALSE, TRUE, MIDRUB_BASE_USER_APPS_FACEBOOK_ADS );\n \n // Return app information\n return array(\n 'app_name' => $this->CI->lang->line('advertising'),\n 'app_slug' => 'facebook_ads',\n 'app_icon' => '<i class=\"icon-social-facebook\"></i>',\n 'version' => MIDRUB_BASE_USER_APPS_FACEBOOK_ADS_VERSION,\n 'min_version' => '0.0.7.9',\n 'max_version' => '0.0.7.9'\n );\n \n }",
"public function getApp()\n {\n return $this->command('App')->get($this->appId);\n }",
"public function getItemDescription();",
"public function describeAction()\n\t{\n\t\t$resourceProperties = static::resourceEntityPropertiesDescription($this->objectManager);\n\t\tif ($this->normalizeResourceTypes) {\n\t\t\t$schemas[] = &$resourceProperties;\n\t\t\twhile (count($schemas) > 0) {\n\t\t\t\tforeach ($schemas[0] as &$property) {\n\t\t\t\t\t$property['type'] = ResourceTypeHelper::normalize($property['type']);\n\t\t\t\t\tif (isset($property['elementType']) && $property['elementType'] !== null) {\n\t\t\t\t\t\t$property['elementType'] = ResourceTypeHelper::normalize($property['elementType']);\n\t\t\t\t\t}\n\t\t\t\t\tif (isset($property['schema'])) {\n\t\t\t\t\t\tif (is_array($property['schema'])) {\n\t\t\t\t\t\t\t$schemas[] = &$property['schema'];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$property['schema'] = ResourceTypeHelper::normalize($property['schema']);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tarray_shift($schemas);\n\t\t\t}\n\t\t}\n\t\t//$resourceProperties = array_diff($resourceProperties, array('Persistence_Object_Identifier'));\n\t\t$this->view->assign('description', $resourceProperties);\n\t\tif ($this->view instanceof JsonView) {\n\t\t\t$this->view->setVariablesToRender(['description']);\n\t\t}\n\t}",
"function apps_app_details_page($server_name, $app_name) {\n apps_include('manifest');\n $apps = apps_apps($server_name , array('machine_name' => $app_name)) ;\n $apps[$app_name]['#theme'] = 'apps_app_page';\n return $apps[$app_name];\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initialize the Composer Autoloader | private function initLoader(): void
{
require_once __DIR__.'/vendor/autoload.php';
} | [
"protected function initAutoloader()\n {\n if ($this->loader) {\n $this->loader->unregister();\n }\n \n $package = $this->composer->getPackage();\n $generator = $this->composer->getAutoloadGenerator();\n $packages = $this->composer->getRepositoryManager()->getLocalRepository()->getCanonicalPackages();\n $packageMap = $generator->buildPackageMap($this->composer->getInstallationManager(), $package, $packages);\n $map = $generator->parseAutoloads($packageMap, $package);\n \n $this->loader = $generator->createLoader($map);\n $this->loader->register();\n }",
"protected function initAutoLoader()\n {\n require dirname(__FILE__) . '/../../application/Autoloader.php';\n $this->autoloader = new Autoloader();\n $this->autoloader\n ->addNamespaces($this->getAutoloaderNamespaces())\n ->register(true)\n ;\n }",
"public function init()\n {\n $classLoader = new ClassLoader('Doctrine', dirname(__FILE__) . '/vendor');\n \\Yii::registerAutoloader(array($classLoader, 'loadClass'));\n\n $classLoader = new ClassLoader('Symfony', dirname(__FILE__) . '/vendor');\n \\Yii::registerAutoloader(array($classLoader, 'loadClass'));\n\n }",
"public function init()\n {\n require_once __DIR__ . '/vendor/autoload.php';\n }",
"public function loadComposer()\n {\n if ($ownVendor = $this->tryPath('vendor/', BootLoader::RELATIVE | BootLoader::VALIDATE)) {\n $this->autoLoader = require $ownVendor . 'autoload.php';\n } else {\n // when bootstrapping is inside a dependency of another project\n $this->autoLoader = require $this->getPath('../../', BootLoader::RELATIVE | BootLoader::VALIDATE) . 'autoload.php';\n }\n }",
"public function initialize()\n {\n $autoloader = $this->registerAutoloader();\n $this->registerPlugins($autoloader);\n }",
"function initAutoloaderComposer($sl){\n $autoload = __DIR__ . \"$sl..\" . $sl . \"vendor\" . $sl . \"autoload.php\";\n require_once $autoload;\n }",
"protected function init_autoloading() {\n\t\tif ( ! class_exists( 'Tribe__Autoloader' ) ) {\n\t\t\trequire_once dirname( __FILE__ ) . '/Autoloader.php';\n\t\t}\n\n\t\t$prefixes = array( 'Tribe__' => dirname( __FILE__ ) );\n\t\t$autoloader = Tribe__Autoloader::instance();\n\t\t$autoloader->register_prefixes( $prefixes );\n\t\t$autoloader->register_autoloader();\n\t}",
"function registerComposerAutoLoad()\n {\n // sx: Register sologics composer autoloader\n $autoloaderPath = __DIR__ . '/../../vendor/autoload.php';\n if (file_exists($autoloaderPath)) {\n include_once $autoloaderPath;\n }\n\n // initialize symfony kernel\n require_once __DIR__ . '/../kernelbootstrap.php';\n }",
"public static function register_autoloader() {}",
"private function _initAutoloaderConfig()\n {\n require_once __DIR__ . '/Loader/AutoloaderFactory.php';\n \n AutoloaderFactory::factory(array(\n 'Spark\\Loader\\StandardAutoloader' => array(\n 'autoregister_framework' => true\n ),\n ));\n }",
"public function provide__initAutoloader ( )\n {\n return array(\n array(),\n );\n\n }",
"protected function _initAutoload()\n {\n $autoloader = Zend_Loader_Autoloader::getInstance();\n $autoloader->registerNamespace('MyBase_');\n $autoloader->registerNamespace('MyProject_');\n }",
"function get_composer_autoloader()\n {\n static $loader;\n\n if (null === $loader) {\n $loader = new ClassLoader();\n }\n\n return $loader;\n }",
"public static function onClassLoaded(): void {\n\t\tif(!defined('libDocker\\COMPOSER_AUTOLOADER_PATH')) {\n\t\t\tif(Phar::running(true) !== \"\") {\n\t\t\t\tdefine('libDocker\\COMPOSER_AUTOLOADER_PATH',\n\t\t\t\t\tPhar::running(true) . \"/vendor/autoload.php\");\n\t\t\t} elseif(is_file($path = dirname(__DIR__, 2) . \"/vendor/autoload.php\")) {\n\t\t\t\tdefine('libDocker\\COMPOSER_AUTOLOADER_PATH', $path);\n\t\t\t} else {\n\t\t\t\tServer::getInstance()->getLogger()->debug(\"Composer autoloader not found.\");\n\t\t\t\tServer::getInstance()->getLogger()\n\t\t\t\t\t->debug(\"Please install/update Composer dependencies or use provided releases.\");\n\t\t\t\ttrigger_error(\"Couldn't find composer autoloader\", E_USER_ERROR);\n\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\trequire_once(COMPOSER_AUTOLOADER_PATH);\n\t}",
"protected function _initAutoLoader()\n {\n $autoloader = Zend_Loader_Autoloader::getInstance();\n $autoloader->registerNamespace('Sahara_');\n\n $inst = Zend_Registry::get('config')->institution;\n if (is_dir(self::$rootDirectory . '/../institution/' . $inst))\n {\n $autoloader->registerNamespace($inst . '_');\n }\n }",
"public function initialize()\n\t{\t\n\t\tspl_autoload_register([self::$instance,'registerAutoloader']);\n\t}",
"public static function initialize()\n {\n if (version_compare(PHP_VERSION, COMPOSER_MIN_PHPVERSION, '<')) {\n return;\n }\n\n if (TL_MODE == 'BE') {\n $GLOBALS['TL_HOOKS']['loadLanguageFile']['composer'] = array(\n 'ContaoCommunityAlliance\\Contao\\Composer\\Client',\n 'disableOldClientHook'\n );\n\n $input = \\Input::getInstance();\n if ($input->get('do') == 'repository_manager') {\n $environment = \\Environment::getInstance();\n\n header('Location: ' . $environment->base . 'contao/main.php?do=composer');\n exit;\n }\n }\n\n static::registerVendorClassLoader();\n }",
"public function initResourceLoader()\n {\n $namespace = $this->getAppNamespace();\n if ($namespace!==false) {\n $r = new ReflectionClass($this);\n $path = $r->getFileName();\n $this->setResourceLoader(new Zend_Application_Module_Autoloader(array(\n 'namespace' => $namespace,\n 'basePath' => dirname($path),\n )));\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets as consignmentQuantity BBIE Shipment. Consignment_ Quantity. Quantity The total number of consignments within this shipment. 0..1 Shipment Consignment Quantity Quantity Quantity. Type | public function getConsignmentQuantity()
{
return $this->consignmentQuantity;
} | [
"public function getChargeableQuantity()\n {\n return $this->chargeableQuantity;\n }",
"public function getQuantityInCase()\n {\n return $this->_fields['QuantityInCase']['FieldValue'];\n }",
"public function getQuantityInCase() \n {\n return $this->_fields['QuantityInCase']['FieldValue'];\n }",
"public function getQuantity()\r\n {\r\n return $this->quantity;\r\n }",
"public function getQUANTITY()\n {\n return $this->QUANTITY;\n }",
"public function getQuantity()\n {\n return isset($this->quantity) ? $this->quantity : null;\n }",
"public function getQuantity();",
"public function getDiscountedQuantity();",
"public function getQuantity()\n {\n return $this->_fields['Quantity']['FieldValue'];\n }",
"public function getQuantity()\n {\n // @TODO - This is temporary. We have migrated data that has stored quanity in the\n // quanity_pending column on the signup. However, since then we updated the business\n // logic to store everything in the quanity column and not use the quanity_pending\n // column at all. We only want to return what is in the quanity_pending column\n // if is the only place quanity is stored.\n if (! config('features.v3QuantitySupport') || $this->posts->isEmpty()) {\n if (! is_null($this->quantity_pending) && is_null($this->quantity)) {\n return $this->quantity_pending;\n }\n\n return $this->quantity;\n }\n\n // If we are supporting quantity on posts then we can just return the summed quantity across all posts under the signup.\n return $this->posts->sum('quantity');\n }",
"public function getQtyToCancelBundle()\n {\n if ($this->isDummy()) {\n $qty = $this->getQtyOrdered()\n - $this->getQtyInvoiced()\n - $this->getQtyCanceled();\n return min(max($qty, 0), $this->getQtyToShip());\n }\n return min($this->getQtyToInvoice(), $this->getQtyToShip());\n }",
"public function getOetbconfdispcaseqty()\n {\n return $this->oetbconfdispcaseqty;\n }",
"function getQuantity() {\n return $this->getFieldValue('quantity');\n }",
"public function getDiscountQty()\n {\n return $this->_discountQuantity;\n }",
"public function getQty()\n {\n return $this->qty;\n }",
"public function getPurchaseQuantity()\n {\n return $this->purchaseQuantity;\n \n }",
"public function getQtyToCancelBundleItem()\n {\n if ($this->isDummy(true)) {\n return min($this->getQtyToInvoice(), $this->getSimpleQtyToShip());\n }\n return min($this->getQtyToInvoice(), $this->getQtyToShip());\n }",
"public function getConsignment()\n {\n return $this->consignment;\n }",
"private function getQuantity() {\n\t\t$quantity = $this->getRequest()->requestVar('Quantity');\n\t\treturn (isset($quantity) && is_numeric($quantity)) ? $quantity : 1;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the templates configuration | public function getTemplates()
{
return [
'paths' => [
'app' => [__DIR__ . '/../templates/app'],
'error' => [__DIR__ . '/../templates/error'],
'layout' => [__DIR__ . '/../templates/layout'],
],
];
} | [
"private function getTemplateConfig()\n\t{\n\t\treturn $this->config['templateDir'] . DIRECTORY_SEPARATOR . $this->config['template'] . DIRECTORY_SEPARATOR . 'config.neon';\n\t}",
"public function getTemplateConfiguration()\n {\n return $this->_templateConfiguration;\n }",
"private function getTemplates()\n {\n return EmailConfig::fetchAll(Context::getContext()->language->id);\n }",
"abstract public function getConfigTemplate(): string;",
"public function getConfigTemplates(){\n\n $dir = DIR_CONFIG.'d_visual_designer_template/';\n if(is_dir($dir)){\n $files = scandir($dir);\n }\n else{\n $files = array();\n }\n\n $template_data = array();\n\n foreach($files as $file){\n if(strlen($file) > 1 && strpos( $file, '.php')){\n $_ = array();\n\n $results = array();\n\n require($dir.$file);\n\n $results = array_merge($results, $_);\n\n $templates = $results['d_visual_designer_templates'];\n foreach ($templates as $template) {\n $template_data[] = array(\n 'template_id' => $template['template_id'],\n 'content' => $template['content'],\n 'config' => substr($file, 0, -4),\n 'image' => $template['image'],\n 'category' => $template['category'],\n 'sort_order' => $template['sort_order'],\n 'name' => $template['name']\n );\n }\n }\n }\n return $template_data;\n }",
"public function getTemplates()\n {\n return [\n 'paths' => [\n 'jg' => [__DIR__ . '/../templates/jg'],\n 'error' => [__DIR__ . '/../templates/error'],\n 'layout' => [__DIR__ . '/../templates/layout'],\n ],\n ];\n }",
"public static function get_template_options() {\n\t\treturn self::$template_options;\n\t}",
"public function getTemplates();",
"function getSettingsTemplate() {\n\t\treturn $this->getTemplatePath() . 'settings.tpl';\n\t}",
"public function templates()\n {\n $config = $this->app['config']->get('motor-cms-page-templates', []);\n $this->app['config']->set('motor-cms-page-templates', array_replace_recursive(require __DIR__.'/../../config/motor-cms-page-templates.php', $config));\n }",
"public function getTemplates()\n {\n $baseDir = __DIR__ . '/../../../view/adminhtml/web/packlink/templates/';\n\n return [\n 'pl-configuration-page' => [\n 'pl-main-page-holder' => file_get_contents($baseDir . 'configuration.html'),\n ],\n 'pl-countries-selection-modal' => file_get_contents($baseDir . 'countries-selection-modal.html'),\n 'pl-default-parcel-page' => [\n 'pl-main-page-holder' => file_get_contents($baseDir . 'default-parcel.html'),\n ],\n 'pl-default-warehouse-page' => [\n 'pl-main-page-holder' => file_get_contents($baseDir . 'default-warehouse.html'),\n ],\n 'pl-disable-carriers-modal' => file_get_contents($baseDir . 'disable-carriers-modal.html'),\n 'pl-edit-service-page' => [\n 'pl-header-section' => '',\n 'pl-main-page-holder' => file_get_contents($baseDir . 'edit-shipping-service.html'),\n 'pl-pricing-policies' => file_get_contents($baseDir . 'pricing-policies-list.html'),\n ],\n 'pl-login-page' => [\n 'pl-main-page-holder' => file_get_contents($baseDir . 'login.html'),\n ],\n 'pl-my-shipping-services-page' => [\n 'pl-main-page-holder' => file_get_contents($baseDir . 'my-shipping-services.html'),\n 'pl-header-section' => file_get_contents($baseDir . 'shipping-services-header.html'),\n 'pl-shipping-services-table' => file_get_contents($baseDir . 'shipping-services-table.html'),\n 'pl-shipping-services-list' => file_get_contents($baseDir . 'shipping-services-list.html'),\n ],\n 'pl-onboarding-overview-page' => [\n 'pl-main-page-holder' => file_get_contents($baseDir . 'onboarding-overview.html'),\n ],\n 'pl-onboarding-welcome-page' => [\n 'pl-main-page-holder' => file_get_contents($baseDir . 'onboarding-welcome.html'),\n ],\n 'pl-order-status-mapping-page' => [\n 'pl-main-page-holder' => file_get_contents($baseDir . 'order-status-mapping.html'),\n ],\n 'pl-pick-service-page' => [\n 'pl-header-section' => '',\n 'pl-main-page-holder' => file_get_contents($baseDir . 'pick-shipping-services.html'),\n 'pl-shipping-services-table' => file_get_contents($baseDir . 'shipping-services-table.html'),\n 'pl-shipping-services-list' => file_get_contents($baseDir . 'shipping-services-list.html'),\n ],\n 'pl-pricing-policy-modal' => file_get_contents($baseDir . 'pricing-policy-modal.html'),\n 'pl-register-page' => [\n 'pl-main-page-holder' => file_get_contents($baseDir . 'register.html'),\n ],\n 'pl-register-modal' => file_get_contents($baseDir . 'register-modal.html'),\n 'pl-system-info-modal' => file_get_contents($baseDir . 'system-info-modal.html'),\n ];\n }",
"public static function getTemplates(){\n return array(\n 'index'=>array(\n 'name'=>'Default Template',\n 'theme'=>'reports'\n ),\n 'pretty'=>array(\n 'name'=>'Pretty Template',\n 'theme'=>'simple'\n ),\n );\n }",
"public function getTemplateMap();",
"public function get_templates() {\n\t\treturn get_option( 'tve_menu_item_templates', array() );\n\t}",
"function templates()\n {\n return [];\n }",
"public function getTemplatePreferences()\n {\n return ['we1rdo' => ['example_setting' => 1],\n ];\n }",
"public function getFormViewTemplateConfiguration()\n {\n $formViewIdentifier = FormConfigurationManager::getFormViewIdentifier();\n return $this->libraryConfiguration['templates'][$formViewIdentifier];\n }",
"public function getTemplateInfo();",
"public function getTemplatesPath()\n {\n return $this->templates_path;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Removes a message from the list of warning messages. | public function removeWarningMessage($index) {
$this->warningMessages[$index] = null;
} | [
"public function deleteStatusMessage($message)\n\t{\n\t\t$this->loadOtherParts();\n\t\t$i = array_search($message, $this->_statusMessages);\n\t\tif($i !== false)\n\t\t\t$this->_statusMessages = array_splice($this->_statusMessages, $i, 1);\n\t}",
"public function remove_notice() {\n\t\t$this->admin_notices->remove_notice( self::NOTICE_GROUP_ID, $this->get_notice_id() );\n\t}",
"function warning($message)\n\t{\n\t\tif (is_array($message)) {\n\t\t\tforeach ($message as $value) {\n\t\t\t\t$this->send($value, GW_LOG_WARNING);\n\t\t\t}\n\t\t} else {\n\t\t\t$this->send($message, GW_LOG_WARNING);\n\t\t}\n\t}",
"function remove_notice( $key ) {\r\n\t\t\t$admin_notices = $this->get_admin_notices();\r\n\r\n\t\t\tif ( ! empty( $admin_notices[ $key ] ) ) {\r\n\t\t\t\tunset( $admin_notices[ $key ] );\r\n\t\t\t\t$this->set_admin_notices( $admin_notices );\r\n\t\t\t}\r\n\t\t}",
"function message_remove($message)\r\n\t{\r\n\tsql_query(\"DELETE FROM user_message WHERE message='{$message}'\");\r\n\tsql_query(\"DELETE FROM message WHERE ref='{$message}'\");\t\r\n\t}",
"public function general_removal($message = \"\")\r\n\t\t{\r\n\t\t\t$this->check_login();\r\n\t\t\t\r\n\t\t\t$data['message'] = $message;\r\n\t\t\t$data['admin_info'] = $this->admin_model->getUsernames(5);\r\n\r\n\t\t\t$this->load->view($this->admin_views . 'sidebar');\r\n\t\t\t$this->load->view($this->admin_views . 'Account Removal/remove_general_body', $data);\r\n\t\t}",
"public function remove_admin_notice($notice) {\r\n\t\t$notices = get_option('mapsmarkerpro_notices');\r\n\t\tif (!is_array($notices)) {\r\n\t\t\t$notices = array();\r\n\t\t}\r\n\r\n\t\t$key = array_search($notice, $notices);\r\n\t\tif ($key !== false) {\r\n\t\t\tunset($notices[$key]);\r\n\t\t\tupdate_option('mapsmarkerpro_notices', $notices);\r\n\t\t}\r\n\t}",
"public function warning($message);",
"function message_remove($message)\n\t{\n $message = escape_check($message);\n\n\tsql_query(\"DELETE FROM user_message WHERE message='{$message}'\");\n\tsql_query(\"DELETE FROM message WHERE ref='{$message}'\");\t\n\t}",
"function clearMessages ()\n\t{\n\t\tunset ($this->messageList);\n\t}",
"private static function remove_admin_notices()\n {\n }",
"public function removeAll() {\n $this->messages = array();\n }",
"public function addWarning($message);",
"protected function addWarningMessage($message){\n $this->addMessage('warning', $message);\n }",
"public function deleteOldMessages()\n {\n $messageSource = $this->i18n->getGlobalMessageSource();\n foreach ($this->getOldMessages() as $message)\n {\n $messageSource->delete($message);\n }\n }",
"function ocf_delete_warning($warning_id)\n{\n\tif (!ocf_may_warn_members()) access_denied('SPECIFIC_PERMISSION','warn_members');\n\n\t$member_id=$GLOBALS['FORUM_DB']->query_value_null_ok('f_warnings','w_member_id',array('id'=>$warning_id));\n\tif (is_null($member_id)) warn_exit(do_lang_tempcode('MISSING_RESOURCE'));\n\n\t$GLOBALS['FORUM_DB']->query_delete('f_warnings',array('id'=>$warning_id),'',1);\n\n\t$num_warnings=$GLOBALS['FORUM_DB']->query_value('f_warnings','COUNT(*)',array('w_is_warning'=>1,'w_member_id'=>$member_id));\n\t$GLOBALS['FORUM_DB']->query_update('f_members',array('m_cache_warnings'=>$num_warnings),array('id'=>$member_id),'',1);\n}",
"public function warningMessage($message)\n {\n $this->setSessionMessage(\"warning\", $message);\n }",
"function cns_delete_warning($warning_id)\n{\n if (!addon_installed('cns_warnings')) {\n warn_exit(do_lang_tempcode('INTERNAL_ERROR'));\n }\n\n if (!cns_may_warn_members()) {\n access_denied('PRIVILEGE', 'warn_members');\n }\n\n $member_id = $GLOBALS['FORUM_DB']->query_select_value_if_there('f_warnings', 'w_member_id', array('id' => $warning_id));\n if (is_null($member_id)) {\n warn_exit(do_lang_tempcode('MISSING_RESOURCE'));\n }\n\n $GLOBALS['FORUM_DB']->query_delete('f_warnings', array('id' => $warning_id), '', 1);\n\n $num_warnings = $GLOBALS['FORUM_DB']->query_select_value('f_warnings', 'COUNT(*)', array('w_is_warning' => 1, 'w_member_id' => $member_id));\n $GLOBALS['FORUM_DB']->query_update('f_members', array('m_cache_warnings' => $num_warnings), array('id' => $member_id), '', 1);\n\n return $member_id;\n}",
"public function assertNotWarningMessage($message) {\n $this->_assertNot(\n $message,\n 'warning_message_selector',\n \"The page '%s' contains the warning message '%s'\"\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets a new vATSite This string value is the Site ID value of the eBay Marketplace where the VAT is applicable and where the seller is registered as a Business Seller. The eBay sites that support VAT (and their corresponding Site IDs) can be found in the Business Feature Field Differences topic. | public function setVATSite($vATSite)
{
$this->vATSite = $vATSite;
return $this;
} | [
"private function set_category_version($site_id, $version){\n\n $data = $this->get_category_version();\n $data[$site_id] = $version;\n// var_dump(json_encode($data));\n $this->ebay_model->set_storage_data('ebay_category_version', json_encode($data));\n\n }",
"public static function setSite(Site $site) {\n self::$site = $site;\n }",
"public function setSite(Site $site)\n {\n $this->site = $site;\n }",
"function setSiteOption($key, $val) {\n\t\t$this->_siteOptions[$key] = $val;\n\t}",
"public function setSiteURL($site_url)\n\t{\n\t\t$this->site_url = rtrim($site_url, '/').'/';\n\t}",
"public function setSiteURL($siteURL)\r\n {\r\n //Find out how to validate urls\r\n $this->siteURL = $siteURL;\r\n }",
"public function setSite($var)\n {\n GPBUtil::checkString($var, True);\n $this->site = $var;\n\n return $this;\n }",
"public function setVatNumber(string $vatNumber):void\n {\n $this->vatNumber = $vatNumber;\n }",
"public function setSiteId( $value );",
"public function setSiteUrl()\n {\n }",
"public function fixVat()\n\t{\n\t\tif (!isset($this->vat_rate))\n\t\t {\n\t\t\t $this->vat_rate=Yii::app()->params['standardVatRate'];\n\t\t\t $this->vat_amount=$this->vatAmount;\t\t\t \n\t\t }\t\n\t}",
"private function _set_site_id($site_id){\n\t\t$this->_site_id = $site_id;\n\t}",
"public function set_customer_vat( $post_data ) {\n\n\t\tif ( ! empty( $post_data ) ) {\n\n\t\t\t$post_data = explode( '&', $post_data );\n\n\t\t\tforeach ( $post_data as $pair ) {\n\t\t\t\t$pair = explode( '=', $pair );\n\t\t\t\t$post_data[ $pair[0] ] = urldecode( $pair[1] );\n\t\t\t}\n\t\t}\n\n\t\tif ( isset( $post_data['billing_wc_avatax_vat_id'] ) ) {\n\t\t\tWC()->customer->vat_id = $post_data['billing_wc_avatax_vat_id'];\n\t\t}\n\t}",
"public function setVat($value)\n {\n return $this->set(self::VAT, $value);\n }",
"public function setBeappVersion($beappVersion)\n {\n $this->beappVersion = intval($beappVersion);\n }",
"public function setVat($value);",
"public function setVatNumber(string $vat_number): void\n {\n $this->_vat_number = $vat_number;\n }",
"public function testFrontendVATOptions()\n {\n //enabling config (Display shipping costs as net price and VAT (instead of gross) in shopping cart and invoice)\n $this->_setShopParam(\"blShowVATForDelivery\", \"true\");\n\n //enabling config (Display VAT contained in Payment Method Charges in Shopping Cart and Invoice)\n $this->_setShopParam(\"blShowVATForPayCharge\", \"true\");\n\n //enabling config (Display VAT contained in Gift Wrappings and Greeting Cards in Shopping Cart and Invoice)\n $this->_setShopParam(\"blShowVATForWrapping\", \"true\");\n\n $this->clearCache();\n $this->addToBasket( \"1000\", 3 );\n\n $this->loginInFrontend(\"example_test@oxid-esales.dev\", \"useruser\");\n $this->assertEquals(\"3\", $this->getValue(\"am_1\"));\n $this->click(\"//tr[@id='cartItem_1']/td[4]/a\");\n $this->waitForItemAppear(\"wrapp_1\");\n $this->click(\"//ul[@id='wrapp_1']/li[4]//input\");\n $this->clickAndWait(\"//button[text()='%APPLY%']\");\n\n //in 1st order step check order information\n $this->assertTextPresent(\"%TOTAL_NET%\",\"info about net total not displays in cart\");\n $this->assertTextPresent(\"plus 5% tax, amount:\",\"info about product VAT not displays in cart\");\n $this->assertTextPresent(\"%TOTAL_GROSS%\",\"info about bruto total not displays in cart\");\n $this->assertTextPresent(\"%SHIPPING_NET%:\",\"info about shipping not displays in cart\");\n $this->assertTextPresent(\"%BASKET_TOTAL_WRAPPING_COSTS_NET%:\",\"info about wrapping total not displays in cart\");\n $this->assertTextPresent(\"%PLUS_VAT%:\",\"info about gift wrapping vat not displays in cart\");\n $this->assertTextPresent(\"%GRAND_TOTAL%:\",\"info about grand total not displays in cart\");\n\n $this->assertEquals(\"128,57 €\", $this->getText(\"basketTotalProductsNetto\"),\"Neto price changed or didn't displayed\");\n $this->assertEquals(\"6,43 €\", $this->getText(\"//div[@id='basketSummary']//tr[2]/td\"),\"VAT 5% changed \");\n $this->assertEquals(\"135,00 €\", $this->getText(\"basketTotalProductsGross\"),\"Bruto price changed or didn't displayed\");\n $this->assertEquals(\"0,00 €\", $this->getText(\"basketDeliveryNetto\"),\"Shipping price changed or didn't displayed\");\n $this->assertEquals(\"2,57 €\", $this->getText(\"basketWrappingNetto\"), \"Wrapping price changed or didn't displayed\");\n $this->assertEquals(\"0,13 €\", $this->getText(\"basketWrappingVat\"),\"Wrapping price changed or didn't displayed\");\n $this->assertEquals(\"137,70 €\", $this->getText(\"basketGrandTotal\"),\"Grand total price changed or didn't displayed\");\n }",
"public function setVatID($value)\n {\n $this->vatID = $value;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Maintains a hashmap : ( type , index ) => Vertex obj | public function indicesVertex($type, $index, Vertex $v)
{
$this->vertex[$type][$index] = $v;
} | [
"public function vertex();",
"function createOrUpdateIndexStructures() ;",
"public function addVertex($id) {\n\t\tif(!isset($this->inAdjacents[$id])) {\n\t\t\t$this->inAdjacents[$id] = array();\n\t\t}\n\t\t\n\t\tif(!isset($this->outAdjacents[$id])) {\n\t\t\t$this->outAdjacents[$id] = array();\n\t\t}\n\t}",
"public static function createIndex()\n\t{\n\t\tif (!isset(self::$tempMap[self::$activeClass]['_']['index']))\n\t\t{\n\t\t\tself::$tempMap[self::$activeClass]['_']['index'] = array();\n\t\t}\n\t\t\n\t\tself::$tempMap[self::$activeClass]['_']['index'][] = func_get_args();\n\t}",
"public function getVertexSet(): VertexSet\n {\n return $this->vertexMap->keySet();\n }",
"public function generateMap()\n {\n $map = array();\n $database = $this->binding->getDatabase()->getData();\n\n foreach ($database->classes as $class) {\n $map[$class->name] = $class->clusters;\n }\n\n $this->map = $map;\n $this->cache->save($this->getCacheKey(), $map);\n }",
"public function createOrUpdateIndexStructures() {}",
"function glBindFragDataLocationIndexed(int $program, int $colorNumber, int $index, string $name) : void {}",
"private function _updateIndexes()\n\t{\n\t\t$class = get_called_class();\n\t\tforeach($this->_data as $k => $v)\n\t\t{\n\t\t\tif(@in_array($k, $class::$_indexes))\n\t\t\t{\n\t\t\t\t$f = new Factory();\n\t\t\t\t$f->insert()\n\t\t\t\t\t->table('indexes')\n\t\t\t\t\t->fields(array(\n\t\t\t\t\t\t\t'id',\n\t\t\t\t\t\t\t'name',\n\t\t\t\t\t\t\t'value',\n\t\t\t\t\t\t\t'object',\n\t\t\t\t\t\t\t'objectType',\n\t\t\t\t\t\t\t'user'\n\t\t\t\t\t\t\t\n\t\t\t\t\t))\n\t\t\t\t\t->values(array(\n\t\t\t\t\t\t\t'',\n\t\t\t\t\t\t\t$k,\n\t\t\t\t\t\t\t$v,\n\t\t\t\t\t\t\t$this->_id,\n\t\t\t\t\t\t\t$this->_type,\n\t\t\t\t\t\t\t$this->_user\n\t\t\t\t\t))\n\t\t\t\t\t->onDuplicateUpdate(array(\n\t\t\t\t\t\t\t'value' => $v\n\t\t\t\t\t));\n\t\t\t\t\t\n\t\t\t\tCoreDB::query($f);\n\t\t\t}\n\t\t}\n\t}",
"function connect(Vertex $to)\n {\n $this->connections[spl_object_hash($to)] = $to;\n }",
"public function insertVertex($v){\n $this->adjList[$v] = array(); //create an empty adjacent array for given vertex\n }",
"private function addHashTableElem(string $path, int $index)\n {\n $this->hashTable[$path] = $index;\n }",
"protected abstract function createVariantsMap();",
"public function addVertex(VertexInterface $vertex);",
"public function getStartVertex(): VertexInterface;",
"public function vertices();",
"private function createDijkstraGraph() {\n $keys = $this->getRelationKeys();\n $t = array();\n foreach ($keys as $k) {\n $s = explode(':', $k);\n $t[$s[1]][$s[2]] = 1;\n $t[$s[2]][$s[1]] = 1;\n }\n return $t;\n }",
"private function initIndexes(): void\n {\n if (empty($this->uniques)) {\n return;\n }\n\n $this->indexes = [];\n foreach ($this->uniques as $key) {\n $values = \\array_column($this->rows, $key);\n $values = \\array_map('json_encode', $values);\n $this->indexes[$key] = \\array_flip($values);\n }\n }",
"public function setMapping(IndexInterface $index, $type, array $attributes);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the public 'web_profiler.controller.exception' shared service. | protected function getWebProfiler_Controller_ExceptionService()
{
return $this->services['web_profiler.controller.exception'] = new \Symfony\Bundle\WebProfilerBundle\Controller\ExceptionController(${($_ = isset($this->services['profiler']) ? $this->services['profiler'] : $this->get('profiler', ContainerInterface::NULL_ON_INVALID_REFERENCE)) && false ?: '_'}, ${($_ = isset($this->services['twig']) ? $this->services['twig'] : $this->get('twig')) && false ?: '_'}, true);
} | [
"protected function getWebProfiler_Controller_ExceptionService()\n {\n return $this->services['web_profiler.controller.exception'] = new \\Symfony\\Bundle\\WebProfilerBundle\\Controller\\ExceptionController($this->get('profiler', ContainerInterface::NULL_ON_INVALID_REFERENCE), $this->get('twig'), true);\n }",
"protected function getWebProfiler_Controller_ExceptionService()\n {\n @trigger_error('The \"web_profiler.controller.exception\" service is deprecated since Symfony 4.4, use the \"web_profiler.controller.exception_panel\" service instead.', E_USER_DEPRECATED);\n\n return $this->services['web_profiler.controller.exception'] = new \\Symfony\\Bundle\\WebProfilerBundle\\Controller\\ExceptionController(($this->services['profiler'] ?? $this->getProfilerService()), ($this->services['twig'] ?? $this->getTwigService()), true, ($this->privates['debug.file_link_formatter'] ?? $this->getDebug_FileLinkFormatterService()), ($this->privates['error_handler.error_renderer.html'] ?? $this->getErrorHandler_ErrorRenderer_HtmlService()));\n }",
"protected function getTwig_Controller_ExceptionService()\n {\n return $this->services['twig.controller.exception'] = new \\Symfony\\Bundle\\TwigBundle\\Controller\\ExceptionController($this->get('twig'), true);\n }",
"protected function getExceptionControllerService()\n {\n include_once \\dirname(__DIR__, 4).'/vendor/symfony/twig-bundle/Controller/ExceptionController.php';\n include_once \\dirname(__DIR__, 4).'/src/Controller/ExceptionController.php';\n\n return $this->services['App\\\\Controller\\\\ExceptionController'] = new \\App\\Controller\\ExceptionController(($this->services['kernel'] ?? $this->get('kernel', 1)), ($this->services['twig'] ?? $this->getTwigService()), true, $this);\n }",
"protected function getTwig_Controller_ExceptionService()\n {\n return $this->services['twig.controller.exception'] = new \\Symfony\\Bundle\\TwigBundle\\Controller\\ExceptionController(${($_ = isset($this->services['twig']) ? $this->services['twig'] : $this->get('twig')) && false ?: '_'}, true);\n }",
"protected function getWebProfiler_Controller_ExceptionPanelService()\n {\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\web-profiler-bundle\\\\Controller\\\\ExceptionPanelController.php';\n\n return $this->services['web_profiler.controller.exception_panel'] = new \\Symfony\\Bundle\\WebProfilerBundle\\Controller\\ExceptionPanelController(($this->privates['error_handler.error_renderer.html'] ?? $this->getErrorHandler_ErrorRenderer_HtmlService()), ($this->services['profiler'] ?? $this->getProfilerService()));\n }",
"public function get_exception(/* ... */)\n {\n return $this->_exception;\n }",
"protected function getTwig_Controller_ExceptionService()\n {\n return $this->services['twig.controller.exception'] = new \\Victoire\\Bundle\\TwigBundle\\Controller\\ExceptionController($this->get('twig'), false, $this->get('doctrine.orm.default_entity_manager'), $this->get('http_kernel'), $this->get('request_stack'), $this->get('router'), array(0 => 'fr', 1 => 'en'), 'fr');\n }",
"protected function getAvanzuAdminTheme_ExceptionControllerService()\n {\n return $this->services['avanzu_admin_theme.exception_controller'] = new \\Avanzu\\AdminThemeBundle\\Controller\\ExceptionController($this->get('twig'), false);\n }",
"protected function getDataCollector_ExceptionService()\n {\n return $this->privates['data_collector.exception'] = new \\Symfony\\Component\\HttpKernel\\DataCollector\\ExceptionDataCollector();\n }",
"protected function getTwig_Controller_ExceptionService()\n {\n @trigger_error('The \"twig.controller.exception\" service is deprecated since Symfony 4.4.', E_USER_DEPRECATED);\n\n return $this->services['twig.controller.exception'] = new \\Symfony\\Bundle\\TwigBundle\\Controller\\ExceptionController(($this->services['twig'] ?? $this->getTwigService()), false);\n }",
"protected function getTwig_Controller_ExceptionService()\n {\n @trigger_error('The \"twig.controller.exception\" service is deprecated since Symfony 4.4.', E_USER_DEPRECATED);\n\n return $this->services['twig.controller.exception'] = new \\Symfony\\Bundle\\TwigBundle\\Controller\\ExceptionController(($this->services['twig'] ?? $this->getTwigService()), true);\n }",
"public function getException()\n {\n return $this->getResponse()->getException();\n }",
"public function getException()\n {\n return $this->exception;\n }",
"protected function getExceptionHandlerService()\n {\n return $this->services['Mini\\\\Exception\\\\ExceptionHandler'] = new \\Mini\\Exception\\ExceptionHandler();\n }",
"protected function getKernelExceptionSubscriberService()\n {\n return $this->services['kernel_exception_subscriber'] = new \\phpbb\\event\\kernel_exception_subscriber($this->get('template'), $this->get('language'), false);\n }",
"public function getException(): Exception;",
"public function getException()\n {\n return new \\Exception($this->_statusMessage, $this->_statusCode);\n }",
"protected function getExceptionListenerService()\n {\n include_once \\dirname(__DIR__, 4).'/src/Listener/ExceptionListener.php';\n\n return $this->privates['App\\\\Listener\\\\ExceptionListener'] = new \\App\\Listener\\ExceptionListener('dev', true, ($this->services['monolog.logger.trace'] ?? $this->getMonolog_Logger_TraceService()));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get number of tests done Per County by age | function totalTestsPerCountyByAge($countyID,$filter,$currentmonth,$currentyear,$fromfilter,$tofilter,$fromdate,$todate)
{
if ($filter==0) //last submission
{
$sequel="SELECT sum(CASE WHEN age>15 THEN 1 ELSE 0 END),sum(CASE WHEN age Between 6 AND 15 THEN 1 ELSE 0 END),sum(CASE WHEN age Between 1 AND 5 THEN 1 ELSE 0 END)
FROM sample1
LEFT JOIN `facilitys` ON `sample1`.`facility` = `facilitys`.`facilitycode`
LEFT JOIN `districts` ON `districts`.`ID` = `facilitys`.`district`
LEFT JOIN `countys` ON `countys`.`ID` = `districts`.`county`
LEFT JOIN `provinces` ON `countys`.`province` = `provinces`.`ID`
WHERE `countys`.`ID` ='$countyID' AND MONTH(End_Time)='$currentmonth' AND YEAR(End_Time)='$currentyear' AND cond='1' ";
}
elseif ($filter==1)//last 6 months $fromdate$todate
{
$sequel="SELECT sum(CASE WHEN age>15 THEN 1 ELSE 0 END),sum(CASE WHEN age Between 6 AND 15 THEN 1 ELSE 0 END),sum(CASE WHEN age Between 1 AND 5 THEN 1 ELSE 0 END)
FROM sample1
LEFT JOIN `facilitys` ON `sample1`.`facility` = `facilitys`.`facilitycode`
LEFT JOIN `districts` ON `districts`.`ID` = `facilitys`.`district`
LEFT JOIN `countys` ON `countys`.`ID` = `districts`.`county`
LEFT JOIN `provinces` ON `countys`.`province` = `provinces`.`ID`
WHERE `countys`.`ID` ='$countyID' AND End_Time BETWEEN '$fromdate' AND '$todate' AND cond='1' ";
}
elseif ($filter==2)//cusomtize dates $fromfiler $tofilter
{
$sequel="SELECT sum(CASE WHEN age>15 THEN 1 ELSE 0 END),sum(CASE WHEN age Between 6 AND 15 THEN 1 ELSE 0 END),sum(CASE WHEN age Between 1 AND 5 THEN 1 ELSE 0 END)
FROM sample1
LEFT JOIN `facilitys` ON `sample1`.`facility` = `facilitys`.`facilitycode`
LEFT JOIN `districts` ON `districts`.`ID` = `facilitys`.`district`
LEFT JOIN `countys` ON `countys`.`ID` = `districts`.`county`
LEFT JOIN `provinces` ON `countys`.`province` = `provinces`.`ID`
WHERE `countys`.`ID` ='$countyID' AND End_Time BETWEEN '$fromfilter' AND '$tofilter' AND cond='1' ";
}
elseif ($filter==3)//month/year
{
$sequel="SELECT sum(CASE WHEN age>15 THEN 1 ELSE 0 END),sum(CASE WHEN age Between 6 AND 15 THEN 1 ELSE 0 END),sum(CASE WHEN age Between 1 AND 5 THEN 1 ELSE 0 END)
FROM sample1
LEFT JOIN `facilitys` ON `sample1`.`facility` = `facilitys`.`facilitycode`
LEFT JOIN `districts` ON `districts`.`ID` = `facilitys`.`district`
LEFT JOIN `countys` ON `countys`.`ID` = `districts`.`county`
LEFT JOIN `provinces` ON `countys`.`province` = `provinces`.`ID`
WHERE `countys`.`ID` ='$countyID' AND MONTH(End_Time)='$currentmonth' AND YEAR(End_Time)='$currentyear' AND cond='1' ";
}
elseif ($filter==4)//year only
{
$sequel="SELECT sum(CASE WHEN age>15 THEN 1 ELSE 0 END),sum(CASE WHEN age Between 6 AND 15 THEN 1 ELSE 0 END),sum(CASE WHEN age Between 1 AND 5 THEN 1 ELSE 0 END)
FROM sample1
LEFT JOIN `facilitys` ON `sample1`.`facility` = `facilitys`.`facilitycode`
LEFT JOIN `districts` ON `districts`.`ID` = `facilitys`.`district`
LEFT JOIN `countys` ON `countys`.`ID` = `districts`.`county`
LEFT JOIN `provinces` ON `countys`.`province` = `provinces`.`ID`
WHERE `countys`.`ID` ='$countyID' AND YEAR(End_Time)='$currentyear' AND cond='1' ";
}
elseif ($filter==7) //last 6 months $fromdate$todate
{
$sequel="SELECT sum(CASE WHEN age>15 THEN 1 ELSE 0 END),sum(CASE WHEN age Between 6 AND 15 THEN 1 ELSE 0 END),sum(CASE WHEN age Between 1 AND 5 THEN 1 ELSE 0 END)
FROM sample1
LEFT JOIN `facilitys` ON `sample1`.`facility` = `facilitys`.`facilitycode`
LEFT JOIN `districts` ON `districts`.`ID` = `facilitys`.`district`
LEFT JOIN `countys` ON `countys`.`ID` = `districts`.`county`
LEFT JOIN `provinces` ON `countys`.`province` = `provinces`.`ID`
WHERE `countys`.`ID` ='$countyID' AND End_Time BETWEEN '$fromdate' AND '$todate' AND cond='1' ";
}
elseif ($filter==8) //all
{
$sequel="SELECT sum(CASE WHEN age>15 THEN 1 ELSE 0 END),sum(CASE WHEN age Between 6 AND 15 THEN 1 ELSE 0 END),sum(CASE WHEN age Between 1 AND 5 THEN 1 ELSE 0 END)
FROM sample1
LEFT JOIN `facilitys` ON `sample1`.`facility` = `facilitys`.`facilitycode`
LEFT JOIN `districts` ON `districts`.`ID` = `facilitys`.`district`
LEFT JOIN `countys` ON `countys`.`ID` = `districts`.`county`
LEFT JOIN `provinces` ON `countys`.`province` = `provinces`.`ID`
WHERE `countys`.`ID` ='$countyID' AND cond='1' ";
}
$resultReport=mysql_query($sequel);
$resultArr=mysql_fetch_array($resultReport);
return $resultArr;
} | [
"public static function countPerfectsByAge($year = null)\n {\n $table = Result::getTableName();\n\n if ($year == null || $year < Config::get('dopey.firstYear')) {\n $year = Config::get('dopey.lastYear');\n }\n\n $sql = \"\n SELECT age, COUNT(*) AS count\n FROM $table \n WHERE id IN (SELECT MAX(id) AS id \n FROM $table \n WHERE year <= $year \n GROUP BY runner_id \n HAVING COUNT(runner_id) = ($year - (\".Config::get('dopey.firstYear').\" - 1))) \n GROUP BY age \n ORDER BY age ASC\n \";\n\n $query = \\DB::select($sql);\n\n return $query;\n }",
"public static function countByAge($mode = 'overall')\n {\n $table = Result::getTableName();\n\n if ($mode == 'perfect') {\n return Result::countForYearByAge(Config::get('dopey.lastYear'), $mode);\n }\n else {\n $sql = \"\n SELECT t1.age, COUNT(t1.age) AS count \n FROM (SELECT or1.runner_id, MAX(or1.age) AS age \n FROM $table or1 \n WHERE or1.age >= 18\n GROUP BY or1.runner_id) AS t1 \n GROUP BY t1.age \n ORDER BY t1.age ASC\n \";\n }\n\n return \\DB::select($sql);\n }",
"function totalTestsPerCountyByAge1($countyID,$filter,$currentmonth,$currentyear,$fromfilter,$tofilter,$fromdate,$todate)\n\t {\n\t if ($filter==0) //last submission\n\t {\n\t $sequel=\"SELECT sum(CASE WHEN age>15 THEN 1 ELSE 0 END),sum(CASE WHEN age Between 6 AND 15 THEN 1 ELSE 0 END),sum(CASE WHEN age Between 0 AND 5 THEN 1 ELSE 0 END)\n FROM sample1\nLEFT JOIN `facilitys` ON `sample1`.`facility` = `facilitys`.`facilitycode`\nLEFT JOIN `districts` ON `districts`.`ID` = `facilitys`.`district`\nLEFT JOIN `countys` ON `countys`.`ID` = `districts`.`county`\nLEFT JOIN `provinces` ON `countys`.`province` = `provinces`.`ID`\nWHERE `countys`.`ID` ='$countyID' AND MONTH(End_Time)='$currentmonth' AND YEAR(End_Time)='$currentyear' AND cond='1' \";\n\n\t }\n\t elseif ($filter==1)//last 6 months $fromdate$todate\n\t {\n\t $sequel=\"SELECT sum(CASE WHEN age>15 THEN 1 ELSE 0 END),sum(CASE WHEN age Between 6 AND 15 THEN 1 ELSE 0 END),sum(CASE WHEN age Between 0 AND 5 THEN 1 ELSE 0 END)\n FROM sample1\nLEFT JOIN `facilitys` ON `sample1`.`facility` = `facilitys`.`facilitycode`\nLEFT JOIN `districts` ON `districts`.`ID` = `facilitys`.`district`\nLEFT JOIN `countys` ON `countys`.`ID` = `districts`.`county`\nLEFT JOIN `provinces` ON `countys`.`province` = `provinces`.`ID`\nWHERE `countys`.`ID` ='$countyID' AND End_Time BETWEEN '$fromdate' AND '$todate' AND cond='1' \";\n\t }\n\t elseif ($filter==2)//cusomtize dates $fromfiler $tofilter\n\t {\n\t \t $sequel=\"SELECT sum(CASE WHEN age>15 THEN 1 ELSE 0 END),sum(CASE WHEN age Between 6 AND 15 THEN 1 ELSE 0 END),sum(CASE WHEN age Between 0 AND 5 THEN 1 ELSE 0 END)\n FROM sample1\nLEFT JOIN `facilitys` ON `sample1`.`facility` = `facilitys`.`facilitycode`\nLEFT JOIN `districts` ON `districts`.`ID` = `facilitys`.`district`\nLEFT JOIN `countys` ON `countys`.`ID` = `districts`.`county`\nLEFT JOIN `provinces` ON `countys`.`province` = `provinces`.`ID`\nWHERE `countys`.`ID` ='$countyID' AND End_Time BETWEEN '$fromfilter' AND '$tofilter' AND cond='1' \";\n\t }\n\t elseif ($filter==3)//month/year\n\t {\n\t $sequel=\"SELECT sum(CASE WHEN age>15 THEN 1 ELSE 0 END),sum(CASE WHEN age Between 6 AND 15 THEN 1 ELSE 0 END),sum(CASE WHEN age Between 0 AND 5 THEN 1 ELSE 0 END)\n FROM sample1\nLEFT JOIN `facilitys` ON `sample1`.`facility` = `facilitys`.`facilitycode`\nLEFT JOIN `districts` ON `districts`.`ID` = `facilitys`.`district`\nLEFT JOIN `countys` ON `countys`.`ID` = `districts`.`county`\nLEFT JOIN `provinces` ON `countys`.`province` = `provinces`.`ID`\nWHERE `countys`.`ID` ='$countyID' AND MONTH(End_Time)='$currentmonth' AND YEAR(End_Time)='$currentyear' AND cond='1' \";\n \t }\n\t elseif ($filter==4)//year only\n\t {\n\t $sequel=\"SELECT sum(CASE WHEN age>15 THEN 1 ELSE 0 END),sum(CASE WHEN age Between 6 AND 15 THEN 1 ELSE 0 END),sum(CASE WHEN age Between 0 AND 5 THEN 1 ELSE 0 END)\n FROM sample1\nLEFT JOIN `facilitys` ON `sample1`.`facility` = `facilitys`.`facilitycode`\nLEFT JOIN `districts` ON `districts`.`ID` = `facilitys`.`district`\nLEFT JOIN `countys` ON `countys`.`ID` = `districts`.`county`\nLEFT JOIN `provinces` ON `countys`.`province` = `provinces`.`ID`\nWHERE `countys`.`ID` ='$countyID' AND YEAR(End_Time)='$currentyear' AND cond='1' \";\n\t }\n\t elseif ($filter==7) //last 6 months $fromdate$todate\n\t {\n\t \t $sequel=\"SELECT sum(CASE WHEN age>15 THEN 1 ELSE 0 END),sum(CASE WHEN age Between 6 AND 15 THEN 1 ELSE 0 END),sum(CASE WHEN age Between 0 AND 5 THEN 1 ELSE 0 END)\n FROM sample1\nLEFT JOIN `facilitys` ON `sample1`.`facility` = `facilitys`.`facilitycode`\nLEFT JOIN `districts` ON `districts`.`ID` = `facilitys`.`district`\nLEFT JOIN `countys` ON `countys`.`ID` = `districts`.`county`\nLEFT JOIN `provinces` ON `countys`.`province` = `provinces`.`ID`\nWHERE `countys`.`ID` ='$countyID' AND End_Time BETWEEN '$fromdate' AND '$todate' AND cond='1' \";\n\t }\n\t elseif ($filter==8) //all\n\t {\n\t \t $sequel=\"SELECT sum(CASE WHEN age>15 THEN 1 ELSE 0 END),sum(CASE WHEN age Between 6 AND 15 THEN 1 ELSE 0 END),sum(CASE WHEN age Between 0 AND 5 THEN 1 ELSE 0 END)\n FROM sample1\nLEFT JOIN `facilitys` ON `sample1`.`facility` = `facilitys`.`facilitycode`\nLEFT JOIN `districts` ON `districts`.`ID` = `facilitys`.`district`\nLEFT JOIN `countys` ON `countys`.`ID` = `districts`.`county`\nLEFT JOIN `provinces` ON `countys`.`province` = `provinces`.`ID`\nWHERE `countys`.`ID` ='$countyID' AND cond='1' \";\n\t }\n\t \n\t $resultReport=mysql_query($sequel);\n\t $resultArr=mysql_fetch_array($resultReport);\n\t return $resultArr;\n\t\t\n\t }",
"function count_county_member_in_project($project, $county) {\n $this->db->where('project', $project);\n $this->db->where('county', $county);\n $this->db->where('year', date(\"Y\")-1911);\n return $this->db->get('member')->num_rows();\n }",
"public function tester_amount() {\n return count(TestFase::groupBy(\"tester\")->get());\n }",
"private function getAgeLoad(): int\n {\n return $this->formula(self::collectAges($this->data->get('age')))->sum();\n }",
"public function calcAgeDataProvider() {}",
"public function get_total_person_counts_by_county($county)\n\n\t{\n\n\n\n\t\t$sql=\"\tSELECT COUNT( a.person_id ) AS total_person_count\n\n\t\t\t\tFROM (\t\n\n\n\n\t\t\t\tSELECT DISTINCT p_e.person_id\n\n\t\t\t\tFROM personevents p_e \n\n\t\t\t\tJOIN facility f ON f.mflcode=p_e.facility_mflcode\n\n\t\t\t\tWHERE f.county = '\";\n\n\t\t$sql.=$county;\n\n\t\t$sql.=\"'\t) a\";\n\n\n\n\t\t$query=$this->db->query($sql);\n\n\n\n\t\tif($query->num_rows()==1)\n\n\t\t{\n\n\t\t\treturn $query->row();\n\n\t\t}\n\n\t\telse\n\n\t\t{\n\n\t\t\treturn false;\n\n\t\t}\n\n\n\n\t}",
"public function countWellnessAge($data) {\n $gender = $data['gender'];\n $dob = $data['dob'];\n $age = CommonHelper::getAgeFromDOB($dob);\n\n $height = $data['height'];\n $heightUnit = $data['heightUnit'];\n\n if ($heightUnit == Constant::$HEIGHT_IN_FEET)\n $height = CommonHelper::getHeightInCm($height);\n\n $weight = $data['weight'];\n $weightUnit = $data['weightUnit'];\n\n if ($weightUnit == Constant::$WEIGHT_IN_LBS)\n $weight = CommonHelper::getWeightInKg($weight);\n\n $cigrattesPerDay = $data['cigrattesPerDay'];\n $exerciseHourPerWeek = $data['exerciseHourPerWeek'];\n $exerciseIntensity = $data['exerciseIntensity'];\n $eatingHabit = $data['eatingHabit'];\n $bloodPresure = $data['bloodPresure'];\n $stressLevel = $data['stressLevel'];\n $sleepHours = $data['sleepHour'];\n $happiness = $data['happiness'];\n $diabetes = $data['diabetes'];\n\n $weightAsPerHeight = $weight / $height;\n\n\n $weightCheck = self::countWeightCheck($gender, $height, $weightAsPerHeight);\n\n $smokerCheck = self::countSmokerCheck($age, $cigrattesPerDay);\n\n $exerciseCheck = self::countExerciseCheck($exerciseIntensity, $exerciseHourPerWeek);\n\n $dietCheck = ($eatingHabit - 3) * -1.5;\n\n $bloodPresureCheck = self::countBloodPresureCheck($bloodPresure);\n\n $stressCheck = ($stressLevel - 5) / 2;\n\n $sleepCheck = self::countSleepHourCheck($sleepHours);\n\n $happinessCheck = ($happiness - 3) * -0.75;\n \n $diabetesCheck = ($diabetes == Constant::$DIABETES_YES)?1:0;\n \n\n $checkSum = $weightCheck + $smokerCheck + $exerciseCheck + $dietCheck + $bloodPresureCheck + $stressCheck + $sleepCheck + $happinessCheck + $diabetesCheck;\n\n $wellnessAge = round($age + $checkSum);\n return $wellnessAge;\n }",
"public static function countForYearByAge($year = null, $mode = 'overall')\n {\n $table = Result::getTableName();\n\n if ($year == null || $year < Config::get('dopey.firstYear')) {\n $year = Config::get('dopey.lastYear');\n }\n\n if ($mode == 'perfect') {\n $sql = \"\n SELECT age, COUNT(*) AS count\n FROM $table \n WHERE id IN (SELECT MAX(id) AS id \n FROM $table \n WHERE year <= $year \n GROUP BY runner_id \n HAVING COUNT(runner_id) = ($year - (\".Config::get('dopey.firstYear').\" - 1))) \n AND age >= 18 \n GROUP BY age \n ORDER BY age ASC\n \";\n }\n else {\n $sql = \"\n SELECT age, COUNT(*) AS count\n FROM $table \n WHERE year = $year \n AND age >= 18 \n GROUP BY age \n ORDER BY age ASC\n \";\n }\n\n return \\DB::select($sql);\n }",
"function countTestCases() {}",
"public function testAge()\n {\n $prixList = ['enfant' => 0, 'junior' => 8, 'adulte' => 16, 'senior' => 12];\n $age = new P4Forms($prixList);\n $result = $age->age(\\date_create('1997-06-05'), \\date_create('2017-12-12'));\n\n $this->assertEquals(20, $result);\n }",
"public function estimateCount(): int;",
"function Getnooftestsindec($province,$year)\n{\n$startdate=$year.\"-12-1\";\n$enddate=$year.\"-12-31\";\n\n$strQuery=mysql_query(\"SELECT COUNT(samples.ID) as 'noofprovincialtests' FROM samples,patients,facilitys,districts WHERE samples.patientid=patients.AutoID AND samples.result IS NOT NULL AND YEAR(samples.datetested)='$year' AND ((samples.datetested >=$startdate) AND (samples.datetested <=$enddate)) AND samples.facility=facilitys.ID AND facilitys.district=districts.ID AND districts.province='$province'\")or die(mysql_error());\n$resultarray=mysql_fetch_array($strQuery);\n$provincialtests=$resultarray['noofprovincialtests'];\nreturn $provincialtests;\n}",
"public function calcAge()\n {\n $now = new DateTime();\n $dob = new DateTime($this->dob);\n $this->age = $now->diff($dob)->y;\n }",
"public function printAge(){\n $time = time(); // Store time for consistency\n\n if (isset($this->data_nasc) && !empty($this->data_nasc)) {\n list($birthYear, $birthMonth, $birthDay) = explode(\"-\", $this->data_nasc);\n $day = 60 * 60 * 24;\n $year = $day * 365;\n $thisYear = date(\"Y\", $time);\n $numYears = $thisYear - $birthYear;\n $leapYears = $numYears / 4 * $day; // Calculate for accuracy\n $ageTime = mktime(0, 0, 0, $birthMonth, $birthDay, $birthYear);\n $age = $time - $ageTime - $leapYears;\n echo floor($age / $year).\" anos\";\n }\n }",
"function Getnooftestsinmay($province,$year)\n{\n\n$startdate=$year.\"-05-01\";\n$enddate=$year.\"-05-31\";\n$strQuery=mysql_query(\"SELECT COUNT(samples.ID) as 'noofprovincialtests' FROM samples,patients,facilitys,districts WHERE samples.patientid=patients.AutoID AND samples.result IS NOT NULL AND YEAR(samples.datetested)='$year' AND (samples.datetested >='$startdate' AND samples.datetested <='$enddate') AND samples.facility=facilitys.ID AND facilitys.district=districts.ID AND districts.province='$province'\")or die(mysql_error());\n\n$resultarray=mysql_fetch_array($strQuery);\n$provincialtests=$resultarray['noofprovincialtests'];\nreturn $provincialtests;\n}",
"function Getnooftestsinapril($province,$year)\n{\n\n$startdate=$year.\"-04-01\";\n$enddate=$year.\"-04-30\";\n$strQuery=mysql_query(\"SELECT COUNT(samples.ID) as 'noofprovincialtests' FROM samples,patients,facilitys,districts WHERE samples.patientid=patients.AutoID AND samples.result IS NOT NULL AND YEAR(samples.datetested)='$year' AND (samples.datetested >='$startdate' AND samples.datetested <='$enddate') AND samples.facility=facilitys.ID AND facilitys.district=districts.ID AND districts.province='$province'\")or die(mysql_error());\n\n$resultarray=mysql_fetch_array($strQuery);\n$provincialtests=$resultarray['noofprovincialtests'];\nreturn $provincialtests;\n}",
"function calculateAge ($person_arr){\n //getts current year via Y\n $current_year = date(\"Y\");\n //gets age\n $age = $current_year - $person_arr[\"birth_year\"];\n return $age;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Use this to get a specific value from the vector. If $i is passed, it must be an integer, and is equivalent to the array index for the vector. If $i is not passed, method will return the arraylevel vector. | public function get($i = null)
{
if ($i === null)
{
return $this->vect;
}
else
{
if (isset($this->vect[$i]))
{
return $this->vect[$i];
}
else
{
throw new MathException('Index {$i} of vector was not found.', 2);
}
}
} | [
"function get_scalar($var , $i) {\n\n if (is_array($var))\n return $var[$i];\n else\n return $var;\n}",
"public function getValue($index){\n\t\treturn $this->values[$index];\n\t}",
"function at($i){\n\t\tif(($i < count($this->data)&&($i>=0))){\n\t\t\treturn $this->data[$i];\n\t\t}else{\n\t\t\treturn \"\";\n\t\t}\n\t}",
"public function getValue(array $position);",
"public function get(int $index): mixed;",
"public function elementAt($i)\n {\n $absIndex = $this->p + $i;\n if ($absIndex >= count($this->data)) {\n throw new \\OutOfRangeException(\"queue index \" + $absIndex + \" > last index \" + (count($this->data) - 1));\n }\n if ($absIndex < 0) {\n throw new \\OutOfRangeException(\"queue index \" + $absIndex + \" < 0\");\n }\n if ($absIndex > $this->range)\n $this->range = $absIndex;\n return $this->data[$absIndex];\n }",
"public function vectorAt($length_)\n\t{\n\t\t$dx = $this->end->x() - $this->start->x();\n\t\t$dy = $this->end->y() - $this->start->y();\n\t\t$v = new Vector($dx,$dy);\n\t\t$v = $v->unit();\n\t\t\n\t\treturn $v;\n\t}",
"public function getValue($index = 0) {\n if (isset($this->value[$index])) {\n return $this->value[$index];\n }\n return NULL;\n }",
"function value($arg = -1)\r\n {\r\n\t\tif ($arg == -1)\r\n {\r\n\t return $this->Array;\r\n\t\t}\r\n else\r\n {\r\n\t return $this->Array[$arg]->Value();\r\n\t\t}\r\n }",
"public function value($iteration) {\n return $iteration[1];\n }",
"public function getArgument($index);",
"public function get(int $index);",
"public function getCell($index) {return $this->values[$index];}",
"public function remove($i) {\n if (($i > $this->getSize()) || !isset($this->_vector[$i])) {\n return null;\n }\n\n $ret = $this->_vector[$i];\n $this->_vector[$i] = null;\n unset($this->_vector[$i]);\n $this->_vector = array_merge($this->_vector);\n return $ret;\n }",
"public function getDouble($i);",
"function getArrayValue($arrValues, $index) {\n $ret = NULL;\n foreach($arrValues[$index] as $key => $value) {\n if($key == 'value') {\n $ret = $value;\n }\n }\n return $ret;\n}",
"public function getForecastElement($index)\n{\nreturn $this->forecast[$index];\n}",
"function get(int $index)\n {\n return $this->values[$index] ?? null;\n }",
"public function getVelocity(): Vector\n {\n return $this->object->get('velocity');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the deletedDateTime property value. The date and time when the shared cookie was deleted. | public function setDeletedDateTime(?DateTime $value): void {
$this->getBackingStore()->set('deletedDateTime', $value);
} | [
"public function setDeletedTime(\\DateTime $deletedTime)\n {\n $this->deletedTime = $deletedTime;\n }",
"public function setDeletedDateTime($val)\n {\n $this->_propDict[\"deletedDateTime\"] = $val;\n return $this;\n }",
"public function setDeleted(&$var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Timestamp::class);\n $this->deleted = $var;\n }",
"public function setDeletedAt(?DateTimeInterface $dt)\n {\n $this->deletedAt = $dt;\n }",
"public function setDeletedAtAttribute($value)\n {\n $this->attributes['deleted_at'] = $value;\n }",
"public function setDeleteTime($timestamp);",
"public function setExpires($datetime);",
"public function softDelete()\n {\n $this->dateTime('deleted_at');\n }",
"public function setDate_deleted($sDate_deleted)\n {\n if( is_null($sDate_deleted) ) $sDate_deleted='';\n $this->sDate_deleted = $sDate_deleted;\n $this->aDataSet[\"date_deleted\"]=1;\n }",
"public function getDeletedDate()\r\n {\r\n return $this->_deletedDate;\r\n }",
"public function setDeletedtime($v)\n\t{\n\t\t// we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')\n\t\t// -- which is unexpected, to say the least.\n\t\tif ($v === null || $v === '') {\n\t\t\t$dt = null;\n\t\t} elseif ($v instanceof DateTime) {\n\t\t\t$dt = $v;\n\t\t} else {\n\t\t\t// some string/numeric value passed; we normalize that so that we can\n\t\t\t// validate it.\n\t\t\ttry {\n\t\t\t\tif (is_numeric($v)) { // if it's a unix timestamp\n\t\t\t\t\t$dt = new DateTime('@'.$v, new DateTimeZone('UTC'));\n\t\t\t\t\t// We have to explicitly specify and then change the time zone because of a\n\t\t\t\t\t// DateTime bug: http://bugs.php.net/bug.php?id=43003\n\t\t\t\t\t$dt->setTimeZone(new DateTimeZone(date_default_timezone_get()));\n\t\t\t\t} else {\n\t\t\t\t\t$dt = new DateTime($v);\n\t\t\t\t}\n\t\t\t} catch (Exception $x) {\n\t\t\t\tthrow new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);\n\t\t\t}\n\t\t}\n\n\t\tif ( $this->deletedtime !== null || $dt !== null ) {\n\t\t\t// (nested ifs are a little easier to read in this case)\n\n\t\t\t$currNorm = ($this->deletedtime !== null && $tmpDt = new DateTime($this->deletedtime)) ? $tmpDt->format('H:i:s') : null;\n\t\t\t$newNorm = ($dt !== null) ? $dt->format('H:i:s') : null;\n\n\t\t\tif ( ($currNorm !== $newNorm) // normalized values don't match \n\t\t\t\t\t)\n\t\t\t{\n\t\t\t\t$this->deletedtime = ($dt ? $dt->format('H:i:s') : null);\n\t\t\t\t$this->modifiedColumns[] = OnlinecustomerPeer::DELETEDTIME;\n\t\t\t}\n\t\t} // if either are not null\n\n\t\treturn $this;\n\t}",
"public function setDeletedAt($v)\n {\n $dt = PropelDateTime::newInstance($v, null, 'DateTime');\n if ($this->deleted_at !== null || $dt !== null) {\n if ($this->deleted_at === null || $dt === null || $dt->format(\"Y-m-d H:i:s\") !== $this->deleted_at->format(\"Y-m-d H:i:s\")) {\n $this->deleted_at = $dt === null ? null : clone $dt;\n $this->modifiedColumns[UserTableMap::COL_DELETED_AT] = true;\n }\n } // if either are not null\n\n return $this;\n }",
"public function getDeletedTime()\n {\n return $this->deletedTime;\n }",
"public function delete() {\n\t\tif (static::$soft_delete) {\n\t\t\t$this->deleted_at = new \\DateTime;\n\t\t\t$this->save();\n\t\t}\n\t\telse {\n\t\t\tparent::delete();\n\t\t}\n\t}",
"public function getDeletedDate() {\n return $this->deletedDate;\n }",
"public function getDeletedDate()\n {\n return $this->deletedDate;\n }",
"public function delete()\r\n\t{\r\n\t\t// Affecte le 01-01-1980 comme date d'expiration\r\n\t\t$this->setExpires(315554400);\r\n\t\t\r\n\t\t// Effacement global\r\n\t\tself::_eraseCookie($this->_name);\r\n\t}",
"public function setDeletedtime($v)\n {\n $dt = PropelDateTime::newInstance($v, null, 'DateTime');\n if ($this->deletedtime !== null || $dt !== null) {\n $currentDateAsString = ($this->deletedtime !== null && $tmpDt = new DateTime($this->deletedtime)) ? $tmpDt->format('H:i:s') : null;\n $newDateAsString = $dt ? $dt->format('H:i:s') : null;\n if ($currentDateAsString !== $newDateAsString) {\n $this->deletedtime = $newDateAsString;\n $this->modifiedColumns[] = ProjectdetailsPeer::DELETEDTIME;\n }\n } // if either are not null\n\n\n return $this;\n }",
"public function setDeleted($deleted = TRUE)\n {\n $this->deleted = (bool) $deleted;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Show the form for creating a new massMediaAboutUs. | public function create()
{
return view('backend.mass_media_aboutuses.create');
} | [
"public function actionCreate()\n {\n $model = new UnidadeMedida();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->codUnidadeMedida]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function newAction()\n {\n $entity = new Media();\n $form = $this->createCreateForm($entity);\n\n return $this->render('SiteMainBundle:Backend/Media:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }",
"public function actionCreate()\n {\n $model = new Mobil();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'no_mobil' => $model->no_mobil, 'nopol' => $model->nopol]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function create()\n\t{\n\t\treturn view('anneeUs.create');\n\t}",
"public function showNewForm()\n {\n return view('admin.user_new_form');\n }",
"public function create()\n {\n return view('centro_medicos.create');\n }",
"public function newAction()\n {\n if (!$this->isGranted('CREATE', new PublisherManagers())) {\n throw new AccessDeniedException(\"You are not authorized for this page!\");\n }\n $entity = new PublisherManagers();\n $form = $this->createCreateForm($entity);\n\n return $this->render(\n 'OjsAdminBundle:AdminPublisherManagers:new.html.twig',\n array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n )\n );\n }",
"public function create()\n\t{\n\t \n\t \n\t return view('admin.media.create');\n\t}",
"public function create()\n {\n BreadcrumbsRegister::Register($this->ModelName,$this->BreadCrumbName);\n return view('admin.mechanics.create');\n }",
"public function actionCreate()\n {\n $model = new MusrenbangSkpdMedia();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'Kd_Musrenbang_Kecamatan' => $model->Kd_Musrenbang_Kecamatan, 'Kd_Media' => $model->Kd_Media]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function newAction()\n {\n $entity = new Media();\n \n $thumbformat = new Format();\n $entity->addFormat($thumbformat);\n \n $form = $this->createForm(new MediaType(), $entity);\n\n return $this->render('ACInst3MediaBundle:Media:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView()\n ));\n }",
"public function newAction()\n {\n $request = $this->getRequest();\n \n $form = new Application_Model_Admin_NewUserForm();\n $this->view->pageTitle = \"Admin New Member Contact\";\n $this->view->form = $form;\n\n $this->view->headScript()->appendFile($this->view->baseUrl('admin.js'));\n $this->view->headScript()->appendFile($this->view->baseUrl('utility.js'));\n \n \n // Verify Post\n if( $request->isPost() ){\n $this->handleNewForm($form);\n }\n \n }",
"public function action_new() {\n \n $article = new Model_Article();\n \n $this->template->title = \"Nuevo Artículo\";\n $this->template->content = View::factory('article/dashboard/form')\n ->bind('article', $article);\n }",
"public function actionCreate()\n {\n $model = new Medic();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->ME_CODIGO]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Media(['scenario' => 'upload']);\n\n return $this->render('create', ['model' => $model]);\n }",
"public function newAction(Request $request)\n {\n $aboutUserMeta = new AboutUserMeta();\n $form = $this->createForm('Dt\\AdminBundle\\Form\\Type\\AboutUserMetaType', $aboutUserMeta);\n $form->handleRequest($request);\n\n if ($form->isSubmitted() && $form->isValid()) {\n \n $em = $this->getDoctrine()->getManager();\n $em->persist($aboutUserMeta);\n $em->flush();\n\n $message = $this->get('translator')->trans('form.about_user_meta.flash.add_success');\n \n $this->addFlash('success', $message);\n \n $form = $this->createForm('Dt\\AdminBundle\\Form\\Type\\AboutUserMetaType', new AboutUserMeta());\n }\n\n return $this->render('DtAdminBundle:AboutUserMeta:new.html.twig', array(\n 'aboutUserMeta' => $aboutUserMeta,\n 'form' => $form->createView(),\n ));\n }",
"public function newAction() {\n $entity = new Megaloman();\n $form = $this->createCreateForm($entity);\n\n return $this->render('MegalomanBundle:Megaloman:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }",
"public function newAction()\n {\n $entity = new Souscription();\n $form = $this->createForm(new SouscriptionType(), $entity);\n\n return $this->render('AdminBundle:Souscription:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n\t 'page_title' => 'Création d\\'une souscription'\n ));\n }",
"public function actionCreate()\n {\n $model = new Peminjaman();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If we provide line items and the amount matches the actual unit price sum of the item, then we just proceed with a full refund in Mollie including the line item data. | public function testIsFullRefundWithItems_ItemsAmountNotDifferent()
{
$order = $this->getOrder();
$request = new RefundRequest('', '', '', 0);
$request->addItem(new RefundRequestItem('line-1', 19.99, 1, 0));
$this->assertEquals(true, $request->isFullRefundWithItems($order));
} | [
"private static function calculate_refund_amount_from_line_items( $request ) {\n\t\t$line_items = $request['line_items'];\n\n\t\tif ( ! is_array( $line_items ) || empty( $line_items ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\t$amount = 0;\n\n\t\tforeach ( $line_items as $item ) {\n\t\t\tif ( ! isset( $item['refund_total'] ) || ! is_numeric( $item['refund_total'] ) ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t$amount += $item['refund_total'];\n\n\t\t\tif ( ! isset( $item['refund_tax'] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tforeach ( $item['refund_tax'] as $tax ) {\n\t\t\t\tif ( ! is_numeric( $tax ) ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\t$amount += $tax;\n\t\t\t}\n\t\t}\n\n\t\treturn $amount;\n\t}",
"public function testIsFullRefundWithItems_ItemsAmountDifferent()\n {\n $order = $this->getOrder();\n\n $request = new RefundRequest('', '', '', 0);\n $request->addItem(new RefundRequestItem('line-1', 4.99, 1, 0));\n\n $this->assertEquals(false, $request->isFullRefundWithItems($order));\n }",
"function refund($items, $qtyFieldName)\n {\n foreach ($items as $item) {\n $itemData = $item->getData();\n $infoBuyRequest = $itemData['product_options']['info_buyRequest'];\n\n if (!isset($infoBuyRequest['options'])) {\n continue;\n }\n\n $orderItemQtyReturned = $itemData[$qtyFieldName];\n $itemOptions = $infoBuyRequest['options'];\n\n $valueIds = [];\n foreach ($itemOptions as $optionId => $value) {\n if (is_array($value)) {\n foreach ($value as $valueId) {\n $valueIds[] = $valueId;\n }\n } else {\n $valueIds[] = $value;\n }\n }\n\n $valuesCollection = $this->valueCollection\n ->create()\n ->getValuesByOption($valueIds)\n ->load();\n\n if (!$valuesCollection->getSize()) {\n continue;\n }\n\n foreach ($valueIds as $valueId) {\n $valueModel = $valuesCollection->getItemById($valueId);\n\n if (!$valueModel) {\n continue;\n }\n\n if ($valueModel->getSku() || !$valueModel->getManageStock()) {\n continue;\n }\n\n $totalQtyReturned = $this->getTotalQtyReturned($valueModel, $infoBuyRequest, $orderItemQtyReturned);\n\n $valueModel->setQty($valueModel->getQty() + $totalQtyReturned);\n }\n\n $valuesCollection->save();\n }\n\n return $this;\n }",
"public function saleOrderPaymentRefund($observer)\n {\n $oCreditmemo = $observer['creditmemo'];\n $oOrder = $oCreditmemo->getOrder();\n foreach($oCreditmemo->getAllItems() as $_item){\n $giftCardsOrderCollection = Mage::getModel('giftcards/order')->getCollection()->addFieldToFilter('id_order', $oOrder->getId());\n foreach($giftCardsOrderCollection as $giftCardOrder){\n $giftCard = Mage::getModel('giftcards/giftcards')->load($giftCardOrder->getIdGiftcard());\n $hash_data = unserialize($giftCard->getHashData());\n $cardItem = $hash_data[$giftCardOrder->getIdGiftcard()];\n $orderItem = $_item->getOrderItem();\n $refundAmountArray = $cardItem['items'][$orderItem->getQuoteItemId()];\n $refundAmount = $refundAmountArray['item_discount'] / (isset($refundAmountArray['qty']) ? $refundAmountArray['qty'] : 1);\n if (is_null($giftCard->getCardCurrency()) || $giftCard->getCardCurrency() == $oOrder->getBaseCurrencyCode()) {\n $refundValue = $refundAmount * $_item->getQty();\n } else {\n $refundValue = Mage::helper('giftcards')->currencyConvert($refundAmount, $oOrder->getBaseCurrencyCode(), $giftCard->getCardCurrency()) * $_item->getQty();\n }\n if($refundValue > 0 ){\n $hash_data[$giftCardOrder->getIdGiftcard()]['items'][$orderItem->getQuoteItemId()]['item_discount'] = $hash_data[$giftCardOrder->getIdGiftcard()]['items'][$orderItem->getQuoteItemId()]['item_discount'] - $refundValue;\n $giftCard->setCardBalance($giftCard->getCardBalance() + $refundValue);\n $giftCard->setCardStatus(1);\n $giftCard->setHashData(serialize($hash_data));\n $giftCard->save();\n $oGiftCardOrder = Mage::getModel('giftcards/order');\n $oGiftCardOrder->setIdGiftcard($giftCard->getId());\n $oGiftCardOrder->setIdOrder($oOrder->getId());\n $oGiftCardOrder->setDiscounted(-(float)$refundValue);\n $oGiftCardOrder->save();\n }\n if($oCreditmemo->getShippingAmount() > 0){\n $refundValue = $hash_data[$giftCardOrder->getIdGiftcard()]['shipping_discount'];\n //if($refundValue){\n // $oCreditmemo->setShippingAmount(0);\n //}\n $hash_data[$giftCardOrder->getIdGiftcard()]['shipping_discount'] = 0 ;\n $giftCard->setCardBalance($giftCard->getCardBalance() + $refundValue);\n $giftCard->setCardStatus(1);\n $giftCard->setHashData(serialize($hash_data));\n $giftCard->save();\n $oGiftCardOrder = Mage::getModel('giftcards/order');\n $oGiftCardOrder->setIdGiftcard($giftCard->getId());\n $oGiftCardOrder->setIdOrder($oOrder->getId());\n $oGiftCardOrder->setDiscounted(-(float)$refundValue);\n $oGiftCardOrder->save();\n }\n }\n \n }\n }",
"public function refund($purchase);",
"public function doRefund() {\n if (isset($this->request->post['transaction_id']) && isset($this->request->post['refund_full'])) {\n \n $this->theme->model('payment/paypalexpress');\n $this->theme->language('payment/paypalexpress_refund');\n \n if ($this->request->post['refund_full'] == 0 && $this->request->post['amount'] == 0) {\n $this->session->data['error'] = $this->language->get('lang_error_partial_amt');\n } else {\n $order_id = $this->model_payment_paypalexpress->getOrderId($this->request->post['transaction_id']);\n $paypal_order = $this->model_payment_paypalexpress->getOrder($order_id);\n \n if ($paypal_order) {\n $call_data = array();\n $call_data['METHOD'] = 'RefundTransaction';\n $call_data['TRANSACTIONID'] = $this->request->post['transaction_id'];\n $call_data['NOTE'] = urlencode($this->request->post['refund_message']);\n $call_data['MSGSUBID'] = uniqid(mt_rand(), true);\n \n $current_transaction = $this->model_payment_paypalexpress->getLocalTransaction($this->request->post['transaction_id']);\n \n if ($this->request->post['refund_full'] == 1) {\n $call_data['REFUNDTYPE'] = 'Full';\n } else {\n $call_data['REFUNDTYPE'] = 'Partial';\n $call_data['AMT'] = number_format($this->request->post['amount'], 2);\n $call_data['CURRENCYCODE'] = $this->request->post['currency_code'];\n }\n \n $result = $this->model_payment_paypalexpress->call($call_data);\n \n $transaction = array('paypal_order_id' => $paypal_order['paypal_order_id'], 'transaction_id' => '', 'parent_transaction_id' => $this->request->post['transaction_id'], 'note' => $this->request->post['refund_message'], 'msgsubid' => $call_data['MSGSUBID'], 'receipt_id' => '', 'payment_type' => '', 'payment_status' => 'Refunded', 'transaction_entity' => 'payment', 'pending_reason' => '', 'amount' => '-' . (isset($call_data['AMT']) ? $call_data['AMT'] : $current_transaction['amount']), 'debug_data' => json_encode($result));\n \n if ($result === false) {\n $transaction['payment_status'] = 'Failed';\n $this->model_payment_paypalexpress->addTransaction($transaction, $call_data);\n $this->response->redirect($this->url->link('sale/order/info', 'token=' . $this->session->data['token'] . '&order_id=' . $paypal_order['order_id'], 'SSL'));\n } else if ($result['ACK'] != 'Failure' && $result['ACK'] != 'FailureWithWarning') {\n \n $transaction['transaction_id'] = $result['REFUNDTRANSACTIONID'];\n $transaction['payment_type'] = $result['REFUNDSTATUS'];\n $transaction['pending_reason'] = $result['PENDINGREASON'];\n $transaction['amount'] = '-' . $result['GROSSREFUNDAMT'];\n \n $this->model_payment_paypalexpress->addTransaction($transaction);\n \n //edit transaction to refunded status\n if ($result['TOTALREFUNDEDAMOUNT'] == $this->request->post['amount_original']) {\n $this->db->query(\"\n\t\t\t\t\t\t\t\tUPDATE `{$this->db->prefix}paypal_order_transaction` \n\t\t\t\t\t\t\t\tSET \n\t\t\t\t\t\t\t\t\t`payment_status` = 'Refunded' \n\t\t\t\t\t\t\t\tWHERE `transaction_id` = '\" . $this->db->escape($this->request->post['transaction_id']) . \"' \n\t\t\t\t\t\t\t\tLIMIT 1\");\n } else {\n $this->db->query(\"\n\t\t\t\t\t\t\t\tUPDATE `{$this->db->prefix}paypal_order_transaction` \n\t\t\t\t\t\t\t\tSET \n\t\t\t\t\t\t\t\t\t`payment_status` = 'Partially-Refunded' \n\t\t\t\t\t\t\t\tWHERE `transaction_id` = '\" . $this->db->escape($this->request->post['transaction_id']) . \"' \n\t\t\t\t\t\t\t\tLIMIT 1\");\n }\n \n //redirect back to the order\n $this->response->redirect($this->url->link('sale/order/info', 'token=' . $this->session->data['token'] . '&order_id=' . $paypal_order['order_id'], 'SSL'));\n } else {\n $this->model_payment_paypalexpress->log(json_encode($result));\n $this->session->data['error'] = (isset($result['L_SHORTMESSAGE0']) ? $result['L_SHORTMESSAGE0'] : 'There was an error') . (isset($result['L_LONGMESSAGE0']) ? '<br />' . $result['L_LONGMESSAGE0'] : '');\n $this->response->redirect($this->url->link('payment/paypalexpress/refund', 'token=' . $this->session->data['token'] . '&transaction_id=' . $this->request->post['transaction_id'], 'SSL'));\n }\n } else {\n $this->session->data['error'] = $this->language->get('lang_error_data_missing');\n $this->response->redirect($this->url->link('payment/paypalexpress/refund', 'token=' . $this->session->data['token'] . '&transaction_id=' . $this->request->post['transaction_id'], 'SSL'));\n }\n }\n } else {\n $this->session->data['error'] = $this->language->get('lang_error_data');\n $this->response->redirect($this->url->link('payment/paypalexpress/refund', 'token=' . $this->session->data['token'] . '&transaction_id=' . $this->request->post['transaction_id'], 'SSL'));\n }\n }",
"public function applyRefund(Tickets $ticket, $amount)\n {\n }",
"public function testIsPartialRefundWithItems_ItemsAmountDifferent()\n {\n $order = $this->getOrder();\n\n $request = new RefundRequest('', '', '', 0);\n $request->addItem(new RefundRequestItem('line-1', 4.99, 1, 0));\n\n $this->assertEquals(true, $request->isPartialAmountWithItems($order));\n }",
"public function refund($order);",
"public function cleanup_line_items(array $line_items, $expected_sum, $currency)\n {\n $effective_sum = $this->round_amount($this->get_total_amount_including_tax($line_items), $currency);\n $rounded_expected_sum = $this->round_amount($expected_sum, $currency);\n $inconsistent_amount = $rounded_expected_sum - $effective_sum;\n if ($inconsistent_amount != 0) {\n $enforce_consistency = get_option(WooCommerce_Wallee::CK_ENFORCE_CONSISTENCY);\n switch ($enforce_consistency){\n case 'no':\n $line_item = new \\Wallee\\Sdk\\Model\\LineItemCreate();\n $line_item->setAmountIncludingTax($this->round_amount($inconsistent_amount, $currency));\n $line_item->setName(__('Adjustment', 'woo-wallee'));\n $line_item->setQuantity(1);\n $line_item->setSku('adjustment');\n $line_item->setUniqueId('adjustment');\n $line_item->setShippingRequired(false);\n $line_item->setType($enforce_consistency > 0 ? \\Wallee\\Sdk\\Model\\LineItemType::FEE : \\Wallee\\Sdk\\Model\\LineItemType::DISCOUNT);\n $line_items[] = $line_item;\n break;\n default:\n throw new WC_Wallee_Exception_Invalid_Transaction_Amount($effective_sum, $rounded_expected_sum);\n }\n }\n $data = $this->ensure_unique_ids($line_items);\n return $data;\n }",
"public function confirm_refund_requestAction()\r\n {\r\n /**\r\n * check license key\r\n */\r\n Mage::helper('marketplace')->checkMarketplaceKey();\r\n $this->chekcingForMarketplaceSellerOrNot();\r\n /**\r\n * Initilize refund variables\r\n */\r\n $orderId = $this->getRequest()->getParam('id');\r\n $produtId = $this->getRequest()->getParam('item');\r\n $sellerId = Mage::getSingleton('customer/session')->getId();\r\n /**\r\n * Prepare product collection for cancel\r\n */\r\n $products = Mage::getModel('marketplace/commission')->getCollection();\r\n $products->addFieldToSelect('*');\r\n $products->addFieldToFilter('seller_id', $sellerId);\r\n $products->addFieldToFilter('order_id', $orderId);\r\n $products->addFieldToFilter('product_id', $produtId);\r\n\r\n $commission = $products->getFirstItem();\r\n //echo '<pre>'; print_r($commission); echo '</pre>'; die;\r\n $collectionId = $products->getFirstItem()->getId();\r\n if (!empty($collectionId)) {\r\n try {\r\n $commission->setRefundRequestSellerConfirmation(\"1\");\r\n $commission->save();\r\n //echo '<pre>'; print_r($commission); echo '</pre>'; die;\r\n /**\r\n * Ali or Imran can write an code to push forword this seller confirmation data to far eye\r\n * seller confirmation from magento sychnroize on for eye as well\r\n * Redirect to order view page\r\n */\r\n Mage::getSingleton('core/session')->addSuccess($this->__($this->__('Item refund request has beed approved by seller.')));\r\n $this->_redirect('marketplace/order/vieworder/orderid/' . $orderId);\r\n } catch (Exception $e) {\r\n Mage::getSingleton('core/session')->addError($this->__($e->getMessage()));\r\n $this->_redirect('marketplace/order/vieworder/orderid/' . $orderId);\r\n }\r\n } else {\r\n /**\r\n * Return to order manage page\r\n */\r\n Mage::getSingleton('core/session')->addError($this->__('You do not have permission to access this page'));\r\n $this->_redirect('marketplace/order/manage');\r\n return false;\r\n }\r\n }",
"public function getRefundItems();",
"public function refund(Refund $refund): ContractsResult;",
"public function refund() {\n $result = Braintree_Transaction::refund('f22c2zwk'); //for full refund\n //$result = Braintree_Transaction::refund('f22c2zwk','20.9'); //for partial refund\n if ($result) {\n echo \"<pre>\";\n print_r($result);\n echo \"</pre>\";\n }\n }",
"public function refund($url, $orderUUID, $amount);",
"public function refundTransaction()\n {\n $oxOrder = $this->getEditObject();\n\n $transaction = oxNew('paymill_transaction');\n $transaction->load($this->getEditObjectId());\n\n //Create Refund\n $params = array(\n 'transactionId' => $transaction->paymill_transaction__transaction_id->rawValue,\n 'params' => array('amount' => (int) ($this->_getRefundAmount() * 100))\n );\n\n $refundsObject = new Services_Paymill_Refunds(\n trim(oxRegistry::getConfig()->getShopConfVar('PAYMILL_PRIVATEKEY')),\n paymill_util::API_ENDPOINT\n );\n\n oxRegistry::getSession()->setVariable('refund', true);\n\n try {\n $refund = $refundsObject->create($params);\n } catch (Exception $ex) {\n\n }\n\n if (isset($refund['response_code']) && $refund['response_code'] == 20000) {\n $oxOrder->assign(array('oxorder__oxdiscount' => $this->_getRefundAmount()));\n $oxOrder->reloadDiscount(false);\n $oxOrder->recalculateOrder();\n oxRegistry::getSession()->setVariable('success', true);\n } else {\n oxRegistry::getSession()->setVariable('error', true);\n }\n }",
"public function testRefundValidationWithValidInvoiceProvided()\n {\n $client = ClientFactory::create($this->company->id, $this->user->id);\n $client->save();\n\n $this->invoice = InvoiceFactory::create($this->company->id, $this->user->id); //stub the company and user_id\n $this->invoice->client_id = $client->id;\n $this->invoice->status_id = Invoice::STATUS_SENT;\n\n $this->invoice->line_items = $this->buildLineItems();\n $this->invoice->uses_inclusive_taxes = false;\n\n $this->invoice->save();\n\n $this->invoice_calc = new InvoiceSum($this->invoice);\n $this->invoice_calc->build();\n\n $this->invoice = $this->invoice_calc->getInvoice();\n $this->invoice->save();\n\n $data = [\n 'amount' => 50,\n 'client_id' => $client->hashed_id,\n 'invoices' => [\n [\n 'invoice_id' => $this->invoice->hashed_id,\n 'amount' => $this->invoice->amount,\n ],\n ],\n 'date' => '2020/12/12',\n\n ];\n\n $response = $this->withHeaders([\n 'X-API-SECRET' => config('ninja.api_secret'),\n 'X-API-TOKEN' => $this->token,\n ])->post('/api/v1/payments', $data);\n\n $arr = $response->json();\n $response->assertStatus(200);\n\n $payment_id = $arr['data']['id'];\n\n $this->assertEquals(50, $arr['data']['amount']);\n\n $payment = Payment::whereId($this->decodePrimaryKey($payment_id))->first();\n\n $this->assertNotNull($payment);\n $this->assertNotNull($payment->invoices());\n $this->assertEquals(1, $payment->invoices()->count());\n\n $data = [\n 'id' => $this->encodePrimaryKey($payment->id),\n 'amount' => 50,\n 'invoices' => [\n [\n 'invoice_id' => $this->invoice->hashed_id,\n 'amount' => $this->invoice->amount,\n ],\n ],\n 'date' => '2020/12/12',\n ];\n\n $response = false;\n\n $response = $this->withHeaders([\n 'X-API-SECRET' => config('ninja.api_secret'),\n 'X-API-TOKEN' => $this->token,\n ])->post('/api/v1/payments/refund', $data);\n\n $response->assertStatus(200);\n }",
"public function refund()\n {\n }",
"public function add_refund_order_costs( $refund_id ) {\n\n\t\t$refund = wc_get_order( $refund_id );\n\n\t\t$refund_total_cost = 0;\n\n\t\tforeach ( $refund->get_items() as $refund_line_item_id => $refund_line_item ) {\n\n\t\t\t// skip line items that aren't actually being refunded or the original refunded item ID isn't available\n\t\t\tif ( ! isset( $refund_line_item['line_total'] )\n\t\t\t || $refund_line_item['line_total'] >= 0\n\t\t\t || ! isset( $refund_line_item['qty'] )\n\t\t\t || abs( $refund_line_item['qty'] ) === 0\n\t\t\t || empty( $refund_line_item['refunded_item_id'] ) ) {\n\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// get original item cost\n\t\t\t$item_cost = wc_get_order_item_meta( $refund_line_item['refunded_item_id'], '_wc_cog_item_cost', true );\n\n\t\t\t// skip if a cost wasn't set for the original item. note that we're\n\t\t\t// intentionally not calculating a negative cost here based on the\n\t\t\t// current cost for the product because we assume the admin decided\n\t\t\t// not to run the \"apply costs\" feature to apply historical costs\n\t\t\tif ( ! $item_cost ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// a refunded item cost & item total cost are negative since they reduce the item total costs when summed (for reports, etc)\n\t\t\t$refunded_item_cost = $item_cost * -1;\n\t\t\t$refunded_item_total_cost = ( $item_cost * abs( $refund_line_item['qty'] ) ) * -1;\n\n\t\t\t// add as meta to the refund line item\n\t\t\twc_update_order_item_meta( $refund_line_item_id, '_wc_cog_item_cost', wc_format_decimal( $refunded_item_cost ) );\n\t\t\twc_update_order_item_meta( $refund_line_item_id, '_wc_cog_item_total_cost', wc_format_decimal( $refunded_item_total_cost ) );\n\n\t\t\t$refund_total_cost += $refunded_item_total_cost;\n\t\t}\n\n\n\t\t/**\n\t\t * Update Refund Order Cost Meta Filter.\n\t\t *\n\t\t * Allow actors to change the order total cost before it's set when\n\t\t * refunding an order in the admin.\n\t\t *\n\t\t * *IMPORTANT* - you must add negative values to this total if you've\n\t\t * added costs via the similar order total cost filters above. It should\n\t\t * match the order total cost, just with a negative value.\n\t\t *\n\t\t * @since 2.0.0\n\t\t * @param float|string $refund_total_cost order total cost to update.\n\t\t * @param \\WC_Order_Refund $refund refund order object\n\t\t */\n\t\t$refund_total_cost = apply_filters( 'wc_cost_of_goods_update_refund_order_cost_meta', $refund_total_cost, $refund );\n\n\t\t// update the refund total cost\n\t\tSV_WC_Order_Compatibility::update_meta_data( $refund, '_wc_cog_order_total_cost', wc_format_decimal( $refund_total_cost, wc_get_price_decimals() ) );\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
checks to see if we have an account record for this urlPrefix already | public function validateUrlPrefix($urlPrefix) {
$isAccount = false;
switch ($urlPrefix) {
case null:
case 'www':
case 'app':
break;
default:
$account = $this->checkForActiveAccount($urlPrefix);
if ($account) {
if($this->databaseExists($urlPrefix . '_' . ENVIRONMENT )) {
$isAccount = true;
}
}
}
return $isAccount;
} | [
"private function isAccountValid($account) {\n\t\t// Ensure the prefix is unique (or empty if self-hosted)\n\t\tif ($account->selfHost) return true;\n\t\t$sql = \t<<<EOD\n\t\t\t\tSELECT F_RootID, F_Prefix\n\t\t\t\tFROM T_AccountRoot\n\t\t\t\tWHERE F_Prefix=?\nEOD;\n\t\t$rs = $this->db->Execute($sql, array($account->prefix));\n\t\t\n\t\tswitch ($rs->RecordCount()) {\n\t\t\tcase 0:\n\t\t\t\t// There are no duplicates\n\t\t\t\treturn true;\n\t\t\tcase 1:\n\t\t\t\t// There is a duplicate, but if this is an update it might be the same record\n\t\t\t\treturn ((int)($rs->FetchNextObj()->F_RootID) == (int)($account->id));\n\t\t\tdefault:\n\t\t\t\t// Something is wrong with the database!\n\t\t\t\tthrow new Exception(\"isAccountValid: More than one account was returned with prefix '\".$account->prefix.\"'\");\n\t\t}\n\t}",
"function accountExist($account){\n\t\tinclude \"/settings/settings.php\";\n\t\t$accounts = $con->selectCollection($dbname,\"accounts\");\n\t\t$exist = false;\n\t\t$user = array (\n\t\t\t'login' => $account\n\t\t);\n\t\t\n\t\t$user = $accounts->findOne($user);\n\t\t\n\t\t// Check if the login don't exist\n\t\tif (strtoupper($user['login']) == strtoupper($account)) {\n\t\t\t$exist= true;\n\t\t}\n\n\t\treturn $exist;\n\t}",
"function check_account() {\n if (!isset($this->uid)) {\n return FALSE;\n }\n elseif (!isset($this->send_method) || !isset($this->send_interval)) {\n return $this->set_account($this->get_user());\n }\n else {\n return TRUE;\n }\n }",
"function account_exists($account){\n $get_account_detail_query = \"select a.accountsID, a.accountBalance\"\n . \", a.status from accounts a inner \"\n . \"join customers c on a.customerID=c.customerid inner join \"\n . \"customerDetails cd on c.customerid = cd.customerid where \"\n . \"cd.account_number='$account'\";\n Logger::log(\"Core::account_exists()->\"\n . \"Check account -> $account , \"\n . \"query -> $get_account_detail_query\");\n $account_details = \n $this->_coredb->get_record($get_account_detail_query);\n if (count($account_details) > 0) {\n Logger::log(\"Core::account_exists()~TRUE\");\n return $account_details;\n }\n Logger::log(\"Core::account_exists()~FALSE\");\n return FALSE;\n }",
"public function hasAccounts()\n\t{\n\t\treturn false;\n\t}",
"public function hasAccountId()\n {\n return $this->account_id !== null;\n }",
"public function usernameExists() {\n\t\tif(!check($this->_username)) return;\n\t\t\n\t\t$collection = $this->db->loginserver->accounts;\n\t\t$result = $collection->findOne(\n\t\t\t[\n\t\t\t\t'accountName' => $this->_username,\n\t\t\t]\n\t\t);\n\t\tif(!check($result->accountName)) return;\n\t\treturn true;\n\t}",
"protected function hasAccounts()\n\t{\n\t\treturn !empty($this->accounts);\n\t}",
"public function exists($accountName);",
"function accountExists($username){\n\t\t$exists = false;\n\t\t$account = getAccountByUsername($username);\n\t\t\n\t\t// user id will be we be 0 if there is no such user\n\t\tif ($account -> getId() != 0){\n\t\t\t$exists = true;\n\t\t}\n\t\treturn $exists;\n }",
"public function checkAccountCreatedSuccesfuly() {\n\n\t\t\t$db = Db::getInstance();\n\n\t\t\t$req = $db->prepare('Select * FROM Users WHERE Email = :email');\n\t\t\t$req->execute(array( ':email' => $this->emailAddress) );\n\t\t\t$User = $req->fetchAll();\n\t\t\t\n\t\t\tif(count($User) >= 1){\n\n\t\t\t\t//Account exists\n\t\t\t\treturn true;\n\n\t\t\t}else{\n\n\t\t\t\t//Account does not exist\n\t\t\t\treturn false;\n\n\t\t\t}\n\n\t\t}",
"public function hasExternalAccounts(): bool {\n return !$this->externalLogins->isEmpty();\n }",
"public function exist($username, Account $account);",
"private function accountExists($id){\n \n $account = DB::table('accounts')\n ->where('id', $id)\n ->get();\n\n return $account->count() > 0;\n\n }",
"public function accountExists(){\n $exists = false;\n $query = \"select * from users where name = ? and password = ?\";\n\n\n $stmt = $this->db_handle->prepare($query);\n $stmt->execute(array($this->getName(), sha1($this->getPassword())));\n\n if($stmt->rowCount() > 0){\n $exists = true;\n }\n\n return $exists; \n }",
"function checkIfAccountExists($account_id){\n\n global $db;\n $stmt= $db->prepare('SELECT * from account where account_id = ?');\n $stmt->execute(array($account_id));\n\n $ret= $stmt->fetch();\n\n if( $ret == null){\n\n return false;\n }\n else{\n\n return true;\n }\n }",
"public function check_account($account){\n\t\t$sql = 'SELECT user_uid FROM '.ADMIN_USERS.' WHERE username = '.$this->db->escape($account);\n $rs = $this->db->query($sql);\n\t \tif ( $rs->num_rows()>0 ){\n return true;\n }else{\n return false;\n }\n }",
"public function checkUserExisted(){\n return $this->getAuth() != NULL;\n }",
"function checkIfKeyExists(){\nglobal $user;\n $result = db_select('ccdev_accounts')\n ->fields('ccdev_accounts', array(\n 'api_key'))\n ->condition('user_id', $user->uid, '=')\n ->range(0,1)\n ->execute()\n ->fetchAssoc();\n\n if(isset($result['api_key'])) {\n\t\treturn true;\n\t}\n\treturn false;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A winner is determined and this method will either increment the player's or the dealer's total score by one. | public function win()
{
$this->totalWins++;
} | [
"function countScores() //todo if none busted and dealer has more point no one wins. <- this solution ugly af\n {\n $playerPoints = $this->player->calculatePoints();\n $dealerPoints = $this->dealer->calculatePoints();\n\n if ($dealerPoints > $playerPoints && $dealerPoints <= $this->maxWinningValue) {\n $this->setWinner($this->dealer);\n } elseif ($dealerPoints === $playerPoints) {\n $this->setWinner('Tie');\n }\n }",
"public function win() {\n $this->games++;\n $this->wins++;\n $this->save();\n }",
"public function addWin()\n {\n $this->score++;\n }",
"function TestScenarioPlayer1Win() {\n $this->game->setHandForPlayer(0, 'HandRock');\n $this->game->setHandForPlayer(1, 'HandScissors');\n $score = $this->game->players[0]->score;\n $winner = $this->game->findWinner();\n $this->assertEqual($this->game->players[0], $winner);\n $this->assertEqual($this->game->players[0]->score, ($score + 1));\n }",
"public function checkForGameWinner()\n\t{\n\t\t$x = 1;\n\t\tforeach($this->players as $player) {\n\t\t\tif (count($player->getHand()) <= 0) {\n\t\t\t\t$this->gameWinner = $x;\t\t\n\t\t\t}\n\t\t\t$x++;\n\t\t}\t\t\n\t}",
"function add_to_win_player2($score_keeper, $scoreboard){\n\t\t//Create variable to keep track of the wins\n\t\t$player2_wins = 0;\n\t\t//If Player 2 is a person and $score_keeper is equal to the String \"Player 2 Wins!!!\"\n\t\t//and the game is not set up to play against the computer\n\t\tif ($scoreboard[9] == \"0\" && $score_keeper == 2) {\t\t\n\t\t\t//Add 1 to Player 2's wins\n\t\t\t$player2_wins += 1;\n\t\t\t//Return the number of wins for Player 2\n\t\t\treturn $player2_wins;\n\t\t}\n\n\t}",
"protected function gamesWon()\n {\n $p = 0;\n foreach ($this->leaderboards() as $l) {\n $p = $p + $l->wins;\n }\n return $p;\n }",
"public function set_winner()\n {\n if ($this->red->get_size() <= 0) {\n $this->winner = $this->blue;\n } elseif ($this->blue->get_size() <= 0) {\n $this->winner = $this->red;\n }\n }",
"public function winner(){\n\t\tif(count($this->armies[0]->warriors)==0){\n\t\t\treturn 1;\n\t\t}\n\t\telse if(count($this->armies[1]->warriors)==0){\n\t\t\treturn 2;\n\t\t}\n\t\treturn 0;\n\t}",
"public function setWins()\n {\n $this->wins++;\n }",
"public function incrementScore()\n {\n $this->score++;\n }",
"public function placeMatch($won){\n\t\tif($won)\n\t\t\t$winLoss+=1;\n\t\telse if(!$won)\n\t\t\t$winLoss-=1;\n\t}",
"function player_score($results, $player) {\n\t$score = object() ;\n\t$score->matchplayed = 0 ;\n\t$score->matchpoints = 0 ;\n\t$score->gameplayed = 0 ;\n\t$score->gamepoints = 0 ;\n\tforeach ( $results as $round ) {\n\t\tforeach ( $round as $match ) {\n\t\t\tif ( $player->player_id == $match->creator_id ){ // If player was 'creator'\n\t\t\t\t$player_score = $match->creator_score ;\n\t\t\t\t$opponent_score = $match->joiner_score ;\n\t\t\t} else if ($player->player_id == $match->joiner_id ) { // If player was 'joiner'\n\t\t\t\t$player_score = $match->joiner_score ;\n\t\t\t\t$opponent_score = $match->creator_score ;\n\t\t\t} else // Player didn't participate in this match\n\t\t\t\tcontinue ; // Go next match\n\t\t\t// Match wins\n\t\t\t$score->matchplayed++ ;\n\t\t\tif ( $player_score > $opponent_score ) // Player won\n\t\t\t\t$score->matchpoints += 3 ;\n\t\t\telse if ( $player_score == $opponent_score ) // Player tied\n\t\t\t\t$score->matchpoints += 1 ;\n\t\t\t// Game wins\n\t\t\tif ( $player_score + $opponent_score > 0 )\n\t\t\t\t$score->gameplayed += $player_score + $opponent_score ;\n\t\t\telse\n\t\t\t\t$score->gameplayed++ ; // At least 1 game per round\n\t\t\t$score->gamepoints += 3 * $player_score ; // No management for game draw\n\t\t}\n\t}\n\t// Percentages\n\t\t// Match win\n\tif ( $score->matchplayed == 0 )\n\t\t$score->matchwinpct = 0 ;\n\telse\n\t\t$score->matchwinpct = max(1/3, $score->matchpoints/(3*$score->matchplayed)) ;\n\t\t// Game win\n\tif ( $score->gameplayed == 0 )\n\t\t$score->gamewinpct = 0 ;\n\telse\n\t\t$score->gamewinpct = max(1/3, $score->gamepoints/(3*$score->gameplayed)) ;\n\treturn $score ;\n}",
"public function scoreWin() {\n return 10 - $this->ply;\n }",
"public function increaseScore() {\n $this->score++;\n }",
"function dealer_vs_player() {\n\tglobal $NUM_PLAYERS, $GAME_STATE;\n\t$hands = $GAME_STATE['hands'];\n\t$dealers_hand = $hands[0];\n\t$dealers_score = card_count($dealers_hand);\n\tfor ($i = 1; $i < $NUM_PLAYERS; $i++) {\n\t\t$players_score = card_count($hands[$i]);\n\t\tif ($players_score == \"Blackjack\") {\n\t\t\t$players_score = 21;\n\t\t}\n\t\tif ($players_score > 21) {\n\t\t\techo \"Player $i - Bust\";\n\t\t\techo \"<br>\";\n\t\t} else {\n\t\t\tif ($dealers_score > 21) {\n\t\t\t\techo \"Player $i - wins\";\n\t\t\t\techo \"<br>\";\n\t\t\t} else {\n\t\t\t\tif ($dealers_score > $players_score) {\n\t\t\t\t\techo \"Player $i - loses\";\n\t\t\t\t\techo \"<br>\";\n\t\t\t\t}\n\t\t\t\tif ($dealers_score < $players_score) {\n\t\t\t\t\techo \"Player $i - wins\";\n\t\t\t\t\techo \"<br>\";\n\t\t\t\t}\n\t\t\t\tif ($dealers_score == $players_score) {\n\t\t\t\t\techo \"Player $i - push\";\n\t\t\t\t\techo \"<br>\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}",
"public function addWin() {\n $query = '\n UPDATE ' . Stats::TABLE_NAME . ' \n SET wins = wins + 1 \n WHERE id = ' . $this->userId . ';'\n ;\n $result = $this->db->query($query);\n return $result && $this->db->affected_rows() > 0;\n }",
"public function AddWin() \n\t\t{\n\t\t\treturn ++$this->wins;\n\t\t}",
"public function isWinner() {\n\t\t$winner = null;\n\t\t$rule = $this->getRule(); // note: rule is required for matches\n\t\tif($rule->rule_type == Rule::TYPE_MATCHPLAY) {\n\t\t\t// Get opponent scorecard\n\t\t\tif($opponent = $this->getOpponent()) {\n\t\t\t\tif($opponent_scorecard = $opponent->getScorecard()) {\n\t\t\t\t\t$this_total = $this->points_total($rule->handicap);\n\t\t\t\t\t$opponent_total = $opponent_scorecard->points_total($rule->handicap);\n\t\t\t\t\t//Yii::trace('tie:'.$this->tie_break.'vs.'.$opponent_scorecard->tie_break, 'Scorecard::isWinner');\n\t\t\t\t\t$winner = ($this_total > $opponent_total) ?\n\t\t\t\t\t\t\t\ttrue :\n\t\t\t\t\t\t\t\t($opponent_total > $this_total ?\n\t\t\t\t\t\t\t\t\tfalse :\n\t\t\t\t\t\t\t\t\t($this->tie_break > $opponent_scorecard->tie_break ?\n\t\t\t\t\t\t\t\t\t\ttrue :\n\t\t\t\t\t\t\t\t\t\t($this->tie_break < $opponent_scorecard->tie_break ?\n\t\t\t\t\t\t\t\t\t\t\tfalse :\n\t\t\t\t\t\t\t\t\t\t\tnull)));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//Yii::trace('return:'.($winner ? 't' : 'f'), 'Scorecard::isWinner');\n\t\treturn $winner;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
name CPackageStatusCompare::__destruct() description Destructor for a CPackageStatusCompare object. | public function __destruct()
{
$this->save();
// Delete all maybe existing temporary package status files
foreach (glob("/m23/tmp/getStatusFile*") as $filename)
unlink($filename);
} | [
"public function __destruct()\r\n\t{\r\n\t\tKalturaLog::debug(\"KalturaTestResult destructed\\n\");\r\n\t}",
"public function __destruct() {\n\t\tparent::__destruct();\n\t\t$this->free();\n\t}",
"public function __destruct(){\n\t\techo \"Destructor dari class komputer <br>\";\n\t}",
"private function __destruct() {}",
"function __destruct( ){ // cTableDependencyManager\n \n }",
"function __destruct() {\n if ($this->var) {\n com_release($this->var);\n $this->var= NULL;\n }\n }",
"public function __destruct(){}",
"public function __destruct() {\n\t\t$this->_lob->free();\n\t\t$this->_lob = null;\n\t}",
"public function __destruct()\n\t{\n\t\t//\n\t\t// Reset graph.\n\t\t//\n\t\tif( $this->Graph() !== NULL )\n\t\t\t$this->Graph( FALSE );\n\t\t\n\t}",
"public function __destruct()\n {\n $this->cleanTestEnv();\n }",
"function __destruct(){\n self::profiler('Destructing codeLib', TRUE);\n }",
"public function __destruct()\n {\n $this->_loadedPackets = [];\n }",
"public function __destruct() {\n // exclusive block\n if ($this->blockMutex()) {\n $pings = $this->getData();\n\n // check if our ping is still in the list\n if (isset($pings[self::$devid][self::$user][self::$pid])) {\n unset($pings[self::$devid][self::$user][self::$pid]);\n $stat = $this->setData($pings);\n }\n\n $this->releaseMutex();\n }\n // end exclusive block\n }",
"function __destruct()\n {\n if (!isset($this->isRemoved) || TRUE !== $this->isRemoved) {\n $this->removeDpObject();\n }\n\n echo sprintf(dp_text(\"__destruct() called in object %s (%s).\\n\"),\n $this->uniqueId,\n $this->getTitle(DPUNIVERSE_TITLE_TYPE_INDEFINITE));\n }",
"public function __destruct()\n {\n $this->endTime = date(\"Y-m-d H:i:s\");\n $this->writeSummary();\n }",
"public function __destruct()\n\t{\n\t\t$this->runGarbageCollection();\n\t\tparent::__destruct();\n\t}",
"public function __destruct()\n {\n if ($this->hasChanges) {\n $data = array();\n foreach ($this->packages as $installedPackage) {\n $data[] = $this->dumper->dump($installedPackage);\n }\n\n file_put_contents($this->filePath, json_encode($data, JSON_PRETTY_PRINT));\n }\n }",
"final public function __destruct()\n\t{\n\t\tif (class_exists('PerformanceClass')) PerformanceClass::timer_end('PAYPALSIMPLE_CLASS');\n\t\tself::$instance = null;\n\t}",
"public function __destruct()\n {\n if ( $this->cleanProcInfo ) {\n $this->cleanInstanceProcInfo();\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the names of all classes known to this reflection service. | public function getAllClassNames() {
return array_keys($this->reflectedClassNames);
} | [
"public function getAllClassNames(): array\n {\n if (!$this->initialized) {\n $this->initialize();\n }\n\n return array_keys($this->classReflectionData);\n }",
"public function getClasses()\n {\n $classes = [];\n foreach ($this->classes as $class) {\n $classes[] = new ClassReflection($class);\n }\n\n return $classes;\n }",
"public static function classes()\n\t{\n\t\treturn static::dump(get_declared_classes());\n\t}",
"public function getClassNames();",
"public function getAllClassNames()\n {\n return array_keys($this->mappings);\n }",
"public static function getDeclaredClasses()\n {\n VarDumper::dump(get_declared_classes());\n }",
"public function getClassNames(): array;",
"protected function getAllClasses()\n {\n return $this->getClassesFromNamespace($this->getAppNamespace());\n }",
"public function getClassNames() {\r\n\t\treturn $this->ilRoomsharingDatabase->getClassNames();\r\n\t}",
"public static function getRegisteredClassnames()\n\t{\n\t\treturn array_keys(self::$instances);\n\t}",
"public function getClasses() {\n return $this->robot->getIndexedClasses();\n }",
"public function getDeclaredClasses() : Collection\n {\n $this->findAndLoadClasses();\n // We should filter out common classes\n // - std_class\n // - ? Exception\n $classes = collect(get_declared_classes());\n\n $filtered = $classes->reject(function ($value, $key) {\n return starts_with($value, 'Illuminate'); // Ignore Illuminate Packages\n })->reject(function ($value, $key) {\n return starts_with($value, 'Symfony');\n });\n\n return $filtered;\n }",
"public static function listClasses(): array\n {\n return array_merge(get_declared_classes(), get_declared_interfaces());\n }",
"private function getAllClasses(): array\n {\n $annotationReader = new SimpleAnnotationReader();\n $annotationManager = new AnnotationManager($annotationReader);\n return $annotationManager->buildClassInfosBasedOnPath($this->sourceDir);\n }",
"public function getClasses()\n {\n return array();\n }",
"private function getAllClassNames()\n {\n return array_merge(\n array($this->class->name),\n $this->class->subClasses,\n $this->class->parentClasses\n );\n }",
"protected function getServiceClasses()\n {\n $classes = array();\n $builder = $this->getContainerBuilder();\n $serviceIds = new ApplicationServiceIterator(\n $this->getKernel(),\n new \\ArrayIterator($builder->getServiceIds())\n );\n foreach ($serviceIds as $serviceId) {\n /* @var $serviceId string */\n $definition = $builder->findDefinition($serviceId);\n if ($definition->getClass() === null) {\n continue;\n }\n $classes[] = $builder->getParameterBag()->resolveValue($definition->getClass());\n }\n return array_unique($classes);\n }",
"public function getClassNames()\n {\n return array_keys($this->getEntityAliases());\n }",
"abstract public function getClassNamesForContainer();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Rebuilds partner net contains given client uid. | public function rebuildPartnerNet()
{
$this->checkIfValid();
Yii::$app->referralNetwork->rebuildPartnerNetForClientUid($this->clientUid);
} | [
"public function rebuildPartnerNetForClientUid(int $clientUid)\n {\n $rootPartnerUids = $this->getRootPartnerUidsForClientUid($clientUid);\n Yii::debug(\n '[ReferralNetwork::rebuildPartnerNetForClientUid] root partner ids : '\n . json_encode($rootPartnerUids)\n );\n\n $timeStart = microtime(true);\n Yii::debug(\n '[ReferralNetwork::rebuildPartnerNetForClientUid] start : '\n . $timeStart\n );\n\n $transaction = Yii::$app->db->beginTransaction();\n try {\n foreach ($rootPartnerUids as $rootPartnerUid) {\n self::dropPartnerNetByRootClientUid($rootPartnerUid);\n self::buildPartnerNetForClientUid($rootPartnerUid, 1);\n }\n\n $transaction->commit();\n } catch (\\Exception $ex) {\n $transaction->rollBack();\n throw $ex;\n }\n\n $timeEnd = microtime(true);\n Yii::debug(\n '[ReferralNetwork::rebuildPartnerNetForClientUid] end : '\n . $timeEnd\n . ' (duration : '\n . ($timeEnd - $timeStart)\n . ' sec)'\n );\n }",
"private function rebuildInvoiceWithPerson()\n {\n $addrLabel = $this->addressLabelByType()->formatAddress();\n $sql = \"UPDATE card set clientnickname = :cnick, clientaddress = :caddr WHERE client_id = :pid\";\n R::exec($sql, array(\n ':pid' => $this->bean->getId(),\n ':cnick' => $this->bean->nickname,\n ':caddr' => $addrLabel\n ));\n /*\n $offset = 0;\n $limit = 500;\n while ($records = R::findAll('card', ' client_id = :pid ORDER BY id LIMIT '.$limit.' OFFSET '.$offset, array(':pid' => $this->bean->getId()))) {\n foreach ($records as $id => $record) {\n $update = false;\n if ($record->client_id == $this->bean->getId()) {\n $record->clientnickname = $this->bean->nickname;\n //$record->clientaddress = $addrLabel;\n $update = true;\n }\n if ($update) {\n try {\n $record->setAutoInfo(false);\n $record->setAutoTag(false);\n R::store($record);\n }\n catch (Exception $e) {\n }\n }\n }\n $offset = $offset + $limit; \n }\n */\n }",
"public function testUpdateNetworkClientPolicy()\n {\n }",
"function wp_clients_update_func( $userdata ) {\r\n global $rul_db_addresses, $wpdb;\r\n\r\n if ( !isset( $userdata['ID'] ) ) {\r\n $wpc_settings = get_option( 'wpc_settings' );\r\n\r\n // insert new user\r\n $new_user = wp_insert_user($userdata);\r\n\r\n if ( isset( $_REQUEST['circles'] ) && is_string( $_REQUEST['circles'] ) && 0 < $new_user ) {\r\n if( $_REQUEST['circles'] == 'all' ) {\r\n $group_ids = $this->get_group_ids();\r\n } else {\r\n $group_ids = explode( ',', $_REQUEST['circles'] );\r\n }\r\n foreach ( $group_ids as $group_id ) {\r\n $wpdb->query( $wpdb->prepare( \"INSERT INTO {$wpdb->prefix}wpc_client_group_clients SET group_id = %d, client_id = '%d'\", $group_id, $new_user ) );\r\n }\r\n }\r\n\r\n update_user_option( $new_user, 'contact_phone', $userdata['contact_phone'], false );\r\n update_user_option( $new_user, 'unqiue', md5( time() ) );\r\n\r\n //set business name\r\n if ( isset( $userdata['business_name'] ) ) {\r\n update_user_meta( $new_user, 'wpc_cl_business_name', $userdata['business_name'] );\r\n }\r\n\r\n //create hub page for the user\r\n $post = array();\r\n $post['post_type'] = 'hubpage'; //could be 'page' for example\r\n $post['post_content'] = html_entity_decode( $this->hub_template );\r\n $post['post_author'] = 1;\r\n $post['post_status'] = 'publish'; //draft\r\n $post['comment_status'] = 'closed';\r\n $post['post_title'] = $userdata['business_name'];\r\n $post['post_parent'] = 0;\r\n $post['post_status'] = \"publish\";\r\n\r\n $postid = wp_insert_post($post);\r\n\r\n if ( 0 < $postid )\r\n update_user_meta( $new_user, 'wpc_cl_hubpage_id', $postid );\r\n\r\n\r\n // add Portal Page for this user\r\n $client_template = $this->client_template;\r\n $client_template = html_entity_decode($client_template);\r\n $client_template = str_replace(\"{name}\", $userdata['business_name'], $client_template);\r\n $client_template = str_replace(\"{page_title}\",$userdata['business_name'],$client_template);\r\n\r\n $create_client = get_option(\"wpc_create_client\");\r\n\r\n if( $create_client == \"yes\" ) {\r\n\r\n $clients = array(\r\n 'comment_status' => 'closed',\r\n 'ping_status' => 'closed',\r\n 'post_author' => get_current_user_id(),\r\n 'post_content' => $client_template,\r\n 'post_name' => $userdata['business_name'],\r\n 'post_status' => 'publish',\r\n 'post_title' => $userdata['business_name'],\r\n 'post_type' => 'clientspage'\r\n );\r\n\r\n $client_page_id = wp_insert_post($clients);\r\n\r\n $user_ids = array();\r\n $user_ids[] = '' . $new_user ;\r\n update_post_meta( $client_page_id, \"user_ids\", $user_ids );\r\n }\r\n\r\n\r\n $link = get_permalink($postid);\r\n\r\n if( isset( $userdata['send_password'] ) && ( $userdata['send_password'] == 'on' || $userdata['send_password'] == '1' ) ) {\r\n\r\n //get email template\r\n\r\n $headers = \"From: \" . get_option(\"sender_name\") . \" <\" . get_option(\"sender_email\") . \"> \\r\\n\";\r\n $headers .= \"Reply-To: \" . ( get_option( 'wpc_reply_email' ) ) ? get_option( 'wpc_reply_email' ) : get_option( 'admin_email' ) . \"\\r\\n\";\r\n $headers .= \"MIME-Version: 1.0\\r\\n\";\r\n $headers .= \"Content-Type: text/html; charset=UTF-8\\r\\n\";\r\n\r\n $args = array( 'client_id' => $new_user, 'user_password' => $userdata['user_pass'], 'page_id' => $link, 'page_title' => $userdata['business_name'] );\r\n\r\n $wpc_templates['emails']['new_client_password']['subject'] = 'Your Private and Unique Client Portal has been created';\r\n\r\n $wpc_templates['emails']['new_client_password']['body'] = '<p>Hello {contact_name},<br /> <br /> Your Username is : <strong>{user_name}</strong> and Password is : <strong>{user_password}</strong></p>\r\n <p>Your private and secure Client Portal has been created. You can login by clicking <strong><a href=\"{admin_url}\">HERE</a></strong></p>\r\n <p>Thanks, and please contact us if you experience any difficulties,</p>\r\n <p>YOUR COMPANY NAME HERE</p>';\r\n\r\n $subject = $this->replace_placeholders( $wpc_templates['emails']['new_client_password']['subject'], $args, 'new_client' );\r\n $subject = htmlentities( $subject, ENT_QUOTES, 'UTF-8' );\r\n $message = $this->replace_placeholders( $wpc_templates['emails']['new_client_password']['body'], $args, 'new_client' );\r\n\r\n wp_mail($userdata['user_email'], $subject, $message, $headers);\r\n }\r\n\r\n } else {\r\n\r\n wp_update_user( $userdata );\r\n //sending email to client for updated password information\r\n if ( '1' == $userdata['send_password'] && '1' == $userdata['update_password'] ) {\r\n\r\n //get email template\r\n\r\n $headers = \"From: \" . get_option(\"sender_name\") . \" <\" . get_option(\"sender_email\") . \"> \\r\\n\";\r\n $headers .= \"Reply-To: \" . ( get_option( 'wpc_reply_email' ) ) ? get_option( 'wpc_reply_email' ) : get_option( 'admin_email' ) . \"\\r\\n\";\r\n $headers .= \"MIME-Version: 1.0\\r\\n\";\r\n $headers .= \"Content-Type: text/html; charset=UTF-8\\r\\n\";\r\n\r\n $args = array( 'client_id' => $userdata['ID'], 'user_password' => $userdata['user_pass'] );\r\n\r\n $wpc_templates['emails']['client_updated']['subject'] = 'Your Client Password has been updated';\r\n\r\n $wpc_templates['emails']['client_updated']['body'] = '<p>Hello {contact_name},<br /> <br /> Your Username is : <strong>{user_name}</strong> and Password is : <strong>{user_password}</strong></p>\r\n <p>Your password has been updated. You can login by clicking <strong><a href=\"{admin_url}\">HERE</a></strong></p>\r\n <p>Thanks, and please contact us if you experience any difficulties,</p>\r\n <p>YOUR COMPANY NAME HERE</p>';\r\n\r\n $subject = $this->replace_placeholders( $wpc_templates['emails']['client_updated']['subject'], $args, 'client_updated' );\r\n $subject = htmlentities( $subject, ENT_QUOTES, 'UTF-8' );\r\n\r\n $message = $this->replace_placeholders( $wpc_templates['emails']['client_updated']['body'], $args, 'client_updated' );\r\n\r\n wp_mail($userdata['user_email'], $subject, $message, $headers);\r\n }\r\n\r\n //sending email to client for updated password information\r\n update_user_option( $userdata['ID'], 'contact_phone', $userdata['contact_phone'], false );\r\n update_user_meta( $userdata['ID'], 'admin_manager', $userdata['admin_manager'] );\r\n\r\n if ( isset( $_REQUEST['circles'] ) && is_string( $_REQUEST['circles'] ) ) {\r\n if( $_REQUEST['circles'] == 'all' ) {\r\n $group_ids = $this->get_group_ids();\r\n } else {\r\n $group_ids = explode( ',', $_REQUEST['circles'] );\r\n }\r\n $wpdb->query( $wpdb->prepare( \"DELETE FROM {$wpdb->prefix}wpc_client_group_clients WHERE client_id = '%d'\", $userdata['ID'] ) );\r\n foreach ( $group_ids as $group_id ) {\r\n $wpdb->query( $wpdb->prepare( \"INSERT INTO {$wpdb->prefix}wpc_client_group_clients SET group_id = %d, client_id = '%d'\", $group_id, $userdata['ID'] ) );\r\n }\r\n }\r\n\r\n }\r\n }",
"public function setClient(string $key, string $change=\"set\"){\n /*\n $which_key = \"FriendlyName\";\n $which_value = $ClientName;\n\n $key = $this->search_key($which_key, $which_value, $Client_Array);\n $this->SendDebug('Send','setze Client '.$ClientName , 0);\n $Client_Array[$key]['DeviceActiveIcon'] = \"image/button_ok_blue_80x80.png\";\n */\n if ($change == \"dec\"){\n $key = $this->GetValue(\"upnp_ClientKey\") - 1;\n } \n else if($change ==\"inc\"){\n $key = $this->GetValue(\"upnp_ClientKey\") + 1;\n }\n else{\n $key = $key;\n }\n $array = $this->GetValue(\"upnp_ClientArray\");\n $Client_Array = json_decode($array, JSON_OBJECT_AS_ARRAY);\n $ctClient = count($Client_Array);\n if($key > $ctClient){$key = $ctClient-1;}\n if($key < 0){$key = 0;}\n\n $ClientIP = $Client_Array[$key]['DeviceIP'];\n $ClientPort = $Client_Array[$key]['DevicePort'];\n $friendlyName = $Client_Array[$key]['FriendlyName'];\n $ClientControlServiceType = $Client_Array[$key]['DeviceControlServiceType'];\n $ClientControlURL = $Client_Array[$key]['DeviceControlURL'];\n $ClientRenderingServiceType = $Client_Array[$key]['DeviceRenderingServiceType'];\n $ClientRenderingControlURL = $Client_Array[$key]['DeviceRenderingControlURL'];\n $ClientIconURL = $Client_Array[$key]['IconURL'];\n $this->SetValue(\"upnp_ClienIP\", $ClientIP);\n $this->SetValue(\"upnp_ClientPort\", $ClientPort);\n $this->SetValue(\"upnp_ClientName\", $friendlyName);\n $this->setvalue(\"upnp_ClientKey\", $key);\n //SetValue(UPNP_Device_ControlServiceType, $DeviceControlServiceType);\n $this->SetValue(\"upnp_ClientControlURL\", $ClientControlURL);\n //SetValue(UPNP_Device_RenderingServiceType, $DeviceRenderingServiceType);\n $this->SetValue(\"upnp_ClientRenderingControlURL\", $ClientRenderingControlURL);\n $this->SetValue(\"upnp_ClientIcon\", $ClientIconURL);\n return $key;\n\t}",
"private function cleanPostCurrentPartnerData()\n {\n $this->partner->current = 0;\n $this->partner->total_invoiced_eur = 0;\n $this->partner->save();\n // cleaning post partner cards\n foreach ($this->partner->paymentCards AS $paymentCard) {\n $paymentCard->card_invoiced_eur = 0;\n $paymentCard->current = 0;\n $paymentCard->save();\n }\n }",
"function rebuild_supercarriers()\n{\n\tglobal $globalDb;\n\n\tdo_log(\"Rebuilding 'supercarriers' group membership\",1);\n\t$group=4;\n\t$globalDb->query(\"update group_membership set previous_state=state where group_id='$group'\");\n\t$globalDb->query(\"update group_membership set state=1 where group_id='$group'\");\n\n\t$sth=$globalDb->query(\"SELECT a.user_id, b.corp_id, b.corp_name, d.alliance_name\nFROM auth_users a, api_characters b, corporations c, alliances d\nWHERE b.state <=2 AND b.character_last_ship in ('Aeon','Hel','Nyx','Wyvern','Revenant', 'Vendetta')\nAND a.user_id = b.user_id\nAND (d.alliance_id = c.alliance_id)\nAND c.corp_id = b.corp_id\nAND (c.is_allowed_to_reg = 1 OR d.is_allowed_to_reg = 1)\n\");\n\n\n\twhile($result=$sth->fetch_array()) {\n\t\t$user_id=$result['user_id'];\n\t\tdo_log(\"Starting group chain investigation for user id $user_id against group $group\",9);\n\t\t$chain=check_group_chain($group,$user_id);\n\t\tif($chain==0) {\n\t\t\t$globalDb->query(\"insert into group_membership (`group_id`,`user_id`,`state`) values \" .\n\t\t\t\t\"('$group','$user_id',0) on duplicate key update state='0'\");\n\t\t}\n\t}\n\t$globalDb->query(\"update group_membership set state=99 where state=1 and group_id='$group'\");\n}",
"private function rebuildCheminComplet() {\n $new_chemin_complet = Departement::getCheminComplet($this->intitule, $this->departement_parent_id);\n if ($this->chemin_complet == $new_chemin_complet) {\n // nothing to do\n } else {\n // we set the new one\n $this->chemin_complet = $new_chemin_complet;\n $this->save();\n }\n }",
"static function rebuildFromNewCrop($cid, $current) {\n global $login;\n $sessions = SessionAllergyNc::fromNewCropAllergies($login->userGroupId, $cid, $current['allergy']);\n $actives = FaceAllergyNc::fetchAllActiveNewCrop($cid);\n logit_r($sessions, 'sessions');\n logit_r($actives, 'actives');\n foreach ($sessions as $agent => $sess) {\n if (! isset($actives[$agent])) {\n $face = $sess->asFace();\n $face->save();\n } else {\n $face = $actives[$agent];\n if ($face->isDifferentThan($sess)) {\n $face->reactions = $sess->reactions;\n $face->index = $sess->index;\n $face->date = $sess->date;\n $face->save();\n }\n }\n }\n foreach ($actives as $agent => $face) \n if (! isset($sessions[$agent])) \n $face->deactivate();\n }",
"function UpdateCustomerCreditPositif($UUID, $credit)\r\n{\r\n global $url;\r\n global $db;\r\n global $username;\r\n global $password;\r\n global $common;\r\n global $uid;\r\n global $models;\r\n \r\n $id =SearchCustomerIdByUUID($UUID);\r\n $cred = getCustomerCreditByUUID($UUID);\r\n $cred = $cred + $credit;\r\n \r\n \r\n $models->execute_kw($db, $uid, $password, 'res.partner', 'write',\r\n array(array($id), array('x_credit'=>$cred)));\r\n \r\n \r\n}",
"public function testUpdateNetworkFloorPlan()\n {\n }",
"function createNbaVirtualLineup($reqLineup,$playerLists){\n \n $objParser = Engine_Utilities_GameXmlParser::getInstance();\n $lineupDetails = $objParser->lineupDetails(3);\n \n $unqLineup = array();\n \n foreach($lineupDetails as $lval){\n \n if(array_search($lval, $unqLineup) === false){\n \n array_push($unqLineup,$lval);\n }\n }\n \n $posCount = array_count_values($lineupDetails);\n \n $allPlayers = array(); $i=0;\n \n foreach($playerLists as $pkey=>$pval){\n \n $allPlayers[$i]['id'] = $pval['plr_id'];\n $decode = json_decode($pval['plr_details'],true);\n $allPlayers[$i]['pos_code'] = $decode['pos_code'];\n $allPlayers[$i]['fpts'] = $pval['fpts'];\n $allPlayers[$i]['details'] = $pval['plr_details'];\n $i++;\n }\n \n $index = 0;\n \n foreach($unqLineup as $ulval){\n \n $selectedPlayers = array();\n \n if($ulval === \"G\"){\n \n $specialPlayer = array(\"PG\",\"SG\");\n $specialSelectedPlayers = array();\n \n foreach($specialPlayer as $pVal){\n \n $specialSelectedPlayers = $objParser->filterArray($pVal,$allPlayers,'pos_code');\n $selectedPlayers = array_merge($selectedPlayers,$specialSelectedPlayers);\n }\n \n }else if($ulval === \"F\"){\n \n $specialPlayer = array(\"PF\",\"SF\");\n $specialSelectedPlayers = array();\n \n foreach($specialPlayer as $pVal){\n \n $specialSelectedPlayers = $objParser->filterArray($pVal,$allPlayers,'pos_code');\n $selectedPlayers = array_merge($selectedPlayers,$specialSelectedPlayers);\n }\n \n }else if($ulval === \"UTIL\"){\n \n $specialPlayer = array(\"PG\",\"SG\",\"PF\",\"SF\");\n $specialSelectedPlayers = array();\n \n foreach($specialPlayer as $pVal){\n \n $specialSelectedPlayers = $objParser->filterArray($pVal,$allPlayers,'pos_code');\n $selectedPlayers = array_merge($selectedPlayers,$specialSelectedPlayers);\n }\n }else{\n \n $selectedPlayers = $objParser->filterArray($ulval,$allPlayers,'pos_code');\n }\n// $reqLineup = 5;\n $eachCount = $posCount[$ulval];\n if($reqLineup==1){$eachCount = $eachCount+1;}\n $reqPlayersCount = $eachCount * $reqLineup;\n \n $sorted = $this->array_orderby($selectedPlayers, 'fpts', SORT_DESC);\n \n array_splice($sorted, $reqPlayersCount);\n \n $selectedPlayer[$index]['position'] = $ulval;\n $selectedPlayer[$index]['players'] = $sorted;\n $index++;\n }\n $index=0;\n for($i=1; $i<=$reqLineup; $i++){\n \n $lineup = array();\n $posLineup = array();\n foreach($selectedPlayer as $sVal){\n \n do{\n \n $randomPlayerKey = array_rand($sVal['players']);\n $randomPlayer = $sVal['players'][$randomPlayerKey]; \n $check = array_search($randomPlayer['id'], $lineup);\n if($check === false){\n array_push($lineup,$randomPlayer['id']);\n $posLineup[$randomPlayer['id']] = $sVal['position'];\n }\n \n }while($check != false);\n }\n \n $virtualLineup[$index]['id'] = $lineup;\n $virtualLineup[$index]['position'] = $posLineup;\n $index++;\n }\n if(isset($virtualLineup)){\n return $virtualLineup;\n }else{\n return null;\n }\n \n }",
"function upgrade_network() {}",
"public function createUpdateClient(){\r\n\t $client = $_POST['client'];\r\n\t parse_str($client,$data);\r\n\t if ($state = $this->loginToSandBox()){\r\n\t\t\t$ch = $this->session;\r\n\t\t\tif ($data['operation'] == 'create')\r\n\t\t\t$url = SANDBOX_URL.$this->account_id.'/clients?token='.$this->token; \r\n\t\t\telse\r\n\t\t\t$url = SANDBOX_URL.$this->account_id.'/clients/'.$data['id'].'?token='.$this->token;\r\n\t\t\t$params = array(\r\n\t\t\t\t\tCURLOPT_URL => $url, \r\n\t\t\t\t\tCURLOPT_HEADER => 'Content-Type: application/json; Accept: application/json;',\r\n\t\t\t\t\tCURLOPT_RETURNTRANSFER => 1, \r\n\t\t\t\t\tCURLOPT_TIMEOUT\t\t => 20,\r\n\t\t\t);\r\n\t\t\tif ($data['operation'] == 'create')\r\n\t\t\t$params[CURLOPT_POST] = true; //curl_setopt($ch, CURLOPT_POST, true);\r\n\t\t\telse\r\n\t\t\t$params[CURLOPT_CUSTOMREQUEST] = 'PUT';\r\n\t\t\t$params[CURLOPT_POSTFIELDS] = json_encode(array(\"title\" => $data['title'],\r\n\t\t\t\t\t\t\t\t\t\t \"fullTitle\" => $data['fullTitle'],\r\n\t\t\t\t\t\t\t\t\t \"idCity\" => (int)$data['idCity'],\r\n\t\t\t\t\t\t\t\t\t\t \"address\" => $data['address'],\r\n\t\t\t\t\t\t\t\t\t\t \"phone\" => $data['phone'],\r\n\t\t\t\t\t\t\t\t\t\t \"email\"=> $data['email'],\r\n\t\t\t\t\t\t\t\t\t\t \"inn\" => $data['inn'],\r\n\t\t\t\t\t\t\t\t\t\t \"kpp\" => $data['kpp'],\r\n\t\t\t\t\t\t\t\t\t\t \"jurAddress\" => $data['jurAddress'],\r\n\t\t\t\t\t\t\t\t\t\t \"createDate\" => 0,\r\n\t\t\t\t\t\t\t\t\t\t \"modifyDate\" => 0\r\n\t\t\t\t\t\t\t )\r\n\t\t\t\t\t\t\t\t\t);\r\n\t\t\t//$out = curl_exec($ch);\r\n\t\t\theader('Content-Type: application/json');\r\n\t\t\techo json_encode($this->sendCurl($ch, $params));\r\n\t }else\r\n\t echo $state;\r\n\t}",
"public function partnerMagento()\n {\n $mailinPartnerParameters = array();\n $mailin = $this->createObjMailin($this->apiKey);\n $mailinPartnerParameters['partner'] = 'MAGENTO';\n $mailin->updateMailinParter($mailinPartnerParameters);\n }",
"function change_order_owner($id,$client) {\n\t# used in case an order's client value is set to ANY, so this value becomes CLIENT and no other client will execute the order\n\t$query=\"update orders set client=$client where id='$id'\";\n\t# mysql_unbuffered_query($query);\n\tprint \"become order query $query\\n\";\n\t# print \"### $client deleted order $id\\n\";\n}",
"public function resetPartialHbfVentassRelatedByIdCliente($v = true)\n {\n $this->collHbfVentassRelatedByIdClientePartial = $v;\n }",
"public function resetPartialCiModulossRelatedByIdUserCreated($v = true)\n {\n $this->collCiModulossRelatedByIdUserCreatedPartial = $v;\n }",
"public function updateCreditSum($clientId) {\n if (is_numeric($clientId)) {\n $result = mysql_query(\"UPDATE tblclients as cl SET cl.credit=(SELECT sum(amount) FROM tblcredit as cr WHERE cr.clientid=cl.id) WHERE cl.id=\" . $clientId);\n } else {\n error_log(\"Wrong clientId:\" . $clientId);\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sanitizes a title, replacing whitespace and a few other characters with dashes. Limits the output to alphanumeric characters, underscore (_) and dash (). Whitespace becomes a dash. | function sanitize_title_with_dashes( $title, $raw_title = '', $context = 'display' ) {
$title = strip_tags($title);
// Preserve escaped octets.
$title = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', '---$1---', $title);
// Remove percent signs that are not part of an octet.
$title = str_replace('%', '', $title);
// Restore octets.
$title = preg_replace('|---([a-fA-F0-9][a-fA-F0-9])---|', '%$1', $title);
if (seems_utf8($title)) {
if (function_exists('mb_strtolower')) {
$title = mb_strtolower($title, 'UTF-8');
}
$title = utf8_uri_encode($title, 200);
}
$title = strtolower($title);
$title = preg_replace('/&.+?;/', '', $title); // kill entities
$title = str_replace('.', '-', $title);
if ( 'save' == $context ) {
// Convert nbsp, ndash and mdash to hyphens
$title = str_replace( array( '%c2%a0', '%e2%80%93', '%e2%80%94' ), '-', $title );
// Strip these characters entirely
$title = str_replace( array(
// iexcl and iquest
'%c2%a1', '%c2%bf',
// angle quotes
'%c2%ab', '%c2%bb', '%e2%80%b9', '%e2%80%ba',
// curly quotes
'%e2%80%98', '%e2%80%99', '%e2%80%9c', '%e2%80%9d',
'%e2%80%9a', '%e2%80%9b', '%e2%80%9e', '%e2%80%9f',
// copy, reg, deg, hellip and trade
'%c2%a9', '%c2%ae', '%c2%b0', '%e2%80%a6', '%e2%84%a2',
// acute accents
'%c2%b4', '%cb%8a', '%cc%81', '%cd%81',
// grave accent, macron, caron
'%cc%80', '%cc%84', '%cc%8c',
), '', $title );
// Convert times to x
$title = str_replace( '%c3%97', 'x', $title );
}
$title = preg_replace('/[^%a-z0-9 _-]/', '', $title);
$title = preg_replace('/\s+/', '-', $title);
$title = preg_replace('|-+|', '-', $title);
$title = trim($title, '-');
return $title;
} | [
"function sanitized($title){\r\n $z = strtolower($title);\r\n $z = preg_replace('/[^a-z0-9 -]+/', '', $z);\r\n $z = str_replace(' ', '-', $z);\r\n return trim($z, '-');\r\n}",
"public function sanitize_title($title) {\n\n\t\t$title = strtolower($title);\n\t\t$title = preg_replace('/&.+?;/', '', $title); // kill entities\n\t\t$title = str_replace('.', '-', $title);\n\t\t$title = preg_replace('/[^%a-z0-9 _-]/', '', $title);\n\t\t$title = preg_replace('/\\s+/', '-', $title);\n\t\t$title = preg_replace('|-+|', '-', $title);\n\t\t$title = trim($title, '-');\n\n\t\treturn $title;\n\n\t}",
"protected function _sanitizeTitle($title) \r\n {\r\n $title = preg_replace('/[^A-Za-z0-9-]+/', '-', $title);\r\n \r\n return trim(strtolower($title));\r\n }",
"function sanitize_title_with_dashes($title)\n {\n $title = strip_tags($title);\n // Preserve escaped octets.\n $title = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', '---$1---', $title);\n // Remove percent signs that are not part of an octet.\n $title = str_replace('%', '', $title);\n // Restore octets.\n $title = preg_replace('|---([a-fA-F0-9][a-fA-F0-9])---|', '%$1', $title);\n\n $title = $this->remove_accents($title);\n if ($this->seems_utf8($title)) {\n if (function_exists('mb_strtolower')) {\n $title = mb_strtolower($title, 'UTF-8');\n }\n $title = $this->utf8_uri_encode($title, 200);\n }\n\n $title = strtolower($title);\n $title = preg_replace('/&.+?;/', '', $title); // kill entities\n $title = str_replace('.', '-', $title);\n $title = preg_replace('/[^%a-z0-9 _-]/', '', $title);\n $title = preg_replace('/\\s+/', '-', $title);\n $title = preg_replace('|-+|', '-', $title);\n $title = trim($title, '-');\n\n return $title;\n }",
"function sanitize_title_with_dashes($title) {\n\t$title = strip_tags($title);\n\t// Preserve escaped octets.\n\t$title = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', '---$1---', $title);\n\t// Remove percent signs that are not part of an octet.\n\t$title = str_replace('%', '', $title);\n\t// Restore octets.\n\t$title = preg_replace('|---([a-fA-F0-9][a-fA-F0-9])---|', '%$1', $title);\n\n\t$title = remove_accents($title);\n\tif (seems_utf8($title)) {\n\t\tif (function_exists('mb_strtolower')) {\n\t\t\t$title = mb_strtolower($title, 'UTF-8');\n\t\t}\n\t\t$title = utf8_uri_encode($title, 200);\n\t}\n\n\t$title = strtolower($title);\n\t$title = preg_replace('/&.+?;/', '', $title); // kill entities\n\t$title = str_replace('.', '-', $title);\n\t$title = preg_replace('/[^%a-z0-9 _-]/', '', $title);\n\t$title = preg_replace('/\\s+/', '-', $title);\n\t$title = preg_replace('|-+|', '-', $title);\n\t$title = trim($title, '-');\n\n\treturn $title;\n}",
"function tc_clean_slug($title) {\n\t\t$title = strtolower(str_replace(array('-','_'), ' ', $title));\n\t\t$title = ucwords($title);\n\t\treturn $title;\n\t}",
"function sanitize_title( $unsafe_title ) {\n\t$title = $unsafe_title;\n\t$title = strip_tags( $title );\n\t$title = preg_replace( \"/\\s+/\", ' ', trim( $title ) );\n\treturn apply_filter( 'sanitize_title', $title, $unsafe_title );\n}",
"function sanitize($title)\n{\n $title = strip_tags($title);\n // Preserve escaped octets.\n $title = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', '---$1---', $title);\n // Remove percent signs that are not part of an octet.\n $title = str_replace('%', '', $title);\n // Restore octets.\n $title = preg_replace('|---([a-fA-F0-9][a-fA-F0-9])---|', '%$1', $title);\n\n if (seems_utf8($title)) {\n if (function_exists('mb_strtolower')) {\n $title = mb_strtolower($title, 'UTF-8');\n }\n $title = utf8_uri_encode($title, 200);\n }\n\n $title = strtolower($title);\n $title = preg_replace('/&.+?;/', '', $title); // kill entities\n //$title = str_replace('.', '-', $title); // Preserve dot\n $title = preg_replace('/[^%a-z0-9#. _-]/', '', $title); // original: [^%a-z0-9 _-], now includes #.\n $title = preg_replace('/\\s+/', '-', $title); // replaces any whitespace cahracter\n $title = preg_replace('|-+|', '-', $title);\n $title = trim($title, '-'); // Strips -\n\n return $title;\n}",
"public function hyphenate($title)\n {\n $title = strtolower(str_replace(array(\"%20\", \" \"), '-', $title));\n $title = preg_replace('/[^a-z\\-]/i','',$title);\n return $title;\n }",
"function wt_html_sanitize_title( $title ) {\n\treturn wp_kses( $title, wt_html_allowed() );\n}",
"function title_to_slug($string) {\n //Lower case everything\n $string = strtolower($string);\n //Make alphanumeric (removes all other characters)\n $string = preg_replace(\"/[^a-z0-9_\\s-]/\", \"\", $string);\n //Clean up multiple dashes or whitespaces\n $string = preg_replace(\"/[\\s-]+/\", \" \", $string);\n //Convert whitespaces and underscore to dash\n $string = preg_replace(\"/[\\s_]/\", \"-\", $string);\n return $string;\n}",
"function hyphenate_title($url_title) {\n\n\n\t$url_title = strtolower($url_title);\n\n\t$patterns = array();\n\t$replacements = array();\n\t\n\t\n\t$patterns[0] = '/\\b[a-z]\\b/';\n\t$replacements[0] = '';\n\n\t$patterns[1] = '/\\b[a-z][a-z]\\b/';\n\t$replacements[1] = '';\n\n\t$patterns[2] = '/[0-9] (value|regular)\\b/';\n\t$replacements[2] = '';\n\n\t$patterns[3] = '/[0-9] (towards|spend)\\b/';\n\t$replacements[3] = '';\n\n\t$patterns[4] = '/\\b(for|the|and|are|but|you|reg|your|more)\\b/i';\n\t$replacements[4] = '';\n\n\t$patterns[5] = '/&[0-9a-z]+;/';\n\t$replacements[5] = '-';\n\n\t$patterns[6] = '/[^a-z0-9\\-]/';\n\t$replacements[6] = '-';\n\n\t$patterns[7] = '/\\b[0-9]+\\b/';\n\t$replacements[7] = '-';\n\t\n\t$patterns[8] = '/ /';\n\t$replacements[8] = '-';\n\n\t$patterns[9] = '/-+/';\n\t$replacements[9] = '-';\n\n\t$patterns[10] = '/deal-ends-soon/';\n\t$replacements[10] = '';\n\n\t$patterns[11] = '/^-/';\n\t$replacements[11] = '';\n\n\t$patterns[12] = '/-$/';\n\t$replacements[12] = '';\n\t\n\t$url_title = preg_replace($patterns, $replacements, $url_title);\n\t\n\tif ($url_title == \"\") {\n\t\t$url_title = \"deal\";\n\t}\n\n\n\treturn $url_title;\n}",
"protected function cleanouttitleordesc($title) {\n\t\t$title = str_replace(' ', 'ZrGrM', $title);\n\t\t$search = array('@<script[^>]*?>.*?</script>@si', // Strip out javascript\n\t\t\t\t'@<[\\/\\!]*?[^<>]*?>@si', // Strip out HTML tags\n\t\t\t\t'@<style[^>]*?>.*?</style>@siU', // Strip style tags properly\n\t\t\t\t'@<![\\s\\S]*?--[ \\t\\n\\r]*>@', // Strip multi-line comments including CDATA\n\t\t);\n\t\t$titleclean = ' ' . preg_replace($search, '', $title);\n\t\t$searcharr = array();\n\t\t$searcharr = explode('http', $titleclean);\n\t\t$textdedoublespaced = '';\n\t\tif (count($searcharr) > 1) {\n\t\t\t$countstrsrcharr = count($searcharr);\n\t\t\tfor ($d=0; $d<$countstrsrcharr; $d=$d+2) {\n\t\t\t\t$textdedoublespaced .= $searcharr[$d];\n\t\t\t\t$searcharr2 = explode(' ', $searcharr[$d+1]);\n\t\t\t\tunset($searcharr2[0]);\n\t\t\t\t$textdedoublespaced .= ' ' . implode(' ', $searcharr2);\n\n\t\t\t}\n\n\t\t} else {\n\t\t\t$textdedoublespaced = trim($titleclean);\n\t\t}\n\n\t\t$title = $textdedoublespaced;\n\t\t$cleanspacearr= explode(' ', $title);\n\t\t$textdedoublespaced= '';\n\t\tif (count($cleanspacearr)>1) {\n\t\t\t$countcleanspacearr=count($cleanspacearr);\n\t\t\tfor ($d=0; $d<$countcleanspacearr; $d++) {\n\t\t\t\tif (trim($cleanspacearr[$d]) != '') {\n\t\t\t\t\t$textdedoublespaced .= trim($cleanspacearr[$d]) . ' ';\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else {\n\t\t\t$textdedoublespaced = $title;\n\t\t}\n\n\t\t$title = trim($textdedoublespaced);\n\t\tif ($title!=''){\n\t\t\t$titlearr = array();\n\t\t\t$titlearr = explode(' ', $title);\n\t\t\tif (count($titlearr) > 1) {\n\t\t\t\t$counttitlearr = count($titlearr);\n\t\t\t\tfor ($i=0; $i<$counttitlearr; $i++) {\n\t\t\t\t\t$titlearr2 = array();\n\t\t\t\t\t$titlearr2 = explode('-', $titlearr[$i]);\n\t\t\t\t\tif (count($titlearr2) > 1) {\n\t\t\t\t\t\t$counttitlearr2 = count($titlearr2);\n\t\t\t\t\t\tfor ($ti=0; $ti<$counttitlearr2; $ti++) {\n\t\t\t\t\t\t\t$titlearr2[$ti]=$this->checkandcorrUTF8 ($titlearr2[$ti]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$titlearr[$i]=implode ('-', $titlearr2);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$titlearr[$i]=$this->checkandcorrUTF8($titlearr[$i]);\n \t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\t$title=implode(' ', $titlearr);\n\t\t\t} else {\n\t\t\t\t$title=$this->checkandcorrUTF8($title);\n\t\t\t}\n\n\t\t}\n\t\t$title = str_replace('ZrGrM', ' ', $title);\n\t\treturn $title;\n\t}",
"function format_game_title($title){\n return str_replace(' ','',ucwords(str_replace('_',' ',str_replace('-',' ',$title))));\n}",
"function sanitize_title_no_final_period ($title) {\n $title = strip_tags($title);\n // Preserve escaped octets.\n $title = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', '---$1---', $title);\n // Remove percent signs that are not part of an octet.\n $title = str_replace('%', '', $title);\n // Restore octets.\n $title = preg_replace('|---([a-fA-F0-9][a-fA-F0-9])---|', '%$1', $title);\n\n $title = remove_accents($title);\n if (seems_utf8($title)) {\n if (function_exists('mb_strtolower')) {\n $title = mb_strtolower($title, 'UTF-8');\n }\n $title = utf8_uri_encode($title);\n }\n\n $title = strtolower($title);\n $title = preg_replace('/&.+?;/', '', $title); // kill entities\n $title = preg_replace('/[^%a-z0-9\\. _-]/', '', $title);\n $title = preg_replace('/\\s+/', '-', $title);\n $title = preg_replace('|-+|', '-', $title);\n $title = trim($title, '-\\.');\n\n return $title;\n}",
"function grd_custom_archive_title( $title ) {\n // Remove any HTML, words, digits, and spaces before the title.\n return preg_replace( '#^[\\w\\d\\s]+:\\s*#', '', strip_tags( $title ) );\n }",
"public function slugify(string $title) : string;",
"private function makeTitleFriendly($title)\n\t{\n\t\t// parse title for problem entities\n\t\t$title = htmlentities($title, ENT_QUOTES, \"UTF-8\");\t\t\n\t\t$problem_chars = array(\n\t\t\t\t\t\t\t\t\t\t''' => '%26amp%3B%238217%3B',\n\t\t\t\t\t\t\t\t\t\t''' => '&#8217;',\n\t\t\t\t\t\t\t\t\t\t'&' => '%26amp%3Bamp%3B',\n\t\t\t\t\t\t\t\t\t\t'...' => '…',\n\t\t\t\t\t\t\t\t\t\t'&' => '&amp;',\n\t\t\t\t\t\t\t\t\t );\n\t\t\t\t\t\t\t\t\t \n\t\tforeach($problem_chars as $true_char => $crap_char)\n\t\t{\n\t\t\t$title = str_replace($crap_char, $true_char, $title);\n\t\t}\n\t\treturn $title;\n\t}",
"function makeURLFriendly($pre_title){\n\t$symbol_swap = array('symbols' => array('%', '&', '&'), 'words' => array(' percent ', 'and', 'and'));\n \t$post_title = str_replace($symbol_swap['symbols'], $symbol_swap['words'], stripslashes($pre_title));\n \t$post_title = ereg_replace(\"[^A-Za-z0-9 -]\", '', $post_title);\n \t$post_title = strtolower(preg_replace('/[-|\\s]+/','-', $post_title));\n\treturn $post_title;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation getSmtpReportWithHttpInfo Get your transactional email activity aggregated per day | public function getSmtpReportWithHttpInfo($limit = '10', $offset = '0', $startDate = null, $endDate = null, $days = null, $tag = null, $sort = 'desc')
{
$returnType = '\SendinBlue\Client\Model\GetReports';
$request = $this->getSmtpReportRequest($limit, $offset, $startDate, $endDate, $days, $tag, $sort);
try {
$options = $this->createHttpClientOption();
try {
$response = $this->client->send($request, $options);
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
$e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
$e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
);
}
$statusCode = $response->getStatusCode();
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$request->getUri()
),
$statusCode,
$response->getHeaders(),
$response->getBody()
);
}
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
if ($returnType !== 'string') {
$content = json_decode($content);
}
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
} catch (ApiException $e) {
switch ($e->getCode()) {
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\SendinBlue\Client\Model\GetReports',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\SendinBlue\Client\Model\ErrorModel',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
}
throw $e;
}
} | [
"public function trackingSmtp()\n {\n $smtpDetails = array();\n $apiKey = $this->getDbData('api_key');\n if (!empty($apiKey)) {\n $mailin = $this->createObjMailin($apiKey);\n $smtpDetails = $mailin->getSmtpDetails();\n return $smtpDetails;\n }\n }",
"public function getReportsWithHttpInfo()\n {\n return $this->getReportsWithHttpInfoRetry(true );\n }",
"public function getSmtpDetails()\n {\n return $this->get(\"account/smtpdetail\", \"\");\n }",
"public function trackingSmtp()\n {\n $params['api_key'] = $this->apiKey;\n $psmailinObj = Mage::getModel('sendinblue/psmailin', $params);\n $smtpDetails = $psmailinObj->getSmtpDetails();\n return $smtpDetails;\n }",
"public static function get_email_row_statistics() {\n\t\tglobal $inbound_settings;\n\n\t\t$stats = get_transient( 'inbound-email-stats-cache');\n\n\t\tif (!is_array($stats)) {\n\t\t\t$stats = array();\n\t\t}\n\n\t\tif (isset($stats[$_REQUEST['email_id']])) {\n\t\t\techo json_encode($stats[$_REQUEST['email_id']]);\n\t\t\theader('HTTP/1.1 200 OK');\n\t\t\texit;\n\t\t}\n\n\t\tswitch ($inbound_settings['inbound-mailer']['mail-service']) {\n\t\t\tcase \"mandrill\":\n\t\t\t\t$stats[$_REQUEST['email_id']] = Inbound_Mandrill_Stats::get_email_timeseries_stats( $_REQUEST['email_id'] );\n\n\t\t\t\tbreak;\n\t\t\tcase \"sparkpost\":\n\t\t\t\t$stats[$_REQUEST['email_id']] = Inbound_SparkPost_Stats::get_sparkpost_inbound_events( $_REQUEST['email_id'] );\n\t\t\t\t//$stats[$_REQUEST['email_id']] = Inbound_SparkPost_Stats::get_email_timeseries_stats( $_REQUEST['email_id'] );\n\t\t\t\tbreak;\n\t\t}\n\n\t\tset_transient('inbound-email-stats-cache' , $stats , 60* 5);\n\n\t\techo json_encode($stats[$_REQUEST['email_id']]);\n\t\theader('HTTP/1.1 200 OK');\n\t\texit;\n\t}",
"public function get_smtp_details()\n {\n return $this->get(\"account/smtpdetail\",\"\");\n }",
"public function getAggregatedSmtpReportWithHttpInfo($start_date = null, $end_date = null, $days = null, $tag = null)\n {\n // parse inputs\n $resourcePath = \"/smtp/statistics/aggregatedReport\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json'));\n\n // query params\n if ($start_date !== null) {\n $queryParams['startDate'] = $this->apiClient->getSerializer()->toQueryValue($start_date);\n }\n // query params\n if ($end_date !== null) {\n $queryParams['endDate'] = $this->apiClient->getSerializer()->toQueryValue($end_date);\n }\n // query params\n if ($days !== null) {\n $queryParams['days'] = $this->apiClient->getSerializer()->toQueryValue($days);\n }\n // query params\n if ($tag !== null) {\n $queryParams['tag'] = $this->apiClient->getSerializer()->toQueryValue($tag);\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('api-key');\n if (strlen($apiKey) !== 0) {\n $headerParams['api-key'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'GET',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\Swagger\\Client\\Model\\GetAggregatedReport',\n '/smtp/statistics/aggregatedReport'\n );\n\n return array($this->apiClient->getSerializer()->deserialize($response, '\\Swagger\\Client\\Model\\GetAggregatedReport', $httpHeader), $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Swagger\\Client\\Model\\GetAggregatedReport', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 400:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Swagger\\Client\\Model\\ErrorModel', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function requestDailyReport()\n {\n $client = $this->guzzleClient ?: new GuzzleClient($this->apiEndpoint);\n\n $request = $client->get(\n '/anapi/daily_summary_feed',\n ['Accept' => 'application/json'],\n ['query' => ['key' => $this->apiKey, 'format' => $this->format]]\n );\n\n $response = $request->send();\n\n return $this->handleResponse($response);\n }",
"public function trackingSmtp()\n {\n $smtpDetails = array();\n $mailinObj = $this->createObjSibClient();\n $smtpDetails = $mailinObj->getAccount();\n if (SendinblueSibClient::RESPONSE_CODE_OK === $mailinObj->getLastResponseCode()) {\n return $smtpDetails;\n }\n return false;\n }",
"function apiContactDetailsReport($reportType='rpt_Contact_Details',$email=''){\r\n\r\n\t\t$soapXml='<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n\t\t\t\t\t<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">\r\n\t\t\t\t\t\t<soap:Body>\r\n\t\t\t\t\t\t\t<DownloadReport xmlns=\"https://ws.campaigner.com/2013/01/\">\r\n\t\t\t\t\t\t\t\t'.$this->getAuthenticationNode().'\r\n\t\t\t\t\t\t\t\t<reportType>'.$reportType.'</reportType>\r\n\t\t\t\t\t\t\t\t<fromRow>1</fromRow>\r\n\t\t\t\t\t\t\t\t<toRow>10</toRow>\r\n\t\t\t\t\t\t\t</DownloadReport>\r\n\t\t\t\t\t\t</soap:Body>\r\n\t\t\t\t\t</soap:Envelope>';\r\n\r\n\t\r\n\t\t$headerArr[] = \"SOAPAction: \\\"https://ws.campaigner.com/2013/01/DownloadReport\\\"\";\r\n\r\n\t\treturn $this->apiCurlRequest('POST', 'https://ws.campaigner.com/2013/01/contactmanagement.asmx', $headerArr, $soapXml);\r\n\t}",
"public function auReportsTimesheetGetWithHttpInfo($business_id, $request_employee_id = null, $request_include_costs = null, $request_statuses = null, $request_work_type_id = null, $request_pay_schedule_id = null, $request_include_post_tax_deductions = null, $request_from_date = null, $request_to_date = null, $request_location_id = null, $request_employing_entity_id = null, string $contentType = self::contentTypes['auReportsTimesheetGet'][0])\n {\n $request = $this->auReportsTimesheetGetRequest($business_id, $request_employee_id, $request_include_costs, $request_statuses, $request_work_type_id, $request_pay_schedule_id, $request_include_post_tax_deductions, $request_from_date, $request_to_date, $request_location_id, $request_employing_entity_id, $contentType);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n } catch (ConnectException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n null,\n null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n (string) $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n\n switch($statusCode) {\n case 200:\n if ('\\OpenAPI\\Client\\Model\\AuTimesheetExportModel[]' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\OpenAPI\\Client\\Model\\AuTimesheetExportModel[]' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\AuTimesheetExportModel[]', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\AuTimesheetExportModel[]';\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\OpenAPI\\Client\\Model\\AuTimesheetExportModel[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function getMailingStatistics()\n {\n $query = $this->em->createQuery('\n SELECT\n m.id AS messageId, COUNT(u.viewed) AS views, COUNT(u.status) AS total,\n m.subject, m.sent, m.bounceCount AS bounceCount, (COUNT(u.viewed) / COUNT(u.status) * 100) AS rate\n FROM\n IdeupPhplistBundle:PhplistUserMessage u\n JOIN\n u.message m\n GROUP BY u.newsletterId\n ORDER BY m.sent DESC\n ');\n return $query->getResult();\n }",
"public static function getStatsMailOpenedByHour($id)\n\t{\n\n\t\t$return = (array)BackendModel::getContainer()->get('database')->getRecords('SELECT COUNT(i.user_id) AS opened, DATE_FORMAT(i.created_on, \"%H\") AS date_group_by\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM mailengine_stats_mail_opened AS i\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE i.send_id = ?\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGROUP by date_group_by\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tORDER BY date_group_by', array((int)$id));\n\n\t\t$xAxis = array();\n\t\t$seriesData = array();\n\n\t\t$hour = 0;\n\t\twhile($hour < 24)\n\t\t{\n\t\t\t//--Alter the hour (add 0 before single digit hour)\n\t\t\t$hourCalculation = str_pad($hour, 2, \"0\", STR_PAD_LEFT);\n\n\t\t\t//--Set opened\n\t\t\t$opened = 0;\n\n\t\t\t//--Loop the dates and format the date\n\t\t\tforeach($return as &$row)\n\t\t\t{\n\t\t\t\tif($hourCalculation == $row['date_group_by'])\n\t\t\t\t{\n\t\t\t\t\t$opened = (int)$row['opened'];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//--Add the data\n\t\t\t$xAxis[] = $hourCalculation . ':00';\n\t\t\t$seriesData[] = $opened;\n\n\t\t\t//--Add the hour\n\t\t\t$hour++;\n\t\t}\n\n\t\t$mailOpenedByDateChart = array();\n\t\t$mailOpenedByDateChart['title'] = json_encode(ucfirst(BL::getLabel('MailsOpenedByHour', 'Mailengine')));\n\t\t$mailOpenedByDateChart['xAxis'] = json_encode($xAxis);\n\t\t$mailOpenedByDateChart['series'] = json_encode(array('name' => ucfirst(BL::getLabel('MailsOpened', 'Mailengine')), 'data' => $seriesData));\n\n\t\treturn $mailOpenedByDateChart;\n\t}",
"public function getMailStatisticsEndpoint() {\n return $this->mail_statistics_endpoint;\n }",
"public function getSmtpReportAsync($limit = '10', $offset = '0', $startDate = null, $endDate = null, $days = null, $tag = null, $sort = 'desc')\n {\n return $this->getSmtpReportAsyncWithHttpInfo($limit, $offset, $startDate, $endDate, $days, $tag, $sort)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function reportsGetWithHttpInfo($statuses, $from = null, $to = null, $channel_name = null, $limit = '0', $offset = '0', $include_email = 'True', $include_sms = 'True', $email = null, $ipaddress = null)\n {\n $returnType = '\\Swagger\\Client\\Model\\Log';\n $request = $this->reportsGetRequest($statuses, $from, $to, $channel_name, $limit, $offset, $include_email, $include_sms, $email, $ipaddress);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\Log',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function sendDailyCRMReport() {\n $right_now_date = date('Y-m-d H:i:s');\n\n $daily_reports = CrmAutoReporting::on('bk')\n ->select('user_id', 'date', 'time', 'last_sent')\n ->get();\n\n foreach ($daily_reports as $report) {\n Queue::push(new SendDailyCrmReport($report, $right_now_date));\n }\n\n return 'success';\n }",
"function SummarizeEmailSend($queueid=0, $statid=0, $userid=0)\n\t{\n\t\t// ----- Initialize common variables for this function\n\t\t\t$totalRecipient = 0;\n\t\t\t$timeStart = 0;\n\t\t\t$timeFinished = 0;\n\n\t\t\t$mStatID = intval($statid);\n\t\t\t$mUserID = intval($userid);\n\t\t// -----\n\n\n\t\t// ----- Get statistic information from stats_newsletter table\n\t\t\t$rs = $this->Db->Query(\"\n\t\t\t\tSELECT\thtmlrecipients, textrecipients, multipartrecipients, starttime, finishtime\n\t\t\t\tFROM\t[|PREFIX|]stats_newsletters\n\t\t\t\tWHERE\tstatid={$mStatID}\n\t\t\t\");\n\n\t\t\tif ($rs !== false) {\n\t\t\t\t$row = $this->Db->Fetch($rs);\n\t\t\t\t$this->Db->FreeResult($rs);\n\n\t\t\t\tif ($row !== false) {\n\t\t\t\t\t$totalRecipient = $row['htmlrecipients'] + $row['textrecipients'] + $row['multipartrecipients'];\n\t\t\t\t\t$timeStart = intval($row['starttime']);\n\t\t\t\t\t$timeFinished = intval($row['finishtime']);\n\t\t\t\t} else {\n\t\t\t\t\terror_log('stats_API::SummarizeEmailSend - Newsletter statistic does not exist');\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\terror_log('stats_API::SummarizeEmailSend - Cannot get newsletter statistics');\n\t\t\t}\n\t\t// -----\n\n\n\t\t// ----- Calculate how many emails have already been recorded and subtract that from the total\n\t\t\t$query = \"\n\t\t\t\tSELECT\tSUM(emailssent) as count\n\t\t\t\tFROM\t[|PREFIX|]user_stats_emailsperhour\n\t\t\t\tWHERE\tuserid = {$mUserID} AND statid = {$mStatID}\n\t\t\t\";\n\n\t\t\t$result = $this->Db->Query($query);\n\t\t\t$totalRecorded = $this->Db->FetchOne($result, 'count');\n\t\t\tif ($totalRecorded > 0) {\n\t\t\t\t$totalRecipient -= $totalRecorded;\n\t\t\t}\n\t\t// -----\n\n\n\t\t// ----- Calculate and insert statistic to user_stats_emailsperhour table\n\t\t\tif ($totalRecipient > 0) {\n\t\t\t\t$tempSpan = $timeFinished - $timeStart;\n\t\t\t\t$tempHours = floor($tempSpan / 3600);\n\t\t\t\t$tempAverage = ($tempHours == 0 ? 0 : floor($totalRecipient / $tempHours));\n\t\t\t\t$tempRemainder = ($tempHours == 0 ? $totalRecipient : ($totalRecipient % $tempHours));\n\n\t\t\t\t// Get the starting time in increment of hours\n\t\t\t\t// ie. If the campaign is started on 26th of Feb 2009 14:16,\n\t\t\t\t// it will contains 26th of Feb 2009 14:00\n\t\t\t\t// The time is noted as unix timestamp\n\t\t\t\t$tempCurrentTime = $timeStart - ($timeStart % 3600);\n\n\t\t\t\tfor ($i = 0; $i <= $tempHours; ++$i) {\n\t\t\t\t\t$tempCurrentRecipient = ($i == $tempHours) ? $tempRemainder : $tempAverage;\n\n\t\t\t\t\t$status = $this->Db->Query(\"\n\t\t\t\t\t\tINSERT INTO [|PREFIX|]user_stats_emailsperhour(statid, sendtime, emailssent, userid)\n\t\t\t\t\t\tVALUES ({$mStatID}, {$tempCurrentTime}, {$tempCurrentRecipient}, {$mUserID})\n\t\t\t\t\t\");\n\n\t\t\t\t\tif ($status === false) {\n\t\t\t\t\t\terror_log('stats_API::SummarizeEmailSend - Cannot insert into user_stats_emailsperhour table - Error message: ' . $this->Db->Error());\n\t\t\t\t\t}\n\n\t\t\t\t\t$tempCurrentTime += 3600;\n\t\t\t\t}\n\t\t\t}\n\t\t// -----\n\t}",
"public function daily($project_id = null)\n {\n $now = $this->test_env ? Carbon::parse('2020-01-14') : Carbon::now();\n $dateRange = array(\n $now->startOfDay()->format('Y-m-d H:i:s'),\n $now->endOfDay()->format('Y-m-d H:i:s')\n );\n $date = Carbon::parse($now)->format('d F, Y');\n\n $emailInfo = array(\n 'type' => 'daily',\n 'subject' => 'Daily Report',\n 'unique_id' => 'emailFreq_dailyReport'\n );\n $info = $this->SendEmail($emailInfo, $dateRange, $date, $project_id);\n\n if ($this->show_view) { // Show view if show_view is enabled\n if ($info) {\n return $info;\n }\n } else {\n echo $date . '<br/>';\n }\n\n if ($info) {\n echo $emailInfo['subject'] . \" Email Send Successfully\";\n } else {\n echo $emailInfo['subject'] . \" Email Sending Failed\";\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Declares the Subscribe2 widget class. | function __construct() {
$widget_ops = array( 'classname' => 's2_form_widget', 'description' => esc_html__( 'Sidebar Widget for Subscribe2', 'subscribe2' ) );
$control_ops = array( 'width' => 250, 'height' => 300 );
parent::__construct( 's2_form_widget', esc_html__( 'Subscribe2 Widget', 'subscribe2' ), $widget_ops, $control_ops );
} | [
"function register_subscribe2_meta_box()\n\t{\n\t\tglobal $mysubscribe2;\n\t\tif ($mysubscribe2) {\n\t\t\tadd_meta_box(\n\t\t\t\t'subscribe2',\n\t\t\t\t'Subscribe2 Notification Override',\n\t\t\t\tarray(&$mysubscribe2, 's2_meta_box'),\n\t\t\t\t'gig',\n\t\t\t\t'advanced'\n\t\t\t);\n\t\t}\n\t}",
"function bulldog_newsletter_subscribe_widget(){\n\t\n\trequire_once( trailingslashit( BULLDOG_NEWSLETTER_DIR ) . 'widget-subscribe-box.php' );\n\tregister_widget( 'Widget_Subscribe_Box' );\n}",
"public function setToSubscribe()\n {\n $this->buttonType = self::SUBSCRIBE;\n return $this;\n }",
"function neat_subscribeform(){\n\t\t\t$args = array(\n\t\t\t\t'name'\t=>\t__('Subscribe Form','neat'),\n\t\t\t\t'base'\t=>\t'neat_subscribeform',\n\t\t\t\t'category'\t=>\t__('NeatTheme','neat'),\n\t\t\t\t'class'\t=>\t'neat',\n\t\t\t\t'icon'\t=>\t'neat',\n\t\t\t\t'description'\t=>\t__('Display the Subscribe Form.','neat'),\n\t\t\t\t'params'\t=>\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'type'\t=>\t'textfield',\n\t\t\t\t\t\t'holder'\t=>\t'div',\n\t\t\t\t\t\t'class'\t=>\t'',\n\t\t\t\t\t\t'heading'\t=>\t__('Title','neat'),\n\t\t\t\t\t\t'param_name'\t=>\t'title',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'type'\t=>\t'dropdown',\n\t\t\t\t\t\t'holder'\t=>\t'div',\n\t\t\t\t\t\t'class'\t=>\t'',\n\t\t\t\t\t\t'heading'\t=>\t__('How it works?','neat'),\n\t\t\t\t\t\t'param_name'\t=>\t'type',\n\t\t\t\t\t\t'value'\t=>\tarray(\n\t\t\t\t\t\t\t__('Save the Email as Subscriber User','neat') \t\t=>\t\t'default',\n\t\t\t\t\t\t\t__('Forward the data to another site','neat') \t\t=>\t\t'external'\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'type'\t=>\t'textfield',\n\t\t\t\t\t\t'holder'\t=>\t'div',\n\t\t\t\t\t\t'class'\t=>\t'',\n\t\t\t\t\t\t'heading'\t=>\t__('External Link','neat'),\n\t\t\t\t\t\t'description'\t=>\t__('This link will handle the action.','neat'),\n\t\t\t\t\t\t'param_name'\t=>\t'external_link',\n\t\t\t\t\t\t'dependency'\t=>\tarray(\n\t\t\t\t\t\t\t'element'\t=>\t'type',\n\t\t\t\t\t\t\t'value'\t=>\t'external'\n\t\t\t\t\t\t),\t\t\t\t\t\t\t\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'type'\t=>\t'textfield',\n\t\t\t\t\t\t'holder'\t=>\t'div',\n\t\t\t\t\t\t'class'\t=>\t'',\n\t\t\t\t\t\t'heading'\t=>\t__('Class','neat'),\n\t\t\t\t\t\t'param_name'\t=>\t'el_class',\n\t\t\t\t\t\t'description' => __( 'If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'neat' )\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t\tvc_map( $args );\t\t\t\n\t\t}",
"function register_abNewsletter_Widget() {\n register_widget( 'abNewsletter_Widget' );\n}",
"public function _construct()\r\n {\r\n $this->_init('advsubscribe/advsubscribe', 'advsubscribe_id');\r\n }",
"public function _register_widgets() {}",
"public function _register_widgets()\n {\n }",
"public static function init() {\r\n register_widget(__CLASS__);\r\n }",
"function ceres_widget_1() {\r\n\t\tparent::__construct(false, $name = esc_html__('Ceres Widget #1', 'ceres' ), array(\r\n\t\t\t'description' => esc_html__('Homepage Widget #1', 'ceres' )\r\n\t\t));\r\n\t}",
"public function ajax_subscribe_widget()\n {\n // Check if feature is enabled\n if (!$this->opt['woochimp_enabled'] || !$this->opt['woochimp_enabled_widget']) {\n echo $this->prepare_json_label('woochimp_label_error', true);\n die();\n }\n\n // Check if data was received\n if (!isset($_POST['data'])) {\n echo $this->prepare_json_label('woochimp_label_error', true);\n die();\n }\n\n $data = array();\n parse_str($_POST['data'], $data);\n\n // Check if our vars were received\n if (!isset($data['woochimp_widget_subscription']) || empty($data['woochimp_widget_subscription'])) {\n echo $this->prepare_json_label('woochimp_label_error', true);\n die();\n }\n\n $data = $data['woochimp_widget_subscription'];\n\n // Check if email was received\n if (!isset($data['email']) || empty($data['email'])) {\n echo $this->prepare_json_label('woochimp_label_error', true);\n die();\n }\n\n $email = $data['email'];\n\n // Get double opt-in option\n $double_optin = (bool) $this->opt['woochimp_double_widget'];\n\n // Get user id\n $user_id = is_user_logged_in() ? get_current_user_id() : 0;\n\n // Parse custom fields\n $custom_fields = array();\n\n if (isset($data['custom']) && !empty($data['custom'])) {\n foreach ($data['custom'] as $key => $value) {\n $field_ok = false;\n\n foreach ($this->opt['woochimp_widget_fields'] as $custom_field) {\n if ($key == $custom_field['tag']) {\n $field_ok = true;\n break;\n }\n }\n\n if ($field_ok) {\n $custom_fields[$key] = $value;\n }\n }\n }\n\n // Subscribe user\n $result = $this->subscribe($this->opt['woochimp_list_widget'], $email, $this->opt['woochimp_groups_widget'], $custom_fields, $user_id, $double_optin);\n\n // Subscribe successfully\n if ($result === true) {\n echo $this->prepare_json_label('woochimp_label_success', false);\n die();\n }\n\n // Already subscribed\n else if ($result == 'member_exists') {\n echo $this->prepare_json_label('woochimp_label_already_subscribed', true);\n die();\n }\n\n // Other errors\n echo $this->prepare_json_label('woochimp_label_error', true);\n die();\n }",
"static function register_delivery_widget(){\n\t\tregister_widget('WooDeliveryTimeWidget');\n\t\tregister_widget('WooDeliveryCodeWidget');\t\t\n\t}",
"function widget_ac_subscribe_public($args = false) {\n\n\t$options_site = ac_subscribe_options_site_get();\n\t$options_form = ac_subscribe_options_form_get();\n\n\tif ($args) extract($args);\n\n\techo $before_widget;\n\techo $before_title;\n\n\tif ( !function_exists(curl_init) ) {\n\t\tac_subscribe_curl_fail();\n\t}\n\telse {\n\t\tif (!(int)$options_form[\"form_fetch\"]) {\n\t\t\t// if it's set to display the static HTML saved in the Wordpress database\n\t\t\tif ($options_form[\"form_html\"]) {\n\t\t\t\t$form_html = $options_form[\"form_html\"];\n\n\t\t\t\tif ( (int)$options_form[\"remove_css\"] ) {\n\t\t\t\t\t// remove <style> block\n\t\t\t\t\tpreg_match_all(\"|<style[^>]*>(.*)</style>|iUs\", $form_html, $matches);\n\t\t\t\t\tif ( isset($matches[0]) and count($matches[0]) > 0 ) {\n\t\t\t\t\t\t$form_html = str_replace($matches[0], \"\", $form_html);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// replace <input type=\"button\" with <input type=\"submit\" (otherwise the form won't submit)\n//print_r($matches);exit();\n\t\t\t\t$form_html = preg_replace(\"/<input type=[\\\"']?button[\\\"']? value=[\\\"']?Subscribe[\\\"']?>/i\", \"<input type=\\\"submit\\\" value=\\\"Subscribe\\\">\", $form_html);\n\t\t\t\techo $form_html;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t// If it's set to fetch the form each time (using the API)\n\t\t\tif ($options_site[\"api_url\"] && $options_site[\"api_key\"] && $options_form[\"form_id\"]) {\n\n\t\t\t\t$api_url = $options_site[\"api_url\"] . \"admin/api.php?api_key=\" . $options_site[\"api_key\"] . \"&api_action=form_view&api_output=serialize&id=\" . $options_form[\"form_id\"];\n\t\t\t\t$api_result = ac_subscribe_curl_get($api_url);\n\n\t\t\t\t// for some reason the very first character of the string is \"s\" instead of \"<\". Example: sstyle>\n\t\t\t\t$api_result = preg_replace(\"/^s?/i\", \"<\", $api_result);\n\n\t\t\t\tif ( (int)$options_form[\"remove_css\"] ) {\n\t\t\t\t\t// remove <style> block\n\t\t\t\t\tpreg_match_all(\"|<style[^>]*>(.*)</style>|iUs\", $api_result, $matches);\n\t\t\t\t\tif ( isset($matches[0]) and count($matches[0]) > 0 ) {\n\t\t\t\t\t\t$api_result = str_replace($matches[0], \"\", $api_result);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// replace <input type=\"button\" with <input type=\"submit\" (otherwise the form won't submit)\n\t\t\t\t$api_result = preg_replace(\"/<input type=[\\\"']?button[\\\"']? value=[\\\"']?Subscribe[\\\"']?>/i\", \"<input type=\\\"submit\\\" value=\\\"Subscribe\\\">\", $api_result);\n\t\t\t\techo $api_result;\n\t\t\t}\n\t\t}\n\t}\n\n\t//echo print_r($options_site);\n\t//echo print_r($options_form);\n\n\techo $after_title;\n\techo $after_widget;\n}",
"function widget_web2pdf_init(){\r\n\tif ( !function_exists('register_sidebar_widget') || !function_exists('register_widget_control') )\r\n\t\treturn;\r\n\r\n if ( function_exists('register_sidebar_widget') )\r\n register_sidebar_widget('Web2PDF Converter Widget', 'web2pdf_sidebar_widget');\r\n\t\t\r\n}",
"public function register_mail_chimp_list_widget() {\r\n register_widget( new Admin\\Mailchimp_List_Widget() ); \r\n }",
"public function showCreateSubscriber2Form() {\n\t\t$this->redirectIfNoAccess('Create Secondary Account', 'subscribers/showCreateSubscriber2Form');\n\t\t$portal = $this->session->userdata('portal');\n\t\t$realm = $this->session->userdata('realm');\n\t\t/**************************************************\n\t\t * check connections\n\t\t **************************************************/\n\t\t// $clientCheck = $this->isConnectedToRmV2();\n\t\t// $rmOk = $clientCheck === false ? false : true;\n\t\t$dbOk = $this->isConnectedToMainDbV2();\n\t\t$checks = $this->proceedWithAction($dbOk);\n\t\t// $checks = $this->proceedWithAction($dbOk, $rmOk);\n\t\tlog_message('debug', '@showCreateSubscriber2Form|dbOk:'.json_encode($dbOk).'|proceed:'.json_encode($checks));\n\t\t// log_message('debug', '@showCreateSubscriber2Form|rmOk:'.json_encode($rmOk).',dbOk:'.json_encode($dbOk).'|proceed:'.json_encode($checks));\n\t\t//get realms\n\t\t$this->load->model('realm');\n\t\t$realms = $this->realm->fetchAllNamesOnly();\n\t\t$data = array(\n\t\t\t'realms' => $realms);\n\t\tif ($portal == 'service') {\n\t\t\t$data['realm'] = $realm;\n\t\t\t$data['disableRealm'] = true;\n\t\t}\n\t\t$data['proceed'] = $checks['go'];\n\t\t$data['error'] = $checks['msg'];\n\t\t$this->load->view('create_user_account2', $data);\n\t}",
"function init_subscription() {\r\n\t\tinclude(\"subscriptionManager.php\");\r\n\t}",
"public function getSubscribe()\n {\n }",
"function __construct() {\n\n\t\tload_plugin_textdomain(self::locale, false, dirname(plugin_basename( __FILE__ ) ) . '/lang/' );\n\n\t\t$widget_opts = array (\n\t\t\t'classname' => self::name, \n\t\t\t'description' => __('A simple WordPress widget for sharing a few of your social networks.', self::locale)\n\t\t);\t\n\t\t\n\t\tparent::__construct(self::slug, __(self::name, self::locale), $widget_opts);\n\n \t// Load JavaScript and stylesheets\n \t$this->register_scripts_and_styles();\n\t\t\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns Amount Money. Represents an amount of money. `Money` fields can be signed or unsigned. Fields that do not explicitly define whether they are signed or unsigned are considered unsigned and can only hold positive amounts. For signed fields, the sign of the value indicates the purpose of the money transfer. See [Working with Monetary Amounts]( monetaryamounts) for more information. | public function getAmountMoney(): Money
{
return $this->amountMoney;
} | [
"public function getAmount()\n {\n return $this->money->getAmount();\n }",
"public function getMoney()\n {\n return $this->get(self::_MONEY);\n }",
"public function getMoney()\n {\n return $this->money;\n }",
"public function getMoneyValue()\n {\n return $this->readOneof(2);\n }",
"public function getMoneyValue()\n {\n return $this->readOneof(4);\n }",
"public function getComputedAmountMoney(): ?Money\n {\n return $this->computedAmountMoney;\n }",
"public function getMoney();",
"public function getMoney(): int\n {\n return $this->getStat('money')->value;\n }",
"public function getTransactionAmountMoney(): ?Money\n {\n return $this->transactionAmountMoney;\n }",
"public function amount() {\n return new Double((double)$this->amount);\n }",
"public function money() : MoneyFieldBuilder\n {\n return new MoneyFieldBuilder($this->field->type(new MoneyType()));\n }",
"public function setMoney($var)\n {\n GPBUtil::checkInt64($var);\n $this->Money = $var;\n\n return $this;\n }",
"public function getAmount()\n {\n return isset($this->amount) ? $this->amount : null;\n }",
"public function getAmountValue();",
"public function setAmount($var)\n {\n GPBUtil::checkMessage($var, \\Io\\Token\\Proto\\Common\\Money\\Money::class);\n $this->amount = $var;\n\n return $this;\n }",
"function getMoney(){\n return $this->money;\n }",
"public function getPaidMoney()\n {\n $money = new Money($this->paidAmount, $this->paidCurrency);\n return $money;\n }",
"public function getAmount()\n {\n return $this->data['amount'] ?? null;\n }",
"public function setAmount($var)\n {\n GPBUtil::checkMessage($var, \\Hipstershop\\Money::class);\n $this->amount = $var;\n\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the nb heures reel interim. | public function setNbHeuresReelInterim(?float $nbHeuresReelInterim): Affaires {
$this->nbHeuresReelInterim = $nbHeuresReelInterim;
return $this;
} | [
"public function setNbHeuresReelInterim($nbHeuresReelInterim) {\n $this->nbHeuresReelInterim = $nbHeuresReelInterim;\n return $this;\n }",
"public function getNbHeuresReelInterim() {\n return $this->nbHeuresReelInterim;\n }",
"public function getNbHeuresInterim() {\n return $this->nbHeuresInterim;\n }",
"public function testSetNbrHeures() {\n\n $obj = new LettresMissionsLignes();\n\n $obj->setNbrHeures(10.092018);\n $this->assertEquals(10.092018, $obj->getNbrHeures());\n }",
"public function setNbHeures(?float $nbHeures): Articles {\n $this->nbHeures = $nbHeures;\n return $this;\n }",
"public function setNbrHeures($nbrHeures) {\n $this->nbrHeures = $nbrHeures;\n return $this;\n }",
"public function testSetNbHeuresReelSousTrait() {\n\n $obj = new Affaires();\n\n $obj->setNbHeuresReelSousTrait(10.092018);\n $this->assertEquals(10.092018, $obj->getNbHeuresReelSousTrait());\n }",
"public function setNbHeuresRs(?float $nbHeuresRs): HistoPrepPaie {\n $this->nbHeuresRs = $nbHeuresRs;\n return $this;\n }",
"public function setNbHeures(?float $nbHeures): BonsTravaux {\n $this->nbHeures = $nbHeures;\n return $this;\n }",
"public function setNbHeuresReelSousTrait(?float $nbHeuresReelSousTrait): Affaires {\n $this->nbHeuresReelSousTrait = $nbHeuresReelSousTrait;\n return $this;\n }",
"public function setNbHeuresRs($nbHeuresRs) {\n $this->nbHeuresRs = $nbHeuresRs;\n return $this;\n }",
"public function setNb($nb)\n\t{\n\t\t$this->nb = $nb;\n\t}",
"public function testSetNbHeures() {\n\n $obj = new HistoPaieType2();\n\n $obj->setNbHeures(10.092018);\n $this->assertEquals(10.092018, $obj->getNbHeures());\n }",
"public function setNbHeuresReelSousTrait($nbHeuresReelSousTrait) {\n $this->nbHeuresReelSousTrait = $nbHeuresReelSousTrait;\n return $this;\n }",
"public function getNbHeuresRs() {\n return $this->nbHeuresRs;\n }",
"public function testSetNbHeureMens() {\n\n $obj = new AttestationCacm();\n\n $obj->setNbHeureMens(10.092018);\n $this->assertEquals(10.092018, $obj->getNbHeureMens());\n }",
"public function getNbHeuresReelInterim(): ?float {\n return $this->nbHeuresReelInterim;\n }",
"public function getNbHeures3() {\n return $this->nbHeures3;\n }",
"public function setNbHNuit(?float $nbHNuit): HeuresEffectuees {\n $this->nbHNuit = $nbHNuit;\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Will get the set user_id, if none is set will return false | function get_user_id() {
if(isset($this->user_id))
return $this->user_id;
return false;
} | [
"public function hasUserid()\n {\n return $this->get(self::USERID) !== null;\n }",
"public static function getUserID() {\r\n\t\tif(empty(self::$userID) && isset($_SESSION['userID'])){\r\n\t\t\tself::$userID = $_SESSION['userID'];\r\n\t\t\treturn self::$userID;\r\n\t\t}else if(!empty(self::$userID)){\r\n\t\t\treturn self::$userID;\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"function user_id()\n{\n global $userquery;\n if ($userquery->userid != '' && $userquery->is_login)\n return $userquery->userid; else\n false;\n}",
"public function get_user_id();",
"public function is_user_id( $value );",
"protected function determine_user_id()\n {\n }",
"public function getId_user()\n {\n return $this->id_user;\n }",
"public function getIduser()\n {\n return $this->iduser;\n }",
"public function get_id_user()\n\t{\n\t\treturn $this->id_user;\n\t}",
"public function byUser()\n {\n if ($this->user_id !== NULL) {\n return true;\n }\n\n return false;\n }",
"public function getId_user()\n {\n return $this->id_user;\n }",
"public function getId_user(){\n return $this->id_user;\n }",
"public function get_id_user()\n {\n return $this->_id_user;\n }",
"public static function userID()\n\t{\n\t\t$auth = static::configAuth();\n\t\t$user = static::user();\n\n\t\tif (isset($user->{$auth->methodActiveUserID}))\n\t\t\treturn $user->{$auth->methodActiveUserID};\n\n\t\treturn false;\n\t}",
"public function getUserId()\n {\n return parent::getValue('user_id');\n }",
"public function user_is_set() { return $this->user_is_set; }",
"private function validateUserID(){\n if(is_numeric($this->user_id)){\n return true;\n }else{\n return false;\n }\n }",
"function checkUserIdBL() {\n\t $isExisting = false;\n\t // If the user exists\n\t if ( checkUserIdDAL($_POST['userId']) )\n\t {\n\t\t $isExisting = true;\n\t }\n\t return $isExisting;\n }",
"protected function determine_user_id() {\n\t\t$user_id = $this->context->site_user_id;\n\n\t\t/**\n\t\t * Filter: 'wpseo_schema_person_user_id' - Allows filtering of user ID used for person output.\n\t\t *\n\t\t * @api int|bool $user_id The user ID currently determined.\n\t\t */\n\t\treturn apply_filters( 'wpseo_schema_person_user_id', $user_id );\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return list of validation rules for `local` fields | protected function _getLocalFieldsValidationRules() {
$result = [];
$localFields = $this->_modelConfigSync->getLocalFieldsInfo();
if (empty($localFields)) {
return $result;
}
foreach ($localFields as $localFieldName => $localFieldInfo) {
if (!isset($localFieldInfo['rules']) || empty($localFieldInfo['rules'])) {
continue;
}
$result[$localFieldName] = $localFieldInfo['rules'];
}
return $result;
} | [
"protected function _getLdapFieldsValidationRules() {\n\t\t$result = [];\n\t\t$ldapFields = $this->_modelConfigSync->getLdapFieldsInfo();\n\t\tif (empty($ldapFields)) {\n\t\t\treturn $result;\n\t\t}\n\n\t\t$localFields = $this->getListLocalFields();\n\t\tif (empty($localFields)) {\n\t\t\treturn $result;\n\t\t}\n\n\t\tforeach ($ldapFields as $ldapFieldName => $ldapFieldInfo) {\n\t\t\tif (!isset($ldapFieldInfo['rules']) || empty($ldapFieldInfo['rules'])) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (!in_array($ldapFieldName, $localFields)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$result[$ldapFieldName] = $ldapFieldInfo['rules'];\n\t\t}\n\n\t\treturn $result;\n\t}",
"private function get_field_validation_rules() {\n $rules = array();\n foreach ($this->form_fields as $f_name => $f_spec) {\n $rule = array();\n $rule['field'] = $f_name;\n $rule['label'] = $f_spec['label'];\n $rule['rules'] = $f_spec['rules'];\n $rules[$f_name] = $rule;\n }\n return $rules;\n }",
"function getRules() {\n\t\t$fields = $this->getFields();\n\t\t$allRules = array();\n\n\t\tforeach ($fields as $field) {\n\t\t\t$fieldRules = $field->getValidationRules();\n\t\t\t$allRules[$field->getName()] = $fieldRules;\n\t\t}\n\n\t\treturn $allRules;\n\t}",
"public function getValidationRules();",
"public function getValidationRules()\n {\n $rules = [\n 'genre' => 'required',\n 'title' => 'required|max:200',\n 'uploadfile' => 'required',\n 'price' => 'numeric|max:850000',\n 'days' => 'numeric|max:25'\n ];\n\n $messages = [\n\n ];\n\n return [$rules, $messages];\n }",
"public function getValidationRules(): array\n {\n return [\n 'email_address' => 'required|email',\n 'status' => 'required|string',\n 'mailchimp_id' => 'nullable|string',\n ];\n }",
"public function getFilterValidationRules();",
"public function inValids(){\n\t\t$ret = array();\n\t\tforeach($this->_fieldValidations as $f){\n\t\t\tif(!$f->isValid){\n\t\t\t\t$ret[] = $f;\n\t\t\t}\n\t\t}\n\t\treturn $ret;\n\t}",
"abstract protected function getValidationRules();",
"public function getValidationRules(){\n \t\treturn $this->getValidationRules();\n }",
"public static function validationFields()\n\t{\n\t\t\n\t\treturn [\n\t\t\t\"title\"\t\t\t\t\t\t =>\t\"required\",\n\t\t\t\"description\"\t\t\t\t =>\t\"required\",\n\t\t\t\"url\"\t\t\t\t\t\t =>\t\"required\",\n\t\t\t\"current_status\"\t\t\t =>\t\"required\",\n\t\t];\n\t\t\n\t}",
"protected function getValidationRules(): array\n {\n $rules = [];\n\n foreach ($this->columns as $name => $properties) {\n $validation = $properties->validation ?? null;\n if (!$validation) {\n continue;\n }\n\n $rules[$name] = $validation;\n }\n\n if (is_callable([$this, 'validationRules'])) {\n $rules = call_user_func([$this, 'validationRules'], $rules);\n }\n\n return $rules;\n }",
"abstract public function getFilterValidationRules();",
"public function getEditRules(){\n\t\t$rules=[\n\t\t\t'first_name'=>'required|string',\n\t\t\t'last_name'=>'required|string',\n\t\t\t'address_line1'=>'required|string',\n\t\t\t'address_line2'=>'required|string',\n\t\t\t'city'=>'required|string',\n\t\t\t'state'=>'required|string',\n\t\t\t'country'=>'required|string',\n\t\t\t'postcode'=>'required|integer',\n\t\t\t'phone'=>'required|string',\n\t\t\t'passport_no'=>'required|string',\n\t\t\t'qualification'=>'required|string',\n\t\t\t'specialism'=>'required|string',\n\t\t]; \n\t\tLog::info(\"return list of validation rules\"); \n\t\treturn $rules; \n\t}",
"public function rules() {\n\t\t$args = array();\n\n\t\tforeach ( $this->rules as $arg => $validation ) {\n\t\t\tif ( ! $validation || ! is_string( $validation ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$args[ $arg ] = $this->parse_validation( $validation );\n\t\t}\n\n\t\treturn $args;\n\t}",
"public function getValidationRules(): array {\n\t\t$result = [];\n\t\t\n\t\tforeach ($this->getSections() as $section) {\n\t\t\t$result = array_merge($result, $section->getValidationRules());\n\t\t}\n\t\t\n\t\treturn $result;\n\t}",
"public function filterableValidationRules() : array;",
"public function filterableValidationRules() : array\n {\n return $this->filterable()->filter(function ($item) {\n return trim($item->validation_rules) != '' && ! is_null($item->validation_rules);\n })->mapWithKeys(function ($item) {\n return ['features.' . $item->name => $item->validation_rules];\n })->all();\n }",
"private static function getRules() {\n return [\n 'title' => FILTER_SANITIZE_SPECIAL_CHARS,\n 'director' => FILTER_SANITIZE_SPECIAL_CHARS,\n 'year' => [\n 'filter' => FILTER_VALIDATE_INT,\n 'options' => [\n 'min_range' => 1800,\n 'max_range' => date(\"Y\")\n ]\n ],\n 'runlength' => [\n 'filter' => FILTER_VALIDATE_INT,\n 'options' => [\n 'min_range' => 30,\n 'max_range' => 300\n ]\n ],\n 'description' => FILTER_SANITIZE_SPECIAL_CHARS,\n 'activated' => [\n 'filter' => FILTER_VALIDATE_BOOLEAN,\n 'flags' => FILTER_NULL_ON_FAILURE\n ],\n 'price' => FILTER_VALIDATE_FLOAT\n ];\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add URL rewrites to collection | protected function _addUrlRewrite()
{
$urlRewrites = null;
if ($this->_cacheConf) {
if (!($urlRewrites = Mage::app()->loadCache($this->_cacheConf['prefix'] . 'urlrewrite'))) {
$urlRewrites = null;
} else {
$urlRewrites = unserialize($urlRewrites);
}
}
if (!$urlRewrites) {
$productIds = array();
foreach($this->getItems() as $item) {
$productIds[] = $item->getEntityId();
}
if (!count($productIds)) {
return;
}
$select = $this->_factory->getProductUrlRewriteHelper()
->getTableSelect($productIds, $this->_urlRewriteCategory, Mage::app()->getStore()->getId());
$urlRewrites = array();
foreach ($this->getConnection()->fetchAll($select) as $row) {
if (!isset($urlRewrites[$row['product_id']])) {
$urlRewrites[$row['product_id']] = $row['request_path'];
}
}
if ($this->_cacheConf) {
Mage::app()->saveCache(
serialize($urlRewrites),
$this->_cacheConf['prefix'] . 'urlrewrite',
array_merge($this->_cacheConf['tags'], array(Mage_Catalog_Model_Product_Url::CACHE_TAG)),
$this->_cacheLifetime
);
}
}
foreach($this->getItems() as $item) {
if (empty($this->_urlRewriteCategory)) {
$item->setDoNotUseCategoryId(true);
}
if (isset($urlRewrites[$item->getEntityId()])) {
$item->setData('request_path', $urlRewrites[$item->getEntityId()]);
} else {
$item->setData('request_path', false);
}
}
} | [
"function rest_api_register_rewrites()\n {\n }",
"function add_rewrite() {\n\tadd_rewrite_rule( '^my-patterns/[^/]+/?$', 'index.php?pagename=my-patterns', 'top' );\n\tadd_rewrite_rule( '^favorites/.+/?$', 'index.php?pagename=favorites', 'top' );\n\tadd_rewrite_endpoint( 'categories', EP_AUTHORS );\n}",
"public function add_feed_rewrites() {\n\t\t\t$this->rewrites['feed'] = true;\n\t\t}",
"public function add_rewrite_urls() {\n $get_rewrite_rules = get_option( 'rewrite_rules' );\n $default_last_url_regex = $this->fRoutingRegister['default_last_url_regex'];\n $default_flush_rewrite_rules = $this->fRoutingRegister['default_flush_rewrite_rules'];\n $default_first_url_regex = $this->fRoutingRegister['default_first_url_regex'];\n\n // register routes\n foreach ($this->frConfig as $pageName => $value) {\n\n $set_first_url_regex = isset($this->frConfig[$pageName]['first_url_regex']) ? \n $this->frConfig[$pageName]['first_url_regex'] : $default_first_url_regex;\n\n $set_last_url_regex = isset($this->frConfig[$pageName]['last_url_regex']) ? \n $this->frConfig[$pageName]['last_url_regex'] : $default_last_url_regex;\n\n $regex_url_rewrite = $set_first_url_regex . $pageName . $set_last_url_regex;\n \n add_rewrite_rule(\n $regex_url_rewrite,\n 'index.php?pagename='. $pageName .'&wiew-page=$matches[2]',\n 'top'\n );\n }\n\n flush_rewrite_rules($default_flush_rewrite_rules);\n }",
"public function register_rewrites()\n {\n }",
"function rewrite() {\n\n\t\t// for each path (course)\n\t\tforeach ( $this->types[ 'paths' ] as $path ) {\n\n\t\t\t// Permalink structure course/%coursename%\n\t\t\t$path_structure = \"{$path}/%{$path}name%\";\n\n\t\t\t// add permalink structure to wp rewrite rules\n\t\t\tadd_permastruct( $path, $path_structure, false );\n\n\t\t\t// add the regex to match %coursename% & placing it in ?coursename=\n\t\t\tadd_rewrite_tag( \"%{$path}name%\", '([^/]+)', \"{$path}name=\" );\n\n\t\t\t// create rewrite rules for modules\n\t\t\t$this->rewrite_modules( $path_structure );\n\n\t\t\t// create rewrite rules for units\n\t\t\t$this->rewrite_units( $path_structure );\n\t\t}\n\t\t\n\t\tadd_rewrite_endpoint( 'learn', EP_PERMALINK | EP_PAGES );\n\t}",
"public function rewrites() {\n\n\t\t$taxonomies = get_taxonomies( array( 'public' => true, '_builtin' => false ), 'objects' );\n\t\t$ref = affiliate_wp()->tracking->get_referral_var();\n\n\t\tforeach ( $taxonomies as $tax_id => $tax ) {\n\t\t\tif ( is_array( $tax->rewrite ) && isset( $tax->rewrite[ 'slug' ] ) ) {\n\t\t\t\tadd_rewrite_rule( $tax->rewrite[ 'slug' ] . '/(.+?)/' . $ref . '(/(.*))?/?$', 'index.php?' . $tax_id . '=$matches[1]&' . $ref . '=$matches[3]', 'top' );\n\t\t\t}\n\t\t}\n\n\t\tadd_rewrite_endpoint( $ref, EP_PERMALINK | EP_ROOT | EP_COMMENTS | EP_SEARCH | EP_PAGES | EP_ALL_ARCHIVES, false );\n\t}",
"public function add_rewrite_rules()\n {\n }",
"function dispatch_rewrites() {\n\t\\path_dispatch()->add_path(\n\t\t[\n\t\t\t'path' => 'homepage',\n\t\t\t'rewrite' => [\n\t\t\t\t'rule' => 'page/([0-9]+)/?',\n\t\t\t\t'redirect' => 'index.php?dispatch=homepage&pagination=$matches[1]',\n\t\t\t\t'query_vars' => 'pagination',\n\t\t\t],\n\t\t]\n\t);\n}",
"function cu_rewrite_add_rewrites() {\n\tadd_rewrite_tag( '%cpage%', '[^/]' );\n\tadd_rewrite_rule(\n\t\t'^users/?$',\n\t\t'index.php?cpage=custom_page_url',\n\t\t'top'\n\t);\n}",
"function rest_api_register_rewrites() {\n\tadd_rewrite_rule( '^' . rest_get_url_prefix() . '/?$','index.php?rest_route=/','top' );\n\tadd_rewrite_rule( '^' . rest_get_url_prefix() . '/(.*)?','index.php?rest_route=/$matches[1]','top' );\n}",
"function iis7_save_url_rewrite_rules() {}",
"public function my_referral_links_add_endpoint() {\n add_rewrite_endpoint( 'my-referral-links', EP_ROOT | EP_PAGES );\n }",
"public function add_rewrite_rule() {\n\t\t\tadd_rewrite_rule(\n\t\t\t\t'photo/([a-z0-9-_]+)/?', // ([^/]+)\n\t\t\t\t'index.php?attachment=$matches[1]',\n\t\t\t\t'top'\n\t\t\t);\n\t\t}",
"public function rewriteUrls() {\n add_rewrite_rule('^give-hubtel/([^/]*)$', 'index.php?give-hubtel-action=$matches[1]', 'top');\n }",
"protected function _getUrlRewriteCollection()\n {\n return Mage::getResourceModel('varnish/core_url_rewrite_collection');\n }",
"function endpoints() {\r\n\t\tadd_rewrite_endpoint( 'backers', EP_PERMALINK | EP_PAGES );\r\n\t}",
"public function add_rewrite_tags()\n {\n }",
"public function register_rewrite_rules() {\n\t\t$statements_pg_path = $this->page_path;\n\t\t$statements_pg = $this->page;\n\n\t\tif ( $statements_pg && $statements_pg_path ) {\n\t\t\tadd_rewrite_rule(\n\t\t\t\t'^' . $statements_pg_path . '/year/([0-9]{4})(/page/(\\d+))?[/]?$',\n\t\t\t\t'index.php?page_id=' . $statements_pg->ID . '&by-year=$matches[1]&paged=$matches[3]',\n\t\t\t\t'top'\n\t\t\t);\n\t\t\tadd_rewrite_rule(\n\t\t\t\t'^' . $statements_pg_path . '/author/([a-z0-9_-]+)(/page/(\\d+))?[/]?$',\n\t\t\t\t'index.php?page_id=' . $statements_pg->ID . '&tu_author=$matches[1]&paged=$matches[3]',\n\t\t\t\t'top'\n\t\t\t);\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Collect the items in the bag ordered by the highest ratio and if them equals order by price. | private function collectItemsByRatio(array $items, &$capacity, $orderByDesc = true)
{
$this->sortByRatio($items, $orderByDesc);
$bag = [];
while (
$capacity !== 0
&& count($items) > 0
) {
$item = array_pop($items);
if ($capacity >= $item['weight'])
{
$bag[] = $item;
$capacity -= $item['weight'];
}
}
return $bag;
} | [
"private function organizePrices(): void\n {\n $newGroups = [];\n\n foreach($this->groups as $groups) {\n foreach($groups as $group) {\n $newGroups[(int) $group[\"totalPrice\"]] = $group;\n }\n }\n sort($newGroups);\n\n $this->groups = $newGroups;\n }",
"public static function mostPopular()\n\t{\n\t\t$date = \\Carbon\\Carbon::now()->subDays(30);\n\t\t$purchases = Purchase::where('created_at', '>=', date($date))->get();\n\t\t$purchaseCounts = [];\n\t\tforeach ($purchases as $purchase) {\n\t\t\tforeach ($purchase->products as $product) {\n\t\t\t\tif (isset($purchaseCounts[$product['id']]))\n\t\t\t\t\t$purchaseCounts[$product['id']] += $product['inCart'];\n\t\t\t\telse \n\t\t\t\t\t$purchaseCounts[$product['id']] = $product['inCart'];\n\t\t\t}\n\t\t}\n\t\tarsort($purchaseCounts);\n\t\t$products = [];\n\t\tforeach (array_slice($purchaseCounts, 0, 5, true) as $productId => $count) {\n\t\t\t$products[] = Product::find($productId);\n\t\t}\n\t\treturn collect($products);\n\t}",
"public static function choosePrices($pairs) {\n // sort the pairs by the difference between the amazon subtotal + .99 and the best total\n usort($pairs, function ($p1, $p2) {\n list($b1, $am1) = $p1;\n list($b2, $am2) = $p2;\n\n if (!$am1 || !$am2) {\n if (!$am1 && !$am2) { // amazon has neither of the books\n return 0;\n } else {\n return $am1 ? -1 : 1; // amazon has only one of the books\n }\n }\n\n $diff1 = $am1->subtotal + .99 - $b1->getTotal();\n $diff2 = $am2->subtotal + .99 - $b2->getTotal();\n\n return $diff1 - $diff2;\n });\n\n $naiveBestChoices = array();\n foreach ($pairs as $p) {\n if ($p[0]) { // only if at least one vendor has the book\n $naiveBestChoices[] = $p[0];\n }\n }\n $bestChoices = array();\n $amazonSubtotalSum = 0;\n $naiveBestTotalSum = 0;\n $flag = false;\n foreach ($pairs as $p) {\n if ($flag && $p[1] && $p[0] && $p[1]->subtotal + .99 <= $p[0]->getTotal()) {\n $p[0] = $p[1];\n }\n $flag = true;\n\n if ($amazonSubtotalSum < 25) {\n if ($p[1]) {\n $bestChoices[] = $p[1];\n $amazonSubtotalSum += $p[1]->subtotal;\n $naiveBestTotalSum += $p[0]->getTotal();\n }\n // if super saver doesn't save money\n if (!$p[1] || ($amazonSubtotalSum >= 25 && $amazonSubtotalSum > $naiveBestTotalSum)) {\n $bestChoices = $naiveBestChoices;\n break;\n }\n } else if ($p[1] && $p[0] && ($p[1]->subtotal - $p[0]->getTotal()) <= .99) {\n $bestChoices[] = $p[1];\n } else if ($p[0]) { // only if at least one vendor has the book\n $bestChoices[] = $p[0];\n }\n }\n\n return $bestChoices;\n\n }",
"public function testSortItemsByPrice()\n\t{\n\t\t//Check sorted array with reverse of original array\n\t\t$this->assertSame(self::$items->getSortedItemsByPrice('desc'), array_reverse(self::$items->getSortedItemsByPrice()));\n\t}",
"public function getItems()\n {\n usort($this->items, function (Item $item1, Item $item2) {\n return $item2->getUpVotes() - $item1->getUpVotes();\n });\n\n return array_filter($this->items, function (Item $item) {\n return $item->getUpVotes() > 0;\n });\n }",
"function exodus_sort_products_by_price($products) {\n\n usort($products, function($a, $b) { return $a['price'] - $b['price']; });\n\n return $products;\n\n}",
"protected function sortItems()\n {\n usort($this->items, static function ($a, $b) {\n if ($a->weight === $b->weight) {\n return $a->title <=> $b->title;\n }\n\n return $a->weight <=> $b->weight;\n });\n }",
"private function sortByRest() {\r\n $ids = $this->getUniqRestId();\r\n foreach($this->_individual_items as $item) {\r\n $item = (object)$item;\r\n $sorted[$item->id][] = array($item->items, $item->price);\r\n }\r\n $this->_individual_items = $sorted;\r\n }",
"public function getTop3BestSellers()\n {\n $products = $this->productRepo->findBy([], ['orderCounter' => 'DESC'], 3);\n return $products;\n }",
"function get_vehicles_by_price() {\n global $db;\n $query = 'SELECT * FROM vehicles\n ORDER BY price DESC';\n $statement = $db->prepare($query);\n $statement->execute();\n $vehicles = $statement->fetchAll();\n $statement->closeCursor();\n return $vehicles;\n }",
"public function sortByGreatestAvailablePointsWon(): Collection\n {\n return $this->teams->sort(function($team_one, $team_two){\n return $team_one->getPercentageOfAvailablePointsWon() > $team_two->getPercentageOfAvailablePointsWon();\n });\n }",
"function collect_best($userComparison)\n{\n\t\n\t$collectionArray = array();\n\n\tforeach($userComparison as $value) {\n\t\t$localRelations = $value->get_relations();\n\t\tforeach ($localRelations as $key => $value_2) {\n\t\t\tif (array_key_exists($key, $collectionArray)) {\n\t\t\t\tif ($collectionArray[$key]->get_difference() > $value_2) {\n\t\t\t\t\t$difference = new FprintDifference($value->get_room(), $value->get_position(), $value_2);\n\t\t\t\t\t$collectionArray[$key] = $difference;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\telse {\n\t\t\t\t$difference = new FprintDifference($value->get_room(), $value->get_position(), $value_2);\n\t\t\t\t$collectionArray[$key] = $difference;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\treturn $collectionArray;\n\n}",
"function getMostPopularAuctions() {\n global $conn;\n $stmt = $conn->prepare('SELECT auction.id, (SELECT filename\n FROM image\n WHERE product_id = product.id\n LIMIT 1) as image, product.id, product.name as product_name, \"user\".username, \"user\".rating as user_rating, auction.curr_bid, auction.end_date, \"user\".id as user_id, auction.num_bids as numBids, auction.start_date \n FROM bid\n INNER JOIN auction ON bid.auction_id = auction.id\n INNER JOIN product ON auction.product_id = product.id\n INNER JOIN \"user\" ON auction.user_id = \"user\".id\n WHERE state = \\'Open\\'\n GROUP BY auction.id, image, product.id, product.name, \"user\".username, \"user\".rating, auction.curr_bid, auction.end_date, \"user\".id, auction.num_bids\n ORDER BY auction.num_bids DESC\n LIMIT 10;');\n $stmt->execute();\n return $stmt->fetchAll();\n}",
"public static function get_top_bidders_with_end_auctions() {\n global $wpdb;\n $auction_table = $wpdb->prefix.\"wauc_auction_log\";\n\n //get all running product\n $args = array(\n 'post_status' => 'publish',\n 'post_type' => 'product',\n 'meta_query' => array(\n array(\n 'key' => 'wauc_auction_end',\n 'value' => time(),\n 'type' => 'CHAR',\n 'compare' => '<',\n ),\n array(\n 'key' => '_wauc_current_status',\n 'value' => 'running',\n 'type' => 'CHAR',\n 'compare' => '=',\n )\n )\n );\n $running_auctions = new WP_Query($args);\n $running_auc_ids = array();\n if( $running_auctions->have_posts() ) {\n while( $running_auctions->have_posts() ) {\n $running_auctions->the_post();\n $running_auc_ids[] = get_the_ID();\n }\n }\n //term\n if( empty( $running_auc_ids ) ) return array();\n\n $query = \"SELECT DISTINCT tt.*, wp_users.user_email, wp_posts.post_title as auction_name\nFROM $auction_table tt\nINNER JOIN\n (SELECT auction_id, MAX(bid) AS max_bid\n FROM ( SELECT * FROM $auction_table c WHERE c.is_fake = 0 ) d\n GROUP BY auction_id) groupedtt \nON tt.auction_id = groupedtt.auction_id \nAND tt.bid = groupedtt.max_bid\nINNER JOIN wp_users\nON wp_users.ID = tt.userid\nINNER JOIN $wpdb->posts wp_posts\nON wp_posts.ID = tt.auction_id\nWHERE tt.auction_id IN (\".implode(',',$running_auc_ids).\")\n\";\n\n $result = $wpdb->get_results($query);\n return $result;\n }",
"function sort_by_price($watch1, $watch2)\n{\n return $watch1['price'] <=> $watch2['price'];\n}",
"function limitItemNB()\n{\n\tglobal $currShopcart;\n\t$incartitems = getFromIDs(array_keys($currShopcart));\n\n\tforeach ($incartitems as $i)\n\t{\n\t\tif ($currShopcart[$i['ID']] > $i['quantite'])\n\t\t{\n\t\t\t$currShopcart[$i['ID']] = $i['quantite'];\n\t\t}\n\t}\n}",
"function sortBookPrice($localresults)\t{\n\t\t\t\t\t\t$index = 0;\n\t\t\t\t\t\tfor ($i=0;$i<count($localresults);$i++) \t{\t\t\t\n\t\t\t\t\t\t\t\t\t\t$index=$i;\n\t\t\t\t\t\t\t\t\t\tfor ($j= $i+1;$j<count($localresults);$j++) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$temp = explode(\"|\" , $localresults[$j]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$temp1 = explode(\"|\" , $localresults[$index]);\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (($temp[3]*100)< ($temp1[3]*100)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$index = $j;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\t\t\t\n\t\t\t\t\t\t\t\t\t\tif ( $index != $i ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$small = $localresults[$i];\n\t\t\t\t\t\t\t\t\t\t\t\t\t$localresults[$i]=$localresults[$index];\n\t\t\t\t\t\t\t\t\t\t\t\t\t$localresults[$index]=$small;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t//echo $localresults[$i].\"<br/>\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn $localresults;\n\t\t\t}",
"function _getBidItems($auc, $bid)\n\t{\n\t\t$items = array();\n\t\t$s = <<<SQL\n\t\t\tselect abi.instance, iname,\n\t\t\t\t(case when stack = 0 then ai.instance\n\t\t\t\telse -1 * ai.inum end) as sort,\n\t\t\t\t(case when stack = 0 then 1\n\t\t\t\telse count(ai.inum) end) as num\t\t\t\n\t\t\tfrom auction_bid_item abi\n\t\t\tjoin actor_item ai on ai.instance = abi.instance\n\t\t\tjoin item i on i.inum = ai.inum\n\t\t\twhere abi.auction = ? and abi.actor = ?\n\t\t\tgroup by sort\n\t\t\torder by lower(iname) asc\nSQL;\n\t\t$q = $this->db->query($s, array($auc, $bid));\n\t\treturn $q->result_array();\n\t}",
"function getLatestPrices($items, $location, $tiers = null, $rarities = null) {\n\n $dbConnection = new PDO(\"mysql:host=\".DB_HOST.\";port=\".DB_PORT.\";dbname=\".DB_BASE, DB_USER, DB_PASSWORD);\n\t$selectStatement = $dbConnection->prepare(\"SELECT price FROM item_latest_price WHERE item_id = ? AND location = ?\");\n\n\t$prices = [];\n\n\tforeach ($items as $item) {\n\t\tif (!empty($tiers)) {\n\t\t\tforeach ($tiers as $tier) {\n\n\t\t\t\t$itemId = \"T\".$tier.\"_\".$item;\n\n\t\t\t\tif (!empty($rarities)) {\n\t\t\t\t\tforeach ($rarities as $rarity) {\n\n\t\t\t\t\t\t// Prevent rarity call if tier > 0\n\t\t\t\t\t\tif ($rarity > 0 && $tier > 3) {\n\t\t\t\t\t\t\t// Special case : resources\n\t\t\t\t\t\t\tif (in_array($item, [\"WOOD\", \"PLANKS\", \"ORE\", \"METALBAR\", \"HIDE\", \"LEATHER\", \"FIBER\", \"CLOTH\"])) {\n\t\t\t\t\t\t\t\t$itemId .= '_LEVEL'.$rarity;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$itemId .= '@'.$rarity;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$selectStatement->execute([$itemId, $location]);\n\t\t\t\t\t\tif($price = $selectStatement->fetchColumn()) {\n\t\t\t\t\t\t\t$prices[$item][$tier][$rarity] = $price;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$selectStatement->execute([$itemId, $location]);\n\t\t\t\t\tif($price = $selectStatement->fetchColumn()) {\n\t\t\t\t\t\t$prices[$item][$tier] = $price;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$selectStatement->execute([$item, $location]);\n\t\t\tif($price = $selectStatement->fetchColumn()) {\n\t\t\t\t$prices[$item] = $price;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $prices;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test active content id getter Test active content id getter when content id passed with oxcid param. | public function testGetContentIdWithOxcidParam()
{
$this->setRequestParameter('oxcid', $this->_oObj->getId());
$this->getConfig()->setConfigParam("blPsLoginEnabled", false);
oxTestModules::addFunction('oxUtils', 'redirect', '{ throw new Exception($aA[0]); }');
$oObj = oxNew('content');
// testing special chars conversion
$this->assertEquals($oObj->getContentId(), $this->_oObj->getId());
} | [
"public function testGetContentIdWhenNoIdSpecified()\n {\n $this->getConfig()->setConfigParam(\"blPsLoginEnabled\", false);\n\n oxTestModules::addFunction('oxUtils', 'redirect', '{ throw new Exception($aA[0]); }');\n $sContentId = oxDb::getDb(oxDB::FETCH_MODE_ASSOC)->getOne(\"SELECT oxid FROM oxcontents WHERE oxloadid = 'oximpressum' \");\n\n $oObj = oxNew('content');\n $this->assertEquals($sContentId, $oObj->getContentId());\n }",
"public function testgetIdAcceso() {\n\n $this->assertEquals($this->object->getId(), $this->object->getIdAcceso());\n\n }",
"public function testGetCageById()\n {\n $this->assertSame(2, $this->repository->getById(2)->id);\n $this->assertSame(5, $this->repository->getById(5)->id);\n }",
"public function testProV1ContentPropertiesIdLegalinfoGet()\n {\n }",
"public function test_010_getItemDetails_eContent_executesCorrectly()\r\n\t{\r\n\t\t$this->setMethodHeader(\"getItemDetails\");\r\n\t\t$this->setAccessTokenHeader(self::$accessToken);\r\n\t\t$this->setJSONContent(array(\"id\"=>EContentRecord::prefixUnique.\"51\"));\r\n\t\r\n\t\t$actual = $this->exec();\r\n\t\t$this->assertEquals(EContentRecord::prefixUnique.\"51\", $actual->uniqueID);\r\n\t}",
"public function testGetContentmanagementStatusStatusId()\n {\n }",
"static function testContentObject( ) {\n return OWMonitoringReportTools::executeCountQuery( 'ezcontentobject_trash', 'contentobject_id NOT IN (\n SELECT id\n FROM ezcontentobject\n )' );\n }",
"public function test_getRecordId_called_returnCorrectly()\r\n\t{\r\n\t\t$expected = \"aDummyId\";\r\n\t\t$this->econtentRecordMock->id = $expected;\r\n\t\t$actual = $this->service->getRecordId();\r\n\t\t$this->assertEquals($expected, $actual);\r\n\t}",
"function _getTestIDFromObjectID($object_id)\n\t{\n\t\tglobal $ilDB;\n\t\t$test_id = FALSE;\n\t\t$result = $ilDB->queryF(\"SELECT test_id FROM tst_tests WHERE obj_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($object_id)\n\t\t);\n\t\tif ($result->numRows())\n\t\t{\n\t\t\t$row = $ilDB->fetchAssoc($result);\n\t\t\t$test_id = $row[\"test_id\"];\n\t\t}\n\t\treturn $test_id;\n\t}",
"public function testGetId() {\n\t\techo (\"\\n********************Test GetId()************************************************************\\n\");\n\t\n\t\t$this->stubedGenome->method ( 'getId' )->willReturn ( 1 );\n\t\t$this->assertEquals ( 1, $this->stubedGenome->getId () );\n\t}",
"function get_criteria_content_object_id()\r\n {\r\n return $this->get_optional_property(self :: PROPERTY_CRITERIA_CONTENT_OBJECT_ID);\r\n }",
"abstract protected function existsItem($contentId);",
"public function testOrganizationIdAlfrescoSyncGet()\n {\n }",
"public function testGetOrcidId()\n {\n $this->assertEquals('0000-0000-0000-0000', $this->profile()->id(), 'Failed to fetch properly formatted ID');\n }",
"public function editRegularContentFromId() {}",
"public function testGetOrcidId()\n {\n $this->assertEquals(\n '0000-0000-0000-0000',\n $this->profile()->id(),\n 'Failed to fetch properly formatted ID'\n );\n }",
"public function testShowIdExisted() {\n // arrange\n $targetId = 3;\n $expectedSuccess = true;\n $expectedContent = [\n 'id'=>$targetId, 'user_id'=>11 , 'value'=>120 , 'record_time'=>'2016-09-10 09:00:00'\n ];\n $this->mockVitalRepos->shouldReceive('getById')\n ->once()\n ->with($targetId)\n ->andReturn($expectedContent);\n\n // act\n $response = $this->target->show($targetId);\n $content = json_decode($response->getContent(),true);\n $actualSuccess = $content['success'];\n $actualContent = $content['result'];\n\n // assert\n $this->assertEquals($expectedSuccess, $actualSuccess);\n $this->assertEquals($expectedContent, $actualContent);\n }",
"public static function find_by_content_id($content_id)\n\t\t{\n\t\t\t$sql = \"SELECT * FROM \".static::$table_name. \" WHERE content_id = '$content_id'\";\n\t\t\treturn self::find_by_sql($sql);\n\t\t}",
"function testGetId()\n {\n echo 'Test GetAmount' . \"\\n\";\n $user = self::getUser('teamowner@team.com');\n $activity = $user->getStairsActivities();\n $this->assertEquals($activity[0]->getId(), 11);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Finds a document by path. | public function find($path)
{
return $this->getDm()->find(null, $path);
} | [
"public function findByPath($path){\n $keys = explode('.', $path .\"\");\n return $this->findByKeys($keys);\n }",
"public static function find_by_path ($path)\n\t{\n\t\t$path = preg_replace('/^\\//', '', $path);\n\t\t$compound = \\GitData\\Compound::load(array(\n\t\t\t'wiki/' . $path . '/info.json',\n\t\t\t'wiki/' . $path . '.json.md'\n\t\t));\n\n\t\tif ($compound)\n\t\t{\n\t\t\treturn new WikiPage($compound);\n\t\t}\n\t}",
"public function findByPath($path) {\n\t\t$config = Registry::get('Phile_Settings');\n\t\t$path = str_replace($config['install_path'], '', $path);\n\t\t$file = null;\n\t\tif (file_exists(CONTENT_DIR . $path . CONTENT_EXT)) {\n\t\t\t$file = CONTENT_DIR . $path . CONTENT_EXT;\n\t\t}\n\t\tif ($file == null) {\n\t\t\tif (file_exists(CONTENT_DIR . $path . '/index' . CONTENT_EXT)) {\n\t\t\t\t$file = CONTENT_DIR . $path . '/index' . CONTENT_EXT;\n\t\t\t}\n\t\t}\n\n\t\tif ($file !== null) {\n\t\t\treturn new \\Phile\\Model\\Page($file);\n\t\t}\n\n\t\treturn null;\n\t}",
"public function find($path) {\n\t\t$path = $this->parsePath($path);\n\t\tif ($var = $this->offsetGet(array_shift($path))) {\n\t\t\treturn $this->getValue($var, $path);\n\t\t}\n\t\treturn $var;\n\t}",
"function findNodeByPath($path);",
"function searchMongoByFilename($fn) \n{\n\tglobal $activities, $textbooks;\n\t$collectionarray = array($activities, $textbooks);\n\tfor($i = 0; $i < $collectionarray; $i++)\n\t{\n\t\t$document = $collectionarray[$i]->findOne(array('fn' => \"$fn\"));\n\t\tif ($document != null) \n\t\t{\n\t\t\treturn $document; // it's in this collection!\n\t\t} \n\t}\n\n\treturn null;\n}",
"function get_document_id($_course, $path) {\n\t\t$TABLE_DOCUMENT = Database::get_course_table ( TABLE_DOCUMENT, $_course ['dbName'] );\n\t\t\n\t\t$sql = \"SELECT id FROM $TABLE_DOCUMENT WHERE path = '$path'\";\n\t\t$sql .= \" AND cc='\" . $_course [\"code\"] . \"' \";\n\t\t$result = api_sql_query ( $sql, __FILE__, __LINE__ );\n\t\t\n\t\tif ($result && mysql_num_rows ( $result ) == 1) {\n\t\t\t$row = mysql_fetch_row ( $result );\n\t\t\treturn $row [0];\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public static function get_id_by_path($path)\n {\n // Sanitize Path and get List\n $list = array_filter(explode(\"/\", self::sanitize_path($path)), function ($value) {\n return $value !== '';\n });\n\n // First Get All List File in MY DRIVE\n $root_files = self::file_list();\n if (isset($root_files['error'])) {\n return false;\n }\n\n // Start Nested Search\n foreach ($list as $route) {\n $_found = false;\n foreach ($root_files as $file) {\n if ($file['name'] == $route) {\n $route_info = $file;\n $_found = true;\n break;\n }\n }\n\n if ($_found === true and isset($route_info)) {\n if (end($list) == $route) {\n return $route_info;\n } else {\n $root_files = self::file_list(array(\n 'q' => \"'\" . $route_info['id'] . \"' in parents and trashed=false\"\n ));\n if (isset($root_files['error'])) {\n return false;\n }\n }\n }\n }\n\n return false;\n }",
"public function find($id)\n {\n //First we try to find it in the current unit of work\n if ($doc = $this->documentManager->getUnitOfWork()->find($this->documentClass, $id)) {\n return $doc;\n }\n\n return $this->findOneBy(['id' => $id]);\n }",
"public function getObjectAtPath($path);",
"public function findModelForPath($path, $url);",
"function getDocument($id) {\n \treturn $this->connection->get($id);\n }",
"function find($key) {\n global $client;\n $d = $client->documents->find($key);\n print \"{$d->document->key} - {$d->document->status} - {$d->document->original_name}\\n\";\n}",
"public function find($identifier);",
"public function findOrFail($id)\n\t{\n\t\t$result = $this->find($id);\n\t\t\n\t\tif (is_array($id)) {\n\t\t\tif (count($result) === count(array_unique($id))) {\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t} elseif (null !== $result) {\n\t\t\treturn $result;\n\t\t}\n\t\t\n\t\tthrow (new DocumentNotFoundException())->setDocument(\n\t\t\tget_class($this->model), $id\n\t\t);\n\t}",
"public function objectPathToId($path)\n\t{\n if (!$path) return false;\n \t\n\t\t$sql = \"SELECT docmgr.path_to_id('\".sanitize($path).\"') AS objpath;\";\n\t\t$info = $this->DB->single($sql);\n\n\t\treturn $info[\"objpath\"];\n\t\n\t}",
"public function find($path)\n\t{\n\t\t$ds = DIRECTORY_SEPARATOR;\n\t\t$path = self::normalize_path($path);\n\t\t\n\t\t$root_name = $this->_options['root_name'];\n\t\t// ROOT SPECIAL CASE\n\t\tif($path == $ds.$root_name) return $this->find($ds);\n\n\t\t$this->_load_indexes($path);\n\n\t\tif(array_key_exists($path, $this->_datas))\n\t\t{\n\t\t\t$datas = $this->_datas[$path];\n\t\t\t// ROOT CASE\n\t\t\t\n\t\t\tif($path == $ds)\n\t\t\t{\n\t\t\t\t$alias = new Lemon($this->_datas[$ds.$root_name], $this);\n\t\t\t}\n\t\t\telse if(isset($datas['alias']))\n\t\t\t{\n\t\t\t\t// ALIAS CASE\n\t\t\t\t$alias = $this->find($datas['alias']);\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($alias))\n\t\t\t{\n\t\t\t\tforeach($datas as $k=>$v)\n\t\t\t\t{\n\t\t\t\t\tif($k != 'alias') $alias->set($k, $v);\n\t\t\t\t}\n\t\t\t\treturn $alias;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn new Lemon($this->_datas[$path], $this);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn false;\n\t}",
"public function matchPath($path);",
"public function testIfFindByPathWhenPathNotFound()\n {\n $product = $this->getDocument('AcmeTestBundle:Product', 1);\n $result = $product->findByPath('foo');\n $this->assertEquals(null, $result);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remove the filter expression from the content | protected function removeExpression()
{
self::$content = str_replace(self::$filter_expression, '', self::$content);
} | [
"public function filter($content) {}",
"public function filter($content){ }",
"public function filter(string $content): string;",
"function acf_allow_unfiltered_html() { }",
"public function remove_content_filter() {\n\t\t// @todo also check if this page supports blocks.\n\t\tif ( is_page() ) {\n\t\t\tremove_filter( 'the_content', 'wpautop', 10 );\n\t\t\tadd_filter( 'the_content', array( $this, 'spineautop' ), 10 );\n\t\t}\n\t}",
"public function removeWPCoursewareContentFilter()\n {\n global $post;\n $checkbox_value = get_post_meta($post->ID, \"op-courseware-checkbox\", true);\n if (intval($checkbox_value) == 1) {\n remove_filter('the_content', 'WPCW_units_processUnitContent');\n }\n }",
"function acf_allow_unfiltered_html()\n{\n}",
"function formbuilder_strip_content($content) {\n\t\twhile(eregi(FORMBUILDER_CONTENT_TAG, $content, $regs)) {\n\t\t\t$content = str_replace($regs[0], \"\", $content);\n\t\t}\n\t\treturn($content);\n\t}",
"function FilterTheContent($content) {\n\t\n\t\t// Get the list of find and replace rules from the database\n\t\t$rules = $this->GetFindAndReplaceWords();\n\t\tif(is_array($rules)) // If there are rules then go through each one and perform the find and replace on the content\n\t\t{\n\t\t\tforeach($rules as $rule)\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$content = str_replace(stripslashes($rule['find']), stripslashes($rule['replace']), $content);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Return the modified content\n\t\treturn $content;\n\t}",
"public function cleanContent() {\n $this->params[\"content\"] = preg_replace( '/\\s?(style|class|id)=[\\'\"]{1}.*[\\'\"]{1}/sUi', '', $this->params[\"content\"], -1 );\n }",
"public function ContentFilter_stub ($content)\n {\n $content = preg_replace ('|\\[stocktwits([^\\]]*)\\]|i', '', $content);\n return ($content);\n }",
"public function addFilters ()\n\t\t{\n\t\t\tadd_action('wp_footer', array(&$this, 'printScript'));\n\t\t\tadd_filter('the_content', array(&$this, 'removeChars'));\n\t\t}",
"function partial_filter($content){\r\n\r\n if ($this->top_replace_old)\r\n $content = str_replace($this->top_replace_old, $this->top_replace_new, $content);\r\n\r\n if ($this->partial_replace_old)\r\n $content = str_replace($this->partial_replace_old, $this->partial_replace_new, $content);\r\n\r\n if ($this->partial_preg_replace_old)\r\n $content = preg_replace($this->partial_preg_replace_old, $this->partial_preg_replace_new, $content);\r\n\r\n return $content;\r\n }",
"function abo_remove_p($content){\n remove_filter(' the_content' , 'wpautop ');\n return $content;\n\n\n }",
"public function removeAllFilters();",
"function dumbFilter($content){\n\tif (inString($content,'[[Category:Robots]]'))\t\t// if the article already has the category...\n\t\t$content = str_replace( '[[Category:Robots]]', '', $content); // remove it.\n\telse \t\t\t\t// otherwise...\n\t\t$content .= ' [[Category:Robots]]';\t// add it.\n\treturn $content;\t// CRUCIAL. Return the edited content back to wikiFilter().\n}",
"public function removeFilter($name);",
"function hrld_remove_filters(){\n\tremove_filter('image_send_to_editor', 'image_add_caption', 20, 8);\n}",
"function remove_yoast_filters() {\n global $wpseo_meta_columns;\n global $typenow;\n \n if ( $wpseo_meta_columns && $typenow == 'content_block') {\n remove_action( 'restrict_manage_posts', array( $wpseo_meta_columns, 'posts_filter_dropdown' ) );\n remove_action( 'restrict_manage_posts', array( $wpseo_meta_columns, 'posts_filter_dropdown_readability' ) );\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Init the Table model by instantiating a Post model and loading the list of tables option. | public function __construct() {
parent::__construct();
$this->model_post = TablePress::load_model( 'post' );
$params = array(
'option_name' => 'tablepress_tables',
'default_value' => $this->default_tables,
);
$this->tables = TablePress::load_class( 'TablePress_WP_Option', 'class-wp_option.php', 'classes', $params );
} | [
"public function initTable()\n {\n $this->reflection_class = new \\ReflectionClass($this->model);\n $this->table_fields = $this->getTableFields(true);\n if ($this->table_name == \"\") {\n $this->table_name = (new \\ReflectionClass($this))->getShortName();\n }\n }",
"protected function loadPosts() {\r\n $this->posts = new \\App\\Table\\PostTable(App::getInstance()->getDb());\r\n \r\n }",
"public function initTable(){\n\t\t\t\n\t\t}",
"public static function init() {\n\t\tcore::loadClass(\"database\");\n\n\t\t/* Child tables */\n\t\tcore::loadClass(\"team_model\");\n\t\tcore::loadClass(\"round_model\");\n\t\tcore::loadClass(\"person_model\");\n\t}",
"protected function _initTables()\n {\n $this->_productWebsiteTable = $this->getResource()->getTable('catalog/product_website');\n $this->_productCategoryTable= $this->getResource()->getTable('catalog/category_product');\n }",
"private function _init()\n {\n $this->modelName = ucfirst(get_class($this));\n if (!is_object(self::$db)) {\n self::$db = $this->getDbo()->clear();\n }\n if (empty($this->table)) {\n $this->table = $this->modelName;\n }\n foreach ($this->belongsTo as $alias => $details) {\n $defaults['model'] = $alias;\n $defaults['foreign_key'] = Inflector::singular($alias).$this->foreign_key_suffix;\n $this->belongsTo[$alias] = array_merge($defaults, $details);\n }\n foreach ($this->hasOne as $alias => $details) {\n $defaults['model'] = $alias;\n $defaults['foreign_key'] = /* $this->modelName */ $this->getTable().$this->foreign_key_suffix;\n $this->hasOne[$alias] = array_merge($defaults, $details);\n }\n foreach ($this->hasMany as $alias => $details) {\n $defaults['model'] = $alias;\n $defaults['foreign_key'] = /* Inflector::singular($this->modelName) */$this->getTable().$this->foreign_key_suffix;\n $defaults['through'] = null;\n $defaults['far_key'] = Inflector::singular($alias).$this->foreign_key_suffix;\n $this->hasMany[$alias] = array_merge($defaults, $details);\n }\n foreach ($this->manyMany as $alias => $det) {\n $defaults['model'] = $alias;\n $defaults['far_key'] = Inflector::singular($alias).$this->foreign_key_suffix;\n $this->manyMany[$alias] = array_merge($defaults, $det);\n }\n $this->reload_columns();\n $this->clear_model();\n }",
"protected function initDbTable()\r\n {\r\n }",
"public static function init() {\n self::init_hooks();\n self::create_table();\n }",
"public function init()\n {\n if ($this->enableCreateTable===true){\n $this->createTable();\n }\n }",
"public function __construct() {\n $this->postModel = $this->loadModel('Article');\n }",
"private function initialize_table()\n\t{\n\t\tself::$xform_table_name = $this->config->item(\"table_xform\");\n\t\tlog_message(\"debug\", \"Xform table => \" . $this->config->item(\"table_xform\"));\n\t\tself::$archive_xform_table_name = $this->config->item(\"table_archive_xform\");\n\t}",
"function set_table()\n\t{\n\t\t$this->table = eval($this->template('MAIN_TABLE'));\n\t\t$this->etable = eval($this->template('MAIN_ETABLE'));\n\t}",
"public function initialize()\n {\n global $table_prefix;\n\n $this->setSource($table_prefix . 'terms');\n\n // Terms have many metas\n $this->hasMany(\n 'term_id',\n 'Akufen\\Orchestra\\Mvc\\Models\\TermMeta',\n 'term_id',\n array('alias' => 'metas')\n );\n\n // Terms have term taxonomies\n $this->hasMany(\n 'term_id',\n 'Akufen\\Orchestra\\Mvc\\Models\\TermTaxonomy',\n 'term_id',\n array('alias' => 'taxonomy')\n );\n }",
"function __construct() {\n\t\tglobal $wpdb;\n\t\t$this->wpdb = $wpdb;\n\t\t\n\t\t$this->tables = array(\n\t\t\t'posts' => $this->wpdb->prefix . \"posts\"\n\t\t);\n\t\t\n\t}",
"public function init()\n {\n $sql = 'SHOW TABLES LIKE ' . SQLBuilder::value($this->table_name);\n\n $results = App::$connection->getPDO()->query($sql);\n if ($results->rowCount() == 0) {\n $this->create();\n }\n }",
"private function init_tables()\r\n\t{\r\n\t\tself::$articles_table = PREFIX . 'wiki_articles';\r\n\t\tself::$cats_table = PREFIX . 'wiki_cats';\r\n\t\tself::$contents_table = PREFIX . 'wiki_contents';\r\n\t}",
"abstract protected function initModel();",
"protected function initTableName() {\n\n\t\t\t// Is there a table property set on the Model itself\n\t\t\tif ($table = $this->class->getStaticPropertyValue('table', null)) {\n\n\t\t\t\t// Store it\n\t\t\t\t$this->table = $table;\n\n\t\t\t} else {\n\n\t\t\t\t// Tableize classname\n\t\t\t\t$this->table = StringUtil::tableize($this->className);\n\n\t\t\t}\n\n\n\t\t\t// Was there a db-name specified in the model?\n\t\t\tif ($db = $this->class->getStaticPropertyValue('database', null)) {\n\t\t\t\t$this->database = $db;\n\t\t\t} else {\n\t\t\t\t$this->database = null;\n\t\t\t}\n\n\n\n\t\t}",
"protected function _initModel()\n {\n $entity = ucfirst($this->_getRequestData('entity'));\n $className = str_replace(self::ENTITY_PLACEHOLDER, $entity, self::MODEL_CLASS_TEMPLATE);\n $model = new $className($this->SH()->getDbAdapter());\n $this->_addDataContainer(self::DC_MODEL, $model);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get headers as string | protected function getHeadersString()
{
$headerString = '';
foreach ($this->getHeaders(true) as $header => $value) {
$headerString .= $header . ': ' . $value . "\r\n";
}
return $headerString;
} | [
"public function getHeadersAsString()\n {\n return $this->getResponse()->getHeadersAsString();\n }",
"public function headerToString() {\n\t\treturn implode(\"\\r\\n\", $this->getHeader());\n\t}",
"public function getRawHeaders();",
"private function getRedirectStringHeaders()\n {\n return implode(\"\\r\\n\", $this->getRedirectIndexedHeaders());\n }",
"public function getHeadersJson()\n {\n if (count($this->getHeaders()) <= 0) {\n return \"{}\";\n }\n return json_encode($this->getHeaders(), JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP);\n }",
"protected function _getFormattedRequestHeaders()\n {\n $formattedHeaders = array();\n foreach ($this->_getRequestHeaders() as $headerId => $header) {\n $formattedHeaders[] = sprintf('%s: %s', $headerId, $header);\n }\n\n return implode(\"\\n\", $formattedHeaders);\n }",
"public function getRawHeaders() {\n\t\t$headers = 'HTTP/1.1 ' . $this->statusCode . ' ' . $this->reasonPhrase . \"\\r\\n\";\n\t\t$lines = $this->getHeaderLines();\n\t\tif (!empty($lines)) {\n\t\t\t$headers .= implode(\"\\r\\n\", $lines) . \"\\r\\n\";\n\t\t}\n\n\t\treturn $headers . \"\\r\\n\";\n\t}",
"public function getHeadersAttribute()\n {\n // Include Authentication\n if(config('graphqlclient.auth_credentials') || isset($this->token)) {\n $this->includeAuthentication();\n }\n\n $formattedHeaders = [];\n foreach ($this->rawHeaders as $key => $value) {\n $formattedHeaders[] = $key . ': ' . $value;\n }\n\n return $formattedHeaders;\n }",
"public function toHeaders();",
"public function get_headers()\r\n\t{\r\n\t\treturn $this->get_attr('headers');\r\n\t}",
"private function buildHeaderString()\n {\n $out = '';\n foreach($this->headers as $header => $value) {\n $out .= \"$header: $value\\r\\n\";\n }\n return $out;\n }",
"function getHeaders() {\n $rv[] = 'Content-Type: ' . $this->getContentType();\n if($this->isGzipBody()) {\n $rv[] = 'Content-Encoding: gzip';\n }\n $rv[] = 'Content-Length: ' . strLen($this->getBody());\n return $rv;\n }",
"function getHeaders() {\n return $this->getFieldValue('headers');\n }",
"protected function renderHeaders()\n {\n $headers = array();\n\n foreach ($this->headers as $key => $value)\n $headers[] = sprintf('%s:%s', $key, str_replace(':', '\\c', $value));\n\n return implode(\"\\n\", $headers);\n }",
"public function formatHeaders()\n\t{\n\t\t$headers = array();\n\n\t\tforeach ($this->headers as $key => $val) {\n\t\t\tif (is_string($key)) {\n\t\t\t\t$headers[] = $key . ': ' . $val;\n\t\t\t} else {\n\t\t\t\t$headers[] = $val;\n\t\t\t}\n\t\t}\n\n\t\treturn $headers;\n\t}",
"public function getHeaders() {\n }",
"public function getHeader(){\n\t\treturn $this->base64UrlEncode(json_encode($this->header));\n\t}",
"public function getHeaders()\n {\n }",
"public function getHeaders(): array;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
$query=$this>db>query("SELECT FROM docentes WHERE rut='$rut'"); | public function getDocenteRut($rut){
$where=array('rut'=>$rut);
$query= $this->db
->select('*')
->from('docentes')
->where($where)
->get();
return $query->row();
} | [
"static function caricaUtente() : string\n {\n return \"SELECT *\n FROM utente\n WHERE id = :id;\";\n }",
"static function searchRecensioneByCreatore() : string\n {\n return \"SELECT *\n FROM recensione\n WHERE Creatore=:Creatore;\";\n }",
"function consultarIDRuta($ruta){\n\t\t$conecto=$this->consultar(\"SELECT * FROM ruta WHERE nombre='\".$ruta.\"'\");\n\t\treturn $this->f_fila($conecto)->id_ruta;\n\n\t}",
"function catalogo(){\n global $db;\n $sql = \" SELECT id, nombre from clientes\";\n\treturn find_by_sql($sql);\n \n}",
"function get_recette_by_nom($nom){\n\tglobal $db ;\n\t$table = 'recettes';\n\t$q = \"SELECT * FROM $table WHERE titre='$nom'\";\n\t$recette = readData($db, $q);\n\treturn $recette;\n}",
"function build_sql_request_allDocuments($idUtente) {\n $requestToSQL = \"SELECT idDocumento,titolo FROM Documents WHERE idUtente='\" . $idUtente . \"'\";\n return $requestToSQL;\n}",
"function unidadesDeCurso($idCurso) {\n $query = new Query(\"SG\");\n $query->sql = <<<SQL\n select id_unidad as \"idUnidad\", no_unidad as \"noUnidad\"\n from unidades u\n where id_curso = $idCurso\n order by no_unidad\n \nSQL;\n $resultado = $query->select(\"obj\");\n return $resultado;\n}",
"public function select($convenio);",
"function get_resep($where){\n return $this->db->query(\"SELECT * from resep where id_kue = '\".$where.\"'\");\n }",
"function registro($pk, $nomeTabela, $atributo_exibir, $atributo_de_busca = \"id\") {\n\n\n $conn = TConnection::open(DB);\n\n $criterio = new TCriteria;\n $criterio->add(new TFilter($atributo_de_busca, \"=\", $pk));\n\n $sql = new TSqlSelect;\n $sql->setEntity($nomeTabela);\n $sql->addColumn($atributo_exibir);\n $sql->setCriteria($criterio);\n $result = $conn->query($sql->getInstruction());\n if($result->rowCount()){\n $row = $result->fetch(PDO::FETCH_ASSOC);\n extract($row);\n return $$atributo_exibir;\n }else{\n return '';\n }\n}",
"function caricaRuolo($id) {\r\n\t\tglobal $database, $dati_db;\r\n\r\n\t\t$sql=\"SELECT * FROM \".$dati_db['prefisso'].\"etrasp_ruoli WHERE id=$id\";\r\n\t\tif ( !($risultato = $database->connessioneConReturn($sql)) ) {\r\n\t\t\tdie('Non posso caricare dati ruoli'.$sql);\r\n\t\t}\r\n\r\n\t\t$ente = $database->sqlArray($result);\r\n\r\n\t\treturn $ente;\r\n\r\n\t}",
"function getPesananSelesai()\r\n{\r\n $db = dbConnect();\r\n $sql = \"SELECT * FROM pesanan WHERE status_pesanan = 2\";\r\n return $db->query($sql);\r\n}",
"function referentiel_get_referentiel_referentiel($id){\r\nglobal $DB;\r\n if (!empty($id)){\r\n $params = array(\"id\" => \"$id\");\r\n $sql=\"SELECT * FROM {referentiel_referentiel} WHERE id=:id \";\r\n\t\treturn $DB->get_record_sql($sql, $params);\r\n\t}\r\n\telse \r\n\t\treturn 0; \r\n}",
"function triprix(){\r\n $sql=\"SELECT * FROM livraison ORDER BY prix 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 getviaQuery($que){\n $this->db->query($que);//mengambilkan data berdasrkan query manual\n //manual disini langsung ditulis seperti select * freom dst\n }",
"function consultaGrupos($idTutor)\n{\n $sql=\"SELECT DISTINCT gp.id_grupo as id ,\n gp.nombre_grupo as nombre ,\n gp.clave as clave,\n gp.id_escuela as \\\"idEscuela\\\",\n gp.id_empresa as \\\"idEmpresa\\\",\n gp.tipo_grupo as \\\"tipoGrupo\\\" \n FROM rel_curso_tutor r_c_t\n JOIN rel_curso_grupo r_c_g\n ON r_c_t.id_rel_curso_grupo = r_c_g.id_rel_curso_grupo\n JOIN grupo gp\n ON gp.id_grupo = r_c_g.id_grupo \n WHERE \tgp.status = 1\n AND r_c_t.id_tutor = \".$idTutor;\n \n $consultaGrupo= new Query(\"SG\");\n $consultaGrupo->sql=$sql;\n $resultado = $consultaGrupo->select(\"obj\");\n \n return $resultado;\n}",
"function caricaRuolo($id) {\n\t\tglobal $database, $dati_db;\n\n\t\t$sql=\"SELECT * FROM \".$dati_db['prefisso'].\"etrasp_ruoli WHERE id=$id\";\n\t\tif ( !($risultato = $database->connessioneConReturn($sql)) ) {\n\t\t\tdie('Non posso caricare dati ruoli'.$sql);\n\t\t}\n\n\t\t$ente = $database->sqlArray($result);\n\n\t\treturn $ente;\n\n\t}",
"function voirProduitById($id){\n $conditions = array();\n array_push($conditions, array('nameChamps'=>'id','type'=>'=','name'=>'id','value'=>$id));\n $req = new myQueryClass('produit',$conditions);\n $r = $req->myQuerySelect();\n if(count($r)==0){\n $r = false;\n }else{\n $r = $r[0];\n }\n\treturn $r;\n}",
"function idHome($db,$idUtilisateur){\n $sql = 'SELECT idMaison FROM maisons WHERE idUtilisateur = \"'.$idUtilisateur.'\"';\n $reponse = $db->query($sql);\n return $reponse;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function for get admin detail | public function getAdminDetail()
{
$arrayResponse = array();
try
{
if($this->tokenData)
{
$select = "adm_id,adm_name,adm_username,adm_email,CASE WHEN adm_image!='' THEN CONCAT('".ADMIN_PROFILE_IMAGE."',adm_image) ELSE adm_image END as admin_image";
$response = $this->UserModel->singleData($select,'comm_admin');
if ($response)
{
$arrayResponse = array('success' => true, 'data' => $response,'message' => 'Get successfully');
}
else
{
$arrayResponse = array('success' => false, 'message' => 'Oops! There is no data to display.');
}
}
else
{
$arrayResponse = array("success" => false, "message" => "Your session has timed out, please login again.");
}
if(empty($arrayResponse))
{
throw new Exception('Server Error, please try again.');
}
}
catch (Exception $e)
{
$arrayResponse = array('success' => false, 'message' => $e->getMessage());
}
//--Convert Response to json
$this->getJsonData($arrayResponse);
} | [
"public function admin_detail()\n {\n $id = $this->request->getVar('id');\n\n $respon = $this->dataAdmins->getDataByIdAdmin($id);\n echo json_encode($respon);\n }",
"function admininfo($id)\n{\n $row = getAdminInfo($id);\n return $row;\n}",
"public function getAdminProfile()\r\n {\r\n //\r\n }",
"public function viewadmin(){\r\n\t\t//sql query\r\n\t\t$sql = \"SELECT * FROM admins\";\r\n\t\t//return executed query\r\n\t\treturn $this->db_query($sql);\r\n\t}",
"function getListAdmin() {\n\t\treturn user_get_object($this->dataArray['list_admin']);\n\t}",
"function viewAdministrators(){\n\t/**\n\t*Database is querried and then the admin with the unique id will be added/deleted\n\t*/\n\t $str_query = \"select employee_id, first_name,last_name, Contact\n\t\t\t\t from administrators\";\n\t\t\t\t return $this->query($str_query);\n\t\t\t}",
"public static function SelectAdminById($id){\n return self::where('id',$id)->first();\n }",
"public function getUrlDetailNapza(){\n\t\treturn $this->module->id.'/detailnapzaM/admin';\n\t}",
"static function getInfoAdminById($idAdmin)\n {\n\n $con=Database::getConnection();\n $req=$con->prepare('SELECT * FROM admin WHERE _idAdmin=?');\n $req->execute(array($idAdmin));\n return $req->fetch();\n }",
"public function personaldetailAction ()\n\t{}",
"public function get_admin($admin)\r\n\t{\r\n//\t\t$this->db->select('*');\r\n//\t\t$this->db->from('admin_data');\r\n//\t\t$this->db->where($where); // Produces: WHERE name = 'Joe' \r\n//\t\t$query = $this->db->get(); // Produces: SELECT id, nav_link, nav_name FROM nav\r\n\t\t$query = $this->db->query(\"SELECT * FROM admin_data WHERE admin_user = '$admin' ORDER BY admin_uid DESC\");\r\n\t\t$result = $query->row();\r\n\t\treturn $result;\r\n\t\t\r\n\t}",
"public function listadmin()\n {\n $this->data['title_web'] = \"Daftar Administrator\";\n $this->data['daftar_admin'] = $this->model(\"Admin_model\")->getAllAdmin();\n $this->view(\"templates/header\", $this->data);\n $this->view(\"admin/listadmin\", $this->data);\n $this->view(\"templates/footer\");\n }",
"public function get_admin_details($where){\n\t\treturn $this->db->select('id,full_name,password')\n\t\t\t\t\t->from(Tbl_Admin)\n\t\t\t\t\t->where($where)\n\t\t\t\t\t->get()\n\t\t\t\t\t->result_array();\n\t}",
"public function getadmin($id){\n\n //Make an object instance from admin\n $admin = new admin();\n $admin->__set('AdminID', $id);\n $result = $admin->get();\n if(!$result){\n //echo 'hata';\n return false;\n } else { \n //echo 'Hooooooooooba';\n return $result;\n }\n }",
"function get_admin($id_admin)\n {\n return $this->db->get_where('admin',array('id_admin'=>$id_admin))->row_array();\n }",
"abstract public function get_admin_name();",
"function get_admin_name() {\n return $this->admin_name;\n }",
"public function getAdmins()\n {\n }",
"public static function getAccountDetails()\n {\n return self::fetchAdmin($_SESSION['admin_id']);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Move comment form fields | function wpex_move_comment_form_fields( $fields ) {
$comment_field = $fields['comment'];
unset( $fields['comment'] );
$fields['comment'] = $comment_field;
return $fields;
} | [
"function move_comment_field( $fields ) {\n\t $comment_field = $fields['comment'];\n\t unset( $fields['comment'] );\n\t $fields['comment'] = $comment_field;\n\t return $fields;\n\t}",
"function theone_move_comment( $fields ) {\n $comment_field = $fields[ 'comment' ];\n unset( $fields[ 'comment' ] );\n $fields[ 'comment' ] = $comment_field;\n return $fields;\n}",
"function bbp_move_reply_form_fields()\n{\n}",
"function change_comment_form($fields) {\n\n\t$fields['comment_notes_before'] = '';\n\treturn $fields;\n}",
"function ForBlogs_move_comment_field_to_bottom( $fields ) {\n\t\t$comment_field = $fields['comment'];\n\t\tunset( $fields['comment'] );\n\t\t$fields['comment'] = $comment_field;\n\t\treturn $fields;\n\t}",
"function prefix_move_comment_field_to_bottom($fields)\n{\n $comment_field = $fields['comment'];\n $cookies_field = $fields['cookies'];\n\n unset($fields['comment']);\n unset($fields['cookies']);\n\n $fields['comment'] = $comment_field;\n $fields['cookies'] = $cookies_field;;\n return $fields;\n}",
"function wpb_move_comment_field_to_bottom( $fields ) {\n $comment_field = $fields['comment'];\n unset( $fields['comment'] );\n unset($fields['website']);\n $fields['comment'] = $comment_field;\n return $fields;\n }",
"public static function rearrange_comment_form_fields ($fields) {\r\n\t\tif (!is_array($fields) || empty($fields['comment'])) return $fields;\r\n\r\n\t\t$result = array();\r\n\t\tforeach ($fields as $key => $field) {\r\n\t\t\tif ('comment' === $key) continue;\r\n\t\t\t$result[$key] = $field;\r\n\t\t}\r\n\t\t$result['comment'] = $fields['comment'];\r\n\r\n\t\treturn $result;\r\n\t}",
"function ology_comment_form_after_fields() {\n\n\t\techo ology_close_markup( 'ology_comment_fields_inner_wrap', 'div' );\n\n\techo ology_close_markup( 'ology_comment_fields_wrap', 'div' );\n\n}",
"function beans_comment_before_fields() {\n\n\techo beans_open_markup( 'beans_comment_all_fields_wrap', 'div', array( 'class' => 'uk-grid' ) );\n\n\t\techo beans_open_markup( 'beans_comment_fields_wrap', 'div', array( 'class' => 'uk-width-medium-1-1' ) );\n\n\t\t\techo beans_open_markup( 'beans_comment_fields_inner_wrap', 'div', array( 'class' => 'uk-grid' ) );\n\n}",
"function gk_comment_form( $fields ) {\n ob_start();\n wp_editor( '', 'comment', array( 'teeny' => true ));\n $fields['comment_field'] = ob_get_clean();\n return $fields;\n}",
"function rk_comment_form() {\n\t$commenter = wp_get_current_commenter();\n\t\n\t$args = array(\n\t\t'fields' => rk_comment_form_fields( $commenter ),\n\t\t'comment_field' => rk_comment_field(),\n\t\t'logged_in_as' => '',\n\t\t'comment_notes_before' => '',\n\t\t'comment_notes_after' => rk_comment_notes_after(),\n\t\t'title_reply' => '',\n\t\t'title_reply_to' => 'You are replying to %s',\n\t\t'cancel_reply_link' => 'Cancel Reply'\n\t);\n\t\n add_action( 'comment_form_before', 'rk_comment_form_before' ); // Add heading, Quicktags dialogs\n\tadd_action( 'comment_form_top', 'rk_comment_form_top' ); // Add <fieldset>, <ol>\n\tadd_action( 'comment_form_logged_in_after', 'rk_comment_form_logged_in_after', 10, 2 ); // Add fields even if user is logged in\n\t\n\tcomment_form($args);\n}",
"function appthemes_before_comments_form() {\n\tdo_action( 'appthemes_before_comments_form' );\n}",
"function recover_comment_fields($comment_fields)\n{\n $comment = array_shift($comment_fields);\n $comment_fields = array_merge($comment_fields, array('comment' => $comment));\n return $comment_fields;\n}",
"function cleanyeti_belowcommentsform() {\n do_action('cleanyeti_belowcommentsform');\n}",
"public static function makeCommentFieldTheLastField() {\n\t\tadd_filter('comment_form_fields', function ($fields) {\n\t\t\t$commentField = $fields['comment'];\n\t\t\tunset($fields['comment']);\n\t\t\t$fields['comment'] = $commentField;\n\t\t\treturn $fields;\n\t\t});\n\t}",
"function travel_agency_change_comment_form_default_fields( $fields ){\r\n \r\n // get the current commenter if available\r\n $commenter = wp_get_current_commenter();\r\n \r\n // core functionality\r\n $req = get_option( 'require_name_email' );\r\n $aria_req = ( $req ? \" aria-required='true'\" : '' ); \r\n \r\n // Change just the author field\r\n $fields['author'] = '<p class=\"comment-form-author\"><input id=\"author\" name=\"author\" placeholder=\"' . esc_attr__( 'Name*', 'travel-agency' ) . '\" type=\"text\" value=\"' . esc_attr( $commenter['comment_author'] ) . '\" size=\"30\"' . $aria_req . ' /></p>';\r\n \r\n $fields['email'] = '<p class=\"comment-form-email\"><input id=\"email\" name=\"email\" placeholder=\"' . esc_attr__( 'Email*', 'travel-agency' ) . '\" type=\"text\" value=\"' . esc_attr( $commenter['comment_author_email'] ) . '\" size=\"30\"' . $aria_req . ' /></p>';\r\n \r\n $fields['url'] = '<p class=\"comment-form-url\"><input id=\"url\" name=\"url\" placeholder=\"' . esc_attr__( 'Website', 'travel-agency' ) . '\" type=\"text\" value=\"' . esc_attr( $commenter['comment_author_url'] ) . '\" size=\"30\" /></p>'; \r\n \r\n return $fields;\r\n \r\n}",
"function garland_cichorieae_form_comment_form_alter(&$form, &$form_state) {\n\n if (!isset($form['comment_preview'])) {\n $form['header'] = array(\n '#markup' => '<h2>' . t('Reply') . '</h2>',\n '#weight' => -2,\n );\n }\n $form['subject']['#title'] = $form['subject']['#title'] . ':';\n $form['comment_body']['und'][0]['#title'] = $form['comment_body']['und'][0]['#title'] . ':';\n if (isset($form['author']['_author']['#title'])) {\n $form['author']['_author']['#title'] = $form['author']['_author']['#title'] . ':';\n }\n $form['actions']['submit']['#value'] = t('Post comment');\n $form['actions']['submit']['#weight'] = 1000;\n $form['actions']['preview']['#value'] = t('Preview comment');\n}",
"public static function amend_comment_form() {\n\t\t?>\n\t\t<?php if ( is_singular() && ! amp_is_canonical() ) : ?>\n\t\t\t<input type=\"hidden\" name=\"redirect_to\" value=\"<?php echo esc_url( amp_get_permalink( get_the_ID() ) ); ?>\">\n\t\t<?php endif; ?>\n\t\t<?php\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns value of 'locationStart' property | public function getLocationStart() {
return $this->get(self::LOCATIONSTART);
} | [
"public function getStartLocation()\n {\n return $this->start_location;\n }",
"public function getStartLocation()\n {\n return $this->startLocation;\n }",
"public function getStartLocation(): string\n {\n return $this->startLocation;\n }",
"public function getStartLocation() {\n return $this->get(self::START_LOCATION);\n }",
"function getStartValue() {\n return $this->startValue;\n }",
"public function getGeoPointStart()\n {\n return isset($this->geoPointStart) ? $this->geoPointStart : null;\n }",
"public function getStartPoint()\n {\n return $this->startPoint;\n }",
"public function getStartAddress()\n {\n return $this->startAddress;\n }",
"public function getStartAddress() {\n return $this->get(self::START_ADDRESS);\n }",
"public function getStartStation() { return $this->journeyParts[0]->getStartStation(); }",
"public function getLoc()\n {\n return $this->properties[static::LOC];\n }",
"public function setLocationStart($value) {\n return $this->set(self::LOCATIONSTART, $value);\n }",
"public function getRangeStart()\n {\n return $this->range_start;\n }",
"public function getStartTimeOffset()\n {\n return $this->start_time_offset;\n }",
"public function start_location()\n {\n return $this->hasOne('App\\Models\\Location', 'id', 'start_location_id');\n }",
"public function getStartNumber()\n {\n return $this->startNumber;\n }",
"public function getStartPosition()\n {\n return $this->startPosition;\n }",
"public function getStart()\r\n\t{\r\n\t\treturn $this->startTime;\r\n\t}",
"public function getStartOffset()\n {\n return $this->start_offset;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns Gift Card Activity. Represents an action performed on a gift card that affects its state or balance. | public function getGiftCardActivity(): ?GiftCardActivity
{
return $this->giftCardActivity;
} | [
"public function giftCardActivity(?GiftCardActivity $value): self\n {\n $this->instance->setGiftCardActivity($value);\n return $this;\n }",
"public function getContractingActivity()\n {\n return $this->contractingActivity;\n }",
"public function activity()\n {\n return Activity::i();\n }",
"public function getGiftCardActivitiesApi(): GiftCardActivitiesApi\n {\n if ($this->giftCardActivities == null) {\n $this->giftCardActivities = new GiftCardActivitiesApi($this->client);\n }\n return $this->giftCardActivities;\n }",
"public function getVehicleActivity()\n {\n return $this->vehicleActivity;\n }",
"public function getActivityReward()\n {\n return $this->get(self::_ACTIVITY_REWARD);\n }",
"public function getDisputeActivity()\n {\n return $this->disputeActivity;\n }",
"public function getAct(){\n\t\t\treturn $this->act;\n\t\t}",
"function bbp_get_activity_actions()\n{\n}",
"function ajan_get_activity_action_name() { return ajan_get_activity_type(); }",
"public function getTransferBalanceFromActivityDetails(): ?GiftCardActivityTransferBalanceFrom\n {\n return $this->transferBalanceFromActivityDetails;\n }",
"public function getActivity()\n {\n return $this->activity;\n }",
"protected function getGameAttribute(): ?Activity\n {\n return $this->activities->get('type', Activity::TYPE_GAME);\n }",
"public function activity_get()\r\n {\r\n $this->load('activity');\r\n return $this->activity;\r\n }",
"function get_activity () {\r\n if ($this->activity != null)\r\n return $this->activity;\r\n else\r\n return null;\r\n }",
"public function getActif()\n {\n\n return $this->actif;\n }",
"public function getDeactivateActivityDetails(): ?GiftCardActivityDeactivate\n {\n return $this->deactivateActivityDetails;\n }",
"public function activity() {\n\n\t\t$activityModel = Base::getModel('Common_Items_Activity');\n\t\t$select = $activityModel->select()\n\t\t ->setIntegrityCheck(false)\n\t\t\t\t\t ->from(array('cia' => 'common_items_activity'), array('id', 'common_item_id', 'user_id', 'status', 'note', 'created', new Zend_Db_Expr(\"'Item' as flag\")))\n\t\t\t\t\t ->where('common_item_id in (?)', new Zend_Db_Expr(\"(SELECT id FROM common_items WHERE common_order_id = $this->id)\"));\n\t\t\n\t\t$sql = \"SELECT id, common_order_id, user_id, status, note, created, 'Order' as flag FROM common_orders_activity WHERE common_order_id = $this->id\";\n\n\t\t$select = $activityModel->select()->union(array($select, $sql))->order(\"created DESC\")->order(\"id DESC\");\n\t\t//Zend_Debug::dump((string)$select); die();\n\t\t$activity = $activityModel->fetchAll($select);\n\t\treturn $activity;\n\t}",
"public function getActivityForCard($cardID)\n {\n $result = self::$dbInterface -> query(\"SELECT activityID, content, time, user_userID, card_cardID \n FROM activity WHERE card_cardID='$cardID'\");\n return $result;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Configure and set up exception and error handling | protected function initializeErrorHandling() {} | [
"protected function configureErrorHandling()\n {\n $this->crashHandler = new CrashHandler();\n $this->crashHandler->register();\n\n $this->errorHandler = new ErrorHandler();\n $this->errorHandler->register();\n }",
"private function setErrorHandling(){\n\t\t$errorconfig = $this->config->getErrorSettings();\n\t\tself::$debug = Debug::getInstance(\n\t\t\t$errorconfig['stage'],\n\t\t\t$errorconfig['log_exceptions'],\n\t\t\t$errorconfig['log_exceptions_file']\n\t\t);\n\t\tself::$error = Error::getInstance( \n\t\t\tself::$debug,\n\t\t\t$errorconfig\n\t\t);\n\t\tset_error_handler(array( &self::$error, \"errorHandler\" ));\n\t\tset_exception_handler(array( &self::$error, \"exceptionHandler\") );\n\t}",
"public function __construct()\n {\n set_exception_handler([$this, 'handleException']);\n }",
"private function _setupErrorHandler() {\n // Get the error handler class name\n $errorHandlerClassName = $this->_appConf->getErrorHandler();\n\n // If there is no error handler, stops\n if (empty($errorHandlerClassName)) {\n return;\n }\n\n // Separate the class name from the method\n $errorHandlerInfo = explode('::', $errorHandlerClassName);\n\n // If the error handler class and method is not correctly defined\n if (!isset($errorHandlerInfo[1])) {\n throw new AppException('The error handler you specified with the $app[\"error-handler\"] setting must define a class name and a method, separated by ::');\n }\n\n // Set the error handler\n set_error_handler($errorHandlerClassName);\n }",
"function api_error_setup() {\n\tset_exception_handler(function(Throwable $e) {\n\t\ttry {\n\t\t\techo APIException::make_json_string(APIException::map_to_code($e), $e);\n\t\t\tls_log($e->__toString(), LOGERR);\n\t\t} catch (Exception $e) {\n\t\t\t/*\n\t\t\t* Exceptions thrown in the exception handler\n\t\t\t* cause hard to debug fatal errors. Handle them.\n\t\t\t*/\n\t\t\techo '{\"error\":'.API_E_INTERNAL.', \"e_msg\":\"'.$e->getMessage().\n\t\t\t\t' (in exception handler, '.$e->getFile().' '.$e->getLine().')\"}';\n\t\t}\n\t\texit(1);\n\t});\n}",
"public function loadErrorAndExceptionHandler(): void\n {\n error_reporting(E_ALL);\n set_error_handler('Awesome\\Error::errorHandler');\n set_exception_handler('Awesome\\Error::exceptionHandler');\n }",
"public function __construct()\n {\n set_error_handler([$this, 'handleError']);\n }",
"static public function init()\n {\n set_error_handler(array('ErrorExceptionProxy', 'handler')); \n }",
"public function __construct()\n {\n set_exception_handler(array($this, 'handleException'));\n }",
"public function startExceptionHandling()\n\t{\n\t\t$this['exception']->register($this->environment());\n\n\t\t$this['exception']->setDebug($this['config']['app.debug']);\n\t}",
"public function startExceptionHandling()\n {\n $this['exception']->register($this->environment());\n $this['exception']->setDebug($this['config']['app.debug']);\n }",
"private static function setupErrorHandler() {\n set_error_handler(array('System', 'errorHandler'));\n }",
"public function startExceptionHandling()\n {\n $this['exception']->register();\n }",
"protected function _handleException(){ }",
"public function __construct() {\n\t\tset_error_handler(array($this, 'handleError'));\n\t}",
"protected static function initializeBasicErrorReporting() {}",
"protected function _initSetErrorHandlers(){\n\n function catchException( Exception $e ){\n\n echo 'Houve uma excecao<br>Mensagem:<b> '.$e->getMessage().'</b><br>';\n echo 'Arquivo:<b> '.$e->getFile().'</b></br>';\n echo 'Linha: <b>'.$e->getLine().'</b></br>';\n echo 'Codigo: <b>'.$e->getCode().'</b></br>';\n }\n\n set_exception_handler( 'catchException' );\n \n }",
"function error_config() {\r\n if(ERR_LEVEL !== DEVELOPMENT) {\r\n ini_set('display_errors', 1);\r\n } else {\r\n ini_set('display_errors', 0);\r\n }\r\n \r\n $errorsManager = ErrorsManager::instance();\r\n \r\n if(ERR_LEVEL !== PRODUCTION) {\r\n ErrorsManager::setVerboseMode(TRUE);\r\n }\r\n \r\n error_reporting(ERR_LEVEL);\r\n $errorsManager->setLogsPath(PATH_LOG);\r\n set_error_handler(array($errorsManager, 'captureErrors'));\r\n set_exception_handler(array($errorsManager, 'captureExceptions'));\r\n register_shutdown_function(array($errorsManager, 'captureShutdown'));\r\n //ini_set('log_errors', TRUE);\r\n //ini_set('error_log', DEFAULT_LOG_FILE);\r\n }",
"public static function setExceptionHandlers()\n\t{\n\t\tset_exception_handler(array('XfCli_ExceptionHandler', 'handleException'));\n\t\tset_error_handler(array('XfCli_ExceptionHandler', 'handleError'));\n\t\t\n\t\tCLI::$_useExceptions \t= true;\n\t\tCLI::$_exceptionClass \t= 'XfCli_Exception';\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
AJAX method to rename a module | public function renameAction()
{
$post = $this->params()->fromPut();
if (empty($post['title'])) {
return array(
'status' => 0,
'message' => __('Title is required.')
);
}
$id = intval($post['id']);
$row = Pi::model('module')->find($id);
$row->title = $post['title'];
$row->save();
Pi::service('registry')->module->clear();
Pi::service('registry')->modulelist->clear();
return array(
'status' => 1,
'data' => array(
'title' => $row->title,
),
);
} | [
"public function renameAction()\n {\n //$post = $this->params()->fromPost();\n $title = _post('title');\n if (empty($title)) {\n return array(\n 'status' => 0,\n 'message' => __('Title is required.')\n );\n }\n $id = _post('id', 'int');\n $name = _post('name', 'regexp',\n array('regexp' => '/^[a-z0-9_]+$/i'));\n if ($id) {\n $row = Pi::model('module')->find($id);\n } else {\n $row = Pi::model('module')->find($name, 'name');\n }\n if (!$row) {\n return array(\n 'status' => 0,\n 'message' => __('Module is not found.')\n );\n }\n\n $row->title = $title;\n $row->save();\n Pi::registry('module')->clear();\n Pi::registry('modulelist')->clear();\n\n return array(\n 'status' => 1,\n 'data' => array(\n 'title' => $row->title,\n ),\n );\n }",
"public function renameModule($name, $newName);",
"abstract function actionRename();",
"abstract function rename();",
"public function rename() {\n header(\"Content-Type: application/json\");\n setUserContext($this);\n if ($this->auth->isAllowed('edit_organization') == FALSE) {\n $this->output->set_header(\"HTTP/1.1 403 Forbidden\");\n } else {\n $id = $this->input->get('id', TRUE);\n $text = sanitize($this->input->get('text', TRUE));\n $this->load->model('organization_model');\n $this->organization_model->rename($id, $text);\n }\n }",
"public function actionRename()\n {\n $groupForm = new GroupForm(['scenario' => GroupForm::SCENARIO_RENAME]);\n\n $myMembership = GroupMember::find()->where(['member' => Yii::$app->user->identity->name])->one();\n if ($myMembership) {\n /* @var $myMembership GroupMember */\n $groupForm->_group = $myMembership->group;\n $groupForm->name = $myMembership->group->name;\n\n if ($myMembership->group->administrationAvailable()) {\n if (Yii::$app->request->isPost) {\n if ($groupForm->load(Yii::$app->request->post()) && $groupForm->validate()) {\n $groupForm->renameGroup();\n Yii::$app->session->setFlash('success', 'Группа переименована');\n return $this->redirect(['rename']);\n }\n }\n }\n }\n\n return $this->render('rename', [\n 'groupForm' => $groupForm\n ]);\n }",
"public function renameAction(Rsc_Http_Request $request)\n {\n $lang = $this->getEnvironment()->getLang();\n $logger = $this->getEnvironment()->getLogger();\n\n $stats = $this->getEnvironment()->getModule('stats');\n $stats->save('galleries.rename');\n\n try {\n\n $this->getModel('galleries')->renameFromRequest($request, $lang);\n\n } catch (Exception $e) {\n\n if ($logger) {\n $logger->error(\n 'Invalid argument specified: {exception}',\n array(\n 'exception' => $e,\n )\n );\n }\n\n return $this->response(\n 'ajax',\n $this->getErrorResponseData(\n $e->getMessage()\n )\n );\n\n }\n\n return $this->response(\n 'ajax',\n $this->getSuccessResponseData(\n $lang->translate('Title successfully updated')\n )\n );\n }",
"public function UpdateName() \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n{\t$this->autorender = false;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t$this->layout = null;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t$this->render('ajax');\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\tif ($this->request->is('get')) { throw new MethodNotAllowedException(); }\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n $params = json_decode(file_get_contents('php://input'),true); //\n $fileID=$params['fileID'];\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t//\n $newName=$params['newName'];\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t//\n\t$newName= preg_replace('/_/',' ', $newName);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// \n $editPerm=$this->getPermissionsFromID('edit', $this->Auth->user('id'), $fileID); //\n \tif ($editPerm=='1')\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t{\t$thisFile = $this->Workspace->find('first', array('conditions' => array('id' => $fileID)));\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t//\n\t\tif ($this->Workspace->hasAny(array('parent_id' => $thisFile['Workspace']['parent_id'], 'name'=>$newName)))\t\t\t\t\t\t\t\t\t\t\t\t\t\t// \n\t { echo('Error1');\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t }else\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// \n\t\t{\t$this->Workspace->id=$fileID;\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// \n\t\t $this->Workspace->saveField('name', $newName);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// \n\t \techo('1');\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t }\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t}else { echo('Error2'); }\t\t \t\t\t\t\t\t\t\t\t\t//\n}",
"public function changeBlockName() \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n{\tif ($this->request->is('get')) { throw new MethodNotAllowedException(); }\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t$this->autorender = false;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t$this->layout = null;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// \n $this->render('ajax');\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// \n\t$thisFile=$this->request->data('thisFile');\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t$thisFile=preg_replace(\"/^\\//\", \"\", $thisFile);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t$oldName=$this->request->data('oldName');\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t$newName=$this->request->data('newName');\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t$DirInfo=$this->Get_FolderID($thisFile);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// \n\t$oldName=preg_replace(\"/_/\",\" \",$oldName);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t$newName=preg_replace(\"/_/\",\" \",$newName);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\tController::loadModel('Workspace');\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\tController::loadModel('Permission');\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\tif ($this->Workspace->hasAny(array('parent_id' => $DirInfo['ID'], 'name'=>$oldName)))\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// \n\t{\t$editPerm=$this->Get_Permissions('edit', $this->Auth->user('id'), $thisFile);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\tif ($editPerm=='1')\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\t{\t$FileData=$this->Workspace->find('first', array('conditions' => array('parent_id' => $DirInfo['ID'], 'name'=>$oldname)));\t\t\t\t\t\t\t\t\t//\n\t\t $this->Workspace->id=$FileData['Workspace']['id'];\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// \n\t\t\t$this->Workspace->saveField('name', $newName);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// \n\t\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n}",
"public static function rename()\n {\n }",
"function runkit_method_rename($classname, $methodname, $newname){}",
"public static function replaceModule(\\Illuminate\\Http\\Request $request, $filename) {\n\n $oModule = \\Atlantis\\Models\\Repositories\\ModulesRepository::getModule($request->get('namespace'))->first();\n\n if ($oModule != NULL) {\n\n /**\n * disable module\n */\n $oModule->active = 0;\n $oModule->update();\n\n $modulePath = str_replace('/', '', config('atlantis.modules_dir')) . '/' . \\Atlantis\\Helpers\\Tools::getParentFolderPath($oModule->path);\n $moduleBackupPath = $modulePath . '-backup';\n $filenameBackup = 'backup-' . $filename;\n $moduleFolder = last(array_filter(explode('/', $modulePath)));\n\n if ($moduleFolder === FALSE) {\n return ['error' => 'Module folder not found'];\n }\n\n /**\n * create backup archive\n */\n Storage::disk('local')->move($modulePath, $moduleBackupPath);\n \\Zipper::make(base_path(self::$_UPDATER_STORAGE) . '/' . $filenameBackup)->folder($moduleFolder)->add(base_path($moduleBackupPath));\n\n\n /**\n * unzip new module in modules folder\n */\n Storage::disk('local')->makeDirectory($modulePath);\n \\Zipper::make(base_path(self::$_UPDATER_STORAGE) . '/' . $filename)->folder($moduleFolder)->extractTo(base_path($modulePath));\n\n /**\n * delete unnecessary files\n */\n Storage::disk('local')->deleteDirectory($moduleBackupPath);\n Storage::disk('local')->delete(self::$_UPDATER_STORAGE . '/' . $filename);\n\n /**\n * update modules table module\n */\n $setup = \\Atlantis\\Helpers\\Tools::getModuleFileSetup($request->get('path'));\n if (empty($setup)) {\n return ['error' => 'Setup.php file not found'];\n }\n\n /**\n * change module folder permissions\n */\n exec('chmod -R 775 ' . $modulePath);\n\n /**\n * run migrations\n */\n \\Artisan::call('atlantis:migrate:module', [\n 'namespace' => $request->get('namespace')\n ]);\n\n $oModule->name = $setup['name'];\n $oModule->author = $setup['author'];\n $oModule->version = $setup['version'];\n $oModule->namespace = $setup['moduleNamespace'];\n $oModule->path = $setup['path'];\n $oModule->provider = $setup['provider'];\n $oModule->extra = serialize($setup['extra']);\n $oModule->adminURL = $setup['adminURL'];\n $oModule->icon = $setup['icon'];\n $oModule->description = $setup['description'];\n $oModule->active = 1;\n $oModule->update();\n } else {\n return ['error' => 'Module namespace not found'];\n }\n }",
"function action_reopen_module() {\n\t// Check that the supplied module exists and that the user is enrolled in it\n\tif (empty($_POST['module_id']) || !ctype_digit($_POST['module_id']) || !get_module_by_id($_POST['module_id'])) {\n\t\tajax_response(true, ['Ugyldig module id']);\n\t}\n\n\ttry {\n\t\tset_completed_flag_on_module($_POST['module_id'], false);\n\t}\n\tcatch (RuntimeException $e) {\n\t\tajax_response(true, [ $e->getMessage() ]);\n\t}\n\n\tajax_response();\n}",
"function runkit_method_rename($class_name, $method_name, $new_name) {}",
"private function rename(){\n\n // Define the new name\n // ... [NOT YET IMPLEMENTED] ...\n $name_ = '0' . $this->name;\n // Set the renamed file name\n $this->setFileName($name_);\n\n }",
"public static function setModuleName($module_name);",
"public function setModuleName($module) {}",
"function session_module_name($newname = null) {}",
"public function setModuleName($module);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create the options page. | public function create_options_page() {
add_menu_page(
$this->settings['heading'],
$this->settings['menu_title'],
'edit_theme_options',
$this->settings['page_slug'],
array( $this, 'render_options_page' ),
$this->settings['dashicon'],
999 // Place at the bottom of the dash menu
);
} | [
"public function createOptionsPage () \r\n {\r\n echo '<div id=\"amazonsimpleadmin-general\" class=\"wrap\">';\r\n echo '<h2>AmazonSimpleAdmin</h2>';\r\n\r\n $this->_displayPreDispatcher($this->task);\r\n echo $this->getTabMenu($this->task);\r\n #echo '<div style=\"clear: both\"></div>';\r\n echo '<div id=\"asa_content\">';\r\n $this->_displayDispatcher($this->task);\r\n echo '</div>';\r\n }",
"public function create_options_page() {\n print '<div class=\"wrap\">';\n screen_icon();\n printf( '<h2>%s</h2>', __( 'Instagram Settings', 'bii-instagram' ) );\n print '<form method=\"post\" action=\"options.php\">';\n settings_fields( 'bii_instagram' );\n do_settings_sections( 'bii-instagram' );\n submit_button();\n print '</form>';\n print '</div>';\n }",
"function build_option_pages()\r\n\t{\r\n\t\t/* intentionally left blank */\r\n\t}",
"public function page_options() {\n\t\t$this->render_option_tabs( $this::get_pagetype_tab( 'page' ) );\n\t}",
"protected function create_options() {}",
"public function initOptionsPage()\n {\n $optionsPage = new OptionsPageController(\n new Config($this->optionsPageConfig),\n new RegisterSetting(),\n new AddOptionsPage(),\n new RegisterSection(),\n new RegisterFields()\n );\n }",
"public function do_options_page() {\n\t\t?>\n\t\t<div class=\"wrap\">\n\t\t\t<h1><?php echo esc_html( $this->options_page_name ); ?></h1>\n\t\t\t<form method=\"POST\" action=\"options.php\">\n\t\t\t\t<?php settings_fields( $this->options_key ); ?>\n\t\t\t\t<?php do_settings_sections( $this->slug ); ?>\n\t\t\t\t<?php submit_button(); ?>\n\t\t\t</form>\n\t\t</div>\n\t\t<?php\n\t}",
"public function setup_options_page() {\n\t\tacf_add_options_sub_page( [\n\t\t\t'page_title' \t=> _x( 'Promotions', 'Promotions page title in WP Admin', 'my-listing' ),\n\t\t\t'menu_title'\t=> _x( 'Promotions', 'Promotions menu title in WP Admin', 'my-listing' ),\n\t\t\t'menu_slug' \t=> 'theme-promotions-settings',\n\t\t\t'capability'\t=> 'manage_options',\n\t\t\t'redirect'\t\t=> false,\n\t\t\t'parent_slug' => 'case27/tools.php',\n\t\t] );\n\t}",
"public function addOptionsPage() {\n\n\t\t$this->_options_page_hook = add_options_page(\n\t\t\t'Managed Missions Options',\n\t\t\t'Managed Missions',\n\t\t\t'manage_options',\n\t\t\tself::OPT_GROUP,\n\t\t\tarray( $this, 'renderOptionsPage' )\n\t\t);\n\t}",
"function hydriade_register_options_page() {\n add_options_page('Hydriade option', 'Hydriade', 'manage_options', 'hydriade_options', array($this,'hydriade_options_page'));\n }",
"public function addOptionsPage() {\n\n\t\tadd_options_page(\n\t\t\t__( \"E20R Licensing\", \"e20rlicense\" ),\n\t\t\t__( \"E20R Licensing\", \"e20rlicense\" ),\n\t\t\t'manage_options',\n\t\t\t'e20r-license',\n\t\t\tarray( $this, 'licensePage' )\n\t\t);\n\t}",
"public function renderOptions() {\n global $zuhaus_mikado_Framework;\n $tab \t\t= zuhaus_mikado_get_admin_tab();\n $active_page \t= $zuhaus_mikado_Framework->mkdOptions->getAdminPageFromSlug($tab);\n $current_theme \t= wp_get_theme();\n\n if ($active_page == null) return;\n ?>\n <div class=\"mkdf-options-page mkdf-page\">\n <?php $this->getHeader($current_theme->get('Name'), $current_theme->get('Version')); ?>\n <div class=\"mkdf-page-content-wrapper\">\n <div class=\"mkdf-page-content\">\n <div class=\"mkdf-page-navigation mkdf-tabs-wrapper vertical left clearfix\">\n <?php $this->getPageNav($tab); ?>\n <?php $this->getPageContent($active_page, $tab); ?>\n </div>\n </div>\n </div>\n </div>\n <a id='back_to_top' href='#'>\n <span class=\"fa-stack\">\n <span class=\"fa fa-angle-up\"></span>\n </span>\n </a>\n <?php }",
"public function setup_options_page() {\n\t\tacf_add_options_sub_page( [\n\t\t\t'page_title' \t=> _x( 'Map Services', 'Maps page title in WP Admin', 'my-listing' ),\n\t\t\t'menu_title'\t=> _x( 'Map Services', 'Maps menu title in WP Admin', 'my-listing' ),\n\t\t\t'menu_slug' \t=> 'theme-maps-settings',\n\t\t\t'capability'\t=> 'manage_options',\n\t\t\t'redirect'\t\t=> false,\n\t\t\t'parent_slug' => 'case27/tools.php',\n\t\t] );\n\t}",
"public function add_options_page() {\n add_options_page($this->title, $this->title, 'manage_options', $this->page, array(&$this, 'display_options_page'));\n }",
"function gg_add_pages() {\r\n add_options_page('Guestbook Generator', 'Guestbook Generator', 8, __FILE__, 'gg_options_page');\r\n}",
"function add_options_page() {\r\n\t\tadd_options_page($this->title, $this->title, 'manage_options', $this->page, array(&$this, '_display_options_page'));\r\n\t}",
"function create_options() {\n if ( !is_admin() )\n return;\n \n if ( !$this->is_supported_php() ) {\n add_action( 'admin_notices', array( $this, 'render_missing_php_notice' ) );\n }\n\n if ( !in_array( 'titan-framework/titan-framework.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {\n add_action( 'admin_notices', array( $this, 'render_missing_titan_notice' ) );\n return;\n }\n \n remove_filter( 'admin_footer_text', 'addTitanCreditText' );\n \n // Launch options framework instance\n $equipeer_options = TitanFramework::getInstance( EQUIPEER_ID );\n\n // ===============================================\n // Create PANEL menu item\n // ===============================================\n $panel = $equipeer_options->createAdminPanel( array(\n 'name' => __( 'Admin Settings', EQUIPEER_ID ),\n 'id' => EQUIPEER_ID . '_options',\n 'capability' => 'equipeer_edit_options',\n 'desc' => '',\n 'parent' => 'edit.php?post_type=' . $this->post_type\n ) );\n // Create OPTIONS panel tabs\n //$options = $panel->createTab( array(\n // 'name' => 'Options',\n // 'id' => EQUIPEER_ID . '_options',\n //) );\n // Create PREFIX panel tabs\n //$prefixes = $panel->createTab( array(\n // 'name' => 'Préfixes',\n // 'id' => EQUIPEER_ID . '_prefix',\n //) );\n // Create EMAILS panel tabs\n //$email = $panel->createTab( array(\n // 'name' => 'Emails',\n // 'id' => EQUIPEER_ID . '_email',\n //) );\n // Create CONTACT CLIENT panel tabs\n //$email_send = $panel->createTab( array(\n // 'name' => 'Contact client',\n // 'id' => EQUIPEER_ID . '_email_send',\n //) );\n // Create FEATURED ADS panel tabs\n $featured_ads = $panel->createTab( array(\n 'name' => 'A la une',\n 'id' => EQUIPEER_ID . '_featured_ads',\n ) );\n // Create ADMIN options panel tabs\n $admin_options = $panel->createTab( array(\n 'name' => 'Admin',\n 'id' => EQUIPEER_ID . '_admin_options',\n ) );\n // Create XML FEED Facebook panel tabs\n $xml_feed = $panel->createTab( array(\n 'name' => 'Flux XML FB',\n 'id' => EQUIPEER_ID . '_xml_feed_fb',\n ) );\n // Create HELPERS panel tabs\n $helpers = $panel->createTab( array(\n 'name' => 'Aides',\n 'id' => EQUIPEER_ID . '_helpers',\n ) );\n // Create CREDITS panel tabs\n $credits = $panel->createTab( array(\n 'name' => 'Crédits',\n 'id' => EQUIPEER_ID . '_credits',\n ) );\n // ===============================================\n //$equipeer_tt_files = array( 'prefixes', 'helpers', 'options', 'email', 'email-send', 'widget-featured-ads', 'xml-feed-facebook', 'credits' );\n //$equipeer_tt_files = array( 'helpers', 'options', 'email', 'email-send', 'widget-featured-ads', 'xml-feed-facebook', 'credits' );\n //$equipeer_tt_files = array( 'helpers', 'email', 'email-send', 'widget-featured-ads', 'admin-options', 'xml-feed-facebook', 'credits' );\n $equipeer_tt_files = array( 'helpers', 'widget-featured-ads', 'admin-options', 'xml-feed-facebook', 'credits' );\n foreach( $equipeer_tt_files as $equipeer_tt_file ) {\n $equipeer_tt_file_exist = EQUIPEER_INC_DIR . '/titan-inc-' . $equipeer_tt_file . '.php';\n if ( file_exists( $equipeer_tt_file_exist ) )\n include( $equipeer_tt_file_exist );\n }\n // ===============================================\n $helpers->createOption( array(\n 'type' => 'save',\n 'save' => __( 'Save Changes', EQUIPEER_ID ),\n 'reset' => __( 'Reset to Defaults', EQUIPEER_ID ),\n ) );\n //$prefixes->createOption( array(\n // 'type' => 'save',\n // 'save' => __( 'Save Changes', EQUIPEER_ID ),\n // 'reset' => __( 'Reset to Defaults', EQUIPEER_ID ),\n //) );\n //$options->createOption( array(\n // 'type' => 'save',\n // 'save' => __( 'Save Changes', EQUIPEER_ID ),\n // 'reset' => __( 'Reset to Defaults', EQUIPEER_ID ),\n //) );\n $admin_options->createOption( array(\n 'type' => 'save',\n 'save' => __( 'Save Changes', EQUIPEER_ID ),\n 'reset' => __( 'Reset to Defaults', EQUIPEER_ID ),\n ) );\n //$email->createOption( array(\n // 'type' => 'save',\n // 'save' => __( 'Save Changes', EQUIPEER_ID ),\n // 'reset' => __( 'Reset to Defaults', EQUIPEER_ID ),\n //) );\n $xml_feed->createOption( array(\n 'type' => 'save',\n 'save' => __( 'Save Changes', EQUIPEER_ID ),\n 'reset' => false\n ) );\n // =============================================== \n }",
"public function renderOptionsPage() {\n\t\tammm_get_template( 'Admin/Options/options-page', array(\n\t\t\t'fields' => self::OPT_GROUP,\n\t\t\t'options' => $this->_options_page_hook,\n\t\t) );\n\t}",
"public function renderOptions() {\n $tab \t\t= sienna_mikado_get_admin_tab();\n $active_page \t= sienna_mikado_framework()->mkdOptions->getAdminPageFromSlug($tab);\n $current_theme \t= wp_get_theme();\n\n if ($active_page == null) return;\n ?>\n <div class=\"mkdf-options-page mkdf-page\">\n\n <?php $this->getHeader($current_theme->get('Name'), $current_theme->get('Version')); ?>\n\n <div class=\"mkdf-page-content-wrapper\">\n <div class=\"mkdf-page-content\">\n <div class=\"mkdf-page-navigation mkdf-tabs-wrapper vertical left clearfix\">\n\n <?php $this->getPageNav($tab); ?>\n <?php $this->getPageContent($active_page, $tab); ?>\n\n\n </div> <!-- close div.mkdf-page-navigation -->\n\n </div> <!-- close div.mkdf-page-content -->\n\n </div> <!-- close div.mkdf-page-content-wrapper -->\n\n </div> <!-- close div.mkd-options-page -->\n\n <a id='back_to_top' href='#'>\n <span class=\"fa-stack\">\n <span class=\"fa fa-angle-up\"></span>\n </span>\n </a>\n <?php }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets up the translated strings and object properties. The method creates the translatable strings for various calendar elements. Which allows for specifying locale specific calendar names and text direction. | public function init() {
// The weekdays.
$this->weekday[0] = /* translators: Weekday. */ __( 'Sunday' );
$this->weekday[1] = /* translators: Weekday. */ __( 'Monday' );
$this->weekday[2] = /* translators: Weekday. */ __( 'Tuesday' );
$this->weekday[3] = /* translators: Weekday. */ __( 'Wednesday' );
$this->weekday[4] = /* translators: Weekday. */ __( 'Thursday' );
$this->weekday[5] = /* translators: Weekday. */ __( 'Friday' );
$this->weekday[6] = /* translators: Weekday. */ __( 'Saturday' );
// The first letter of each day.
$this->weekday_initial[ __( 'Sunday' ) ] = /* translators: One-letter abbreviation of the weekday. */ _x( 'S', 'Sunday initial' );
$this->weekday_initial[ __( 'Monday' ) ] = /* translators: One-letter abbreviation of the weekday. */ _x( 'M', 'Monday initial' );
$this->weekday_initial[ __( 'Tuesday' ) ] = /* translators: One-letter abbreviation of the weekday. */ _x( 'T', 'Tuesday initial' );
$this->weekday_initial[ __( 'Wednesday' ) ] = /* translators: One-letter abbreviation of the weekday. */ _x( 'W', 'Wednesday initial' );
$this->weekday_initial[ __( 'Thursday' ) ] = /* translators: One-letter abbreviation of the weekday. */ _x( 'T', 'Thursday initial' );
$this->weekday_initial[ __( 'Friday' ) ] = /* translators: One-letter abbreviation of the weekday. */ _x( 'F', 'Friday initial' );
$this->weekday_initial[ __( 'Saturday' ) ] = /* translators: One-letter abbreviation of the weekday. */ _x( 'S', 'Saturday initial' );
// Abbreviations for each day.
$this->weekday_abbrev[ __( 'Sunday' ) ] = /* translators: Three-letter abbreviation of the weekday. */ __( 'Sun' );
$this->weekday_abbrev[ __( 'Monday' ) ] = /* translators: Ttree-letter abbreviation of the weekday. */ __( 'Mon' );
$this->weekday_abbrev[ __( 'Tuesday' ) ] = /* translators: Three-letter abbreviation of the weekday. */ __( 'Tue' );
$this->weekday_abbrev[ __( 'Wednesday' ) ] = /* translators: Three-letter abbreviation of the weekday. */ __( 'Wed' );
$this->weekday_abbrev[ __( 'Thursday' ) ] = /* translators: Three-letter abbreviation of the weekday. */ __( 'Thu' );
$this->weekday_abbrev[ __( 'Friday' ) ] = /* translators: Three-letter abbreviation of the weekday. */ __( 'Fri' );
$this->weekday_abbrev[ __( 'Saturday' ) ] = /* translators: Three-letter abbreviation of the weekday. */ __( 'Sat' );
// The months.
$this->month['01'] = /* translators: Month name. */ __( 'January' );
$this->month['02'] = /* translators: Month name. */ __( 'February' );
$this->month['03'] = /* translators: Month name. */ __( 'March' );
$this->month['04'] = /* translators: Month name. */ __( 'April' );
$this->month['05'] = /* translators: Month name. */ __( 'May' );
$this->month['06'] = /* translators: Month name. */ __( 'June' );
$this->month['07'] = /* translators: Month name. */ __( 'July' );
$this->month['08'] = /* translators: Month name. */ __( 'August' );
$this->month['09'] = /* translators: Month name. */ __( 'September' );
$this->month['10'] = /* translators: Month name. */ __( 'October' );
$this->month['11'] = /* translators: Month name. */ __( 'November' );
$this->month['12'] = /* translators: Month name. */ __( 'December' );
// The months, genitive.
$this->month_genitive['01'] = /* translators: Month name, genitive. */ _x( 'January', 'genitive' );
$this->month_genitive['02'] = /* translators: Month name, genitive. */ _x( 'February', 'genitive' );
$this->month_genitive['03'] = /* translators: Month name, genitive. */ _x( 'March', 'genitive' );
$this->month_genitive['04'] = /* translators: Month name, genitive. */ _x( 'April', 'genitive' );
$this->month_genitive['05'] = /* translators: Month name, genitive. */ _x( 'May', 'genitive' );
$this->month_genitive['06'] = /* translators: Month name, genitive. */ _x( 'June', 'genitive' );
$this->month_genitive['07'] = /* translators: Month name, genitive. */ _x( 'July', 'genitive' );
$this->month_genitive['08'] = /* translators: Month name, genitive. */ _x( 'August', 'genitive' );
$this->month_genitive['09'] = /* translators: Month name, genitive. */ _x( 'September', 'genitive' );
$this->month_genitive['10'] = /* translators: Month name, genitive. */ _x( 'October', 'genitive' );
$this->month_genitive['11'] = /* translators: Month name, genitive. */ _x( 'November', 'genitive' );
$this->month_genitive['12'] = /* translators: Month name, genitive. */ _x( 'December', 'genitive' );
// Abbreviations for each month.
$this->month_abbrev[ __( 'January' ) ] = /* translators: Three-letter abbreviation of the month. */ _x( 'Jan', 'January abbreviation' );
$this->month_abbrev[ __( 'February' ) ] = /* translators: Three-letter abbreviation of the month. */ _x( 'Feb', 'February abbreviation' );
$this->month_abbrev[ __( 'March' ) ] = /* translators: Three-letter abbreviation of the month. */ _x( 'Mar', 'March abbreviation' );
$this->month_abbrev[ __( 'April' ) ] = /* translators: Three-letter abbreviation of the month. */ _x( 'Apr', 'April abbreviation' );
$this->month_abbrev[ __( 'May' ) ] = /* translators: Three-letter abbreviation of the month. */ _x( 'May', 'May abbreviation' );
$this->month_abbrev[ __( 'June' ) ] = /* translators: Three-letter abbreviation of the month. */ _x( 'Jun', 'June abbreviation' );
$this->month_abbrev[ __( 'July' ) ] = /* translators: Three-letter abbreviation of the month. */ _x( 'Jul', 'July abbreviation' );
$this->month_abbrev[ __( 'August' ) ] = /* translators: Three-letter abbreviation of the month. */ _x( 'Aug', 'August abbreviation' );
$this->month_abbrev[ __( 'September' ) ] = /* translators: Three-letter abbreviation of the month. */ _x( 'Sep', 'September abbreviation' );
$this->month_abbrev[ __( 'October' ) ] = /* translators: Three-letter abbreviation of the month. */ _x( 'Oct', 'October abbreviation' );
$this->month_abbrev[ __( 'November' ) ] = /* translators: Three-letter abbreviation of the month. */ _x( 'Nov', 'November abbreviation' );
$this->month_abbrev[ __( 'December' ) ] = /* translators: Three-letter abbreviation of the month. */ _x( 'Dec', 'December abbreviation' );
// The meridiems.
$this->meridiem['am'] = __( 'am' );
$this->meridiem['pm'] = __( 'pm' );
$this->meridiem['AM'] = __( 'AM' );
$this->meridiem['PM'] = __( 'PM' );
// Numbers formatting.
// See https://www.php.net/number_format
/* translators: $thousands_sep argument for https://www.php.net/number_format, default is ',' */
$thousands_sep = __( 'number_format_thousands_sep' );
// Replace space with a non-breaking space to avoid wrapping.
$thousands_sep = str_replace( ' ', ' ', $thousands_sep );
$this->number_format['thousands_sep'] = ( 'number_format_thousands_sep' === $thousands_sep ) ? ',' : $thousands_sep;
/* translators: $dec_point argument for https://www.php.net/number_format, default is '.' */
$decimal_point = __( 'number_format_decimal_point' );
$this->number_format['decimal_point'] = ( 'number_format_decimal_point' === $decimal_point ) ? '.' : $decimal_point;
// Set text direction.
if ( isset( $GLOBALS['text_direction'] ) ) {
$this->text_direction = $GLOBALS['text_direction'];
/* translators: 'rtl' or 'ltr'. This sets the text direction for WordPress. */
} elseif ( 'rtl' === _x( 'ltr', 'text direction' ) ) {
$this->text_direction = 'rtl';
}
} | [
"function init()\n\t{\n\t\tglobal $wp_locale;\n\t\t\n\t\t$this->l10n = array(\n\t\t\t'closeText' => __( 'Done', 'acf' ),\n\t 'currentText' => __( 'Today', 'acf' ),\n\t 'monthNames' => array_values( $wp_locale->month ),\n\t 'monthNamesShort' => array_values( $wp_locale->month_abbrev ),\n\t 'monthStatus' => __( 'Show a different month', 'acf' ),\n\t 'dayNames' => array_values( $wp_locale->weekday ),\n\t 'dayNamesShort' => array_values( $wp_locale->weekday_abbrev ),\n\t 'dayNamesMin' => array_values( $wp_locale->weekday_initial ),\n\t 'isRTL' => isset($wp_locale->is_rtl) ? $wp_locale->is_rtl : false,\n\t\t);\n\t}",
"function _calendartranslation()\n\t{\n\t\tstatic $jsscript = 0;\n\n\t\t/*\n\t\t * \t\tCalendar._TT[\"ABOUT\"] =\n\t\t \"DHTML Date/Time Selector\\n\" +\n\t\t \"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\\n\" +\n\t\t \"For latest version visit: http://www.dynarch.com/projects/calendar/\\n\" +\n\t\t \"Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details.\" +\n\t\t \"\\n\\n\" +\n\t\t \"Date selection:\\n\" +\n\t\t \"- Use the \\xab, \\xbb buttons to select year\\n\" +\n\t\t \"- Use the \" + String.fromCharCode(0x2039) + \", \" + String.fromCharCode(0x203a) + \" buttons to select month\\n\" +\n\t\t \"- Hold mouse button on any of the above buttons for faster selection.\";\n\t\t Calendar._TT[\"ABOUT_TIME\"] = \"\\n\\n\" +\n\t\t \"Time selection:\\n\" +\n\t\t \"- Click on any of the time parts to increase it\\n\" +\n\t\t \"- or Shift-click to decrease it\\n\" +\n\t\t \"- or click and drag for faster selection.\";\n\t\t */\n\t\tif($jsscript == 0)\n\t\t{\n\t\t\t$return = 'Calendar._DN = new Array (\"'.JText::_('Sunday').'\", \"'.JText::_('Monday').'\", \"'.JText::_('Tuesday').'\", \"'.JText::_('Wednesday').'\", \"'.JText::_('Thursday').'\", \"'.JText::_('Friday').'\", \"'.JText::_('Saturday').'\", \"'.JText::_('Sunday').'\");Calendar._SDN = new Array (\"'.JText::_('Sun').'\", \"'.JText::_('Mon').'\", \"'.JText::_('Tue').'\", \"'.JText::_('Wed').'\", \"'.JText::_('Thu').'\", \"'.JText::_('Fri').'\", \"'.JText::_('Sat').'\", \"'.JText::_('Sun').'\"); Calendar._FD = 0;\tCalendar._MN = new Array (\"'.JText::_('January').'\", \"'.JText::_('February').'\", \"'.JText::_('March').'\", \"'.JText::_('April').'\", \"'.JText::_('May').'\", \"'.JText::_('June').'\", \"'.JText::_('July').'\", \"'.JText::_('August').'\", \"'.JText::_('September').'\", \"'.JText::_('October').'\", \"'.JText::_('November').'\", \"'.JText::_('December').'\");\tCalendar._SMN = new Array (\"'.JText::_('January_short').'\", \"'.JText::_('February_short').'\", \"'.JText::_('March_short').'\", \"'.JText::_('April_short').'\", \"'.JText::_('May_short').'\", \"'.JText::_('June_short').'\", \"'.JText::_('July_short').'\", \"'.JText::_('August_short').'\", \"'.JText::_('September_short').'\", \"'.JText::_('October_short').'\", \"'.JText::_('November_short').'\", \"'.JText::_('December_short').'\");Calendar._TT = {};Calendar._TT[\"INFO\"] = \"'.JText::_('About the calendar').'\";\n\t\tCalendar._TT[\"PREV_YEAR\"] = \"'.JText::_('Prev. year (hold for menu)').'\";Calendar._TT[\"PREV_MONTH\"] = \"'.JText::_('Prev. month (hold for menu)').'\";\tCalendar._TT[\"GO_TODAY\"] = \"'.JText::_('Go Today').'\";Calendar._TT[\"NEXT_MONTH\"] = \"'.JText::_('Next month (hold for menu)').'\";Calendar._TT[\"NEXT_YEAR\"] = \"'.JText::_('Next year (hold for menu)').'\";Calendar._TT[\"SEL_DATE\"] = \"'.JText::_('Select date').'\";Calendar._TT[\"DRAG_TO_MOVE\"] = \"'.JText::_('Drag to move').'\";Calendar._TT[\"PART_TODAY\"] = \"'.JText::_('(Today)').'\";Calendar._TT[\"DAY_FIRST\"] = \"'.JText::_('Display %s first').'\";Calendar._TT[\"WEEKEND\"] = \"0,6\";Calendar._TT[\"CLOSE\"] = \"'.JText::_('Close').'\";Calendar._TT[\"TODAY\"] = \"'.JText::_('Today').'\";Calendar._TT[\"TIME_PART\"] = \"'.JText::_('(Shift-)Click or drag to change value').'\";Calendar._TT[\"DEF_DATE_FORMAT\"] = \"'.JText::_('%Y-%m-%d').'\"; Calendar._TT[\"TT_DATE_FORMAT\"] = \"'.JText::_('%a, %b %e').'\";Calendar._TT[\"WK\"] = \"'.JText::_('wk').'\";Calendar._TT[\"TIME\"] = \"'.JText::_('Time:').'\";';\n\t\t\t$jsscript = 1;\n\t\t\treturn $return;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"function _calendartranslation()\r\n {\r\n static $jsscript = 0;\r\n\r\n /*\r\n * \t\tCalendar._TT[\"ABOUT\"] =\r\n \"DHTML Date/Time Selector\\n\" +\r\n \"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\\n\" +\r\n \"For latest version visit: http://www.dynarch.com/projects/calendar/\\n\" +\r\n \"Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details.\" +\r\n \"\\n\\n\" +\r\n \"Date selection:\\n\" +\r\n \"- Use the \\xab, \\xbb buttons to select year\\n\" +\r\n \"- Use the \" + String.fromCharCode(0x2039) + \", \" + String.fromCharCode(0x203a) + \" buttons to select month\\n\" +\r\n \"- Hold mouse button on any of the above buttons for faster selection.\";\r\n Calendar._TT[\"ABOUT_TIME\"] = \"\\n\\n\" +\r\n \"Time selection:\\n\" +\r\n \"- Click on any of the time parts to increase it\\n\" +\r\n \"- or Shift-click to decrease it\\n\" +\r\n \"- or click and drag for faster selection.\";\r\n */\r\n if($jsscript == 0)\r\n {\r\n $return = 'Calendar._DN = new Array (\"'.JText::_('Sunday').'\", \"'.JText::_('Monday').'\", \"'.JText::_('Tuesday').'\", \"'.JText::_('Wednesday').'\", \"'.JText::_('Thursday').'\", \"'.JText::_('Friday').'\", \"'.JText::_('Saturday').'\", \"'.JText::_('Sunday').'\");Calendar._SDN = new Array (\"'.JText::_('Sun').'\", \"'.JText::_('Mon').'\", \"'.JText::_('Tue').'\", \"'.JText::_('Wed').'\", \"'.JText::_('Thu').'\", \"'.JText::_('Fri').'\", \"'.JText::_('Sat').'\", \"'.JText::_('Sun').'\"); Calendar._FD = 0;\tCalendar._MN = new Array (\"'.JText::_('January').'\", \"'.JText::_('February').'\", \"'.JText::_('March').'\", \"'.JText::_('April').'\", \"'.JText::_('May').'\", \"'.JText::_('June').'\", \"'.JText::_('July').'\", \"'.JText::_('August').'\", \"'.JText::_('September').'\", \"'.JText::_('October').'\", \"'.JText::_('November').'\", \"'.JText::_('December').'\");\tCalendar._SMN = new Array (\"'.JText::_('January_short').'\", \"'.JText::_('February_short').'\", \"'.JText::_('March_short').'\", \"'.JText::_('April_short').'\", \"'.JText::_('May_short').'\", \"'.JText::_('June_short').'\", \"'.JText::_('July_short').'\", \"'.JText::_('August_short').'\", \"'.JText::_('September_short').'\", \"'.JText::_('October_short').'\", \"'.JText::_('November_short').'\", \"'.JText::_('December_short').'\");Calendar._TT = {};Calendar._TT[\"INFO\"] = \"'.JText::_('About the calendar').'\";\r\n \r\n\r\n\t\tCalendar._TT[\"PREV_YEAR\"] = \"'.JText::_('Prev. year (hold for menu)').'\";Calendar._TT[\"PREV_MONTH\"] = \"'.JText::_('Prev. month (hold for menu)').'\";\tCalendar._TT[\"GO_TODAY\"] = \"'.JText::_('Go Today').'\";Calendar._TT[\"NEXT_MONTH\"] = \"'.JText::_('Next month (hold for menu)').'\";Calendar._TT[\"NEXT_YEAR\"] = \"'.JText::_('Next year (hold for menu)').'\";Calendar._TT[\"SEL_DATE\"] = \"'.JText::_('Select date').'\";Calendar._TT[\"DRAG_TO_MOVE\"] = \"'.JText::_('Drag to move').'\";Calendar._TT[\"PART_TODAY\"] = \"'.JText::_('(Today)').'\";Calendar._TT[\"DAY_FIRST\"] = \"'.JText::_('Display %s first').'\";Calendar._TT[\"WEEKEND\"] = \"0,6\";Calendar._TT[\"CLOSE\"] = \"'.JText::_('Close').'\";Calendar._TT[\"TODAY\"] = \"'.JText::_('Today').'\";Calendar._TT[\"TIME_PART\"] = \"'.JText::_('(Shift-)Click or drag to change value').'\";Calendar._TT[\"DEF_DATE_FORMAT\"] = \"'.JText::_('%Y-%m-%d').'\"; Calendar._TT[\"TT_DATE_FORMAT\"] = \"'.JText::_('%a, %b %e').'\";Calendar._TT[\"WK\"] = \"'.JText::_('wk').'\";Calendar._TT[\"TIME\"] = \"'.JText::_('Time:').'\";';\r\n $jsscript = 1;\r\n return $return;\r\n } else {\r\n return false;\r\n }\r\n }",
"public function initTranslations();",
"public function generic_strings() {\n\t\t$switched_locale = function_exists( 'switch_to_locale' ) && switch_to_locale( 'en_US' );\n\n\t\tparent::generic_strings();\n\n\t\tif ( $switched_locale ) {\n\t\t\trestore_previous_locale();\n\t\t}\n\t}",
"protected function initializeL10nLocales() {}",
"private function setLocaleSettings()\n {\n $this->setDaysOfWeekNames();\n $this->setMonthNames();\n }",
"public function __construct()\n {\n for ($i = 1; $i <= 12; $i++) {\n $names = explode(\"\\n\", strftime(\"%b\\n%B\", mktime(12, 0, 0, $i, 1, 2011)));\n $this->messages['months_short'][] = $names[0];\n $this->messages['months_long'][] = $names[1];\n }\n for ($i = 0; $i < 7; $i++) {\n $names = explode(\"\\n\", strftime(\"%a\\n%A\", mktime(12, 0, 0, 1, 2 + $i, 2011)));\n $this->messages['weekdays_short'][] = $names[0];\n $this->messages['weekdays_long'][] = $names[1];\n }\n }",
"function createCalendar($name,$properties);",
"public function _strings_for_pot() {\n\t\t/* translators: Localized date format, see https://www.php.net/date */\n\t\t__( 'F j, Y' );\n\t\t/* translators: Localized time format, see https://www.php.net/date */\n\t\t__( 'g:i a' );\n\t\t/* translators: Localized date and time format, see https://www.php.net/date */\n\t\t__( 'F j, Y g:i a' );\n\t}",
"protected static function _dateTimeTranslation()\n {\n static $jsscript = 0;\n\n if ($jsscript == 0)\n {\n $return =\n 'Calendar._DN = new Array (\"'\n .JText::_('SUNDAY', true).'\", \"'\n .JText::_('MONDAY', true).'\", \"'\n .JText::_('TUESDAY', true).'\", \"'\n .JText::_('WEDNESDAY', true).'\", \"'\n .JText::_('THURSDAY', true).'\", \"'\n .JText::_('FRIDAY', true).'\", \"'\n .JText::_('SATURDAY', true).'\", \"'\n .JText::_('SUNDAY', true).'\");'\n .' Calendar._SDN = new Array (\"'\n .JText::_('SUN', true).'\", \"'\n .JText::_('MON', true).'\", \"'\n .JText::_('TUE', true).'\", \"'\n .JText::_('WED', true).'\", \"'\n .JText::_('THU', true).'\", \"'\n .JText::_('FRI', true).'\", \"'\n .JText::_('SAT', true).'\", \"'\n .JText::_('SUN', true).'\");'\n .' Calendar._FD = 0;'\n .' Calendar._MN = new Array (\"'\n .JText::_('JANUARY', true).'\", \"'\n .JText::_('FEBRUARY', true).'\", \"'\n .JText::_('MARCH', true).'\", \"'\n .JText::_('APRIL', true).'\", \"'\n .JText::_('MAY', true).'\", \"'\n .JText::_('JUNE', true).'\", \"'\n .JText::_('JULY', true).'\", \"'\n .JText::_('AUGUST', true).'\", \"'\n .JText::_('SEPTEMBER', true).'\", \"'\n .JText::_('OCTOBER', true).'\", \"'\n .JText::_('NOVEMBER', true).'\", \"'\n .JText::_('DECEMBER', true).'\");'\n .' Calendar._SMN = new Array (\"'\n .JText::_('JANUARY_SHORT', true).'\", \"'\n .JText::_('FEBRUARY_SHORT', true).'\", \"'\n .JText::_('MARCH_SHORT', true).'\", \"'\n .JText::_('APRIL_SHORT', true).'\", \"'\n .JText::_('MAY_SHORT', true).'\", \"'\n .JText::_('JUNE_SHORT', true).'\", \"'\n .JText::_('JULY_SHORT', true).'\", \"'\n .JText::_('AUGUST_SHORT', true).'\", \"'\n .JText::_('SEPTEMBER_SHORT', true).'\", \"'\n .JText::_('OCTOBER_SHORT', true).'\", \"'\n .JText::_('NOVEMBER_SHORT', true).'\", \"'\n .JText::_('DECEMBER_SHORT', true).'\");'\n .' Calendar._TT = {};Calendar._TT[\"INFO\"] = \"'.JText::_('JLIB_HTML_BEHAVIOR_ABOUT_THE_CALENDAR', true).'\";'\n .' Calendar._TT[\"ABOUT\"] =\n \"DHTML Date/Time Selector\\n\" +\n \"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\\n\" +\n \"For latest version visit: http://www.dynarch.com/projects/calendar/\\n\" +\n \"Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details.\" +\n \"\\n\\n\" +\n \"'.JText::_('JLIB_HTML_BEHAVIOR_DATE_SELECTION', true).'\" +\n \"'.JText::_('JLIB_HTML_BEHAVIOR_YEAR_SELECT', true).'\" +\n \"'.JText::_('JLIB_HTML_BEHAVIOR_MONTH_SELECT', true).'\" +\n \"'.JText::_('JLIB_HTML_BEHAVIOR_HOLD_MOUSE', true).'\";\n Calendar._TT[\"ABOUT_TIME\"] = \"\\n\\n\" +\n \"Time selection:\\n\" +\n \"- Click on any of the time parts to increase it\\n\" +\n \"- or Shift-click to decrease it\\n\" +\n \"- or click and drag for faster selection.\";\n\n Calendar._TT[\"PREV_YEAR\"] = \"'.JText::_('JLIB_HTML_BEHAVIOR_PREV_YEAR_HOLD_FOR_MENU', true).'\";'\n .' Calendar._TT[\"PREV_MONTH\"] = \"'.JText::_('JLIB_HTML_BEHAVIOR_PREV_MONTH_HOLD_FOR_MENU', true).'\";'\n .' Calendar._TT[\"GO_TODAY\"] = \"'.JText::_('JLIB_HTML_BEHAVIOR_GO_TODAY', true).'\";'\n .' Calendar._TT[\"NEXT_MONTH\"] = \"'.JText::_('JLIB_HTML_BEHAVIOR_NEXT_MONTH_HOLD_FOR_MENU', true).'\";'\n .' Calendar._TT[\"NEXT_YEAR\"] = \"'.JText::_('JLIB_HTML_BEHAVIOR_NEXT_YEAR_HOLD_FOR_MENU', true).'\";'\n .' Calendar._TT[\"SEL_DATE\"] = \"'.JText::_('JLIB_HTML_BEHAVIOR_SELECT_DATE', true).'\";'\n .' Calendar._TT[\"DRAG_TO_MOVE\"] = \"'.JText::_('JLIB_HTML_BEHAVIOR_DRAG_TO_MOVE', true).'\";'\n .' Calendar._TT[\"PART_TODAY\"] = \"'.JText::_('JLIB_HTML_BEHAVIOR_TODAY', true).'\";'\n .' Calendar._TT[\"DAY_FIRST\"] = \"'.JText::_('JLIB_HTML_BEHAVIOR_DISPLAY_S_FIRST', true).'\";'\n .' Calendar._TT[\"WEEKEND\"] = \"0,6\";'\n .' Calendar._TT[\"CLOSE\"] = \"'.JText::_('JLIB_HTML_BEHAVIOR_CLOSE', true).'\";'\n .' Calendar._TT[\"TODAY\"] = \"'.JText::_('JLIB_HTML_BEHAVIOR_TODAY', true).'\";'\n .' Calendar._TT[\"TIME_PART\"] = \"'.JText::_('JLIB_HTML_BEHAVIOR_SHIFT_CLICK_OR_DRAG_TO_CHANGE_VALUE', true).'\";'\n .' Calendar._TT[\"DEF_DATE_FORMAT\"] = \"'.JText::_('%Y-%m-%d', true).'\";'\n .' Calendar._TT[\"TT_DATE_FORMAT\"] = \"'.JText::_('%a, %b %e', true).'\";'\n .' Calendar._TT[\"WK\"] = \"'.JText::_('JLIB_HTML_BEHAVIOR_WK', true).'\";'\n .' Calendar._TT[\"TIME\"] = \"'.JText::_('JLIB_HTML_BEHAVIOR_TIME', true).'\";';\n\n $jsscript = 1;\n\n return $return;\n }\n else\n {\n return false;\n }\n }",
"public function register_strings() {\n\t\t// prepare strings\n\t\t$this->strings = array(\n\t\t\t'Event rewrite base'\t\t\t=> Events_Maker()->options['permalinks']['event_rewrite_base'],\n\t\t\t'Event rewrite slug'\t\t\t=> Events_Maker()->options['permalinks']['event_rewrite_slug'],\n\t\t\t'Event Categories rewrite slug'\t=> Events_Maker()->options['permalinks']['event_categories_rewrite_slug'],\n\t\t\t'Event Locations rewrite slug'\t=> Events_Maker()->options['permalinks']['event_locations_rewrite_slug'],\n\t\t);\n\t\t\n\t\tif ( Events_Maker()->options['general']['use_tags'] === true )\n\t\t\t$this->strings['Event Tags rewrite slug'] = Events_Maker()->options['permalinks']['event_tags_rewrite_slug'];\n\t\tif ( Events_Maker()->options['general']['use_organizers'] === true )\n\t\t\t$this->strings['Event Organizers rewrite slug'] = Events_Maker()->options['permalinks']['event_organizers_rewrite_slug'];\n\t\t\n\t\t// WPML >= 3.2\n\t\tif ( defined( 'ICL_SITEPRESS_VERSION' ) && version_compare( ICL_SITEPRESS_VERSION, '3.2', '>=' ) ) {\n\t\t\t$this->register_wpml_strings();\n\t\t// WPML and Polylang compatibility\n\t\t} elseif ( function_exists( 'icl_register_string' ) ) {\n\t\t\t$this->register_pll_strings();\n\t\t}\n\t}",
"function setAllStrings()\r\n {\r\n if ( isset( $this->TextStrings ) and is_array( $this->TextStrings ) )\r\n {\r\n reset( $this->TextStrings );\r\n $tmp =& each( $this->TextStrings );\r\n while ( $tmp )\r\n {\r\n $tmp_key = \"intl-\" . $tmp[0];\r\n $this->set_var_internal( $tmp_key, $tmp[1] );\r\n $tmp =& each( $this->TextStrings );\r\n }\r\n }\r\n }",
"protected function initLocalization() {\n Lang::init();\n }",
"function JewishCalendar() {\n parent::NativeCalendar();\n $this->settings = array();\n // Initialize defaults:\n $this->settings['language'] = CAL_LANG_FOREIGN;\n $this->settings['diaspora'] = FALSE;\n $this->settings['eves'] = TRUE;\n $this->settings['isru'] = FALSE;\n $this->settings['sefirat_omer'] = FALSE;\n }",
"private function set_locale() {\n\n\t\t$plugin_i18n = new WP_Carousel_Pro_I18n();\n\t\t$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );\n\n\t}",
"private function set_locale() {\n\n\t\t$plugin_i18n = new Recipes_CPT_I18n();\n\n\t\t$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );\n\n\t}",
"function calendarComponent() {\n $this->objName = get_class ( $this );\n\n $this->action = array();\n $this->attach = array();\n $this->attendee = array();\n $this->categories = array();\n $this->class = array();\n $this->comment = array();\n $this->completed = array();\n $this->contact = array();\n $this->created = array();\n $this->description = array();\n $this->dtend = array();\n $this->dtstart = array();\n $this->dtstamp = array();\n $this->due = array();\n $this->duration = array();\n $this->exdate = array();\n $this->exrule = array();\n $this->freebusy = array();\n $this->geo = array();\n $this->lastmodified = array();\n $this->location = array();\n $this->organizer = array();\n $this->percentcomplete = array();\n $this->priority = array();\n $this->rdate = array();\n $this->recurrenceid = array();\n $this->relatedto = array();\n $this->repeat = array();\n $this->requeststatus = array();\n $this->resources = array();\n $this->sequence = array();\n $this->rrule = array();\n $this->status = array();\n $this->summary = array();\n $this->transp = array();\n $this->trigger = array();\n $this->tzid = array();\n $this->tzname = array();\n $this->tzoffsetfrom = array();\n $this->tzoffsetto = array();\n $this->tzurl = array();\n $this->uid = array();\n $this->url = array();\n $this->xprop = array();\n\n $this->subcomponents = array();\n\n $this->language = null;\n $this->nl = null;\n $this->unique_id = null;\n $this->xcaldecl = array();\n\n $this->_makeDtstamp();\n }",
"protected function initTranslations()\n {\n /** @var I18N $i18n */\n $i18n = Instance::ensure($this->i18n, I18N::class);\n $i18n->translations['credy*'] = [\n 'class' => PhpMessageSource::class,\n 'basePath' => dirname(__FILE__) . DIRECTORY_SEPARATOR . 'messages',\n 'sourceLanguage' => 'en',\n 'fileMap' => [\n 'credy' => 'credy.php',\n ],\n ];\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Count layers with folder ids | public function countFolderContainLayerByIds($ids)
{
return FolderLayer::WhereNotNull('parent_folder')->whereIn('parent_folder', $ids)->count();
} | [
"public function countLayers(): int {}",
"public function count()\n {\n return count($this->layers);\n }",
"public function getStLayerCount()\n {\n return $this->count(self::STLAYER);\n }",
"public function getFolderCounts() {\n $result = array();\n \n // Default folder counts\n $root = _wp_rml_root();\n $result[\"all\"] = $this->getCntAttachments();\n $result[$root] = $this->getCntRoot();\n \n // Iterate through our folders\n $folders = $this->getParsed();\n if (is_array($folders)) {\n foreach ($folders as $value) {\n $id = $value->getId();\n $result[$id] = $value->getCnt();\n }\n }\n return $result;\n }",
"public function getDirectoryCount(DirectoryInterface $directory): int;",
"public function getCountFolder($shop_id) {\n APP::import(\"Model\", array(\"FolderShop\"));\n $this->FolderShop = new FolderShop();\n $data = $this->FolderShop->find(\"count\", array(\n \"conditions\" => array(\n \"FolderShop.shop_id\" => $shop_id\n )\n ));\n return $data;\n }",
"public function getPathCount();",
"function num_subfolder_photos($name_value, $path)\n{\n\n\t$query=$GLOBALS['db']->$GLOBALS['query_statement'](\"SELECT id FROM \".PREFIX.\"photos\n\t\t\t\t\t\tWHERE name='\".linpha_addslashes($name_value).\"' AND prev_path='\".linpha_addslashes($path).\"'\");\n\t$num=$query->RecordCount();\n\techo $num;\n}",
"function myfiles_getFilesCount($folderid='0') {\r\n\tglobal $db, $db_pfs;\r\n\tif ($folderid=='' || $folderid=='-1') {\r\n\t\t$folderid='0';\r\n\t}\t\r\n\t$sql_files = $db->query(\"SELECT pfs_id FROM $db_pfs WHERE pfs_folderid='$folderid'\");\r\n\treturn $sql_files->rowCount();\r\n}",
"function intellidocs_get_subfolder_count($cat_id){\r\n\t$sub_folders = get_terms( 'document_folders', array('child_of' => 0 ,'hide_empty' => false,'parent' => $cat_id) );\r\n\treturn count($sub_folders);\r\n}",
"public function _countAllFolders()\n {\n\t\treturn $this->_getAllFolders()->count();\n\t}",
"function fann_get_num_layers($ann)\n{\n}",
"function getNumberOfFiles() {\n\t\tif(!empty($this->id)) {\n\t\t\tglobal $dbi;\n\n\t\t\t/* Initialize number of files */\n\t\t\t$numberOfFiles = 0;\n\t\t\t\n\t\t\t/* Get number of files in this folder */\n\t\t\t$result = $dbi->query(\"SELECT COUNT(*) FROM \".fileTableName.\" WHERE folderId=\".$this->id);\n\t\t\tif($result->rows()) {\n\t\t\t\tlist($numberOfFiles) = $result->fetchrow_array();\n\t\t\t}\n\t\t\t\n\t\t\t/* Get number of files for subdirectories */\n\t\t\t$result = $dbi->query(\"SELECT id FROM \".folderTableName.\" WHERE parentId=\".$this->id);\n\t\t\tif($result->rows()) {\n\t\t\t\tfor($i=0;(list($id)=$result->fetchrow_array());$i++) {\n\t\t\t\t\t$folder = new Folder($id);\n\t\t\t\t\t$numberOfFiles += $folder->getNumberOfFiles();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t/* Return number of files */\n\t\t\treturn $numberOfFiles;\n\t\t}\t\t\n\t\treturn 0;\n\t}",
"public function testTeamsIdImageFoldersNkChildrenCountGet()\n {\n\n }",
"public function testImageFoldersIdChildrenCountGet()\n {\n\n }",
"function getImagesCount($dir)\r\n{\r\n\tif(strpos($dir, '.zip'))\r\n\t{\r\n\t\t$zip = new ZipArchive; // php zip archieve instance\r\n\t\t$res = $zip->open($dir);\r\n\t\tif ($res === TRUE) {\r\n\t\t\r\n\t\t\t return $zip->numFiles;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn \"Zip file broken or empty!!\";\r\n\t\t}\t\t\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$count=count(glob($dir.\"/*\"));\r\n\t\treturn $count;\r\n\t}\r\n\r\n}",
"public function getAllWithImageCount();",
"public function get_layerCount(): int\n {\n // $res is a int;\n if ($this->_cacheExpiration == 0) {\n if ($this->load(YAPI::$_yapiContext->GetCacheValidity()) != YAPI::SUCCESS) {\n return self::LAYERCOUNT_INVALID;\n }\n }\n $res = $this->_layerCount;\n return $res;\n }",
"public abstract function getObjectsToImportCount();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create required columns Create the necessary columns for email access | public function create_columns() {
global $wpdb;
// Create columns in donors table.
$wpdb->query( "ALTER TABLE {$wpdb->donors} ADD `token` VARCHAR(255) CHARACTER SET utf8 NOT NULL, ADD `verify_key` VARCHAR(255) CHARACTER SET utf8 NOT NULL AFTER `token`, ADD `verify_throttle` DATETIME NOT NULL AFTER `verify_key`" );
} | [
"public function initialize_columns()\n {\n $this->add_column(new DataClassPropertyTableColumn(User::class_name(), User::PROPERTY_OFFICIAL_CODE));\n $this->add_column(new DataClassPropertyTableColumn(User::class_name(), User::PROPERTY_USERNAME));\n $this->add_column(new DataClassPropertyTableColumn(User::class_name(), User::PROPERTY_LASTNAME));\n $this->add_column(new DataClassPropertyTableColumn(User::class_name(), User::PROPERTY_FIRSTNAME));\n\n $showEmail = Configuration::getInstance()->get_setting(array('Chamilo\\Core\\User', 'show_email_addresses'));\n\n if($showEmail)\n {\n $this->add_column(new DataClassPropertyTableColumn(User::class_name(), User::PROPERTY_EMAIL));\n }\n\n $this->add_column(\n new DataClassPropertyTableColumn(\n CourseGroupUserRelation::class_name(), \n CourseGroupUserRelation::PROPERTY_SUBSCRIPTION_TIME));\n \n // $title = Translation :: get(self :: COURSE_GROUP_COLOMN, array(), Utilities :: COMMON_LIBRARIES);\n // // $this->add_column(\n // // new DataClassPropertyTableColumn(CourseGroup :: class_name(), CourseGroup :: PROPERTY_ID, $title, false));\n }",
"protected function _prepareColumns()\n {\n // id\n $this->addColumn('id', array(\n 'header' => Mage::helper('emvemt')->__('ID'),\n 'index' => 'id',\n 'type' => 'number',\n ));\n\n // Magento email template code\n $this->addColumn('template_code', array(\n 'header' => Mage::helper('emvemt')->__('Magento Template Name'),\n 'index' => 'template_code',\n 'type' => 'varchar',\n 'renderer' => 'emvemt/adminhtml_template_grid_renderer_mageTemplate',\n ));\n\n // Created at\n $this->addColumn('created_at', array(\n 'header' => Mage::helper('sales')->__('Created At'),\n 'type' => 'datetime',\n 'width' => '110',\n 'align' => 'center',\n 'index' => 'created_at',\n 'gmtoffset' => true\n ));\n\n // Update at\n $this->addColumn('updated_at', array(\n 'header' => Mage::helper('sales')->__('Updated At'),\n 'type' => 'datetime',\n 'width' => '110',\n 'align' => 'center',\n 'index' => 'updated_at',\n 'gmtoffset' => true\n ));\n\n // Created at\n $this->addColumn('account_name', array(\n 'header' => Mage::helper('emvemt')->__('SmartFocus Account'),\n 'type' => 'varchar',\n 'align' => 'center',\n 'index' => 'account_name',\n ));\n\n //list of all avaiable modes\n $this->addColumn('emv_send_mail_mode_id',\n array(\n 'header'=> Mage::helper('emvemt')->__('Sending Mode'),\n 'width' => '100px',\n 'index' => 'emv_send_mail_mode_id',\n 'type' => 'options',\n 'options' => Emv_Emt_Model_Mailmode::getMailModesAndLabels(),\n ));\n\n // SmartFocus Template Id And Name\n $this->addColumn('emv_template_id_and_name', array(\n 'header' => Mage::helper('emvemt')->__('SmartFocus Template Id And Name'),\n 'index' => 'emv_template_id_and_name',\n 'type' => 'varchar',\n 'filter' => false,\n 'renderer' => 'emvemt/adminhtml_template_grid_renderer_emvname',\n ));\n\n // Action column\n $this->addColumn('action', array(\n 'header' => Mage::helper('emvemt')->__('Action'),\n 'type' => 'action',\n 'width' => '100',\n 'getter' => 'getId',\n 'actions' => array(\n array(\n 'caption' => Mage::helper('emvemt')->__('Edit'),\n 'url' => array('base'=> '*/*/edit'),\n 'field' => 'id',\n )\n ),\n 'filter' => false,\n 'sortable' => false,\n 'is_system' => true,\n ));\n\n return parent::_prepareColumns();\n }",
"private function DbColumns(){\n\n $this->user_table_columns = explode(',', extras::USER_TB);\n $this->nazaac_property_registration_columns = explode(',', extras::NAZAC_PROPERTY_REGISTRATION_COLUMN);\n $this->property_type_table_columns = explode(',', extras::PROPERTY_TYPE_TABLE_COLUMNS);\n $this->property_listing_table_column = explode(',',extras::PROPERTY_LISTING_TABLE_COLUMN);\n $this->setup_table_column = explode(',',extras::SETUP_TABLE_COLUMN);\n $this->property_location_table_column = explode(',',extras::LOCATION_TABLE_COLUMN);\n $this->property_category_table_column = explode(',',extras::PROPERTY_CATEGORY_TABLE_COLUMN);\n $this->payment_mood_columns = explode(',',extras::PAYMENT_MOOD_TABLE_COLUMN);\n $this->booked_property_columns = explode(',',extras::BOOKED_PROPERTY_TABLE_COLUMNS);\n\n }",
"public function initialize_columns()\n {\n $this->addEntityColumns();\n\n if($this->getAssignmentServiceBridge()->canEditAssignment())\n {\n $this->add_column(new SortableStaticTableColumn(self::PROPERTY_FIRST_ENTRY_DATE));\n $this->add_column(new SortableStaticTableColumn(self::PROPERTY_LAST_ENTRY_DATE));\n $this->add_column(new SortableStaticTableColumn(self::PROPERTY_ENTRY_COUNT));\n $this->add_column(new StaticTableColumn(self::PROPERTY_FEEDBACK_COUNT));\n $this->add_column(new StaticTableColumn(self::PROPERTY_LAST_SCORE));\n }\n }",
"private function _generateColumns()\n\t\t{\n\t\t\tif( $this->dataSource )\n\t\t\t{\n\t\t\t\t$this->columns = new GridViewColumnCollection($this);\n\n\t\t\t\tforeach( $this->dataSource->fieldMeta as $field )\n\t\t\t\t{\n\t\t\t\t\tif( !$field->primaryKey )\n\t\t\t\t\t{\n\t\t\t\t\t\tif( $field->boolean )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->addColumn( new GridViewColumn( $field->name, ucwords( str_replace( '_', ' ', $field->name )), \"%{$field->name}%?'Yes':'No'\" ));\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif( $field->blob )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontinue;\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\t$this->addColumn( new GridViewColumn( $field->name, ucwords( str_replace( '_', ' ', $field->name ))));\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}",
"protected function _prepareColumns() {\n /**\n * Add colums\n *\n * 'customer_id' , 'name'\n * 'email_id','paypal_email','bank_details'\n */\n $this->addColumn ( 'customer_id', array (\n 'header' => Mage::helper ( 'airhotels' )->__ ( 'Host ID' ),'align' => 'left',\n 'index' => 'customer_id' \n ) );\n /**\n * Add new column for name\n */\n $this->addColumn ( 'name', array (\n 'header' => Mage::helper ( 'airhotels' )->__ ( 'Host Name' ), \n 'index' => 'name','align' => 'left'\n ) );\n /**\n * Add new column for email_id\n */\n $this->addColumn ( 'email_id', array (\n 'header' => Mage::helper ( 'airhotels' )->__ ( 'Host Email' ),'align' => 'left',\n 'index' => 'email_id' \n ) );\n /**\n * Add new column for paypal email\n * header - paypal email\n */\n $this->addColumn ( 'paypal_email', array (\n 'header' => Mage::helper ( 'airhotels' )->__ ( 'Paypal Email' ),'align' => 'left',\n 'index' => 'paypal_email' \n ) );\n /**\n * Add new column for bank_details\n */\n $this->addColumn ( 'bank_details', array (\n 'header' => Mage::helper ( 'airhotels' )->__ ( 'Payout Details' ), \n 'renderer' => 'Apptha_Airhotels_Block_Adminhtml_Renderer_Hostpayoutdetail',\n 'align' => 'left','index' => 'bank_details'\n ) );\n /**\n * Calling the parent Construct Method.\n */\n return parent::_prepareColumns ();\n }",
"public function initialize_columns()\n {\n $this->add_column(new DataClassPropertyTableColumn(User::class_name(), User::PROPERTY_LASTNAME));\n $this->add_column(new DataClassPropertyTableColumn(User::class_name(), User::PROPERTY_FIRSTNAME));\n $this->add_column(new DataClassPropertyTableColumn(User::class_name(), User::PROPERTY_EMAIL));\n $this->add_column(new SortableStaticTableColumn('progress'));\n $this->add_column(new SortableStaticTableColumn('completed'));\n $this->add_column(new SortableStaticTableColumn('started'));\n }",
"protected function generateColumns()\n\t{\n\t\tforeach ($this->dataSource->getColumns() as $name) {\n\t\t\t$this->addColumn($name);\n\t\t}\n\t}",
"public function createColumns()\n {\n foreach ($this->getSchema() as $column => $type) {\n $tableColumns = $this->db->schema->getTableSchema($this->getTableName(), true);\n if (!$tableColumns->getColumn($column)) {\n $this->db->createCommand()->addColumn($this->getTableName(), $column, $type)->execute();\n }\n }\n }",
"function prepareColumns() {\n\t\t\t$this->columns[] = array(\"name\" => \"SessionName\", \"type\" => DB_COLUMN_STRING, \"key\" => true);\n\t\t\t$this->columns[] = array(\"name\" => \"RemoteAddr\", \"type\" => DB_COLUMN_STRING, \"key\" => true);\n\t\t\t$this->columns[] = array(\"name\" => \"SessionTime\", \"type\" => DB_COLUMN_STRING, \"dtype\"=>\"string\", \"length\"=>100 );\n\t\t\t$this->columns[] = array(\"name\" => \"SessionData\", \"type\" => DB_COLUMN_STRING, \"dtype\"=>\"string\", \"length\"=>1000);\n\t\t}",
"public function get_columns() {\n\n\t $columns = array(\n\t \t'cb' => '<input type=\"checkbox\" />',\n\t 'user_email_id' => __( 'User Email Address' , 'woocommerce-ac' ),\n 'sent_time' => __( 'Email Sent Time' , 'woocommerce-ac' ),\n\t 'date_time_opened' => __( 'Date / Time Email Opened', 'woocommerce-ac' ),\n\t\t\t'link_clicked' \t=> __( 'Link Clicked' , 'woocommerce-ac' ),\n 'template_name' => __( 'Sent Email Template' , 'woocommerce-ac'),\n\t );\n\t\treturn apply_filters( 'wcap_sent_emails_columns', $columns );\n\t}",
"public function initialize_columns()\n {\n $this->add_column(new DataClassPropertyTableColumn(User::class, User::PROPERTY_FIRSTNAME));\n $this->add_column(new DataClassPropertyTableColumn(User::class, User::PROPERTY_LASTNAME));\n\n $this->add_column(\n new DataClassPropertyTableColumn(ExternalToolResult::class, ExternalToolResult::PROPERTY_RESULT)\n );\n }",
"public function initialize_columns()\n {\n $this->add_column(new DataClassPropertyTableColumn(Element::class_name(), Element::PROPERTY_TYPE));\n $this->add_column(new DataClassPropertyTableColumn(Element::class_name(), Element::PROPERTY_NAME));\n $this->add_column(new DataClassPropertyTableColumn(Element::class_name(), Element::PROPERTY_REQUIRED));\n }",
"abstract protected function buildAddColumns();",
"public function initialize_columns()\n {\n $this->add_column(new StaticTableColumn(self::PROPERTY_SOURCE));\n $this->add_column(new StaticTableColumn(self::PROPERTY_RELATION));\n $this->add_column(new StaticTableColumn(self::PROPERTY_TARGET));\n }",
"protected function additionalCreateFields() {\r\n $columns = [];\r\n\r\n foreach($this->additionalFields as $fieldName => $validation) {\r\n if(isset($validation['create']) && $validation['create']) {\r\n $columns[] = $fieldName;\r\n }\r\n }\r\n\r\n return $columns;\r\n }",
"protected function createAdminColumns ()\n {\n\n //Adds Column labels. Can be enabled/disabled using screen options.\n add_filter('manage_' . $this->uglify($this->postType) . '_posts_columns', function () {\n\n $additionalLabels = [];\n foreach($this->additionalFields as $name => $label) {\n if($name != 'first_name' && $name != 'last_name' && $name != 'full_name') {\n $additionalLabels[$name] = $label;\n }\n }\n\n $defaults = array_merge(\n [\n 'title' => 'Name',\n 'email_address' => 'Email',\n 'phone_number' => 'Phone Number',\n ], $additionalLabels\n );\n\n $defaults['date'] = 'Date Posted'; //always last\n\n return $defaults;\n }, 0);\n\n //Assigns values to columns\n add_action('manage_' . $this->uglify($this->postType) . '_posts_custom_column', function ($column_name, $post_ID) {\n if($column_name != 'title' && $column_name != 'date'){\n switch ($column_name) {\n case 'email_address':\n $email_address = get_post_meta($post_ID, 'lead_info_email_address', true);\n echo(isset($email_address) ? '<a href=\"mailto:' . $email_address . '\" >' . $email_address . '</a>' : null);\n break;\n case 'phone_number':\n $phone_number = get_post_meta($post_ID, 'lead_info_phone_number', true);\n echo(isset($phone_number) ? '<a href=\"tel:' . $phone_number . '\" >' . $phone_number . '</a>' : null);\n break;\n default:\n echo get_post_meta($post_ID, 'lead_info_' . $column_name, true);\n }\n }\n }, 0, 2);\n }",
"protected function assign_report_columns()\n {\n }",
"protected function addColumns()\r\n {\r\n $content = '';\r\n\r\n foreach( $this->model->getProperties() as $field => $type ) {\r\n\r\n if(!$this->tableHasColumn($field)) {\r\n $this->columnsChanged = true;\r\n $rule = \"\\t\\t\\t\";\r\n\r\n // Primary key check\r\n if ( $field === 'id' and $type === 'integer' )\r\n $rule .= $this->increment();\r\n else {\r\n $rule .= $this->setColumn($this->model->validTypes[$type], $field);\r\n\r\n if ( !empty($setting) )\r\n $rule .= $this->addColumnOption($setting);\r\n }\r\n\r\n array_push($this->columnsAdded, $field);\r\n\r\n $content .= $rule . \";\\n\";\r\n }\r\n }\r\n\r\n return $content;\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets an associative array of data that can be accessed in notification fields and templates | public function getNotificationTemplateData(); | [
"public function getNotificationTemplateData(){\n\t\treturn array();\n\t}",
"public function getNotificationTemplateData()\n {\n $fields = $this->Context->getValues();\n if (!is_array($fields)) {\n $fields = [];\n }\n $fields['Content'] = $this->Content;\n return $fields;\n }",
"public function getData() {\n $result = array();\n foreach ($this->log_entry_fields as $field) {\n $result[$field] = $this->$field;\n }\n return $result;\n }",
"public function getPushData()\n {\n return array(\n 'notification_id' => $this->id,\n 'object_id' => $this->getObjectID(),\n 'type' => $this->getType()\n );\n }",
"public function getMessageData()\n {\n return array();\n }",
"public function getNotificationVars()\n {\n $vars = [\n 'name' => $this->name,\n 'email' => $this->email,\n 'username' => $this->username,\n 'login' => $this->getLogin(),\n 'password' => $this->getOriginalHashValue('password')\n ];\n\n /*\n * Extensibility\n */\n $result = Event::fire('rainlab.user.getNotificationVars', [$this]);\n if ($result && is_array($result)) {\n $vars = call_user_func_array('array_merge', $result) + $vars;\n }\n\n return $vars;\n }",
"public function getMessageData() {\n\t\treturn array(\n\t\t\t'Widget' => $this->name,\n\t\t\t'Parameters' => $this->paramString,\n\t\t);\n\t}",
"public function getNotificationDetailsArray()\n {\n return $this->notificationDetailsArray;\n }",
"public function get_event_data()\n\t{\n\t\t$copy = array();\n\t\t$copy= $this->m_data;\n\t\t\n\t\treturn $copy;\n\t}",
"public static function MessagesData()\n {\n $return = array();\n if(MessageCollection::hasMessages())\n {\n foreach(MessageCollection::Messages() as $message)\n {\n $return[] = $message->GET();\n }\n }\n return $return;\n\n }",
"public function getData()\n {\n return (object) array(\n 'name' => $this->getName(),\n 'startTime' => $this->microtimeToDateFormat($this->startTime, 'H:i:s'),\n 'endTime' => $this->microtimeToDateFormat($this->endTime, 'H:i:s'),\n 'rawStartTime' => number_format($this->startTime, 3, '.', ''),\n 'rawEndTime' => number_format($this->endTime, 3, '.', ''),\n 'duration' => $this->getDuration(),\n 'messages' => $this->messages->getData(),\n 'profiles' => $this->profiles->getData()\n );\n }",
"public function field_data()\n {\n return array();\n }",
"final public function PageViewGetData() {\n\t\t//--\n\t\treturn (array) [\n\t\t\t'heads' \t=> (array) $this->PageViewGetRawHeaders(),\n\t\t\t'cfgs' \t\t=> (array) $this->PageViewGetCfgs(),\n\t\t\t'vars' \t\t=> (array) $this->PageViewGetVars()\n\t\t];\n\t\t//--\n\t}",
"public function getData()\n\t\t\t{\n\n\t\t\t\t$data = array(\n\t\t\t\t\t'id' => $this->getId(),\n\t\t\t\t\t'class' => 'onp-sl-rateus-popup factory-fontawesome-000',\n\t\t\t\t\t'position' => 'popup',\n\t\t\t\t\t'layout' => 'custom',\n\t\t\t\t\t'close' => 'quick-hide',\n\t\t\t\t\t'message' => $this->getMessage(),\n\t\t\t\t\t'where' => array('plugins', 'dashboard', 'edit')\n\t\t\t\t);\n\n\t\t\t\treturn $data;\n\t\t\t}",
"public function field_data()\r\n {\r\n return array();\r\n }",
"function serialize_fields() {\n return notifications_array_serialize($this->get_conditions());\n }",
"private function getData()\n\t{\n\t\t$data = array();\n\t\tif($this->_getSanitizedParam(\"log_usuario\") == '' ) {\n\t\t\t$data['log_usuario'] = $_SESSION['kt_login_user'];\n\t\t} else {\n\t\t\t$data['log_usuario'] = $this->_getSanitizedParam(\"log_usuario\");\n\t\t}\n\t\t$data['log_tipo'] = $this->_getSanitizedParam(\"log_tipo\");\n\t\t$data['log_fecha'] = $this->_getSanitizedParam(\"log_fecha\");\n\t\t$data['log_log'] = $this->_getSanitizedParam(\"log_log\");\n\t\t$data['log_fecha'] = date(\"Y-m-d H:i:s\");\n\t\treturn $data;\n\t}",
"public function getData() {\n\t\t$data = array();\n\t\t$this->loadValues(\"signature/data\", $data);\n\t\t$this->loadValues(\"collection/data\", $data);\n\t\treturn $data;\n\t}",
"public function getAdditionalData(): array\n {\n return $this->data;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Hier is deze functie nodig omdat $species protected is en dus in de applicatie niet zonder een returnfunctie kan worden opgeroepen | public function getSpecies() {
return $this->species;
} | [
"public function getSpecies()\n {\n return $this->species;\n }",
"public function withSpecies(...$species): void;",
"public function getSpecies()\n {\n return $this->data['species'];\n }",
"public function setSpecies($species) { \n $this->species = $species;\n }",
"public function species()\n {\n return $this->allTaxa()->species();\n }",
"public function findFact(string $species){\n foreach($this->animalsArray as $key => $animal) {\n if ($animal['species'] === $species) {\n $output = array_slice($this->animalsArray, $key,1);\n return $output;\n }\n }\n return false;\n }",
"function findspeciesbyname($fgenus, $fspecies) {\r\n $speciesfilename = \"\";\r\n\r\n $specfiles = speciesfilelist();\r\n\r\n $i = 0;\r\n $found = false;\r\n\r\n while ($i < count($specfiles) - 1 && !$found) {\r\n\r\n $fil = $specfiles [$i];\r\n $spdata = parsedatafile($fil);\r\n $genus = $spdata [\"genus\"];\r\n $species = $spdata [\"species\"];\r\n\r\n if ($genus == $fgenus && $species == $fspecies) {\r\n $speciesfilename = $fil;\r\n $found = true;\r\n }\r\n\r\n $i ++;\r\n }\r\n\r\n return $speciesfilename;\r\n}",
"public function getSpeciesCode(): string {\n\t\treturn $this->speciesCode;\n\t}",
"function tpps_accession_valid_species($row, array &$options) {\n $id_name = $options['id_col'];\n $species_options = $options['species_options'];\n $species_columns = $options['species_cols'];\n $species_type = $species_columns['#type'];\n $org_num = $options['org_num'];\n $organisms = $options['page_1_species'];\n\n if (!empty($row[$id_name])) {\n $valid_row = FALSE;\n\n if ($species_type == 'separate') {\n $species = array();\n foreach ($species_options[$species_type] as $column) {\n $species[] = $row[$species_columns[$column]];\n }\n $species = implode(' ', $species);\n }\n else {\n $species = $row[$species_columns[current($species_options[$species_type])]];\n }\n\n for ($i = 1; $i <= $organisms['number']; $i++) {\n if ($species == $organisms[$i]['name']) {\n $valid_row = TRUE;\n break;\n }\n }\n\n if (!$valid_row) {\n form_set_error(\"tree-accession-species-$org_num-file-{$row[$id_name]}\", \"Plant Accession file: Some species information is invalid for plant \\\"{$row[$id_name]}\\\". The species name, \\\"$species\\\", does not match any species name supplied on the Author and Species information page. Please correct the file or add the correct species name.\");\n }\n }\n}",
"function get_pets_by_species($species) {\n $filtered_pets = array();\n foreach ($this->pets as $pet) {\n if ($pet->animal == $species) {\n array_push($filtered_pets, $pet);\n }\n }\n return $filtered_pets;\n }",
"function flavorCatcher(array $species)\n{\n $flavor_en = [];\n foreach ($species[\"flavor_text_entries\"] AS $flavor_text) {\n if ($flavor_text[\"language\"][\"name\"] === \"en\") {\n $flavor_en[] = $flavor_text[\"flavor_text\"];\n }\n }\n return $flavor_en;\n}",
"public function species() {\n return view('speciesListing', ['species' => Species::getAll()]);\n }",
"public function getSpeciesName() : string\n {\n return $this->species->getName();\n }",
"public function getSpeciesFromTitle() {\n\t\treturn self::speciesFromTitle($this->getTitleObject());\n\t}",
"public function getAllAnimalSpeciesData()\n {\n $sql = \"SELECT animals.id, animals.name, animals.description, animals.sex, animals.image, species.name as species_name FROM `animals`, `species` WHERE animals.species_id = species.id ORDER BY animals.name ASC\";\n $query = $this->db->query($sql);\n return $query->result();\n }",
"public static function getSpeciesNames(){\n return self::distinct('species_name')->pluck('species_name');\n }",
"public function speciesNames(){\n $allSpecies = $this->getSpecies();\n $species = [];\n if($allSpecies->results){\n $species = collect($allSpecies->results)->pluck('name')->toArray();\n }\n return $species;\n }",
"public function findAllSpecies()\n {\n $queryBuilder = $this->createQueryBuilder('species');\n $query = $queryBuilder->getQuery();\n $results = $query->getScalarResult();\n return $results;\n }",
"function check_scientificname($species, $genus){\t\n\t\t\n\t\t$this->db->select('species, genus');\n\t\t/*join the taxonomy related tables*/\n\t\t$this->db->from('species');\n\t\t$this->db->where('species',$species);\n\t\t$this->db->where('genus',$genus);\n\t\t$this->db->join('genus','species.genus_genus_id = genus.genus_id' );\n\t\t\n\t\t//$query_str = \"SELECT species FROM species WHERE species = ?\";\n\t\t\n\t\t/*trying to use active records*/\n\n\t\t// $this->db->from('species');\n\t\t\n\t\t$query = $this->db->get();\n\t\t\n\t\tif($query->num_rows() > 0){\n\t\t\t\n\t\t\t//scientific name exist\n\t\t\treturn true;\n\t\t}else{\n\t\t\t//scientific name do not exist\n\t\t\treturn false;\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set Posts of Site | public function setPosts($posts)
{
$this->posts = $posts;
} | [
"private function setPostsSettings()\n {\n $this->posts = isset($this->config->Registers->CustomPosts)\n ? (array) $this->config->Registers->CustomPosts\n : [];\n }",
"public function updatePosts();",
"public function setPosts()\n {\n global $Database;\n \n if($this->data == null) {\n return array();\n }\n \n $posts = json_decode($this->data[\"posts\"]);\n $p = array();\n \n foreach($posts as $postID) {\n if(is_numeric($postID)) {\n $post = $Database->get(\"posts\", \"*\", [\n \"postID\" => $postID\n ]\n );\n \n if(is_array($post)) {\n $p[] = $post;\n }\n } else if(is_string($postID)) {\n $post = $Database->get(\"posts\", \"*\", [\n \"permalink\" => $postID\n ]\n );\n \n if(count($post) == 1) {\n $p[] = $post;\n }\n }\n }\n \n //To get the posts ordered by date\n $this->posts = array_reverse($p);\n }",
"protected function set_up_posts() {\n\t\t\t$hello_world_post = get_page_by_path( 'hello-world', OBJECT, 'post' );\n\n\t\t\tif ( $hello_world_post ) {\n\t\t\t\twp_update_post( array(\n\t\t\t\t\t'ID' => $hello_world_post->ID,\n\t\t\t\t\t'post_status' => 'draft',\n\t\t\t\t) );\n\t\t\t}\n\t\t}",
"abstract public function savePosts();",
"public function setPosts(?array $value): void {\n $this->getBackingStore()->set('posts', $value);\n }",
"protected function addPosts(){\n foreach( $this->post_names as $key => $name ){\n $this->click(\"link=Add New\");\n $this->waitForPageToLoad(\"30000\");\n $this->type(\"id=title\", $name['title']);\n // $this->addFeaturedImage($this->images[$key]);\n $this->click(\"id=publish\");\n $this->waitForPageToLoad(\"30000\"); \n }\n \n }",
"public function set_post($post)\n {\n $this->post = $post;\n }",
"public function __construct(Posts $posts){\n $this->posts = $posts;\n }",
"private function set_post_attrib()\n {\n \t$this->post_data = array(\n \t\t'post_title' => \"\",\n \t\t'post_content' => \"\",\n \t\t'post_type' => PRVT_POST_TYPE,\n \t\t'post_status' => 'publish',\n \t\t'post_parent' => $this->parent_id,\n \t);\n\n }",
"public function setPosts ($newPost = []) {\n //Only set target URL if the argument require so\n $this->_PostVars = $newPost;\n\n //Always return object, allowing concatenation of methods\n return $this;\n }",
"public function testWPQueryPostDataSetup() {\n\t\t$sites = ep_get_sites();\n\n\t\t$old_blog_id = get_current_blog_id();\n\n\t\tforeach ( $sites as $site ) {\n\t\t\tswitch_to_blog( $site['blog_id'] );\n\n\t\t\tep_create_and_sync_post( array( 'post_content' => 'findme' ) );\n\t\t\tep_create_and_sync_post();\n\t\t\tep_create_and_sync_post( array( 'post_content' => 'findme' ) );\n\n\t\t\tep_refresh_index();\n\n\t\t\trestore_current_blog();\n\t\t}\n\n\t\t$args = array(\n\t\t\t's' => 'findme',\n\t\t\t'sites' => 'all',\n\t\t);\n\n\t\t$query = new WP_Query( $args );\n\n\t\twhile ( $query->have_posts() ) {\n\t\t\t$query->the_post();\n\n\t\t\tglobal $post;\n\n\t\t\t$wp_post = get_post( get_the_ID() );\n\n\t\t\t$this->assertEquals( get_current_blog_id(), $post->site_id );\n\t\t\t$this->assertEquals( get_permalink( get_the_ID() ), get_permalink() );\n\t\t\t$this->assertEquals( get_edit_post_link( get_the_ID() ), get_edit_post_link() );\n\t\t\t$this->assertEquals( get_the_date( '', get_the_ID() ), get_the_date() );\n\t\t\t$this->assertEquals( get_the_date( '', get_the_ID() ), get_the_date() );\n\t\t\t$this->assertEquals( get_the_time( '', get_the_ID() ), get_the_time() );\n\t\t}\n\n\t\twp_reset_postdata();\n\n\t\t$this->assertEquals( get_current_blog_id(), $old_blog_id );\n\t}",
"function setValuesByPost()\n\t{\n\t foreach($this->items as $item)\n\t\t{\n\t\t\t$item->setValueByArray($_POST);\n\t\t}\n\t}",
"public function set_object_on_each_loop_post() {\n\t\t\tif ( jet_engine()->listings ) {\n\t\t\t\tglobal $post;\n\t\t\t\tjet_engine()->listings->data->set_current_object( $post );\n\t\t\t}\n\t\t}",
"private function transfer_posts() {\r\n\t\t$res = mysql_query(\"SELECT * FROM `posts` WHERE 1\", $this->sql);\r\n\t\twhile ($row = mysql_fetch_array($res)) {\r\n\t\t\t$row = $this->toText($row);\r\n\t\t\t$data = array(\r\n\t\t\t\t'Post' => array(\r\n\t\t\t\t\t'content_en' => $row['content_en'],\r\n\t\t\t\t\t'content_fr' => $row['content_fr'],\r\n\t\t\t\t\t'meta_description_en' => $row['meta_description_en'],\r\n\t\t\t\t\t'meta_description_fr' => $row['meta_description_fr'],\r\n\t\t\t\t\t'meta_keywords_en' => $row['meta_keywords_en'],\r\n\t\t\t\t\t'meta_keywords_fr' => $row['meta_keywords_fr'],\r\n\t\t\t\t\t'meta_name_en' => $row['meta_title_en'],\r\n\t\t\t\t\t'meta_name_fr' => $row['meta_title_fr'],\r\n\t\t\t\t\t'post_date' => $row['post_date'],\r\n\t\t\t\t\t'published' => $row['published'],\r\n\t\t\t\t\t'name_en' => $row['title_en'],\r\n\t\t\t\t\t'name_fr' => $row['title_fr'],\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\t$this->Post->create();\r\n\t\t\t$this->Post->save($data, false);\r\n\t\t\t$this->posts[$row['post_id']] = $this->Post->getLastInsertID();\r\n\t\t}\r\n\r\n\t\tforeach ($this->posts as $old_id => $new_id) {\r\n\t\t\tif (empty($this->blog_cats)) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t$res = mysql_query('SELECT * FROM `post_category_xref` WHERE `post_id`='. $old_id . ' ', $this->sql);\r\n\t\t\twhile ($row = mysql_fetch_array($res)) {\r\n\t\t\t\t$data = array(\r\n\t\t\t\t\t'Post' => array(\r\n\t\t\t\t\t\t'id' => $new_id,\r\n\t\t\t\t\t\t'blog_category_id' => $this->blog_cats[$row['category_id']]\r\n\t\t\t\t\t)\r\n\t\t\t\t);\r\n\t\t\t\t$this->Post->saveAll($data);\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public function getSampleWebsitesPosts();",
"function load_posts() {\n\n\t\t$post_args = array( 'post_type' => array('piwaka') );\n\t\t$posts = get_posts( $post_args );\n\n\t\t$this->posts = $posts;\n\t}",
"public function load_posts() : void {\n\t\t// Get from cache.\n\t\tif ($this->get_posts_from_cache()) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!$this->posts_dir) {\n\t\t\tthrow new Exception('Posts_dir must be set before calling load_posts()');\n\t\t}\n\n\t\t$this->posts = [];\n\t\tforeach (glob($this->posts_dir . '/*' . $this->post_extension) as $key => $path) {\n\t\t\t$object = $this->prepare_post($path);\n\t\t\tif (!$object) {\n\t\t\t\t// Not published.\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$this->posts[basename($path)] = $object;\n\t\t}\n\n\t\t$this->count_posts = count($this->posts);\n\n\t\t// Save to cache.\n\t\t$this->save_cache();\n\t}",
"public function addPostToBlogInTheMiddle() {}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a matcher which does NOT matches. | public function logicalNot(AbstractMatcher $matcher); | [
"public static function logicalNot(Matcher $matcher)\n {\n return new Matcher\\LogicalNot($matcher);\n }",
"public function isNot($expression);",
"public static function isFalse()\n {\n return new Matcher\\IsFalse();\n }",
"public function not(): OppositeExpectation\n {\n return new OppositeExpectation($this);\n }",
"public function notSpecification(): NotSpecification\n {\n return new NotSpecification($this);\n }",
"public function createNot()\n {\n $o = new NotSelector();\n $this->appendSelector($o);\n\n return $o;\n }",
"public function not()\n {\n return new Not($this);\n }",
"public static function buildNot(Criterion $criterion)\n {\n return new LogicalNot($criterion);\n }",
"public function not(): Specification;",
"public function testNotLike()\n {\n $exp = Expression::notLike('city', '%York%');\n $this->assertSame(Operator::NotLike(), $exp->getOperator());\n \n $this->assertFalse($exp->evaluate(array('city'=>'New York')));\n $this->assertFalse($exp->evaluate(array('city'=>'York')));\n $this->assertFalse($exp->evaluate(array('city'=>'Yorkshire')));\n $this->assertTrue($exp->evaluate(array('city'=>'Baltimore')));\n \n $exp = Expression::notLike('city', 'York%');\n \n $this->assertTrue($exp->evaluate(array('city'=>'New York')));\n $this->assertFalse($exp->evaluate(array('city'=>'York')));\n $this->assertFalse($exp->evaluate(array('city'=>'Yorkshire')));\n $this->assertTrue($exp->evaluate(array('city'=>'Baltimore')));\n \n $exp = Expression::notLike('city', '%York');\n \n $this->assertFalse($exp->evaluate(array('city'=>'New York')));\n $this->assertFalse($exp->evaluate(array('city'=>'York')));\n $this->assertTrue($exp->evaluate(array('city'=>'Yorkshire')));\n $this->assertTrue($exp->evaluate(array('city'=>'Baltimore')));\n }",
"public function not(){\n\t\t$this->queryString .= self::NOT;\n\t\treturn $this;\n\t}",
"public function visitNotEquals(NotEqualsExpression $expr);",
"public function negate()\n {\n return new NegatePredicate($this);\n }",
"public function _not() {\n \n if(!$this->isReady()) {\n $this->error(\"bad _not(), object not ready.\");\n return $this;\n }\n\n if(!is_array($this->whereExpr)) {\n $this->whereExpr = array();\n }\n \n /* start a new expression that is negated... */\n \n array_unshift($this->whereExpr, (object)array(\n 'type' => 'not',\n 'lhs' => '',\n 'op' => strtoupper('not'),\n 'rhs' => null,\n 'unary' => true\n ));\n \n /* all done */\n \n return $this;\n \n }",
"public function testParseNotExpr()\n\t{\n\t\t$this->parser->search = ['number' => '!xxx'];\n\t\t$check = $this->parser->parse();\n\t\t$assume = [];\n\t\t$assume['number'] = Func::notEqual('xxx');\n\t\treturn $this->assume(__FUNCTION__, $check, $assume, false);\n\t}",
"public function not(): HigherOrderExpectation\n {\n $this->opposite = !$this->opposite;\n\n return $this;\n }",
"public function whereNotEq()\n {\n \n list($field, $value) = $this->extractQueryToFieldAndValue(func_get_args());\n $this->_conditions[self::WHERENOT][$field] = [self::OPERATORS['ne'] => $value];\n return $this;\n }",
"public function testNotEqualTo()\n {\n test_number_let('__number__')->be(7);\n $predicate = test_number_numberx('__number__')->notEqualTo(8);\n $this->assertTrue($predicate->evaluate(), \"Failed to assert that notEqualTo returns true when the operand is not equal to the constraint.\");\n\n // We test that given 10, equalTo agrees that it is not equal to 10\n test_number_let('__number__')->be(10);\n $predicate = test_number_numberx('__number__')->notEqualTo(10);\n $this->assertFalse($predicate->evaluate(), \"Failed to assert that notEqualTo returns false when the constraint is equal to the operand.\");\n }",
"public function testNotEvaluatorReturnsFalseWhenConditionEvaluatesTrue()\n {\n $this->assertFalse(\n $this->conditionTreeEvaluator->evaluate(\n ['not', $this->conditionA],\n $this->getLeafEvaluator(true)\n )\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the nb h travail. | public function getNbHTravail() {
return $this->nbHTravail;
} | [
"public function getNbHTravail(): ?float {\n return $this->nbHTravail;\n }",
"public function getNumLotTraite(): ?int {\n return $this->numLotTraite;\n }",
"public function getNbHeureTrav() {\n return $this->nbHeureTrav;\n }",
"public function getNb()\n {\n return $this->nb;\n }",
"public function getNb_elec_hs()\n {\n return $this->nb_elec_hs;\n }",
"public function get_nb_eleve()\n {\n return $this->nb_eleve;\n }",
"function getNumberRow(){\r\n\t\t//will be used to set the number of rows the header will span\r\n\t\t$minWeight=getMinWeight();\r\n\t\t$maxWeight=getMaxWeight();\r\n\t\t$rows=2+(($maxWeight-$minWeight)/5);\r\n\t\treturn $rows;\r\n\t}",
"public function numeroNivelesHijos() {\n //$ids = implode(\",\", $param);\n $sql = \"select max(level) level from mos_arbol_procesos \";\n $data = $this->dbl->query($sql);\n \n if (count($data)>0){\n $num = $data[0][level] - 1;\n }\n return $num; \n }",
"public function getNbJh() {\n return $this->nbJh;\n }",
"public function getNbHeurePaye() {\n return $this->nbHeurePaye;\n }",
"public function getNbCertifTravailFact() {\n return $this->nbCertifTravailFact;\n }",
"public function getN()\n {\n return $this->n;\n }",
"public function getNbHBase(): ?float {\n return $this->nbHBase;\n }",
"public function getNbCertifTravailFact(): ?int {\n return $this->nbCertifTravailFact;\n }",
"public function getNbHConduite() {\n return $this->nbHConduite;\n }",
"public function getNbHeureSal() {\n return $this->nbHeureSal;\n }",
"public function getNPage(): int\n {\n return $this->nPage ;\n }",
"public function getReceiptNumTeeth() {\n $retVal = '';\n if (isset($this->rReceipt)) {\n $retVal = $this->rReceipt->getNumTeeth() . '';\n }\n if (!empty($retVal)) {\n return $retVal;\n }\n return '1';\n }",
"public function getTotal_ht()\n {\n return $this->total_ht;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Loop on json files and store in database. | public function store()
{
global $DbInsertions;
$this->log->debug(_('Chargement des fichiers json de ') . $this->table);
// Loop on dowloaded files
for ($fic = $this->fileMin; $fic < $this->fileMax; $fic++) {
if (file_exists(getenv('HOME') . '/' . $this->fileStore . '/' . $this->table . '_' . $fic . '.json')) {
$this->log->info(_('Lecture du fichier ') . getenv('HOME') . '/' . $this->fileStore . '/' . $this->table . '_' . $fic . '.json');
// Read stored json file
$response = file_get_contents(getenv('HOME') . '/' . $this->fileStore . '/' . $this->table . '_' . $fic . '.json');
// Correct missing comment value (incorrect character)
$response = str_replace('"comment": ,',
'"comment": "!!!Commentaire supprimé car caractère incorrect",',
$response, $pbCar);
if ($pbCar > 0) {
$this->log->warn(_('Commentaire incorrect supprimés: ') . $pbCar);
}
// Create insertion counter (for debug)
$DbInsertions[$this->table . '_' . $fic . '.json'] = new DbInsertCounter();
// Parse JSON file
$this->parser->parse($response, $DbInsertions[$this->table . '_' . $fic . '.json']);
}
}
} | [
"function importJSON() {\n $this->parseJSONFile();\n $this->getDBNames();\n\n // Prompt for database overwrite\n if (! $this->climate->arguments->defined('quiet')) {\n if (FALSE !== in_array($this->dbName, $this->dbNames)) {\n if (! $this->climate->arguments->defined('skip_create')) {\n $input = $this->climate->confirm(\"Database \" . $this->dbName . \" exists. Use --skip_create option to preserve database. Overwrite (destroy) existing?\");\n if (!$input->confirmed()) {\n exit();\n }\n }\n }\n }\n\n $this->connectToDB();\n\n // Create (drop any existing) database definition\n if (! $this->climate->arguments->defined('skip_create')) {\n $sql = \"DROP DATABASE IF EXISTS `\" . $this->dbName . \"`;\\n\";\n if ($this->db->query($sql) !== TRUE) {\n echo \"Error, dropping database: \" . $this->db->error;\n exit();\n }\n $create = $this->jsonDB['create'];\n \n if ($this->jsonDB['name'] != $this->dbName) {\n $create = str_replace($this->jsonDB['name'], $this->dbName, $create);\n }\n $sql = $create . \";\\n\";\n if ($this->db->query($sql) !== TRUE) {\n echo \"Error, creating database: \" . $this->db->error;\n exit();\n } \n }\n\n // Always use specified database\n $sql = \"USE `\" . $this->dbName . \"`;\\n\";\n if ($this->db->query($sql) !== TRUE) {\n echo \"Error, using database: \" . $this->db->error;\n exit();\n } \n\n // Create tables and import data\n foreach($this->jsonDB['tables'] as $table) {\n\n // Check for implicit tables or default to all\n $bSkip = false;\n if ($this->climate->arguments->defined('tables')) {\n $t = ',' . $this->climate->arguments->get('tables') . ',';\n if (FALSE === strpos($t, \",\" . $table['name'] . \",\")) {\n $bSkip = true;\n }\n }\n if (FALSE === $bSkip) {\n $sql = $table['create'];\n\n // Strict mode compatibility \n $sql = str_replace(\"NOT NULL DEFAULT '0000-00-00 00:00:00'\",\"NOT NULL DEFAULT '1000-01-01 00:00:00'\", $sql);\n \n if ($this->db->query($sql) !== TRUE) {\n echo \"Error, creating table: \" . $this->db->error;\n exit();\n }\n \n // Import data\n $last = round(microtime(true) * 1000);\n $spin = 0;\n foreach($table['data'] as $row) {\n $sql = \"INSERT INTO \" . $table['name'] . \" (\";\n $vals = \"(\";\n foreach($table['columns'] as $col) {\n $sql = $sql . $col['name'] . ',';\n $v = $row[$col['name']];\n if (NULL !== $v) {\n if ($col['json_type'] === 'string' || $col['json_type'] === 'object') {\n if ($col['json_type'] === 'string' || gettype($v) == 'string') {\n $vals = $vals . '\"' . mysqli_real_escape_string($this->db, $v) . '\",';\n }else{\n $vals = $vals . '\"' . mysqli_real_escape_string($this->db, $this->restore_references(serialize($v))) . '\",';\n }\n }else{\n if ($col['json_type'] === 'number') {\n $vals = $vals . strval($v) . ',';\n }else{\n if ($v) { // Boolean\n $vals = $vals . 'true' . ',';\n }else{\n $vals = $vals . 'false' . ',';\n }\n }\n }\n }else{\n $vals = $vals . 'NULL' . ',';\n }\n }\n\n $sql = new GString($sql);\n $sql = $sql->delRightMost(\",\")->concat(\") VALUES \" . $vals);\n $sql = $sql->delRightMost(\",\")->concat(\");\\n\");\n if ($this->db->query($sql) !== TRUE) {\n echo \"Error, insert into table: \" . $table['name'] . \"\\n\";\n echo $sql . \"\\n\";\n var_dump($this->db);\n exit();\n }\n if (! $this->climate->arguments->defined('quiet')) {\n \n // Spin the cursor\n if ((round(microtime(true) * 1000) - 100) > $last) {\n $last = round(microtime(true) * 1000);\n echo chr(8);\n if ($spin == 0 || $spin == 4) {\n echo \"|\";\n } elseif ($spin == 1 || $spin == 5) {\n echo \"/\";\n } elseif ($spin == 2 || $spin == 6) {\n echo \"-\";\n } elseif ($spin == 3 || $spin == 7) {\n echo \"\\\\\";\n }\n if ($spin > 6) {\n $spin = 0;\n }else{\n $spin++;\n }\n }\n }\n }\n if (! $this->climate->arguments->defined('quiet')) {\n echo chr(8) . \"Imported table: \" . $table['name'] . \"\\n\";\n } \n }\n }\n if (! $this->climate->arguments->defined('quiet')) {\n echo chr(8) . \"Database import complete: \" . $this->dbName . \"\\n\";\n }\n $this->db->close();\n exit();\n }",
"public function load()\n {\n $objectManager = new ObjectManager();\n $objects = $objectManager->prepareJsonObjects();\n\n $jsonTab = [];\n foreach ($objects as $object) {\n $taskManager = new TaskManager();\n $tasks = $taskManager->prepareJsonTask($object->getId());\n $object->entities = $tasks;\n $jsonTab[] = $object->toArray();\n// var_dump($object);\n }\n\n $startJson = 'let jsonDocument = ';\n\n $spaceEnv = json_encode($jsonTab, JSON_PRETTY_PRINT);\n// echo '<pre>' . print_r($spaceEnv, true) ;\n $spaceJson = 'public/uploads/dbJson.json';\n $jsonFile = fopen($spaceJson, 'w+');\n fwrite($jsonFile, $startJson);\n fwrite($jsonFile, $spaceEnv);\n fclose($jsonFile);\n }",
"private function InsertSFolder($Folder){\n $ID_User=$this->session->idusu;\n $file = file_get_contents($Folder.\"/S_Folder.json\");\n $sf=json_decode($file);\n $count=count($sf->ID_Folder);\n for($i=0;$i<$count;$i++){\n $sql=\"INSERT INTO S_Folder(ID_SFUser,folderName,folderDescr,imgSFolder,folderColor,folderOrder)\n VALUES (?,?,?,?,?,?)\";\n $this->db->query($sql,array(\n $ID_User,\n $sf->folderName[$i],\n $sf->folderDescr[$i],\n $sf->imgSFolder[$i],\n $sf->folderColor[$i],\n $sf->folderOrder[$i]\n ));\n}\nreturn $count;\n}",
"protected function importFileRecords()\n {\n if (is_array($this->jsonArray['records']['sys_file'])) {\n foreach ($this->jsonArray['records']['sys_file'] as $properties) {\n if ($this->isFileRecordAlradyExisting($properties['identifier'], (int)$properties['storage'])) {\n $newUid = $this->findFileUidByStorageAndIdentifier(\n $properties['identifier'],\n (int)$properties['storage']\n );\n $this->mappingService->setNew($newUid, (int)$properties['uid'], 'sys_file');\n } else {\n $this->insertRecord($properties, 'sys_file');\n }\n }\n }\n }",
"function processJSON($json_data){\n #decode json string into php varible;\n $data = (json_decode($json_data, true));\n #iterate the associate array and insert them into the table\n for ($i = 0; $i < count($data); $i++){\n $name = $data[$i]['name'];\n $id = $data[$i]['id'];\n $value = $data[$i]['value'];\n $timestamp = $data[$i]['timestamp'];\n $query = \"insert into users values('$name', '$id', '$value', '$timestamp')\";\n $result = mysql_query($query);\n if (!$result){\n die (\"Database access failed: \".mysql_error());\n }else{\n echo \"Add data into a table \\n\";\n }\n }\n }",
"public function import() {\n \t\n foreach (self::getFactsFromJSON() as $fact) {\n // Insertion dans la base de donnée\n $statement = $this->connection->prepare(\"INSERT INTO facts (fact, date, vote, points) VALUES (:fact, :date, :vote, :points)\");\n \t$statement->bindParam('fact', $fact->fact, PDO::PARAM_STR);\n \t$statement->bindParam('date', $fact->date);\n $statement->bindParam('vote', $fact->vote);\n $statement->bindParam('points', $fact->points);\n\t \t$statement->execute();\n }\n }",
"public function submitChanges(){\n $data = file_get_contents(\"Database.json\");\n $json_a = json_decode($data);\n foreach ($json_a as $clientID => $client){\n if ($this->clientID == $clientID){\n $client->phoneNum = $this->phoneNum;\n $client->balance = $this->balance;\n }\n $data = json_encode($json_a);\n file_put_contents(\"Database.json\", $data);\n }\n }",
"function importFromFile( $json_file )\n {\n $read_file = json_decode( file_get_contents( $json_file), true );\n\n $pokemon_insert = \"INSERT INTO pokemon VALUES( NULL, :pokemon_name )\";\n $pokemon_type_insert = \"INSERT INTO pokemon_types VALUES( NULL, :pokemon_type_name )\";\n $assn_pokemon_pokemon_types = \"INSERT INTO assn_pokemon_pokemon_types VALUES (:pokemon_id, :pokemon_type_id)\";\n\n $dbh_pokemon = $this->db->prepare($pokemon_insert);\n $dbh_pokemon_type = $this->db->prepare($pokemon_type_insert);\n $dbh_assn_pokemon_pokemon_type = $this->db->prepare($assn_pokemon_pokemon_types);\n\n $pokemon_types_model = new PokemonTypesModel;\n\n //to not repeat insertion of same type / prevent auto_increment gap\n $type_values = [];\n\n $errors = [];\n\n foreach ($read_file as $value) {\n\n //ignore if type isn't defined for the Pokemon (internal rule)\n if(isset($value['name']) && isset($value['types'])){\n $pokemon_name = ucfirst($value['name']);\n\n //Insert Pokemon name\n if($dbh_pokemon->execute( array( ':pokemon_name' => $pokemon_name)) ){\n $pokemon_last_id = $this->db->lastInsertId();\n }else{\n $errors[] = array( \"Failed inserting $pokemon_name\", $dbh_pokemon->errorInfo() );\n $pokemon_last_id = false;\n }\n\n if($pokemon_last_id){\n foreach($value['types'] as $type_value) {\n if(in_array($type_value, $type_values)){\n //Query pokemon_types to get the type ID\n $pokemon_type_last_id = $pokemon_types_model->getTypeIdFromName( $type_value );\n }else{\n //Insert pokemon type name\n $pokemon_type_response = $dbh_pokemon_type->execute( array( ':pokemon_type_name' => $type_value));\n $pokemon_type_last_id = ($pokemon_type_response == true) ? $this->db->lastInsertId() : '';\n }\n\n //prevent gaps in auto_increment\n $type_values[] = $type_value;\n\n //Create Association between pokemon -> pokemon_type tables\n if($pokemon_type_last_id)\n {\n $dbh_assn_pokemon_pokemon_type->execute( array( ':pokemon_id' => $pokemon_last_id,\n ':pokemon_type_id' => $pokemon_type_last_id\n ));\n }\n }\n\n }\n }\n\n $pokemon_last_id = false;\n $pokemon_type_last_id = false;\n }\n if(!empty($errors))\n {\n return $errors;\n }\n\n return true;\n }",
"private function InsertNameClass($Folder){\n $ID_Language=$this->session->uinterfacelangauge;\n $pictokey=$this->getPictokeys();\n switch($ID_Language){\n case 1:\n $table=\"NameClassCA\";\n break;\n case 2:\n $table=\"NameClassES\";\n break;\n }\n $file = file_get_contents($Folder.\"/\".$table.\".json\");\n $nclass=json_decode($file);\n $count=count($nclass->nameid);\n for($i=0;$i<$count;$i++){\n $sql=\"INSERT INTO $table(nameid,class)VALUES (?,?)\";\n $this->db->query($sql,array(\n $pictokey[$i],\n $nclass->class[$i]\n ));\n}\n}",
"private function importSampleData()\n {\n $paths = $this->fs->files(base_path('storage/app/sample_data'));\n\n foreach($paths as $path) {\n $data = json_decode($this->fs->get($path), true);\n\n $genreModel = Genre::where('name', basename($path, '.json'))->first();\n\n foreach($data as $artist) {\n $props = [];\n\n foreach($artist as $key => $property) {\n if ($key === 'pivot' || $key === 'id' || str_contains($key, '_at') || $key === 'similar') continue;\n\n if ($key === 'albums') {\n $albums = $property;\n } else if ($key === 'fully_scraped') {\n $props[$key] = 0;\n } else {\n $props[$key] = $property;\n }\n }\n\n //insert artist and attach to genre\n $artistModel = Artist::create($props);\n $genreModel->artists()->attach($artistModel->id);\n\n //format albums\n $formatted = [];\n foreach($albums as $album) {\n $formattedAlbum = [\n 'name' => $album['name'],\n 'image' => $album['image'],\n 'spotify_popularity' => $album['spotify_popularity'],\n 'release_date' => $album['release_date'],\n 'tracks' => $album['tracks'],\n 'fully_scraped' => 1,\n ];\n\n //format tracks\n $formattedTracks = [];\n foreach($formattedAlbum['tracks'] as $track) {\n $formattedTracks[] = [\n 'duration' => $track['duration'],\n 'name' => $track['name'],\n 'number' => $track['number'],\n 'album_name' => $formattedAlbum['name'],\n 'artists' => implode('*|*', $track['artists']),\n 'spotify_popularity' => $track['spotify_popularity'],\n ];\n }\n\n $formattedAlbum['tracks'] = $formattedTracks;\n $formatted[] = $formattedAlbum;\n }\n\n $saver = App::make('App\\Services\\Artist\\ArtistSaver');\n $saver->saveAlbums(['albums' => $formatted], $artistModel);\n $saver->saveTracks($formatted, $artistModel);\n }\n }\n }",
"public function migrateRecords(){\n $directory = $this->migrationStructure->getMigrationRootDir() . \"/migrations/\";\n if(file_exists($directory) && !is_null($this->config)){\n $migrationFileNames = $this->migrationStructure->getMigrationFiles();\n $completedMigrationsFileContent = file_get_contents($this->migrationStructure->getMigrationRootDir() . \"/completedMigs.json\");\n $completedMigrationsFileAssoc = json_decode($completedMigrationsFileContent, true);\n $this->databaseAdapter->connect();\n \n foreach($migrationFileNames as $fileName){\n $this->migrateRecord($fileName, $completedMigrationsFileAssoc);\n }\n \n $completedMigrationsFile = fopen($this->migrationStructure->getMigrationRootDir() . \"/completedMigs.json\", \"w\");\n fwrite($completedMigrationsFile, json_encode($completedMigrationsFileAssoc, JSON_PRETTY_PRINT));\n }\n else{\n throw new Exception('Migration structure not properly set. Have you ran \"Sooth init\" ?');\n }\n }",
"public function insertDataFromZipfile($zipFilePath) {\r\n $zip = new ZipArchive;\r\n if( !$zip->open($zipFilePath) ) {\r\n throw new Exception(\"Failed to open zipfile\");\r\n }\r\n $date = $this->utcNow();\r\n $successList = array();\r\n $pdo = $this->dbConn();\r\n for( $i = 0; $i < $zip->numFiles; $i++ ) {\r\n $name = $zip->getNameIndex($i);\r\n $extension = pathinfo($name);\r\n if($extension['extension'] == 'json') {\r\n $data = $zip->getFromIndex($i);\r\n $obj = json_decode($data);\r\n } else {\r\n echo \"the file: $name is not a JSON file <br>\";\r\n continue;\r\n }\r\n if($extension['extension'] != 'json') {\r\n echo \"the file: $name is not a JSON file <br>\";\r\n continue;\r\n }\r\n $data = $zip->getFromIndex($i);\r\n $obj = json_decode($data);\r\n if(!$zipFilePath = '') {\r\n $stmt2 = $pdo->prepare(\"SELECT * FROM data WHERE id='$obj->id'\");\r\n $stmt2->execute();\r\n $num_rows = $stmt2->fetchAll();\r\n if ($num_rows) {\r\n $successList[] .= $obj->id;\r\n continue;\r\n }\r\n $stmt = $pdo->prepare('INSERT INTO data (id, applicatie_naam, applicatie_instantie, applicatie_versie, datum_gecreeerd, datum_aangekomen, niveau, beschrijving_kort, beschrijving_lang)\r\n VALUES (:id, :applicatie_naam, :applicatie_instantie, :applicatie_versie, :datum_gecreeerd, :datum_aangekomen, :niveau, :beschrijving_kort, :beschrijving_lang)');\r\n $stmt->bindParam(':id', $obj->id);\r\n $stmt->bindParam(':applicatie_naam', $obj->applicatie_naam);\r\n $stmt->bindParam(':applicatie_instantie', $obj->applicatie_versie);\r\n $stmt->bindParam(':applicatie_versie', $obj->applicatie_versie);\r\n $stmt->bindParam(':datum_gecreeerd', $obj->datum_gecreeerd);\r\n $stmt->bindParam(':datum_aangekomen', $date);\r\n $stmt->bindParam(':niveau', $obj->niveau);\r\n $stmt->bindParam(':beschrijving_kort', $obj->beschrijving_kort);\r\n $stmt->bindParam(':beschrijving_lang', $obj->beschrijving_lang);\r\n $stmt->execute();\r\n $successList[] .= $obj->id;\r\n }\r\n }\r\n $json = json_encode($successList);\r\n echo $json;\r\n }",
"private function importSampleData()\n {\n $fs = App::make('Illuminate\\Filesystem\\Filesystem');\n\n $paths = $fs->files(base_path('storage/app/sample_data'));\n\n foreach($paths as $path) {\n $data = json_decode($fs->get($path), true);\n\n $genreModel = App\\Genre::where('name', basename($path, '.json'))->first();\n\n foreach($data as $artist) {\n $props = [];\n\n foreach($artist as $key => $property) {\n if ($key === 'pivot' || $key === 'id' || str_contains($key, '_at') || $key === 'similar') continue;\n\n if ($key === 'albums') {\n $albums = $property;\n } else if ($key === 'fully_scraped') {\n $props[$key] = 0;\n } else {\n $props[$key] = $property;\n }\n }\n\n //insert artist and attach to genre\n $artistModel = App\\Artist::create($props);\n $genreModel->artists()->attach($artistModel->id);\n\n //format albums\n $formatted = [];\n foreach($albums as $album) {\n $formattedAlbum = [\n 'name' => $album['name'],\n 'image' => $album['image'],\n 'spotify_popularity' => $album['spotify_popularity'],\n 'release_date' => $album['release_date'],\n 'tracks' => $album['tracks'],\n 'fully_scraped' => 1,\n ];\n\n //format tracks\n $formattedTracks = [];\n foreach($formattedAlbum['tracks'] as $track) {\n $formattedTracks[] = [\n 'duration' => $track['duration'],\n 'name' => $track['name'],\n 'number' => $track['number'],\n 'album_name' => $formattedAlbum['name'],\n 'artists' => implode('*|*', $track['artists']),\n 'spotify_popularity' => $track['spotify_popularity'],\n ];\n }\n\n $formattedAlbum['tracks'] = $formattedTracks;\n $formatted[] = $formattedAlbum;\n }\n\n $saver = App::make('App\\Services\\Artist\\ArtistSaver');\n $saver->saveAlbums(['albums' => $formatted], $artistModel);\n $saver->saveTracks($formatted, $artistModel);\n }\n }\n }",
"public static function loadStations() {\n\n $filename = $_ENV['dirroot'] . '/src/assets/json/stations.json';\n $stations = json_decode(file_get_contents($filename));\n //dd('STATIONS',$stations);\n foreach ($stations->locations as $station) {\n $s = ORM::forTable('station')->create();\n $s->crs = $station->crs;\n $s->name = $station->name;\n $s->save();\n }\n }",
"private function write_data_to_db()\r\n {\r\n $dic_depth = 1;\r\n \r\n for ($dic_depth = 1; $dic_depth < 6; $dic_depth++)\r\n {\r\n foreach ($this->directory_array[$dic_depth] as $id => $dic_node)\r\n {\r\n // create node is not existed, get id when existed\r\n $ret = $this->add_testsuite_node_to_db($dic_depth, $dic_node);\r\n \r\n // create testcase under testsuite\r\n if ($ret)\r\n {\r\n $this->add_testcase_nodes_to_db($dic_depth, $dic_node);\r\n }\r\n }\r\n }\r\n }",
"public function populateRelationTableFromJson(){\n $entityManager = $this->getDoctrine()->getManager();\n $jsondata = file_get_contents('relations.json');\n $data = json_decode($jsondata, true);\n\n foreach($data as $item) {\n $entity = new Relation();\n $entity->setIdRelation($item['id']);\n $entity->setName($item['name']);\n $entity->setDescription($item['description']);\n $entity->setWeight(0);\n\n $entityManager->persist($entity);\n }\n $entityManager->flush();\n }",
"public function processFromJson(string $filePath): void\r\n {\r\n // check if $filePath has a value\r\n if (empty($filePath)) {\r\n echo \"Please indicate JSON file path\";\r\n exit;\r\n }\r\n\r\n // check if file path exists\r\n if (!file_exists($filePath)) {\r\n echo \"Inputted JSON file path does not exists\";\r\n exit;\r\n }\r\n // parse JSON file\r\n $jsonContent = file_get_contents($filePath);\r\n $weeklyOrders = json_decode($jsonContent, true);\r\n\r\n // check if JSON file has been decoded properly\r\n if (empty($weeklyOrders)) {\r\n echo \"Invalid JSON file. Please check content format.\";\r\n exit;\r\n }\r\n\r\n // loop for every day in a week\r\n foreach ($weeklyOrders as $dailyOrders) {\r\n\r\n // at the start of the day, check if there's a purchase order for receiving\r\n $poReceivedProductIds = $this->ProductsPurchased->getPurchaseOrdersForReceiving();\r\n if (!empty($poReceivedProductIds)) {\r\n // process purchase order for every products fetched\r\n $this->processPurchaseOrder($poReceivedProductIds);\r\n }\r\n\r\n // loop for every orders in a day\r\n foreach ($dailyOrders as $order) {\r\n // check if order is not empty and all ordered products have enough stock. Otherwise, reject the order\r\n if (!$this->validateOrder($order)) {\r\n continue;\r\n }\r\n\r\n // proceed to processing the order\r\n $this->processOrder($order);\r\n }\r\n\r\n // at the end of the day, check if there's a product already below stock limit for PO\r\n $productsIdsForPo = $this->Inventory->getProductsForPurchaseOrder();\r\n\r\n // create a purchase order for every products fetched\r\n if (!empty($productsIdsForPo)) {\r\n $this->ProductsPurchased->createPurchaseOrders($productsIdsForPo);\r\n }\r\n }\r\n\r\n $this->outputResults();\r\n }",
"public function testing()\n{\n $files = glob('/var/www/html/cms/upload/home_slider/*');\n\n foreach($files as $file){ // iterate files\n $upload_file= $this->aws3->sendFile('testing-bucket-for-study',$file);\n $f = $upload_file;\n $data = array('img_path'=>$f);\n // echo \"<pre>\"; print_r($data);//exit();\n\n $this->db->insert('testing',$data);\n // if(is_file($file))\n // unlink($file); // delete file\n }\n}",
"public function run()\n {\n DB::table('destinations')->delete();\n\n $destinationJson = File::get(storage_path() . \"/jsondata/destination.json\");\n $destination = json_decode($destinationJson);\n foreach ($destination as $item) \n {\n \tApp\\Destination::create(array(\n \t\t'name' => $item->name,\n 'slug' => $item->slug,\n 'code' => $item->code\n \t));\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ URL: /admin/schedule/import Grabs a JSON file from an external source. Parse the JSOn into an array format format the time and dates. For each object try to create, update. Keep count along the way of create, update, or canceled courses. Return results. | public function getImport(){
$file = file_get_contents($_ENV['courseLink']);
$data = json_decode($file, true);
$timeFormat = "H:i:s";
$dateFormat = "Y-m-d";
$newCourses = 0;
$updatedCourses = 0;
$canceledCourses = 0;
foreach($data as $value){
$parsed = array(
'credit_hours' => $value['CREDIT_HOURS'],
'end_time' => date($timeFormat,strtotime($value['END_TIME'])),
'building' => $value['BUILDING'],
'term_code' => $value['TERM_CODE'],
'crn' => $value['CRN'],
'status_code' => $value['SSTS_CODE'],
'days_of_week' => $value['DAYS'],
'instructor' => $value['INSTRUCTOR'],
'start_time' => date($timeFormat,strtotime($value['BEGIN_TIME'])),
'start_date' => date($dateFormat,strtotime($value['START_DATE'])),
'section' => $value['SECTION'],
'course_number' => $value['COURSE_NUMBER'],
'room_number' => $value['ROOM_NUMBER'],
'subject_code' => $value['SUBJECT_CODE'],
'course_title' => $value['COURSE_TITLE'],
'part_of_term' => $value['PART_OF_TERM'],
'end_date' => date($dateFormat,strtotime($value['END_DATE']))
);
try{
$course = Course::where('crn', '=', $parsed['crn'])->firstOrFail();
if(!empty(array_diff_assoc($parsed, $course->toArray()))){
$course->update($parsed);
$updatedCourses++;
}
if($course->status_code == 'X'){
$canceledCourses++;
//$course->delete();
}
}catch(Exception $e){
Course::create($parsed);
$newCourses++;
}
}
return Redirect::to('admin/schedule/course-summary')->with(
array(
'message' => "created: " . $newCourses .
", updated: " . $updatedCourses .
", canceled: " . $canceledCourses,
));
} | [
"function calendar_import() {\n require_once(\"xml_airbnb.inc\");\n $today = today();\n $result = new stdClass;\n db_query(\"DELETE FROM reservation WHERE source_id > 0 AND res_id < 0 AND checkout <= '$today'\");\n //db_query(\"DELETE FROM reservation,property WHERE reservation.source_id > 0 AND reservation.res_id < 0 AND property.active=0 AND reservation.apt_id=property.id\");\n \n $importObjs = find_objects('calendar_import', []);\n \n foreach($importObjs as $importObj) {\n $source_id = $importObj->id;\n $apt_id = $importObj->apt_id; \n if(!$apt_id) {\n $errors[]= \"{$op}: Source has no rental ID\";\n continue;\n }\n \n $url = $importObj->url;\n if(!is_url($url)) {\n $errors[]= \"{$op}: {$url} is not valid\";\n continue;\n }\n \n $fname = $importObj->fname;\n $map = $fname ? array($fname => $apt_id) : array(); \n $res = airbnb_import($apt_id, $url, $map); \n if($res->success) {\n update_object(\"calendar_import\", array(\"last_sync\" => now()), $source_id);\n $messages[] = \"OK: Imported calendar for {$apt_id}\";\n } else {\n $error = $res->error ?: \"Error: import failed for {$apt_id}\";\n $errors = array_merge_smart($errors, $error); \n }\n }\n $result->success = 1;\n $result->message = $messages;\n $result->error = $errors;\n return $result;\n}",
"public function importer_cron () {\n ini_set('memory_limit', '-1');\n $this->tree_url = get_field('ohjelma-json', 'option');\n $this->tips_url = get_field('tips-json', 'option');\n $this->import();\n update_field( 'field_57c6b36acafd4', date(\"Y-m-d H:i:s\"), 'option' );\n $this->import_tips();\n update_field( 'field_57c6b3e52325e', date(\"Y-m-d H:i:s\"), 'option' );\n }",
"public function jsonToArrayOfSchedule(){\n\t\t$timetables = array();\n\t\t$today = Carbon::today();\n\t\t$tomorrow = Carbon::tomorrow();\n\t\t$dates = array($today,$tomorrow);\n\n\t\tforeach ($dates as $d){\n\t\t\t$this->outputName = $d->__get('day').\"_\".$d->__get('month').\"_\".$d->__get('year').'.json';\n\t\t\ttry\n\t\t\t{\n\t\t\t $contents = File::get($this->savePath.$this->outputName);\n\t\t\t $arrayClass = json_decode($contents);\n\t\t\t $counter = 0;\n\t\t\t $dateString = $d->toDateString();\n\n\t\t\t foreach ($arrayClass as $element) {\n\t\t\t \t//$object = $this->arrayElementToObject($element);\n\t\t\t \t$timetables[$dateString][] = $element; //$object;\n\t\t\t }\n\n\t\t\t \n\t\t\t //var_dump($timetables[$dateString]);\n\t\t\t}\n\t\t\tcatch (Illuminate\\Filesystem\\FileNotFoundException $exception)\n\t\t\t{\n\t\t\t\t$this->getOne($this->idExternal);\n\t\t\t //die(\"The file \".$this->outputName.\" doesn't exist\");\n\t\t\t}\n\t\t}\n\t\tusort($timetables[$dateString], array($this, 'compareWeekday'));\n\t\tusort($timetables[$dateString], array($this, 'compareStart'));\n\t\t$timetables['__dates'] = $dates;\n\t\treturn $timetables;\n\t}",
"protected function importFlights()\n {\n $this->comment('--- FLIGHT SCHEDULE IMPORT ---');\n\n $count = 0;\n foreach ($this->readRows('schedules') as $row) {\n $airline_id = $this->getMapping('airlines', $row->code);\n\n $flight_num = trim($row->flightnum);\n\n $attrs = [\n 'dpt_airport_id' => $row->depicao,\n 'arr_airport_id' => $row->arricao,\n 'route' => $row->route ?: '',\n 'distance' => round($row->distance ?: 0, 2),\n 'level' => $row->flightlevel ?: 0,\n 'dpt_time' => $row->deptime ?: '',\n 'arr_time' => $row->arrtime ?: '',\n 'flight_time' => $this->convertDuration($row->flighttime) ?: '',\n 'notes' => $row->notes ?: '',\n 'active' => $row->enabled ?: true,\n ];\n\n try {\n $flight = Flight::updateOrCreate(\n ['airline_id' => $airline_id, 'flight_number' => $flight_num],\n $attrs\n );\n } catch (\\Exception $e) {\n //$this->error($e);\n }\n\n $this->addMapping('flights', $row->id, $flight->id);\n\n // TODO: deserialize route_details into ACARS table\n\n if ($flight->wasRecentlyCreated) {\n $count++;\n }\n }\n\n $this->info('Imported '.$count.' flights');\n }",
"public function actionImport()\n {\n // Load posted json data into a variable.\n $importData = Craft::$app->request->getBodyParam('importData');\n\n $updateExisting = (bool)Craft::$app->request->getBodyParam('updateExisting');\n\n list($parseError, $noErrors, $backup, $results) = Architect::$plugin->architectService->import($importData, false, $updateExisting);\n\n if ($parseError) {\n $this->renderTemplate('architect/import', [\n 'invalidJSON' => $results[0],\n 'invalidYAML' => $results[1],\n 'updateExisting' => $updateExisting,\n 'importData' => $importData,\n ]);\n return;\n }\n\n $this->renderTemplate('architect/import_results', [\n 'noErrors' => $noErrors,\n 'backupLocation' => $backup,\n 'results' => $results,\n 'updateExisting' => $updateExisting,\n 'importData' => $importData,\n ]);\n }",
"abstract protected function jsonToArrayOfSchedule();",
"public function import()\n {\n $importer = app('importers-'.$this->type);\n\n // Delete events from previous imports.\n $this->events()->delete();\n\n // Retrieve and store events from calendar.\n $this->events()->saveMany($importer->get($this->url, $this->start_date, $this->end_date));\n }",
"public function loadImportItems()\n {\n $sId = $this->getId();\n\n // Get this external id.\n $sExternalId = $this->ettm_project__external_id->rawValue;\n\n // Get all items from remote.\n $aHeaders = [\n 'Content-Type' => 'application/json',\n 'apikey' => $this->_sApiKey,\n ];\n\n $oClient = new \\GuzzleHttp\\Client([\n 'base_uri' => $this->_sUriBaseFull . 'project/',\n 'timeout' => 4.0,\n ]);\n\n $aItems = [];\n\n try {\n $oResponse = $oClient->get(\n $sExternalId . '.json',\n [\n 'headers' => $aHeaders\n ]\n );\n $aResponse = json_decode($oResponse->getBody()->getContents(), true);\n\n $aItems = $aResponse['items'];\n } catch (\\Exception $e) {\n // Do nothing\n }\n\n // Create a marker for each in local database.\n foreach ($aItems as $sItemId => $aItem) {\n $oImportJob = oxNew('\\Eurotext\\Translationmanager\\Model\\ImportJob');\n $oImportJob->assign([\n 'ettm_importjobs__project_id' => $sId,\n 'ettm_importjobs__external_id' => $sItemId,\n 'ettm_importjobs__external_project_id' => $sExternalId,\n ]);\n $oImportJob->save();\n }\n\n return count($aItems);\n }",
"public function actionImport()\n {\n Yii::$app->db->createCommand()->truncateTable('exchange_rates')->execute();\n\n $date = date(\"Y-m-d\");\n $currencies = Currency::find()->all();\n\n $currenciesAbbr = [];\n foreach ($currencies as $currency){\n $currenciesAbbr[$currency->id] = $currency->abbreviation;\n }\n\n $addedRowsCnt = 0;\n for($i=1; $i<=$this->daysCnt; $i++){\n\n foreach($currencies as $currency){\n\n $url = $this->url.$date.'?base='.$currency->abbreviation;\n $data = Json::decode(file_get_contents($url));\n if(!is_array($data)) continue;\n foreach($currenciesAbbr as $id => $abbr){\n if($abbr == $currency->abbreviation) continue;\n $exchangeRate = new ExchangeRate();\n $exchangeRate->date = $date;\n $exchangeRate->base_currency_id = $currency->id;\n $exchangeRate->quoted_currency_id = $id;\n $exchangeRate->rate = $data['rates'][$abbr];\n if($exchangeRate->save()) $addedRowsCnt++;\n }\n }\n echo $date.\" is processed\\n\";\n $date = date(\"Y-m-d\", strtotime($date) - 60*60*24);\n }\n echo $addedRowsCnt.\" rows added to database.\";\n }",
"public function parseImport()\n {\n request()->validate([\n 'file' => 'required|mimes:csv,txt'\n ]);\n $path = request()->file('file')->getRealPath();\n $csvString = file_get_contents($path);\n $data = $this->parse_csv($csvString);\n $header = array_shift($data);\n foreach ($data as $row) {\n $csv[] = array_combine($header, $row);\n }\n $parts = (array_chunk($csv, 10));\n $i = 1;\n foreach($parts as $line) {\n $filename = base_path('resources/pendingDevices/'.date('y-m-d-H-i-s').$i.'.csv');\n file_put_contents($filename, json_encode($line));\n $i++;\n }\n\n session()->flash('status', 'queued for importing');\n\n return redirect(\"import\");\n }",
"public static function import() {\n $count = 0;\n $records = array();\n foreach (self::getSources() as $source) {\n $items = self::readFile($source['path']);\n\n foreach ($items as $item) {\n $item['active'] = true;\n $item['id'] = ++$count;\n $item['name'] = $source['name'];\n $item['type'] = $source['type'];\n $records[$count] = $item;\n }\n }\n self::saveRecords($records);\n }",
"function import_ajax_delete_schedule() {\r\n\r\n\tif ( ! wpgmza_user_can_edit_maps() || ! isset( $_POST['schedule_id'], $_POST['wpgmaps_security'] ) ||\r\n\t ! wp_verify_nonce( $_POST['wpgmaps_security'], 'wpgmaps_import' ) ) {\r\n\r\n\t\twp_send_json_error( __( 'No scheduled import specified or failed security check.', 'wp-google-maps' ) );\r\n\r\n\t}\r\n\r\n\t$import_schedule = get_option( 'wpgmza_import_schedule' );\r\n\r\n\tif ( ! isset( $import_schedule[ $_POST['schedule_id'] ] ) ) {\r\n\r\n\t\twp_send_json_error( __( 'Scheduled import not found.', 'wp-google-maps' ) );\r\n\r\n\t}\r\n\r\n\twp_clear_scheduled_hook( 'wpgmza_import_cron', array( $_POST['schedule_id'] ) );\r\n\t$next_run = wp_next_scheduled( 'wpgmza_import_cron', array( $_POST['schedule_id'] ) );\r\n\r\n\tif ( false === $next_run ) {\r\n\r\n\t\tunset( $import_schedule[ $_POST['schedule_id'] ] );\r\n\t\tupdate_option( 'wpgmza_import_schedule', $import_schedule );\r\n\t\twp_send_json_success( array(\r\n\t\t\t'schedule_id' => $_POST['schedule_id'],\r\n\t\t) );\r\n\r\n\t}\r\n\r\n\twp_send_json_error( __( 'Unable to remove scheduled import.', 'wp-google-maps' ) );\r\n\r\n}",
"public function schedules() {\n if (preg_match('/\\\\d{4}-\\\\d{2}-\\\\d{2}/', $this->vars['id'])) {\n $this->jsonOutput($this->model->getScheduleStructureForDay($this->vars['id']));\n\n } elseif ($this->vars['id'] === '*') {\n $ids = array();\n\n } elseif (!intval($this->vars['id'])) {\n $this->jsonOutput($this->model->getScheduleStructureForType($this->vars['id']));\n\n } else {\n $ids = explode(',', $this->vars['id']);\n }\n\n $this->jsonOutput($this->model->getScheduleStructure($ids));\n }",
"public function import() {\n \t\n foreach (self::getFactsFromJSON() as $fact) {\n // Insertion dans la base de donnée\n $statement = $this->connection->prepare(\"INSERT INTO facts (fact, date, vote, points) VALUES (:fact, :date, :vote, :points)\");\n \t$statement->bindParam('fact', $fact->fact, PDO::PARAM_STR);\n \t$statement->bindParam('date', $fact->date);\n $statement->bindParam('vote', $fact->vote);\n $statement->bindParam('points', $fact->points);\n\t \t$statement->execute();\n }\n }",
"function getJsonCourses(){\n\t\t$this->jsonFilePath = MY_LOCATION . JSON_DIRECTORY . JSON_FILENAME;\n\t\t//echo \"jsonFilePath:\" . $this->jsonFilePath . \"\\n\";\n\t\tif (!is_file($this->jsonFilePath)){\n\t\t//\techo \"ERROR: jsonFilePath:\" . \"NOT A FILE\" . \"\\n\";\n\t\t}else{\n\t\t\t$this->jsonCourseData = file_get_contents($this->jsonFilePath);\n\t\t\t//\techo \"jsonCourseData:\" . $this->jsonCourseData . \"\\n\";\n\n\t\t\tif (!empty($this->jsonCourseData)){\n\t\t\t\t// json decode the updated courses\n\t\t\t\t$rawCourseData = json_decode($this->jsonCourseData, 1);\n\t\t\t\t// echo \"rawCourseData:\" . print_r($rawCourseData, 1) . \"\\n\";\n\n\t\t\t\tif (!empty($rawCourseData) && !empty($rawCourseData['activityDetaillist'])){\n\t\t\t\t\t// courses are in the 'activityDetaillist' array member\n\t\t\t\t\t$courseData = $rawCourseData['activityDetaillist'];\n\t\t\t\t\t// echo \"courseData:\" . print_r($courseData, 1) . \"\\n\";\n\n\t\t\t\t\tif (is_array($courseData)){\n\t\t\t\t\t\t// extract ids for all courses\n\t\t\t\t\t\t$course_ids = array_column($courseData, 'id');\n\t\t\t\t\t\t// echo \"course_ids:\" . print_r($course_ids, 1) . \"\\n\";\n\n\t\t\t\t\t\tif (count($course_ids) == count($courseData)){\n\t\t\t\t\t\t\t// combine id and course to create indexed array\n\t\t\t\t\t\t\t$this->jsonCourses = array_combine($course_ids, $courseData);\n\t\t\t\t\t\t\t//echo \"JSON courses:\" . print_r($this->jsonCourses, 1) . \"\\n\";\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}",
"public function cs_run_cron_import() {\n\t\t// Run the download and import process.\n\t\t$this->import_articles();\n\t}",
"protected function importTasks()\n {\n $modelFactory = function () {\n return new Task;\n };\n $targetTable = 'tasks';\n $sourceTable = 'tasks';\n $columns = [\n 'name' => 'name',\n 'number' => 'task_num',\n 'estimation' => 'duration',\n 'clocking_id' => 'id',\n 'active' => 'status',\n 'project_id' => 'project_id',\n 'created_at' => 'created_at',\n 'resource_type_id' => 'created_at',\n ];\n $keys = [\n 'number',\n ];\n\n // Prefetch all projects\n $projectsCache = [];\n /** @var Project[] $allProjects */\n $allProjects = Project::all();\n foreach ($allProjects as $project) {\n $projectsCache[$project->clocking_id] = $project->id;\n }\n\n /**\n * The previous ClockingIt system has certain tasks with the same \"task_num\". This is problematic\n * since a task's \"number\" field is now a unique identifier and thus duplicates cannot be imported.\n * To prevent data loss, the first one of each task number will be imported, but any others\n * will be added to a list and imported at the end with a new task number\n * If needed, they can still be found via their \"clocking_id\" field.\n *\n * Issue: https://projets.libeo.com/issues/37324\n */\n $findDuplicatesQuery = 'SELECT GROUP_CONCAT(id) AS ids,\n task_num,\n COUNT(*) AS quantity\n FROM tasks\n GROUP BY task_num\n HAVING quantity > 1\n ORDER BY id';\n\n $duplicateTasks = [];\n $importedDuplicateTasks = [];\n\n $allDuplicateTasks = $this->db->select($findDuplicatesQuery);\n foreach ($allDuplicateTasks as $duplicateTask) {\n $ids = explode(',', $duplicateTask->ids);\n $taskNum = $duplicateTask->{'task_num'};\n foreach (range(0, $duplicateTask->quantity - 1) as $i) {\n $duplicateTasks[$ids[$i]] = $taskNum;\n }\n }\n\n $referenceTypeRedmineId = $this->referenceTypeRepository->findOneByCode(ReferenceType::CODE_REDMINE)->id;\n\n $resourcesToFetch = [\n ResourceType::CODE_OTHER,\n 'formation',\n 'strategie',\n 'wireframes',\n 'design',\n 'integration',\n 'programmation',\n 'sysadmin',\n 'gestion_de_projet',\n 'qa',\n 'direction_artistique',\n ];\n $resourceCache = [];\n foreach ($resourcesToFetch as $resourceCode) {\n $resourceCache[$resourceCode] = $this->resourceTypeRepository->findOneByCode($resourceCode)->id;\n }\n\n // Recover tasks' tags from another table in Clocking for future reference.\n $citResourcesTagsQuery = $this->db->table('task_tags')->select('*');\n\n $clockingResourcesTypesTagsRaw = $citResourcesTagsQuery->get();\n $clockingResourcesTypesTags = [];\n foreach ($clockingResourcesTypesTagsRaw as $row) {\n $clockingResourcesTypesTags[$row->{'task_id'}] = $row->{'tag_id'};\n }\n\n $endMerge = function ($data) use (\n $projectsCache,\n $clockingResourcesTypesTags,\n $resourceCache,\n $referenceTypeRedmineId,\n &$duplicateTasks,\n &$importedDuplicateTasks\n ) {\n $citId = $data['clocking_id'];\n\n /*\n * Verify if the current task is in the list of duplicate tasks\n */\n if (array_key_exists($citId, $duplicateTasks)) {\n $taskNum = $duplicateTasks[$citId];\n\n /*\n * Verify that, if this task was previously imported and assigned a new task number,\n * we do not try to import it normally.\n */\n $exactExists = Task::whereClockingIdAndNumber($citId, $taskNum)->exists();\n $similarExists = Task::whereNumber($taskNum)->exists();\n if ((!$exactExists && $similarExists) || in_array($taskNum, $importedDuplicateTasks, true)) {\n throw new SkipRowImportException(\n 'Task',\n \"Task with CIT-ID of {$citId} has the same task number ({$taskNum}) as another task.\"\n );\n }\n\n /*\n * This task can be imported normally because either no task with this task number\n * has been imported before or it was previously imported normally.\n *\n * Remove this task from the task's ID from the list to be processed at the end\n * And add its task number to the list of ones already imported\n */\n unset($duplicateTasks[$citId]);\n $importedDuplicateTasks[] = $taskNum;\n }\n\n $taskIsActive = $this->getIsActive($data['active']);\n\n $clockingProjectId = $data['project_id'];\n if (array_key_exists($clockingProjectId, $projectsCache)) {\n $projectId = $projectsCache[$clockingProjectId];\n } else {\n throw new SkipRowImportException(\n 'Task',\n \"Unable to add Task since no project with the CIT-ID {$clockingProjectId} was found\",\n $data\n );\n }\n\n $estimation = null;\n if (array_key_exists('estimation', $data) && $data['estimation']) {\n $estimation = $data['estimation'];\n }\n\n $clockingResourceId = null;\n if (array_key_exists($citId, $clockingResourcesTypesTags)) {\n $clockingResourceId = $clockingResourcesTypesTags[$citId];\n }\n\n $resourceType = $this->getResourceTypeId($clockingResourceId, $resourceCache);\n\n /*\n * reference_number\n * reference_type_id\n */\n $referenceNumber = null;\n $referenceTypeId = null;\n\n // Redmine Issue prefixed by \"#\"\n $matches = [];\n preg_match_all('(#[0-9]{5})', $data['name'], $matches);\n if (count($matches) === 1 && count($matches[0]) === 1) {\n $match = $matches[0][0];\n $redmineIssueNumber = ltrim($match, '#');\n $referenceNumber = $redmineIssueNumber;\n $referenceTypeId = $referenceTypeRedmineId;\n }\n\n return [\n 'active' => $taskIsActive,\n 'project_id' => $projectId,\n 'estimation' => $estimation,\n 'resource_type_id' => $resourceType,\n 'reference_number' => $referenceNumber,\n 'reference_type_id' => $referenceTypeId,\n 'revised_estimation' => null,\n ];\n };\n\n $beforeRowHook = function (&$data) {\n // Convert all times to current timezone\n $gmt = new DateTimeZone('GMT');\n $current_tz = new DateTimeZone(self::DEFAULT_TIMEZONE);\n\n $data['created_at'] = (new DateTime($data['created_at'], $gmt))->setTimezone($current_tz);\n };\n\n $afterRowHook = function () {\n //Update task_number_seq to the highest number to be sure future auto increments will work\n DB::statement(\"SELECT setval('task_number_seq', (SELECT MAX(number) FROM tasks))\");\n };\n\n $afterImportCompleted = function () use (\n $projectsCache,\n $clockingResourcesTypesTags,\n $resourceCache,\n $referenceTypeRedmineId,\n &$duplicateTasks\n ) {\n /*\n * Loop through and import all tasks remaining in the list of duplicates\n * and import them with a new task number.\n */\n $this->progressOutput('Commencing import of duplicate Tasks');\n $this->printWarning(\n 'These tasks will be assigned new Task Numbers, but will be retraceable by means of their clocking_id'\n );\n $total = count($duplicateTasks);\n $iteration = 1;\n foreach ($duplicateTasks as $citId => $taskNumber) {\n /**\n * Check first if it was previously imported so as to avoid duplicates\n * @var Task $task\n */\n $task = Task::query()->where('clocking_id', '=', $citId)->first();\n if (!$task || !$task->exists) {\n $task = new Task();\n }\n $this->output->write(\"\\x0DImporting duplicate task {$iteration} of {$total} (CIT: $citId)\");\n $iteration++;\n\n $oldData = (array)$this->db->selectOne(\"SELECT * FROM tasks WHERE id={$citId}\");\n\n $newTaskData = [\n 'clocking_id' => $citId,\n 'name' => $oldData['name'],\n 'created_at' => $oldData['created_at'],\n 'updated_at' => $oldData['updated_at'],\n 'active' => $this->getIsActive($oldData['status'])\n ];\n\n $clockingProjectId = $oldData['project_id'];\n if (array_key_exists($clockingProjectId, $projectsCache)) {\n $newTaskData['project_id'] = $projectsCache[$clockingProjectId];\n }\n\n if (!empty($oldData['estimation'])) {\n $newTaskData['estimation'] = $oldData['estimation'];\n }\n\n $clockingResourceId = null;\n if (array_key_exists($citId, $clockingResourcesTypesTags)) {\n $clockingResourceId = $clockingResourcesTypesTags[$citId];\n }\n\n $newTaskData['resource_type_id'] = $this->getResourceTypeId($clockingResourceId, $resourceCache);\n\n // Redmine Issue prefixed by \"#\"\n $matches = [];\n preg_match_all('(#[0-9]{5})', $oldData['name'], $matches);\n if (count($matches) === 1 && count($matches[0]) === 1) {\n $match = $matches[0][0];\n $redmineIssueNumber = ltrim($match, '#');\n $newTaskData['reference_number'] = $redmineIssueNumber;\n $newTaskData['reference_type_id'] = $referenceTypeRedmineId;\n }\n\n Model::unguard();\n $task->fill($newTaskData);\n $success = $task->save();\n Model::reguard();\n if (!$success) {\n throw new SkipRowImportException(\n 'DuplicateTask',\n 'Failed to create new Task'\n );\n }\n }\n $this->progressOutput('Finished importing duplicate Tasks');\n };\n\n $this->runImport(\n $modelFactory,\n $targetTable,\n $sourceTable,\n $columns,\n $keys,\n [],\n $endMerge,\n $beforeRowHook,\n $afterRowHook,\n $afterImportCompleted\n );\n }",
"protected function import()\n {\n if($this->import == true) {\n $json = file_get_contents( $this->json );\n $pages = json_decode( $json );\n foreach ($pages as $page) {\n $post = array(\n 'post_content' => $page->post_content,\n 'post_title' => $page->post_title,\n 'post_name' => $page->post_name,\n 'post_date' => $page->post_date,\n 'post_date_gmt' => $page->post_date,\n 'post_type' => $page->post_type,\n 'post_category' => array($page->post_category),\n 'post_status' => 'publish',\n 'post_parent' => $this->getID($page->post_parent),\n );\n\n $post_id = wp_insert_post( $post, $error );\n\n if(!empty($post_id) && !empty($page->post_category)) {\n update_field('field_55783009d0ba5', $page->post_category, $post_id);\n }\n\n if(!empty($post_id) && $page->post_type == 'post') {\n update_field('field_55794a1b32019', $page->post_content, $post_id);\n }\n\n if(!empty($error)) {\n print \"There was an error importing the posts.\";\n die();\n }\n }\n }\n }",
"public function cronAction()\n {\n $directory = Shopware()->DocPath() . 'files/import_cron/';\n $allFiles = scandir($directory);\n $files = array_diff($allFiles, array('.', '..'));\n\n $lockerFilename = '__running';\n $lockerFileLocation = $directory . $lockerFilename;\n\n if (in_array($lockerFilename, $files)) {\n $file = fopen($lockerFileLocation, \"r\");\n $fileContent = (int) fread($file, filesize($lockerFileLocation));\n fclose($file);\n\n if ($fileContent > time()) {\n echo \"There is already an import in progress.\\n\";\n\n return;\n } else {\n unlink($lockerFileLocation);\n }\n }\n\n if ($files === false || count($files) == 0) {\n echo \"No import files are found\\n\";\n\n return;\n }\n\n //Create empty file to flag cron as running\n $timeout = time() + 1800;\n $file = fopen($lockerFileLocation, \"w\");\n fwrite($file, $timeout);\n fclose($file);\n\n $profileRepository = $this->getManager()->getRepository('Shopware\\CustomModels\\ImportExport\\Profile');\n foreach ($files as $file) {\n $fileExtension = strtolower(pathinfo($file, PATHINFO_EXTENSION));\n $fileName = strtolower(pathinfo($file, PATHINFO_FILENAME));\n\n if ($fileExtension == 'xml' || $fileExtension == 'csv') {\n try {\n $profile = CommandHelper::findProfileByName($file, $profileRepository);\n if ($profile === false) {\n $message = SnippetsHelper::getNamespace()->get('cronjob/no_profile', 'No profile found %s');\n throw new \\Exception(sprintf($message, $fileName));\n }\n\n $filePath = Shopware()->DocPath() . 'files/import_cron/' . $file;\n $fileObject = new \\Symfony\\Component\\HttpFoundation\\File\\File($filePath);\n\n $album = $this->createAlbum();\n\n $media = new \\Shopware\\Models\\Media\\Media();\n\n $media->setAlbum($album);\n $media->setDescription('');\n $media->setCreated(new DateTime());\n $media->setExtension($fileExtension);\n\n $identity = Shopware()->Auth()->getIdentity();\n if ($identity !== null) {\n $media->setUserId($identity->id);\n } else {\n $media->setUserId(0);\n }\n\n //set the upload file into the model. The model saves the file to the directory\n $media->setFile($fileObject);\n\n $this->getManager()->persist($media);\n $this->getManager()->flush();\n\n $mediaPath = $media->getPath();\n } catch (\\Exception $e) {\n echo $e->getMessage() . \"\\n\";\n unlink($lockerFileLocation);\n\n return;\n }\n\n try {\n $return = $this->start($profile, $mediaPath, $fileExtension);\n\n $profilesMapper = array('articles', 'articlesImages');\n\n //loops the unprocessed data\n $pathInfo = pathinfo($mediaPath);\n foreach ($profilesMapper as $profileName) {\n $tmpFileName = 'media/unknown/' . $pathInfo['filename'] . '-' . $profileName . '-tmp.csv';\n $tmpFile = Shopware()->DocPath() . $tmpFileName;\n\n if (file_exists($tmpFile)) {\n $outputFile = str_replace('-tmp', '-swag', $tmpFile);\n rename($tmpFile, $outputFile);\n\n $profile = $this->getPlugin()->getProfileFactory()->loadHiddenProfile($profileName);\n $profileEntity = $profile->getEntity();\n\n $this->start($profileEntity, $outputFile, 'csv');\n }\n }\n\n $message = $return['data']['position'] . ' ' . $return['data']['adapter'] . \" imported successfully \\n\";\n echo $message;\n } catch (\\Exception $e) {\n // copy file as broken\n copy($mediaPath, Shopware()->DocPath() . 'files/import_export/broken-' . $file);\n echo $e->getMessage() . \"\\n\";\n unlink($lockerFileLocation);\n\n return;\n }\n }\n }\n\n unlink($lockerFileLocation);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function used to load the attachment listing | function attachmentListing() {
if ($this->isAdmin () == TRUE) {
$this->loadThis ();
} else {
$searchText = $this->input->post ( 'searchText' );
$data ['searchText'] = $searchText;
$this->load->library ( 'pagination' );
$count = $this->cms_model->attachmentListingCount ( $searchText );
$returns = $this->paginationCompress ( "attachmentListing/", $count, 10 );
$data ['rawRecords'] = $this->cms_model->attachmentListing ( $searchText, $returns ["page"], $returns ["segment"] );
$this->global ['pageTitle'] = 'Feedbacker : Attachment Listing';
$this->loadViews("attachmentListing", $this->global, $data, NULL);
}
} | [
"function controller_attachment_list($page_name) {\n $page = try_textblock_get($page_name);\n identity_require('textblock-list-attach', $page);\n\n $view = array();\n $options = pager_init_options();\n\n $attach_list = attachment_get_all($page_name, \"%\", $options['first_entry'],\n $options['display_entries']);\n //FIXME: hack for numbering\n for ($i = 0; $i < count($attach_list); ++$i) {\n $attach_list[$i]['id'] = $options['first_entry'] + $i + 1;\n }\n $view['attach_list'] = $attach_list;\n $view['page_name'] = $page['name'];\n $view['title'] = 'Atasamentele paginii '.$page['title'];\n $view['total_entries'] = attachment_get_count($page_name);\n $view['first_entry'] = $options['first_entry'];\n $view['display_entries'] = $options['display_entries'];\n\n execute_view_die('views/listattach.php', $view);\n}",
"public function getAttachments()\n\t{\n\t\t$page = 0;\n\t\t$type = $this->input->post('type');\n\t\t$out = $this->media->getList( $page, $type );\n\t\t$this->tpl->assign('media', $out);\n\t\techo $this->tpl->fetch('media/media_left_ajax.tpl');\n\t\texit;\n\t}",
"public static function loadAttachmentData()\r\n\t{\r\n\t\tglobal $context, $smcFunc, $sourcedir, $scripturl, $user_info, $txt, $modSettings, $issue;\r\n\t\r\n\t\t$attachmentData = array();\r\n\t\r\n\t\t$request = $smcFunc['db_query']('', '\r\n\t\t\tSELECT\r\n\t\t\t\ta.id_attach, a.id_folder, a.id_msg, a.filename, IFNULL(a.size, 0) AS filesize, a.downloads, a.approved,\r\n\t\t\t\ta.fileext, a.width, a.height, IFNULL(mem.real_name, t.poster_name) AS real_name, t.poster_ip' . (empty($modSettings['attachmentShowImages']) || empty($modSettings['attachmentThumbnails']) ? '' : ',\r\n\t\t\t\tIFNULL(thumb.id_attach, 0) AS id_thumb, thumb.width AS thumb_width, thumb.height AS thumb_height') . '\r\n\t\t\tFROM {db_prefix}issue_attachments AS ia\r\n\t\t\t\tINNER JOIN {db_prefix}attachments AS a ON (a.id_attach = ia.id_attach)' . (empty($modSettings['attachmentShowImages']) || empty($modSettings['attachmentThumbnails']) ? '' : '\r\n\t\t\t\tLEFT JOIN {db_prefix}attachments AS thumb ON (thumb.id_attach = a.id_thumb)') . '\r\n\t\t\t\tLEFT JOIN {db_prefix}members AS mem ON (mem.id_member = ia.id_member)\r\n\t\t\t\tLEFT JOIN {db_prefix}project_timeline AS t ON (t.id_event = ia.id_event)\r\n\t\t\tWHERE ia.id_issue = {int:issue}\r\n\t\t\t\tAND a.attachment_type = {int:attachment_type}' . (!$modSettings['postmod_active'] || allowedTo('approve_posts') ? '' : '\r\n\t\t\t\tAND a.approved = {int:is_approved}'),\r\n\t\t\tarray(\r\n\t\t\t\t'issue' => $issue,\r\n\t\t\t\t'attachment_type' => 0,\r\n\t\t\t\t'is_approved' => 1,\r\n\t\t\t)\r\n\t\t);\r\n\t\r\n\t\twhile ($row = $smcFunc['db_fetch_assoc']($request))\r\n\t\t{\r\n\t\t\t$i = $row['id_attach'];\r\n\t\r\n\t\t\t$attachmentData[$i] = array(\r\n\t\t\t\t'id' => $i,\r\n\t\t\t\t'name' => preg_replace('~&#(\\\\d{1,7}|x[0-9a-fA-F]{1,6});~', '&#\\\\1;', htmlspecialchars($row['filename'])),\r\n\t\t\t\t'href' => $scripturl . '?action=dlattach;issue=' . $issue . '.0;attach=' . $i,\r\n\t\t\t\t'link' => '<a href=\"' . $scripturl . '?action=dlattach;issue=' . $issue . '.0;attach=' . $i . '\">' . htmlspecialchars($row['filename']) . '</a>',\r\n\t\t\t\t'extension' => $row['fileext'],\r\n\t\t\t\t'downloads' => comma_format($row['downloads']),\r\n\t\t\t\t'poster' => $row['real_name'],\r\n\t\t\t\t'ip' => $row['poster_ip'],\r\n\t\t\t\t'size' => round($row['filesize'] / 1024, 2) . ' ' . $txt['kilobyte'],\r\n\t\t\t\t'byte_size' => $row['filesize'],\r\n\t\t\t\t'is_image' => !empty($row['width']) && !empty($row['height']) && !empty($modSettings['attachmentShowImages']),\r\n\t\t\t\t'is_approved' => $row['approved'],\r\n\t\t\t);\r\n\t\r\n\t\t\tif (!$attachmentData[$i]['is_image'])\r\n\t\t\t\tcontinue;\r\n\t\r\n\t\t\t$attachmentData[$i] += array(\r\n\t\t\t\t'real_width' => $row['width'],\r\n\t\t\t\t'width' => $row['width'],\r\n\t\t\t\t'real_height' => $row['height'],\r\n\t\t\t\t'height' => $row['height'],\r\n\t\t\t);\r\n\t\r\n\t\t\tif (!empty($modSettings['attachmentThumbnails']) && !empty($modSettings['attachmentThumbWidth']) && !empty($modSettings['attachmentThumbHeight']) && ($row['width'] > $modSettings['attachmentThumbWidth'] || $row['height'] > $modSettings['attachmentThumbHeight']) && strlen($row['filename']) < 249)\r\n\t\t\t{\r\n\t\t\t\t// ...\r\n\t\r\n\t\t\t\t$attachmentData[$i]['width'] = $row['thumb_width'];\r\n\t\t\t\t$attachmentData[$i]['height'] = $row['thumb_height'];\r\n\t\t\t}\r\n\t\r\n\t\t\tif (!empty($row['id_thumb']))\r\n\t\t\t\t$attachmentData[$i]['thumbnail'] = array(\r\n\t\t\t\t\t'id' => $row['id_thumb'],\r\n\t\t\t\t\t'href' => $scripturl . '?action=dlattach;issue=' . $issue . '.0;attach=' . $row['id_thumb'] . ';image',\r\n\t\t\t\t);\r\n\t\t\t$attachmentData[$i]['thumbnail']['has_thumb'] = !empty($row['id_thumb']);\r\n\t\r\n\t\t\t// If thumbnails are disabled, check the maximum size of the image.\r\n\t\t\tif (!$attachmentData[$i]['thumbnail']['has_thumb'] && ((!empty($modSettings['max_image_width']) && $row['width'] > $modSettings['max_image_width']) || (!empty($modSettings['max_image_height']) && $row['height'] > $modSettings['max_image_height'])))\r\n\t\t\t{\r\n\t\t\t\tif (!empty($modSettings['max_image_width']) && (empty($modSettings['max_image_height']) || $row['height'] * $modSettings['max_image_width'] / $row['width'] <= $modSettings['max_image_height']))\r\n\t\t\t\t{\r\n\t\t\t\t\t$attachmentData[$i]['width'] = $modSettings['max_image_width'];\r\n\t\t\t\t\t$attachmentData[$i]['height'] = floor($row['height'] * $modSettings['max_image_width'] / $row['width']);\r\n\t\t\t\t}\r\n\t\t\t\telseif (!empty($modSettings['max_image_width']))\r\n\t\t\t\t{\r\n\t\t\t\t\t$attachmentData[$i]['width'] = floor($row['width'] * $modSettings['max_image_height'] / $row['height']);\r\n\t\t\t\t\t$attachmentData[$i]['height'] = $modSettings['max_image_height'];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telseif ($attachmentData[$i]['thumbnail']['has_thumb'])\r\n\t\t\t{\r\n\t\t\t\t// If the image is too large to show inline, make it a popup.\r\n\t\t\t\tif (((!empty($modSettings['max_image_width']) && $attachmentData[$i]['real_width'] > $modSettings['max_image_width']) || (!empty($modSettings['max_image_height']) && $attachmentData[$i]['real_height'] > $modSettings['max_image_height'])))\r\n\t\t\t\t\t$attachmentData[$i]['thumbnail']['javascript'] = 'return reqWin(\\'' . $attachmentData[$i]['href'] . ';image\\', ' . ($row['width'] + 20) . ', ' . ($row['height'] + 20) . ', true);';\r\n\t\t\t\telse\r\n\t\t\t\t\t$attachmentData[$i]['thumbnail']['javascript'] = 'return expandThumb(' . $i . ');';\r\n\t\t\t}\r\n\t\r\n\t\t\tif (!$attachmentData[$i]['thumbnail']['has_thumb'])\r\n\t\t\t\t$attachmentData[$i]['downloads']++;\r\n\t\t}\r\n\t\t$smcFunc['db_free_result']($request);\r\n\t\r\n\t\t$context['attachments'] = &$attachmentData;\r\n\t}",
"public function attachments() {\n $list = array();\n\n $result = $this->connection->query (\n 'SELECT id,entry_id,description,document_type, LENGTH(document) AS \"document_size\"'.\n ' FROM attachment WHERE entry_id='.$this->id());\n\n $nrows = mysql_numrows( $result );\n for( $i = 0; $i < $nrows; $i++ ) {\n array_push (\n $list,\n new LogBookFFAttachment (\n $this->connection,\n $this,\n mysql_fetch_array( $result, MYSQL_ASSOC )));\n }\n return $list;\n }",
"public function ListAll()\r\n {\r\n return $this->request('attachment/listall');\r\n }",
"function attachments_list($attachments)\n{\n\t$icons = array('document' => 'book.png',\n\t 'other' => 'folder.png',\n\t 'default' => 'folder.png',\n\t 'image' => 'image.png',\n\t 'jpg' => 'image.png',\n\t 'png' => 'image.png',\n\t 'gif' => 'image.png',\n\t 'doc' => 'word.png',\n\t 'docx' => 'word.png',\n\t 'pdf' => 'pdf.png');\n\n\tif ($attachments->count() > 0) {\n\t\t$result = '<ul>';\n\n\t\tforeach ($attachments as $attachment)\n\t\t{\n\t\t\t$filesize = ($attachment['size'] > 1024 ? round($attachment['size'] / 1024) . ' MB' : $attachment['size'] . ' KB');\n\t\t\t$image = isset($icons[$attachment['content_type']]) ? $icons[$attachment['content_type']] : $icons['default'];\n\t\t\t$result .= '<li>'\n\t\t\t\t\t. image_tag('/csDoctrineActAsAttachablePlugin/images/attachable/icons/' . $image,\n\t\t\t\t\t\tarray('align' => 'absmiddle',\n\t\t\t\t\t\t 'style' => 'margin-right: 5px;'))\n\t\t\t\t\t. '<strong>' . link_to($attachment['title'], '/' . $attachment['upload_path']) . '</strong>'\n\t\t\t\t\t. '<br />'\n\t\t\t\t\t. '<span class=\"file-size\" style=\"font-style: italic;\">' . $attachment['content_type'] . ' - ' . $filesize . '</span>'\n\t\t\t\t\t. '</li>';\n\t\t}\n\n\t\t$result .= '</ul>';\n\n\t\treturn $result;\n\t}\n\n\treturn false;\n}",
"private function setAttachmentInfo() {\n // Get the attachments\n $attachmentData = $this->postData->getAttachmentData();\n\n // Stop if there are none.\n if (!$attachmentData) return;\n\n // Show attachment links as real links. Add a preview tooltip if the attachment is an image.\n $attachmentData = array_map(function ($mediaFile) {\n /** @var MediaFile $mediaFile */\n $tooltip = preg_match('/\\.(jpg|JPG|png|PNG|gif|GIF|jpeg|JPEG)/', $mediaFile->getLocalUrl()) ? true : false;\n\n return Utils::view('site-tester.partial.attachment-item')->with([\n 'item' => $mediaFile,\n 'tooltip' => $tooltip\n ])->render();\n\n }, $attachmentData);\n\n $this->addInfo(_wpcc(\"Attachments\"), $attachmentData);\n }",
"public function getAttachments()\n {\n return $this->attachment_list;\n }",
"function get_list_record_attachments ($list_title, $attachments_array)\r\n{\r\n global $logging;\r\n\r\n $logging->trace(\"getting list_record_attachments\");\r\n\r\n $td_id = ListTable::_get_db_field_name(DB_ATTACHMENTS_NAME).\"_0\";\r\n \r\n $html_str = \" <td id=\\\"$td_id\\\">\\n\";\r\n $html_str .= \" <div id=\\\"attachments_container\\\">\\n\";\r\n\r\n # show all stored attachments\r\n foreach ($attachments_array as $attachment_array)\r\n {\r\n $attachment_id = $attachment_array[0];\r\n $record_id = $attachment_array[1];\r\n $file_type = $attachment_array[2];\r\n $file_size = $attachment_array[3];\r\n $file_name = $attachment_array[4];\r\n \r\n $html_str .= get_list_record_attachment($list_title, $attachment_id, LISTTABLEATTACHMENT_EXISTING_ATTACHMENT.\"|$file_type|$file_size|$file_name\");\r\n }\r\n \r\n $html_str .= \" </div>\\n\";\r\n # show the add attachment button \r\n $html_str .= get_list_record_attachment($list_title, 0, \"tmp.tmp|some_type|0|some_name\");\r\n $html_str .= \" </td>\\n\";\r\n\r\n $logging->trace(\"got list_record_attachments\");\r\n\r\n return $html_str;\r\n}",
"public function getAttachmentList() {\n\t\treturn $this->attachmentList;\n\t}",
"public function initAttachmentFiles()\n\t{\n\t\t$this->collAttachmentFiles = array();\n\t}",
"function GetAttachmentList($nID) {\t\t\r\n\tglobal $db;\r\n\t\r\n\t// formiruem tablizu ssilok i imen \t\r\n\t\r\n\t$aResult = $db->select(array('email_id' => $nID),'attachment_id','attachment_id,attachment_filename',REJECTMAIL_ATTACHMENTS);\t\r\n\treturn $aResult;\r\n}",
"function fetch_user_attachments($id)\r\n\t{\r\n\t\tglobal $ilance, $phrase, $v3template, $iltemplate, $page_title, $area_title, $ilconfig, $ilpage;\r\n\t\t\r\n\t\t$sql_attach = $ilance->db->query(\"\r\n\t\t\tSELECT attachid, filename, filesize\r\n\t\t\tFROM \" . DB_PREFIX . \"attachment\r\n\t\t\tWHERE tblfolder_ref = '\" . intval($id) . \"'\r\n\t\t\tAND attachtype = 'kb'\r\n\t\t\", 0, null, __FILE__, __LINE__);\r\n\t\tif ($ilance->db->num_rows($sql_attach) > 0)\r\n\t\t{\r\n\t\t\t$attach = \"<span class='smaller'><br /><strong>\".$phrase['_attachments'].\"</strong>:<br />\";\r\n\t\t\twhile ($res_attach = $ilance->db->fetch_array($sql_attach))\r\n\t\t\t{\r\n\t\t\t\t$attach .= \"<li><img src='\".$ilconfig['template_relativeimagepath'].$ilconfig['template_imagesfolder'].\"paperclip.gif' alt='\".$res_attach['filesize'].\" bytes'> \".stripslashes($res_attach['filename']).\" <a href='\".HTTP_SERVER.$ilpage['attachment'].\"?id=\".$res_attach['attachid'].\"'><img src='\".$ilconfig['template_relativeimagepath'].$ilconfig['template_imagesfolder'].\"icons/arrowdown.gif' border='0' alt=''></a></li>\";\r\n\t\t\t}\r\n\t\t\t$attach .= '</span><br />';\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$attach = \"<br />\";\r\n\t\t}\r\n\t\t\r\n\t\treturn $attach;\r\n\t}",
"public function attachmentsAction() {\n $this->_initProduct();\n $this->loadLayout();\n $this->getLayout()->getBlock('product.edit.tab.attachment')\n ->setProductAttachments($this->getRequest()->getPost('product_attachments', null));\n $this->renderLayout();\n }",
"function __attachFiles() {\n\t\tforeach ($this->attachments as $attachment) {\n\t\t\t$files[] = $this->__findFiles($attachment);\n\t\t}\n\n\t\tforeach ($files as $file) {\n\t\t\t$handle = fopen($file, 'rb');\n\t\t\t$data = fread($handle, filesize($file));\n\t\t\t$data = chunk_split(base64_encode($data)) ;\n\t\t\t$filetype = trim(mime_content_type($file));\n\n\t\t\tif(empty($filetype)) {\n\t\t\t\tuser_error('Unable to get mimetype for e-mail attachment', E_USER_ERROR);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$this->__message .= '--' . $this->__createBoundary() . $this->_newLine;\n\t\t\t$this->__message .= 'Content-Type: ' . $filetype . '; name=\"' . basename($file) . '\"' . $this->_newLine;\n\t\t\t$this->__message .= 'Content-Transfer-Encoding: base64' . $this->_newLine;\n\t\t\t$this->__message .= 'Content-Disposition: attachment; filename=\"' . basename($file) . '\"' . $this->_newLine . $this->_newLine;\n\t\t\t$this->__message .= $data . $this->_newLine . $this->_newLine;\n\t\t}\n\t}",
"public function getAttachmentPreview()\n {\n $row = $this->input->get('row');\n $data['data'] = array();\n if (!is_null($this->session->req_attachment) && array_key_exists($row, $this->session->req_attachment)) {\n $req_attachment = $this->session->req_attachment[$row];\n\n if (count($req_attachment) > 0) {\n foreach ($req_attachment as $key => $value) {\n $data['data'][] = array(\n $key,\n $value['file_name'],\n '<a target=\"_blank\" href=\"' . base_url('request/dl_attachment/' . $row . '/' . $key) . '\" class=\"btn btn-xs btn-info\">' . lang('btn_download') . '</a>\n\t\t\t\t\t\t\t',\n );\n }\n }\n }\n echo $this->xwbJsonEncode($data);\n }",
"public function viewAllAttachmentsAction() {\n\n $this->view->title = \"Case - View All Item\";\n $caseItemsModel = new Application_Model_DbTable_CaseItem();\n\n $caseId = $this->_getParam(\"id\");\n $caseItems = $caseItemsModel->fetchAll(\"case_id = $caseId\");\n $this->view->caseItems = $caseItems;\n }",
"function refreshAttachments(){\n\n\t\t$attachments = '';\n\t\t$attachments = array();\n\n\t\t$query = sprintf(\"SELECT * FROM `blobs` WHERE `clientid` = '%s'\", $this->clientid);\n\t\t$result = mysql_query($query);\n\t\t$attachmentColumnData = $result;\n\n\t\tfor($i=0;$i < mysql_num_rows($result);$i++){\n\n\n\t\t\t\n\t\t}\n\n\t}",
"function getAttachments($input, array $commonAttachments) {\n $attachments = array();\n if (!count($input) && !$commonAttachments) {\n return $attachments;\n }\n\n if (!\\RightNow\\Utils\\Connect::isFileAttachmentType($input)){\n echo $this->reportError(Config::getMessage(FILELISTDISPLAY_DISP_FILE_ATTACH_MSG));\n return $attachments;\n }\n\n // convert connect object to array and merge in common attachments if present\n $input = (array) $input;\n if ($commonAttachments) {\n $input = array_merge(array_values($input), array_values($commonAttachments));\n }\n\n $openInNewWindow = trim(Config::getConfig(EU_FA_NEW_WIN_TYPES));\n $attachmentUrl = '/ci/fattach/get/%s/%s' . Url::sessionParameter() . '/filename/%s';\n $showCreatedTime = Text::beginsWith($this->data['attrs']['name'], 'Incident.');\n foreach ($input as $item) {\n if ($item->Private) {\n continue;\n }\n $item->Target = ($openInNewWindow && preg_match(\"/{$openInNewWindow}/i\", $item->ContentType)) ? '_blank' : '_self';\n $item->Icon = \\RightNow\\Utils\\Framework::getIcon($item->FileName);\n $item->ReadableSize = Text::getReadableFileSize($item->Size);\n $item->AttachmentUrl = sprintf($attachmentUrl, $item->ID, $showCreatedTime ? $item->CreatedTime : 0, urlencode($item->FileName));\n $item->ThumbnailUrl = $item->ThumbnailScreenReaderText = null;\n if($this->data['attrs']['display_thumbnail'] && Text::beginsWith($item->ContentType, 'image')) {\n $fileExtension = pathinfo($item->AttachmentUrl, PATHINFO_EXTENSION);\n $fileExtension = Text::escapeHtml($fileExtension);\n $item->ThumbnailScreenReaderText = sprintf(Config::getMessage(FILE_TYPE_PCT_S_LBL), $fileExtension);\n // ThumbnailUrl may change in the future, but for now is the same as $item->AttachmentUrl\n $item->ThumbnailUrl = $item->AttachmentUrl;\n }\n $attachments[] = $item;\n }\n\n return $attachments;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks whether the current user can edit the preview of the specified version. If no revisionid is specified the latest revision of the document is assumed | function checkIfPreviewCanBeEdited($pDocumentId, $pRevisionId = false){
$lLatestRevisionId = getDocumentLatestRevisionId($pDocumentId);
if((int)$pRevisionId && $pRevisionId != $lLatestRevisionId){
//The previous revisions are
// var_dump($pRevisionId);
return false;
}
//We are checking the latest revision
//Check if the document is in a readonly state
$lCon = new DBCn();
$lCon->Open();
$lSql = 'SELECT s.is_readonly::int as is_readonly
FROM pwt.document_states s
JOIN pwt.documents d ON d.state = s.id
WHERE d.id = ' . (int)$pDocumentId . '
';
$lCon->Execute($lSql);
// var_dump(2);
if((int)$lCon->mRs['is_readonly']){
return false;
}
//Now check if the document can be locked by the current user
return lockDocument($pDocumentId);
} | [
"public function revisionEditAccess($data_policy_revision) {\n if ($this->currentUser()->hasPermission('administer data policy entities') || $this->currentUser()->hasPermission('edit data policy')) {\n $ids = $this->dataPolicyConsentManager()->getConfig('revision_ids');\n\n if (!isset($ids[$data_policy_revision])) {\n return AccessResult::allowed();\n }\n }\n\n return AccessResult::forbidden();\n }",
"function tve_ult_is_preview_page() {\n\tglobal $design;\n\n\treturn tve_ult_is_editable( get_the_ID() ) && ! empty( $design );\n}",
"function mia_wf_is_revision_author($post){\n\t$user_id = get_current_user_id();\n\t$author_id = $post->post_author;\n\treturn $user_id == $author_id;\n}",
"static public function is_builder_draft_preview() {\n\t\treturn is_user_logged_in() && isset( $_GET['fl_builder_preview'] );\n\t}",
"function fa_is_theme_edit_preview(){\n\tif( fa_is_preview() ){\n\t\tif( isset( $_GET['action'] ) && 'theme_edit' == $_GET['action'] ){\n\t\t\treturn true;\n\t\t}\n\t}\t\n\treturn false;\n}",
"public function canEdit()\n {\n if (!function_exists('current_user_can')) {\n return false;\n }\n if (current_user_can('edit_post', $this->ID)) {\n return true;\n }\n return false;\n }",
"public function canCurrentUserDeleteRevision()\n {\n return $this->_isAllowedAction('delete_revision');\n }",
"function formcraft3_check_form_page_access($form_id)\n {\n global $fc_meta, $fc_forms_table, $wpdb;\n $query = $wpdb->prepare(\"SELECT meta_builder FROM $fc_forms_table WHERE id = %d\", $form_id);\n $query = $wpdb->get_var($query);\n $query = json_decode(stripslashes($query), 1);\n if (isset($query['config']) && isset($query['config']['disable_form_link']) && $query['config']['disable_form_link']==true) {\n if (is_user_logged_in()) {\n if (isset($_GET['preview']) && $_GET['preview']==true) {\n return true;\n } else {\n return false;\n }\n } else {\n return false;\n }\n } else {\n return true;\n }\n }",
"function userCanEditEvent() {\n\t\tglobal $user_ID;\n\t\t\n\t\tif (empty($this->eventid))\n\t\t\treturn true;\n\t\t\n\t\tif ($this->author != $user_ID) {\n\t\t\treturn current_user_can('edit_others_posts');\t\n\t\t// Edit of published only by editor!\n\t\t} elseif ($this->state == 'publish') {\n\t\t\treturn current_user_can('edit_published_posts');\n\t\t} else {\n\t\t\treturn current_user_can('edit_posts');\t\n\t\t}\n\t}",
"function displayVersionPreview () {\n\t\tif ($this->versioningEnabled) {\n\t\t\t$vPrev = t3lib_div::_GP('ADMCMD_vPrev');\n\t\t\tif ($this->piVars['ADMCMD_vPrev']) {\n\t\t\t\t$piADMCMD = unserialize(rawurldecode($this->piVars['ADMCMD_vPrev']));\n\t\t\t}\n\t\t\tif ((is_array($vPrev) || is_array($piADMCMD)) && is_object($GLOBALS['BE_USER'])) { // check if ADMCMD_vPrev is set and if a BE_user is logged in. $this->piVars['ADMCMD_vPrev'] is needed for previewing a \"single view with pagebrowser\"\n\t\t\t\tif (!is_array($vPrev)) { $vPrev = $piADMCMD; }\n\t\t\t\tlist($table,$t3ver_oid) = explode(':',key($vPrev));\n\t\t\t\tif ($table == 'tt_news') {\n\t\t\t\t\tif ($testrec = $this->pi_getRecord('tt_news', intval($vPrev[key($vPrev)]))) { // check if record exists before doing anything\n\t\t\t\t\t\tif ($testrec['t3ver_oid'] == intval($t3ver_oid) && $testrec['pid']==-1) { // check if requested t3ver_oid is the t3ver_oid of the requested tt_news record, and if the pid of the record is -1 (=non-plublic version)\n\t\t\t\t\t\t\t$GLOBALS['TSFE']->set_no_cache(); // version preview will never be cached\n\t\t\t\t\t\t\t\t// make version preview message with a link to the public version of hte record which is previewed\n\t\t\t\t\t\t\t$vPrevHeader = $this->local_cObj->stdWrap(\n\t\t\t\t\t\t\t\t$this->pi_getLL('versionPreviewMessage').\n\t\t\t\t\t\t\t\t\t$this->local_cObj->typolink(\n\t\t\t\t\t\t\t\t\t\t$this->local_cObj->stdWrap(\n\t\t\t\t\t\t\t\t\t\t\t$this->pi_getLL('versionPreviewMessageLinkToOriginal'),$this->conf['versionPreviewMessageLinkToOriginal_stdWrap.']\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t'parameter' => $this->config['singlePid'].' _blank',\n\t\t\t\t\t\t\t\t\t\t\t'additionalParams' => '&tx_ttnews[tt_news]='.$t3ver_oid,\n\t\t\t\t\t\t\t\t\t\t\t'no_cache' => 1\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t$this->conf['versionPreviewMessage_stdWrap.']\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$this->tt_news_uid = intval($vPrev[key($vPrev)]);\n\t\t\t\t\t\t\t$this->piVars['tt_news'] = $this->tt_news_uid;\n\t\t\t\t\t\t\t$this->piVars['ADMCMD_vPrev'] = rawurlencode(serialize(array($table.':'.$t3ver_oid => $this->tt_news_uid)));\n\t\t\t\t\t\t\t$this->theCode = 'SINGLE';\n\t\t\t\t\t\t\t$this->vPrev = true;\n\t\t\t\t\t\t\t$content = $vPrevHeader.$this->displaySingle();\n\t\t\t\t\t\t} else { // error: t3ver_oid mismatch\n\t\t\t\t\t\t\t$GLOBALS['TT']->setTSlogMessage('tt_news: ERROR! The \"t3ver_oid\" of requested tt_news record and the \"t3ver_oid\" from GPvars doesn\\'t match.');\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\treturn $content;\n\t}",
"public static function newRevisionsAllowed() {\n // only allow revisions when you logged in\n if(self::$_identity) {\n return self::$_newRevisionsAllowed;\n } else {\n return false;\n }\n }",
"function resume_manager_user_can_view_resume( $resume_id ) {\n\t$can_view = true;\n\t$resume = get_post( $resume_id );\n\n\t// Allow previews\n\tif ( $resume->post_status === 'preview' ) {\n\t\treturn true;\n\t}\n\n\t$caps = array_filter( array_map( 'trim', array_map( 'strtolower', explode( ',', get_option( 'resume_manager_view_resume_capability' ) ) ) ) );\n\n\tif ( $caps ) {\n\t\t$can_view = false;\n\t\tforeach ( $caps as $cap ) {\n\t\t\tif ( current_user_can( $cap ) ) {\n\t\t\t\t$can_view = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( $resume->post_status === 'expired' ) {\n\t\t$can_view = false;\n\t}\n\n\tif ( $resume->post_author > 0 && $resume->post_author == get_current_user_id() ) {\n\t\t$can_view = true;\n\t}\n\n\tif ( ( $key = get_post_meta( $resume_id, 'share_link_key', true ) ) && ! empty( $_GET['key'] ) && $key == $_GET['key'] ) {\n\t\t$can_view = true;\n\t}\n\n\treturn apply_filters( 'resume_manager_user_can_view_resume', $can_view, $resume_id );\n}",
"public function userCanEditFile()\n {\n if ($this->userIsEditingPublicDraft) {\n // we need to check that the user has access to edit this draft.\n $draft = $this->getDraft(basename($this->filePath));\n\n if ($draft === false && $this->userIsEditingDraftForFile) {\n // user is editing a draft that represents this file.\n return true;\n }\n\n return PermissionsManager::userCanEditDraft($this->username, $draft);\n } else if ($this->userIsEditingDraft && !$this->userIsEditingDraftForFile) {\n // user is editing a draft and our current FileManager is the draft and not the file the draft represents\n $draft = $this->getDraft(basename($this->filePath));\n if ($draft) {\n return PermissionsManager::userCanEditDraft($this->username, $draft);\n }\n } else if ($this->userIsEditingSiteNav) {\n return PermissionsManager::userCanEditSiteNav($this->username, Utility::removeDocRootFromPath($this->filePath));\n }\n\n $filePath = Utility::removeDocRootFromPath($this->filePath);\n return PermissionsManager::userCanEditFile($this->username, $filePath);\n }",
"public function allowEdit()\n\t{\n\t\treturn $this->id == Auth::user() -> id || Auth::user() -> admin;\n\t}",
"public function isRevisionable();",
"public function testApiDocRevisionsAccessLoggedIn() {\n $user = $this->createUser([]);\n $this->container->get('account_switcher')->switchTo($user);\n\n $entity_v1 = $this->entityTypeStorage->loadRevision($this->apidocV1Id);\n\n $tests = [\n 'view' => 'LoggedIn should not be able to view an unpublished revision.',\n 'update' => 'LoggedIn should not be able to update a revision.',\n ];\n\n foreach ($tests as $op => $message) {\n $this->assertFalse($entity_v1->access($op, $user), $message);\n }\n }",
"public function is_elementor_preview() {\n\t\t\t$result = false;\n\t\t\tif ( isset( $_REQUEST['elementor-preview'] ) || ( is_admin() && isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'elementor' ) || ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'elementor_ajax' ) ) {\n\t\t\t\t$result = true;\n\t\t\t}\n\n\t\t\treturn $result;\n\t\t}",
"protected static function is_previewing() {\n\t\tglobal $wp_query;\n\t\tif ( isset($_GET['preview']) && isset($_GET['preview_nonce']) && wp_verify_nonce($_GET['preview_nonce'], 'post_preview_'.$wp_query->queried_object_id) ) {\n\t\t\treturn true;\n\t\t}\n\t}",
"public static function post_previewed_is_editable() {\n\n\t\tcheck_ajax_referer( 'bb_booster_post_previewed_is_editable' );\n\n\t\t$url = filter_input( INPUT_POST, 'url', FILTER_SANITIZE_STRING );\n\t\t$post_id = url_to_postid( $url );\n\n\t\tif ( static::is_post_editable( $post_id ) ) {\n\n\t\t\twp_send_json_success();\n\n\t\t}\n\n\t\twp_send_json_error();\n\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load relations on given entity If the relation is already loaded, the relation will not be reloaded Use reloadRelation for force loading | #[ReadOperation]
public function loadRelations($entity, $relations): void
{
foreach (Relation::sanitizeRelations((array)$relations) as $relationName => $meta) {
$this->relation($relationName)->loadIfNotLoaded(
new SingleEntityIndexer($this->mapper, $entity),
$meta['relations'],
$meta['constraints']
);
}
} | [
"protected function loadRelated($entity)\n {\n }",
"public function eagerLoad($relations);",
"public function loadAllRelations()\n {\n $this->load(self::RELATIONS);\n }",
"public function load()\n {\n $query = $this->newQuery()->with(func_get_args());\n $query->eagerLoadRelations(array($this));\n }",
"function load ()\n {\n $this->relationships = parent::_load ( $this->basepath ) ;\n }",
"public function loadAllRelations()\n {\n $this->load('cashMovements');\n }",
"protected function lazyLoadRelation()\n {\n //do nothing for simple product\n }",
"public function load(Model $model, $relations = []);",
"public function loadToArrayRelations()\n {\n $this->load('currentRegister');\n\n if ($this->currentRegister) {\n $this->currentRegister->loadAllRelations();\n }\n }",
"public function markForReload()\n\t{\n\t\tif ($this->isLoaded())\n\t\t{\n\t\t\t$related = $this->toModelArray($this->related);\n\n\t\t\t$this->related = NULL;\n\t\t\t$this->loaded = FALSE;\n\t\t}\n\t}",
"protected function eagerLoadRelationships()\n {\n if (isset($this->config['load']) && $this->user) {\n $this->user->load($this->config['load']);\n }\n }",
"public function reload($entity);",
"public function eagerLoadableRelations(): array;",
"public function forceEagerLoad() {\n\t\treturn true;\n\t}",
"public function loadRelationship($name)\n {\n $relation = $this->_relationships[$name];\n $repo = new $relation['repo'];\n\n $local = $relation['key']['local'];\n\n if($this->$local != null) {\n if($relation['type'] == 'one') {\n $this->_relations[$name] = $repo->fetchOneBy($relation['key']['foreign'], $this->$relation['key']['local']);\n } elseif($relation['type'] == 'many') {\n $this->_relations[$name] = $repo->fetchAllBy($relation['key']['foreign'], $this->$relation['key']['local']);\n }\n }\n }",
"public function initializeRelations();",
"protected function setRelations(&$entity)\n {\n }",
"public function postLoad($entity);",
"public function testPrepareRestModelWithLazyLoadRelationsOn()\n\t{\n\t\tYii::app()->params['RestfullYii'] = [\n\t\t\tERestEvent::MODEL_LAZY_LOAD_RELATIONS => function() {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t];\n\t\t$errh = $this->getERestResourceHelper();\n\t\t$model = $errh->prepareRestModel(1);\n\t\t$this->assertTrue(!$model->hasRelated('posts'));\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Gets the public 'DiContainerBenchmarks\Fixture\B\FixtureB404' shared autowired service. | protected function getFixtureB404Service()
{
return $this->services['DiContainerBenchmarks\\Fixture\\B\\FixtureB404'] = new \DiContainerBenchmarks\Fixture\B\FixtureB404();
} | [
"protected function getFixtureB279Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB279'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB279();\n }",
"protected function getFixtureB747Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB747'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB747();\n }",
"protected function getFixtureB788Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB788'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB788();\n }",
"protected function getFixtureB479Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB479'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB479();\n }",
"protected function getFixtureB241Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB241'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB241();\n }",
"protected function getFixtureB321Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB321'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB321();\n }",
"protected function getFixtureB320Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB320'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB320();\n }",
"protected function getFixtureB783Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB783'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB783();\n }",
"protected function getFixtureB182Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB182'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB182();\n }",
"protected function getFixtureB786Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB786'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB786();\n }",
"protected function getFixtureB474Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB474'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB474();\n }",
"protected function getFixtureB679Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB679'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB679();\n }",
"protected function getFixtureB324Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB324'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB324();\n }",
"protected function getFixtureB781Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB781'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB781();\n }",
"protected function getFixtureB327Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB327'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB327();\n }",
"protected function getFixtureB329Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB329'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB329();\n }",
"protected function getFixtureB473Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB473'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB473();\n }",
"protected function getFixtureB798Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB798'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB798();\n }",
"protected function getFixtureB433Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB433'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB433();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns HTML for the page containing the list of category conditions. | function theme_gallery_category_condition_list($variables) {
$conditions = $variables['conditions'];
$category = $variables['category'];
$conds = _gallery_category_conditions();
$header = array(
t('Name'),
t('Column'),
t('Value'),
array(
'data' => t('Operations'),
'colspan' => 2
)
);
$rows = array();
foreach ($conditions as $condition) {
$cond = $conds[$condition['condition']];
if (isset($cond['columns']) && is_array($cond['columns'])
&& is_array($cond['columns'][$condition['columnname']])) {
$options = _gallery_column_options(
array('columns' => array($condition['columnname'] => $cond['columns'][$condition['columnname']])));
$condition['value'] = $options[$cond['columns'][$condition['columnname']][0]][$condition['columnname']
. '___' . $condition['value']];
$condition['columnname'] = $cond['columns'][$condition['columnname']][0];
}
$row = array();
$row[] = l(
$condition['name'],
'admin/config/media/gallery/categories/'
. $condition['gallery_category_id'] . '/conditions/edit/'
. $condition['id']);
$row[] = l(
$condition['columnname'],
'admin/config/media/gallery/categories/'
. $condition['gallery_category_id'] . '/conditions/edit/'
. $condition['id']);
$row[] = l(
$condition['value'],
'admin/config/media/gallery/categories/'
. $condition['gallery_category_id'] . '/conditions/edit/'
. $condition['id']);
$row[] = array_key_exists('columns', $cond) ? l(
t('edit'),
'admin/config/media/gallery/categories/'
. $condition['gallery_category_id'] . '/conditions/edit/'
. $condition['id']) : '';
$row[] = l(
t('delete'),
'admin/config/media/gallery/categories/'
. $condition['gallery_category_id'] . '/conditions/delete/'
. $condition['id']);
$rows[] = $row;
}
if (empty($rows)) {
$rows[] = array(
array(
'colspan' => 6,
'data' => t(
'There are currently no conditions for this category.')
)
);
}
$options = '';
foreach ($conds as $value => $cond)
$options .= '<option value="' . $value . '">' . $cond['name']
. '</option>';
$add_form = '<form action="'
. url(
'admin/config/media/gallery/categories/' . $category['id']
. '/conditions/add') . '" method="post">'
. '<select name="condition" size="1">' . $options . '</select>'
. '<input type="submit" value="' . t('Create condition')
. '" name="submit" />' . '</form>';
return $add_form
. theme(
'table',
array('header' => $header,
'rows' => $rows
));
} | [
"private function _getShortcodeCategoriesHTML() {\n $out = '\t<ul class=\"isotope-filter\">';\n $out .= '\t\t<li class=\"active\"><a href=\"#\" data-filter=\"*\">'.t('Show all').'</a></li>';\n $show_other = FALSE;\n $categories = $this->getShortcodeCateggories();\n foreach($categories as $key => $title) {\n if($title === '_other_category_') {\n $_other_category_index = $key;\n $show_other = TRUE;\n } else {\n $out .='<li><a href=\"#\" data-filter=\".category-'.md5($key).'\">'.t($title).'</a></li>';\n }\n }\n\n if ($show_other) {\n $out .= '<li><a href=\"#\" data-filter=\".category-'.$_other_category_index.'\">' .t('Other').'</a></li>';\n }\n $out .= '\t</ul>';\n return $out;\n }",
"public function conditionsAction() {\n $last_terms = $this->getDoctrine()->getManager()->getRepository('AppBundle:Conditions')->findLast();\n return $this->render('AppBundle:Conditions:conditions.html.twig', array(\n 'last_terms' => $last_terms,\n ));\n }",
"public function action_terms_conditions()\n {\n $cms = Model::factory( 'cms' );\n $content_cms = $cms->getcmscontent( 'terms-and-conditions' );\n $view = View::factory( USERVIEW . 'cms_pages' )->bind( 'cmscontent', $content_cms );\n $this->meta_title = isset( $content_cms[0]['meta_title'] ) ? $content_cms[0]['meta_title'] : \"\";\n $this->meta_keywords = isset( $content_cms[0]['meta_keyword'] ) ? $content_cms[0]['meta_keyword'] : \"\";\n $this->meta_description = isset( $content_cms[0]['meta_description'] ) ? $content_cms[0]['meta_description'] : \"\";\n $this->template->content = $view;\n }",
"function habitat_gallery_category_conditions() {\n\treturn array(\n\t\t\t'habitat' => array(\n\t\t\t\t\t'name' => t('Habitats'),\n\t\t\t\t\t'type' => 'habitat'\n\t\t\t),\n\t);\n}",
"function categories() {\n $categories = Categories::findByModuleSection($this->active_project, $this->active_module, $this->getControllerName());\n \n if($this->request->isApiCall()) {\n $this->serveData($categories, 'categories');\n } else {\n $this->setTemplate(array(\n 'module' => RESOURCES_MODULE, \n 'controller' => 'categories', \n 'template' => 'list'\n ));\n $this->smarty->assign(array(\n 'categories' => $categories,\n 'can_add_category' => Category::canAdd($this->logged_user, $this->active_project)\n ));\t\n } // if\n }",
"public function show_terms_condition()\n {\n return view('terms_condition');\n }",
"public function get_html_categories(){\n\n $html = '<tr class=\"wm-widget-sub-title\"><td>{{categories-title}}:</td></tr><tr class=\"wm-widget-info\"><td>';\n\n $categories = get_the_category();\n $output = '';\n foreach( $categories as $category ){\n $id = get_cat_ID( $category->name );\n $url = get_category_link( $id );\n $output .= '<span class=\"wm-tags\"><a href=\"' . $url . '\">' . $category->name . '</a></span>, ';\n }\n\n if( count( $categories ) > 1 ){\n /** Replace the categories title to be plural. */\n $html = str_replace( '{{categories-title}}', 'Categories', $html );\n } else {\n /** Replace the categories title to be singular. */\n $html = str_replace( '{{categories-title}}', 'Category', $html );\n }\n\n /** Remove the extra comma and space from the loop and close the HTML. */\n $html .= substr( $output, 0, strlen( $output ) - 2 ) . '</td></tr>';\n return $html;\n }",
"public function Index()\n\t{\n\t\t$filter_data = $this->uri->uri_to_assoc($this->_getSegmentsOffset()+3);\n\t\t\n\t\tif(!isset($filter_data['category'])) $filter_data['category'] = 0;\n\t\t\n\t\t$data['categories'] = $this->categories_model->GetChildren($filter_data['category'],TRUE);\n\t\t\n\t\t//if no subcategories - show posts\n\t\tif(empty($data['categories']))\n\t\t{\n\t\t\tredirect($this->_getBaseURI().\"/search/category/\".$filter_data['category']);\n\t\t}\n\t\t\n\t\t$data['controller'] = \"companies\";\n\t\t\n\t\t$data['tpl_page'] = \"categories/list\";\n\t\t\n\t\t// === Current Location === //\n\t\t$current_location_arr = \n\t\tarray(\n\t\t\t$this->_getBaseURI()=>$this->_getPageTitle()\n\t\t);\n\t\t\n\t\t// === Categories Location === //\n\t\t$categories_location_arr = $this->categories_model->GetLocation($filter_data['category'],'companies');\n\t\t$current_location_arr = array_merge($current_location_arr,$categories_location_arr);\n\t\t\n\t\t$data['current_location_arr'] = $current_location_arr;\n\t\t\n\t\t//add search category info\n\t\tif($filter_data['category']) $data = array_merge($data,$this->categories_model->getSearchCategoryData($filter_data['category']));\n\t\t\n\t\t//generate additional page title\n\t\t$this->appendPageTitleForListPages($filter_data,$data);\n\t\t\n\t\tparent::_OnOutput($data);\n\t}",
"public function getTermsConditions()\n {\n return view('web.setting-terms-conditions', ['activeTab' => '5']);\n }",
"function outputCategoryPages()\n \t{\n \t\t// remove root directory\n \t\t$catalog_tree = modApiFunc(\"Catalog\", \"getSubcategoriesFullListWithParent\", 1);\n\n \t\tforeach($catalog_tree as $key => $cat)\n \t\t{\n \t\t\t$id = prepareHTMLDisplay($cat['id']);\n \t\t\t$catName = prepareHTMLDisplay($cat['name']);\n \t\t\t$result .= \"<label><span class='checkBox'>\n <input type='checkbox' name='CatPageList[\". $id .\"]' value='\".$catName.\"' class='form-control'/></span>\"\n .$catName.\"</label>\";\n\n \t\t}//foreach loop\n \t\treturn $result;\n \t}",
"function termsConditions()\r\r\n\t{\r\r\n\t $this->data['content'] \t\t\t= 'general/terms_conditions';\r\r\n\t\t$this->_render_page('temp/template', $this->data);\r\r\n\t}",
"private function getCategoriesHtml() {\n $html = \"<select name='category'>\";\n $categories = $this->getCategories();\n if(0 === count($categories)) {\n return 'Geen categorieën gevonden';\n }\n foreach($categories as $category) {\n $html .= '<option value=\"'.$category.'\">'.$category.'</option>';\n }\n return $html . '</select>';\n }",
"function list_categories() {\n\t$result = rtrv_categories();\n\t$content = '<p>';\n\twhile ($cat_nm = mysql_fetch_array($result)) {\n\t\t$content .= '<input type=\"radio\" name=\"cat\" value=\"' . $cat_nm[0] . '\">';\n\t\t$content .= $cat_nm[0] . '<br />'; \n\t}\n\t$content .= '</p>';\n\treturn $content;\t\n}",
"public function showTermsAndCondition()\n {\n return view('Store::static.terms-condition');\n }",
"public function getHealthCategoryList() {\n try{ \n $catList = MasterHealthCategories::all();\n return $this->renderSuccess(trans('messages.cat_list'), $catList);\n } \n catch(\\Exception $e){\n UtilityHelper::logException(__METHOD__, $e);\n return $this->renderFailure(trans('messages.error.exception'), Response::HTTP_OK);\n }\n \n }",
"public function display_category()\n {}",
"function createstring_FilterByCategoriesDiv() {\n\t\trequire_once( SLPPOWER_REL_DIR . 'include/module/admin/SLP_Power_Admin_Location_Filters.php' );\n\t\t$HTML =\n\t\t\t'<div id=\"extra_filter_by_category\" class=\"filter_extras\">' .\n\t\t\t$this->slplus->Power_Admin_Location_Filters->createstring_LocationFilterForm() .\n\t\t\t'</div>';\n\n\t\treturn $HTML;\n\t}",
"public function catPage() {\n $catList = $this->allCategories;\n $catLinks = array_map(array($this, 'createCatLink'), $catList);\n return view( 'area.coinCategory.catlist', ['catList' => $catList, 'catLinks' => $catLinks] );\n }",
"public function listCategoriesAction(){\n\t\t\t$categories = $this->getCategoriesAction();\n\t\t\tif (!$categories) {\n\t\t\t\t$this->addFlash('notice', 'Oops! there are no categories yet! create one perhaps?');\n\t\t}\n\t\treturn $this->render('NotesBundle:Default:listCategories.html.twig',array('categories' => $categories));\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Data provider for testJobStatusNonExistant | public function dataJobStatusNonExistant()
{
return [
/**
* Testing when job does not exist
*/
[
false,
false,
null,
null,
false,
false,
0,
0,
0,
false,
],
/**
* Testing when job is started
*/
[
true,
true,
0,
10,
true,
true,
0,
10,
0,
false,
],
/**
* Testing when job is still running
*/
[
true,
true,
5,
10,
true,
true,
5,
10,
0.5,
false,
],
/**
* Testing when job is already finished
*/
[
true,
false,
10,
10,
true,
false,
10,
10,
1,
true,
],
];
} | [
"public function if_contractstatus_2_is_in_progress_status()\n {\n $this->assertEquals('U toku', ContractStatus::find(2)->name);\n $this->assertEquals('fa-star', ContractStatus::find(2)->icon);\n $this->assertEquals('info', ContractStatus::find(2)->color);\n }",
"public function testFaxJobIdStatusGet()\n {\n }",
"public function testJobListPreparationAndReleaseTaskStatus()\n {\n\n }",
"public function testGetByStatusFalse()\n {\n $status = 0;\n\n $this->getByStatus($status);\n\n }",
"public function test_load_biz_by_status()\n\t{\n\t\t//TODO: write later\t\n\t}",
"public function testGetFulFillmentStatuses()\n {\n }",
"public function testCreateTaskWithInvalidStatus() {\n $response = $this->runApp(\n 'POST', '/api/v1/task', ['name' => 'ToDo', 'status' => 123]\n );\n\n $result = (string) $response->getBody();\n\n $this->assertEquals(400, $response->getStatusCode());\n $this->assertStringNotContainsString('success', $result);\n $this->assertStringContainsString('error', $result);\n }",
"public function testReadBatchV2alpha1NamespacedCronJobStatus()\n {\n\n }",
"public function doesExist(){ return $this->APICall( '', \"Could not test for existence for job \" . $this->description() ); }",
"public function findStatusDataProvider() {\n\t\treturn array(\n\t\t\t'nothing' => array(\n\t\t\t\t'foo-bar',\n\t\t\t\tarray()\n\t\t\t),\n\t\t\t'queue 1' => array(\n\t\t\t\t'queue1',\n\t\t\t\tarray(\n\t\t\t\t\t'outstanding' => 2,\n\t\t\t\t\t'locked' => 0,\n\t\t\t\t\t'failed' => 0,\n\t\t\t\t\t'completed' => 0,\n\t\t\t\t\t'total' => 2\n\t\t\t\t)\n\t\t\t),\n\t\t\t'queue 2' => array(\n\t\t\t\t'queue2',\n\t\t\t\tarray(\n\t\t\t\t\t'outstanding' => 1,\n\t\t\t\t\t'locked' => 0,\n\t\t\t\t\t'failed' => 0,\n\t\t\t\t\t'completed' => 0,\n\t\t\t\t\t'total' => 1\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t}",
"abstract public function getStatus();",
"public function testItemCreateWithoutStatus()\n {\n $this->expectExceptionMessage('A status is required to save item');\n\n $data = [\n 'status' => Item::STATUS_DRAFT,\n 'part_number' => str_random(12),\n 'brand_id' => str_random(4)\n ];\n\n $item = new Item();\n $item->part_number = $data['part_number'];\n $item->brand_id = $data['brand_id'];\n $item->save();\n }",
"public function testGetContentmanagementStatusStatusId()\n {\n }",
"public function test_check_before_save_with_invalid_status()\n {\n $mock_object = $this->prepare_mock_object_for_check_before_save_tests(false, true, false);\n \n $this->assertTrue($this->invoke_check_before_save($mock_object));\n $this->assertTrue($mock_object->get_status() == Request::STATUS_IN_PROGRESS);\n }",
"public function testGetExportStatus()\n {\n\n }",
"public function testReplaceBatchV2alpha1NamespacedScheduledJobStatus()\n {\n\n }",
"public function testGetParcelCreationStatus()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function testUserStatus()\n {\n }",
"public function testReplaceBatchV2alpha1NamespacedCronJobStatus()\n {\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get hidden fields of variables. | private function hidden_variables()
{
$str = "";
// in
foreach ($this->filter_db_variables($this->vars_in) as $field => $value)
$str .= "<input type='hidden' name='".$field."_in' value='".$value."' />";
// out
foreach ($this->filter_db_variables($this->vars_out) as $field => $value)
$str .= "<input type='hidden' name='".$field."_out' value='".$value."' />";
// projects
if (count($this->projects) > 0)
{
$str .= "<input type='hidden' name='projects' value='".implode(',',array_keys($this->projects))."' />";
foreach ($this->projects as $id_in => $id_out)
$str .= "<input type='hidden' name='project_".$id_in."' value='".$id_out."' />";
}
// categories
if (count($this->categories) > 0)
{
$str .= "<input type='hidden' name='categories' value='".implode(',',array_keys($this->categories))."' />";
foreach ($this->categories as $id_in => $id_out)
$str .= "<input type='hidden' name='category_".$id_in."' value='".$id_out."' />";
}
// severities
if (count($this->severities) > 0)
{
$str .= "<input type='hidden' name='severities' value='".implode(',',array_keys($this->severities))."' />";
foreach ($this->severities as $id_in => $id_out)
$str .= "<input type='hidden' name='severity_".$id_in."' value='".$id_out."' />";
}
// custom fields
if (count($this->custom_fields) > 0)
{
$str .= "<input type='hidden' name='custom_fields' value='".implode(',',array_keys($this->custom_fields))."' />";
foreach ($this->custom_fields as $id_in => $id_out)
$str .= "<input type='hidden' name='custom_field_".$id_in."' value='".$id_out."' />";
}
// options
if (count($this->options) > 0)
{
$str .= "<input type='hidden' name='options' value='".implode(',',array_keys($this->options))."' />";
foreach ($this->options as $name => $value)
$str .= "<input type='hidden' name='option_".$name."' value='".$value."' />";
}
return $str;
} | [
"abstract public function getHiddenFields();",
"public function transaction_formGetHiddenFields ();",
"function get_hidden_fields()\n{\n\tglobal $HTTP_POST_VARS;\n\t$keys_array = array_keys($HTTP_POST_VARS);\n\t$values_array = array_values($HTTP_POST_VARS);\n\t$count = count($keys_array);\n\tif($count)\n\t{\n\t\t$hidden_fields = '<input type=\"hidden\" name=\"' . $keys_array[0] . '\" value=\"' . $values_array[0] . '\" />';\n\t\tfor ($i = 1; $i < $count; $i++)\n\t\t{\n\t\t\t$hidden_fields .= '<input type=\"hidden\" name=\"' . $keys_array[$i] . '\" value=\"' . $values_array[$i] . '\" />';\n\t\t}\n\t\treturn $hidden_fields;\n\t}\n\telse return '';\n}",
"public function transaction_formGetHiddenFields () {\n }",
"public function getHiddenFields(): array\n {\n return $this->hiddenFields;\n }",
"public function getHiddenFields()\n {\n return [\n 'createdAt',\n 'updatedAt',\n 'version',\n 'locale'\n ];\n }",
"private function show_hidden() {\n\n if (!empty($this->_hiddenfields)) {\n\n foreach ($this->_hiddenfields as $name => $value) {\n ?>\n <input type=\"hidden\" name=\"<?php echo $name; ?>\" id=\"<?php echo $name; ?>\" value=\"<?php echo $value; ?>\">\n <?php\n }\n\n // Clear the array\n $this->_hiddenfields = array();\n\n }\n }",
"public function getHiddenFields()\n {\n return [\n 'createdAt',\n 'updatedAt',\n 'version'\n ];\n }",
"public function hiddenFields()\n {\n $hiddenFields = [];\n foreach ($this->fieldsCache as $name => $field) :\n if ($field->isHidden()):\n $hiddenFields[$name] = $field;\n endif;\n endforeach;\n\n return $hiddenFields;\n }",
"protected function hiddenFields() \n {\n /**\n * Intialize the hidden fields array.\n */\n $hidden_fields = array();\n \n /**\n * Get all the field names for the form.\n */\n $field_names = array_keys($this->fields);\n \n /**\n * Iterate over each field name.\n */\n foreach ($field_names as $name) {\n /**\n * Check a bound field instance of the field to see if it's hidden.\n */\n if ($this[$name]->is_hidden) {\n /**\n * Add the hidden field to the array.\n */\n $hidden_fields[] = $this[$name];\n }\n }\n \n /**\n * Return the hidden field array.\n */\n return $hidden_fields;\n }",
"function acf_get_hidden_input($attrs = array()) {}",
"private function getHiddenFieldsWithoutAccess(): array\n\t{\n\t\treturn [\n\t\t\t'STORE_TO',\n\t\t\t'STORE_TO_INFO',\n\t\t\t'STORE_TO_TITLE',\n\t\t\t'STORE_TO_AMOUNT',\n\t\t\t'STORE_TO_RESERVED',\n\t\t\t'STORE_TO_AVAILABLE_AMOUNT',\n\t\t\t'STORE_FROM',\n\t\t\t'STORE_FROM_INFO',\n\t\t\t'STORE_FROM_TITLE',\n\t\t\t'STORE_FROM_AMOUNT',\n\t\t\t'STORE_FROM_RESERVED',\n\t\t\t'STORE_FROM_AVAILABLE_AMOUNT',\n\t\t\t'PURCHASING_PRICE',\n\t\t\t'BASE_PRICE',\n\t\t\t'TOTAL_PRICE',\n\t\t\t'AMOUNT',\n\t\t];\n\t}",
"public function genericSearchHiddenFields();",
"public function getHiddenFields()\n {\n $fields = array();\n foreach ($this->points as $index => $point)\n {\n $fields['points[' . $index . '][location][0]'] = array();\n $fields['points[' . $index . '][location][1]'] = array();\n $fields['points[' . $index . '][order]'] = array('class' => 'order');\n }\n return $fields;\n }",
"public function print_serialized_hidden_form() {\n\t\tforeach($this->_values as $k => $v) {\n\t\t\tif(!is_string($v)) continue;\n\t\t\tprintf(\"\\t<input type='hidden' name='%s' value='%s'>\\n\", $k, htmlentities($v, ENT_QUOTES | ENT_HTML401));\n\t\t}\n\t}",
"public function load_hidden()\n {\n echo \"<input type='hidden' name='$this->name' id='$this->id'\"\n .(($this->class) ? \" class='$this->class'\" : \"\")\n .(($this->placeholder) ? \" placeholder='$this->placeholder'\" : \"\")\n .\" value='$this->value'/>\";\n }",
"public function generate_hidden_inputs() {\n $input_names = $this->hidden_input_form;\n $hidden_inputs = '';\n foreach ($input_names as $input_name) {\n $value_input = (isset($this->{$input_name}) && $this->{$input_name}) ? $this->{$input_name} : '';\n $hidden_inputs .= \"<input type='hidden' name={$input_name} value={$value_input}>\";\n }\n return $hidden_inputs;\n }",
"function form_view_hidden_fields($wcode, $page, $maxp, $poll)\n{\n echo elgg_view_field([\n '#type' => 'hidden',\n 'name' => 'wcode',\n 'value' => $wcode\n ]);\n echo elgg_view_field([\n '#type' => 'hidden',\n 'name' => 'page',\n 'value' => $page\n ]);\n echo elgg_view_field([\n '#type' => 'hidden',\n 'name' => 'maxp',\n 'value' => $maxp\n ]);\n echo elgg_view_field([\n '#type' => 'hidden',\n 'name' => 'poll',\n 'value' => $poll\n ]);\n}",
"public function get_visible_fields() {\n $fields = array();\n if (count($this->fields)) {\n foreach($this->fields as $field) {\n if (!$this->get_field($field)->is_hidden()) {\n $fields[] = $field;\n }\n }\n }\n return $fields;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Find person action Find person name in the database using doctrine | public function findPersonAction() {
if (!$user = $this->identity()) {
return $this->redirect()->toRoute('login', array('controller' => 'index', 'action' => 'login'));
}
$findPersonForm = new FindPersonForm();
$request = $this->getRequest();
$message = null;
if ($request->isPost()) {
$findPersonForm->setData($request->getPost());
if ($findPersonForm->isValid()) {
$data = $findPersonForm->getData();
if($data['search'] !== '') {
$search = '%'.$data['search'].'%';
$dqlSearch = "SELECT u.id, u.firstName, u.lastName FROM CsnUser\Entity\User u WHERE CONCAT(u.firstName, ' ', u.lastName) LIKE :string";
$query = $this->getEntityManager()->createQuery($dqlSearch);
$query->setParameter('string', $search);
$query->setMaxResults(100);
$resultSearch = $query->getResult();
// remove current user from result to prevent adding themself
$user_id = $this->identity()->getId();
foreach($resultSearch as $k) {
if(in_array($user_id, $k)) {
$key = array_search($k, $resultSearch);
unset($resultSearch[$key]);
}
}
if($resultSearch == null){
$message = $this->getTranslator()->translate('Person with %s in their name cannot be found!');
}
}else{
$message = $this->getTranslator()->translate('Please enter a person name!');
}
}
}
return new ViewModel(
array(
'resultSearch' => $resultSearch,
'search' => $data['search'],
'findPersonForm' => $findPersonForm,
'message' => $message
)
);
} | [
"function fetchPerson(Person $person) {\n\n\n }",
"public function getFindPerson()\n\t{\n\t\t$this->_makeRequest(Wp_WhitePages_Model_Api::API_REQUEST_METHOD_FINDPERSON);\n\t\treturn $this->_result;\n\t}",
"public function getEntityName();",
"public function getEntity($name);",
"public function findPersonByLastName($lastname)\n {\n }",
"public function findPersonByName($name)\n {\n $pgw = $this->di['personGateway'];\n return $pgw->findByName($name);\n }",
"function findByNameTest()\n {\n $productDao = new ProductDao();\n return $productDao->findByName(\"trung\");\n }",
"function searchPerson() {\n\n\t\ttry {\n\n\t\t\t//Check if there is a server cached version of this request.\n\t\t\tif ( !$cachedResponse = basicServerCachingCheck() )\n\t\t\t{\n\n\t\t\t\t//themoviedb.org API\n\t\t\t\t$app\t= Slim::getInstance();\n\n\t\t\t\t//Get request object\n\t\t\t\t$req \t= \t$app->request();\n\n\t\t\t\t//Get the query paramter\t\n\t\t\t\t$query \t= \t$req->params('query');\n\n\t\t\t\t//Get themoviedb.org API credential from the config file.\n\t\t\t\t$tmDbApiKey \t\t\t= tmDbApiConfig::$tmDbApiKey;\n\t\t\t\t$tmDbApiURL \t\t\t= tmDbApiConfig::$tmDbApiURL;\n\n\t\t\t\t//Use our custom API client to connect to the API.\n\t\t\t\t$MyapiClient = new MyAPIClient( $tmDbApiURL, $tmDbApiKey);\n\n\t\t\t\t//Search for the query string provided.\n\t\t\t\t$person = $MyapiClient->searchPerson( $query );\n\n\t\t\t\t//Save the response on our server cache. so we don have to go for it later again.\n\t\t\t\tbasicServerCachingSet( $person );\n\n\t\t\t\t//Give the response\n\t\t\t\techo $person;\n\n\t\t\t}else{\n\n\t\t\t\t//Give cached response\n\t\t\t\techo $cachedResponse;\n\n\t\t\t}\n\n\t\t} catch (Exception $err ) {\n\n\t\t\t//In case there is any error we give a clue to the app dev. but no more.\n\t\t\techo '{\"error\":{ \"text\": \"An Error Occurred on searchPerson '.__LINE___.' \"}}'; \n\n\t\t}\n\n\t}",
"public function findResult($name);",
"public function findResult($name)\n {\n }",
"public function retrievePersonById() {\r\n\r\n try {\r\n\r\n // Get person ID\r\n $personId = rf_request_query()->get('personId');\r\n\r\n // Get person\r\n $person = PersonsActionsRetrieve::retrieveById($personId);\r\n\r\n // Send success response\r\n $httpResponse = new JsonResponse(200, $person);\r\n $httpResponse->send();\r\n\r\n } catch (\\Exception $e) {\r\n\r\n // Send error response\r\n $httpResponse = new JsonResponse(500, [\r\n 'error' => $e->getMessage()\r\n ]);\r\n $httpResponse->send();\r\n\r\n }\r\n\r\n }",
"abstract protected function getEntityNameSingular();",
"function search_people_by_name($name){\r\n\t\t\t$query = 'select * from people as Person where name like \"%';\r\n\t\t\t$query = $query.$name;\r\n\t\t\t$query = $query.'%\"';\r\n\t\t\treturn $this->query($query);\r\n\t\t}",
"abstract protected function findForGetOne();",
"public function find_name($user) {\r\n\t}",
"function personExists($name) {\r\n $result = findPerson($name);\r\n if ($result != null) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}",
"function persistePerson($nombre)\n{\n $c = new Criteria();\n $c->add(PersonPeer::NAME, $nombre);\n if ($person = PersonPeer::doSelectOne($c)){\n pintaln(\"\\t\\t\\tPersona \" . $nombre . \" ya existe, recuperada de la BD\", \"amarillo\", 3);\n\n return $person;\n }\n\n $person = new Person();\n $person->setName($nombre);\n $person->setWeb(WEB_PERSON);\n // Necesario para que cree entradas en person_i18n\n $person->setCulture('es');\n $person->setHonorific(' '); \n \n $person->save();\n pintaln(\"\\t\\t\\tPersona \" . $nombre . \" persistida\", \"verde\", 3);\n\n return $person;\n}",
"public function findByNickname($nickname);",
"public function detailsAction()\n {\n $adapter = $this->getServiceLocator()->get('Book\\Db');\n $personTable = new PersonRowTable($adapter);\n $result = $personTable->select(array('id' => 1));\n return array('person' => $result->current());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sale the unit and update the unit status [Unit point of view] A function to update the status of the unit and/or sale it | public function saleUpdateUnitStatus(Request $request){
try{
//get logged user
$user_id = 8; //Auth::user()->id;
//get the loged user data
$user = User::find($user_id);
if(!$user){ return $this->modelNotFoundResponse(); }
//Validate the request data
$validator = Validator::make($request->all(), [
'unit_id' => 'required|numeric',
'status' => 'required|numeric', //A number from one to five
]);
if ($validator->fails()) { //some of request data are missing or invalid
//return the validation errors
return $this->validationErrorsResponse($validator->errors());
}else{
$unit_status = $request->status;
$unit_id = $request->unit_id;
/**
* unit_status values and descriptions:
* a- For sale [value will be: 1]
* b- Sold unknown [value will be: 2]
* c- Not for sale sale now [value will be: 3]
* d- Sold with outside broker [value will be: 4]
*/
if($unit_status == 1 || $unit_status == 2 || $unit_status == 3){
//Just update the unit's status
Unit::where('id', $unit_id)->update(['unit_status'=> $unit_status]);
//build the response
$code = 200; //successful Request:
$status = 'success';
$message = "The data has been updated successfully";
$dataContent = '';
}elseif($unit_status == 4){ //Sold with outside broker
//Make sure that the request contains the broker id
$validator = Validator::make($request->all(), [
'broker_id' => 'required|numeric'
]);
if ($validator->fails()) { //some of request data are missing or invalid
//return the validation errors
return $this->validationErrorsResponse($validator->errors());
}
//add the request to the temp data table until the admin/team leader approve/disapprove it
//1- get the unit details
$unit = Unit::find($unit_id);
if(!$unit){ return $this->modelNotFoundResponse(); }
//2- build the temp request description
$desc = "$user->first_name sold a unit [Code: $unit->unit_code] to outside broker";
//save the request
$result = $this->addToTempDataTable($request->all(), $desc, 1);
if($result == true){ //successful operation
//build the response
$code = 200; //successful Request:
$status = 'success';
$message = "The data has been updated successfully";
$dataContent = '';
}else{ //Unknown error happened
abort(401);
}
}else{
abort(401);
}
return $this->returnApiResult($code, $status, $message, $dataContent);
}
}catch (Exception $e) {
//log what happend
Log::channel('system_exceptions')->info('Exceptions:', [$e]);
//Unknown error happened
return $this->unknownErrorHappenedMsg();
}
} | [
"public function updated(Unit $unit)\n {\n //\n }",
"function update_status_unit($id_unit, $status_unit)\n\t{\n\t\t$this->access_lib->_is(\"adm,stk\");\n\t\t\n\t\t$this->load->model('unit_m');\n\t\t$data_unit = $this->unit_m->get_by_id($id_unit)->row();\n\n\t\tif($data_unit->status_transaksi == \"\")\n\t\t{\n\t\t\tif($status_unit != \"Promo\")\n\t\t\t{\n\t\t\t\t$data_unit_update = array(\t'status_unit'\t\t=> $status_unit,\n\t\t\t\t\t\t\t\t\t\t\t'diskon_tanah'\t\t=> '',\n\t\t\t\t\t\t\t\t\t\t\t'diskon_bangunan'\t=> ''\n\t\t\t\t);\n\t\t\t\t$this->unit_m->edit($id_unit, $data_unit_update);\n\t\t\t\t$this->access_lib->logging('Ubah status unit : '.$data_unit->kode_unit.' ('.$status_unit.')');\n\t\t\t\techo \"ok-mm\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->load->model('promo_m');\n\t\t\t\t$actived = $this->promo_m->get_active_promo()->row();\n\t\t\t\tif (count($actived) > 0)\n\t\t\t\t{\n\t\t\t\t\t$id_promo = $actived->id_promo;\n\t\t\t\t\t$data_unit_update = array(\t'status_unit'\t=> $status_unit,\n\t\t\t\t\t\t\t\t\t\t\t\t'id_promo'\t\t=> $id_promo\n\t\t\t\t\t);\n\t\t\t\t\t$this->unit_m->edit($id_unit, $data_unit_update);\n\t\t\t\t\t\n\t\t\t\t\t$this->access_lib->logging('Ubah status unit : '.$data_unit->kode_unit.' ('.$status_unit.')');\n\t\t\t\t\techo \"ok-p\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\techo 'Data promo dengan status \"Aktif\" tidak ditemukan. Silahkan pilih menu \"Master -> Promo\" untuk mengaktifkan data promo.';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo 'Maaf, status unit \"'.$data_unit->kode_unit.'\" tidak bisa diubah, karena masih dalam progress transaksi.';\n\t\t}\n\t}",
"public function testUpdateProductionLot()\n {\n }",
"private function changesku(){\t \r\n\t $this->chartValue(); //adding to output\r\n\t $this->idleStHealthChk(); //adding to output\r\n\t}",
"public function testUpdateUserInventoryStatus()\n {\n }",
"public static function update(Unit $unit)\n {\n $conn = &PDOData::connect();\n $stmt = $conn->prepare(\"UPDATE units SET name = :name, exchange_rate = :exchange_rate WHERE id = :id \");\n\n $stmt->bindParam(':name', $unit->getName(),PDO::PARAM_STR);\n $stmt->bindParam(':exchange_rate', $unit->getExchangeRate());\n $stmt->bindParam(':id', $event->getId());\n $stmt->execute();\n\n PDOData::disconnect();\n\n echo \"SUCCESS\";\n }",
"public function storeUpdateUnitApi()\n {\n $this->validate(request(), [\n 'unit_number' => 'required'\n ]);\n if(request('id')) {\n $unit = Unit::findOrFail(request('id'));\n $unit->update([\n 'block_number' => request('block_number'),\n 'unit_number' => request('unit_number'),\n 'address' => request('address'),\n 'remarks' => request('remarks'),\n 'squarefeet' => request('squarefeet'),\n 'purchase_price' => request('purchase_price'),\n 'bedbath_room' => request('bedbath_room'),\n 'purchased_at' => request('purchased_at'),\n 'updater_id' => auth()->user()->id\n ]);\n }else {\n Unit::create([\n 'block_number' => request('block_number'),\n 'unit_number' => request('unit_number'),\n 'address' => request('address'),\n 'remarks' => request('remarks'),\n 'squarefeet' => request('squarefeet'),\n 'purchase_price' => request('purchase_price'),\n 'bedbath_room' => request('bedbath_room'),\n 'purchased_at' => request('purchased_at'),\n 'property_id' => request('property_id'),\n 'creator_id' => auth()->user()->id,\n 'profile_id' => auth()->user()->profile->id,\n ]);\n }\n }",
"function updatePaymentStatus(){\r\n $payment = new managePaymentModel();\r\n $payment->cust_ID = $_SESSION['cust_ID'];\r\n $payment->updatePaymentStatus();\r\n }",
"public function updateStoreGoods()\n {\n }",
"public function startSale()\n {\n }",
"private function updateSale()\n {\n $dbUpdate = new EloUpdate();\n\n try {\n\n $dbUpdate->updateSale();\n\n } catch (\\Exception $exception) {\n\n $errorMessage = $exception->getMessage();\n\n include BASEDIR . '/App/Views/error.php';\n\n return;\n\n }\n }",
"function tep_set_specials_status($specials_id, $status) {\n\tif (!function_exists('insert_psc_change_history')) {\n\t\trequire_once(DIR_WS_FUNCTIONS.'inventory_functions.php');\n\t}\n\n\t$prod_details = prepared_query::fetch('SELECT p.stock_id, p.products_model, s.status FROM products p JOIN specials s ON p.products_id = s.products_id WHERE s.specials_id = ?', cardinality::ROW, array($specials_id));\n\t$old = $prod_details['status']?'Status On':'Status Off';\n\t$new = $status?'Status On':'Status Off';\n\tinsert_psc_change_history($prod_details['stock_id'], 'Special Update ['.$prod_details['products_model'].']', $old, $new);\n\n\tprepared_query::execute(\"UPDATE specials SET status = :status, date_status_change = NOW() WHERE specials_id = :specials_id\", [':status' => $status, ':specials_id' => $specials_id]);\n}",
"public function updateAction()\n {\n $this->ensure('post');\n\n try {\n $purchase = $this->getPurchaseService()->getPurchaseWithItems($this->getRequestQuery('id'));\n $input = $this->autoFilledInputFilter(PurchaseInput::class, $purchase);\n $currentStatus = $purchase->getStatus();\n\n // prevent changing warehouse\n $input->remove('warehouse');\n\n if ($input->isValid()) {\n\n $data = $input->getValues();\n $this->mapper(Purchase::class)->getHydrator()->hydrate($data, $purchase);\n $this->persist($purchase)->commit();\n\n // in case we got exception, recover current item data\n $currentItems = $purchase->getItemsAsArray();\n $this->getPurchaseService()->removeItemsFromPurchase($purchase);\n\n try {\n $this->insertRawItems($purchase, $data['raw_items']);\n\n if ($this->getRequestPost('update_stock_level')) {\n if (($data['status'] != $currentStatus) && ($data['status'] == Purchase::STATUS_DELIVERED)) {\n $this->getStockService()->increaseStock($purchase, $this->user(), $data['raw_items']);\n }\n }\n\n // log all changes\n $this->getLogService()->logUpdatePurchase($this->user(), $purchase, $data);\n\n } catch (\\Exception $e) {\n $this->insertRawItems($purchase, $currentItems);\n\n // log partial changes\n $dataWithoutItems = $data;\n $dataWithoutItems['raw_items'] = [];\n $this->getLogService()->logUpdatePurchase($this->user(), $purchase, $dataWithoutItems);\n\n }\n\n return $this->jsonOk([], 200);\n }\n return $this->jsonError($input->getMessages(), 400);\n } catch (NoResultException $e) {\n return $this->jsonError([], 404);\n }\n }",
"public function sales_complete()\n {\n $sales_no = trim($this->input->post('sales_no'));\n $sales_date = date_to_db(trim($this->input->post('sales_date')));\n\n $sales = $this->MSales_master->get_by_sales_no($sales_no);\n $this->MSales_master->update($sales[0]['id']);\n $this->MSales_master->update_tax_info($sales_no);\n\n /** Check if previous sales journal exist then Remove sales journal details else make new sales journal master */\n $sales_journal = $this->MAc_journal_master->get_by_doc('Sales', $sales_no);\n if (count($sales_journal) > 0)\n {\n $sales_journal_no = $sales_journal['journal_no'];\n $this->MAc_journal_details->delete_by_journal_no($sales_journal_no);\n }\n else\n {\n $sales_journal_no = $this->MAc_journal_master->get_journal_number();\n $this->MAc_journal_master->create_by_sales($sales_journal_no, $sales_no);\n }\n\n $settings = $this->MSettings->get_by_company_id($this->session->user_company);\n $total_price = $this->MSales_details->get_total_price_by_sales_no($sales_no);\n\n /** Calculate COGS */\n $total_cogs = $this->MSales_details->get_total_cogs($sales_no);\n\n /** Calculate Sales Tax */\n $tax_amount = 0;\n $tax_percent = $settings['tax_rate'];\n if ($tax_percent > 0)\n {\n $tax_amount = ($total_price * $tax_percent) / 100;\n }\n\n /** Calculate Dues */\n $total_paid = $this->input->post('paid_amount');\n $dues = ((float)$total_price + (float)$tax_amount) - (float)$total_paid;\n /** Discount price calculation */\n // $discount = $this->input->post('discount');\n // $dues = (float)$total_price - (float)$discount - (float)$total_paid;\n\n /** Sales Journal details entry */\n if ($dues == 0)\n {\n /** Cash debit (gross amount) */\n $this->MAc_journal_details->create_by_inventory($sales_journal_no, $settings['ac_cash'], $total_paid);\n /** Sales revenue credit (net sale amount) */\n $this->MAc_journal_details->create_by_inventory($sales_journal_no, $settings['ac_sales'], NULL, $total_price);\n /** Tax payable credit (tax amount) */\n if ($tax_amount > 0)\n {\n $this->MAc_journal_details->create_by_inventory($sales_journal_no, $settings['ac_tax'], NULL, $tax_amount);\n }\n }\n else\n {\n /** Accounts receivable / Customer account debit (dues amount) */\n $customer = $this->MCustomers->get_by_id($this->input->post('customer_id'));\n $this->MAc_journal_details->create_by_inventory($sales_journal_no, $customer['ac_id'], $dues);\n /** Cash debit (paid amount if any) */\n if ((float)$total_paid != 0)\n {\n $this->MAc_journal_details->create_by_inventory($sales_journal_no, $settings['ac_cash'], $total_paid);\n }\n /** Sales revenue credit (net sale amount) */\n $this->MAc_journal_details->create_by_inventory($sales_journal_no, $settings['ac_sales'], NULL, $total_price);\n /** Tax payable credit (tax amount) */\n if ($tax_amount > 0)\n {\n $this->MAc_journal_details->create_by_inventory($sales_journal_no, $settings['ac_tax'], NULL, $tax_amount);\n }\n }\n\n /** Check if previous expense journal exist then Remove expense journal details else make new expense journal master */\n $expense_journal = $this->MAc_journal_master->get_by_doc('Expense', $sales_no);\n if (count($expense_journal) > 0)\n {\n $expense_journal_no = $expense_journal['journal_no'];\n $this->MAc_journal_details->delete_by_journal_no($expense_journal_no);\n }\n else\n {\n $expense_journal_no = $this->MAc_journal_master->get_journal_number();\n $this->MAc_journal_master->create_by_doc($expense_journal_no, $sales_date, 'Direct Sales', 'Expense', $sales_no);\n }\n $this->MAc_journal_details->create_by_inventory($expense_journal_no, $settings['ac_cogs'], $total_cogs);\n $this->MAc_journal_details->create_by_inventory($expense_journal_no, $settings['ac_inventory'], NULL, $total_cogs);\n\n /** Auto Money Receipt if partial or full cash paid */\n if ((float)$total_paid != 0)\n {\n $mr = $this->MAc_money_receipts->get_latest();\n if (count($mr) > 0)\n {\n $mr_no = (int)$mr['mr_no'] + 1;\n }\n else\n {\n $mr_no = 1001;\n }\n $this->MAc_money_receipts->create_by_sales($mr_no, $total_paid, $sales_no);\n }\n\n echo 'inventory/sales-list';\n }",
"public function updated(Sale $sale)\n {\n //\n }",
"public function saveUnit(Unit $unit)\n {\n $namespace = new Container('user');\n \n //build save data array\n $data = array(\n 'id' => $unit->id,\n 'type' => $unit->type,\n 'active_flag' => ($unit->active_flag)? $unit->active_flag: 0,\n );\n \n //deactivating an existing program\n if(!$unit->active_flag){\n $data['deactivated_ts'] = date('Y-m-d h:i:s', time());\n $data['deactivated_user'] = $namespace->userID;\n }\n \n //get the user id\n $id = $unit->id;\n \n $exists = $this->getUnit($id);\n \n //if program doesn't exists\n if (!$exists) {\n $data['created_ts'] = date('Y-m-d h:i:s', time());\n $data['created_user'] = $namespace->userID; \n \n //insert unit\n $this->insert($data);\n \n //get assessor/liaison\n $assessor = (isset($unit->assessor_1))? $unit->assessor_1:'';\n $liaison = (isset($unit->liaison_1))? $unit->liaison_1:'';\n \n //add priv records\n if(!empty($assessor))\n {\n $this->addPriv($id,$assessor,'unit_privs');\n }\n \n if(!empty($liaison))\n {\n $this->addPriv($id,$liaison,'liaison_privs');\n }\n\n } else {\n if ($this->getUnit($id)) {\n \n //update unit\n $this->update($data, array('id' => $id));\n \n //get assessor/liaison\n $assessors[] = (isset($unit->assessor_1))? $unit->assessor_1:'';\n $liaisons[] = (isset($unit->liaison_1))? $unit->liaison_1:''; \n\n //update privs\n $this->updatePrivs($id,$liaisons,'liaison_privs');\n $this->updatePrivs($id,$assessors,'unit_privs');\n \n } else {\n throw new \\Exception('Form id does not exist');\n }\n }\n }",
"public function update(){\n $this->tax = $this->getTax();\n echo \"The new tax in the USA is: \". $this->tax .\" as of today.\";\n }",
"public function update_investmnt_staus($user_id,$status){\n\t\t$data['status'] = $status;\t\t\n\t\t$this->db->where('user_id',$user_id);\n\t\t$return = $this->db->update(DB_PREFIX.'accounts',$data);\n\t\treturn $return;\n\t}",
"function increaseInventory($sku, $amount) {\n \n # STH means \"Statement Handle\" \n $STH = $this->DBH->prepare(\"update xcart_products set avail = avail+{$amount} where productcode = '$sku';\"); \n $STH->execute(); \n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if a variable is really "empty". Code borrowed from PHP.net at because we were previously using empty() to see if a variable is empty or not. But empty() dosen't work for attributes that have a value of "0", so we need something more robust here. an unset variable > empty null > empty 0 > NOT empty "0" > NOT empty false > empty true > NOT empty 'string value' > NOT empty " " (white space) > empty array() (empty array) > empty There are two optional parameters: allow_false: setting this to true will make the function consider a boolean value of false as NOT empty. This parameter is false by default. allow_ws: setting this to true will make the function consider a string with nothing but white space as NOT empty. This parameter is false by default. | public static function gagawaIsEmpty ( $var, $allow_false = false,
$allow_ws = false ) {
if ( !isset($var) || is_null($var) ||
($allow_ws == false && !is_object($var) && trim($var) == "" && !is_bool($var)) ||
($allow_false === false && is_bool($var) && $var === false) ||
(is_array($var) && empty($var)) ) {
return true;
}
else {
return false;
}
} | [
"function v6_empty($var)\n{\n return empty($var);\n}",
"private function isEmpty(): bool\n {\n $data = $this->value;\n if (is_numeric($data)) {\n return false;\n }\n return empty(is_string($data) ? trim($data) : $data);\n }",
"public function is_empty()\r\n\t{\r\n\t\treturn substr($this->type(), 0, 6) == 'empty-';\r\n\t}",
"function notempty($var) {\n return ! empty($var);\n }",
"function not_empty($var)\n{\n\treturn ! empty($var) || $var === 0 || $var === '0';\n}",
"public function allow_empty() {\n\t\treturn $this->allow_empty;\n\t}",
"function is_blank(mixed $value): bool\n {\n if (is_null($value)) {\n return true;\n }\n\n if (is_string($value)) {\n return trim($value) === '';\n }\n\n if (is_numeric($value) || is_bool($value)) {\n return false;\n }\n\n if ($value instanceof Countable) {\n return count($value) === 0;\n }\n\n return empty($value);\n }",
"public function is_empty()\r\n {\r\n if( $this->is_submit() && ($this->taintedInputs->length()=== 0))\r\n return true; \r\n else\r\n return false;\r\n }",
"function is_blankstr($var)\n {\n if ( (gettype($var) == \"string\") and ($var == \"\") ) return TRUE;\n else return FALSE;\n }",
"function papi_is_empty( $obj ) {\n\tif ( is_string( $obj ) ) {\n\t\treturn empty( $obj ) && ! is_numeric( $obj );\n\t}\n\n\tif ( is_bool( $obj ) || is_numeric( $obj ) ) {\n\t\treturn false;\n\t}\n\n\treturn empty( $obj );\n}",
"public function ContainsEmptyAttribute()\n {\n foreach(self::$attributes as $attribute)\n {\n if($this->$attribute == '')\n {\n $this->_error = 'All attributes cannot be empty';\n return true;\n }\n }\n \n return false;\n }",
"function is_blank($value) {\n return !isset($value) || trim($value) === '';\n }",
"function is_blank($value)\n{\n return !isset($value) || trim($value) === '';\n}",
"function is_blank($value) {\n return !isset($value) || trim($value) === '';\n}",
"function is_blank($value) {\n return !isset($value) || trim($value) === '';\n}",
"public function empty()\n {\n $empty = true;\n foreach ($this->attributes as $attribute) {\n if (!empty($attribute)) {\n $empty = false;\n }\n }\n return $empty;\n }",
"function is_blank($value){\n return !isset($value) || trim($value) === '';\n}",
"function is_blank($value) {\n return !isset($value) || trim($value) === '';\n }",
"function is_empty($str) {\r\n return (is_null($str) || !isset($str) || $str == '');\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get services to preload. | public static function getServicesToPreload(): array
{
return [
'router' => 'getMatcher,getGenerator',
'event_dispatcher' => null,
'request_stack' => null,
'http_kernel' => null,
'kernel' => null,
'twig' => null,
];
} | [
"private function loadServices()\n {\n $this->messageQueueService = $this->getContainer()->get('ktio_worker.message_queue_service');\n $this->urlService = $this->getContainer()->get('ktio_worker.url_service');\n $this->timerService = $this->getContainer()->get('ktio_worker.timer_service');\n }",
"private function load_services() {\n\t\tforeach ( $this->get_services() as $service_classname ) {\n\t\t\t$this->load_service( $service_classname );\n\t\t}\n\t}",
"private static function loadServices() {\n\n Application::$services = array();\n\n $config = Application::getConfig();\n\n if ($handle = opendir($config[\"system\"][\"service-folder\"])) {\n\n /* Das ist der korrekte Weg, ein Verzeichnis zu durchlaufen. */\n while (false !== ($entry = readdir($handle))) {\n if ($entry != \".\" && $entry != \"..\") {\n require $config[\"system\"][\"service-folder\"] . \"/\" . $entry;\n $className = $config[\"system\"][\"namespace\"] . \"\\\\services\\\\\" . basename($entry,\".php\");\n $testClass = new \\ReflectionClass($className);\n if (!$testClass->isAbstract()) {\n Application::$services[basename($entry,\".php\")] = new $className();\n }\n\n }\n }\n closedir($handle);\n }\n }",
"private function loadServices()\n {\n $this->emailBuilder = $this->container->get('mollie_shopware.components.support.email_builder');\n $this->logger = $this->container->get('mollie_shopware.components.logger');\n $this->mailTransport = $this->container->get('shopware.mail_transport');\n }",
"protected static function loadServices()\n {\n $dir = 'Service';\n self::checkIsDir($dir);\n\n // next load 'normal' classes\n self::loadFromDir($dir);\n }",
"private function loadServices()\n\t{\n\t\t$response \t= $this->call(sprintf(\"%s/%s\", $this->endpoint, \"services.json\"));\n\t\t$services \t= $this->getResponseContent($response);\n\n\t\tforeach($services as $serviceName => $serviceConfiguration) {\n\t\t\tif(!isset($serviceConfiguration['endpoint'])) { continue; }\n\n\t\t\t$serviceConfig = new ServiceConfiguration($serviceName, $serviceConfiguration['endpoint']);\n\n\t\t\tforeach($serviceConfiguration['routes'] as $routeName => $routeConfig) {\n\t\t\t\t$serviceRouteconfig = new ServiceRouteConfiguration($serviceConfig->getEndpoint(), $routeName, $routeConfig['path'], $routeConfig['method']);\n\t\t\t\t$serviceConfig->addRoute($serviceRouteconfig);\n\t\t\t}\n\n\t\t\t$this->services->attach($serviceConfig);\n\t\t}\n\t}",
"public static function loadPersistentServices()\n {\n $handlers = ModUtil::getVar(self::HANDLERS, 'definitions', array());\n if (!$handlers) {\n return;\n }\n\n foreach ($handlers as $id => $handler) {\n self::$serviceManager->registerService(new Zikula_ServiceManager_Service($id, $handler['definition'], $handler['shared']));\n }\n }",
"public static function getLoadedServiceClasses()\n {\n return static::$_loadedServiceClasses;\n }",
"public function getServices()\n {\n if (null === $this->services) {\n $services = $this->cache->load(self::CACHE_ID);\n if ($services && is_string($services)) {\n $this->services = $this->serializer->unserialize($services);\n } else {\n $this->services = $this->configReader->read();\n $this->cache->save($this->serializer->serialize($this->services), self::CACHE_ID);\n }\n }\n return $this->services;\n }",
"private function loadDefaultServices()\r\n {\r\n $services = new ArrayObject();\r\n $dbService = new DbService();\r\n if (isset($this->config['services']['DbService'])) {\r\n $dbService->configure($this->config['services']['DbService']);\r\n \r\n }\r\n $this->injector->registerService($dbService);\r\n $services[] = $dbService;\r\n\r\n\t\t$service = new TypeManager();\r\n if (isset($this->config['services']['TypeManager'])) {\r\n $service->configure(ifset($this->config['services'], 'TypeManager', array()));\r\n }\r\n $this->injector->registerService($service);\r\n $services[] = $service;\r\n \r\n $service = new SearchService();\r\n if (isset($this->config['services']['SearchService'])) {\r\n $service->configure($this->config['services']['SearchService']);\r\n }\r\n $this->injector->registerService($service);\r\n $services[] = $service;\r\n\r\n $authService = new AuthService();\r\n if (isset($this->config['services']['AuthService'])) {\r\n $authService->configure($this->config['services']['AuthService']);\r\n }\r\n $this->injector->registerService($authService);\r\n $services[] = $authService;\r\n\r\n $authComponent = new AuthComponent();\r\n if (isset($this->config['services']['AuthComponent'])) {\r\n $authComponent->configure($this->config['services']['AuthComponent']);\r\n }\r\n $this->injector->registerService($authComponent);\r\n $services[] = $authComponent;\r\n\r\n $tasksService = new ScheduledTasksService();\r\n $this->injector->registerService($tasksService);\r\n $services[] = $tasksService;\r\n \r\n $accessService = new AccessService();\r\n $this->injector->registerService($accessService);\r\n $services[] = $accessService;\r\n \r\n $cacheService = new CacheService();\r\n\t\t$this->injector->registerService($cacheService);\r\n $services[] = $cacheService;\r\n \tif (isset($this->config['services']['CacheService'])) {\r\n $cacheService->configure($this->config['services']['CacheService']);\r\n }\r\n\r\n\t\t$service = new VersioningService();\r\n\t\t$this->injector->registerService($service);\r\n $services[] = $service;\r\n \tif (isset($this->config['services']['VersioningService'])) {\r\n $service->configure($this->config['services']['VersioningService']);\r\n }\r\n\r\n return $services;\r\n }",
"private function getServices()\n {\n return $this->services;\n }",
"function initServices() {\n\n\t\treturn array(\n\t\t\t'UserStorage' => new Service('User\\Storage\\User'),\n\t\t\t'UserEntity' => new Service('User\\Entity\\User')\n\t\t);\n\t\t\n\t}",
"public function getRequiredServices();",
"public function getCacheServices();",
"public static function getDeferredServices(){\n return \\Illuminate\\Foundation\\Application::getDeferredServices();\n }",
"public function loadServices() {\n $services = Config::getParam(\"services\");\n\n foreach($services as $service) {\n\n $this->container[$service] = function($c) use($service) {\n $reflection = new \\ReflectionClass($service);\n $args = [];\n if($reflection->getConstructor()) {\n /** @var \\ReflectionParameter $param */\n foreach ($reflection->getConstructor()->getParameters() as $param) {\n if(isset($c[$param->getClass()->getName()])) {\n $args[] = $c[$param->getClass()->getName()];\n } else {\n throw new \\Exception(sprintf(\"You forgot to register the service \\\"%s\\\". Go to services.eoss and register it.\", $param->getClass()->getName()));\n }\n }\n }\n return $reflection->newInstanceArgs($args);\n };\n\n }\n }",
"public function loadServices($providers);",
"public static function getDeferredServices()\n {\n /** @var \\Illuminate\\Foundation\\Application $instance */\n return $instance->getDeferredServices();\n }",
"private function getAllPresetsServices(ContainerBuilder $container): array\n {\n $presets = $container->getParameter('preload.presets');\n $services = [];\n\n foreach ($presets as $preset) {\n $services = array_merge(\n $services,\n $preset::getServicesToPreload()\n );\n }\n\n return $services;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sets the ModStrings used Portions created by SugarCRM are Copyright (C) SugarCRM, Inc. All Rights Reserved. Contributor(s): ______________________________________. | function setModStrings($mod_strings) {
unset($this->local_module_strings);
$this->local_mod_strings = $mod_strings;
if(isset($this->xTemplate))$this->xTemplate->assign("MOD", $this->local_mod_strings);
} | [
"public function setModStrings(&$mod_strings) {\n\t\tglobal $log;\n\t\t$log->debug('> setModStrings');\n\t\tunset($this->local_mod_strings);\n\t\t$this->local_mod_strings = $mod_strings;\n\t\tif (isset($this->xTemplate)) {\n\t\t\t$this->xTemplate->assign('MOD', $this->local_mod_strings);\n\t\t}\n\t\t$log->debug('< setModStrings');\n\t}",
"public function changeModuleModStrings($moduleName, $replacementLabels)\n {\n $GLOBALS['log']->info(\"Beginning to change module labels for: $moduleName\");\n $currentModuleStrings = return_module_language($this->selectedLanguage, $moduleName);\n $labelKeysToReplace = array(\n array('name' => 'LNK_NEW_RECORD', 'type' => 'singular'), //Module built modules, Create <moduleName>\n array('name' => 'LNK_LIST', 'type' => 'plural'), //Module built modules, View <moduleName>\n array('name' => 'LNK_NEW_###MODULE_SINGULAR###', 'type' => 'singular'),\n array('name' => 'LNK_CREATE', 'type' => 'singular'),\n array('name' => 'LBL_MODULE_NAME', 'type' => 'plural'),\n array('name' => 'LBL_MODULE_NAME_SINGULAR', 'type' => 'singular'),\n array('name' => 'LBL_NEW_FORM_TITLE', 'type' => 'singular'),\n array('name' => 'LBL_NEW_FORM_BTN', 'type' => 'singular'),\n array('name' => 'LNK_###MODULE_SINGULAR###_LIST', 'type' => 'plural'),\n array('name' => 'LNK_###MODULE_SINGULAR###_REPORTS', 'type' => 'singular'),\n array('name' => 'LNK_IMPORT_VCARD', 'type' => 'singular'),\n array('name' => 'LNK_IMPORT_###MODULE_PLURAL###', 'type' => 'plural'),\n array('name' => 'MSG_SHOW_DUPLICATES', 'type' => 'singular'),\n array('name' => 'LBL_SAVE_###MODULE_SINGULAR###', 'type' => 'singular'),\n array('name' => 'LBL_LIST_FORM_TITLE', 'type' => 'singular'), //Popup title\n array('name' => 'LBL_SEARCH_FORM_TITLE', 'type' => 'singular'), //Popup title\n array('name' => 'LNK_###MODULE_SINGULAR###_PROCESS_MANAGEMENT', 'type' => 'singular'), //PA title\n array('name' => 'LNK_###MODULE_SINGULAR###_UNATTENDED_PROCESSES', 'type' => 'plural'), //PA title\n array('name' => 'LBL_###MODULE_PLURAL###_SUBPANEL_TITLE', 'type' => 'plural'),\n );\n\n $replacedLabels = array();\n foreach ($labelKeysToReplace as $entry) {\n $formattedLanguageKey = $this->formatModuleLanguageKey($entry['name'], $replacementLabels);\n\n //If the static of dynamic key exists it should be replaced.\n if (isset($currentModuleStrings[$formattedLanguageKey])) {\n $oldStringValue = $currentModuleStrings[$formattedLanguageKey];\n $this->changedModule = $moduleName;\n $replacedLabels[$formattedLanguageKey] = $this->replaceSingleLabel($oldStringValue, $replacementLabels, $entry);\n }\n }\n\n //Save all entries\n ParserLabel::addLabels($this->selectedLanguage, $replacedLabels, $moduleName);\n $this->renamedModules[$moduleName] = true;\n return $replacedLabels;\n }",
"public function install_strings() {\r\n $this->strings['update_wxr_packages'] = __('Updated all to wxr packages file.');\r\n $this->strings['update_item_to_wxr_packages'] = __('Updated %s to wxr packages file.');\r\n $this->strings['update_packages_error'] = __('Update packages wxr file error.');\r\n $this->strings['update_packages_success'] = __('Update packages wxr file successful.');\r\n $this->upgrader->update_strings($this->strings);\r\n }",
"function add_strings() {\n\t\tparent::add_strings();\n\n\t\t// if first step is bulk-upgrading, then stop string overrides!\n\t\tif ( ! empty( $this->options['step_one'] ) && $this->options['step_one'] == 'upgrade' )\n\t\t\treturn;\n\n\t\t// if we're bulk-installing, switch up the strings!\n\t\tif ( ! empty( $this->options['install_strings'] ) ) {\n\t\t\t$this->upgrader->strings['skin_before_update_header'] = __( 'Installing Plugin %1$s (%2$d/%3$d)', 'cbox' );\n\n\t\t\t$this->upgrader->strings['skin_upgrade_start'] = __( 'The installation process is starting. This process may take a while on some hosts, so please be patient.', 'cbox' );\n\t\t\t$this->upgrader->strings['skin_update_failed_error'] = __( 'An error occurred while installing %1$s: <strong>%2$s</strong>.', 'cbox' );\n\t\t\t$this->upgrader->strings['skin_update_failed'] = __( 'The installation of %1$s failed.', 'cbox' );\n\t\t\t$this->upgrader->strings['skin_update_successful'] = __( '%1$s installed successfully.', 'cbox' ) . ' <a onclick=\"%2$s\" href=\"#\" class=\"hide-if-no-js\"><span>' . __( 'Show Details', 'cbox' ) . '</span><span class=\"hidden\">' . __( 'Hide Details', 'cbox' ) . '</span>.</a>';\n\t\t\t$this->upgrader->strings['skin_upgrade_end'] = __( 'Plugins finished installing.', 'cbox' );\n\t\t}\n\t}",
"protected function setStrings(): void\n\t{\n\t\tforeach ($this->resources->getStrings() as $string)\n\t\t{\n\t\t\tMain\\Page\\Asset::getInstance()->addString($string, false, Main\\Page\\AssetLocation::AFTER_JS);\n\t\t}\n\t}",
"public function install_strings() {\r\n $this->strings['no_package'] = __('Install package not available.');\r\n $this->strings['downloading_package'] = __('Downloading install package from <span class=\"code\">%s</span>…');\r\n $this->strings['unpack_package'] = __('Unpacking the package…');\r\n $this->strings['installing_package'] = __('Installing the plugin…');\r\n $this->strings['no_files'] = __('The plugin contains no files.');\r\n $this->strings['process_failed'] = __('Plugin install failed.');\r\n $this->strings['process_success'] = __('Plugin installed successfully.');\r\n $this->strings['go_manage_page'] = __('<a href=\"'.admin_url('admin.php?page='. HW_Plugins_Manager::PAGE_SLUG).'\">Trở về trang danh sách modules.</a>');\r\n }",
"function setAllStrings()\r\n {\r\n if ( isset( $this->TextStrings ) and is_array( $this->TextStrings ) )\r\n {\r\n reset( $this->TextStrings );\r\n $tmp =& each( $this->TextStrings );\r\n while ( $tmp )\r\n {\r\n $tmp_key = \"intl-\" . $tmp[0];\r\n $this->set_var_internal( $tmp_key, $tmp[1] );\r\n $tmp =& each( $this->TextStrings );\r\n }\r\n }\r\n }",
"public function upgrade_strings()\n {\n }",
"public function changeStringsInRelatedModules()\n {\n $this->setRenameDefs();\n if (isset($this->renameDefs['modules']) && is_array($this->renameDefs['modules'])) {\n foreach ($this->renameDefs['modules'] as $module => $defs) {\n $this->renameCertainModuleModStrings($module, $defs);\n }\n }\n }",
"public function upgrade_strings()\n {\n }",
"private function changeModuleModStrings($moduleName, $replacementLabels)\n {\n $GLOBALS['log']->info(\"Begining to change module labels for: $moduleName\");\n $currentModuleStrings = return_module_language($this->selectedLanguage, $moduleName);\n $labelKeysToReplace = array(\n array('name' => 'LNK_NEW_RECORD', 'type' => 'plural'), //Module built modules, Create <moduleName>\n array('name' => 'LNK_LIST', 'type' => 'plural'), //Module built modules, View <moduleName>\n array('name' => 'LNK_NEW_###MODULE_SINGULAR###', 'type' => 'singular'),\n array('name' => 'LNK_###MODULE_SINGULAR###_LIST', 'type' => 'plural'),\n array('name' => 'LNK_###MODULE_SINGULAR###_REPORTS', 'type' => 'singular'),\n array('name' => 'LNK_IMPORT_VCARD', 'type' => 'singular'),\n array('name' => 'LNK_IMPORT_###MODULE_PLURAL###', 'type' => 'plural'),\n array('name' => 'MSG_SHOW_DUPLICATES', 'type' => 'singular', 'case' => 'both'),\n array('name' => 'LBL_SAVE_###MODULE_SINGULAR###', 'type' => 'singular'),\n array('name' => 'LBL_LIST_FORM_TITLE', 'type' => 'singular'), //Popup title\n array('name' => 'LBL_SEARCH_FORM_TITLE', 'type' => 'singular'), //Popup title\n );\n\n $replacedLabels = array();\n foreach($labelKeysToReplace as $entry)\n {\n $formattedLanguageKey = $this->formatModuleLanguageKey($entry['name'], $replacementLabels);\n\n //If the static of dynamic key exists it should be replaced.\n if( isset($currentModuleStrings[$formattedLanguageKey]) )\n {\n $oldStringValue = $currentModuleStrings[$formattedLanguageKey];\n $replacedLabels[$formattedLanguageKey] = $this->replaceSingleLabel($oldStringValue, $replacementLabels, $entry);\n if( isset($entry['case']) && $entry['case'] == 'both')\n {\n $replacedLabels[$formattedLanguageKey] = $this->replaceSingleLabel($replacedLabels[$formattedLanguageKey], $replacementLabels, $entry, 'strtolower');\n }\n }\n }\n\n //Save all entries\n ParserLabel::addLabels($this->selectedLanguage, $replacedLabels, $moduleName);\n $this->renamedModules[$moduleName] = true;\n }",
"public function install_strings()\n {\n }",
"public function install_strings() {}",
"public function upgrade_strings() {}",
"protected function setStrTextBase($strModulename) {\n $this->strTextbase = $strModulename;\n }",
"public function generic_strings() {\r\n $this->strings['bad_request'] = __('Invalid Data provided.');\r\n $this->strings['fs_unavailable'] = __('Could not access filesystem.');\r\n $this->strings['fs_error'] = __('Filesystem error.');\r\n $this->strings['fs_no_root_dir'] = __('Unable to locate WordPress Root directory.');\r\n $this->strings['fs_no_content_dir'] = __('Unable to locate WordPress Content directory (wp-content).');\r\n $this->strings['fs_no_plugins_dir'] = __('Unable to locate WordPress Plugin directory.');\r\n $this->strings['fs_no_themes_dir'] = __('Unable to locate WordPress Theme directory.');\r\n /* translators: %s: directory name */\r\n $this->strings['fs_no_folder'] = __('Unable to locate needed folder (%s).');\r\n\r\n $this->strings['download_failed'] = __('Download failed.');\r\n $this->strings['installing_package'] = __('Installing the latest version…');\r\n $this->strings['no_files'] = __('The package contains no files.');\r\n $this->strings['folder_exists'] = __('Destination folder already exists.');\r\n $this->strings['mkdir_failed'] = __('Could not create directory.');\r\n $this->strings['incompatible_archive'] = __('The package could not be installed.');\r\n\r\n $this->strings['maintenance_start'] = __('Enabling Maintenance mode…');\r\n $this->strings['maintenance_end'] = __('Disabling Maintenance mode…');\r\n\r\n }",
"function sumac_load_new_strings()\n{\n//*** new file system for user override strings was not adopted - old system used for new packages\n\n//this creates a javascript user-override list for the new generation packages' text strings\n\tif (isset($_SESSION['sumac_override_text_js']) === false)\n\t{\n\t\t$error_level = error_reporting();\n\t\t$new_level = error_reporting($error_level ^ E_WARNING);\n\t\t$strings = file_get_contents(SUMAC_USER_FOLDER . '/' . 'over_sumac.strings',true);\n\t\t$error_level = error_reporting($error_level);\n\n\t\tif (trim($strings) == '') return '';\n\t\t$stringArray = explode('|',$strings);\n\t\t$_SESSION['sumac_override_text_js'] = 'var sumac_override_sids = [';\n//that starts the javascript array variable ...\n\t\tfor ($i = 0; $i < (count($stringArray)+1); $i = $i + 3)\n\t\t{\n\t\t\t$said = trim($stringArray[$i]);\n\t\t\t//ignore the middle element on each line\n\t\t\tif (($i+2) < count($stringArray)) $sastr = $stringArray[$i+2]; else $sastr = '';\n\t\t\tif ($said == '') continue;\n\t\t\tif ($sastr == '') continue;\n\t\t\t$_SESSION['sumac_override_text_js'] .= '{id:\"'.$said.'\",str:\"'.$sastr.'\"},';\n// ... and that adds each replacement id+str set to it ...\n\t\t}\n\t\t$_SESSION['sumac_override_text_js'] .= '];';\n// ... and that closes the array off.\n\t}\n}",
"static function strings_for_translations() {\n\n __('General Settings', 'wpp');\n __('Find your property', 'wpp');\n __('Edit', 'wpp');\n __('City', 'wpp');\n __('Contact us', 'wpp');\n __('Login', 'wpp');\n __('Explore', 'wpp');\n __('Message', 'wpp');\n __('Phone Number', 'wpp');\n __('Name', 'wpp');\n __('E-mail', 'wpp');\n __('Send Message', 'wpp');\n __('Submit Inquiry', 'wpp');\n __('Inquiry', 'wpp');\n __('Comment About', 'wpp');\n __('Inquire About', 'wpp');\n __('Inquiry About:', 'wpp');\n __('Inquiry message:', 'wpp');\n __('You forgot to enter your e-mail.', 'wpp');\n __('You forgot to enter a message.', 'wpp');\n __('You forgot to enter your name.', 'wpp');\n __('Error with sending message. Please contact site administrator.', 'wpp');\n __('Thank you for your message.', 'wpp');\n }",
"function get_strings() {\n $strings = [\n 'consent_modal_title' => 'Käytämme verkkosivuillamme evästeitä',\n 'consent_modal_description' => 'Käytämme evästeitä käyttökokemuksesi parantamiseksi ja sivuston kehittämiseksi. Osaa evästeistä käytetään analytiikkaan, markkinointiin ja sen kohdentamiseen.<br/><br/><button type=\"button\" data-cc=\"c-settings\" class=\"cc-link\">Lisätietoa ja asetukset</button>. Voit muuttaa asetuksia koska tahansa sivuston alaosassa olevasta linkistä.',\n 'consent_modal_primary_btn_text' => 'Salli evästeet',\n 'consent_modal_secondary_btn_text' => 'Vain välttämättömät',\n 'settings_modal_title' => 'Evästeasetukset',\n 'settings_modal_big_title' => 'Evästeiden käyttö',\n 'settings_modal_description' => 'Käytämme sivustolla yhteistyökumppaneidemme kanssa evästeitä mm. toiminnallisuuteen, mainonnan ja sosiaalisen median liitännäisten toteuttamiseen sekä sivuston käytön analysointiin. Kävijätietoja voidaan jakaa sosiaalisen median palveluja, verkkomainontaa tai analytiikkapalveluja tarjoavien kumppaneiden kanssa. Evästeiden tallennusaika vaihtelee sen tyypistä riippuen. Poistoajankohdan ylittäneet evästeet poistuvat automaattisesti.',\n 'settings_modal_save_settings_btn' => 'Tallenna asetukset',\n 'settings_modal_accept_all_btn' => 'Hyväksy kaikki',\n 'category_necessary_title' => 'Välttämättömät',\n 'category_necessary_description' => 'Välttämättömät evästeet sallivat perustoimintojen käytön ja auttavat tekemään sivustosta toimivan. Verkkosivusto ei toimi kunnolla ilman näitä evästeitä ja ne ovat siksi pakolliset.',\n 'category_functional_title' => 'Toiminnalliset',\n 'category_functional_description' => 'Toiminnalliset evästeet mahdollistavat sivuston paremman toiminnan ja joidenkin kolmansien osapuolien palveluiden, kuten asiakaspalveluchatin lataamisen.',\n 'category_analytics_title' => 'Analytiikka',\n 'category_analytics_description' => 'Analytiikka auttaa meitä ymmärtämään, miten voisimme kehittää sivustoa paremmaksi. Yhteistyökumppanimme voivat käyttää evästeitä myös markkinoinnin kohdentamiseen.',\n ];\n\n // Modify all the strings with one filter.\n $strings = apply_filters( 'air_cookie\\strings', $strings );\n\n // Loop strings to get singular filters for each string.\n foreach ( $strings as $key => $string ) {\n $strings[ $key ] = apply_filters( \"air_cookie\\strings\\{$key}\", $string );\n }\n\n return $strings;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns if a given filter is available. Returns either an array of handler names this filter is available in or false if the filter is not enabled. | public function hasFilter( $name )
{
foreach ( $this->handlers as $handler )
{
if ( $handler->hasFilter( $name ) )
{
return true;
}
}
return false;
} | [
"function hasFilters() {\n return Hook\\Registry::hasFilters($this);\n }",
"public function hasFilter()\n\t{\n\t\treturn FALSE;\n\t}",
"public function hasFilter(): bool\n {\n return isset($this->filter);\n }",
"function hasFilter();",
"function has_filters() {\n //get the list of defined filters\n $filters = $this->get_filters();\n\n //check how many there are\n return count($filters) > 0;\n }",
"function check_filter_enabled()\n{\n if (function_exists('filter_list')) {\n \n return true;\n \n } else {\n \n return false;\n \n }\n \n}",
"public static function hasCustomHandler($filter)\n {\n return isset(self::$FilterSections[$filter]['handler']);\n }",
"public function available()\n {\n return !$this->getFilters()->isEmpty();\n }",
"protected function _isFilterEnabled()\n {\n if (!isset($this->controller->filterFields)) {\n return false;\n }\n\n foreach ($this->controller->filterFields as $field) {\n if (isset($field['actions']) &&\n is_array($field['actions']) &&\n in_array($this->action, $field['actions'])\n ) {\n return true;\n }\n }\n\n return false;\n }",
"protected function hasFilters() : bool\n {\n return (bool) $this->filters;\n }",
"public function isFilter() {\n return $this->definition['filter'] === TRUE;\n }",
"public function is_filterable() {\n\t\treturn $this->is_listable() && isset( $this->data['filterable'] ) && $this->data['filterable'];\n\t}",
"public function hasFilter($name);",
"function has_filters() {\n //this report has no configurable filters\n return false;\n }",
"public function getAvailableFilterNames();",
"function has_filters() {\n //default to true, since almost all reports will have some filtering options\n return true;\n }",
"public function hasFilters()\n\t{\n\t\t$columns = $this->getColumns();\n\t\tforeach($columns as $columnName => $columnConfig)\n\t\t{\n\t\t\tif (isset($columnConfig['filter']) && !empty($columnConfig['filter']))\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn false;\n\t}",
"public function hasCustomFilters()\n {\n return $this->has_custom_filter;\n }",
"function isFilterable(): bool;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Override core new post method. Adds a check for duplicate Tidal username when creating a Tidalcontributed post then calls the Wordpress new post method. | function tidal_newPost( $args ) {
global $wp_xmlrpc_server;
if ( ! empty( $args[3] ) ) {
$content_struct = $args[3];
if ( ! empty( $content_struct['post_type'] ) && $this::post_type == $content_struct['post_type'] ) {
if ( ! empty( $content_struct['custom_fields'] ) && is_array( $content_struct['custom_fields'] ) ) {
foreach ( $content_struct['custom_fields'] as $custom_field ) {
if ( ! empty( $custom_field['key'] ) && $this::username_meta == $custom_field['key'] && ! empty( $custom_field['value'] ) ) {
$query = new WP_Query( array(
'post_type' => $this::post_type,
'meta_query' => array(
array(
'key' => $this::username_meta,
'value' => $custom_field['value'],
)
),
) );
// If username already exist, return an IXR error message
if ( ! empty( $query->posts ) ) {
return new IXR_Error( 2001, esc_html__( 'Username already exists.' ) );
}
}
}
}
} else {
if ( ! empty( $content_struct['custom_fields'] ) && is_array( $content_struct['custom_fields'] ) ) {
foreach ( $content_struct['custom_fields'] as $custom_field ) {
if ( ! empty( $custom_field['key'] ) && $this::tidal_id_meta == $custom_field['key'] && ! empty( $custom_field['value'] ) ) {
$query = new WP_Query( array(
'post_type' => 'post',
'meta_query' => array(
array(
'key' => $this::tidal_id_meta,
'value' => $custom_field['value'],
)
),
) );
// If Tidal ID already exists, return an IXR error message
if ( ! empty( $query->posts ) ) {
return new IXR_Error( 2002, esc_html__( 'Tidal ID already exists.', 'tidal' ) );
}
}
}
}
}
}
return $wp_xmlrpc_server->wp_newPost( $args );
} | [
"public function new_post( $post_id ) {\n\n\t\t\tglobal $bp;\n\n\t\t\t// Check if user should be excluded\n\t\t\tif ( $this->core->exclude_user( $bp->loggedin_user->id ) ) return;\n\n\t\t\t// Limit\n\t\t\tif ( $this->over_hook_limit( 'new_post', 'new_group_forum_post' ) ) return;\n\n\t\t\t// Make sure this is unique event\n\t\t\tif ( $this->core->has_entry( 'new_group_forum_post', $post_id, $bp->loggedin_user->id ) ) return;\n\n\t\t\t// Execute\n\t\t\t$this->core->add_creds(\n\t\t\t\t'new_group_forum_post',\n\t\t\t\t$bp->loggedin_user->id,\n\t\t\t\t$this->prefs['new_post']['creds'],\n\t\t\t\t$this->prefs['new_post']['log'],\n\t\t\t\t$post_id,\n\t\t\t\t'bp_fpost',\n\t\t\t\t$this->mycred_type\n\t\t\t);\n\n\t\t}",
"public function metaWeblog_newPost($args) {\n $this->auth(fallback($args[1]), fallback($args[2]));\n global $user;\n\n if (!$user->group->can(\"add_post\", \"add_draft\"))\n return new IXR_Error(403, __(\"You do not have sufficient privileges to add posts.\"));\n\n fallback($args[3], array());\n fallback($args[3][\"description\"], \"\");\n fallback($args[3][\"mt_basename\"], \"\");\n fallback($args[3][\"title\"], \"\");\n fallback($args[3][\"post_status\"]);\n fallback($args[3][\"mt_allow_pings\"], \"open\");\n\n $trigger = Trigger::current();\n $struct = $args[3];\n\n # Support for extended content.\n if (isset($struct[\"mt_text_more\"]))\n $struct[\"description\"].= \"<!--more-->\".$struct[\"mt_text_more\"];\n\n # Convert statuses from WordPress to Chyrp equivalents.\n switch ($struct[\"post_status\"]) {\n case \"draft\":\n $status = \"draft\";\n break;\n case \"future\":\n $status = \"scheduled\";\n break;\n case \"private\":\n $status = \"private\";\n break;\n default:\n $status = \"public\";\n }\n\n $slug = oneof(sanitize($struct[\"mt_basename\"], true, true, 80), slug(8));\n $status = $user->group->can(\"add_post\") ? $status : \"draft\" ;\n $pings = ($struct[\"mt_allow_pings\"] == \"open\");\n $created_at = oneof($this->convertFromDateCreated($struct), datetime());\n $values = array(\"title\" => $struct[\"title\"],\n \"body\" => oneof($struct[\"description\"], __(\"Nothing here yet!\")));\n\n $trigger->filter($values, \"metaWeblog_before_newPost\", $struct);\n\n $post = Post::add($values,\n $slug,\n \"\",\n \"text\",\n $user->id,\n null,\n $status,\n $created_at,\n null,\n $pings);\n\n $trigger->call(\"metaWeblog_newPost\", $struct, $post);\n return $post->id;\n }",
"function blogger_newPost($args) {\n\n\t global $wpdb;\n\n\t\t$this->escape($args);\n\n\t $blog_ID = $args[1]; /* though we don't use it yet */\n\t $user_login = $args[2];\n\t $user_pass = $args[3];\n\t $content = $args[4];\n\t $publish = $args[5];\n\n\t if (!$this->login_pass_ok($user_login, $user_pass)) {\n\t return $this->error;\n\t }\n\t \n\t $cap = ($publish) ? 'publish_posts' : 'edit_posts';\n\n\t $user = new WP_User(0, $user_login);\n\t if ( !$user->has_cap($cap) )\n\t return new IXR_Error(401, 'Sorry, you can not post on this weblog or category.');\n\n\t $post_status = ($publish) ? 'publish' : 'draft';\n\n\t $post_author = $user->ID;\n\n\t $post_title = xmlrpc_getposttitle($content);\n\t $post_category = xmlrpc_getpostcategory($content);\n\t $post_content = xmlrpc_removepostdata($content);\n\n\t $post_date = current_time('mysql');\n\t $post_date_gmt = current_time('mysql', 1);\n\n\t $post_data = compact('blog_ID', 'post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_category', 'post_status');\n\n\t $post_ID = wp_insert_post($post_data);\n\n\t if (!$post_ID) {\n\t return new IXR_Error(500, 'Sorry, your entry could not be posted. Something wrong happened.');\n\t }\n\n\t logIO('O', \"Posted ! ID: $post_ID\");\n\n\t return $post_ID;\n\t}",
"public function a2020_duplicate_post($post_id){\r\n\t\t\t\r\n\t\t\tglobal $wpdb;\r\n\t\t\t$post = get_post( $post_id );\r\n\t\t\t\r\n\t\t\t$current_user = wp_get_current_user();\r\n\t\t\t$new_post_author = $current_user->ID;\r\n\t\t\t\r\n\t\t\t$args = array(\r\n\t\t\t\t'comment_status' => $post->comment_status, \r\n\t\t\t\t'ping_status' => $post->ping_status,\r\n\t\t\t\t'post_author' => $new_post_author,\r\n\t\t\t\t'post_content' => $post->post_content,\r\n\t\t\t\t'post_excerpt' => $post->post_excerpt,\r\n\t\t\t\t'post_name' => $post->post_name,\r\n\t\t\t\t'post_parent' => $post->post_parent,\r\n\t\t\t\t'post_password' => $post->post_password,\r\n\t\t\t\t'post_status' => 'draft',\r\n\t\t\t\t'post_title' => $post->post_title.' (copy)',\r\n\t\t\t\t'post_type' => $post->post_type,\r\n\t\t\t\t'to_ping' => $post->to_ping,\r\n\t\t\t\t'menu_order' => $post->menu_order\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t$new_post_id = wp_insert_post( $args );\r\n\t\t\t\r\n\t\t\tif(!$new_post_id){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$taxonomies = get_object_taxonomies($post->post_type); // returns array of taxonomy names for post type, ex array(\"category\", \"post_tag\");\r\n\t\t\tforeach ($taxonomies as $taxonomy) {\r\n\t\t\t\t$post_terms = wp_get_object_terms($post_id, $taxonomy, array('fields' => 'slugs'));\r\n\t\t\t\twp_set_object_terms($new_post_id, $post_terms, $taxonomy, false);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$post_meta_infos = $wpdb->get_results(\"SELECT meta_key, meta_value FROM $wpdb->postmeta WHERE post_id=$post_id\");\r\n\t\t\tif (count($post_meta_infos)!=0) {\r\n\t\t\t\t$sql_query = \"INSERT INTO $wpdb->postmeta (post_id, meta_key, meta_value) \";\r\n\t\t\t\tforeach ($post_meta_infos as $meta_info) {\r\n\t\t\t\t\t\r\n\t\t\t \t$meta_key = $meta_info->meta_key;\r\n\t\t\t \tif( $meta_key == '_wp_old_slug' ) continue;\r\n\t\t\t \t \t$meta_value = addslashes($meta_info->meta_value);\r\n\t\t\t \t\t$sql_query_sel[]= \"SELECT $new_post_id, '$meta_key', '$meta_value'\";\r\n\t\t\t\t\t \r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$sql_query.= implode(\" UNION ALL \", $sql_query_sel);\r\n\t\t\t\t$wpdb->query($sql_query);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$postobject = get_post($new_post_id);\r\n\t\t\t\r\n\t\t\treturn true;\r\n\t\t\t\r\n\t}",
"function createPost();",
"function makeFollowerFor_wpw_fp_plugin($new_post_id){\n global $user_ID, $user_email, $wpw_fp_options;\n\n // Create post object\n $add_follow_post_arr = array(\n 'post_title'\t\t=>\t$user_ID,\n 'post_content'\t\t=>\t'',\n 'post_status'\t\t=>\t'publish',\n 'post_type'\t\t\t=>\t'wpwfollowpost',\n 'post_parent'\t\t=>\t$new_post_id,\n 'author' => $user_ID,\n 'post_author' => $user_ID,\n );\n\n $followed_post_id = wp_insert_post( $add_follow_post_arr );\n\n if($followed_post_id){\n // update follow status\n update_post_meta( $followed_post_id, '_wpw_fp_follow_status', 1 );\n\n // update post user email\n update_post_meta( $followed_post_id, '_wpw_fp_post_user_email', $user_email );\n }\n }",
"function kinsta_duplicate_post(){\n\t\n\tglobal $wpdb;\n\t\n\t// Die if post not selected\n\tif (! ( isset( $_GET['post']) || isset( $_POST['post']) || ( isset($_REQUEST['action']) && 'kinsta_duplicate_post' == $_REQUEST['action'] ) ) ) {\n\t\twp_die( __( 'Please select a post to duplicate.', 'kinsta' ) );\n\t}\n \n\t// Verify nonce\n\tif ( ! isset( $_GET['duplicate_nonce'] ) || ! wp_verify_nonce( $_GET['duplicate_nonce'], basename( __FILE__ ) ) ) {\n\t\treturn;\t\t\n\t}\n \n\t// Get id of post to be duplicated and data from it\n\t$post_id = ( isset( $_GET['post']) ? absint( $_GET['post'] ) : absint( $_POST['post'] ) );\n\t$post = get_post( $post_id );\n \n\t// duplicate the post\n\tif ( isset( $post ) && $post != null ) {\n \n\t\t// args for new post\n\t\t$args = array(\n\t\t\t'comment_status' => $post->comment_status,\n\t\t\t'ping_status' => $post->ping_status,\n\t\t\t'post_author' => $post->post_author,\n\t\t\t'post_content' => $post->post_content,\n\t\t\t'post_excerpt' => $post->post_excerpt,\n\t\t\t'post_name' => $post->post_name,\n\t\t\t'post_parent' => $post->post_parent,\n\t\t\t'post_password' => $post->post_password,\n\t\t\t'post_status' => 'draft',\n\t\t\t'post_title' => $post->post_title,\n\t\t\t'post_type' => $post->post_type,\n\t\t\t'to_ping' => $post->to_ping,\n\t\t\t'menu_order' => $post->menu_order\n\t\t);\n \n\t\t// insert the new post\n\t\t$new_post_id = wp_insert_post( $args );\n \n\t\t// add taxonomy terms to the new post\n\t\t// identify taxonomies that apply to the post type\n\t\t$taxonomies = get_object_taxonomies( $post->post_type );\n\t\t\n\t\t// add the taxonomy terms to the new post\n\t\tforeach ( $taxonomies as $taxonomy ) {\n\t\t\t\n\t\t\t$post_terms = wp_get_object_terms( $post_id, $taxonomy, array( 'fields' => 'slugs' ) );\n\t\t\twp_set_object_terms( $new_post_id, $post_terms, $taxonomy, false );\n\t\t\n\t\t}\n \n\t\t// use SQL queries to duplicate postmeta\n\t\t$post_metas = $wpdb->get_results(\"SELECT meta_key, meta_value FROM $wpdb->postmeta WHERE post_id=$post_id\");\n\t\t\n\t\tif ( count( $post_metas )!=0 ) {\n\t\t\t\n\t\t\t$sql_query = \"INSERT INTO $wpdb->postmeta ( post_id, meta_key, meta_value ) \";\n\t\t\t\n\t\t\tforeach ( $post_metas as $post_meta ) {\n\t\t\t\t\n\t\t\t\t$meta_key = $post_metas->meta_key;\n\t\t\t\t\n\t\t\t\tif( $meta_key == '_wp_old_slug' ) continue;\n\t\t\t\t$meta_value = addslashes( $post_metas->meta_value);\n\t\t\t\t$sql_query_sel[]= \"SELECT $new_post_id, '$meta_key', '$meta_value'\";\n\t\t\t}\n\t\t\t\n\t\t\t$sql_query.= implode(\" UNION ALL \", $sql_query_sel);\n\t\t\t$wpdb->query( $sql_query );\n\t\t\n\t\t}\n \n \n\t\t// redirect to admin screen depending on post type\n\t\t$posttype = get_post_type( $post_id );\n\t\twp_redirect( admin_url( 'edit.php?post_type=' . $posttype ) );\n\t\n\t} else {\n\t\t// display an error message if the post id of the post to be duplicated can't be found\n\t\twp_die( __( 'Post cannot be found. Please select a post to duplicate.', 'kinsta' ) );\n\t}\n\n}",
"function mw_newPost($args) {\n\n\t global $wpdb, $post_default_category;\n\n\t\t$this->escape($args);\n\n\t $blog_ID = $args[0]; // we will support this in the near future\n\t $user_login = $args[1];\n\t $user_pass = $args[2];\n\t $content_struct = $args[3];\n\t $publish = $args[4];\n\n\t if (!$this->login_pass_ok($user_login, $user_pass)) {\n\t return $this->error;\n\t }\n\n\t $user = new WP_User(0, $user_login);\n\t if ( !$user->has_cap('publish_posts') )\n\t return new IXR_Error(401, 'Sorry, you can not post on this weblog or category.');\n\n\t $post_author = $user->ID;\n\n\t $post_title = $content_struct['title'];\n\t $post_content = apply_filters( 'content_save_pre', $content_struct['description'] );\n\t $post_status = $publish ? 'publish' : 'draft';\n\n\t $post_excerpt = $content_struct['mt_excerpt'];\n\t $post_more = $content_struct['mt_text_more'];\n\n\t $comment_status = (empty($content_struct['mt_allow_comments'])) ?\n\t get_settings('default_comment_status')\n\t : $content_struct['mt_allow_comments'];\n\n\t $ping_status = (empty($content_struct['mt_allow_pings'])) ?\n\t get_settings('default_ping_status')\n\t : $content_struct['mt_allow_pings'];\n\n\t if ($post_more) {\n\t $post_content = $post_content . \"\\n<!--more-->\\n\" . $post_more;\n\t }\n\n\t\t$to_ping = $content_struct['mt_tb_ping_urls'];\n\n\t // Do some timestamp voodoo\n\t $dateCreatedd = $content_struct['dateCreated'];\n\t if (!empty($dateCreatedd)) {\n\t $dateCreated = $dateCreatedd->getIso();\n\t $post_date = get_date_from_gmt(iso8601_to_datetime($dateCreated));\n\t $post_date_gmt = iso8601_to_datetime($dateCreated, GMT);\n\t } else {\n\t $post_date = current_time('mysql');\n\t $post_date_gmt = current_time('mysql', 1);\n\t }\n\n\t $catnames = $content_struct['categories'];\n\t logIO('O', 'Post cats: ' . printr($catnames,true));\n\t $post_category = array();\n\n\t if (is_array($catnames)) {\n\t foreach ($catnames as $cat) {\n\t $post_category[] = get_cat_ID($cat);\n\t }\n\t }\n\t\t\n\t // We've got all the data -- post it:\n\t $postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'comment_status', 'ping_status', 'to_ping');\n\n\t $post_ID = wp_insert_post($postdata);\n\n\t if (!$post_ID) {\n\t return new IXR_Error(500, 'Sorry, your entry could not be posted. Something wrong happened.');\n\t }\n\n\t logIO('O', \"Posted ! ID: $post_ID\");\n\n\t return strval($post_ID);\n\t}",
"function createPoster()\r\n {\r\n \r\n }",
"function create_new_user_posts($user_id){\n if (!$user_id>0)\n return;\n //here we know the user has been created so to create \n //3 posts we call wp_insert_post 3 times.\n // Create post object\n $user = get_user_by('id', $user_id); \n $streamer_account = array(\n 'post_title' => $user->user_nicename,\n 'post_status' => 'publish',\n 'post_author' => $user_id,\n 'post_type' => 'streamers'\n );\n\n // Insert the post into the database\n $streamer_act = wp_insert_post( $streamer_account );\n update_user_meta( $user_id, 'useracct', $streamer_act ); //this gets the id of the use, adds a meta useracct and places the added post id for the account, so that there will be only 1 streamer post per user account\n wp_update_post();\n\n}",
"public function duplicate_post_as_draft(){\n global $wpdb;\n if (! ( isset( $_GET['post']) || isset( $_POST['post']) || ( isset($_REQUEST['action']) && 'wtm_duplicate_post_as_draft' == $_REQUEST['action'] ) ) ) {\n wp_die('No post to duplicate has been supplied!');\n }\n \n /*\n * Nonce verification\n */\n if ( !isset( $_GET['duplicate_nonce'] ) || !wp_verify_nonce( $_GET['duplicate_nonce'], basename( __FILE__ ) ) )\n return;\n \n /*\n * get the original post id\n */\n $post_id = (isset($_GET['post']) ? absint( $_GET['post'] ) : absint( $_POST['post'] ) );\n /*\n * and all the original post data then\n */\n $post = get_post( $post_id );\n \n /*\n * if you don't want current user to be the new post author,\n * then change next couple of lines to this: $new_post_author = $post->post_author;\n */\n $current_user = wp_get_current_user();\n $new_post_author = $current_user->ID;\n \n /*\n * if post data exists, create the post duplicate\n */\n if (isset( $post ) && $post != null) {\n \n /*\n * new post data array\n */\n $args = array(\n 'comment_status' => $post->comment_status,\n 'ping_status' => $post->ping_status,\n 'post_author' => $new_post_author,\n 'post_content' => $post->post_content,\n 'post_excerpt' => $post->post_excerpt,\n 'post_name' => $post->post_name,\n 'post_parent' => $post->post_parent,\n 'post_password' => $post->post_password,\n 'post_status' => 'draft',\n 'post_title' => $post->post_title,\n 'post_type' => $post->post_type,\n 'to_ping' => $post->to_ping,\n 'menu_order' => $post->menu_order\n );\n \n /*\n * insert the post by wp_insert_post() function\n */\n $new_post_id = wp_insert_post( $args );\n \n /*\n * get all current post terms ad set them to the new post draft\n */\n $taxonomies = get_object_taxonomies($post->post_type); // returns array of taxonomy names for post type, ex array(\"category\", \"post_tag\");\n foreach ($taxonomies as $taxonomy) {\n $post_terms = wp_get_object_terms($post_id, $taxonomy, array('fields' => 'slugs'));\n wp_set_object_terms($new_post_id, $post_terms, $taxonomy, false);\n }\n \n /*\n * duplicate all post meta just in two SQL queries\n */\n $post_meta_infos = $wpdb->get_results(\"SELECT meta_key, meta_value FROM $wpdb->postmeta WHERE post_id=$post_id\");\n if (count($post_meta_infos)!=0) {\n $sql_query = \"INSERT INTO $wpdb->postmeta (post_id, meta_key, meta_value) \";\n foreach ($post_meta_infos as $meta_info) {\n $meta_key = $meta_info->meta_key;\n if( $meta_key == '_wp_old_slug' ) continue;\n $meta_value = addslashes($meta_info->meta_value);\n $sql_query_sel[]= \"SELECT $new_post_id, '$meta_key', '$meta_value'\";\n }\n $sql_query.= implode(\" UNION ALL \", $sql_query_sel);\n $wpdb->query($sql_query);\n }\n \n \n /*\n * finally, redirect to the edit post screen for the new draft\n */\n wp_redirect( admin_url( 'post.php?action=edit&post=' . $new_post_id ) );\n exit;\n } else {\n wp_die('Post creation failed, could not find original post: ' . $post_id);\n }\n }",
"function kapost_create_user_for_post($id)\n{\n\t$post = get_post($id);\n\tif(!is_object($post)) return false;\n\n\t$meta = kapost_attribution_meta($id);\n\tif($meta === false) return false;\n\n\trequire_once(ABSPATH . WPINC . '/registration.php');\n\n\t$uid = email_exists($meta['email']);\n\tif(!$uid)\n\t{\n\t\t$c = 0;\n\t\t$user_name = $user_login = str_replace(\" \",\"\",strtolower($meta['name']));\n\n\t\t// FIXME: find a better way to do this\n\t\t// Assuming 1000 collisions is safe enough for now, but there must be\n\t\t// a better way to achieve this; the request will time out before\n\t\t// reaching 1000 anyway ...\n\t\twhile(username_exists($user_name))\n\t\t{\n\t\t\t$user_name = \"$user_login-$c\";\n\t\t\tif(++$c == 1000) return false;\n\t\t}\n\n\t\t$uid = wp_insert_user(array(\n\t\t\t'user_login'=>esc_sql($user_name),\n\t\t\t'user_pass'=>wp_generate_password(12,false),\n\t\t\t'user_email'=>esc_sql($meta['email']),\n\t\t\t'user_url'=>esc_sql($meta['profile']),\n\t\t\t'display_name'=>esc_sql($meta['name']),\n\t\t\t'role'=>'contributor'\n\t\t));\n\n\t\t// Should never really happen\n\t\tif(!$uid) return false;\n\t}\n\n\t// Override our community user with original author ...\n\t$post->post_author = $uid;\n\treturn $post;\n}",
"public function creating(Post $post)\n {\n // Se ejecute si no se esta ingresando registros desde la consola\n if (! \\App::runningInConsole()) {\n $post->user_id = auth()->user()->id;\n }\n }",
"function duplicate_post_save_as_new_post($status = ''){\n\tif(!duplicate_post_is_current_user_allowed_to_copy()){\n\t\twp_die(esc_html__('Current user is not allowed to copy posts.', 'duplicate-post'));\n\t}\n\t\n\tif (! ( isset( $_GET['post']) || isset( $_POST['post']) || ( isset($_REQUEST['action']) && 'duplicate_post_save_as_new_post' == $_REQUEST['action'] ) ) ) {\n\t\twp_die(esc_html__('No post to duplicate has been supplied!', 'duplicate-post'));\n\t}\n\n\t// Get the original post\n\t$id = (isset($_GET['post']) ? $_GET['post'] : $_POST['post']);\n\t\n\tcheck_admin_referer('duplicate-post_' . $id);\n\t\n\t$post = get_post($id);\t\n\n\t// Copy the post and insert it\n\tif (isset($post) && $post!=null) {\n\t\t$new_id = duplicate_post_create_duplicate($post, $status);\n\t\t\n\t\tif ($status == ''){\n\t\t\t$sendback = wp_get_referer();\n\t\t\tif ( ! $sendback ||\n\t\t\t\t\tstrpos( $sendback, 'post.php' ) !== false ||\n\t\t\t\t\tstrpos( $sendback, 'post-new.php' ) !== false ) {\n\t\t\t\t\t\tif ( 'attachment' == $post_type ) {\n\t\t\t\t\t\t\t$sendback = admin_url( 'upload.php' );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$sendback = admin_url( 'edit.php' );\n\t\t\t\t\t\t\tif ( ! empty( $post_type ) ) {\n\t\t\t\t\t\t\t\t$sendback = add_query_arg( 'post_type', $post_type, $sendback );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$sendback = remove_query_arg( array('trashed', 'untrashed', 'deleted', 'cloned', 'ids'), $sendback );\n\t\t\t\t\t}\n\t\t\t// Redirect to the post list screen\n\t\t\twp_redirect( add_query_arg( array( 'cloned' => 1, 'ids' => $post->ID), $sendback ) );\n\t\t} else {\n\t\t\t// Redirect to the edit screen for the new draft post\n\t\t\twp_redirect( add_query_arg( array( 'cloned' => 1, 'ids' => $post->ID), admin_url( 'post.php?action=edit&post=' . $new_id ) ) );\n\t\t}\n\t\texit;\n\n\t} else {\n\t\twp_die(esc_html__('Copy creation failed, could not find original:', 'duplicate-post') . ' ' . htmlspecialchars($id));\n\t}\n}",
"public function clone_flow() {\n\n\t\tglobal $wpdb;\n\n\t\tif ( ! ( isset( $_GET['post'] ) || isset( $_POST['post'] ) || ( isset( $_REQUEST['action'] ) && 'cartflows_clone_flow' === $_REQUEST['action'] ) ) ) {\n\t\t\twp_die( 'No post to duplicate has been supplied!' );\n\t\t}\n\n\t\t/*\n\t\t * Nonce verification\n\t\t */\n\t\tif ( ! isset( $_GET['flow_clone_nonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_GET['flow_clone_nonce'] ) ), basename( __FILE__ ) ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t/**\n\t\t * Get the original post id\n\t\t */\n\t\t$post_id = ( isset( $_GET['post'] ) ? absint( $_GET['post'] ) : absint( $_POST['post'] ) );\n\n\t\t/**\n\t\t * And all the original post data then\n\t\t */\n\t\t$post = get_post( $post_id );\n\n\t\t/**\n\t\t * Assign current user to be the new post author\n\t\t */\n\t\t$current_user = wp_get_current_user();\n\t\t$new_post_author = $current_user->ID;\n\n\t\t/**\n\t\t * If post data exists, create the post duplicate\n\t\t */\n\t\tif ( isset( $post ) && null !== $post ) {\n\n\t\t\t/**\n\t\t\t * New post data array\n\t\t\t */\n\n\t\t\t$args = array(\n\t\t\t\t'comment_status' => $post->comment_status,\n\t\t\t\t'ping_status' => $post->ping_status,\n\t\t\t\t'post_author' => $new_post_author,\n\t\t\t\t'post_content' => $post->post_content,\n\t\t\t\t'post_excerpt' => $post->post_excerpt,\n\t\t\t\t'post_name' => $post->post_name,\n\t\t\t\t'post_parent' => $post->post_parent,\n\t\t\t\t'post_password' => $post->post_password,\n\t\t\t\t'post_status' => $post->post_status,\n\t\t\t\t'post_title' => $post->post_title . ' Clone',\n\t\t\t\t'post_type' => $post->post_type,\n\t\t\t\t'to_ping' => $post->to_ping,\n\t\t\t\t'menu_order' => $post->menu_order,\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * Insert the post\n\t\t\t */\n\t\t\t$new_flow_id = wp_insert_post( $args );\n\n\t\t\t/**\n\t\t\t * Get all current post terms ad set them to the new post\n\t\t\t */\n\t\t\t// returns array of taxonomy names for post type, ex array(\"category\", \"post_tag\");.\n\t\t\t$taxonomies = get_object_taxonomies( $post->post_type );\n\n\t\t\tforeach ( $taxonomies as $taxonomy ) {\n\n\t\t\t\t$post_terms = wp_get_object_terms( $post_id, $taxonomy, array( 'fields' => 'slugs' ) );\n\n\t\t\t\twp_set_object_terms( $new_flow_id, $post_terms, $taxonomy, false );\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Duplicate all post meta just in two SQL queries\n\t\t\t */\n\t\t\t// @codingStandardsIgnoreStart\n\t\t\t$post_meta_infos = $wpdb->get_results(\n\t\t\t\t\"SELECT meta_key, meta_value FROM $wpdb->postmeta WHERE post_id=$post_id\"\n\t\t\t);\n\t\t\t// @codingStandardsIgnoreEnd\n\n\t\t\tif ( ! empty( $post_meta_infos ) ) {\n\n\t\t\t\t$sql_query = \"INSERT INTO $wpdb->postmeta (post_id, meta_key, meta_value) VALUES \";\n\n\t\t\t\t$sql_query_sel = array();\n\n\t\t\t\tforeach ( $post_meta_infos as $meta_info ) {\n\n\t\t\t\t\t$meta_key = $meta_info->meta_key;\n\n\t\t\t\t\tif ( '_wp_old_slug' === $meta_key ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$meta_value = addslashes( $meta_info->meta_value );\n\n\t\t\t\t\t$sql_query_sel[] = \"($new_flow_id, '$meta_key', '$meta_value')\";\n\t\t\t\t}\n\n\t\t\t\t$sql_query .= implode( ',', $sql_query_sel );\n\n\t\t\t\t// @codingStandardsIgnoreStart\n\t\t\t\t$wpdb->query( $sql_query );\n \t\t\t// @codingStandardsIgnoreEnd\n\t\t\t}\n\n\t\t\t/* Steps Cloning */\n\t\t\t$flow_steps = get_post_meta( $post_id, 'wcf-steps', true );\n\t\t\t$new_flow_steps = array();\n\n\t\t\t/* Set Steps Empty */\n\t\t\tupdate_post_meta( $new_flow_id, 'wcf-steps', $new_flow_steps );\n\n\t\t\tif ( is_array( $flow_steps ) && ! empty( $flow_steps ) ) {\n\n\t\t\t\tforeach ( $flow_steps as $index => $step_data ) {\n\n\t\t\t\t\t$step_id = $step_data['id'];\n\t\t\t\t\t$step_type = get_post_meta( $step_id, 'wcf-step-type', true );\n\n\t\t\t\t\t$step_object = get_post( $step_id );\n\n\t\t\t\t\t/**\n\t\t\t\t\t * New step post data array\n\t\t\t\t\t */\n\t\t\t\t\t$step_args = array(\n\t\t\t\t\t\t'comment_status' => $step_object->comment_status,\n\t\t\t\t\t\t'ping_status' => $step_object->ping_status,\n\t\t\t\t\t\t'post_author' => $new_post_author,\n\t\t\t\t\t\t'post_content' => $step_object->post_content,\n\t\t\t\t\t\t'post_excerpt' => $step_object->post_excerpt,\n\t\t\t\t\t\t'post_name' => $step_object->post_name,\n\t\t\t\t\t\t'post_parent' => $step_object->post_parent,\n\t\t\t\t\t\t'post_password' => $step_object->post_password,\n\t\t\t\t\t\t'post_status' => $step_object->post_status,\n\t\t\t\t\t\t'post_title' => $step_object->post_title,\n\t\t\t\t\t\t'post_type' => $step_object->post_type,\n\t\t\t\t\t\t'to_ping' => $step_object->to_ping,\n\t\t\t\t\t\t'menu_order' => $step_object->menu_order,\n\t\t\t\t\t);\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Insert the post\n\t\t\t\t\t */\n\t\t\t\t\t$new_step_id = wp_insert_post( $step_args );\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Duplicate all step meta\n\t\t\t\t\t */\n\t\t\t\t\t// @codingStandardsIgnoreStart\n\t\t\t\t\t$post_meta_infos = $wpdb->get_results(\n\t\t\t\t\t\t\"SELECT meta_key, meta_value FROM $wpdb->postmeta WHERE post_id=$step_id\"\n\t\t\t\t\t);\n\t\t\t\t\t// @codingStandardsIgnoreEnd\n\n\t\t\t\t\tif ( ! empty( $post_meta_infos ) ) {\n\n\t\t\t\t\t\t$sql_query = \"INSERT INTO $wpdb->postmeta (post_id, meta_key, meta_value) VALUES \";\n\n\t\t\t\t\t\t$sql_query_sel = array();\n\n\t\t\t\t\t\tforeach ( $post_meta_infos as $meta_info ) {\n\n\t\t\t\t\t\t\t$meta_key = $meta_info->meta_key;\n\n\t\t\t\t\t\t\tif ( '_wp_old_slug' === $meta_key ) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$meta_value = addslashes( $meta_info->meta_value );\n\n\t\t\t\t\t\t\t$sql_query_sel[] = \"($new_step_id, '$meta_key', '$meta_value')\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$sql_query .= implode( ',', $sql_query_sel );\n\n\t\t\t\t\t\t// @codingStandardsIgnoreStart\n\t\t\t\t\t\t$wpdb->query( $sql_query );\n\t\t \t\t\t// @codingStandardsIgnoreEnd\n\t\t\t\t\t}\n\n\t\t\t\t\t// insert post meta.\n\t\t\t\t\tupdate_post_meta( $new_step_id, 'wcf-flow-id', $new_flow_id );\n\t\t\t\t\tupdate_post_meta( $new_step_id, 'wcf-step-type', $step_type );\n\n\t\t\t\t\twp_set_object_terms( $new_step_id, $step_type, CARTFLOWS_TAXONOMY_STEP_TYPE );\n\t\t\t\t\twp_set_object_terms( $new_step_id, 'flow-' . $new_flow_id, CARTFLOWS_TAXONOMY_STEP_FLOW );\n\n\t\t\t\t\t/* Add New Flow Steps */\n\t\t\t\t\t$new_flow_steps[] = array(\n\t\t\t\t\t\t'id' => $new_step_id,\n\t\t\t\t\t\t'title' => $step_object->post_title,\n\t\t\t\t\t\t'type' => $step_type,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/* Update New Flow Step Post Meta */\n\t\t\tupdate_post_meta( $new_flow_id, 'wcf-steps', $new_flow_steps );\n\n\t\t\t/* Clear Page Builder Cache */\n\t\t\t$this->clear_cache();\n\n\t\t\t/**\n\t\t\t * Redirect to the new flow edit screen\n\t\t\t */\n\t\t\twp_safe_redirect( admin_url( 'post.php?action=edit&post=' . $new_flow_id ) );\n\t\t\texit;\n\t\t} else {\n\t\t\twp_die( 'Post creation failed, could not find original post: ' . $post_id );\n\t\t}\n\t}",
"function rd_duplicate_post_as_draft(){\r\n\r\n\trequire_once('library/ZhConversion_simp_to_trad.php');\r\n\r\n\tglobal $wpdb;\r\n\r\n\tif (! ( isset( $_GET['post']) || isset( $_POST['post']) || ( isset($_REQUEST['action']) && 'rd_duplicate_post_as_draft' == $_REQUEST['action'] ) ) ) {\r\n\t\twp_die('No post to duplicate has been supplied!');\r\n\t}\r\n \r\n\t/*\r\n\t * get the original post id\r\n\t */\r\n\t$post_id = (isset($_GET['post']) ? $_GET['post'] : $_POST['post']);\r\n\t/*\r\n\t * and all the original post data then\r\n\t */\r\n\t$post = get_post( $post_id );\r\n \r\n\t/*\r\n\t * if you don't want current user to be the new post author,\r\n\t * then change next couple of lines to this: $new_post_author = $post->post_author;\r\n\t */\r\n\t$current_user = wp_get_current_user();\r\n\t$new_post_author = $current_user->ID;\r\n \r\n\t/*\r\n\t * if post data exists, create the post duplicate\r\n\t */\r\n\tif (isset( $post ) && $post != null) {\r\n \r\n\t\t/*\r\n\t\t * new post data array\r\n\t\t */\r\n\t\t$post_content_trad = strtr(strtr($post->post_content, $zh2TW), $zh2Hant);\t\r\n\t\t$post_excerpt_trad = strtr(strtr($post->post_excerpt, $zh2TW), $zh2Hant);\t\r\n\t\t$post_name_trad = strtr(strtr($post->post_name, $zh2TW), $zh2Hant);\t\r\n\t\t$post_title_trad = strtr(strtr($post->post_title, $zh2TW), $zh2Hant);\t\r\n\t\t\r\n\t\t$args = array(\r\n\r\n\t\t\t\r\n\t\t\t/* It is here you make the change */\r\n\t\t\t//'post_content' => $post->post_content,\r\n\t\t\t'post_content' => $post_content_trad,\r\n\t\t\t// 'post_excerpt' => $post->post_excerpt,\r\n\t\t\t'post_excerpt' => $post_excerpt_trad,\r\n\r\n\t\t\t/* disable the post_name to force the creation of the slug */\r\n\t\t\t// 'post_name' => $post->post_name,\r\n\t\t\t// 'post_name' => $post_name_trad,\r\n\r\n\t\t\t// 'post_title' => $post->post_title,\r\n\t\t\t'post_title' => $post_title_trad,\r\n\t\t\t\r\n\t\t\t'comment_status' => $post->comment_status,\r\n\t\t\t'ping_status' => $post->ping_status,\r\n\t\t\t'post_author' => $new_post_author,\t\t\t\r\n\t\t\t'post_parent' => $post->post_parent,\r\n\t\t\t'post_password' => $post->post_password,\r\n\t\t\t'post_status' => 'draft',\r\n\t\t\t'post_type' => $post->post_type,\r\n\t\t\t'to_ping' => $post->to_ping,\r\n\t\t\t'menu_order' => $post->menu_order\r\n\t\t);\r\n \r\n \t \r\n \t // var_dump($post_title_trad);\r\n\t\t\r\n\t\t/*\r\n\t\t * insert the post by wp_insert_post() function\r\n\t\t */\r\n\t\t$new_post_id = wp_insert_post( $args );\r\n \r\n\t\t/*\r\n\t\t * get all current post terms ad set them to the new post draft\r\n\t\t */\r\n\t\t// returns array of taxonomy names for post type, ex array(\"category\", \"post_tag\");\r\n\t\t\r\n\t\t$taxonomies = get_object_taxonomies($post->post_type);\r\n\t\tforeach ($taxonomies as $taxonomy) {\r\n\t\t$post_terms = wp_get_object_terms($post_id, $taxonomy, array('fields' => 'slugs'));\r\n\t\t\twp_set_object_terms($new_post_id, $post_terms, $taxonomy, false);\r\n\t\t}\r\n\t\r\n\t\t/*\r\n\t\t * duplicate all post meta\r\n\t\t */\r\n\t\t$post_meta_infos = $wpdb->get_results(\"SELECT meta_key, meta_value FROM $wpdb->postmeta WHERE post_id=$post_id\");\r\n\t\tif (count($post_meta_infos)!=0) {\r\n\t\t\t$sql_query = \"INSERT INTO $wpdb->postmeta (post_id, meta_key, meta_value) \";\r\n\t\t\tforeach ($post_meta_infos as $meta_info) {\r\n\t\t\t\t$meta_key = $meta_info->meta_key;\r\n\t\t\t\t$meta_value = addslashes($meta_info->meta_value);\r\n\t\t\t\t$sql_query_sel[]= \"SELECT $new_post_id, '$meta_key', '$meta_value'\";\r\n\t\t\t}\r\n\t\t\t$sql_query.= implode(\" UNION ALL \", $sql_query_sel);\r\n\t\t\t$wpdb->query($sql_query);\r\n\t\t}\r\n \r\n \r\n\t\t/*\r\n\t\t * finally, redirect to the edit post screen for the new draft\r\n\t\t */\r\n\t\twp_redirect( admin_url( 'post.php?action=edit&post=' . $new_post_id ) );\r\n\t\texit;\r\n\t} else {\r\n\t\twp_die('Post creation failed, could not find original post: ' . $post_id);\r\n\t}\r\n}",
"protected function clone_post_fully( WP_Post $post, array $clone_args ): int {\n\t\t\t$defaults_clone_args = array(\n\t\t\t\t'copy_name' => $this->get_default_copy_name( $post ),\n\t\t\t\t'user_id' => get_current_user_id(),\n\t\t\t);\n\t\t\t$clone_args = wp_parse_args( $clone_args, $defaults_clone_args );\n\n\t\t\t$new_post_data = array(\n\t\t\t\t'post_title' => $clone_args['copy_name'],\n\t\t\t\t'post_author' => $clone_args['user_id'],\n\t\t\t\t'post_type' => $post->post_type,\n\t\t\t\t'post_status' => $post->post_status,\n\t\t\t\t'post_content' => $post->post_content,\n\t\t\t\t'comment_status' => $post->comment_status,\n\t\t\t\t'ping_status' => $post->ping_status,\n\t\t\t\t'post_excerpt' => $post->post_excerpt,\n\t\t\t\t'post_name' => $post->post_name,\n\t\t\t\t'post_parent' => $post->post_parent,\n\t\t\t\t'post_password' => $post->post_password,\n\t\t\t\t'to_ping' => $post->to_ping,\n\t\t\t\t'menu_order' => $post->menu_order,\n\t\t\t);\n\t\t\t// future posts.\n\t\t\tif ( 'future' === $post->post_status ) {\n\t\t\t\t$new_post_data['post_date'] = $post->post_date;\n\t\t\t\t$new_post_data['post_date_gmt'] = $post->post_date_gmt;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Filters the default copy name for the new cloned post.\n\t\t\t *\n\t\t\t * @since 4.2.0\n\t\t\t *\n\t\t\t * @param array $new_post_data The current new post data.\n\t\t\t * @param WP_Post $post The post object.\n\t\t\t * @param array $clone_args The cloning arguments.\n\t\t\t *\n\t\t\t * @return array The post data for the new post.\n\t\t\t */\n\t\t\t$new_post_data = apply_filters( 'learndash_cloning_get_cloned_post_data', $new_post_data, $post, $clone_args );\n\n\t\t\t$new_post_id = wp_insert_post( $new_post_data );\n\n\t\t\t// cloning featured image.\n\t\t\t$this->clone_featured_image( $post, $new_post_id );\n\n\t\t\t// cloning taxonomies.\n\t\t\t$this->clone_post_taxonomies( $post, $new_post_id );\n\n\t\t\t// cloning post metadata.\n\t\t\t$this->clone_post_meta( $post, $new_post_id );\n\n\t\t\treturn $new_post_id;\n\t\t}",
"public function p_add() {\n $_POST['user_id'] = $this->user->user_id;\n\n # Unix timestamp of when this post was created / modified\n $_POST['created'] = Time::now();\n $_POST['modified'] = Time::now();\n\n # Insert\n # Note we didn't have to sanitize any of the $_POST data because we're using the insert method which does it for us\n DB::instance(DB_NAME)->insert('posts', $_POST);\n\n # Send 'em back\n \n Router::redirect(\"/users/profile\");\n }",
"function duplicate_post_as_draft(){\n global $wpdb;\n if (! ( isset( $_GET['post']) || isset( $_POST['post']) || ( isset($_REQUEST['action']) && 'duplicate_post_as_draft' == $_REQUEST['action'] ) ) ) {\n wp_die('No post to duplicate has been supplied!');\n }\n\n /*\n * Nonce verification\n */\n if ( !isset( $_GET['duplicate_nonce'] ) || !wp_verify_nonce( $_GET['duplicate_nonce'], basename( __FILE__ ) ) )\n return;\n\n /*\n\t\t\t* get the original post id\n */\n $post_id = (isset($_GET['post']) ? absint( $_GET['post'] ) : absint( $_POST['post'] ) );\n /*\n * and all the original post data then\n */\n $post = get_post( $post_id );\n\n /*\n * if you don't want current user to be the new post author,\n * then change next couple of lines to this: $new_post_author = $post->post_author;\n */\n $current_user = wp_get_current_user();\n $new_post_author = $current_user->ID;\n\n /*\n * if post data exists, create the post duplicate\n */\n if (isset( $post ) && $post != null) {\n\n /*\n * new post data array\n */\n $args = array(\n 'comment_status' => $post->comment_status,\n 'ping_status' => $post->ping_status,\n 'post_author' => $new_post_author,\n 'post_content' => $post->post_content,\n 'post_excerpt' => $post->post_excerpt,\n 'post_name' => $post->post_name,\n 'post_parent' => $post->post_parent,\n 'post_password' => $post->post_password,\n 'post_status' => 'draft',\n 'post_title' => $post->post_title,\n 'post_type' => $post->post_type,\n 'to_ping' => $post->to_ping,\n 'menu_order' => $post->menu_order\n );\n\n /*\n * insert the post by wp_insert_post() function\n */\n $new_post_id = wp_insert_post( $args );\n\n /*\n * get all current post terms ad set them to the new post draft\n */\n $taxonomies = get_object_taxonomies($post->post_type); // returns array of taxonomy names for post type, ex array(\"category\", \"post_tag\");\n foreach ($taxonomies as $taxonomy) {\n $post_terms = wp_get_object_terms($post_id, $taxonomy, array('fields' => 'slugs'));\n wp_set_object_terms($new_post_id, $post_terms, $taxonomy, false);\n }\n\n /*\n * duplicate all post meta just in two SQL queries\n */\n $post_meta_infos = $wpdb->get_results(\"SELECT meta_key, meta_value FROM $wpdb->postmeta WHERE post_id=$post_id\");\n if (count($post_meta_infos)!=0) {\n $sql_query = \"INSERT INTO $wpdb->postmeta (post_id, meta_key, meta_value) \";\n foreach ($post_meta_infos as $meta_info) {\n $meta_key = $meta_info->meta_key;\n if( $meta_key == '_wp_old_slug' ) continue;\n $meta_value = addslashes($meta_info->meta_value);\n $sql_query_sel[]= \"SELECT $new_post_id, '$meta_key', '$meta_value'\";\n }\n $sql_query.= implode(\" UNION ALL \", $sql_query_sel);\n $wpdb->query($sql_query);\n }\n\n\n /*\n * finally, redirect to the edit post screen for the new draft\n */\n wp_redirect( admin_url( 'post.php?action=edit&post=' . $new_post_id ) );\n exit;\n } else {\n wp_die('Post creation failed, could not find original post: ' . $post_id);\n }\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
////Funcion para insertar un Registro a un tabla | public function InsertarRegistro($tabla,$NumRegistros,$Columnas,$Valores){
$tabla=$this->normalizar($tabla);
$sql="INSERT INTO $tabla (";
$fin=$NumRegistros-1;
for($i=0;$i<$NumRegistros;$i++){
$col=$Columnas[$i];
$reg=$this->normalizar($Valores[$i]);
if($fin<>$i)
$sql=$sql."`$col`,";
else
$sql=$sql."`$col`)";
}
$sql=$sql."VALUES (";
for($i=0;$i<$NumRegistros;$i++){
$reg=$Valores[$i];
if($fin<>$i)
$sql=$sql."'$reg',";
else
$sql=$sql."'$reg')";
}
$this->Query($sql) or die("no se pudo ingresar el registro en la tabla $tabla desde la funcion Insertar Registro: " . $this->mysqli->error);
} | [
"public function insert(registroEquipo $reEquipo);",
"public function insertar_registro($valor_NOM,$valor_DESC,$valor_SERV,$valor_R_MAX,$valor_R_MIN,$valor_OLD,$ESPEC_id,$LOCALIZACIONid,$TIPO_I_Oid,$DIAGRAMAid,$EQUIPOid,$LINEAid,$SISTEMAid,$TIPO_INSTid,$SENALid,$PANELid)\r\n {\r\n \r\n\r\n $sql=\"INSERT INTO instrumento VALUES (NULL,:SECC,:SECC2, :SECC3 , :SECC4 , :SECC5, :SECC6 , :SECC7 , NULL , :SECC9 , :SECC10 , :SECC11, :SECC12 , :SECC13 , :SECC14 , :SECC15 , :SECC16 , :SECC17 )\";//preparamos una consulta con marcadores.\r\n \r\n $resultado= $this->conexion_db->prepare($sql);//almacenamos en una variable el objeto pdo statement lanzando el metodo prepare del objeto conexion.\r\n \r\n $resultado->execute(array(\":SECC\"=>$valor_NOM,\":SECC2\"=>$valor_DESC,\":SECC3\"=>$valor_SERV,\":SECC4\"=>$valor_R_MAX,\":SECC5\"=>$valor_R_MIN,\":SECC6\"=>$valor_OLD,\":SECC7\"=>$ESPEC_id,\r\n \":SECC9\"=>$LOCALIZACIONid,\":SECC10\"=>$TIPO_I_Oid,\":SECC11\"=>$DIAGRAMAid,\":SECC12\"=>$EQUIPOid,\":SECC13\"=>$LINEAid,\":SECC14\"=>$SISTEMAid,\":SECC15\"=>$TIPO_INSTid,\":SECC16\"=>$SENALid,\":SECC17\"=>$PANELid));//ejecutamos el metodo execute del objeto pdo statement.\r\n \r\n \r\n }",
"function insertarEnTabla($valores,$campos,$tabla){\r\n\t$sqlF = \"INSERT INTO $tabla ($campos) VALUES($valores)\";\r\n\t$resF = mysql_query($sqlF) or die(mysql_error());\r\n\treturn $resF;\r\n}",
"public function insertar_registro8($valor_ID1,$valor_ID2,$familia,$valor_ID3,$valor_ID4,$valor_ID5,$valor_ID6,$valor_ID7,$valor_ID8,$valor_ID9,$valor_ID10,$valor_ID11,$valor_ID12,$valor_ID13,$valor_ID14,$valor_ID15,$valor_ID16,$valor_ID17,$valor_ID18,$valor_ID19,$valor_ID20,$valorCodL,$SUBFAMILIA,$DIAMETRO_MAYOR,$SCH_MAYOR,$DIAMETRO_MENOR,$SCH_MENOR,$LONGITUD,$RATING,$CODIGO_L,$DESCRIPCION,$CODIGO_CARTAGENA,$tabla)\r\n {\r\n \r\n\r\n $sql=\"INSERT INTO $tabla (ISOMETRICO_ID,FECHA,FAMILIA,ACCESORIOS_ID,BRIDAS_ID,JUNTAS_ID,VALVULAS_ID,PERNO_ID,TUBERIA_ID,MTO_REV0, MTO_REV0A, MTO_REV0B, MTO_REV0C,MTO_REV1, MTO_REV1A, MTO_REV1B, MTO_REV1C,MTO_REV2, MTO_REV2A, MTO_REV2B, MTO_REV2C,CODIGO_L_CONCATENADO,SUBFAMILIA,DIAMETRO_MAYOR,SCH_MAYOR,DIAMETRO_MENOR,SCH_MENOR,LONGITUD,RATING,CODIGO_L,DESCRIPCION,CODIGO_CARTAGENA) VALUES (:SECC1,:SECC2,:SECC21,:SECC3,:SECC4,:SECC5,:SECC6,:SECC7,:SECC8,:SECC9,:SECC10,:SECC11,:SECC12,:SECC13,:SECC14,:SECC15,:SECC16,:SECC17,:SECC18,:SECC19,:SECC20,:SECC22,:SECC23,:SECC24,:SECC25,:SECC26,:SECC27,:SECC28,:SECC29,:SECC30,:SECC31,:SECC32)\";\r\n \r\n \r\n \r\n $resultado= $this->conexion_db->prepare($sql);//almacenamos en una variable el objeto pdo statement lanzando el metodo prepare del objeto conexion.\r\n \r\n $resultado->execute(array(\":SECC1\"=>$valor_ID1,\":SECC2\"=>$valor_ID2,\":SECC3\"=>$valor_ID3,\":SECC4\"=>$valor_ID4,\":SECC5\"=>$valor_ID5,\":SECC6\"=>$valor_ID6,\":SECC7\"=>$valor_ID7,\":SECC8\"=>$valor_ID8 ,\":SECC9\"=>$valor_ID9,\":SECC10\"=>$valor_ID10,\":SECC11\"=>$valor_ID11,\":SECC12\"=>$valor_ID12,\":SECC13\"=>$valor_ID13,\":SECC14\"=>$valor_ID14,\":SECC15\"=>$valor_ID15,\":SECC16\"=>$valor_ID16,\":SECC17\"=>$valor_ID17,\":SECC18\"=>$valor_ID18,\":SECC19\"=>$valor_ID19,\":SECC20\"=>$valor_ID20,\":SECC21\"=>$familia,\":SECC22\"=>$valorCodL,\":SECC23\"=>$SUBFAMILIA,\":SECC24\"=>$DIAMETRO_MAYOR,\":SECC25\"=>$SCH_MAYOR,\":SECC26\"=>$DIAMETRO_MENOR,\":SECC27\"=>$SCH_MENOR,\":SECC28\"=>$LONGITUD,\":SECC29\"=>$RATING,\":SECC30\"=>$CODIGO_L,\":SECC31\"=>$DESCRIPCION,\":SECC32\"=>$CODIGO_CARTAGENA));//ejecutamos el metodo execute del objeto pdo statement.\r\n \r\n }",
"public function insert($convenio);",
"function registrar(){\n\n\t\t\t\n\t\t$sql = \"SELECT *\n\t\t\t\tFROM CENTRO\n\t\t\t\tWHERE CODCENTRO = '$this->centro'\";\n\n\t\t$obj = $this->mysqli->query($sql);\n\n\t\tif (mysqli_num_rows($obj) == 1) {\n\t\t\t$sql = \"INSERT INTO TITULACION (\n\t\t\t\tCODTITULACION,\n\t\t\t\tCODCENTRO,\n\t\t\t\tNOMBRETITULACION,\n\t\t\t\tRESPONSABLETITULACION) \n\t\t\t\t\tVALUES (\n\t\t\t\t\t\t'$this->titulacion',\n\t\t\t\t\t\t'$this->centro',\n\t\t\t\t\t\t'$this->nombre',\n\t\t\t\t\t\t'$this->responsable')\n\t\t\t\t\t\t\";\n\t\t\tif ($this->mysqli->query($sql)) \n\t\t\t\treturn 'Inserción realizada con éxito'; //operacion de insertado correcta\n\t\t\t\n\t\t} \n\t\t\treturn 'Error de gestor de base de datos'; \t\t\n\t}",
"public function insert($table);",
"function guardar($tabla, $condicion, $registro)\n {\n $row_id = $this->existe($tabla, $condicion);\n \n if ( $row_id == 0 ) {\n //No existe, insertar\n $this->db->insert($tabla, $registro);\n $row_id = $this->db->insert_id();\n } else {\n //Ya existe, editar\n $this->db->where('id', $row_id);\n $this->db->update($tabla, $registro);\n }\n \n return $row_id;\n \n }",
"function tb_empresa_insert(){\n\tglobal $Translation;\n\n\t// mm: can member insert record?\n\t$arrPerm=getTablePermissions('tb_empresa');\n\tif(!$arrPerm[1]){\n\t\treturn false;\n\t}\n\n\t$data['str_nome_fantasia'] = makeSafe($_REQUEST['str_nome_fantasia']);\n\t\tif($data['str_nome_fantasia'] == empty_lookup_value){ $data['str_nome_fantasia'] = ''; }\n\t$data['str_responsavel'] = makeSafe($_REQUEST['str_responsavel']);\n\t\tif($data['str_responsavel'] == empty_lookup_value){ $data['str_responsavel'] = ''; }\n\t$data['relacionamento_id'] = makeSafe($_REQUEST['relacionamento_id']);\n\t\tif($data['relacionamento_id'] == empty_lookup_value){ $data['relacionamento_id'] = ''; }\n\t$data['cidade'] = makeSafe($_REQUEST['cidade']);\n\t\tif($data['cidade'] == empty_lookup_value){ $data['cidade'] = ''; }\n\t$data['uf'] = makeSafe($_REQUEST['uf']);\n\t\tif($data['uf'] == empty_lookup_value){ $data['uf'] = ''; }\n\tif($data['str_nome_fantasia']== ''){\n\t\techo StyleSheet() . \"\\n\\n<div class=\\\"alert alert-danger\\\">\" . $Translation['error:'] . \" 'Nome fantasia': \" . $Translation['field not null'] . '<br><br>';\n\t\techo '<a href=\"\" onclick=\"history.go(-1); return false;\">'.$Translation['< back'].'</a></div>';\n\t\texit;\n\t}\n\tif($data['str_responsavel']== ''){\n\t\techo StyleSheet() . \"\\n\\n<div class=\\\"alert alert-danger\\\">\" . $Translation['error:'] . \" 'Gerente da conta': \" . $Translation['field not null'] . '<br><br>';\n\t\techo '<a href=\"\" onclick=\"history.go(-1); return false;\">'.$Translation['< back'].'</a></div>';\n\t\texit;\n\t}\n\tif($data['relacionamento_id']== ''){\n\t\techo StyleSheet() . \"\\n\\n<div class=\\\"alert alert-danger\\\">\" . $Translation['error:'] . \" 'Relacionamento': \" . $Translation['field not null'] . '<br><br>';\n\t\techo '<a href=\"\" onclick=\"history.go(-1); return false;\">'.$Translation['< back'].'</a></div>';\n\t\texit;\n\t}\n\tif($data['uf']== ''){\n\t\techo StyleSheet() . \"\\n\\n<div class=\\\"alert alert-danger\\\">\" . $Translation['error:'] . \" 'UF': \" . $Translation['field not null'] . '<br><br>';\n\t\techo '<a href=\"\" onclick=\"history.go(-1); return false;\">'.$Translation['< back'].'</a></div>';\n\t\texit;\n\t}\n\n\t// hook: tb_empresa_before_insert\n\tif(function_exists('tb_empresa_before_insert')){\n\t\t$args=array();\n\t\tif(!tb_empresa_before_insert($data, getMemberInfo(), $args)){ return false; }\n\t}\n\n\t$o = array('silentErrors' => true);\n\tsql('insert into `tb_empresa` set `str_nome_fantasia`=' . (($data['str_nome_fantasia'] !== '' && $data['str_nome_fantasia'] !== NULL) ? \"'{$data['str_nome_fantasia']}'\" : 'NULL') . ', `str_responsavel`=' . (($data['str_responsavel'] !== '' && $data['str_responsavel'] !== NULL) ? \"'{$data['str_responsavel']}'\" : 'NULL') . ', `relacionamento_id`=' . (($data['relacionamento_id'] !== '' && $data['relacionamento_id'] !== NULL) ? \"'{$data['relacionamento_id']}'\" : 'NULL') . ', `cidade`=' . (($data['cidade'] !== '' && $data['cidade'] !== NULL) ? \"'{$data['cidade']}'\" : 'NULL') . ', `uf`=' . (($data['uf'] !== '' && $data['uf'] !== NULL) ? \"'{$data['uf']}'\" : 'NULL'), $o);\n\tif($o['error']!=''){\n\t\techo $o['error'];\n\t\techo \"<a href=\\\"tb_empresa_view.php?addNew_x=1\\\">{$Translation['< back']}</a>\";\n\t\texit;\n\t}\n\n\t$recID = db_insert_id(db_link());\n\n\t// hook: tb_empresa_after_insert\n\tif(function_exists('tb_empresa_after_insert')){\n\t\t$res = sql(\"select * from `tb_empresa` where `id`='\" . makeSafe($recID, false) . \"' limit 1\", $eo);\n\t\tif($row = db_fetch_assoc($res)){\n\t\t\t$data = array_map('makeSafe', $row);\n\t\t}\n\t\t$data['selectedID'] = makeSafe($recID, false);\n\t\t$args=array();\n\t\tif(!tb_empresa_after_insert($data, getMemberInfo(), $args)){ return $recID; }\n\t}\n\n\t// mm: save ownership data\n\tset_record_owner('tb_empresa', $recID, getLoggedMemberID());\n\n\treturn $recID;\n}",
"protected function insertar()\n {\n }",
"abstract public function insert($table, $data);",
"public function insert($persona_has_celular);",
"public function insert($tipo_proyecto);",
"public function insert($costo);",
"abstract public function sqlInsertar();",
"function inserirTipoMov(){\n\n $banco = abrirBancoTipoMov();\n //declarando as variáveis usadas na inserção dos dados\n $descTipoMov = $_POST[\"descTipoMov\"];\n $tipoMov = $_POST[\"tipoMov\"];\n\n //a consulta sql\n $sql = \"INSERT INTO TiposMovimento(descTipoMov,tipoMov) VALUES ('$descTipoMov','$tipoMov')\";\n \n //executando a inclusão\n $banco->query($sql);\n //fechando a conexao com o banco\n $banco->close();\n voltarIndexTipoMov();\n\n }",
"public function _insertar($objeto);",
"function agregar($data=NULL,$tabla=NULL) \n { \n $i=0;\n $this->CI = & get_instance();\n $this->sql .=\" INSERT INTO `$tabla` set\";\n foreach ($data as $campo=>$valor): \n $i++;\n $this->sql .=\" `$campo`='\". addslashes($valor).\"' \"; \n if ($i<count($data)):\n $this->sql .=\",\";\n endif;\n endforeach;\n \n if ($this->CI->db->query($this->sql))\n {\n $this->CI->session->set_userdata(\"mensaje\",'<div class=\"infobox success-bg mrg10B\"> <p>'.\"Los registros se guardaron correctamente. \".'</p></div>');\n return true;\n }\n else\n {\n $this->CI ->session->set_userdata(\"mensaje\",'<div class=\"infobox error-bg mrg0A mrg10B\"><p>'.\"Hubo un problema al momento de grabar. <br />intentelo y si persiste comunique a la area de sistema.\".'</p></div>');\n return false;\n }\n \n }",
"public function insert($area_empresa);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Relative weight of a word in the title of a webpage | private function calc_weight ($words_in_page, $word_in_title, $word_in_domain, $word_in_path, $path_depth, $meta_keyword)
{
$title_weight = 20;
// Relative weight of a word in the domain name
$domain_weight = 60;
// Relative weight of a word in the path name
$path_weight = 10;
// Relative weight of a word in meta_keywords
$meta_weight = 5;
$weight = ($words_in_page + $word_in_title * $title_weight +
$word_in_domain * $domain_weight +
$word_in_path * $path_weight + $meta_keyword * $meta_weight) *10 / (0.8 +0.2*$path_depth);
return $weight;
} | [
"function getFontWeight(){}",
"public function markupWeight() {\n\t\t\n\t\t$sum_weight = 0;\n\n\t\tforeach($this->items() as $item) {\n\t\t\t$sum_weight += $item->realTimeMarkupWeight() * $item->packcopies();\n\t\t}\n\n\t\t$sum_weight = sprintf(\"%.2f\", $sum_weight);\n\t\t\n\t\treturn $sum_weight;\n\t}",
"public function findCountryWeight($html);",
"public function getFontWeight () {}",
"function is_title(&$line) {\n //$nocapwords = array('a','an','the','of','in','on'); // get a more complete list of words not capitalized in titles, also sort them by the first character and index them so that when you're looking for capital letters at the beginning of words you can also check for these noncap words quickly if it isn't capitalized\n $p=1; // the title probability can only go down from here\n //$words=str_word_count(trim($line),1); // this allows any delimiter between words, I'm only interested in space delimiters\n $words=split(\" \",trim($line)); // this allows any delimiter between words, I'm only interested in space delimiters\n //$p *= 2/max(abs((NumWordsInTypicalTitle-count($words)))^1.2,2); \n $wordcount = 0; \n foreach($words as $word) {\n // see if the word is capitalized and less than 12 characters long\n $titleword = preg_grep(\"/^\\p{Lu}[\\p{Ll}'\\-]{2,12}$/\", $word); // what about \\p{Lt} (title case)\n if(count($titleword) && strlen($titleword[0])>2) {\n $wordcount++;\n }\n }\n $p *= 2/max(abs(NumWordsInTypicalTitle-$wordcount)^1.2,2);\n $p *= 2/max(1+abs(.5-($wordcount/(count($words)+1)))^1.2,2); // actionHL: redesign this weighting function \n}",
"public function getFontWeight() {}",
"function get_word_weight($word)\n{\n if(array_key_exists($word, $this->word_search_array['WordWeight']))\n {\n return $this->word_search_array['WordWeight'][$word];\n }\n else{\n return 0;\n }\n}",
"function titleKeywordMatch($row) {\n\t\t$titleMatchCount = 0;\n\t\t$pageTitle = $row->page_title;\n\t\t$titleWords = explode('_',$pageTitle);\n\t\tforeach($this->QP_searchQuery as $searchTerm) {\n\t\t\tforeach($titleWords as $words) {\n\t\t\t\tif(strcasecmp($searchTerm ,$words) == 0) {\n\t\t\t\t\t$titleMatchCount++;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$titleKeywordRatio = $titleMatchCount/count($this->QP_searchQuery);\n\t\treturn $titleKeywordRatio;\n\t}",
"public function getTextWeight() {\n return $this->textWeight;\n }",
"public function getfontweight()\n {\n }",
"public function getPageWeight()\n {\n return $this->pageWeight;\n }",
"function StyleGetWeight($style){}",
"public function getClassWeight()\n {\n $weight = 0;\n\n // Look for a special classname\n $class = $this->getAttribute('class');\n if (trim($class)) {\n if (preg_match(NodeUtility::$regexps['negative'], $class)) {\n $weight -= 25;\n }\n\n if (preg_match(NodeUtility::$regexps['positive'], $class)) {\n $weight += 25;\n }\n }\n\n // Look for a special ID\n $id = $this->getAttribute('id');\n if (trim($id) !== '') {\n if (preg_match(NodeUtility::$regexps['negative'], $id)) {\n $weight -= 25;\n }\n\n if (preg_match(NodeUtility::$regexps['positive'], $id)) {\n $weight += 25;\n }\n }\n\n return $weight;\n }",
"public function wordCount()\n {\n $pages = $this->pages;\n $words_per_page = 300; // assume that the average book has 200-300 words per page\n\n return $pages * $words_per_page;\n }",
"public function compareWithH1(string $title): string\n {\n if (null === $h1 = $this->fromH1()) {\n return $title;\n }\n\n $percent = 0;\n similar_text($title, $h1, $percent);\n\n if (0.75 < $percent) {\n return $h1;\n }\n\n return $title;\n }",
"protected function _getWeight($string) {\n $exp = explode(\"font-weight: \", $string);\n $exp2 = explode(\";\", $exp[1]);\n return trim($exp2[0]);\n }",
"public function GetKeywordsWeights()\r\n\t{\r\n\t $result = mysql_query(sprintf(\"select * from `url_categories_keywords`\"));\r\n\t $kwds = array();\r\n\t while($row = mysql_fetch_assoc($result))\r\n\t \t$kwds[$row['keyword']] = $row['weight'];\r\n\t return $kwds;\r\n\t}",
"public function findSectorWeight($html, $name);",
"public function weight_kg() {\n return $this->weight_kg . ' kg';\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initializes a new bulk create team members request Builder object. | public static function init(array $teamMembers): self
{
return new self(new BulkCreateTeamMembersRequest($teamMembers));
} | [
"public static function init(): self\n {\n return new self(new BulkCreateTeamMembersResponse());\n }",
"public function build(): BulkCreateTeamMembersRequest\n {\n return CoreHelper::clone($this->instance);\n }",
"public function build(): BulkUpdateTeamMembersRequest\n {\n return CoreHelper::clone($this->instance);\n }",
"public static function init(): self\n {\n return new self(new CreateTeamMemberResponse());\n }",
"public function build(): ListTeamMemberWagesRequest\n {\n return CoreHelper::clone($this->instance);\n }",
"public function checkMemberObjects(): CheckMemberObjectsRequestBuilder {\n return new CheckMemberObjectsRequestBuilder($this->pathParameters, $this->requestAdapter);\n }",
"public function build(): UpdateTeamMemberRequest\n {\n return CoreHelper::clone($this->instance);\n }",
"private static function InitMutateRequestObject() {\n $campaign = new Campaign();\n $campaign->id = -1;\n $campaign->name = 'Test campaign&<>\"\\'';\n $campaign->advertisingChannelType = 'SEARCH';\n $campaign->status = 'ENABLED';\n $campaignOperation = new CampaignOperation();\n $campaignOperation->operand = $campaign;\n $campaignOperation->operator = 'ADD';\n $operations[] = $campaignOperation;\n\n $adGroup = new AdGroup();\n $adGroup->id = -2;\n $adGroup->campaignId = -1;\n $adGroup->name = 'Test ad group';\n $adGroupOperation = new AdGroupOperation();\n $adGroupOperation->operand = $adGroup;\n $adGroupOperation->operator = 'ADD';\n $operations[] = $adGroupOperation;\n\n self::$MUTATE_REQUEST_OBJECT = new BatchJobOpsMutate();\n self::$MUTATE_REQUEST_OBJECT->operations = $operations;\n }",
"private function buildUserTeams() {\n\t\t$teamIDs = get_user_meta($this->user_id, $this->user_meta_key, false);\n\n\t\tif ( !$teamIDs )\n\t\t\t\t$this->newMemberSetUp();\n\t\telse {\n\t\t\tforeach ($teamIDs as $teamID) {\n\t\t\t\t$curTeam = TeamManagerTeam::buildExisting($teamID);\n\t\t\t\tif(!$curTeam)\n\t\t\t\t\t$this->warningAlert(\"Error Loading Team\");\n\t\t\t\telse\n\t\t\t\t\t$this->teams[] = $curTeam;\n\t\t\t}\n\t\t}\n\t}",
"public function build(): BulkUpsertBookingCustomAttributesRequest\n {\n return CoreHelper::clone($this->instance);\n }",
"public function checkMemberGroups(): CheckMemberGroupsRequestBuilder {\n return new CheckMemberGroupsRequestBuilder($this->pathParameters, $this->requestAdapter);\n }",
"public function teamMembers(?array $value): self\n {\n $this->instance->setTeamMembers($value);\n return $this;\n }",
"public function invitedUserSponsors(): InvitedUserSponsorsRequestBuilder {\n return new InvitedUserSponsorsRequestBuilder($this->pathParameters, $this->requestAdapter);\n }",
"public function team_new_member() {\n \n // Create a new Team's member\n (new MidrubBaseUserComponentsCollectionTeamHelpers\\Team)->team_new_member();\n \n }",
"public static function init(array $vendors): self\n {\n return new self(new BulkCreateVendorsRequest($vendors));\n }",
"public function createTeam(Request $request)\n {\n $request->validate([\n 'name' => ['required', 'string', 'max:255'],\n 'description' => ['present', 'max:1000'],\n 'category' => ['required', 'string', 'max:100'],\n 'plan' => ['required', 'string', 'in:team_free,team_low,team_mid,team_high'],\n 'paymentMethod' => ['required', 'string', 'max:100'],\n ]);\n\n $subscription = null;\n\n // Create subscription if plan is selected\n if ($request->plan === config('plans.free_team_plan_name'))\n {\n if (count(Team::where('owner_id', Auth::id())->where('subscription_id', null)->get()) > config('plans.allowed_free_team_plans'))\n {\n return response('TOO_MANY_FREE_PLANS', 422);\n }\n }\n else\n {\n $method = null;\n\n $plan = config('plans.team_plans.'.$request->plan);\n\n $method = $request->paymentMethod === 'default' ? $request->user()->defaultPaymentMethod() : $request->user()->findPaymentMethod($request->paymentMethod);\n\n if (!$method)\n {\n return response('NO_PAYMENT_METHOD', 403);\n }\n\n $subscription = $request->user()->newSubscription( $plan['id'], $plan['stripe_id'] )->quantity(null)->create($method->id);\n }\n\n $team = Team::create([\n 'owner_id' => Auth::id(),\n 'name' => $request->name,\n 'description' => $request->description,\n 'category' => $request->category,\n 'status' => 'inactive',\n 'subscription_id' => $subscription ? $subscription->id : null,\n ]);\n \n // Create owner-member for new team\n TeamMember::create([\n 'team_id' => $team->id,\n 'user_id' => $team->owner_id,\n 'roles' => ['owner'],\n ]);\n \n $user = User::find(Auth::id());\n\n // Set users active team id to new team if user doesn't have an active team\n if (!$user->active_team_id)\n {\n $user->active_team_id = $team->id;\n $user->save();\n }\n\n $team = Team::with(['members.user', 'subscription' => function($query) {\n $query->select('id','name', 'stripe_status');\n }])->find($team->id);\n \n $team->is_owner = true;\n\n return $team;\n }",
"public function addUserGroupMembersRequest($options)\n {\n // unbox the parameters from the associative array\n $user_group_id = array_key_exists('user_group_id', $options) ? $options['user_group_id'] : null;\n $request_body = array_key_exists('request_body', $options) ? $options['request_body'] : null;\n\n // verify the required parameter 'user_group_id' is set\n if ($user_group_id === null || (is_array($user_group_id) && count($user_group_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $user_group_id when calling addUserGroupMembers'\n );\n }\n\n $resourcePath = '/user-groups/{user_group_id}/members';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($user_group_id !== null) {\n $resourcePath = str_replace(\n '{' . 'user_group_id' . '}',\n ObjectSerializer::toPathValue($user_group_id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($request_body)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($request_body));\n } else {\n $httpBody = $request_body;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API token authentication\n $apiToken = $this->config->getApiTokenWithPrefix('Fastly-Key');\n if ($apiToken !== null) {\n $headers['Fastly-Key'] = $apiToken;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $operationHosts = [\"https://api.fastly.com\"];\n if ($this->hostIndex < 0 || $this->hostIndex >= sizeof($operationHosts)) {\n throw new \\InvalidArgumentException(\"Invalid index {$this->hostIndex} when selecting the host. Must be less than \".sizeof($operationHosts));\n }\n $operationHost = $operationHosts[$this->hostIndex];\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'POST',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function build(): BulkUpsertCustomerCustomAttributesRequest\n {\n return CoreHelper::clone($this->instance);\n }",
"public function bulkResize(): BulkResizeRequestBuilder {\n return new BulkResizeRequestBuilder($this->pathParameters, $this->requestAdapter);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the next timezone transitions. This will return an array with the following information for each transition: Array ( [ts] => 1396141200 [time] => 20140330T01:00:00+0000 [offset] => 7200 [isdst] => 1 [abbr] => CEST ) | public function getNextTimezoneTransitions($number = 1)
{
$transitions = $this->getTimeZone()->getTransitions($this->getTimestamp());
return array_splice($transitions, 1, $number);
} | [
"public function getNextStateTransitions(): array\n {\n $transitions = [];\n \n foreach ($this->transitionNextStates as $state => $symNextMap) {\n foreach (\\array_keys($symNextMap) as $sym) {\n $transitions[] = [ $state, $sym, ];\n }\n }\n \n return $transitions;\n }",
"public function testGetTransitionsAcceptsTimeStamps()\n {\n $timezone = DateTimeZone::LondonEurope();\n $transitionsArray = timezone_transitions_get($timezone, 1648342800, 1711846800);\n $transitions = $timezone->getTransitions(1648342800, 1711846800);\n $this->assertSame(count($transitionsArray), count($transitions));\n foreach ($transitions as $key => $transition) {\n $this->assertInstanceOf(Transition::class, $transition);\n $this->assertSame($transitionsArray[$key]['ts'], $transition->getTimestamp());\n $this->assertSame($transitionsArray[$key]['abbr'], $transition->getAbbreviation());\n $this->assertSame($transitionsArray[$key]['isdst'], $transition->isDaylightSavingsTime());\n $this->assertSame($transitionsArray[$key]['offset'], $transition->getOffset());\n $this->assertSame($transitionsArray[$key]['time'], $transition->getDate()->format('Y-m-d\\TH:i:sO'));\n }\n }",
"public function getAvailableTransitions(): array;",
"public function get_outgoing_transitions() {\n $transitions = array();\n foreach ($this->states as $curstate) {\n $transitions = array_merge($transitions, $this->fa->get_adjacent_transitions($curstate));\n }\n return $transitions;\n }",
"public function getNextStateTransitions()\n {\n return $this->stateMachine->getNextTransitions();\n }",
"public function getPossibleTransitions();",
"public function getTransitions();",
"public function getAvailableTransitions(): array\n {\n $currentState = $this->getCurrentState();\n $edges = $this->getEdgesFrom($currentState);\n\n return array_map(\n function (Edge $edge) {\n return $edge->getTransition();\n }, $edges\n );\n }",
"public static function getAllTransitions()\n {\n return array(\n self::TRANS_AUDIO,\n self::TRANS_VIDEO,\n self::TRANS_AV_FIRST,\n self::TRANS_AV_LAST\n );\n }",
"public function transitions()\n\t{\n\t\treturn array();\n\t}",
"public function tz_list() \n{\n $zones_array = array();\n $timestamp = time();\n foreach(timezone_identifiers_list() as $key => $zone) {\n date_default_timezone_set($zone);\n $zones_array[$key]['zone'] = $zone;\n $zones_array[$key]['diff_from_GMT'] = 'UTC/GMT ' . date('P', $timestamp);\n }\n return $zones_array;\n}",
"public function transitions()\n {\n return [\n new Transition('rate', 'rate', 'rated'),\n new Transition('wait_to_review', 'rated', 'review'),\n new Transition('review', 'review', 'reviewed'),\n ];\n }",
"public function timeZoneSelect()\n {\n $timezones = DateTimeZone::listIdentifiers(DateTimeZone::ALL);\n\n $timezone_offsets = [];\n foreach ($timezones as $timezone) {\n $tz = new DateTimeZone($timezone);\n $timezone_offsets[$timezone] = $tz->getOffset(new DateTime);\n }\n\n $timezone_list = [];\n foreach ($timezone_offsets as $timezone => $offset) {\n $offset_prefix = $offset < 0 ? '-' : '+';\n $offset_formatted = gmdate('H:i', abs($offset));\n\n $pretty_offset = \"UTC{$offset_prefix}{$offset_formatted}\";\n\n $timezone_list[$timezone] = \"({$pretty_offset}) $timezone\";\n }\n\n return $timezone_list;\n }",
"public function getTransitions() {\n\t\t\treturn $this->transitions;\n\t\t}",
"public function getAllTimezones()\n {\n /*$timezoneList = CakeTime::listTimezones('', '', false);\n $dateTimeObj = new DateTime();\n foreach ($timezoneList as $timezoneIdentifier) {\n $dateTimeObj->setTimeZone(CakeTime::timezone($timezoneIdentifier));\n $timezoneOffsets[$timezoneIdentifier] = $timezoneIdentifier . \" (\" . $dateTimeObj->format('T') . \"), [\" . $this->getTimezoneOffset($timezoneIdentifier) . \"]\";\n }*/\n $timezoneOffsets = array(\n '(GMT-12:00) International Date Line West ' => ' (GMT-12:00) International Date Line West',\n '(GMT-11:00) Midway Island, Samoa ' => ' (GMT-11:00) Midway Island, Samoa',\n '(GMT-10:00) Hawaii ' => ' (GMT-10:00) Hawaii',\n '(GMT-09:00) Alaska ' => ' (GMT-09:00) Alaska',\n '(GMT-08:00) Pacific Time (US and Canada); Tijuana ' => ' (GMT-08:00) Pacific Time (US and Canada); Tijuana',\n '(GMT-07:00) Mountain Time (US and Canada) ' => ' (GMT-07:00) Mountain Time (US and Canada)',\n '(GMT-07:00) Chihuahua, La Paz, Mazatlan ' => ' (GMT-07:00) Chihuahua, La Paz, Mazatlan',\n '(GMT-07:00) Arizona ' => ' (GMT-07:00) Arizona',\n '(GMT-06:00) Central Time (US and Canada ' => ' (GMT-06:00) Central Time (US and Canada',\n '(GMT-06:00) Saskatchewan ' => ' (GMT-06:00) Saskatchewan',\n '(GMT-06:00) Guadalajara, Mexico City, Monterrey ' => ' (GMT-06:00) Guadalajara, Mexico City, Monterrey',\n '(GMT-06:00) Central America ' => ' (GMT-06:00) Central America',\n '(GMT-05:00) Eastern Time (US and Canada) ' => ' (GMT-05:00) Eastern Time (US and Canada)',\n '(GMT-05:00) Indiana (East) ' => ' (GMT-05:00) Indiana (East)',\n '(GMT-05:00) Bogota, Lima, Quito ' => ' (GMT-05:00) Bogota, Lima, Quito',\n '(GMT-04:00) Atlantic Time (Canada) ' => ' (GMT-04:00) Atlantic Time (Canada)',\n '(GMT-04:00) Caracas, La Paz ' => ' (GMT-04:00) Caracas, La Paz',\n '(GMT-04:00) Santiago ' => ' (GMT-04:00) Santiago',\n '(GMT-03:30) Newfoundland and Labrador ' => ' (GMT-03:30) Newfoundland and Labrador',\n '(GMT-03:00) Brasilia ' => ' (GMT-03:00) Brasilia',\n '(GMT-03:00) Buenos Aires, Georgetown ' => ' (GMT-03:00) Buenos Aires, Georgetown',\n '(GMT-03:00) Greenland ' => ' (GMT-03:00) Greenland',\n '(GMT-02:00) Mid-Atlantic ' => ' (GMT-02:00) Mid-Atlantic',\n '(GMT-01:00) Azores ' => ' (GMT-01:00) Azores',\n '(GMT-01:00) Cape Verde Islands ' => ' (GMT-01:00) Cape Verde Islands',\n '(GMT) Greenwich Mean Time: Dublin, Edinburgh, Lisbon, London ' => ' (GMT) Greenwich Mean Time: Dublin, Edinburgh, Lisbon, London',\n '(GMT) Casablanca, Monrovia ' => ' (GMT) Casablanca, Monrovia',\n '(GMT+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague ' => ' (GMT+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague',\n '(GMT+01:00) Sarajevo, Skopje, Warsaw, Zagreb ' => ' (GMT+01:00) Sarajevo, Skopje, Warsaw, Zagreb',\n '(GMT+01:00) Brussels, Copenhagen, Madrid, Paris ' => ' (GMT+01:00) Brussels, Copenhagen, Madrid, Paris',\n '(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna ' => ' (GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna',\n '(GMT+01:00) West Central Africa ' => ' (GMT+01:00) West Central Africa',\n '(GMT+02:00) Bucharest ' => ' (GMT+02:00) Bucharest',\n '(GMT+02:00) Cairo ' => ' (GMT+02:00) Cairo',\n '(GMT+02:00) Helsinki, Kiev, Riga, Sofia, Tallinn, Vilnius ' => ' (GMT+02:00) Helsinki, Kiev, Riga, Sofia, Tallinn, Vilnius',\n '(GMT+02:00) Athens, Istanbul, Minsk ' => ' (GMT+02:00) Athens, Istanbul, Minsk',\n '(GMT+02:00) Jerusalem ' => ' (GMT+02:00) Jerusalem',\n '(GMT+02:00) Harare, Pretoria ' => ' (GMT+02:00) Harare, Pretoria',\n '(GMT+03:00) Moscow, St. Petersburg, Volgograd ' => ' (GMT+03:00) Moscow, St. Petersburg, Volgograd',\n '(GMT+03:00) Kuwait, Riyadh ' => ' (GMT+03:00) Kuwait, Riyadh',\n '(GMT+03:00) Nairobi ' => ' (GMT+03:00) Nairobi',\n '(GMT+03:00) Baghdad ' => ' (GMT+03:00) Baghdad',\n '(GMT+03:30) Tehran ' => ' (GMT+03:30) Tehran',\n '(GMT+04:00) Abu Dhabi, Muscat ' => ' (GMT+04:00) Abu Dhabi, Muscat',\n '(GMT+04:00) Baku, Tbilisi, Yerevan ' => ' (GMT+04:00) Baku, Tbilisi, Yerevan',\n '(GMT+04:30) Kabul ' => ' (GMT+04:30) Kabul',\n '(GMT+05:00) Ekaterinburg ' => ' (GMT+05:00) Ekaterinburg',\n '(GMT+05:00) Islamabad, Karachi, Tashkent ' => ' (GMT+05:00) Islamabad, Karachi, Tashkent',\n '(GMT+05:30) Chennai, Kolkata, Mumbai, New Delhi ' => ' (GMT+05:30) Chennai, Kolkata, Mumbai, New Delhi',\n '(GMT+05:45) Kathmandu ' => ' (GMT+05:45) Kathmandu',\n '(GMT+06:00) Astana, Dhaka ' => ' (GMT+06:00) Astana, Dhaka',\n '(GMT+06:00) Sri Jayawardenepura ' => ' (GMT+06:00) Sri Jayawardenepura',\n '(GMT+06:00) Almaty, Novosibirsk ' => ' (GMT+06:00) Almaty, Novosibirsk',\n '(GMT+06:30) Yangon Rangoon ' => ' (GMT+06:30) Yangon Rangoon',\n '(GMT+07:00) Bangkok, Hanoi, Jakarta ' => ' (GMT+07:00) Bangkok, Hanoi, Jakarta',\n '(GMT+07:00) Krasnoyarsk ' => ' (GMT+07:00) Krasnoyarsk',\n '(GMT+08:00) Beijing, Chongqing, Hong Kong SAR, Urumqi ' => ' (GMT+08:00) Beijing, Chongqing, Hong Kong SAR, Urumqi',\n '(GMT+08:00) Kuala Lumpur, Singapore ' => ' (GMT+08:00) Kuala Lumpur, Singapore',\n '(GMT+08:00) Taipei ' => ' (GMT+08:00) Taipei',\n '(GMT+08:00) Perth ' => ' (GMT+08:00) Perth',\n '(GMT+08:00) Irkutsk, Ulaanbaatar ' => ' (GMT+08:00) Irkutsk, Ulaanbaatar',\n '(GMT+09:00) Seoul ' => ' (GMT+09:00) Seoul',\n '(GMT+09:00) Osaka, Sapporo, Tokyo ' => ' (GMT+09:00) Osaka, Sapporo, Tokyo',\n '(GMT+09:00) Yakutsk ' => ' (GMT+09:00) Yakutsk',\n '(GMT+09:30) Darwin ' => ' (GMT+09:30) Darwin',\n '(GMT+09:30) Adelaide ' => ' (GMT+09:30) Adelaide',\n '(GMT+10:00) Canberra, Melbourne, Sydney ' => ' (GMT+10:00) Canberra, Melbourne, Sydney',\n '(GMT+10:00) Brisbane ' => ' (GMT+10:00) Brisbane',\n '(GMT+10:00) Hobart ' => ' (GMT+10:00) Hobart',\n '(GMT+10:00) Vladivostok ' => ' (GMT+10:00) Vladivostok',\n '(GMT+10:00) Guam, Port Moresby ' => ' (GMT+10:00) Guam, Port Moresby',\n '(GMT+11:00) Magadan, Solomon Islands, New Caledonia ' => ' (GMT+11:00) Magadan, Solomon Islands, New Caledonia',\n '(GMT+12:00) Fiji Islands, Kamchatka, Marshall Islands ' => ' (GMT+12:00) Fiji Islands, Kamchatka, Marshall Islands',\n '(GMT+12:00) Auckland, Wellington ' => ' (GMT+12:00) Auckland, Wellington',\n '(GMT+13:00) Nuku alofa ' => ' (GMT+13:00) Nuku alofa'\n\n );\n // pr($timeZoneArray);die;\n //return $timezoneOffsets;\n return $timezoneOffsets;\n }",
"public function getNextTransitionsAttribute()\n {\n if ($this->linkedScenario()) {\n $query = Transition::query();\n $query->where('scenario_id', $this->linkedScenario());\n if ($this->status) {\n $query->where('old_status_id', $this->status->id);\n } else {\n $query->whereNull('old_status_id');\n }\n return $query->get();\n }\n return collect([]);\n }",
"function tz_list() {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$zones_array = array();\n\t\t\t\t\t\t\t\t\t\t\t\t\t$timestamp = time();\n\t\t\t\t\t\t\t\t\t\t\t\t\tforeach(timezone_identifiers_list() as $key => $zone) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdate_default_timezone_set($zone);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$zones_array[$key]['zone'] = $zone;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$zones_array[$key]['diff_from_GMT'] = 'UTC/GMT ' . date('P', $timestamp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn $zones_array;\n\t\t\t\t\t\t\t\t\t\t\t}",
"public function testResolveMinPreviousTransitions()\n {\n $transitions = $this->transitionResolver->getTransitions('orderAddress', 2);\n\n $this->assertNotNull($transitions['current'], 'Current transition not found');\n $this->assertCount(1, $transitions['previous'], 'Previous transition count does not match');\n $this->assertCount(3, $transitions['following'], 'Following transition count does not match');\n\n $total = count($transitions['current']) + count($transitions['following']) + count($transitions['previous']);\n $this->assertEquals(5, $total, 'Count does not match');\n }",
"public function transitions()\n {\n return [\n new Transition('send', 'send', 'sent'),\n new Transition('wait_to_take', 'sent', 'take'),\n new Transition('take', 'take', 'took'),\n ];\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks whether the given item is processed by this cluster. This method is safe for nonclustered usage. If you don't pass any options, a 1:1 cluster is given and the current process will process any item. | protected function isClusterProcessing($item)
{
return ($item % $this->getClusterSize() == ($this->getCluster() - 1));
} | [
"public function isProcessedItem($item)\n {\n $key = $this->process.'item'.$item->getId();\n if($this->registry->registry($key)){\n return true;\n } \n return false;\n }",
"public function has_item(){\n $args = func_get_args();\n $item = $this->get_info('robot_item');\n if (!empty($args[0])){ return $item == $args[0] ? true : false; }\n else { return !empty($item) ? true : false; }\n }",
"public function has_item(){\n $args = func_get_args();\n $counter = $this->get_counter('item_disabled');\n $item = empty($counter) ? $this->get_info('robot_item') : '';\n if (!empty($args[0])){ return $item == $args[0] ? true : false; }\n else { return !empty($item) ? true : false; }\n }",
"public function needToPerformAggregationForItem($item)\n {\n $itemIdentifier = $this->getItemIdentifier($item);\n return !isset($this->processedObjects[$itemIdentifier]);\n }",
"protected function task( $item ) {\n\n // Your Logic here\n return false;\n }",
"public function hasMember(int|float|null|object|bool|string $item): bool\n {\n return key_exists($this->hash($item), $this->internalMap);\n }",
"protected function isMulti($item)\n {\n if (!is_array($item)) return false;\n\n return is_array(head($item)) || head($item) instanceof Buyable;\n }",
"private function isMulti($item)\n {\n if ( ! is_array($item)) return false;\n\n return is_array(head($item)) || head($item) instanceof Buyable;\n }",
"private function isMulti($item): bool\n {\n if (is_array($item) === false) {\n return false;\n }\n\n return is_array(head($item)) || head($item) instanceof Buyable === true;\n }",
"private function isMulti($item)\n {\n if ( ! is_array($item)) return false;\n return is_array(head($item)) || head($item) instanceof Buyable;\n }",
"private function is_kernel_item($item) {\r\n $lr0 = $item->item();\r\n $result = false;\r\n if ($lr0->position() == 0 ) {\r\n $fst = $this->g->starting_lr1_item()->item();;\r\n if ($fst->is_same($lr0)) {\r\n $result = true;\r\n }\r\n } else {\r\n $result = true;\r\n }\r\n return $result;\r\n }",
"public function canApplyCustomPrice($item)\n {\n return !$item->isChildrenCalculated();\n }",
"public function validateObjectInRoot($item)\n {\n return in_array($item['uid'], $this->syncAPI->getSyncConfigManager()->getVersionEnabledRootPidList());\n }",
"public function contains($item)\n {\n foreach ($this->_queues as $queue) {\n if ($queue->contains($item)) {\n return true;\n }\n }\n return false;\n }",
"private function inItem()\n\t{\n\t\tif ($this->version == 'RSS 1.0' || $this->version == 'RSS 2.0')\n\t\t{\n\t\t\tif (in_array('ITEM', $this->insideItem) && $this->currentTag != 'ITEM')\n\t\t\treturn TRUE;\n\t\t} elseif ($this->version == 'ATOM 1') {\n\t\t\tif (in_array('ENTRY', $this->insideItem) && $this->currentTag != 'ENTRY')\n\t\t\treturn TRUE; \n\t\t}\n\t\t\n\t\treturn FALSE;\n\t}",
"private function inItem()\n\t{\n\t\tif($this->version == 'RSS 1.0' || $this->version == 'RSS 2.0')\n\t\t{\n\t\t\tif(in_array('ITEM', $this->insideItem) && $this->currentTag != 'ITEM')\n\t\t\treturn TRUE;\n\t\t}\n\t\telseif($this->version == 'ATOM 1')\n\t\t{\n\t\t\tif(in_array('ENTRY', $this->insideItem) && $this->currentTag != 'ENTRY')\n\t\t\treturn TRUE; \n\t\t}\n\t\t\n\t\treturn FALSE;\n\t}",
"protected function _isInCollection(iCollectibleItem $item) {\n try {\n $this->findItem($item);\n return true;\n } catch(KeyNotFoundException $knfe) {\n return false;\n }\n }",
"function Event_Proceedings_Has($item=array())\n {\n $res=FALSE;\n if ($this->Event(\"Contents\")==2)\n {\n $res=TRUE;\n }\n\n return $res;\n }",
"public function isProcessed() {}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
gets the example for the command | public function getExample(); | [
"public function getExample(): string\n {\n return $this->example;\n }",
"public function handleExampleCommand(ExampleCommand $command)\n {\n echo $command->getMessage().\"\\n\";\n }",
"public function getHelp()\n {\n return $this->app->bot()->getCommand($this->name)->description;\n }",
"public function help_examples(&$examples) {\n\t\t$examples[self::CMD_SQLDUMP] = array(\n\t\t\tself::CMD_SQLDUMP,\n\t\t);\n\t}",
"abstract public function commandDescription();",
"public function exampleStuff()\n\t{\n\t\treturn __CLASS__ . ' | Example stuff';\n\t}",
"public function cli_help() {}",
"private function getCommandHelp() {\n return <<<HELP\nThe <info>%command.name%</info> command creates new category and saves it in the database:\n\n <info>php %command.full_name%</info> <comment>name urlName description parent</comment>\n\n\n\nHELP;\n }",
"public function argument_example($opt = null)\n {\n if ($opt == 'help') {\n return 'Help for the argument \\'example\\'';\n }\n\n print \"\\n\".'argument_example was just called and $opt was: '.$opt.\"\\n\";\n $this->argumentvar = 'example';\n\n }",
"abstract protected function getExpectedCommand(): string;",
"public function getSynopsis() {\n return '<command>';\n }",
"public function getHelpString(): string;",
"public function getDescription(): string\n {\n return 'CLI exercise missing interface';\n }",
"public function tag() {return 'examples';}",
"public function getCodeExample();",
"protected function buildHelpFromCommand()\n {\n $help = wordwrap($this->command->getDescription());\n\n $examples = [];\n\n if ($this->command instanceof AnnotatedCommand) {\n foreach ($this->command->getExampleUsages() as $ex => $def) {\n // Skip empty examples and things with obvious pipes...\n if (($ex === '') || (strpos($ex, '|') !== false)) {\n continue;\n }\n\n $ex = preg_replace('/^drush\\s+/', '', $ex);\n $examples[$ex] = $def;\n }\n }\n\n if (!empty($examples)) {\n $help .= \"\\n\\ne.g.\";\n\n foreach ($examples as $ex => $def) {\n $help .= sprintf(\"\\n<return>// %s</return>\\n\", wordwrap(OutputFormatter::escape($def), 75, \"</return>\\n<return>// \"));\n $help .= sprintf(\"<return>>>> %s</return>\\n\", OutputFormatter::escape($ex));\n }\n }\n\n return $help;\n }",
"public function testDescriptionOutput()\n {\n $this->exec('queue worker --help');\n $this->assertOutputContains('Runs a queue worker');\n }",
"public function getHelp();",
"public function help_examples(&$examples) {\n\t\t$examples[self::CMD_CHANGEPWD] = array(\n\t\t\tself::CMD_CHANGEPWD . ' admin new_password',\n\t\t\tself::CMD_CHANGEPWD . ' user@email.com \"a new password\"',\n\t\t);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the rotation of the Photo | public function getRotation()
{
return $this->getAdapter()->getRotation();
} | [
"public function getRotation() {}",
"public function getRotation();",
"public function getRotate()\r\n\t{\r\n\t\treturn $this->rotate;\r\n\t}",
"public function getImageOrientation () {}",
"private function rotateExif() {\n $degArr = Array(\n 3 => 180,\n 6 => 270,\n 8 => 90,\n 4 => 180,\n 7 => 270,\n 5 => 90,\n 2 => 0\n );\n if(!isset($degArr[$this->orient])) {\n return true;\n }\n $orient = $this->orient;\n if(6==$orient || 8==$orient || 5==$orient || 7==$orient) {\n $sw = $this->width;\n $this->width = $this->height;\n $this->height = $sw;\n }\n \n if( !function_exists(\"imagerotate\") ) {\n $width = $this->width;\n $height = $this->height;\n #image rotate and reflections oX\n $rotRes = imagecreatetruecolor($width,$height);\n $srcImg = $this->ImgRes;\n for($x=0; $x<$width; $x++) {\n for($y=0; $y<$height; $y++) {\n if(3==$orient) {\n $srcX = $width-$x-1;\n $srcY = $height-$y-1;\n } elseif(8==$orient) {\n $srcX = $height-$y-1;\n $srcY = $x;\n } elseif(6==$orient) {\n $srcX = $y;\n $srcY = $width-$x-1;;\n } elseif(4==$orient) {\n $srcX = $x;\n $srcY = $height-$y-1;\n } elseif(7==$orient) {\n $srcX = $height-$y-1;\n $srcY = $width-$x-1;\n } elseif(5==$orient) {\n $srcX = $y;\n $srcY = $x;;\n } elseif(2==$orient) {\n $srcX = $width-$x-1;\n $srcY = $y;\n } \n $color = imagecolorat($srcImg, $srcX, $srcY);\n imagesetpixel($rotRes, $x, $y, $color);\n }\n }\n } else {\n $rotRes = imagerotate($this->ImgRes, $degArr[$this->orient], 0);\n if(2==$orient || 4==$orient || 5==$orient || 7==$orient) {\n #image reflections oX\n $width = $this->width;\n $height = $this->height; \n $newImg = imagecreatetruecolor($width, $height);\n for ($x = 0; $x < $width; $x++) {\n imagecopy($newImg, $rotRes, $x+1, 0, $width-$x+1, 0, 1, $height);\n }\n imageDestroy($rotRes);\n $rotRes = $newImg; \n }\n }\n \n imageDestroy($this->ImgRes);\n $this->ImgRes = $rotRes;\n return true;\n }",
"public function image_rotate() {\n\t\t$p =& $this->image_params;\n\t\t\n\t\t$degs = array(90, 180, 270, 'vrt', 'hor');\n\t\t\n\t\tif ($p['rotation_angle'] == '' OR ! in_array($p['rotation_angle'], $degs)) {\n\t\t\t$this->image_set_error('rotation_angle_required');\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\tif ($p['rotation_angle'] == 90 OR $p['rotation_angle'] == 270) {\n\t\t\t$p['width'] \t= $p['orig_height'];\n\t\t\t$p['height']\t= $p['orig_width'];\n\t\t} else {\n\t\t\t$p['width']\t\t= $p['orig_width'];\n\t\t\t$p['height']\t= $p['orig_height'];\n\t\t}\n\t\t\n\t\tif ($p['rotation_angle'] == 'hor' OR $p['rotation_angle'] == 'vrt')\n\t\t\treturn $this->image_mirror();\n\t\t\n\t\t$image \t= $this->image_create();\n\t\t\n\t\tif ($image === FALSE)\n\t\t\treturn FALSE;\n\t\t\t\n\t\t$white \t= imagecolorallocate($image, 255, 255, 255);\n\t\t\n\t\t$image_p = imagerotate($image, $this->image_params['rotation_angle'], $white);\n\t\t\n\t\t$this->image_get_result($image_p);\n\t\t\n\t\treturn TRUE;\n\t}",
"function GetOrientation(){}",
"public function rotate()\n\t{\n\t\t// Allowed rotation values\n\t\t$degs = array(90, 180, 270, 'vrt', 'hor');\n\n\t\tif ($this->rotation_angle === '' OR ! in_array($this->rotation_angle, $degs))\n\t\t{\n\t\t\t$this->set_error('imglib_rotation_angle_required');\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Reassign the width and height\n\t\tif ($this->rotation_angle === 90 OR $this->rotation_angle === 270)\n\t\t{\n\t\t\t$this->width\t= $this->orig_height;\n\t\t\t$this->height\t= $this->orig_width;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->width\t= $this->orig_width;\n\t\t\t$this->height\t= $this->orig_height;\n\t\t}\n\n\t\t// Choose resizing function\n\t\tif ($this->image_library === 'imagemagick' OR $this->image_library === 'netpbm')\n\t\t{\n\t\t\t$protocol = 'image_process_'.$this->image_library;\n\t\t\treturn $this->$protocol('rotate');\n\t\t}\n\n\t\treturn ($this->rotation_angle === 'hor' OR $this->rotation_angle === 'vrt')\n\t\t\t? $this->image_mirror_gd()\n\t\t\t: $this->image_rotate_gd();\n\t}",
"public function rotateExif()\n {\n if (!in_array($this->fileType, array(IMAGETYPE_JPEG, IMAGETYPE_TIFF_II, IMAGETYPE_TIFF_MM))) {\n $this->log(\"Autorotate ignored, EXIF not supported by this filetype.\");\n return $this;\n }\n\n $exif = exif_read_data($this->pathToImage);\n\n if (!empty($exif['Orientation'])) {\n switch ($exif['Orientation']) {\n case 3:\n $this->log(\"Autorotate 180.\");\n $this->rotate(180, $this->bgColor);\n break;\n\n case 6:\n $this->log(\"Autorotate -90.\");\n $this->rotate(-90, $this->bgColor);\n break;\n\n case 8:\n $this->log(\"Autorotate 90.\");\n $this->rotate(90, $this->bgColor);\n break;\n\n default:\n $this->log(\"Autorotate ignored, unknown value as orientation.\");\n }\n } else {\n $this->log(\"Autorotate ignored, no orientation in EXIF.\");\n }\n\n return $this;\n }",
"public function getRotation(): float\n {\n return rad2deg($this->angle);\n }",
"public function correctImageOrientation(Photo $photo) {\n $path = $this->path;\n $filen = $this->getName();\n $ext = $this->extension;\n try {\n\n $exif = @exif_read_data($path);\n\n $orientation = isset($exif['Orientation']) ? $exif['Orientation'] : null;\n\n if (isset($orientation) && $orientation != 1){\n switch ($orientation) {\n case 3:\n $deg = 180;\n break;\n case 6:\n $deg = 270;\n break;\n case 8:\n $deg = 90;\n break;\n }\n\n if ($deg) {\n\n // If png\n if ($ext == \"png\") {\n $img_new = imagecreatefrompng($path);\n $img_new = imagerotate($img_new, $deg, 0);\n\n // Save rotated image\n imagepng($img_new,$path);\n }else {\n $img_new = imagecreatefromjpeg($path);\n $img_new = imagerotate($img_new, $deg, 0);\n\n // Save rotated image\n imagejpeg($img_new,$path,80);\n }\n }\n }\n\n } catch (Exception $e) {\n throw new Exception(\"L'image n'a pas pu être ré-orienté\");\n }\n unset($file);\n }",
"public function getRotationAngle() {\r\n return $this->rotateDegree;\r\n }",
"public function getExifOrientation() {\n if ($this->exifOrientation === static::EXIF_ORIENTATION_NOT_FETCHED) {\n if ($this->getSource() !== NULL) {\n $file_md = $this->fileMetadataManager->uri($this->getSource());\n if ($file_md->getLocalTempPath() === NULL) {\n $file_md->setLocalTempPath($this->ensureSourceLocalPath());\n }\n $orientation = $file_md->getMetadata('exif', 'Orientation');\n $this->setExifOrientation(isset($orientation['value']) ? $orientation['value'] : NULL);\n }\n else {\n $this->setExifOrientation(NULL);\n }\n }\n return $this->exifOrientation;\n }",
"public function exifRotation($file) {\n $exif = @exif_read_data($file);\n if (!$exif) return false;\n $ort = @$exif['IFD0']['Orientation'];\n if (!$ort) $ort = @$exif['Orientation'];\n switch($ort) {\n case 3: // image upside down\n return '180';\n break;\n case 6: // 90 rotate right & switch max sizes\n return '-90';\n break;\n case 8: // 90 rotate left & switch max sizes\n return '90';\n break;\n default:\n return false;\n }\n }",
"public function getRotateControl();",
"private function getOrientation()\n {\n return $this->orientation;\n }",
"public function testGetRotation()\n {\n $photoResult = new PhotoResult($this->getAdapter());\n $this->assertEquals($this->getAdapter()->getRotation(), $photoResult->getRotation());\n }",
"public function getRotation(): array {\n\t\treturn $this->rotation;\n\t}",
"public function getOrientation()\n {\n return $this->orientation;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Writes to the theme.yaml file with the supplied array values. | public function writeConfig($values = [], $overwrite = false)
{
if (!$overwrite) {
$values = $values + (array) $this->getConfig();
}
$path = $this->getPath().'/theme.yaml';
if (!File::exists($path)) {
throw new ApplicationException('Path does not exist: '.$path);
}
$contents = Yaml::render($values);
File::put($path, $contents);
$this->configCache = $values;
} | [
"private function write()\n\t{\n\t\t$this->config->write($this->path, 'yaml');\n\t}",
"public static function writeEnv(Array $values)\n {\n if (!self::envExist()) {\n file_put_contents(getValidPath(CONFIG_PATH, self::ENVFILE, implode(PHP_EOL, $values)));\n }\n }",
"public function testSaveArrayToYaml( )\n {\n $file = OUTPUT_DIR . 'array.yml';\n \n $array = array( 'this', 'that', 'and', 'all', 'this' );\n \n $this->yaml->save($array, $file );\n \n $this->assertEquals(\n\"- this\n- that\n- and\n- all\n- this\n\",\n file_get_contents( $file ) );\n }",
"function arrayToSettings($array,$filename) {\n $file = \"<?php\\n\";\n foreach ($array as $key => $val) {\n $file .= ' $' . str_replace(\" \",\"\",str_replace(\"\\t\",\"\",$key)) . ' = \"' . addSlashes($val) . \"\\\";\\n\";\n }\n $file .= \"?\";\n $file .= \">\";\n if (($handle = fopen($filename, \"w\")) === false) {\n echo \"Could not write to $filename.\";\n die();\n }\n fwrite($handle,$file);\t\n fclose ($handle);\n}",
"protected function write(array $manifest)\n {\n file_put_contents(\n $this->manifestPath,\n '<?php return '.var_export($manifest, true).';'\n );\n }",
"private function createConfiguration($path, $values)\n {\n $file = fopen($path, 'w');\n \n if (!$file) {\n die(\"File $path could not be opened\");\n }\n \n foreach ($values as $key => $value) {\n $success = fwrite($file, $key.' = '.$value.\"\\r\\n\"); \n if (!$success) {\n die(\"$path could not be written\");\n }\n }\n fclose($file); \n }",
"function write_array( &$array2store ){\n die('decided to go anohter route - not done');\n // add the settings back at the bottom of the file\n reset($array2store);\n foreach( $array2store as $key => $val ){\n for( $x = 0 ; $x < count($values) ; ++$x ){ //yes count in a loop - only doing it since this is a single user script -- ohh yeah, sue me!\n exec(\"echo '\".$config_value.'['.$x.\"]=\\\"\".$values[$x].\"\\\"' >> '$this->_settings_file'\");\n ++$upcnt;\n }\n }\n\n }",
"protected function writeAppsettings()\n {\n $app = Bootstrap::getApplication();\n $settings = $app['settings'];\n\n $file = WPBOOT_BASEPATH . '/appsettings.yml';\n $dumper = new Dumper();\n file_put_contents($file, $dumper->dump($settings, 4));\n }",
"public function settingFileWrite(){ \n\t\t\n\t\t$DB\t\t\t=\tAdminLanguageSetting::query();\n\t\t$list\t\t=\t$DB->get()->toArray();\n\t\t\n\t\t$languages\t=\tlanguage::where('is_active', '=', '1')->get(array('folder_code','lang_code'));\n\t\t\n\t\tforeach($languages as $key => $val){\n\t\t\t$currLangArray\t=\t'<?php return array(';\n\t\t\tforeach($list as $listDetails){\n\t\t\t\tif($listDetails['locale'] == $val->lang_code){\n\t\t\t\t\t$currLangArray\t.= '\"'.$listDetails['msgid'].'\"=>\"'.$listDetails['msgstr'].'\",'.\"\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t$currLangArray\t.=\t');';\n\t\t\t\n\t\t\t$file \t\t\t= \t ROOT.DS.'app'.DS.'lang'.DS.$val->lang_code.DS.'messages.php';\n\t\t\t$bytes_written = \t File::put($file, $currLangArray);\n\t\t\tif ($bytes_written === false)\n\t\t\t{\n\t\t\t\tdie(\"Error writing to file\");\n\t\t\t}\n\t\t}\n\t}",
"public function settingFileWrite() {\r\n\t\t$DB\t\t=\tSetting::query();\r\n\t\t$list\t=\t$DB->orderBy('key','ASC')->get(array('key','value'))->toArray();\r\n\t\t\r\n $file = SETTING_FILE_PATH;\r\n\t\t$settingfile = '<?php ' . \"\\n\";\r\n\t\tforeach($list as $value){\r\n\t\t\t$val\t\t =\t str_replace('\"',\"'\",$value['value']);\r\n\t\t\t/* if($value['key']=='Reading.records_per_page' || $value['key']=='Site.debug'){\r\n\t\t\t\t$settingfile .= '$app->make('.'\"config\"'.')->set(\"'.$value['key'].'\", '.$val.');' . \"\\n\"; \r\n\t\t\t}else{\r\n\t\t\t\t$settingfile .= '$app->make('.'\"config\"'.')->set(\"'.$value['key'].'\", \"'.$val.'\");' . \"\\n\"; \r\n\t\t\t} */\r\n\t\t\t\r\n\t\t\t$settingfile .= 'config::set(\"'.$value['key'].'\", \"'.$val.'\");' . \"\\n\"; \r\n\t\t\t\r\n\t\t}\r\n\t\t$bytes_written = File::put($file, $settingfile);\r\n\t\tif ($bytes_written === false)\r\n\t\t{\r\n\t\t\tdie(\"Error writing to file\");\r\n\t\t}\r\n\t}",
"public function writeArray($file, $array)\n {\n $write = \"\";\n\n if (is_array($array) && $array) {\n $write = \"<?php\\nreturn \" . var_export($array, true) . \"\\n?>\";\n }\n\n file_put_contents($file, $write);\n }",
"private function writeTXT($array) {\n $handle = fopen($this->filename, 'w');\n $string = '';\n\n foreach ($array as $key => $value) {\n $string .= \"$value\\n\";\n }\n\n fwrite($handle, $string);\n fclose($handle);\n }",
"protected function write(array $manifest)\n {\n file_put_contents($this->manifestPath, '<?php return ' . var_export($manifest, true) . ';');\n $this->invalidate($this->manifestPath);\n }",
"function kvwriteFile($file, $arr) {\n\t$contents = kvwrite($arr);\n\t$fh = fopen($file, 'w');\n\tfwrite($fh, $contents);\n\tfclose($fh);\n}",
"function writeFile ($array){\n\n foreach ($array as $names => $quantities){\n\n if ( !is_array($quantities) ){\n file_put_contents('file.txt', $names . PHP_EOL, FILE_APPEND);\n }\n elseif (is_array($quantities)){\n writeFile($quantities);\n }\n }\n }",
"function WriteFile($theme_file_path, $theme_file_content)\n{\n //print $theme_file_content;\n if(!$theme_file_handle = fopen($theme_file_path, 'w')){\n die(\"Cannot open file $theme_file_path for writing\\n\");\n }\n if (fwrite($theme_file_handle, $theme_file_content) === false) {\n die(\"Cannot write file $theme_file_path.\\n\");\n }\n fclose($theme_file_handle);\n print \"Wrote $theme_file_path.\\n\";\n}",
"private function insertInYaml(array $injections)\n {\n $yaml_file = Yaml::parse(file_get_contents(self::YAML_FILE));\n $yaml_file = ($yaml_file)? : [];\n foreach ($injections['to_add_first'] as $injection) {\n $yaml_file = array_merge($injection, $yaml_file);\n }\n foreach ($injections['to_add_second'] as $injection) {\n $yaml_file = array_merge( $injection, $yaml_file);\n }\n\n return file_put_contents(self::YAML_FILE, Yaml::dump($yaml_file,3));\n }",
"public function save()\n {\n $array = $this->_buildArrayToWrite();\n\n $this->_path = sfConfig::get('sf_app_dir').'/config/app.yml';\n\n file_put_contents($this->_path, sfYaml::dump($array, 4));\n\n chdir(sfConfig::get('sf_root_dir'));\n $task = new sfCacheClearTask(sfApplicationConfiguration::getActive()->getEventDispatcher(), new sfFormatter());\n $task->run(array(), array('type' => 'config'));\n }",
"function createManifest(array $dados) {\n $data = str_replace(['{$sitename}', '{$favicon}', '{$theme}', '{$themeColor}'], [$dados['sitename'], $dados['favicon'], '#2196f3', '#FFFFFF'], file_get_contents(\"start/tpl/manifest.txt\"));\n writeFile(\"manifest.json\", $data);\n writeFile(\"service-worker.js\", file_get_contents(\"start/tpl/service-worker.txt\"));\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the post back options for this textbox. | protected function getPostBackOptions()
{
$options['ID'] = $this->getClientID();
$options['EventTarget'] = $this->getUniqueID();
$options['AutoPostBack'] = $this->getAutoPostBack();
$options['CausesValidation'] = $this->getCausesValidation();
$options['ValidationGroup'] = $this->getValidationGroup();
$options['TextMode'] = $this->getTextMode();
return $options;
} | [
"protected function getPostBackOptions()\n\t{\n\t\t$options['ID'] = $this->getClientID();\n\t\t$options['EventTarget'] = $this->getUniqueID();\n\n\t\t$options['accept'] = $this->getAcceptCssClass();\n\t\t$options['hoverclass'] = $this->getHoverCssClass();\n\t\treturn $options;\n\t}",
"protected function getPostBackOptions()\n\t{\n\t\t$options['ID']=$this->getClientID();\n\t\t$options['CausesValidation']=$this->getCausesValidation();\n\t\t$options['EventTarget'] = $this->getUniqueID();\n\t\t$options['ValidationGroup']=$this->getValidationGroup();\n\n\t\treturn $options;\n\t}",
"protected function getPostBackOptions()\n\t{\n\t\t$options = parent::getPostBackOptions();\n\t\t$options['ClassName'] = $this->getCssClass();\n\t\t$options['ShowColorPicker'] = $this->getShowColorPicker();\n\t\tif($options['ShowColorPicker'])\n\t\t{\n\t\t\t$mode = $this->getMode();\n\t\t\tif($mode == TColorPickerMode::Full) $options['Mode'] = $mode;\n\t\t\telse if($mode == TColorPickerMode::Simple) $options['Palette'] = 'Tiny';\n\t\t\t$options['OKButtonText'] = $this->getOKButtonText();\n\t\t\t$options['CancelButtonText'] = $this->getCancelButtonText();\n\t\t}\n\t\t$options = array_merge($options,$this->getClientSide()->getOptions()->toArray());\n\t\treturn $options;\n\t}",
"public function getPostbackData()\n {\n return $this->postback_data;\n }",
"public function getPostback()\n {\n return $this->postback;\n }",
"function getPostOpList()\n\t{\n\t\t$options = array();\n\t\t$options[] = JHTML::_('select.option', 'none', JText::_('CRON_OPT_POSTOP_NONE'));\n\t\t$options[] = JHTML::_('select.option', 'upload', JText::_('CRON_OPT_POSTOP_UPLOAD'));\n\t\t$options[] = JHTML::_('select.option', 'email', JText::_('CRON_OPT_POSTOP_EMAIL'));\n\t\treturn $options;\n\t}",
"protected function getOptions() {\n $this->params['options'] = empty($this->params['options']) ?\n array() : json_decode(htmlspecialchars_decode(\n $this->params['options']), TRUE);\n }",
"public function options() {\n\t\t// Refresh the current languages\n\t\t$this->parse_available_languages();\n\t\t// Merge in our previously set language settings\n\t\t$langs = $this->merge_lang_sets( $this->available_langs, $this->lang_prefs );\n\t\t// Merge in any POSTed field values\n\t\tforeach ( $langs as $code => & $lang ) {\n\t\t\t$lang->url_prefix = ( @ isset( $_POST[ 'url_prefix_' . $code ] ) ) ? $_POST[ \"url_prefix_$code\" ] : @ $lang->url_prefix;\n\t\t\tif ( ! $lang->url_prefix )\n\t\t\t\t$lang->url_prefix = $lang->url_prefix;\n\t\t\t$lang->text_direction = $lang->text_direction;\n\t\t\t// This line must come after the text direction value is set\n\t\t\t$lang->input_lang_class = ( 'rtl' == $lang->text_direction ) ? 'lang-rtl' : 'lang-ltr' ;\n\t\t\t$lang->display_name = ( @ isset( $_POST[ \"display_name_$code\" ] ) ) ? $_POST[ \"display_name_$code\" ] : @ $lang->display_name;\n\t\t\tif ( ! $lang->display_name )\n\t\t\t\t$lang->display_name = $lang->names;\n\t\t\t// Note any url_prefix errors\n\t\t\t$lang->url_prefix_error = ( @ $this->errors[ \"url_prefix_$code\" ] ) ? 'babble-error' : '0' ;\n\t\t\t// Flag the active languages\n\t\t\t$lang->active = false;\n\t\t\tif ( in_array( $code, $this->active_langs ) )\n\t\t\t\t$lang->active = true;\n\t\t\t\n\t\t}\n\t\t$vars = array();\n\t\t$vars[ 'langs' ] = $langs;\n\t\t$vars[ 'default_lang' ] = $this->default_lang;\n\t\t$vars[ 'active_langs' ] = $this->get_active_langs();\n\t\t$this->render_admin( 'options-available-languages.php', $vars );\n\t}",
"public function getOptionsForm();",
"public function getPostBack() {\n return $this->isPostBack;\n }",
"public function getFormOptions(): array;",
"public function getOptionsValues()\n {\n return $_SESSION['FORM_DATA'][$this->fieldname];\n }",
"protected function get_control_options() {\n\t\treturn [];\n\t}",
"public function getOptions()\n\t{\n\t\t$options = array(\n\t\t\t1 => JText::_('PLG_FIELDS_TCCHECKBOX_TERMSANDCONDITIONS_ACCETED')\n\t\t);\n\n\t\treturn $options;\n\t}",
"public function getFormOptions()\n {\n return $this->form->getOptions();\n }",
"protected function getClientScriptOptions()\n\t{\n\t\t$control = $this->getValidationTarget();\n\t\t$options['ID'] = $this->getClientID();\n\t\t$options['FormID'] = $this->getPage()->getForm()->getClientID();\n\t\t$options['Display'] = $this->getDisplay();\n\t\t$options['ErrorMessage'] = $this->getErrorMessage();\n\t\tif($this->getFocusOnError())\n\t\t{\n\t\t\t$options['FocusOnError'] = $this->getFocusOnError();\n\t\t\t$options['FocusElementID'] = $this->getFocusElementID();\n\t\t}\n\t\t$options['ValidationGroup'] = $this->getValidationGroup();\n\t\tif($control)\n\t\t\t$options['ControlToValidate'] = $control->getClientID();\n\t\t$options['ControlCssClass'] = $this->getControlCssClass();\n\n\t\t$options['ControlType'] = $this->getClientControlClass($control);\n\t\t$options['Enabled'] = $this->getEnabled(true);\n\n\t\t//get date format from date picker target control\n\t\tif($control instanceof TDatePicker)\n\t\t\t$options['DateFormat'] = $control->getDateFormat();\n\n\t\t$options = array_merge($options,$this->getClientSide()->getOptions()->toArray());\n\n\t\treturn $options;\n\t}",
"public function get_post_values() {\n\t\treturn $this->_post_values;\n\t}",
"function wpsearch_get_options() {\r\n return WPSearchOptions::getOptions();\r\n }",
"public function GetPostHTML() {\n\n return $this->GetOption('PostHTML');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks Booking Source is active or not | protected function is_active_booking_source()
{
$data['status'] = SUCCESS_STATUS;
$data['message'] = '';
if(valid_array($this->config) == false){
$data['status'] = FAILURE_STATUS;
$data['message'] = $this->booking_source.': Booking Source is not active';
}
return $data;
} | [
"public function isBookable() {\n \treturn in_array($this->attributes['status'], array(1,2));\n }",
"function wprss_is_feed_source_active( $source_id ) {\n $state = get_post_meta( $source_id, 'wprss_state', TRUE );\n return ( $state === '' || $state === 'active' );\n }",
"public function isBookable();",
"function active_booking_source()\r\n\t{\r\n\t\t$query = 'select BS.source_id, BS.origin from meta_course_list AS MCL, booking_source AS BS, activity_source_map AS ASM WHERE\r\n\t\tMCL.origin=ASM.meta_course_list_fk and ASM.booking_source_fk=BS.origin and MCL.course_id='.$this->db->escape(META_ACCOMODATION_COURSE).'\r\n\t\tand BS.booking_engine_status='.ACTIVE.' AND MCL.status='.ACTIVE.' AND ASM.status=\"active\"';\r\n\t\treturn $this->db->query($query)->result_array();\r\n\t}",
"function getIsBookable() ;",
"public function isBookable()\n\t{\n\t\treturn !$this->isClosed() && !$this->isFull() && !isAttending();\n\t}",
"public function getIsBookable();",
"public function check_current_booking()\n\t\t{\n\t\t\t$result = $this->LockerModel->CheckLockerBooking();\n\t\t\treturn $result;\n\t\t}",
"function is_reserved(){\n\t $result = false;\n\t if( $this->booking_status == 0 && get_option('dbem_bookings_approval_reserved') ){\n\t $result = true;\n\t }elseif( $this->booking_status == 0 && !get_option('dbem_bookings_approval') ){\n\t $result = true;\n\t }elseif( $this->booking_status == 1 ){\n\t $result = true;\n\t }\n\t return apply_filters('em_booking_is_reserved', $result, $this);\n\t}",
"public function isBooking() {\n \treturn !empty($this->attributes['bkc']);\n }",
"function active_booking_source($course_id=META_SIGHTSEEING_COURSE)\r\n {\r\n $query = 'select BS.source_id, BS.origin from meta_course_list AS MCL, booking_source AS BS, activity_source_map AS ASM WHERE\r\n MCL.origin=ASM.meta_course_list_fk and ASM.booking_source_fk=BS.origin and MCL.course_id='.$this->db->escape($course_id).'\r\n and BS.booking_engine_status='.ACTIVE.' AND MCL.status='.ACTIVE.' AND ASM.status=\"active\"';\r\n return $this->db->query($query)->result_array();\r\n }",
"public function check_availability() {\n \n return true;\n \n }",
"public static function isThereOngoingBookings(){\n\n // first to set this function to run only if $_SESSION with checking isn't set (to check this ongoing only once in a session)\n if(!isset($_SESSION['ongoing'])){\n\n // set session to true in order to avoid checking during a session\n $_SESSION['ongoing'] = true;\n\n $today = new DateTime();\n $today = $today->format('Y-m-d H:i:s');\n\n $sql = \"UPDATE \" . static::$db_table . \" SET status = 3 WHERE checkin <= :today AND checkout > :today\";\n $db = static::getDB();\n\n $stm = $db->prepare($sql);\n $stm->bindValue(':today', $today, PDO::PARAM_STR);\n $stm->setFetchMode(PDO::FETCH_CLASS, get_called_class());\n\n $stm->execute();\n\n }\n return false;\n }",
"public function validateSource(): bool\n {\n return ($this->source and $this->source->isOpen());\n }",
"public function check_availability();",
"public function isBookingOnline() {\n\t\treturn $this->getBookingOnline();\n\t}",
"function check_in ($booking_id) {\n $l = retrieve_dbLoaners($this->id);\n if ($l && $l->status == \"inuse\") {\n $l->status = \"available\";\n $l->booking_id = null;\n update_dbLoaners($l);\n return $l;\n }\n else return false; // can't check in if not in use\n }",
"public function testBookingsAreAvailable(): void\n {\n $booking = Booking::factory()->create();\n\n $this->actingAs($booking->user)\n ->get('profile/bookings')\n ->assertSuccessful()\n ->assertSee($booking->resource->name);\n }",
"public function isBooked(){\n $result = BookingController::isBooked($this->id_list_row);\n return $result;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation fontsDeleteCollection Deletes the specified collection. | public function fontsDeleteCollection($id, $tenant_id = null)
{
list($response) = $this->fontsDeleteCollectionWithHttpInfo($id, $tenant_id);
return $response;
} | [
"public function fontsDeleteCollectionWithHttpInfo($id, $tenant_id = null)\n {\n $request = $this->fontsDeleteCollectionRequest($id, $tenant_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n (string) $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n\n switch($statusCode) {\n case 200:\n if ('\\Aurigma\\AssetStorage\\Model\\CollectionDto' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\Aurigma\\AssetStorage\\Model\\CollectionDto', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 404:\n if ('\\Aurigma\\AssetStorage\\Model\\ProblemDetails' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\Aurigma\\AssetStorage\\Model\\ProblemDetails', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\Aurigma\\AssetStorage\\Model\\CollectionDto';\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Aurigma\\AssetStorage\\Model\\CollectionDto',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Aurigma\\AssetStorage\\Model\\ProblemDetails',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function delete(WebCollection $collection);",
"public function deleteCollection()\n {\n try {\n $response = $this->rekognition->deleteCollection(['CollectionId' => $this->faceCollectionId]);\n $this->echoVerbose($response);\n } catch (RekognitionException $e) {\n $this->echoVerbose( $e->getMessage() );\n exit(1);\n }\n }",
"public function removeCollection(\\TeckHouse\\AnalyticsBundle\\Document\\Collection $collection);",
"public function delete(PersistentCollection $collection);",
"public function deleteCollectionQuery(Collection $collection): void;",
"public function deleteItems(Collection $collection): Collection;",
"public function fontsCreateCollectionWithHttpInfo($tenant_id = null, $create_collection_dto = null)\n {\n $request = $this->fontsCreateCollectionRequest($tenant_id, $create_collection_dto);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n (string) $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n\n switch($statusCode) {\n case 201:\n if ('\\Aurigma\\AssetStorage\\Model\\CollectionDto' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\Aurigma\\AssetStorage\\Model\\CollectionDto', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 409:\n if ('\\Aurigma\\AssetStorage\\Model\\NameConflictDto' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\Aurigma\\AssetStorage\\Model\\NameConflictDto', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\Aurigma\\AssetStorage\\Model\\CollectionDto';\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 201:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Aurigma\\AssetStorage\\Model\\CollectionDto',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 409:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Aurigma\\AssetStorage\\Model\\NameConflictDto',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function forceDeleted(Collection $collection)\n {\n //\n }",
"public function fontsDeleteCollectionRequest($id, $tenant_id = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling fontsDeleteCollection'\n );\n }\n\n $resourcePath = '/api/storage/v1/fonts/collections/{id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($tenant_id !== null) {\n if('form' === 'form' && is_array($tenant_id)) {\n foreach($tenant_id as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['tenantId'] = $tenant_id;\n }\n }\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n // aurigmafix 6\n if (gettype($formParamValueItem) === 'object') {\n if (!($formParamValueItem instanceof StreamInterface \n || $formParamValueItem instanceof \\Iterator \n || method_exists($formParamValueItem, '__toString'))) {\n $formParamValueItem = json_encode($formParamValueItem);\n }\n } \n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('X-API-Key');\n if ($apiKey !== null) {\n $headers['X-API-Key'] = $apiKey;\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n // this endpoint requires OAuth (access token)\n // aurigmafix 3\n $token = $this->config->getAccessToken();\n if ($token !== null && $token !== '' && !ctype_space($token)) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n // this endpoint requires OAuth (access token)\n // aurigmafix 3\n $token = $this->config->getAccessToken();\n if ($token !== null && $token !== '' && !ctype_space($token)) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n // this endpoint requires OAuth (access token)\n // aurigmafix 3\n $token = $this->config->getAccessToken();\n if ($token !== null && $token !== '' && !ctype_space($token)) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public static function deleteCollectionAssociation(Collection $collection)\n {\n $c = static::where('collection_id', '=', $collection->id)->get();\n if(count($c) > 0) {\n foreach($c as $assoc) {\n $assoc->delete();\n }\n }\n }",
"public function registerFonts(array $fontDataCollection): MpdfWrapperInterface;",
"public function fontsDeleteCollectionAsyncWithHttpInfo($id, $tenant_id = null)\n {\n $returnType = '\\Aurigma\\AssetStorage\\Model\\CollectionDto';\n $request = $this->fontsDeleteCollectionRequest($id, $tenant_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"public function deleteCollection($collection){\n $option=array();\n $response=$this->delete('collection/'.$collection,NULL,'json');\n return $response;\n }",
"public function collectionRemoved(Collection $collection): void\n {\n $this->collections->removeElement($collection);\n }",
"public function removeCollection($collection) {\r\n \r\n /*\r\n * Never remove a non empty collection\r\n */\r\n if (!$this->collectionIsEmpty($collection)) {\r\n RestoLogUtil::httpError(403, 'Cannot delete a non empty collection ' . $collection->name);\r\n }\r\n \r\n $results = $this->dbDriver->query('SELECT collection FROM resto.collections WHERE collection=\\'' . pg_escape_string($collection->name) . '\\'');\r\n $schemaName = '_' . strtolower($collection->name);\r\n \r\n if (pg_fetch_assoc($results)) {\r\n \r\n /*\r\n * Delete (within transaction)\r\n * - entry within osdescriptions table\r\n * - entry within collections table\r\n */\r\n $query = 'BEGIN;';\r\n $query .= 'DELETE FROM resto.osdescriptions WHERE collection=\\'' . pg_escape_string($collection->name) . '\\';';\r\n $query .= 'DELETE FROM resto.collections WHERE collection=\\'' . pg_escape_string($collection->name) . '\\';';\r\n \r\n /*\r\n * Do not drop schema if product table is not empty\r\n */\r\n if ($this->dbDriver->check(RestoDatabaseDriver::SCHEMA, array('name' => $schemaName)) && $this->dbDriver->check(RestoDatabaseDriver::TABLE_EMPTY, array('name' => 'features', 'schema' => $schemaName))) {\r\n $query .= 'DROP SCHEMA ' . $schemaName . ' CASCADE;';\r\n }\r\n\r\n $query .= 'COMMIT;';\r\n $this->dbDriver->query($query);\r\n /*\r\n * Rollback on error\r\n */\r\n if ($this->collectionExists($collection->name)) {\r\n $this->dbDriver->query('ROLLBACK');\r\n RestoLogUtil::httpError(500, 'Cannot delete collection ' . $collection->name);\r\n }\r\n }\r\n \r\n }",
"public function deleteByCollection($collection): void\n {\n $query = $collection->getSelect()->deleteFromSelect('main_table');\n\n try {\n $this->getConnection()->query($query);\n } catch (\\Exception $exception) {\n throw new CouldNotDeleteException(__('%1 could not delete events', __CLASS__), $exception);\n }\n }",
"public function delete_users_collection()\n\t{\n\t\t$this->mongo_db->drop_collection('users');\n\t}",
"public function fontsGetCollectionWithHttpInfo($id, $tenant_id = null)\n {\n $request = $this->fontsGetCollectionRequest($id, $tenant_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n (string) $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n\n switch($statusCode) {\n case 200:\n if ('\\Aurigma\\AssetStorage\\Model\\CollectionContentOfFontDto' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\Aurigma\\AssetStorage\\Model\\CollectionContentOfFontDto', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 404:\n if ('\\Aurigma\\AssetStorage\\Model\\ProblemDetails' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\Aurigma\\AssetStorage\\Model\\ProblemDetails', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\Aurigma\\AssetStorage\\Model\\CollectionContentOfFontDto';\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Aurigma\\AssetStorage\\Model\\CollectionContentOfFontDto',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Aurigma\\AssetStorage\\Model\\ProblemDetails',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Saving custom gallery into post_meta table | function gallery_meta_save( $post_id ) {
if ( ! isset( $_POST['gallery_meta_nonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['gallery_meta_nonce'] ) ), basename( __FILE__ ) ) ) {
return;
}
if ( ! current_user_can( 'edit_post', $post_id ) ) {
return;
}
if ( ! empty( $_POST['image_gallery_id'] ) ) {
update_post_meta( $post_id, 'image_gallery_id', array_map( 'intval', wp_unslash( $_POST['image_gallery_id'] ) ) );
} else {
delete_post_meta( $post_id, 'image_gallery_id' );
}
} | [
"function featured_gallery_save($post_id){\r\n\t\tif (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) return $post_id;\r\n\r\n\t\t// verify\r\n\t\tif ( !wp_verify_nonce( $_POST['sm_featured_gallery_nonce'], plugin_basename( __FILE__ ) ) ) return;\r\n\t\tif ( 'page' == $_POST['post_type'] ) {\r\n\t\t\tif ( !current_user_can( 'edit_page', $post_id ) ) return;\r\n\t\t\telse\r\n\t\t\t\tif ( !current_user_can( 'edit_post', $post_id ) ) return;\r\n\t\t}\r\n\r\n\t\t// save gallery options\r\n\t\tforeach($_POST as $key => $value) {\r\n\t\t\tif(stristr($key,'sm_featured_gallery')) {\r\n\t\t\t\tif($key == 'sm_featured_gallery_width' || $key == 'sm_featured_gallery_height' ) {\r\n\t\t\t\t\t$value=str_replace('px', '', $value);\r\n\t\t\t\t}\r\n\t\t\t\t// dont' save nonce or checkbox\r\n\t\t\t\tif($key != 'sm_featured_gallery_nonce' && $key != 'sm_featured_gallery_hyperlink_new_checkbox' && $key != 'sm_featured_gallery_exclude_featured_checkbox') {\r\n\t\t\t\t\tif($value != '')\r\n\t\t\t\t\t\tupdate_post_meta($post_id, '_'.$key, sanitize_text_field($value) );\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tdelete_post_meta($post_id, '_'.$key);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"function gotravel_mikado_map_gallery_post_meta_box() {\n\t\t$gallery_post_format_meta_box = gotravel_mikado_add_meta_box(\n\t\t\tarray(\n\t\t\t\t'scope' => array('post'),\n\t\t\t\t'title' => esc_html__('Gallery Post Format', 'gotravel'),\n\t\t\t\t'name' => 'post_format_gallery_meta'\n\t\t\t)\n\t\t);\n\n\t\tgotravel_mikado_add_multiple_images_field(\n\t\t\tarray(\n\t\t\t\t'name' => 'mkdf_post_gallery_images_meta',\n\t\t\t\t'label' => esc_html__('Gallery Images', 'gotravel'),\n\t\t\t\t'description' => esc_html__('Choose your gallery images', 'gotravel'),\n\t\t\t\t'parent' => $gallery_post_format_meta_box,\n\t\t\t)\n\t\t);\n\t}",
"public function saveMeta() {\n\t\tglobal $post;\n\n\t\tif (isset($_POST['meta'])) {\n\t\t\tforeach ($_POST['meta'] as $name => $value) {\n\t\t\t\t// the 'custom fields' meta box duplicates this meta as\n\t\t\t\t// $metaid => array($key => $value) so we need to ignore those\n\t\t\t\t// on save\n\t\t\t\tif (is_numeric($name) && is_array($value)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif ( $name == 'video_url' && $_POST['meta']['vimeo_url'] == 1 ) {\n\t\t\t\t\t$value = str_replace( 'https', 'http', $value );\n\t\t\t\t}\n\t\t\t\tupdate_post_meta($post->ID, $name, $value);\n\t\t\t}\n\t\t}\n\t}",
"function envira_gallery_ajax_save_bulk_meta() {\n\n\t// Run a security check first.\n\tcheck_admin_referer( 'envira-gallery-save-meta', 'nonce' );\n\n\t// Prepare variables.\n\t$post_id = isset( $_POST['post_id'] ) ? absint( wp_unslash( $_POST['post_id'] ) ) : null;\n\t$image_ids = isset( $_POST['image_ids'] ) ? wp_unslash( $_POST['image_ids'] ) : array(); // @codingStandardsIgnoreLine\n\t$meta = isset( $_POST['meta'] ) ? wp_unslash( $_POST['meta'] ) : array(); // @codingStandardsIgnoreLine\n\n\t// Check the required variables exist.\n\tif ( empty( $post_id ) ) {\n\t\twp_send_json_error();\n\t}\n\tif ( empty( $image_ids ) || ! is_array( $image_ids ) ) {\n\t\twp_send_json_error();\n\t}\n\tif ( empty( $meta ) || ! is_array( $meta ) ) {\n\t\twp_send_json_error();\n\t}\n\n\t// Get gallery.\n\t$gallery_data = get_post_meta( $post_id, '_eg_gallery_data', true );\n\tif ( empty( $gallery_data ) || ! is_array( $gallery_data ) ) {\n\t\twp_send_json_error();\n\t}\n\n\t$image_tags = array();\n\n\t// Iterate through gallery images, updating the metadata.\n\tforeach ( $image_ids as $image_id ) {\n\n\t\t// If the image isn't in the gallery, something went wrong - so skip this image.\n\t\tif ( ! isset( $gallery_data['gallery'][ $image_id ] ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Save the different types of default meta fields for images, videos and HTML slides.\n\t\tif ( isset( $meta['status'] ) ) {\n\t\t\t$gallery_data['gallery'][ $image_id ]['status'] = trim( esc_html( $meta['status'] ) );\n\n\t\t}\n\n\t\t// Update image metadata.\n\t\tif ( isset( $meta['title'] ) && '' !== $meta['title'] ) {\n\t\t\t$gallery_data['gallery'][ $image_id ]['title'] = trim( $meta['title'] );\n\t\t}\n\n\t\tif ( isset( $meta['alt'] ) && '' !== $meta['alt'] ) {\n\t\t\t$gallery_data['gallery'][ $image_id ]['alt'] = trim( esc_html( $meta['alt'] ) );\n\t\t}\n\n\t\tif ( isset( $meta['link'] ) && '' !== $meta['link'] ) {\n\t\t\t$gallery_data['gallery'][ $image_id ]['link'] = esc_url( $meta['link'] );\n\t\t}\n\n\t\tif ( isset( $meta['link_new_window'] ) && '' !== $meta['link_new_window'] ) {\n\t\t\t$gallery_data['gallery'][ $image_id ]['link_new_window'] = trim( $meta['link_new_window'] );\n\t\t}\n\n\t\tif ( isset( $meta['caption'] ) && '' !== $meta['caption'] ) {\n\t\t\t$gallery_data['gallery'][ $image_id ]['caption'] = trim( $meta['caption'] );\n\t\t}\n\n\t\t// Allow filtering of meta before saving.\n\t\t$gallery_data = apply_filters( 'envira_gallery_ajax_save_bulk_meta', $gallery_data, $meta, $image_id, $post_id );\n\n\t\t// Add all image tags to array so we can send them back via ajax.\n\t\t$image_tags[ $image_id ] = wp_get_object_terms( $image_id, 'envira-tag', array( 'fields' => 'names' ) );\n\n\t}\n\n\t// Update the gallery data.\n\tupdate_post_meta( $post_id, '_eg_gallery_data', $gallery_data );\n\n\t// Flush the gallery cache.\n\tenvira_flush_gallery_caches( $post_id );\n\n\t// Done.\n\twp_send_json_success( $image_tags );\n\tdie;\n\n}",
"public function saveOrUpdate($gallery);",
"function royal_add_gallery_post_meta_box() {\n\t\tadd_meta_box(\n\t\t\t'royal_gallery_post_meta_box',\n\t\t\t__( 'Post Format: Gallery', 'portia' ),\n\t\t\t'royal_display_gallery_post_meta_box',\n\t\t\t'post',\n\t\t\t'normal',\n\t\t\t'high'\n\t\t);\n\t}",
"public function register_post_meta() {\n\n\t\tregister_rest_field(\n\t\t\t'envira',\n\t\t\t'gallery_data',\n\t\t\tarray(\n\t\t\t\t'get_callback' => array( $this, 'get_gallery_data' ),\n\t\t\t\t'update_callback' => array( $this, 'update_gallery_data' ),\n\t\t\t)\n\t\t);\n\n\t}",
"function clm_gallery_metaboxes_save($post_id) {\n // Bail if we're doing an auto save\n if( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return;\n\n // if our nonce isn't there, or we can't verify it, bail\n if( !isset( $_POST['meta_box_nonce'] ) || !wp_verify_nonce( $_POST['meta_box_nonce'], 'my_meta_box_nonce' ) ) return;\n\n // if our current user can't edit this post, bail\n if( !current_user_can( 'edit_post' ) ) return;\n\n // verify and save our data\n update_post_meta($post_id, 'gallery_visibility', $_REQUEST['gallery_visibility']);\n update_post_meta($post_id, 'gallery_user_visibility', $_REQUEST['user_checkbox']);\n}",
"function esportz_attachment_extra_field_save( $post, $attachment ) {\r\n if( isset( $attachment['pic-photographer-name'] ) )\r\n update_post_meta( $post['ID'], 'pic_photographer_name', $attachment['pic-photographer-name'] );\r\n\r\n if( isset( $attachment['pic-credits'] ) )\r\n update_post_meta( $post['ID'], 'pic_credits', $attachment['pic-credits'] );\r\n\r\n if( isset( $attachment['video-keywords'] ) )\r\n update_post_meta( $post['ID'], 'video_keywords', $attachment['video-keywords'] );\r\n\r\n update_post_meta( $post['ID'], 'media_to_reuters_rss', $attachment['media-reuters-rss'] );\r\n\r\n return $post;\r\n}",
"function lm_gallery_metaboxes( $post ) {\n\tadd_meta_box( 'lm_gallery_images', 'Imágenes', 'lm_gallery_images', 'mvlm_gallery', 'normal', 'high' );\n\t\n}",
"private function save_post() {\n\t\t\n\t\t//Call wp function to setup saving meta box\n\t\t//add_action( 'save_post', array( $this, 'save_fields' ) );\n\t\t\n\t}",
"function gallery_meta() {\n add_meta_box( 'gallery_meta', __( 'Gallery Images', 'tb-textdomain' ), 'gallery_meta_callback', 'vendor' );\n}",
"function carousel_image_uploader_1_save ( $post_id )\n{\n $is_autosave = wp_is_post_autosave( $post_id );\n $is_revision = wp_is_post_revision( $post_id );\n $is_valid_nonce = ( isset( $_POST['carousel_images_1_nonce'] ) && wp_verify_nonce( $_POST['carousel_images_1_nonce'] ) );\n\n if( $is_autosave || $is_revision || $is_valid_nonce ) {\n return;\n }\n\n if( isset( $_POST['carousel_images_1_data'] ) ) {\n $image_data_array = [];\n\n $image_data = json_decode( stripslashes( $_POST['carousel_images_1_data'] ) );\n\n foreach($image_data as $index=>$image) {\n if( is_object( $image_data[$index] ) ) {\n array_push( $image_data_array, array( 'id' => intval( $image_data[$index]->id ), 'src' => esc_url_raw( $image_data[$index]->url ) ));\n } else {\n $image_data = [];\n }\n\n }\n update_post_meta( $post_id, 'carousel_images_1_data', $image_data_array );\n }\n\n}",
"public function save_meta_all();",
"function save_post(){\n global $post;\n if (array_key_exists('zotero_library_type', $_POST)) {\n update_post_meta($post->ID, \"zotero_library_type\", $_POST[\"zotero_library_type\"]);\n }\n if (array_key_exists('zotero_id', $_POST)) {\n update_post_meta($post->ID, \"zotero_id\", $_POST[\"zotero_id\"]);\n }\n if (array_key_exists('zotero_api_key', $_POST)) {\n update_post_meta($post->ID, \"zotero_api_key\", $_POST[\"zotero_api_key\"]);\n }\n if (array_key_exists('zotero_collection_key', $_POST)) {\n update_post_meta($post->ID, \"zotero_collection_key\", $_POST[\"zotero_collection_key\"]);\n }\n if (array_key_exists('sp_conference_name', $_POST)) {\n update_post_meta($post->ID, \"sp_conference_name\", $_POST[\"sp_conference_name\"]);\n }\n if (array_key_exists('sp_conference_date', $_POST)) {\n update_post_meta($post->ID, \"sp_conference_date\", $_POST[\"sp_conference_date\"]);\n }\n if (array_key_exists('sp_conference_location', $_POST)) {\n update_post_meta($post->ID, \"sp_conference_location\", $_POST[\"sp_conference_location\"]);\n }\n\n }",
"function save_custom_checkbox_attachment_field_residential($post, $attachment) { \n if( isset($attachment['residential_gallery']) ){ \n update_post_meta($post['ID'], 'residential_gallery', sanitize_text_field( $attachment['residential_gallery'] ) ); \n }else{\n delete_post_meta($post['ID'], 'residential_gallery' );\n }\n return $post; \n}",
"function save_custom_checkbox_attachment_field_commercial($post, $attachment) { \n if( isset($attachment['commercial_gallery']) ){ \n update_post_meta($post['ID'], 'commercial_gallery', sanitize_text_field( $attachment['commercial_gallery'] ) ); \n }else{\n delete_post_meta($post['ID'], 'commercial_gallery' );\n }\n return $post; \n}",
"function be_attachment_field_credit_save( $post, $attachment ) {\n if( isset( $attachment['be-photographer-name'] ) )\n update_post_meta( $post['ID'], 'be_photographer_name', $attachment['be-photographer-name'] );\n \n if( isset( $attachment['be-photographer-url'] ) )\nupdate_post_meta( $post['ID'], 'be_photographer_url', esc_url( $attachment['be-photographer-url'] ) );\n \n return $post;\n}",
"function slider_save_data($post_id) {\n global $slider_meta_box;\n custom_save_meta_box($slider_meta_box, $post_id);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the rows of Parts whose $type field has value $value | public static function getPartRowSetsByType($table = null) {
$partRowSets = NULL;
try {
$db = Database::getDB ();
//$query = "SELECT * FROM :$table WHERE (";//= :$id)";
//$query = "SELECT * FROM harddrives WHERE (hdriveId = $id)";
//"harddrives", "hdriveId", "1hdd05"
//if (strcmp($typeid, "hdriveId") == 0)
// $query = $query."hdriveId";
//$query = $query." = :$id)";
//$query = "SELECT * FROM harddrives WHERE (hdriveId = '1hdd05')";
$query = "SELECT * FROM ".$table."";
$statement = $db->prepare($query);
//$statement->bindParam(":$table", $table);
//$statement->bindParam(":$typeid", $typeid);
//$statement->bindParam(":$id", $id);
$statement->execute ();
$partRowSets = $statement->fetchAll(PDO::FETCH_ASSOC);
$statement->closeCursor ();
} catch (Exception $e) { // Not permanent error handling
echo "<p>Error getting part rows by $type: " . $e->getMessage () . "</p>";
}
return $partRowSets;
} | [
"public static function getSensorRowsBy($type = null, $value = null) {\r\n\t\t$allowedTypes = ['sensor_id', 'dataset_id', 'sensor_name'];\r\n\t\t$sensorRows = array();\r\n\t\t\r\n\t\ttry {\r\n\t\t\t$db = Database::getDB();\r\n\t\t\t$query = \"SELECT sensor_id, dataset_id, sensor_name, sensor_type, sensor_units, \r\n\t\t\t\t\tsequence_type, description FROM Sensors\";\r\n\t\t\t\r\n\t\t\tif (!is_null($type)) {\r\n\t\t\t\tif (!in_array($type, $allowedTypes))\r\n\t\t\t\t\tthrow new PDOException(\"$type not an allowed search criterion for Sensors\");\r\n\t\t\t\t\r\n\t\t\t\t$query = $query . \" WHERE ($type = :$type)\";\r\n\t\t\t\t$statement = $db->prepare($query);\r\n\t\t\t\t$statement->bindParam(\":$type\", $value);\r\n\t\t\t} else {\r\n\t\t\t\t$query = $query . \" ORDER BY sensor_id ASC\";\r\n\t\t\t\t$statement = $db->prepare($query);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$statement->execute();\r\n\t\t\t$sensorRows = $statement->fetchAll(PDO::FETCH_ASSOC);\r\n\t\t\t$statement->closeCursor();\r\n\t\t} catch (Exception $e) {\r\n\t\t\techo \"<p>Error getting sensor rows by $type: \".$e->getMessage().\"</p>\";\r\n\t\t}\r\n\t\t\r\n\t\treturn $sensorRows;\r\n\t}",
"public static function getMeasurementRowsBy($type = null, $value = null) {\r\n\t\t$allowedTypes = ['measurement_id', 'sensor_id'];\r\n\t\t$measurementRows = array();\r\n\t\t\r\n\t\ttry {\r\n\t\t\t$db = Database::getDB();\r\n\t\t\t$query = \"SELECT measurement_id, measurement_index, measurement_value,\r\n\t\t\t\t\tmeasurement_timestamp, sensor_id FROM Measurements\";\r\n\t\t\t\r\n\t\t\tif (!is_null($type)) {\r\n\t\t\t\tif (!in_array($type, $allowedTypes))\r\n\t\t\t\t\tthrow new PDOException(\"$type not an allowed search criterion for Measurements\");\r\n\t\t\t\t\r\n\t\t\t\t$query = $query . \" WHERE ($type = :$type)\";\r\n\t\t\t\t$statement = $db->prepare($query);\r\n\t\t\t\t$statement->bindParam(\":$type\", $value);\r\n\t\t\t} else {\r\n\t\t\t\t$query = $query . \" ORDER BY measurement_index ASC\";\r\n\t\t\t\t$statement = $db->prepare($query);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$statement->execute();\r\n\t\t\t$measurementRows = $statement->fetchAll(PDO::FETCH_ASSOC);\r\n\t\t\t$statement->closeCursor();\r\n\t\t} catch (Exception $e) {\r\n\t\t\techo \"<p>Error getting measurement rows by $type: \".$e->getMessage().\"</p>\";\r\n\t\t}\r\n\t\t\r\n\t\treturn $measurementRows;\r\n\t}",
"public static function getBetRowSetsBy($type = null, $value = null) {\r\n\t\t$allowedTypes = [\"id\", \"who\", \"game\"];\r\n\t\t$betRowSets = array();\r\n\t\ttry {\r\n\t\t\t$db = Database::getDB ();\r\n\t\t\t$query = \"SELECT * FROM bets\";\r\n\t\t\tif (!is_null($type)) {\r\n\t\t\t\tif (!in_array($type, $allowedTypes))\r\n\t\t\t\t\tthrow new PDOException(\"$type not an allowed search criterion for bets\");\r\n\t\t\t\t$query = $query. \" WHERE ($type = :$type)\";\r\n\t\t\t\t$statement = $db->prepare($query);\r\n\t\t\t\t$statement->bindParam(\":$type\", $value);\r\n\t\t\t} else\r\n\t\t\t\t$statement = $db->prepare($query);\r\n\t\t\t$statement->execute ();\r\n\t\t\t$betRowSets = $statement->fetchAll(PDO::FETCH_ASSOC);\r\n\t\t\t$statement->closeCursor ();\r\n\t\t} catch (Exception $e) { // Not permanent error handling\r\n\t\t\techo \"<p>Error getting bets rows by $type: \" . $e->getMessage () . \"</p>\";\r\n\t\t}\r\n\t\treturn $betRowSets;\r\n\t}",
"public static function getPublicListRowSetsBy($type = null, $value = null) {\r\n\t\t$allowedTypes = [\"publicListId\", \"listId\"];\r\n\t\t$userRowSets = array();\r\n\t\ttry {\r\n\t\t\t$db = Database::getDB ();\r\n\t\t\t$query = \"SELECT publicListId, publiclist.listId, points, publiclist.title, Lists.typeOf as type FROM PublicList Left Join Lists on PublicList.listId = Lists.listId \";\r\n\t\t\tif (!is_null($type)) {\r\n\t\t\t if (!in_array($type, $allowedTypes))\r\n\t\t\t\t\tthrow new PDOException(\"$type not an allowed search criterion for Users\");\r\n\t\t\t $query = $query. \" WHERE ($type = :$type)\";\r\n\t\t\t $statement = $db->prepare($query);\r\n\t\t\t $statement->bindParam(\":$type\", $value);\r\n\t\t\t} else\r\n\t\t\t\t$query = $query. \" ORDER BY publiclist.points DESC\";\r\n\t\t\t\t$statement = $db->prepare($query);\r\n\t\t\t$statement->execute ();\r\n\t\t\t$userRowSets = $statement->fetchAll(PDO::FETCH_ASSOC);\r\n\t\t\t$statement->closeCursor ();\r\n\t\t} catch (Exception $e) { // Not permanent error handling\r\n\t\t\techo \"<p>Error getting user rows by $type: \" . $e->getMessage () . \"</p>\";\r\n\t\t}\r\n\t\treturn $userRowSets;\r\n\t}",
"private function _addCondition($alias, $column, $value, $type = 'integer')\n\t{\n\t\t$array = array();\n\t\n\t\tif(\t$value == '' )\n\t\t{\n\t\t\treturn $array;\n\t\t}\n\t\t\n\t\t$column = $alias . \".\" . $column;\n\t\n\t\tswitch ($type) {\n\t\t\tcase \"integer\":case \"boolean\":\n\t\t\t\t$array = array($column => $value);\n\t\t\t\tbreak;\n\t\t\tcase \"text\":\n\t\t\t\t$array = array($column . \" LIKE\" => \"%\".$value.\"%\");\n\t\t\t\tbreak;\n\t\t\tcase \"datetime\":\n\t\t\t\t$array = array($column . \" LIKE\" => date('Y-m-d', strtotime($value)).\"%\");\n\t\t\t\tbreak;\n\t\t}\n\t\n\t\treturn $array;\n\t}",
"public static function getUserRowSetsBy($type = null, $value = null) {\r\n\t\t$allowedTypes = [\"id\", \"name\", \"alias\"];\r\n\t\t$userRowSets = array();\r\n\t\ttry {\r\n\t\t\t$db = Database::getDB ();\r\n\t\t\t$query = \"SELECT * FROM users\";\r\n\t\t\tif (!is_null($type)) {\r\n\t\t\t\tif (!in_array($type, $allowedTypes))\r\n\t\t\t\t\tthrow new PDOException(\"$type not an allowed search criterion for Users\");\r\n\t\t\t\t$query = $query. \" WHERE ($type = :$type)\";\r\n\t\t\t\t$statement = $db->prepare($query);\r\n\t\t\t\t$statement->bindParam(\":$type\", $value);\r\n\t\t\t} else\r\n\t\t\t\t$statement = $db->prepare($query);\r\n\t\t\t$statement->execute ();\r\n\t\t\t$userRowSets = $statement->fetchAll(PDO::FETCH_ASSOC);\r\n\t\t\t$statement->closeCursor ();\r\n\t\t} catch (Exception $e) { // Not permanent error handling\r\n\t\t\techo \"<p>Error getting user rows by $type: \" . $e->getMessage () . \"</p>\";\r\n\t\t}\r\n\t\treturn $userRowSets;\r\n\t}",
"function & getByType($type) {\n\t\tglobal $pommo;\n\t\t$dbo =& $pommo->_dbo;\n\t\t\n\t\tif(!is_array($type))\n\t\t\t$type = array($type);\n\t\t\n\t\t$query = \"\n\t\t\tSELECT field_id\n\t\t\tFROM \" . $dbo->table['fields'].\"\n\t\t\tWHERE field_type IN (%q)\";\n\t\t$query = $dbo->prepare($query,array($type));\n\t\t\n\t\treturn $dbo->getAll($query,'assoc','field_id');\n\t}",
"public function selectTermByValueAndType($value, $type)\n {\n $qq = 's_term_by_value';\n $this->sdb->prepare($qq,\n 'select\n id, type, value, uri, description\n from vocabulary where value=$1 and type=$2');\n $result = $this->sdb->execute($qq, array($value, $type));\n $row = $this->sdb->fetchrow($result);\n $this->sdb->deallocate($qq);\n return $row;\n }",
"public static function getUserDataRowSetsBy($type = null, $value = null) {\n\t\t$allowedTypes = [\"userId\"];\n\t\t$userdataRowSets = NULL;\n\t\ttry {\n\t\t\t$db = Database::getDB ();\n\t\t\t$query = \"SELECT userId, email, vmPassword, messengerId FROM UserData\";\n\t\t\tif (!is_null($type)) {\n\t\t\t if (!in_array($type, $allowedTypes))\n\t\t\t\t\tthrow new PDOException(\"$type not an allowed search criterion for Userdata\");\n\t\t\t $query = $query. \" WHERE ($type = :$type)\";\n\t\t\t $statement = $db->prepare($query);\n\t\t\t $statement->bindParam(\":$type\", $value);\n\t\t\t} else \n\t\t\t\t$statement = $db->prepare($query);\n\t\t\t$statement->execute ();\n\t\t\t$userdataRowSets = $statement->fetchAll(PDO::FETCH_ASSOC);\n\t\t\t$statement->closeCursor ();\n\t\t} catch (Exception $e) { // Not permanent error handling\n\t\t\techo \"<p>Error getting user rows by $type: \" . $e->getMessage () . \"</p>\";\n\t\t}\n\t\treturn $userdataRowSets;\n\t}",
"static function retrieveByType($value) {\n\t\treturn static::retrieveByColumn('type', $value);\n\t}",
"public function search($entryType, $key, $value)\n {\n $start = $this->extract($entryType);\n $ret = array();\n\n foreach ($start as $entry) {\n if (($entry instanceof MappedData) &&\n isset($entry->$key) &&\n ($entry->$key == $value)) {\n $ret[] = $entry;\n }\n }\n\n return $ret;\n }",
"public static function findRecords($records, $field, $value, $type)\n\t{\n\t\t$result = [];\n\t\t\n\t\t# check to see if $records is an array of objects or arrays\n\t\tif (is_object(current($records))) {\n\t\t\tforeach ($records as $item) {\n\t\t\t\tif (stripos($item->$field, strval($value)) !== false) {\n\t\t\t\t\t$result[] = $item;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tforeach ($records as $key => $item) {\n\t\t\t\tif (stripos($item[$field], strval($value)) !== false) {\n\t\t\t\t\t$result[] = (object) $item;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($type == 'array') {\n\t\t\tif (isset($result[0])) {\n\t\t\t\treturn (object) $result[0];\n\t\t\t}\t\t\t\n\t\t} elseif ($type == '2dim') {\n\t\t\treturn $result;\n\t\t}\n\t}",
"function find_all_by_type($type){\n\t\t\t\n\t global $db;\n\t\t\t\t \n\t\t\t\t\t$query = \"SELECT * FROM type \";\n\t\t\t\t\t$query .= \"WHERE id = {$type} ;\";\n\t\t\t\t\n\t\t\t\t $employee = $db->query($query);\n\t check_query($employee);\n\t\t \n\t return $employee;\n\t\t\t\n\t\t}",
"public function valuesByType($type) {\n $values = array();\n foreach (array_keys($this->webform->componentsByType($type)) as $cid) {\n $values[$cid] = $this->valueByCid($cid);\n }\n return $values;\n }",
"function getPatient_Info($results, const $type, $value)\n {\n $myList = [];\n for ($i = 0; $i < count($results); $i++)\n {\n if (($results[$i][$type]) == $value)\n {\n $myList[] = intval($results[$i][\"PATIENT_NUM\"]);\n }\n }\n sort($myList, SORT_NUMERIC);\n return $myList;\n }",
"public function retrieveFieldsByType($type)\n\t{\n\t\t$results = array();\n\n\t\tforeach ($this->fields as $field) {\n\n\t\t\tif ($field->type == $type) {\n\t\t\t\t$results[] = $field;\n\t\t\t}\n\t\t}\n\n\t\treturn $results;\n\t}",
"public static function getConditions($type) {\n\n return self::model()->findAll(array('condition' => 'type=:type', 'order' => 't.order ASC', 'params' => array(':type' => $type)));\n }",
"protected function getResultsByType($type)\n {\n $instance = $this->createModelByType($type);\n\n $query = $this->replayMacros($instance->newQuery())\n ->mergeConstraintsFrom($this->getQuery())\n ->with($this->getQuery()->getEagerLoads());\n\n $query->select($this->columns);\n\n return $query->whereIn(\n $instance->getTable().'.'.$instance->getKeyName(), $this->gatherKeysByType($type)\n )->get();\n }",
"public function getFieldItem(array $value, string $type) {\n $fieldDefinitionProphecy = $this->prophesize(FieldDefinitionInterface::class);\n $fieldDefinitionProphecy->getType()->willReturn($type);\n $fieldDefinition = $fieldDefinitionProphecy->reveal();\n $resultProphecy = $this->prophesize(FieldItemInterface::class);\n $resultProphecy->getFieldDefinition()->willReturn($fieldDefinition);\n $resultProphecy->getValue()->willReturn($value);\n $result = $resultProphecy->reveal();\n return $result;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the ad amort anterieur. | public function setAdAmortAnterieur($adAmortAnterieur) {
$this->adAmortAnterieur = $adAmortAnterieur;
return $this;
} | [
"public function setAreeMappa($aree) {\n $this->_aree = $aree; \n }",
"public function getAdAmortAnterieur() {\n return $this->adAmortAnterieur;\n }",
"public function testSetAdAmortAnterieur2() {\n\n $obj = new CreditsBails();\n\n $obj->setAdAmortAnterieur2(10.092018);\n $this->assertEquals(10.092018, $obj->getAdAmortAnterieur2());\n }",
"public function setAlto($alto)\n\t{\n\t\t$this->_alto = $alto;\n\t}",
"public function setAttaque($attaque)\n {\n $this->attaque = $attaque;\n }",
"function setAim($aim)\n\t{\n\t\tif($this->aim != $aim)\n\t\t{\n\t\t\t$this->_modified = true;\n\t\t\t$this->aim = $aim;\n\t\t}\n\t}",
"public function setAdAmortAnterieur2($adAmortAnterieur2) {\n $this->adAmortAnterieur2 = $adAmortAnterieur2;\n return $this;\n }",
"public function testSetAutreAlleg() {\n\n $obj = new Etablissements();\n\n $obj->setAutreAlleg(\"autreAlleg\");\n $this->assertEquals(\"autreAlleg\", $obj->getAutreAlleg());\n }",
"function setAdjustment($adj) {\n $this->adj = (float) $adj;\n }",
"public function __construct($Automad) {\n\t\t\n\t\t$this->Automad = $Automad;\n\t\t\n\t}",
"public function abrir()\n {\n $this->setAberto(true);\n }",
"function alterarParaAmbienteDeTestes() {\n\t\t$this->_ambiente = self::AMBIENTE_TESTE;\n\t}",
"function setAro($id) {\n\t\treturn $this->Aro = $this->_instance->getAro($id);\n\t}",
"public function setTea()\r\n {\r\n $this->proxy->setTea();\r\n }",
"public function setCama(){\n $this->cama = \"Sim\";\n }",
"public function getAorta()\n {\n return $this->aorta;\n }",
"public function _setAnalyteID($analyteID) {\n\t\t$this->_analyteID = $analyteID;\n\t}",
"public function setAcreditacionAza($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (int) $v;\n\t\t}\n\n\t\tif ($this->acreditacion_aza !== $v) {\n\t\t\t$this->acreditacion_aza = $v;\n\t\t\t$this->modifiedColumns[] = AlpzaMiembroAsociadosPeer::ACREDITACION_AZA;\n\t\t}\n\n\t\treturn $this;\n\t}",
"function setCompanionAd(array $companionAd)\n {\n $this->companionAd = $companionAd;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.