query
stringlengths 10
8.11k
| document
stringlengths 17
398k
| negatives
sequencelengths 19
20
| metadata
dict |
---|---|---|---|
Operation deleteThemeWithHttpInfo Delete Theme | public function deleteThemeWithHttpInfo($theme_id)
{
$returnType = 'string';
$request = $this->deleteThemeRequest($theme_id);
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 204:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'string',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\Swagger\Client\Model\Error',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\Swagger\Client\Model\Error',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
case 429:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\Swagger\Client\Model\Error',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
}
throw $e;
}
} | [
"public function deleteTheme(Request $request, $id) {\n if (!empty($id) && is_numeric($id)) {\n $result = Theme::destroy($id);\n $response = response()->json($result);\n } else {\n $response = response()->json('{\"Error\":\"No id provided.\"}');\n } \n\n return $response;\n }",
"public function delete_theme() {\n\t\tif ( isset( $_GET['action'] ) && 'delete_tf_theme' == $_GET['action'] && wp_verify_nonce($_GET['_wpnonce'], 'tf_theme_delete_nonce') ) {\n\t\t\t$post_id = (int) $_GET['post'];\n\t\t\twp_delete_post( $post_id, true ); // delete from db\n\t\t\twp_redirect( admin_url( 'admin.php?page=tf-themes' ) );\n\t\t\texit;\n\t\t}\n\t}",
"public function delete_theme($id)\n {\n $res = array();\n array_push($res, execute_query(\n \"DELETE FROM module WHERE theme_id = '$id';\"\n ));\n array_push($res, execute_query(\n \"DELETE FROM theme WHERE id = '$id';\"\n ));\n return json_encode($res);\n }",
"public function deleteTheme($themeId)\n {\n return $this->start()->uri(\"/api/theme\")\n ->urlSegment($themeId)\n ->delete()\n ->go();\n }",
"function wp_ajax_delete_theme()\n {\n }",
"public function deleteThemeWithHttpInfo($theme_id)\n {\n $returnType = 'string';\n $request = $this->deleteThemeRequest($theme_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 204:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n 'string',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Funeralzone\\LookerClient\\Model\\Error',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Funeralzone\\LookerClient\\Model\\Error',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"function theme_delete()\n{\n // drop the table\n if (!DBUtil::dropTable('themes')) {\n return false;\n }\n\n // delete all module variables\n pnModDelVar('Theme');\n\n // Deletion not allowed\n return false;\n}",
"public function deleteThemeRequest($theme_id)\n {\n // verify the required parameter 'theme_id' is set\n if ($theme_id === null || (is_array($theme_id) && count($theme_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $theme_id when calling deleteTheme'\n );\n }\n\n $resourcePath = '/themes/{theme_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($theme_id !== null) {\n $resourcePath = str_replace(\n '{' . 'theme_id' . '}',\n ObjectSerializer::toPathValue($theme_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 $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function deleteThemeAsyncWithHttpInfo($theme_id)\n {\n $returnType = 'string';\n $request = $this->deleteThemeRequest($theme_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function remove($themeName);",
"public function actionDelete($id)\n {\n $model = $this->findModel($id);\n $model->trash = 'Deleted';\n $model->load(Yii::$app->request->post());\n $model->save();\n \n //delete vendor item theme \n VendorItemThemes::deleteAll(['theme_id' => $id]);\n\n Yii::$app->session->setFlash('success', \"Theme Deleted successfully!\");\n \n return $this->redirect(['index']);\n }",
"public function getDeleteThemeActionUrl()\n {\n return $this->getUrl('*/*/deleteTheme');\n }",
"public function deleteAction(Request $request, $id)\n {\n $form = $this->createDeleteForm($id);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $entity = $em->getRepository('SettingToolBundle:MobileTheme')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find MobileTheme entity.');\n }\n\n $em->remove($entity);\n $em->flush();\n }\n\n return $this->redirect($this->generateUrl('mobiletheme'));\n }",
"public function deleted(Theme $theme)\n {\n Cache::forget('themes');\n\n }",
"public function remove(string $theme);",
"public function deleteStoreThemeAsyncWithHttpInfo($uuid, $accept, $content_type)\n {\n $returnType = '';\n $request = $this->deleteStoreThemeRequest($uuid, $accept, $content_type);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function setDefaultThemeWithHttpInfo($name)\n {\n $returnType = '\\Swagger\\Client\\Model\\Theme';\n $request = $this->setDefaultThemeRequest($name);\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\\Theme',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\Error',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\Error',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 422:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\ValidationError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 429:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\Error',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function onDeleteTheme($theme) {\n return false;\n }",
"public function allThemesWithHttpInfo($fields = null)\n {\n $returnType = '\\Swagger\\Client\\Model\\Theme[]';\n $request = $this->allThemesRequest($fields);\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\\Theme[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\Error',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\Error',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test that the default is AppView. | public function testBuildAppViewMissing(): void
{
static::setAppNamespace('Nope');
$builder = new ViewBuilder();
$view = $builder->build();
$this->assertInstanceOf(View::class, $view);
} | [
"public function testGetView()\n {\n $app = self::$system->getApplicationById(self::$app_name);\n $view = $app->getViewByName('default');\n $this->assertEquals(is_object($view), true);\n }",
"public function testSlimInitializationWithCustomView(){\n\t\tSlim::init('CustomView');\n\t\t$this->assertTrue(Slim::view() instanceof CustomView);\n\t}",
"public function testApp(): void\n {\n self::assertTrue(app() instanceof Valkyrja);\n }",
"public function testGettingView()\n {\n $this->assertNull($this->controller->getView());\n }",
"public function testDefaultViewModelClass()\n\t{\n\t\t$view = new View;\n\t\t$this->assertInstanceOf('ViewModel', $view->viewmodel());\n\t}",
"public function testHomePageReturnsMainView()\n {\n $response = $this->get('/');\n\n $response->assertViewIs('main');\n }",
"public function isView(){}",
"public function testGetDefaultViewForUser()\n {\n $defId = $this->browserViewService->getDefaultViewForUser(\"note\", $this->user);\n $this->assertNotNull($defId);\n }",
"public function hasViewFactory(): bool;",
"public function testSetInitialView()\n {\n }",
"public function testCustomViewAction()\n {\n \\Tools\\Request::setRequestUri('/test/customview');\n\n $this->expectOutputRegex('/Test custom view/');\n $this->runApp();\n }",
"public function testGetViewConfig()\n {\n }",
"public function mvcViewGetSetMainView(IntegrationTester $I)\n {\n $I->wantToTest('Mvc\\View - getMainView() / setMainView()');\n\n $view = new View();\n\n $view->setMainView('html5');\n\n $I->assertEquals(\n 'html5',\n $view->getMainView()\n );\n }",
"public function testConstructView()\n\t{\n\t\t\\Event::listen('orchestra.started: view', function ()\n\t\t{\n\t\t\t$_SERVER['view.started'] = 'foo';\n\t\t});\n\n\t\t$this->assertNull($_SERVER['view.started']);\n\n\t\t$view = new \\Orchestra\\View('orchestra::layout.main');\n\n\t\t$this->assertInstanceOf('\\Laravel\\View', $view);\n\t\t$this->assertEquals('frontend', \\Orchestra\\View::$theme);\n\t\t$this->assertEquals('foo', $_SERVER['view.started']);\n\n\t\t$refl = new \\ReflectionObject($view);\n\t\t$file = $refl->getProperty('view');\n\t\t$file->setAccessible(true);\n\n\t\t$this->assertEquals('orchestra::layout.main', $file->getValue($view));\n\t}",
"public function testPresentNewGameView() {\r\n\t}",
"public function testControllerIndexAction()\n {\n $exp = \"\\Illuminate\\View\\View\";\n $res = $this->controller->index();\n $this->assertInstanceOf($exp, $res);\n }",
"public function testViewAccess()\n\t{\n\t\tforeach ($this->views as $key => $name)\n\t\t{\n\t\t\t$this->assertSame( $name, $this->definition->view( $key ) );\n\t\t}\n\t}",
"public function testNewViewInstance()\n {\n $this->assertInstanceOf(FooView::class, new FooView(new FooModel(), new FooTemplate()));\n }",
"public function testGeneratingWidgetUsingViewInstance(): void\n {\n $inputs = new WidgetLocator(\n $this->templates,\n $this->view,\n ['test' => [TestUsingViewWidget::class, '_view']]\n );\n\n /** @var \\TestApp\\View\\Widget\\TestUsingViewWidget $widget */\n $widget = $inputs->get('test');\n $this->assertInstanceOf(View::class, $widget->getView());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remebers whether the admin menu is collapsed. The selection is saved in the current session. | public static function setIsCollapsed($collapsed)
{
Yii::$app->getSession()->set(static::ADMIN_MENU_STATE_VAR, $collapsed);
} | [
"public function showCollapsed() {\n\t\t\n\t\tif (!$this->canCollapse()) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$default = ($this->widget_manager_collapse_state === 'closed');\n\t\tif (!elgg_is_logged_in()) {\n\t\t\treturn $default;\n\t\t}\n\t\t\n\t\tif (widget_manager_check_collapsed_state($this->guid, 'widget_state_collapsed')) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (widget_manager_check_collapsed_state($this->guid, 'widget_state_open')) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn $default;\n\t}",
"public function canCollapse() {\n\t\tif (!elgg_is_logged_in()) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$result = $this->widget_manager_collapse_disable !== 'yes';\n\t\t\n\t\t$result = elgg_trigger_plugin_hook('collapsable', \"widgets:{$this->handler}\", ['entity' => $this], $result);\n\t\t\n\t\treturn $result;\n\t}",
"public function sync_sidebar_collapsed_state() {\n\t\t$calypso_preferences = get_user_attribute( get_current_user_id(), 'calypso_preferences' );\n\n\t\t$sidebar_collapsed = isset( $calypso_preferences['sidebarCollapsed'] ) ? $calypso_preferences['sidebarCollapsed'] : false;\n\t\tset_user_setting( 'mfold', $sidebar_collapsed ? 'f' : 'o' );\n\t}",
"public function isCollapsed() {\n return $this->isCollapsed;\n }",
"public function getCollapsible()\n\t{\n\t\treturn Mage::getStoreConfig('codnitivecatalog/sidenav/collapsible');\n\t}",
"protected function updateSettingCollapseExpand()\n {\n $current_setting = Configuration::get('HSMA_COLLAPSE_EXPAND_GROUPS');\n switch ($current_setting) {\n case HsMaDisplayStyle::DISPLAY_GROUPS_EXPAND:\n $result = Db::getInstance()->update('accessory_group', array('collapse_expand' => (int) HsMaDisplayStyle::DISPLAY_GROUPS_EXPAND));\n break;\n case HsMaDisplayStyle::DISPLAY_GROUPS_EXPAND_FIRST:\n $result = Db::getInstance()->update('accessory_group', array('collapse_expand' => (int) HsMaDisplayStyle::DISPLAY_GROUPS_EXPAND_FIRST), 'position = 0');\n break;\n case HsMaDisplayStyle::DISPLAY_GROUPS_COLLAPSE:\n $result = Db::getInstance()->update('accessory_group', array('collapse_expand' => (int) HsMaDisplayStyle::DISPLAY_GROUPS_COLLAPSE));\n break;\n default:\n $result = true;\n break;\n }\n if ($result) {\n Configuration::deleteByName('HSMA_COLLAPSE_EXPAND_GROUPS');\n }\n return $result;\n }",
"public function isCollapsed()\n {\n return $this->parse('collapsed');\n }",
"public static function is_admin() {\n\t\tif(current_page() == \"Admin\") echo 'class=\"admin\"';\n\t}",
"public function is_expanded()\n\t{\n\t\treturn \\CCSession::get( 'earth.pages.page-'.$this->id.'.expanded', false );\n\t}",
"protected function get_displayinmenublock() {\n return false;\n }",
"public function getCollapse()\n {\n return $this->collapse;\n }",
"function hideShowMenu() {\n\t\tif(isset($_SESSION['_hide_menu_']) && $_SESSION['_hide_menu_'] != false) {\n\t\t\t$_SESSION['_hide_menu_'] = false;\n\t\t} else {\n\t\t\t$_SESSION['_hide_menu_'] = true;\n\t\t}\n\t}",
"public function getCollapsible() {\n\t\treturn $this->isCollapsible;\n\t}",
"function isAdmin()\n {\n \n return (Yii::app()->user->isGuest) ? FALSE : $this->level == 8;\n }",
"public function getDefaultFieldsetCollapseState()\n {\n return true;\n }",
"public function canAccessAdminMenu()\n {\n if($this->username == 'Admin')\n {\n return true;\n }\n return false;\n }",
"function get_is_admin ()\r\n {\r\n return $_SESSION[\"is_admin\"];\r\n }",
"public function isAdmin()\n {\n return $this->getId() == Mage_Core_Model_App::ADMIN_STORE_ID;\n }",
"public function isMenu()\n {\n return true;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a new meta tag with the description of the page. | public function description(string $description): self
{
return $this->addTag(
Tag::new(Tag::META)->setUnique('description')->setAttributes([
'content' => $description,
'name' => 'description',
])
);
} | [
"public function setMetaDescription($metaDescription) {\n if (!$this->metaDescription) {\n $this->metaDescription = new Meta();\n $this->metaDescription->setName('description');\n $this->head->addContent($this->metaDescription);\n }\n $this->metaDescription->setContent($metaDescription);\n }",
"public function generate_meta_description()\n {\n }",
"public function testSetAndGetMetaDescription()\n {\n $page = new Page();\n\n $metaDescription = 'Simple Page bundle by Stfalcon web-studio';\n $page->setMetaDescription($metaDescription);\n\n $this->assertEquals($metaDescription, $page->getMetaDescription());\n\n }",
"public function get_meta_description() {\n\t\n\t// if static meta description is assigned load that\n\tif (!empty($this->page_meta_description)) {\n\t $set_page_description = $this->page_meta_description;\n\t} else {\n\t $set_page_description = '';\n\t}\n\t\n\t$meta_description = !empty($set_page_description) ? \"<meta name=\\\"description\\\" content=\\\"\".str_replace('&','%amp;',$set_page_description).\"\\\" />\" : \"\";\n\t\n return $meta_description;\n }",
"function genMetaData($decription, $name, $image, $url)\n{\n echo \"\n <meta name='author' content='David McClarty, Musat Valentina'>\n <meta name='keywords' content='hot-spots, Brisbane, rate, review'>\n <meta name='robots' content='noindex'> <!-- do not index this page -->\n <!-- search engine -->\n <meta name='description' content='{$decription}'>\n <meta name='image' content='{$image}'>\n <!-- Google -->\n <meta itemprop='name' content='{$name}'>\n <meta itemprop='description' content='{$decription}'>\n <meta itemprop='image' content='{$image}'>\n <!-- Twitter -->\n <meta name='twitter:card' content='summary'>\n <meta name='twitter:title' content='{$name}'>\n <meta name='twitter:description' content='{$decription}'>\n <meta name='twitter:image:src' content='{$image}'>\n <!-- OG -->\n <meta name='og:title' content='{$name}'>\n <meta name='og:description' content='{$decription}'>\n <meta name='og:image' content='{$image}'>\n <meta name='og:url' content='{$url}'>\n <meta name='og:site_name' content='Brisbane Hot-Spot Finder'>\n <meta name='og:type' content='website'> \n \";\n}",
"public function metadesc() {\n\t\t$generated = Paper::get()->get_description();\n\n\t\tif ( Str::is_non_empty( $generated ) ) {\n\t\t\techo '<meta name=\"description\" content=\"' . $generated . '\"/>', \"\\n\";\n\t\t}\n\t}",
"function setMeta_description($meta_description) {\n $this->meta_description = $meta_description;\n }",
"function setMetaDescription($description)\n {\n $this->metaDescription = $description;\n }",
"static function seo_description() {\n\t\tglobal $post;\n\t\t\n\t\t$seo_desc = get_field( 'nrd_seo_desc' );\n\t\t\n\t\tif ( !$seo_desc ) return;\n\t\t\n\t\techo '<meta name=\"description\" content=\"' . htmlspecialchars_decode( $seo_desc, ENT_QUOTES ) . '\"/>';\t\n\t}",
"function wpseo_save_description() {\n\twpseo_save_what( 'metadesc' );\n}",
"public function seo_meta_information() {\n ?>\n <meta name=\"description\" content=\"web Ddesign and development materials\">\n <meta name=\"keywords\" content=\"HTML, CSS, JavaScript, php, wordpress, laravel\">\n <meta name=\"author\" content=\"moshiur rahman\">\n <?php\n }",
"public function set_standard_meta()\n\t{\n\t\t// Meta description.\n\t\t$meta_description = $this->get_meta_description();\n\t\tif (! empty($meta_description)) {\n\t\t\t$this->add_tag(\n\t\t\t\t'meta',\n\t\t\t\t[\n\t\t\t\t\t'name' => 'description',\n\t\t\t\t\t'content' => \\esc_attr($meta_description),\n\t\t\t\t]\n\t\t\t);\n\t\t}\n\n\t\tif ( ! empty( $meta_keywords ) ) {\n\t\t\t$this->add_tag(\n\t\t\t\t'meta',\n\t\t\t\t[\n\t\t\t\t\t'name' => 'keywords',\n\t\t\t\t\t'content' => esc_attr( implode( ',', array_filter( $meta_keywords ) ) ),\n\t\t\t\t]\n\t\t\t);\n\t\t}\n\n\t\t// Canoncial url.\n\t\tif (! empty($canonical_url)) {\n\t\t\t$this->set_canonical_url($canonical_url);\n\t\t}\n\n\t\t// Deindex URL.\n\t\tif (absint($deindex_url)) {\n\t\t\t$this->add_tag(\n\t\t\t\t'meta',\n\t\t\t\t[\n\t\t\t\t\t'name' => 'robots',\n\t\t\t\t\t'content' => 'noindex',\n\t\t\t\t]\n\t\t\t);\n\t\t}\n\t}",
"public function generateMetaDescription()\n {\n $this->generateEntityByTypeIdForCategory(\n \\MageWorx\\SeoXTemplates\\Model\\Template\\Category::TYPE_CATEGORY_META_DESCRIPTION\n );\n }",
"static function display_meta_description($description) {\r\n\techo '<meta name=\"description\" content=\"' . $description . '\" />\\n';\r\n\t}",
"function get_web_page_description(&$response) {\n // Get meta tags if not already:\n $meta_tags = $response['meta_tags'];\n if (!$meta_tags) {\n $meta_tags = get_meta_tags_from_html($response['content']);\n }\n\n // Get title, description and keywords:\n $title = get_title_from_html($response['content'], $response['encoding']);\n $description = get_meta_info($meta_tags, 'description', $response['encoding']);\n $keywords = get_meta_info($meta_tags, 'keywords', $response['encoding']);\n\n // Update response array with the new info:\n $response['meta_tags'] = $meta_tags;\n $response['title'] = $title;\n $response['description'] = $description;\n $response['keywords'] = $keywords;\n}",
"final public function setPageDescription($desc=\"\"){\n\n $this->assign(array(\n \"App\"=>array(\n \"Page\"=>array(\n \"Description\"=>$desc\n ) \n )\n ));\n \n $this->setMetaTag(\"DESCRIPTION\",$desc);\n\n return $this;\n }",
"public static function insertMeta()\n\t{\n\t\t$settings = app()->controller->settings;\n\t\t\n\t\t//register meta description\n\t\tcs()->registerMetaTag($settings['meta_description'], 'description');\n\t\t\n\t\t//register meta keywords\n\t\tcs()->registerMetaTag($settings['meta_keywords'], 'keywords');\n\t}",
"function prism_create_description() {\n\t$content = '';\n\tif ( prism_seo() ) {\n \tif ( is_single() || is_page() ) {\n \t\tif ( have_posts() ) {\n \t\twhile ( have_posts() ) {\n \t\tthe_post();\n\t\t\t\t\tif ( prism_the_excerpt() == \"\" ) {\n if ( prism_use_autoexcerpt() ) {\n\t\t\t\t\t \t$content = '<meta name=\"description\" content=\"';\n \t\t$content .= prism_excerpt_rss();\n \t\t$content .= '\" />';\n \t\t$content .= \"\\n\";\n }\n \t} else {\n if ( prism_use_excerpt() ) {\n \t\t$content = '<meta name=\"description\" content=\"';\n \t\t$content .= prism_the_excerpt();\n \t\t$content .= '\" />';\n \t\t$content .= \"\\n\";\n }\n \t}\n \t}\n \t}\n } elseif ( is_home() || is_front_page() ) {\n \t\t$content = '<meta name=\"description\" content=\"';\n \t\t$content .= get_bloginfo( 'description', 'display' );\n \t\t$content .= '\" />';\n \t\t$content .= \"\\n\";\n }\n echo apply_filters ('prism_create_description', $content);\n\t}\n}",
"function wpi_postform_metadescription(){\n\t\techo '<p>'.PHP_EOL;\n\t\twpi_postmeta_label('meta_description',__('Descriptions',WPI_META));\n\t\twpi_postmeta_input('meta_description');\n\t\techo '</p>'; ?>\n\t<p><?php _e('<strong>Tips: </strong> Make it descriptive and include relevant keywords or keyphrases, 25-30 words, no more than two sentences.',WPI_META);?></p>\n<?php\t\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine if the given user recently created a password reset token. | public function recentlyCreatedToken(CanResetPasswordContract $user); | [
"public function recentlyCreatedToken(CanResetPasswordContract $user): bool;",
"public function recentlyCreatedToken(CanResetPasswordContract $user)\n {\n $record = (array) $this->getTable()->where(\n config('password_resets.field'), $user->{config('password_resets.field')}\n )->first();\n\n return $record && $this->tokenRecentlyCreated($record['created_at']);\n }",
"public function recentlyCreatedToken(Collaborator\\CanResetPassword $user);",
"private function hasExceededResetLimit($user)\n\t{\n\t\t$params = \\Component::params('com_members');\n\t\t$resetCount = (int)$params->get('reset_count', 10);\n\t\t$resetHours = (int)$params->get('reset_time', 1);\n\t\t$result = true;\n\n\t\t// Get the user's tokens\n\t\t$threshold = date(\"Y-m-d H:i:s\", strtotime(\\Date::toSql() . \" {$resetHours} hours ago\"));\n\t\t$tokens = $user->tokens()->where('created', '>=', $threshold)->rows();\n\n\t\tif ($tokens->count() < $resetCount)\n\t\t{\n\t\t\t$result = false;\n\t\t}\n\n\t\treturn $result;\n\t}",
"public function resetPasswordExpired(): bool {\n return (bool)self::$db->scalar(\"\n SELECT 1\n FROM users_info\n WHERE coalesce(ResetExpires, now()) <= now()\n AND UserID = ?\n \", $this->id\n );\n }",
"public function testGenerateResetPasswordTokenWithTokenAlreadyExistent() {\n Mail::fake();\n $user = User::factory()->create();\n $token = Hash::make($user->email . date(\"Y-m-d H:i:s\"));\n\n $old_reset_token = PasswordReset::create([\n 'email' => $user->email,\n 'token' => $token\n ]);\n\n $response = $this->postJson('/api/forgot-password', ['email' => $user->email]);\n\n $response->assertStatus(200)\n ->assertJsonStructure([\n 'success',\n 'message'\n ]);\n\n $this->assertDatabaseCount('password_resets', 1);\n\n $this->assertDatabaseHas('password_resets', [\n 'email' => $user->email\n ]);\n\n $new_reset_token = PasswordReset::where('email', $user->email)->first();\n $this->assertTrue($new_reset_token->token !== $old_reset_token->token);\n }",
"public function canResetPassword(\\Gems_User_User $user = null)\n {\n return false;\n }",
"public function forgotPasswordHasExpired()\n {\n Yii::info('type of expiration_timestamp = ' . gettype($this->expiration_timestamp));\n $now = (new \\DateTime())->format('Y-m-d H:i:s');\n if ($now > $this->expiration_timestamp) {\n return true;\n }\n return false;\n }",
"public function getPwdResetTokenCreatedOn()\n {\n return $this->pwdResetTokenCreatedOn;\n }",
"function UserHasToken($user)\n {\n //Database objects needed\n global $mysql_connection, $mysql_response, $mysql_status;\n\n //Assume a token does not exist for this user.\n $result = false;\n\n //Look for the token using the userID\n $tokenExist = mysqlQuery(\"select * from `tokens` t where t.userID = \" .$user[\"userID\"] .\";\");\n\n //A token already exists\n if($tokenExist->num_rows != 0)\n {\n $result = true;\n }\n\n return $result;\n }",
"public function userWantsToBeRemembered() : bool {\n return $this->remember;\n }",
"public static function check_creator_token_expiration() {\n\t\t\n\t\t$refresh_token = get_option( 'patreon-creators-refresh-token', false );\n\n\t\tif ( $refresh_token == false ) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$expiration = get_option( 'patreon-creators-refresh-token-expiration', false );\n\t\t\n\t\tif ( !$expiration OR $expiration <= time() ) {\n\t\t\tif ( $tokens = self::refresh_creator_access_token() ) {\n\t\t\t\t\n\t\t\t\tupdate_option( 'patreon-creators-refresh-token-expiration', time() + $tokens['expires_in'] );\n\t\t\t\tupdate_option( 'patreon-creators-access-token-scope', $tokens['scope'] );\n\t\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 isUserPasswordExpired()\n {\n if ($this->getSessionVariable('is_user_password_expired') !== null) {\n return $this->getSessionVariable('is_user_password_expired');\n }\n\n $maximum_password_age_in_seconds = $this->config->item('security_maximum_password_age_in_seconds');\n if (!($maximum_password_age_in_seconds > 0)) {\n $this->setSessionVariable('is_user_password_expired', false); // Disabled\n return $this->getSessionVariable('is_user_password_expired');\n }\n $password_last_changed_timestamp = strtotime($this->getAttribute('password_last_changed_timestamp'));\n if (!$password_last_changed_timestamp) {\n $this->setSessionVariable('is_user_password_expired', true); // Expired because never changed\n return $this->getSessionVariable('is_user_password_expired');\n }\n\n $now_timestamp = (int)gmdate('U');\n\n // If the last time + difference is in future\n if ($password_last_changed_timestamp + $maximum_password_age_in_seconds < $now_timestamp) {\n $this->setSessionVariable('is_user_password_expired', true); // Expired\n return $this->getSessionVariable('is_user_password_expired');\n }\n\n $this->setSessionVariable('is_user_password_expired', false); // Not expired\n return $this->getSessionVariable('is_user_password_expired');\n }",
"public function shouldResetPassword(): bool;",
"public function needsRefresh()\n {\n $now = new \\DateTime();\n $utcTime = new \\DateTimeZone('UTC');\n\n try {\n $tokenTime = new \\DateTime($this->expiresAt);\n $tokenTime->setTimezone($utcTime);\n } catch (\\Exception $e) {\n // Sets time for current time if fails\n $tokenTime = $now;\n }\n\n // If the Token is older than now\n return ($tokenTime <= $now);\n }",
"public function testTokenIsSet()\n {\n $user = $this->resetData();\n\n $this->visit('/password/reset/12345')\n ->see('Enter your new password')\n ->type('test@test.com', 'email')\n ->type('password', 'password')\n ->type('confirm_password', 'password')\n ->press('Reset');\n }",
"protected function isOnResetPasswordSession($token)\n {\n if( (Session::get('scm_reset_password')) && (Session::get('scm_reset_password')==$token) ) return true;\n\n return false;\n }",
"public function checkExistingUser()\n\t{\n\t\t$email = $this->input->post(\"forget_pass_email\");\n\t\t$token = $this->getToken(15);\n\t\t$user_info = array(\"email\"=>$email,\"pass_reset_token\"=>$token);\n\t\t$user_exist = $this->HM->PassReset($user_info);\n\t\tif($user_exist[\"mail_exist\"]==\"1\")\n\t\t{\n\t\t\t$this->userPassResetEmail($email,$token);\n\t\t}\n\t\techo json_encode($user_exist);\n\t\tdie();\n\t}",
"public static function isPasswordResetTokenValid($token) \n { \n if (empty($token)) { \n return false; \n } \n \n $timestamp = (int) substr($token, strrpos($token, '_') + 1); \n $expire = Yii::$app->params['user.passwordResetTokenExpire']; \n return $timestamp + $expire >= time(); \n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parses to get the number of rooms required | function parseNumberOfRooms()
{
//check for numbers less than 8, this should be the number of rooms
foreach ($this->_Number_Array as $No) {
if (in_array($No, $this->_Search_Array)) {
//set the number of rooms
$this->_Bedroom_Number = $No;
}
}
} | [
"public function getNumberRooms(){\n return count($this->arRooms);\n }",
"public function getNumberOfRooms() {\n\t\treturn $this->numberOfRooms;\n\t}",
"public function roomsCount() {\n\t\t\t$request = ['action' => 'report-bulk-objects', 'filter-type' => 'meeting'];\n\t\t\t$response = $this->callConnectApi($request);\n\n\t\t\treturn count($response->{'report-bulk-objects'}->row);\n\t\t}",
"public function getNumBathRoom(){\n\t\t\treturn $this->num_bathroom;\n\t\t}",
"public function getNBedrooms()\r\n {\r\n return $this->nBedrooms;\r\n }",
"public function getRoomInfoListCount()\n {\n return $this->count(self::ROOMINFOLIST);\n }",
"public function livingRooms() : int\n {\n return $this->get('livingRooms');\n }",
"function roomCount() {\n $rooms = rand(5, 12);\n\n return $rooms;\n}",
"public function getRoomInfoCount()\n {\n $value = $this->get(self::ROOMINFOCOUNT);\n return $value === null ? (integer)$value : $value;\n }",
"function totalRooms(){\n\t\t$totalRooms = array(''=>'Please Select Total Rooms');\n\t\tfor($i=1;$i<=10;$i++){\n\t\t\t$totalRooms[$i] = $i;\n\t\t}\n\t\treturn $totalRooms;\n\t}",
"public function getNumberOfBedrooms() {\n\t\tif ($this->getIsBuilding()) {\n\t\t\treturn $this->numberOfBedrooms;\n\t\t}\n\t\treturn NULL;\n\t}",
"public function CountRooms() {\r\n \r\n // Connect\r\n $this->ConnectToDatabase(); \r\n // Prepare query\r\n $query = <<<EOD\r\n SELECT COUNT(*) FROM rum;\r\nEOD;\r\n // Perform query\r\n $res = $this->iMysqli->query($query) \r\n or die(\"Could not query database, query =<br/><pre>{$query}</pre><br/>{$this->iMysqli->error}\");\r\n \r\n $row = $res->fetch_row(); \r\n return $row[0]; \r\n \r\n $this->iMysqli->close(); \r\n \r\n }",
"public function bathrooms() : int\n {\n return $this->get('bathrooms');\n }",
"public function getRooms();",
"private function processRoom($room)\n {\n // Create base parts\n $roomParts = explode('-', $room);\n $roomInfo = explode('[', array_pop($roomParts));\n $roomName = implode($roomParts);\n $roomSector = intval($roomInfo[0]);\n $roomCheck = str_replace(']', '', $roomInfo[1]);\n\n // Pass the sector if the room is valid.\n if ($this->isValidRoomName($roomName, $roomCheck)) {\n // Decode room and store in a list.\n $room = $this->decodeRoom($roomParts, $roomSector);\n $this->realRooms[] = $room;\n\n if (false !== strpos($room, 'north')) {\n $this->shortRoomList[] = $room;\n }\n\n return $roomSector;\n }\n\n return 0;\n }",
"public function getRoomNb()\n {\n return $this->roomNb;\n }",
"public function get_rooms() {\n\t\t\n\t\treturn $this->make_request( 'rooms', array(), 'GET', 'rooms' );\n\t\t\n\t}",
"public function getRooms()\n {\n return $this->rooms;\n }",
"public function getRoomNum(){\r\n\t\treturn $this->roomNumber;\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieve a list of multiply parented paragraph fields with a given parent type and field. Given a parent type and parent field name, we should fetch all of the paragraphs entities whose revisions do not share a common parent_id. If a paragraph's parent_id changes from revision to revision, it may be the result of an improper clone. | function getMultiplyParentedParagraphFieldRows(string $parent_type, string $parent_field_name): array {
$database = \Drupal::database();
$query = $database->select('paragraphs_item_revision_field_data', 'revision');
$query->condition('parent_type', $parent_type);
$query->condition('parent_field_name', $parent_field_name);
$query->addField('revision', 'id', 'target_id');
$query->addField('revision', 'parent_id', 'parent_id');
$statement = $query->distinct()->execute();
$result = [];
foreach ($statement as $item) {
$target_id = $item->target_id;
if (empty($result[$target_id])) {
$result[$target_id] = (object)[
'target_id' => $target_id,
'parent_ids' => [
$item->parent_id,
],
'parent_type' => $parent_type,
'parent_field_name' => $parent_field_name,
];
}
else {
$result[$target_id]->parent_ids[] = $item->parent_id;
sort($result[$target_id]->parent_ids);
}
}
$result = array_filter($result, function ($row) {
return count($row->parent_ids) > 1;
});
$count = count($result);
logMessage("{$parent_type}: {$parent_field_name}... {$count} multiply-parented field rows found.");
return $result;
} | [
"function getParagraphsFields(): array {\n $database = \\Drupal::database();\n\n $query = $database->select('paragraphs_item_field_data', 'p');\n $query->addField('p', 'parent_type', 'parent_type');\n $query->addField('p', 'parent_field_name', 'parent_field_name');\n $result = $query->distinct()->execute()->fetchAll();\n\n return $result;\n}",
"public static function paragraphsPreviewRenderParentField(Paragraph $paragraph, $parent_field_name, ContentEntityBase $parent_entity = NULL) {\n if (!isset($parent_entity)) {\n $parent_entity = $paragraph->getParentEntity();\n }\n\n if ($parent_entity && ($parent_entity instanceof ContentEntityBase)) {\n\n if ($parent_entity->hasField($parent_field_name)) {\n\n // Create a new paragraph with no id.\n $paragraph_clone = $paragraph->createDuplicate();\n\n // Clone the entity since we are going to modify field values.\n $parent_clone = clone $parent_entity;\n\n // Create field item values.\n $parent_field_entity = ['entity' => $paragraph_clone];\n\n // Based on \\Drupal\\Core\\Entity\\EntityViewBuilder to allow arbitrary\n // field data to be rendered.\n // See https://www.drupal.org/node/2274169\n // Push the item as the single value for the field, and defer to\n // FieldItemBase::view() to build the render array.\n try {\n $parent_clone->{$parent_field_name}->setValue([$parent_field_entity]);\n }\n catch (\\Exception $e) {\n if ($e instanceof ReadOnlyException || $e instanceof \\InvalidArgumentException) {\n return NULL;\n }\n }\n\n // TODO: This clones the parent again and uses\n // EntityViewBuilder::viewFieldItem().\n $elements = $parent_clone->{$parent_field_name}->view('default');\n\n // Extract the part of the render array we need.\n $output = [];\n if (isset($elements[0])) {\n $output = $elements[0];\n }\n\n if (isset($elements['#access'])) {\n $output['#access'] = $elements['#access'];\n }\n\n return $output;\n }\n }\n\n return NULL;\n }",
"function return_paragraph_parent($entity_id) {\n $query_string = \"SELECT parent_id, parent_type FROM paragraphs_item_field_data WHERE id = $entity_id;\";\n $retrieved = run_query($query_string)[0];\n\n if($retrieved['parent_type'] == \"paragraph\") {\n return $this.return_paragraph_parent($retrieved['parent_id']);\n } else {\n return ['parent_type' => $retrieved['parent_type'], 'parent_id' => $retrieved['parent_id']];\n }\n\n}",
"public function paragraphsPreviewRenderParentField(Paragraph $paragraph, $parent_field_name, ContentEntityBase $parent_entity = NULL) {\n if (!isset($parent_entity)) {\n $parent_entity = $paragraph->getParentEntity();\n }\n\n if ($parent_entity && ($parent_entity instanceof ContentEntityBase)) {\n $parent_class = get_class($parent_entity);\n $parent_entity_type = $parent_entity->getEntityTypeId();\n\n if ($parent_entity->hasField($parent_field_name)) {\n $parent_view_mode = \\Drupal::config('paragraphs_previewer.settings')->get('previewer_view_mode');\n $parent_view_mode = $parent_view_mode ? $parent_view_mode : 'full';\n\n // Create a new paragraph with no id.\n $paragraph_clone = $paragraph->createDuplicate();\n\n // Clone the entity since we are going to modify field values.\n $parent_clone = clone $parent_entity;\n\n // Create field item values.\n $parent_field_item_value = ['entity' => $paragraph_clone];\n\n // Based on \\Drupal\\Core\\Entity\\EntityViewBuilder to allow arbitrary\n // field data to be rendered.\n // See https://www.drupal.org/node/2274169\n // Push the item as the single value for the field, and defer to\n // FieldItemBase::view() to build the render array.\n $parent_clone->{$parent_field_name}->setValue([$parent_field_item_value]);\n\n // TODO: This clones the parent again and uses\n // EntityViewBuilder::viewFieldItem().\n $elements = $parent_clone->{$parent_field_name}->view($parent_view_mode);\n\n // Extract the part of the render array we need.\n $output = isset($elements[0]) ? $elements[0] : [];\n if (isset($elements['#access'])) {\n $output['#access'] = $elements['#access'];\n }\n\n return $output;\n }\n }\n }",
"public function getPageFields($p) {\n $result = [];\n\n // echo print_r($p);\n // echo print_r($this->conf['queries']);\n\n $includeParents = false;\n if (!empty($this->conf['queries']['parent_included'])) {\n $includeParents = $this->conf['queries']['parent_included'];\n }\n\n $isListingAllowed = false;\n if (!empty($this->conf['queries']['listing'])) {\n $isListingAllowed = $this->conf['queries']['listing'];\n }\n\n $isChildrenAllowed = false;\n if (!empty($this->conf['queries']['children'])) {\n $isChildrenAllowed = $this->conf['queries']['children'];\n }\n\n $isSortedBy = false;\n if (!empty($this->conf['queries']['sort'])) {\n $isSortedBy = $this->conf['queries']['sort'];\n }\n\n // get fields for pageId\n if (!$isListingAllowed) {\n $result = $this->getCoreFields($p);\n $result = array_merge($result, $this->getAllFields($p));\n\n // get children pages\n if (\n $p->child->id &&\n $this->conf['children'] &&\n $isChildrenAllowed\n ) {\n $children = $isSortedBy ? $p->children('sort='.$isSortedBy) : $p->children();\n foreach ($children as $i => $pChild) {\n $result['children'][$i] = $this->getCoreFields($pChild);\n $result['children'][$i] = array_merge($result['children'][$i], $this->getAllFields($pChild));\n }\n }\n }\n\n // get listing\n if ($isListingAllowed && $p->child->id) {\n $children = $isSortedBy ? $children('sort='.$isSortedBy) : $p->children();\n if ($includeParents) {\n $children->prepend($p);\n }\n foreach ($children as $i => $pChild) {\n $result[$i] = $this->getCoreFields($pChild);\n $result[$i] = array_merge($result[$i], $this->getAllFields($pChild));\n }\n }\n\n return $result;\n }",
"function run() {\n $paragraph_fields = getParagraphsFields();\n\n foreach ($paragraph_fields as $paragraph_field) {\n $parent_type = $paragraph_field->parent_type;\n $parent_field_name = $paragraph_field->parent_field_name;\n\n // We only care about cloned nodes right now, because nested paragraphs\n // should clone cleanly by default.\n if ($parent_type !== 'node') {\n logMessage(\"Not processing parent_type $parent_type, field $parent_field_name...\");\n continue;\n }\n\n $rows = getMultiplyParentedParagraphFieldRows($parent_type, $parent_field_name);\n foreach ($rows as $target_id => $row) {\n $parent_ids = $row->parent_ids;\n $parent_count = count($parent_ids);\n\n if ($parent_count > 0) {\n $parent_list = implode(', ', $parent_ids);\n logMessage(\"Paragraph #{$target_id} has {$parent_count} parents: {$parent_list}\");\n // We can leave this paragraph with its original parent,\n // but we wanna give clones to its other parents.\n $cloned_parent_ids = array_slice($parent_ids, 0, 1);\n if (!empty($cloned_parent_ids)) {\n repairParagraph($parent_type, $parent_field_name, (int) $cloned_parent_ids[0], (int) $target_id);\n }\n }\n }\n\n }\n}",
"function update_bp_parent_ids( $field ){\r\n\t\tglobal $wpdb;\r\n\t\t$table_name = $wpdb->prefix . \"ura_fields\";\r\n\t\t$update_sql = \"UPDATE $table_name SET bp_parent_ID = %s WHERE meta_key = %s\";\r\n\t\t$update = $wpdb->prepare( $update_sql, $field->parent_id, $field->meta_key );\r\n\t\t$results = $wpdb->query( $update );\r\n\t\treturn $results;\r\n\t}",
"private function return_paragraph_parent($entity_id) {\n $query_string = \"SELECT parent_id, parent_type FROM paragraphs_item_field_data WHERE id = $entity_id;\";\n $retrieved = $this->run_query($query_string)[0];\n\n if($retrieved['parent_type'] == \"paragraph\") {\n return $this.return_paragraph_parent($retrieved['parent_id']);\n } else {\n return ['parent_type' => $retrieved['parent_type'], 'parent_id' => $retrieved['parent_id']];\n }\n\n }",
"public function getParentComments()\n\t{\n\t\t$commentId = $this->getId();\n\t\t$parentCommentId = explode('::', $this->get('parents'))[0];\n\t\tif (empty($commentId) || empty($parentCommentId)) {\n\t\t\treturn;\n\t\t}\n\t\t$queryGenerator = new \\App\\QueryGenerator('ModComments');\n\t\t$queryGenerator->setFields(['parent_comments', 'createdtime', 'modifiedtime', 'related_to', 'id',\n\t\t\t'assigned_user_id', 'commentcontent', 'creator', 'reasontoedit', 'userid', 'parents']);\n\t\t$queryGenerator->addNativeCondition(['modcommentsid' => $parentCommentId, 'related_to' => $this->get('related_to')]);\n\t\t$dataReader = $queryGenerator->createQuery()->createCommand()->query();\n\t\t$recordInstances = [];\n\t\twhile ($row = $dataReader->read()) {\n\t\t\t$recordInstance = new self();\n\t\t\t$recordInstance->setData($row)->setModuleFromInstance($queryGenerator->getModuleModel());\n\t\t\t$recordInstances[] = $recordInstance;\n\t\t}\n\t\treturn $recordInstances;\n\t}",
"function obtain_parent_list($model_name, $title_field, $parent_field, $sql_father='')\n{\n\n\t$arr_list_father=array();\n\t$arr_cat=array();\n\t//$sql_father.=' order by '.$parent_field.' ASC';\n\t\n\t$query=Webmodel::$model[$model_name]->select($sql_father, array(Webmodel::$model[$model_name]->idmodel, $title_field, $parent_field));\n\n\twhile(list($idcat, $title, $idfather)=Webmodel::$model[$model_name]->fetch_row($query))\n\t{\n\t\tsettype($arr_list_father[$idfather], 'array');\n\t\n\t\t$arr_list_father[$idfather][]=$idcat;\n\t\n\t\t$title=Webmodel::$model[$model_name]->components[$title_field]->show_formatted($title);\n\n\t\t$arr_cat[$idcat]=$title;\n\n\t}\n\n\treturn array($arr_list_father, $arr_cat);\n\n}",
"public function GetParentFieldset ();",
"public function getParentsOfType($parentType)\n {\n $parents = array();\n\n $parentNode = $this->parent;\n while (is_object($parentNode)) {\n if ($parentNode instanceof $parentType) {\n array_unshift($parents, $parentNode);\n }\n $parentNode = $parentNode->getParent();\n }\n return $parents;\n }",
"function makeParentFieldConditions($parentConditionFields)\n{\n global $ModuleID;\n global $SQLBaseModuleID;\n $SQLBaseModuleID = $ModuleID;\n $parentModuleFields = GetModuleFields($ModuleID);\n $parentModuleInfo = GetModuleInfo($ModuleID);\n $parentRecordIDField = $parentModuleInfo->getPKField();\n\n $selects = array();\n $joins = array();\n\n $converted = array();\n foreach($parentConditionFields as $conditionField => $parentField){\n $parentModuleField = $parentModuleFields[$parentField];\n //$selects[] = $parentModuleField->makeSelectDef($ModuleID, false);\n //$joins = array_merge($joins, $parentModuleField->makeJoinDef($ModuleID));\n\n $selects[] = GetSelectDef($parentField);\n $joins = array_merge($joins, GetJoinDef($parentField));\n\n $joins = SortJoins($joins);\n $SQL = ' SELECT ';\n $SQL .= implode(', ', $selects);\n $SQL .= \" FROM `$ModuleID` \";\n $SQL .= implode(\"\\n \", $joins);\n $SQL .= ' WHERE ';\n $SQL .= \"`$ModuleID`.$parentRecordIDField = '/**RecordID**/'\";\n $SQL .= ' ';\n $converted[$conditionField] = $SQL;\n }\n\n\n return $converted;\n}",
"public function children() {\n\t\t/** @var CommentArray $comments */\n\t\t// $comments = $this->getPageComments();\n\t\t$page = $this->getPage();\n\t\t$field = $this->getField();\n\t\t$comments = $page->get($field->name);\n\t\t$children = $comments->makeNew();\n\t\tif($page) $children->setPage($this->getPage());\n\t\tif($field) $children->setField($this->getField()); \n\t\t$id = $this->id; \n\t\tforeach($comments as $comment) {\n\t\t\tif(!$comment->parent_id) continue;\n\t\t\tif($comment->parent_id == $id) $children->add($comment);\n\t\t}\n\t\treturn $children;\n\t}",
"public function getTestParentTypes() {\n if(isset($_POST[\"labTestId\"])) {\n echo $this->fields->getParentFields($_POST[\"labTestId\"]);\n }\n }",
"public function get_element_extend_fields($parent, $id_parent=NULL)\n\t{\n\t\t// Element extend fields\n\t\t$where = array('parent' => $parent);\n\t\t$extend_fields = $this->get_list($where);\n\n\t\t// Current element extend field\n\t\t$this->{$this->db_group}->where(\n\t\t\tarray(\n\t\t\t\t'extend_field.parent' => $parent,\n\t\t\t\t$this->elements_table.'.id_parent' => $id_parent\n\t\t\t)\n\t\t);\n\n\t\t$this->{$this->db_group}->join(\n\t\t\t$this->elements_table,\n\t\t\t$this->elements_table.'.id_'.$this->table.' = ' .$this->table.'.id_'.$this->table,\n\t\t\t'inner'\n\t\t);\n\n\t\t$query = $this->{$this->db_group}->get($this->get_table());\n\n\t\t$result = array();\n\t\tif ( $query->num_rows() > 0)\n\t\t\t$result = $query->result_array();\n\n\t\t$langs = Settings::get_languages();\n\t\t$element_fields = $this->{$this->db_group}->list_fields($this->elements_table);\n\n\t\tforeach($extend_fields as $k => &$extend_field)\n\t\t{\n\t\t\t// One not tranlated extend field...\n\t\t\tif ($extend_field['translated'] != '1')\n\t\t\t{\n\t\t\t\t// fill the base data with empty values\n\t\t\t\t$extend_field = array_merge(array_fill_keys($element_fields, ''), $extend_field);\n\t\t\t\n\t\t\t\tforeach($result as $row)\n\t\t\t\t{\n\t\t\t\t\tif($row['id_extend_field'] == $extend_field['id_extend_field'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$extend_field = array_merge($extend_field , $row);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tforeach($langs as $language)\n\t\t\t\t{\n\t\t\t\t\t// Lang code\n\t\t\t\t\t$lang = $language['lang'];\n\t\t\t\t\t\n\t\t\t\t\t// Feed lang key with blank array\n\t\t\t\t\t$extend_field[$lang] = array();\n\t\t\t\t\t$extend_field[$lang]['content'] = '';\n\t\t\t\t\t\n\t\t\t\t\t// Feeding of template languages elements\n\t\t\t\t\tforeach($result as $row)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($row['id_extend_field'] == $extend_field['id_extend_field'] && $row['lang'] == $lang)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$extend_field[$lang] = $row;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $extend_fields;\n\t}",
"function content_parent_types(&$nodes, $limit_type = 'project') {\n $parent_types = array ();\n foreach ( $nodes as $nid => $node ) {\n if ($node->type == 'project' && $limit_type == 'project') {\n $parent_types [$node->nid] = $node->type;\n } else {\n $parent_types [$node->nid] = $node->type;\n }\n }\n return $parent_types;\n}",
"public function fakeParentData($parentFields = [])\n {\n $fake = Faker::create();\n\n return array_merge([\n 'email' => $fake->word,\n 'first_name' => $fake->word,\n 'last_name' => $fake->word,\n 'student_identity' => $fake->word,\n 'phone' => $fake->word,\n 'gender' => $fake->word,\n 'created_at' => $fake->word,\n 'updated_at' => $fake->word\n ], $parentFields);\n }",
"protected function getComplexContentObjectItemsForParent(\n $parentId\n )\n {\n $condition = new EqualityCondition(\n new PropertyConditionVariable(\n ComplexContentObjectItem::class_name(),\n ComplexContentObjectItem::PROPERTY_PARENT\n ),\n new StaticConditionVariable($parentId)\n );\n\n return $this->contentObjectRepository->findAll(\n ComplexContentObjectItem::class_name(), new DataClassRetrievesParameters(\n $condition, null, null, array(\n new OrderBy(\n new PropertyConditionVariable(\n ComplexContentObjectItem::class_name(),\n ComplexContentObjectItem::PROPERTY_DISPLAY_ORDER\n )\n )\n )\n )\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set a Finder instance | public function setFinder(Finder $finder) {
$this->finder = $finder;
} | [
"public function setFinder($finder) {\n $this->finder = $finder;\n return $this;\n }",
"public static function setFinder(\\Owl\\Finder $finder)\n\t{\n\t\tself::$finder = $finder;\n\t}",
"private function setFinder(Finder $finder)\n {\n $this->getRequest()->getSession()->set('finder', $finder);\n }",
"public static function setFinder($finder)\n {\n /** @var \\Illuminate\\View\\Factory $instance */\n $instance->setFinder($finder);\n }",
"protected function createFinder() {\n return new Finder();\n }",
"public function setFinder(ViewFinderInterface $finder)\n\t{\n\t\t$this->finder = $finder;\n\t}",
"public function finder()\n {\n\n return new Finder($this, $this->connection);\n }",
"function find() : Finder\n {\n return new Finder();\n }",
"public function testSetFinderMethod(): void\n {\n $this->assertSame('all', $this->association->getFinder());\n $this->assertSame($this->association, $this->association->setFinder('published'));\n $this->assertSame('published', $this->association->getFinder());\n }",
"public function setScannerFinder(Finder $finder): void\n {\n $this->scannerFinder = $finder;\n }",
"public function getFinder()\n {\n return new Finder();\n }",
"public function setFinder(ViewFinderInterface $finder)\n {\n $this->finder = $finder;\n }",
"public function finder()\n\t{\n\t\treturn Finder::create();\n\t}",
"public function finder($finder = null) {\n\t\tif ($finder !== null) {\n\t\t\t$this->_finder = $finder;\n\t\t}\n\n\t\treturn $this->_finder;\n\t}",
"function setFind($find){\n $this->find = $find;\n }",
"public function getFinder()\n {\n return $this->get('finder');\n }",
"public function getFinder()\n {\n return $this->finder;\n }",
"protected function getFinderService()\n {\n return $this->services['finder'] = new \\Symfony\\Component\\Finder\\Finder();\n }",
"protected function createFinder()\n {\n if ($this->request->hasPost('pickup', 'return')) {\n $this->sessionBag->set('rental', [\n 'pickup' => $this->request->getPost('pickup'),\n 'return' => $this->request->getPost('return')\n ]);\n }\n\n $data = $this->sessionBag->get('rental', []);\n\n return FinderEntity::factory($data);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Show the banner on the shop loop items | function yv_woocommerce_template_loop_product_banner() {
yv_get_shop_section( 'product-banner' );
} | [
"function banner() {\n cek_session_akses('banner', $this->session->id_session);\n $data['record'] = $this->model_app->view_ordering('banner', 'id_banner', 'DESC');\n $this->template->load('administrator/template', 'administrator/mod_banner/view_banner', $data);\n }",
"function getbanners()\n\t\t{\n\t\t\t$banners = $this->manage_content->getValue('banner_info','*');\n\t\t\techo '<div id=\"add_space\">';\n\t\t\tforeach($banners as $banner)\n\t\t\t{\n\t\t\t\tif($banner['banner_status'] == 1)\n\t\t\t\t{\n\t\t\t\t\techo '<a href=\"'.$banner['banner_link'].'\">';\n\t\t\t\t\techo '<div class=\"add_section\"><img src=\"images/'.$banner['banner_image'].'\" style=\"height:'.$banner['banner_height'].'px;width:'.$banner['banner_width'].'px;float:left;\"/></div></a>';\n\t\t\t\t}\n\t\t\t}\n\t\t\techo '</div>';\n\t\t}",
"public function display_promo_banner() {\r\n\t\t$this->upgrade->display_promo_banner();\r\n\t}",
"public function banner(): void\n {\n Script::fancyBanner();\n }",
"function vikinger_woocommerce_after_shop_loop_item_title() {\r\n ?>\r\n </div>\r\n <!-- /VIKINGER WC PRODUCT INFO -->\r\n <?php\r\n }",
"function showbanner() {echo xoops_getbanner();}",
"function displayBanner()\n\t\t{\n\t\t\techo \"\n <div class='bg2'>\n\t\t\t<h2><em>Categories Manager</em></h2>\n\t\t\t<p align='center'>\";\n\t\t\t\n\t\t\t// menus\n\t\t\techo \"\n <a href='categories.php'>Available</a> . \n\t\t\t<a href='categories.php?event=disabled'>Disabled</a> . \n\t\t\t<a href='categoriescompose.php'>Create</a>\";\n\t\t\t\n\t\t\techo \"\n </p>\n\t\t\t</div>\";\n\t\t\t\n\t\t\treturn;\n\t\t}",
"function vikinger_woocommerce_before_shop_loop_item_title() {\r\n ?>\r\n <!-- VIKINGER WC PRODUCT INFO -->\r\n <div class=\"vikinger-wc-product-info\">\r\n <?php\r\n }",
"public static function show(): void\n {\n\n $banners = \\Hoday\\Banners\\BannerService::getInstance()->getAll();\n $formatString = self::FORMAT_STRING;\n ob_start();\n include 'templates/banners_template.php';\n echo ob_get_clean();\n }",
"function custom_cart_banner() {\n global $post;\n $image_url = get_field('banner', $post->ID);\n if($image_url) { ?>\n <div class=\"cart-banner\">\n <img src=\"<?php echo $image_url ?>\" alt=\"coupon\">\n </div>\n <?php }\n }",
"public function fonShowWebshopItem()\r\n {\r\n // maybe add a session save here\r\n \r\n return '<div class=\"webshopcontent\">\r\n <div class=\"webshopcontentfoto\">\r\n ' . $this->itemimg . '\r\n </div>\r\n <div class=\"webshopcontentdata\">\r\n ' . $this->itemname . '<br>' . $this->itemprice . '\r\n <div class=\"itemlikebutton\"><input type=\"button\" onclick=\"fonJSitemLike('.$this->id.')\" value=\"like\"/></div>\r\n <p>Likes: <span class=\"likeCount\">'. $this->itemlikes .'</span></p>\r\n </div><form action=\"\" method=\"post\">\r\n <div><input type=\"submit\" name=\"addtocart'. $this->id .'\" value=\"Add\" /></div>\r\n <div><input type=\"number\" name=\"quantity\" min=\"1\" max=\"100\" required /></div>\r\n <input type=\"hidden\" name=\"ding\" value=\"' . $this->id . '\" />\r\n </form></div>';\r\n }",
"function sf_display_banner()\r\n{\r\n\t$sftitle = get_option('sftitle');\r\n\tif(!empty($sftitle['sfbanner']))\r\n\t{\r\n\t\treturn '<img id=\"sfbanner\" src=\"'.$sftitle['sfbanner'].'\" alt=\"\" />';\r\n\t}\r\n\treturn '';\r\n}",
"public static function store_banner() {\n\n\t\t$value = get_user_meta( get_current_user_id(), 'rh_vendor_free_header', true ); \n\t\t\n\t\techo '<div class=\"rhpv_shop_brand_container mb15\">';\n\t\techo '<h6>'. __( 'Store Banner', 'rehub_framework'). '</h6>'; \n\n\t\t// Store Banner Image\n\t\tself::file_uploader_helper( apply_filters( 'wcv_vendor_store_banner', array( \n\t\t\t'header_text'\t\t=> __('Store Banner', 'rehub_framework' ), \n\t\t\t'add_text' \t\t\t=> __('Add Store Banner', 'rehub_framework' ), \n\t\t\t'remove_text'\t\t=> __('Remove Store Banner', 'rehub_framework' ), \n\t\t\t'image_meta_key' \t=> '_pv_shop_banner_id', \n\t\t\t'save_button'\t\t=> __('Add Store Banner', 'rehub_framework' ), \n\t\t\t'window_title'\t\t=> __('Select an Image', 'rehub_framework' ), \n\t\t\t'value'\t\t\t\t=> $value\n\t\t\t)\n\t\t) );\n\t\techo '</div>';\n\t}",
"private function show_items() {\n\t\t// Display the items\n\t\tif ( ! empty( $this->items ) ) {\n\t\t\tforeach ( $this->items as $item ) {\n\t\t\t\t$this->show_item( $item );\n\t\t\t}\n\t\t}\n\t}",
"function wrapper_catalog_shop( $ob_get_clean ){\n\t\t\t$animation = (bool) Carbonick_Theme_Helper::get_option('use_animation_shop');\n\t\t\t$animation_style = Carbonick_Theme_Helper::get_option('shop_catalog_animation_style');\n\n\t\t\t$classes = '';\n\t $classes .= (bool)$animation ? ' appear-animation' : '';\n\t $classes .= (bool)$animation && !empty($animation_style) ? ' anim-'.$animation_style : '';\n\n\n\t\t\techo '<ul class=\"wgl-products'.esc_attr($classes).'\">';\n\t\t}",
"function displayBanner()\n\t\t{\n\t\t\techo \"\n <div class='bg2'>\n\t\t\t<h2><em>Accounts Manager</em></h2>\n\t\t\t<p align='center'>\";\n\t\t\t\n\t\t\t// menus\n\t\t\techo \"\n <a href='accounts.php'>Members</a> . \n\t\t\t<a href='accounts.php?event=contributor'>Contributors</a> . \n\t\t\t<a href='accounts.php?event=disabled'>Disabled</a> . \n\t\t\t<a href='accountscompose.php'>Create</a> . \n <a href='search.php?event=accounts'>Search</a>\";\n\t\t\t\n\t\t\techo \"\n </p>\n\t\t\t</div>\";\n\t\t\t\n\t\t\treturn;\n\t\t}",
"public function item()\n\t{\n\t\techo parent::display( 'site/photos/default.item' );\n\t}",
"function displayBanner()\n\t\t{\n\t\t\techo \"<div id='header'>\";\n\t\t\t\n\t\t\t// display the publication name\n\t\t\techo \"<h1>\".$this -> title.\"</h1>\";\n\t\t\techo \"<h2>\".$this -> subtitle.\"</h2>\";\n\t\t\t\n\t\t\techo \"<ul>\";\n\t\t\techo \"<li><a href='index.php'><div id='home'></div></a></li>\";\n\t\t\t\n\t\t\t// display banner for NON-MEMBERS, MEMEBRS, CONTRIBUTORS, and ADMINISTRATORS\n\t\t\tswitch($this -> position)\n\t\t\t{\n\t\t\t\tcase null:\n\t\t\t\t\t// banner for NON-MEMBERS\n\t\t\t\t\techo \"<li><a href='join.php'><div id='register'></div></a></li>\";\n\t\t\t\t\techo \"<li><a href='signin.php'><div id='signIn'></div></a></li>\";\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tdefault:\n\t\t\t\t\t// banner for MEMBERS, CONTRIBUTORS, and ADMINISTRATORS\n\t\t\t\t\techo \"<li><a href='profilesedit.php'><div id='profile'></div></a></li>\";\n\t\t\t\t\techo \"<li><a href='../index.php?event=signout'><div id='signOut'></div></a></li>\";\n\t\t\t}\n\t\t\t\n\t\t\techo \"</ul>\";\n\t\t\techo \"</div>\";\n\t\t\t\n\t\t\treturn;\n\t\t}",
"function BH_shop_single_experience_banner() {\r\n\r\n\t//get_template_part( 'views/woocommerce/single-product/single-product-section2', 'banner' );\r\n\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Coupon action by url Add coupon > talonone/TalonOne/coupon?coupon_code=123 Remove coupon > talonone/TalonOne/coupon?remove=1 | public function couponAction()
{
$this->checkCoupon();
} | [
"public function addCoupon() {\n $this->layout = \"admin_dashboard\";\n $storeId = $this->Session->read('admin_store_id');\n $merchantId = $this->Session->read('admin_merchant_id');\n if ($this->request->is(array('post', 'put')) && !empty($this->request->data['Coupon']['coupon_code'])) {\n $this->request->data = $this->Common->trimValue($this->request->data);\n $couponTitle = trim($this->request->data['Coupon']['name']);\n $couponCode = trim($this->request->data['Coupon']['coupon_code']);\n $isUniqueName = $this->Coupon->checkCouponUniqueName($couponTitle, $storeId);\n $isUniqueCode = $this->Coupon->checkCouponUniqueCode($couponCode, $storeId);\n if ($isUniqueName) {\n if ($isUniqueCode) {\n $response = $this->Common->uploadMenuItemImages($this->request->data['Coupon']['image'], '/Coupon-Image/', $storeId, 480, 320);\n if (!$response['status']) {\n $this->Session->setFlash(__($response['errmsg']), 'alert_failed');\n } else {\n if (!empty($this->request->data['Coupon']['days'])) {\n $this->request->data['Coupon']['days'] = implode(\",\", array_keys($this->request->data['Coupon']['days']));\n } else {\n $this->request->data['Coupon']['days'] = '';\n }\n $coupondata['image'] = $response['imagename'];\n $coupondata['store_id'] = $storeId;\n $coupondata['merchant_id'] = $merchantId;\n $coupondata['name'] = trim($this->request->data['Coupon']['name']);\n $coupondata['start_date'] = $this->Dateform->formatDate($this->request->data['Coupon']['start_date']);\n $coupondata['end_date'] = $this->Dateform->formatDate($this->request->data['Coupon']['end_date']);\n $coupondata['coupon_code'] = trim($this->request->data['Coupon']['coupon_code']);\n $coupondata['number_can_use'] = $this->request->data['Coupon']['number_can_use'];\n $coupondata['discount_type'] = $this->request->data['Coupon']['discount_type'];\n $coupondata['discount'] = $this->request->data['Coupon']['discount'];\n $coupondata['is_active'] = $this->request->data['Coupon']['is_active'];\n $coupondata['allow_time'] = $this->request->data['Coupon']['allow_time'];\n $coupondata['start_time'] = $this->request->data['Coupon']['start_time'];\n $coupondata['end_time'] = $this->request->data['Coupon']['end_time'];\n $coupondata['days'] = $this->request->data['Coupon']['days'];\n if (isset($this->request->data['Coupon']['promotional_message']) && $this->request->data['Coupon']['promotional_message']) {\n $coupondata['promotional_message'] = trim($this->request->data['Coupon']['promotional_message']);\n }\n $this->Coupon->create();\n $this->Coupon->saveCoupon($coupondata);\n $this->request->data = '';\n $this->Session->setFlash(__(\"Coupon Successfully Added\"), 'alert_success');\n }\n } else {\n $this->Session->setFlash(__(\"Coupon Code Already exists\"), 'alert_failed');\n }\n } else {\n $this->Session->setFlash(__(\"Coupon Title Already exists\"), 'alert_failed');\n }\n }\n $start = \"00:00\";\n $end = \"24:00\";\n $timeRange = $this->Common->getStoreTimeAdmin($start, $end);\n $this->set('timeOptions', $timeRange);\n $this->_coupanList();\n //For Dealdata\n $this->loadModel('StoreDeals');\n $storeDealData = $this->StoreDeals->findByStoreId($storeId);\n $this->set('storeDealData', $storeDealData);\n $this->request->data = \"\";\n }",
"public function createCouponAction(){\n \n $couponsmodal = Admin_Model_Coupons::getInstance(); \n if ($this->getRequest()->isPost()) {\n $coupondata = array();\n $coupondata['coupon_code'] = $this->getRequest()->getPost('couponcode');\n $coupondata['coupon_name'] = $this->getRequest()->getPost('couponname');\n $coupondata['discount_offered'] = $this->getRequest()->getPost('coupondiscount');\n $coupondata['coupon_limit'] = $this->getRequest()->getPost('couponlimit');\n $coupondata['coupon_type'] = $this->getRequest()->getPost('subscriptionoffers');\n $coupondata['discount_type'] = $this->getRequest()->getPost('discount_type');\n $coupondatastartdate = $this->getRequest()->getPost('couponstartdate');\n $coupondataenddate = $this->getRequest()->getPost('couponenddate'); \n $coupondata['coupon_startdate'] = date('Y-m-d', strtotime($coupondatastartdate));\n $coupondata['coupon_enddate'] = date('Y-m-d', strtotime($coupondataenddate));\n \n $couponid = $couponsmodal->insertCouponDetails($coupondata);\n \n if($couponid){\n $this->_redirect('/admin/coupons');\n \n }\n \n } \n \n \n }",
"public function register_coupon_shortcode() {\n\t\tadd_shortcode('coupon', array( &$this, 'coupon_url_creation_function' ) );\n\t}",
"public function apply_coupon_from_url() {\n\n\t\t\tif ( empty( $_SERVER['QUERY_STRING'] ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tparse_str( wp_unslash( $_SERVER['QUERY_STRING'] ), $coupon_args ); // phpcs:ignore\n\t\t\t$coupon_args = wc_clean( $coupon_args );\n\n\t\t\tif ( isset( $coupon_args['coupon-code'] ) && ! empty( $coupon_args['coupon-code'] ) ) {\n\n\t\t\t\t$coupon_args['coupon-code'] = urldecode( $coupon_args['coupon-code'] );\n\n\t\t\t\t$coupon_codes = explode( ',', $coupon_args['coupon-code'] );\n\n\t\t\t\t$coupon_codes = array_filter( $coupon_codes ); // Remove empty coupon codes if any.\n\n\t\t\t\t$cart = ( is_object( WC() ) && isset( WC()->cart ) ) ? WC()->cart : null;\n\n\t\t\t\t$coupons_data = array();\n\n\t\t\t\tforeach ( $coupon_codes as $coupon_index => $coupon_code ) {\n\t\t\t\t\t// Process only first five coupons to avoid GET request parameter limit.\n\t\t\t\t\tif ( apply_filters( 'wc_sc_max_url_coupons_limit', 5 ) === $coupon_index ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( empty( $coupon_code ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$coupons_data[] = array(\n\t\t\t\t\t\t'coupon-code' => $coupon_code,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tif ( empty( $cart ) || WC()->cart->is_empty() ) {\n\t\t\t\t\t\t$this->hold_applied_coupon( $coupons_data );\n\t\t\t\t} else {\n\t\t\t\t\tforeach ( $coupons_data as $coupon_data ) {\n\t\t\t\t\t\t$coupon_code = $coupon_data['coupon-code'];\n\t\t\t\t\t\tif ( ! WC()->cart->has_discount( $coupon_code ) ) {\n\t\t\t\t\t\t\tWC()->cart->add_discount( trim( $coupon_code ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( empty( $coupon_args['sc-page'] ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t$redirect_url = '';\n\n\t\t\t\tif ( in_array( $coupon_args['sc-page'], array( 'shop', 'cart', 'checkout', 'myaccount' ), true ) ) {\n\t\t\t\t\tif ( $this->is_wc_gte_30() ) {\n\t\t\t\t\t\t$page_id = wc_get_page_id( $coupon_args['sc-page'] );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$page_id = woocommerce_get_page_id( $coupon_args['sc-page'] );\n\t\t\t\t\t}\n\t\t\t\t\t$redirect_url = get_permalink( $page_id );\n\t\t\t\t} else {\n\t\t\t\t\t$redirect_url = get_permalink( get_page_by_title( $coupon_args['sc-page'] ) );\n\t\t\t\t}\n\n\t\t\t\tif ( empty( $redirect_url ) ) {\n\t\t\t\t\t$redirect_url = home_url();\n\t\t\t\t}\n\n\t\t\t\t$redirect_url = $this->get_redirect_url_after_smart_coupons_process( $redirect_url );\n\n\t\t\t\twp_safe_redirect( $redirect_url );\n\n\t\t\t\texit;\n\n\t\t\t}\n\n\t\t}",
"public function apply_coupon()\n {\n if ($this->input->post('coupon_code')) {\n $this->form_validation->set_rules('coupon_code', 'lang:label.coupon', 'trim|required');\n\n $this->form_validation->set_error_delimiters('<p class=\"help-block\">', '</p>');\n\n // Run the form validation\n if (!$this->form_validation->run()) {\n response_json(['status' => 0, 'error' => form_error('coupon_code')]);\n }\n\n if (!$this->store->hasMinimumOrderAmount()) {\n response_json(['status' => 0, 'error' => lang('text.coupon_not_applicable')]);\n }\n\n // Apply the coupon\n if (!$this->coupons->apply($this->input->post('coupon_code'))) {\n response_json(['status' => 0, 'error' => lang('text.coupon_invalid')]);\n }\n\n $this->table();\n }\n }",
"public function apply_coupon_from_url() {\n\n\t\t\t\tif ( empty( $_SERVER['QUERY_STRING'] ) ) return;\n\n\t\t\t\tparse_str( $_SERVER['QUERY_STRING'], $coupon_args );\n\n\t\t\t\tif ( isset( $coupon_args['coupon-code'] ) && ! empty( $coupon_args['coupon-code'] ) ) {\n\n\t\t\t\t\tif ( empty( $this->global_wc()->cart ) || $this->global_wc()->cart->is_empty() ) {\n\t\t\t\t\t\t$this->hold_applied_coupon( $coupon_args );\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tif ( ! $this->global_wc()->cart->has_discount( $coupon_args['coupon-code'] ) ) {\n\t\t\t\t\t\t\t$this->global_wc()->cart->add_discount( trim( $coupon_args['coupon-code'] ) );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( empty( $coupon_args['sc-page'] ) ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t$redirect_url = '';\n\n\t\t\t\t\tif ( in_array( $coupon_args['sc-page'], array( 'shop', 'cart', 'checkout', 'myaccount' ) ) ) {\n\t\t\t\t\t\t$redirect_url = get_permalink( woocommerce_get_page_id( $coupon_args['sc-page'] ) );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$redirect_url = get_permalink( get_page_by_title( $coupon_args['sc-page'] ) );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( empty( $redirect_url ) ) {\n\t\t\t\t\t\t$redirect_url = home_url();\n\t\t\t\t\t}\n\n\t\t\t\t\t$redirect_url = $this->get_redirect_url_after_smart_coupons_process( $redirect_url );\n\n\t\t\t\t\twp_safe_redirect( $redirect_url );\n\n\t\t\t\t\texit;\n\n\t\t\t\t}\n\n\t\t\t}",
"public static function remove_coupon()\n {\n }",
"public function manager_page_coupon_manager() {\n global $DB;\n $action = optional_param('action', 'list', PARAM_ALPHAEXT);\n $cid = optional_param('cid', 0, PARAM_INT);\n $pageurl = clone $this->page->url;\n $pageurl->param('action', $action);\n if ($this->page->course->id <> SITEID) {\n $pageurl->param('cid', $this->page->course->id);\n }\n\n switch ($action) {\n case 'delete':\n require_capability('enrol/classicpay:deletecoupon', $this->page->context);\n // We'll do this using a form for now.\n $id = required_param('id', PARAM_INT);\n $this->page->set_title(get_string('coupon:delete', 'enrol_classicpay'));\n $coupon = $DB->get_record('enrol_classicpay_coupon', array('id' => $id));\n $deleteform = new \\enrol_classicpay\\forms\\coupondelete($pageurl, $coupon);\n $pageurl->param('action', 'list');\n $deleteform->process_form($id, $pageurl);\n exit;\n break;\n\n case 'edit':\n require_capability('enrol/classicpay:editcoupon', $this->page->context);\n $this->page->set_title(get_string('title:couponedit', 'enrol_classicpay'));\n $id = required_param('id', PARAM_INT);\n if ($id > 0) {\n $instance = $DB->get_record('enrol_classicpay_coupon', array('id' => $id), '*', MUST_EXIST);\n } else {\n $instance = (object)array('id' => 0);\n }\n $options = new stdClass();\n $options->instance = $instance;\n if ($this->page->course->id <> SITEID) {\n $options->lockcourse = $this->page->course->id;\n }\n $form = new \\enrol_classicpay\\forms\\coupon($pageurl, $options);\n $pageurl->param('action', 'list');\n $form->process_form($instance, $pageurl);\n break;\n\n case 'list':\n default:\n $strnewform = '';\n if (has_capability('enrol/classicpay:createcoupon', $this->page->context)) {\n $options = new stdClass();\n $options->instance = (object) array('id' => 0);\n if ($this->page->course->id <> SITEID) {\n $options->lockcourse = $this->page->course->id;\n }\n $newform = new \\enrol_classicpay\\forms\\coupon($pageurl, $options);\n $newform->process_post($options->instance, $pageurl);\n $strnewform = '<div class=\"enrol-classicpay-container\">' . $newform->render() . '</div>';\n }\n\n $filter = optional_param('list', 'all', PARAM_ALPHA);\n $table = new \\enrol_classicpay\\tables\\coupons($cid, $filter);\n $table->baseurl = $pageurl;\n echo $this->header();\n echo '<div class=\"enrol-classicpay-container\">';\n $table->render(25);\n echo '</div>';\n echo $strnewform;\n echo $this->footer();\n break;\n }\n }",
"public function useCoupon($event){\n /** @var $order Order */\n $order = $event->sender;\n /** @var $couponModel Coupon */\n $couponModel = Coupon::findOne(Yii::$app->getSession()->get(self::SESSION_COUPON_MODEL_KEY));\n if($couponModel){\n $couponRuleModel = $couponModel->couponRule;\n $result = Json::decode($couponRuleModel->result);\n if($result['type']){\n $order->total_price = $order->total_price * $result['number'];\n }else{\n $order->total_price = $order->total_price - $result['number'];\n }\n switch($result['shipping']){\n case 1:\n $order->shipping_fee = $order->shipping_fee - $result['shippingFee'];\n break;\n case 2:\n $order->shipping_fee = 0;\n }\n Event::on(Order::className(),Order::EVENT_AFTER_INSERT,[ShoppingCoupon::className(),'updateCouponStatus'],['couponModel'=>$couponModel]);\n }\n }",
"public function removeCoupon($id);",
"public function saveCouponCodeAction()\n {\n $result = $this->_getResult();\n $request = $this->getRequest();\n $quote = $this->_quote;\n if (!$quote->getItemsCount()) {\n return;\n }\n \n $couponCode = $request->getParam('coupon-code');\n if ($request->getParam('remove-coupon') == 1) {\n $couponCode = '';\n }\n $oldCouponCode = $quote->getCouponCode();\n try {\n if (!strlen($couponCode) && !strlen($oldCouponCode)) {\n Mage::throwException($this->_helper->__('Coupon code is not valid.'));\n }\n $quote->getShippingAddress()->setCollectShippingRates(true);\n $quote->setCouponCode(strlen($couponCode) ? $couponCode : '');\n $quote->collectTotals();\n $quote->save();\n if ($couponCode) {\n if ($couponCode == $quote->getCouponCode()) {\n $result->setData(\n 'success',\n $this->_helper->__(\n 'Coupon code \"%s\" was applied successfully.',\n $this->_helper->escapeHtml($couponCode)\n )\n );\n } else {\n $result->setData(\n array(\n 'error' => true,\n 'message' => $this->_helper->__(\n 'Coupon code \"%s\" is not valid.',\n $this->_helper->escapeHtml($couponCode)\n ),\n )\n );\n }\n } else {\n $result->setData('success', $this->_helper->__('Coupon code was canceled successfully.'));\n }\n $result->addData(\n $this->_getBlocksHtml(\n array(\n 'shipping_method_html',\n 'coupon_html',\n 'payment_method_html',\n 'totals_html'\n ))\n );\n } catch (Mage_Core_Exception $e) {\n $result->setData(\n array(\n 'error' => true,\n 'message' => $e->getMessage(),\n )\n );\n } catch (Exception $e) {\n Mage::logException($e);\n $result->setData('error', true);\n if ($this->_helper->isDeveloperMode()) {\n $result->setData('message', $e->getMessage());\n } else {\n $result->setData('message', $this->_helper->__($this->_unknownErrorMsg));\n }\n }\n \n //Messaggi in basso\n $result->setData('message_position', true);\n \n $this->getResponse()->appendBody($result->toJson());\n }",
"function pizza_pos_coupon_add() {\n\n\tpizza_pos_save_orders(\n\t\t$_POST['order_id'],\n\t\tarray(\n\t\t\t'coupon' => sanitize_text_field( $_POST['coupon'] ),\n\t\t\t'discounts' => $_POST['discounts']\n\t\t)\n\t);\n\n\twp_send_json(\n\t\tarray(\n\t\t\t'order_id' => $_POST['order_id']\n\t\t)\n\t);\n\n\twp_die();\n}",
"public function addCouponAction(Request $request)\n {\n $coupon = $request->get('coupon', null);\n\n if (! empty($coupon)) {\n $this->cart->setCoupon($coupon);\n $this->addFlash('success', 'Coupon redeemed successfully.');\n } else {\n $this->addFlash('danger', 'Coupon code cannot be empty.');\n }\n\n return $this->redirectToRoute('cart_index');\n }",
"public static function add_coupon() {\n $response = array(\n 'error' => false,\n 'message' => 'Successfully added Coupon'\n );\n\n if(isset($_REQUEST['fuse-ajax']) && isset($_REQUEST['data'])) {\n\n $data = $_REQUEST['data']['newcoupon'];\n \n if ( !wp_verify_nonce( $data['nonce'], \"fuse_submitting_form\")) {\n $response['error'] = true;\n $response['message'] = 'Could not add Coupon';\n } else {\n\n $data = Stripe::prepare_request($data);\n $response['data'] = $data;\n\n $coupon = Stripe::create_coupon($data);\n if($coupon) {\n if(isset($coupon['error'])) {\n $response['error'] = true;\n $response['message'] = $coupon['error'];\n }\n }\n \n $response['stripe_response'] = $coupon;\n }\n\n echo json_encode($response);\n }\n\n wp_die();\n }",
"public function saveCouponAction()\n {\n if ($this->_expireAjax()) {\n return;\n }\n if (!$this->getRequest()->isPost()) {\n $this->_ajaxRedirectResponse();\n\n return;\n }\n $result = $this->_result;\n $code = (string)$this->getRequest()->getParam('coupon_code');\n $oldCode = $this->getQuote()->getCouponCode();\n\n if (empty($code) && empty($oldCode) && $code !== $oldCode) {\n $isSuccess = false;\n } else {\n try {\n\n $this->getShippingAddress()->setCollectShippingRates(true);\n $this->getQuote()->setCouponCode(strlen($code) ? $code : '')\n ->collectTotals()\n ->save();\n\n if ($code == $this->getQuote()->getCouponCode()) {\n\n $this->getShippingAddress()->setCollectShippingRates(true);\n $this->getQuote()->setTotalsCollectedFlag(false);\n $this->getQuote()->collectTotals()->save();\n\n Mage::getSingleton('checkout/session')->getMessages(true);\n\n /**\n * validate\n */\n if (empty($code)) {\n $result['messages'][] = $this->__('Coupon has been canceled.');\n $isApplied = false;\n\n } else {\n $result['messages'][] = $this->__('Coupon has been applied.');\n $isApplied = true;\n\n }\n\n } else {\n $result['messages'][] = $this->__('Coupon is invalid.');\n $isSuccess = false;\n }\n $result['blocks'] = $this->getBlockHelper()->getActionBlocks();\n if ($this->_isEnabledGrandTotal()) {\n $result['grand_total'] = $this->getGrandTotal();\n }\n } catch (Mage_Core_Exception $e) {\n $result['messages'][] = $e->getMessage();\n $isSuccess = false;\n } catch (Exception $e) {\n $result['messages'][] = $this->__('Error! cannot apply this coupon.');\n $isSuccess = false;\n }\n }\n $result['success'] = $isSuccess;\n $result['coupon_applied'] = $isApplied;\n $this->bodyResponse($result);\n }",
"public function testUpdateCoupon()\n {\n }",
"function addCoupon( $coupon )\r\n {\r\n switch ($coupon->coupon_group)\r\n {\r\n case 'shipping':\r\n // Only Per Order\r\n $this->addOrderCoupon( $coupon, 'shipping' ); \r\n break;\r\n case 'price':\r\n default:\r\n switch ($coupon->coupon_type)\r\n {\r\n case \"1\":\r\n // per product\r\n $this->addProductCoupon( $coupon );\r\n break;\r\n case \"0\":\r\n // per order\r\n $this->addOrderCoupon( $coupon, 'price' );\r\n break;\r\n }\r\n break;\r\n }\r\n \r\n if (!empty($coupon->coupon_id) && $coupon->coupon_automatic != '1') \r\n {\r\n $this->_usercoupons[] = $coupon;\r\n }\r\n }",
"private function redeemCoupon()\n {\n }",
"public function removeCoupon(Request $request){\n if(Cart::where('user_id', Auth::user()->id)->count()==0){\n return response()->json(['status'=>false, 'message'=>'Please add course to cart or refresh the page.'],200);\n }\n \n Cart::where('user_id', Auth::user()->id)->update(['coupon'=>'','coupon_applied'=>0,'discount'=>0]);\n\n return response()->json(['status'=>true, 'message'=>'The coupon code entered is successfully removed.'], 200);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get number of articles to display at FAQ Home Page | public function getNumArticlesToDisplay(); | [
"public static function getCountArticles()\n {\n return 10;\n }",
"function sp_count_articles()\n{\n\t$db = database();\n\n\t$request = $db->query('', '\n\t\tSELECT \n\t\t COUNT(*)\n\t\tFROM {db_prefix}sp_articles'\n\t);\n\tlist ($total_articles) = $db->fetch_row($request);\n\t$db->free_result($request);\n\n\treturn $total_articles;\n}",
"public static function getArticlesNumber() {\n $connection = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );\n $sql = \"SELECT count(*) as count FROM articles\";\n $st = $connection->prepare( $sql );\n $st->execute();\n $num = $st->fetch();\n $connection = null;\n return ( $num['count'] );\n }",
"public function getArticlesCount()\n {\n return $this->articlesCount;\n }",
"function art_count($cat_id) {\nglobal $xoopsDB;\n\n\t$sql = (\"SELECT COUNT(id) AS count FROM \" . $xoopsDB->prefix(\"articles_main\") . \" WHERE art_showme=1 AND art_validated=1 AND art_cat_id='$cat_id'\");\n\t$result=$xoopsDB->query($sql);\n\t\n\t\tif ($xoopsDB->getRowsNum($result) > 0) {\n\t\t\twhile($myrow = $xoopsDB->fetchArray($result)) {\n\n\t\t\t\t$num_articles = $myrow['count'];\n\t\t\n\t\t\t\t//return $num_articles;\n\t\t\t\t//unset ($num_articles);\n\t\t\t}\n\t\t} else {\n\t\t\t$num_articles = 0;\n\t\t}\n\t//echo $num_articles;\n\treturn($num_articles);\n}",
"function getNumArticles() {\n\t\t$issueDao =& DAORegistry::getDAO('IssueDAO');\n\t\treturn $issueDao->getNumArticles($this->getId());\n\t}",
"public function get_total_faq_items() {\n\t\tglobal $wpdb;\n\t\t$result = $wpdb->get_var( \"SELECT COUNT(id) FROM $this->table_faq_headers\" );\n\t\treturn $result;\n\t}",
"public function getNumArticles() {\n $num_articles = intval($this->getAttribute('num_articles'));\n if ($num_articles <= 0) {\n // use default value if not set properly in article list record\n $num_articles = self::default_num_articles;\n }\n return $num_articles;\n }",
"public function adminCountArticlesGrid(){\n\t\t$query = \"SELECT COUNT(id) FROM articles\";\n\t\treturn $this->getField($query);\n\t}",
"public function getNbArticles()\n { // à compléter \n $total = 0;\n $articles = $this->getContenu();\n foreach ($articles as $article) {\n $total = $total + $article->quantite;\n }\n return $total;\n }",
"public function getSimilarShownCountAction()\n {\n $sql = 'SELECT COUNT(id) FROM s_articles';\n $count = Shopware()->Db()->fetchOne($sql);\n\n $this->View()->assign(['success' => true, 'data' => ['count' => $count]]);\n }",
"function getArticleCount() {\n\t\t$numberOfArticles = 0;\n\t\t$sql = \"\n\t\t\tSELECT \n\t\t\t\tcount(tr.articleID) as numberOfArticles\n\t\t\tFROM\n\t\t\t\t\" . POLARBEAR_DB_PREFIX . \"_article_tag_relation AS tr\n\t\t\tINNER JOIN\n\t\t\t\t\" . POLARBEAR_DB_PREFIX . \"_articles AS a ON a.id = tr.articleID\n\t\t\tINNER JOIN\n\t\t\t\t\" . POLARBEAR_DB_PREFIX . \"_article_tags AS at ON at.id = tr.tagID\n\t\t\tWHERE\n\t\t\t\ttr.tagID = '$this->id' AND \n\t\t\t\tat.isDeleted = 0\n\t\t\";\n\n\t\tglobal $polarbear_db;\n\t\tif ($r = $polarbear_db->get_row($sql)) {\n\t\t\t$numberOfArticles = $r->numberOfArticles;\n\t\t}\n\t\treturn $numberOfArticles;\n\t}",
"public function get_nb_questions() {\r\n echo $this->question_model->getNbQuestionByTopic($_POST['topic']);\r\n }",
"public function getEpisodeCount(){\n $e = mysql_query(\"SELECT count(*) as total FROM episodes\") or die(mysql_error());\n extract(mysql_fetch_array($e));\n return $total;\n }",
"public function get_number_of_news()\n {\n $myrows = $widget_instances = get_option('widget_' . 'standout_news_widget');\n foreach ($widget_instances as $instance) :\n return $instance['number_of_news'];\n endforeach;\n }",
"function countblog() {\n $sql = \"select count(*) as a from blog\";\n $result = $this->database->runquery($sql); \n $count = $result->fetch_assoc();\n return $count['a'];\n }",
"function bbp_forum_pagination_count()\n{\n}",
"public static function getTotalArticles()\n {\n\n $db = Db::getConnection();\n\n $result = $db->query('SELECT count(id) AS count FROM dt_articles');\n $result->setFetchMode(PDO::FETCH_ASSOC);\n\n $row = $result->fetch();\n\n return $row['count'];\n\n }",
"function numberOfEnquiry(){\n $conn = database::getDB();\n $sql = 'SELECT COUNT(*) as num FROM enquirydetails';\n $count = $conn->query($sql);\n while($row = $count->fetch_assoc()) {\n \t\t \t$numberOfEnquiries = $row['num'];\n \t\t }\n return $numberOfEnquiries;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the current parameter richness. | public function getRichness() {
return $this->parameterRichness;
} | [
"public function richSnippetIsActive()\n {\n return $this->config->getConfigParam('foxrateRichSnippetActive');\n }",
"public function canRate()\n {\n return $this->getViewParameter('canrate');\n }",
"public function setRichness($level) {\n\t\t$this->parameterRichness = intval($level);\n\t}",
"public function getQualityLevel()\n {\n return $this->qualityLevel;\n }",
"public function getQuality()\n\t{\n\t\treturn $this->quality;\n\t}",
"public function getQuality()\n {\n return $this->quality;\n }",
"public function getQuality()\n {\n return $this->Quality;\n }",
"public function getResourceVisibility()\n {\n return $this->resource_visibility;\n }",
"function getBrightness() {\n return $this->brightness;\n }",
"public function getCorrectnessLevel()\n {\n return $this->correctness_level;\n }",
"public function getQuality() {\n return $this->quality;\n }",
"public function getEnableWordConfidence()\n {\n return $this->enable_word_confidence;\n }",
"public function getIsBonusResource()\n {\n return $this->isBonusResource;\n }",
"public function getRarity()\n {\n return $this->rarity;\n }",
"public function getIsProbation()\n {\n return $this->is_probation;\n }",
"public function getIntegratedLoudness()\n {\n return $this->IntegratedLoudness;\n }",
"public function getFrpRecette() {\n return $this->frpRecette;\n }",
"public function getLightness()\n {\n $this->toHSL();\n\n return $this->hsl['l'];\n }",
"public function get_current_readability_filter()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Prepare field attributes and extract decoration attributes. Apply attribute macros, if available. | protected function prepareField(&$field, array $attributes = [], &$decoration = [])
{
$fieldClass = empty($field['class']) ? '' : $field['class'];
$configAttributes = config('vocalogic.fieldAttributes', []);
$field = array_merge(array_merge($configAttributes, $attributes), $field);
if (empty($field['name']))
{
$field['name'] = '';
}
// We don't want to override classes; we want to concatenate them:
$classes = [];
if (!empty($configAttributes['class']))
{
$classes[] = $configAttributes['class'];
}
if (!empty($attributes['class']))
{
$classes[] = $attributes['class'];
}
if (!empty($fieldClass))
{
if (strpos($fieldClass, '!important') === false)
{
$classes[] = $fieldClass;
}
else
{
// if there is "!important" in the class field attribute, we will discard inherited classes
$classes = [$fieldClass];
}
}
if (!empty($classes))
{
$field['class'] = join(' ', $classes);
}
$decoration = [];
// Making it possible to modify attributes into something else by using macros
foreach ($field as $attribute => $value)
{
$attributeMacro = $attribute . 'Attribute';
if (self::hasMacro($attributeMacro))
{
self::$attributeMacro([&$field]);
}
if (substr($attribute, 0, 1) == '_')
{
$decoration[substr($attribute, 1)] = $value;
unset($field[$attribute]);
}
}
if ($this->tag == 'vlform')
{
if (!empty($field['name']) && empty($field['v-model']))
{
$field['v-model'] = $field['name'];
}
if (!empty($field['v-model']))
{
$this->data[] = $field['v-model'] . ': null';
}
}
elseif (!empty($this->binding) && !empty($field['name']) && empty($field['v-model']))
{
$field['v-model'] = $this->binding . '.' . $field['name'];
}
} | [
"public function initFieldAttributes() {\n\t\t$attributes = static::FIELD_ATTRIBUTES;\n\t\t$attributes['notes']['cols'] = Configs\\Ap::config()->columns_notes_pord;\n\t\treturn $this->fieldAttributes = $attributes;\n\t}",
"function field_wrapper_attributes($wrapper, $field)\n {\n }",
"private function makeAttributes(){\n\n foreach ($this->fields as $key => $field) {\n\n $key = strtolower($key);\n\n if (is_array($field)) {\n $this->{$key} = new Field($key);\n if (isset($field['validates'])) {\n\n $validates = $field['validates'];\n //correção para forçar um array de validades\n if (!isset($validates[0])) {\n $validates = [$validates];\n }\n\n foreach ($validates as $key1 => $validate) {\n if (isset($validate['require'])) {\n $this->{$key}->setRequired((bool)$validate['require']);\n break;\n }\n }\n }\n if (isset($field['type'])) {\n $this->{$key}->setType($field['type']);\n }\n if( isset($field['ignore']) ){\n $this->{$key}->setIgnore($field['ignore']);\n }\n if( isset($field['date_format']) ){\n $this->{$key}->setDateFormat($field['date_format']);\n }\n if( isset($field['empty_value']) ){\n $this->{$key}->setEmptyValue($field['empty_value']);\n }\n } else {\n $this->{strtolower($field)} = new Field(strtolower($field));\n }\n }\n\n $this->created_at = new Field('created_at', date('Y-m-d H:i:s'));\n $this->created_at->setValue(date('Y-m-d H:i:s'));\n $this->id = new Field('id');\n\n }",
"private function setupFieldsAttributes() {\n\n\t\tforeach ( $this->form as $field ) {\n\n\t\t\tif ( ! $field->hasAttribute( 'id' ) ) {\n\t\t\t\t$field->setAttribute( 'id', esc_attr( sanitize_title( $field->getName() ) ) );\n\t\t\t}\n\t\t}\n\n\t}",
"protected function custom_accessors()\n {\n if ($this->accesor_attributes)\n foreach ($this->accesor_attributes as $att)\n $this->properties[$att] = \"\"; \n }",
"public static function formatAttributes();",
"protected function initAttributes()\n\t{\n\t\t// Determine the names of the attributes that have already been defined to avoid defining the again in the next step\n\t\t$definedAttributes = array();\n\t\tif(isset($this->attributes))\n\t\t{\n\t\t\tforeach($this->attributes as $attr)\n\t\t\t{\n\t\t\t\tif(is_string($attr))\n\t\t\t\t{\n\t\t\t\t\t$i = strpos($attr, ':');\n\t\t\t\t\t$definedAttributes[$i === false ? $attr : substr($attr, 0, $i)] = true;\n\t\t\t\t}\n\t\t\t\telse if(isset($attr['name']))\n\t\t\t\t{\n\t\t\t\t\t$definedAttributes[$attr['name']] = true;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Configure renderable attribute attributes if it has not already been defined manually.\n\t\tforeach($this->data->getAllAttributeNames() as $name)\n\t\t{\n\t\t\tif(!isset($definedAttributes[$name]))\n\t\t\t{\n\t\t\t\t$attr = array(\n\t\t\t\t\t'name' => $name,\n\t\t\t\t\t'type' => $this->data->getAttributeType($name),\n\t\t\t\t);\n\n\t\t\t\tif($attr['type'] === 'text')\n\t\t\t\t{\n\t\t\t\t\t$attr['template'] = \"<tr class=\\\"{class}\\\"><th>{label}</th><td style=\\\"word-wrap:break-word;word-break:break-all;\\\">{value}</td></tr>\\n\";\n\t\t\t\t}\n\t\t\t\t$this->attributes[] = $attr;\n\t\t\t}\n\t\t}\n\t}",
"public function buildAttributes()\n {\n $classes = new ClassFactory();\n $classes->add($this->default_class);\n\n if ($this->class) {\n foreach (explode(' ', $this->class) as $c) {\n $classes->add($c);\n }\n }\n\n $attr = new AttributeFactory();\n $attr->add('class', $classes->get());\n\n if ($this->role) {\n $attr->add('role', $this->role);\n }\n\n if ($this->id) {\n $attr->add('id', $this->id);\n }\n\n if ($this->aria_label) {\n $attr->add('aria-label', $this->aria_label);\n }\n\n if ($this->attributes) {\n foreach ($this->attributes as $key => $attribute) {\n $attr->add($key, $attribute);\n }\n }\n\n $this->data['attr'] = $attr->get();\n }",
"private function resolveAttributes()\n {\n $this->attributes = [\n 'class' => $this->cssClass,\n 'id' => $this->name\n ];\n\n if($this->multiple) {\n $this->attributes['multiple'] = true;\n }\n\n if($this->disabled){\n $this->attributes['disabled'] = true;\n }\n }",
"protected function _declareAttributes()\n {\n }",
"protected function getLinkAttributeFieldDefinitions() {}",
"protected function defineAttributes()\n {\n $this->dbAttributes = (object) [\n 'safe' => [\n 'documento_iddocumento',\n 'fecha',\n 'funcionario_idfuncionario',\n 'version',\n 'pdf'\n ],\n 'date' => ['fecha']\n ];\n }",
"protected function defineAttributes()\n {\n $this->dbAttributes = (object) [\n 'safe' => [\n 'origen',\n 'destino',\n 'fecha',\n 'descripcion',\n 'leido',\n 'notificado',\n 'tipo',\n 'tipo_id',\n ],\n 'date' => ['fecha']\n ];\n }",
"protected function defineAttributes()\n {\n $this->dbAttributes = (object)[\n 'safe' => [\n 'fk_grafico',\n 'valor',\n 'operador_inicial',\n 'cantidad_inicial',\n 'operador_final',\n 'cantidad_final',\n 'color',\n 'descripcion',\n 'orden',\n 'estado'\n ]\n ];\n }",
"protected function formatFields()\n {\n $fields = $this->fields;\n\n if (!$fields instanceof AttributeCollection) {\n $fields = new AttributeCollection($fields, $this);\n }\n\n return $this->fields = $fields->formatFields();\n }",
"public function getCustomerAddressAttributeAssembler();",
"protected function defineAttributes()\n {\n $this->dbAttributes = (object) [\n 'safe' => [\n 'documento_iddocumento',\n 'ruta',\n 'etiqueta',\n 'tipo',\n 'formato',\n 'campos_formato',\n 'idbinario',\n 'fecha_anexo',\n 'fecha',\n 'estado',\n 'version',\n 'fk_funcionario',\n 'fk_anexos',\n 'descripcion',\n 'eliminado',\n 'versionamiento'\n ],\n 'date' => ['fecha_anexo', 'fecha']\n ];\n }",
"protected function defineAttributes()\n {\n $this->dbAttributes = (object) [\n 'safe' => [\n 'fk_tarea',\n 'fk_anexo'\n ],\n 'date' => []\n ];\n }",
"protected function defineAttributes()\n {\n $this->dbAttributes = (object)[\n 'safe' => [\n 'pertenece_nucleo',\n 'nombre',\n 'tipo',\n 'imagen',\n 'etiqueta',\n 'enlace',\n 'cod_padre',\n 'orden'\n ],\n 'date' => []\n ];\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Search the parent schema to see if this item is required. This is the "right" way. | public function getRequired()
{
if ($parent = $this->getParentSchema())
{
if (is_array($required = $parent->getRequired()))
{
return in_array($this->getNameInParentSchema(), $required);
}
}
// Non-standard addition, because the "right" way is awkward and inconsistent
return $this->getDocumentProperty('required');
} | [
"protected function _formRequiresFather(){\n \n //if there's no option for the foreign item key\n //it means that we cannot print the form since\n //that one is an obligated father\n\n \n foreach($this->Fields as $field_name):\n $form_table=$this->_getFormParentTable($field_name);\n if(EasyQuery::isForeignItemKey($field_name,$form_table)):\n \n $this->RequiredFathers[]=EasyQuery::getParentTable($field_name);\n \n endif;\n \n endforeach;\n \n if ( $this->RequiredFathers )\n return true;\n \n return false;\n\n \n }",
"public static function hasParent(): bool\n {\n return !is_null(static::get('parent')) && str_starts_with(static::get('parent'), 'field_');\n // return !is_null(static::get('parent'));\n }",
"public function hasParentMetadata()\n {\n return $this->has(self::PARENT_METADATA);\n }",
"public function checkParent(){\n\t\treturn ( !empty($this->filteringOptions['parent']) ) ? true : false;\n\t}",
"public function hasParentFieldDescription(): bool;",
"public function isParent()\n {\n if (!$this->getAttribute($this->getForeignKey())) {\n return true;\n }\n\n return false;\n }",
"public function hasMandatoryAncestor()\n {\n return $this->get(self::MANDATORY_ANCESTOR) !== null;\n }",
"public function hasParent();",
"public function hasMandatoryData();",
"public function hasParent()\n {\n return !empty($this->parent);\n }",
"public function\t\t\tneedPathFinalParent()\n\t{\n\t\tif (!is_null($this->getPathElement())) {\n\t\t\tfor ($p = $this; ; $p = $p->getLeadChild()) {\n\t\t\t\tif (is_null($p->getLeadChild())) {\n\t\t\t\t\t$p = $p->getParentPresenter();\n\t\t\t\t\t$p->setLeadChild(null);\n\t\t\t\t\t$p->createNotFoundPresenter();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}",
"public function hasParent() {\n\t\treturn !empty($this->parent);\n\t}",
"public function hasParent() {\r\n\t\ttry {\r\n\t\t\tif (!$isTree = $this->isTree()) {\r\n\t\t\t\tthrow new LBoxException(\"Table '$tableName' seems not to be tree!\");\r\n\t\t\t}\r\n\t\t\t$this->load();\r\n\t\t\t$treeColNames\t= $this->getClassVar(\"treeColNames\");\r\n\t\t\t$pidColName\t\t= $treeColNames[2];\r\n\t\t\treturn ($this->get($pidColName) > 0);\r\n\t\t}\r\n\t\tcatch (Exception $e) {\r\n\t\t\tthrow $e;\r\n\t\t}\r\n\t}",
"function hasParent()\n {\n return is_null($this->parent) ? false : true;\n }",
"public function isRequired()\n {\n \tforeach ($this->getElements() as $element) {\n \t\tif ($element->isRequired()) {\n \t\t\treturn TRUE;\n \t\t}\n \t}\n return FALSE;\n }",
"public function checkRestriction()\n\t\t{\n\t\t\t$currentItem = $this->getItem();\n\n\t\t\t$itemList = Item::dao()->getItemList();\n\n\t\t\tforeach($itemList as $item) {\n\t\t\t\tif($item->isAbstract()) continue;\n\n\t\t\t\t$itemClass = $item->getClass();\n\n\t\t\t\t$propertyList = Property::dao()->getPropertyList($item);\n\n\t\t\t\tforeach($propertyList as $property) {\n\t\t\t\t\tif(\n\t\t\t\t\t\t$property->getPropertyClass() == Property::ONE_TO_ONE_PROPERTY\n\t\t\t\t\t\t&& $property->getFetchClass() == $currentItem->getItemName()\n\t\t\t\t\t) {\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t$property->getOnDelete() != 'set_null'\n\t\t\t\t\t\t\t&& $property->getOnDelete() != 'cascade'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tif(!sizeof($currentItem->getChildrenItemList())) continue;\n\t\t\t\t\t\t\t$count = $itemClass->dao()->getChildrenCountByProperty($this, $property);\n\t\t\t\t\t\t\tif($count > 0) return false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tforeach($itemList as $item) {\n\t\t\t\tif($item->isAbstract()) continue;\n\n\t\t\t\t$itemClass = $item->getClass();\n\n\t\t\t\t$propertyList = Property::dao()->getPropertyList($item);\n\n\t\t\t\tforeach($propertyList as $property) {\n\t\t\t\t\tif(\n\t\t\t\t\t\t$property->getPropertyClass() == Property::ONE_TO_ONE_PROPERTY\n\t\t\t\t\t\t&& $property->getFetchClass() == $currentItem->getItemName()\n\t\t\t\t\t) {\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t$property->getOnDelete() == 'set_null'\n\t\t\t\t\t\t\t|| $property->getOnDelete() == 'cascade'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tif(!sizeof($currentItem->getChildrenItemList())) continue;\n\t\t\t\t\t\t\t$count = $itemClass->dao()->getChildrenCountByProperty($this, $property);\n\t\t\t\t\t\t\tif($count <= self::MAX_NUMBER_OF_CHECK_ELEMENTS) {\n\t\t\t\t\t\t\t\t$childList =\n\t\t\t\t\t\t\t\t\t$itemClass->dao()->\n\t\t\t\t\t\t\t\t\tgetChildrenByProperty($this, $property)->\n\t\t\t\t\t\t\t\t\tgetList();\n\t\t\t\t\t\t\t\tforeach($childList as $child) {\n\t\t\t\t\t\t\t\t\tif(!$child->checkRestriction()) return false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}",
"public function isWaitingForParent()\n {\n if ($this->options === Manager::DELETE) {\n return false;\n }\n\n return !$this->relation->getParent()->exists;\n }",
"protected function checkInitialParentAvailable(){\n\t\t$select = 'uid';\n\t\t$from = 'sys_category';\n\t\t$where = 'deleted = 0';\n\n\t\t$parentUidResult = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows($select,$from,$where);\n\n\t\tif(count($parentUidResult) > 0){\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}",
"protected function validateParentMenuItem() {\r\n\t\tif(!empty($this->parentMenuItem)) {\r\n\t\t\t$found = false;\r\n\t\t\tforeach($this->parentMenuItems as $parent => $value) {\r\n\t\t\t\tif(isset($value[$this->parentMenuItem]) || $parent == $this->parentMenuItem) {\r\n\t\t\t\t\t$found = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(!$found) $this->parentMenuItem = '';\r\n\t\t}\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get count of needs review nodes for researcher profiles. | function vu_rp_workbench_get_needs_review_count() {
$query = db_select('field_revision_field_rpa_staff_id', 'rp');
$query->leftJoin('workbench_moderation_node_history', 'wm', "rp.entity_id = wm.nid");
$query->distinct()->addField('rp', 'entity_id', 'entity_id');
$query->condition('wm.is_current', 1, '=');
$query->condition('wm.state', 'needs_review', '=');
$result = $query->countQuery()->execute()->fetchField();
return $result;
} | [
"public function needReviewers() {\n if(Yii::app()->user->checkAccess('adminhead')) {\n return Project::model()->reviewable()->count();\n }\n }",
"public function countPeople(){\n\t\treturn $this->nodeStore->countNodes();\n\t}",
"function countReviewers ()\r\n {\r\n $db = Zend_Db_Table::getDefaultAdapter();\r\n $result = $db->query (\"SELECT COUNT(*) AS nb FROM Review WHERE idPaper={$this->id}\");\r\n $nb = $result->fetch (Zend_Db::FETCH_OBJ) ;\r\n if ($nb) {\r\n return $nb->nb;\r\n }\r\n else {\r\n return 0;\r\n }\r\n }",
"public function getNumReviewers() {\n return $this->num_reviewers;\n }",
"public function totalReviewer() {\n $count = 0;\n $count += NotificationCount::needMyReview();\n return $count;\n }",
"public function getTotalReviews(){\n $review_count = UserReview::count();\n return $review_count;\n }",
"public function countRequests()\n {\n // Spawn a query and find unapproved accounts\n $query = $this->parent->db->query();\n $query->select('`id`', 'bf_users')\n ->where('`requires_review` = 1')\n ->execute();\n \n // Return the total\n return $query->count;\n }",
"public function getReviewsCount();",
"public function numToReview()\n\t{\n\t\t$userCalculator = new UserStatsCalculator($this->user);\n\t\t$userCalculator->calcRecallScores();\n\t\t$needToReview = $this->user->flashcards()->where('recall_score', '<=', self::REVIEW_THRESHOLD)\n\t\t\t\t\t\t\t\t\t\t\t ->get();\n\t\t$numToReview = $this->deckCards->intersect($needToReview)->count();\n\t\treturn $numToReview;\n\t}",
"public function count()\n\t{\n\t\treturn $this->context == self::ContextNode ? count($this->nodes) : count($this->relationships);\n\t}",
"public function count() {\n return count($this->nodes);\n }",
"public function nodeCount(): int\n {\n if ($this->getCrawler() === null) {\n return 0;\n }\n\n return $this->getCrawler()->count();\n }",
"function totalReviewCount()\n\t{\n\t\treturn $this->getReviews->count();\n\t}",
"public function getReviewCount() {\n /**\n * get the Colletion of 'review/review' and add filter Values.\n */\n $review = Mage::getModel ( 'review/review' )->getCollection ()->addStoreFilter ( Mage::app ()->getStore ()->getId () )->addStatusFilter ( 'approved' )->addEntityFilter ( 'product', $this->getProduct ()->getId () )->setDateOrder ();\n /**\n * Return review count.\n */\n return intval ( count ( $review ) );\n }",
"public function getCountNewReviews(): int\n {\n return ShopFeedbackEntity::find()\n ->leftJoin('user', 'user.id = shop_feedback.created_by')\n ->where([\n 'shop_feedback.shop_id' => Yii::$app->user->identity->getId(),\n 'shop_feedback.status' => ShopFeedbackEntity::STATUS_UNREAD,\n 'user.status' => UserEntity::STATUS_VERIFIED,\n 'user.is_deleted' => 0\n ])\n ->count();\n }",
"public function getNodeCount()\n {\n return $this->node_count;\n }",
"public function getReviewCount() {\n return $this->count(self::REVIEW);\n }",
"public function countNodes() {\n return count($this->nodes);\n }",
"public function getReviewCount()\n {\n return $this->jsonData->ReviewCount->Total;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Takes an array of arrays and uses the given key to make the array keyed by that value | public static function keyBy(array $array, $key): array
{
$result = [];
foreach ($array as $item) {
$result[$item[$key]] = $item;
}
return $result;
} | [
"function ldap_key_by ($i_array, $key) {\n\t$result = array();\n\tforeach ($i_array as $record) {\n\t\tif (!isset($record[$key]))\n\t\t\tcontinue;\n\t\t$result[$record[$key]] = $record;\n\t}\nreturn($result);\n}",
"public static function groupByKey($array, $key)\n {\n $grouped_array = array();\n foreach($array as $val) {\n $grouped_array[$val[$key]][] = $val;\n }\n return $grouped_array;\n }",
"function fn_array_value_to_key($array, $key_field)\n{\n // Move msgctxt to key\n $_prepared = array();\n foreach ($array as $value) {\n $_prepared[$value[$key_field]] = $value;\n }\n\n return $_prepared;\n}",
"function array_index($array, $key) {\n\t$new_array = array();\n\tforeach ($array as $element) {\n\t\tif (is_array($element)) {\n\t\t\t$new_array[$element[$key]] = $element;\n\t\t} elseif (is_object($element)) {\n\t\t\t$new_array[$element->{$key}] = $element;\n\t\t}\n\t}\n\treturn $new_array;\n}",
"public static function reduceToElementsWithKey($array, $key) {\n\n if ($array instanceof AssociativeArray) {\n $array = $array->toArray();\n }\n\n $targetArray = array();\n\n foreach ($array as $itemKey => $value) {\n\n if ($itemKey == $key) {\n $targetArray[$key] = $value;\n } else if (is_array($value) || $value instanceof AssociativeArray) {\n $subArray = ArrayUtils::reduceToElementsWithKey($value, $key);\n if (sizeof($subArray) > 0) {\n $targetArray[$itemKey] = $subArray;\n }\n }\n\n }\n\n return $targetArray;\n\n }",
"function ArrayUniqueByKey ($array, $key) {\n $tmp = array();\n $result = array();\n foreach ($array as $value) {\n if (!in_array($value[$key], $tmp)) {\n array_push($tmp, $value[$key]);\n array_push($result, $value);\n }\n }\n return $array = $result;\n}",
"public static function keyWith( $key = null, $array = null ) {\n\t\t$keyWith = function ( $key, $array ) {\n\t\t\treturn Fns::map( function ( $item ) use ( $key ) {\n\t\t\t\treturn [ $key => $item ];\n\t\t\t}, $array );\n\t\t};\n\n\t\treturn call_user_func_array( curryN( 2, $keyWith ), func_get_args() );\n\t}",
"function getValuesByKey($array, $key) {\n $ret = array_map(function($row) use ($key) {\n return $row[$key];\n }, $array);\n\n return $ret;\n}",
"function array_group_by( array $array, $keys ) {\n\n // Initialize the result.\n $result = [];\n\n // Look through array items.\n foreach( $array as $item ) {\n\n // Get the item's value for the given key.\n $value = array_get($item, $keys);\n\n // Initialize the key's value if not already initialized.\n if( !isset($result[$value]) ) $result[$value] = [];\n\n // Group the item by the key's value.\n $result[$value][] = $item;\n\n }\n\n // Return the result.\n return $result;\n\n}",
"function array_group_by_key($arr, $key) {\n if (!$key || !$arr) {\n return null;\n }\n $ret = array();\n foreach ($arr as $elem) {\n if (!isset($ret[$elem[$key]])) {\n $ret[$elem[$key]] = array();\n }\n $ret[$elem[$key]][] = $elem;\n }\n return $ret;\n}",
"static function arrExtractOneKey($arr, $key)\n\t{\n\t\t$new = [];\n\t\tforeach($arr as $itm)\n\t\t\t$new[] = $itm[$key];\n\t\t\n\t\treturn $new;\n\t}",
"public function array_set_index($ary, $key) {\r\n $temp = array();\r\n foreach($ary as $row) {\r\n $index = $row[$key];\r\n $temp[$index] = $row;\r\n }\r\n return $temp;\r\n }",
"function iwf_set_array( &$array, $key, $value ) {\r\n\tif ( is_null( $key ) ) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tif ( is_array( $key ) ) {\r\n\t\tforeach ( $key as $k => $v ) {\r\n\t\t\tiwf_set_array( $array, $k, $v );\r\n\t\t}\r\n\r\n\t} else {\r\n\t\t$keys = explode( '.', $key );\r\n\r\n\t\twhile ( count( $keys ) > 1 ) {\r\n\t\t\t$key = array_shift( $keys );\r\n\r\n\t\t\tif ( !isset( $array[$key] ) || !is_array( $array[$key] ) ) {\r\n\t\t\t\t$array[$key] = array();\r\n\t\t\t}\r\n\r\n\t\t\t$array =& $array[$key];\r\n\t\t}\r\n\r\n\t\t$array[array_shift( $keys )] = $value;\r\n\t}\r\n}",
"public static function groupBy(string $key, array $array): array\n {\n $output = [];\n foreach ($array as $a) {\n if (array_key_exists($key, $a)) {\n $output[$a[$key]][] = $a;\n }\n }\n return $output;\n }",
"static public function array_column_as_key($anArray, $aKey) {\n\t\treturn array_combine(self::array_column($anArray,$aKey), $anArray);\n\t}",
"function remapKeys($keys, &$array) {\n foreach($keys as $to => $from) {\n remapKey($from, $to, $array);\n }\n}",
"function compileSubsOnKey($array,$key = 'id',$name=null){\n\t\tif(is_array($array)){\n\t\t\t$newArray = array();\n\t\t\tforeach($array as $part){\n\t\t\t\t$keyValue = $part[$key];\n\t\t\t\tif($name){\n\t\t\t\t\t$newArray[$keyValue][] = $part[$name];\n\t\t\t\t}else{\n\t\t\t\t\tunset($part[$key]);\n\t\t\t\t\tif(count($part) > 1 ){\n\t\t\t\t\t\t$newArray[$keyValue][] = $part;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$newArray[$keyValue][] = array_pop($part);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $newArray;\n\t\t}\n\t\treturn array();\n\t}",
"function insertKeysValuesInEachArraySubArray($array, $keysValues, $subKey = null) {\n foreach ($array as &$v) {\n if (is_array($v)) {\n foreach ($keysValues as $kk => $vv) {\n if (!$subKey) {\n $v[$kk] = $vv;\n } else {\n $v[$subKey][$kk] = $vv;\n }\n }\n }\n }\n\n return $array;\n}",
"function array_normalise_keys(array $array, ?string $nameKey = 'name', ?string $valueKey = 'value') : array\n{\n $result = [];\n\n foreach ($array as $key => $value) {\n // If a string with an anteger key convert to an\n // empty array with the old value as the key\n if (is_string($value) && is_integer($key)) {\n $key = $value;\n $value = [];\n }\n\n if ($valueKey !== null && !is_array($value)) {\n $value = [\n $valueKey => $value\n ];\n }\n\n // If the name key is set copy the key into the value array\n if ($nameKey !== null && !array_key_exists($nameKey, $value)) {\n $value[$nameKey] = $key;\n }\n\n $result[$key] = $value;\n }\n\n return $result;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parse the log file contents | public function parse()
{
$this->parseHeader();
//timezone must have been set by this point
if($this->timezone === null)
throw new ParserException('The log file does not specify a timezone. You must specify one using setTimezone()');
//parse each track in log file
while($track = fgets($this->logFile))
$this->parseTrack($track);
if(sizeof($this->tracks) === 0)
throw new ParserException('The log file contains no track information.');
return $this->tracks;
} | [
"public function parseLog();",
"function parse()\n\t{\n\t\t$log_entries = array();\n\t\t$lines = explode(\"\\n\", $this->log_content);\n\t\t\n\t\tforeach($lines as $line)\n\t\t{\n\t\t\tif($line == \"\") continue;\n\t\t\t$entry = array();\n\t\t\t$entry[] = $line;\n\t\t\t$log_entries[] = $entry;\n\t\t}\n\t\t\n\t\treturn $log_entries;\n\t}",
"function ParseEntireLog ($logFilename)\r\n{\r\n\t//$currentParseFile = $logFilename;\r\n\t//$currentParseLine = 0;\r\n\t\r\n\t$logEntries = array();\r\n\t$entryCount = 0;\r\n\t$errorCount = 0;\r\n\r\n\t$fileData = file_get_contents($logFilename);\r\n\tif ($fileData == null) return false;\r\n\r\n\tif (strlen($fileData) === 0) return true;\r\n\r\n\t$result = preg_match_all('|(event{.*?end{} )|s', $fileData, $logEntries);\r\n\tif ($result === 0) return false;\r\n\r\n\t$totalLineCount = 0;\r\n\r\n\tforeach ($logEntries[1] as $key => $value)\r\n\t{\r\n\t\t$lineCount = substr_count($value, \"\\n\") + 1;\r\n\t\t$totalLineCount += $lineCount;\r\n\t\t//$currentParseLine = $totalLineCount;\r\n\t\t\t\r\n\t\t$entryLog = ParseLogEntry($value);\r\n\t\t\t\r\n\t\t//if (!HandleLogEntry($entryLog))\r\n\t\t//{\r\n\t\t\t//++$errorCount;\r\n\t\t//}\r\n\t\t\t\r\n\t\t++$entryCount;\r\n\t}\r\n\r\n\t//log(\"Parsed {$entryCount} log entries from file '{$logFilename}'.\");\r\n\t//log(\"Found {$errorCount} entries with errors.\");\r\n\t//log(\"Skipped {$duplicateCount} duplicate log entries.\");\r\n\treturn TRUE;\r\n}",
"static public function parseLog($file){\n /**\n * Catches the whole log block by a given type\n * ex1: \\#{80}\\s\\#Type\\[\\sERROR\\s\\].*\\s\\#{80}\\:(\\s.*[^\\#])+\\_{80}\n * ex2: \\#{80}\\s\\#Type\\[\\sWARNING\\s\\].*\\s\\#{80}\\:(\\s.*[^\\#])+\\_{80}\n * ex3: \\#{80}\\s\\#Type\\[\\sALL\\s\\].*\\s\\#{80}\\:(\\s.*[^\\#])+\\_{80}\n */\n \n \n $log = join(\"\", file($file)); # get log file\n # Match all log blocks\n preg_match_all(\"/^\\#{80}\\s\\#(.*)\\s\\#{80}\\:\\s((.|[\\r\\n])*?)\\s\\_{80}/m\", $log, $matches);\n \n foreach($matches[1] as $index => $line){\n # Match title block\n preg_match(\"/Type\\[\\s(?P<type>.*)\\]\\s\\#Title\\[\\s(?P<title>.*)\\s]\\s\\#Date\\[\\s(?P<date>.*)\\s\\]/\", $line, $m);\n $parsedLog[trim($m['type'])][$index] = array(\n \"title\"=> trim($m[\"title\"]),\n \"date\" => trim($m[\"date\"]),\n \"message\"=> $matches[2][$index]\n );\n }\n \n # Normalize arrays\n foreach($parsedLog as $key => $value){ $parsedLog[$key] = array_values($value); }\n \n return $parsedLog;\n }",
"function LogParse($filename, &$logs, &$tags)\n{\n $wasLine = true;\n $files = null;\n $rev = \"\";\n $msg = null;\n $tags = null;\n \n $fp = fopen($filename, \"rt\");\n \n for($i = 1;; ++$i)\n {\n $line = fgets($fp);\n $isLine = $line == \"\\n\";\n $eof = strlen($line) == 0;\n \n if (($wasLine && !$isLine) || $eof)\n {\n if (is_array($files) || isset($msg))\n {\n if (!isset($rev))\n die(\"Error at \" . __FILE__ . \":\" . __LINE__ . \" missing revision number\");\n \n if (!isset($msg))\n die(\"Error at \" . __FILE__ . \":\" . __LINE__ . \" missing log message\");\n \n if (!is_array($files))\n die(\"Error at \" . __FILE__ . \":\" . __LINE__ . \" missing file list\"); \n \n foreach ($files as $f)\n $logs[$rev][normcase($f)] = $msg;\n \n //print(\"Read length \" . strlen($msg) . \" log message for the following files in revision revision $rev:\\n\");\n //foreach($files as $f) print(\" $f\\n\");\n \n $msg = $files = null;\n }\n \n if ($eof) break;\n \n if (preg_match('/^((?:\\\\d+\\\\.\\\\d+)(?:\\\\.\\\\d+\\\\.\\\\d+)*)\\\\s*(.*)\\\\s*$/', $line, $matches))\n {\n $rev = $matches[1];\n $tags[$rev] = strlen($matches[2]) ? \n preg_split(\"/\\\\s+/\", $matches[2]) : array();\n $wasLine = true;\n }\n else\n {\n $files = FileList(substr($line, 0, -1));\n $wasLine = false;\n $msg = \"\";\n }\n }\n else\n {\n if (isset($msg))\n {\n $wasLine = $isLine && !$wasLine; \n if (!$wasLine) $msg .= $line;\n }\n else\n {\n assert($isLine);\n }\n }\n }\n}",
"protected function splitLogIntoEntries()\n {\n $pattern = \"/(# Time(?:.*\\n))/\";\n $entries = preg_split($pattern, $this->contents, -1);\n\n if (count($entries) == 1) {\n throw new Exception\\ParseErrorException(\"Failed to parse file\");\n }\n return array_filter($entries);\n }",
"function parseLog(){\n //set up the log\n $file = file_get_contents($this->log);\n $logs = explode(\"\\n\", $file);\n\n //Parse though the log for all of the information we need\n foreach ($logs as $l){\n //Check for users chatting, set them online, log their chat\n if (preg_match(\"/([0-9-]+ [0-9:]+) \\[INFO\\] \\<([a-zA-Z0-9-_]+)\\> (.*)/i\", $l, $m))\n $this->online($m[2], $m[1], 0, $m[3]);\n //check for users entering the server, set them online\n else if (preg_match(\"/([0-9-]+ [0-9:]+) \\[INFO\\] ([a-zA-Z0-9-_]+) ?\\[.*logged in with entity/i\", $l, $m))\n $this->online($m[2], $m[1], 1);\n //Check for users leaving, set them as offline\n else if (preg_match(\"/([0-9-]+ [0-9:]+) \\[INFO\\] ([a-zA-Z0-9-_]+) lost connection/i\", $l, $m))\n $this->offline($m[2], $m[1]);\n //Check if server shut down, log off all users\n else if (preg_match(\"/([0-9-]+ [0-9:]+) \\[INFO\\] Stopping server/i\", $l, $m))\n $this->server_quit($m[1]);\n }\n\n //Finally we sort the users\n $this->sortUsers();\n\n //Save the cache data if its enabled\n if($this->cacheEnable){\n $this->saveCache();\n }\n\n}",
"protected function parseLog()\r\n {\r\n $log = '';\r\n if (count($this->log) > 0) {\r\n foreach ($this->log as $logEntry) {\r\n if ($logEntry['extended']) {\r\n $log .= sprintf(\r\n '[%s] %s: %s<br />',\r\n $logEntry['datetime']->format('Y-m-d H:i:s'), // DateTime object\r\n $logEntry['type'],\r\n $logEntry['message']\r\n );\r\n } else {\r\n $log .= sprintf(\r\n '%s<br />',\r\n $logEntry['message']\r\n );\r\n }\r\n }\r\n }\r\n return $log;\r\n }",
"public function parse()\n {\n $entries = [];\n\n foreach ($this->getLogRows() as $row) {\n $entry = $this->parseRow($row);\n $entries[] = $this->createLogItem($entry);\n }\n\n return $entries;\n }",
"protected function parseHeader()\n\t{\n\t\t//line 1 is version header\n\t\t$this->parseVersion(fgets($this->logFile));\n\t\t\n\t\t//line 2 is timezone header\n\t\t$this->parseTimezone(fgets($this->logFile));\n\t\t\n\t\t//line 3 is client header\n\t\t$this->parseClient(fgets($this->logFile));\n\t}",
"private function ReadErrorLog() {\n\t\t\t$strCr = chr(10);\n\t\t\t$objFh = fopen($this->strFile, 'r');\n\t\t\t$strList = fread($objFh, filesize($this->strFile));\n\t\t\tfclose($objFh);\n\t\t\t$this->arrList = explode($strCr, $strList);\n\t\t}",
"protected function _parseLogEntry($fp) : array\n {\n // Read first line\n return Model_LogParser::parseLogEntry(\n fgets($fp),\n new DateTimeZone(self::$timezone),\n null,\n 'Y-m-d\\TH:i:sP'\n );\n }",
"public static function ReadLog() {\n if(!file_exists(self::$LogFile) || !is_readable(self::$LogFile)) {\n echo \"ERROR: Log file does not exist or is unreadable.\";\n }\n if($file_handle = fopen(self::$LogFile, 'rb')) {\n self::$Content .= \"<ul class=\\\"log-list\\\">\";\n while(!feof($file_handle)) {\n $entry = fgets($file_handle);\n if(trim($entry) != \"\") { // removes EXTRA newline More: note 4\n self::$Content .= \"<li>\" . $entry . \"</li>\";\n }\n\n }\n }\n self::$Content .= \"</ul>\";\n fclose($file_handle);\n echo (self::$Content);\n }",
"public function load_log_pattern() {\n \t$fp=fopen($this->log_file,'r');\n \tif($fp) {\n \t\tunset($this->g_log_arr);\n \t\t$temp_log_arr=array();\n \t\t$log_pattern_index=0;\n \n while(($line=fgets($fp)) !== false) {\n \t\t\tunset($temp_log_arr);\n \t\t\t$temp=explode(\"$$\",$line);\n \t\t\tforeach($temp as $t) {\n \t\t\t\tlist($k,$v) = explode(':',$t);\n \t\t\t\t$temp_log_arr[$k]=$v;\n \t\t\t}\n \t\t\t$this->g_log_arr[]=$temp_log_arr;\n\n $this->g_log_arr[$log_pattern_index][\"log_index\"] = (int) $this->g_log_arr[$log_pattern_index][\"log_index\"];\n $this->g_log_arr[$log_pattern_index][\"log_score\"] = (float) $this->g_log_arr[$log_pattern_index][\"log_score\"];\n \t\t $log_pattern_index++;\n }\n \t\tfclose($fp);\n \t}\n \t#print_r(explode(\"##\",$this->g_log_arr[0][\"current\"]));\n \t#print_r($this->g_log_arr);\n }",
"public function getLogsFromCurrentFile()\n {\n if ($this->currentFile === null) {\n return [];\n }\n\n if (File::size($this->currentFile) > $this->maxFileSize) {\n return;\n }\n\n $datePattern = '\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}';\n $pattern = \"/\\\\[$datePattern\\\\].*/\";\n $fileContent = File::get($this->currentFile);\n\n preg_match_all($pattern, $fileContent, $rows);\n\n if (! is_array($rows) || count($rows) === 0) {\n return [];\n }\n\n $rows = $rows[0];\n $logs = [];\n\n foreach ($rows as $row) {\n preg_match(\n \"/^\\\\[($datePattern)\\\\].*?(\\\\w+)\\\\.\"\n .'([A-Z]+): (.*?)( in .*?:[0-9]+)?$/',\n $row,\n $matches\n );\n\n if (! isset($matches[4])) {\n continue;\n }\n\n $level = Str::lower($matches[3]);\n\n $inFile = null;\n if (isset($matches[5])) {\n $inFile = substr($matches[5], 4);\n }\n\n $logs[] = (object) [\n 'context' => $matches[2],\n 'level' => $level,\n 'levelClass' => static::$levelsClasses[$level],\n 'levelImg' => static::$levelsImgs[$level],\n 'date' => $matches[1],\n 'text' => trim($matches[4]),\n 'inFile' => $inFile,\n ];\n }\n\n return array_reverse($logs);\n }",
"public function getParsedLog()\n\t{\n\t\tif (!$this->log) {\n\t\t\t$this->parseLog();\n\t\t}\n\n\t\treturn $this->log;\n\t}",
"function readLog(){\n $file = \"log.txt\";\n $fh = fopen($file, 'r');\n $data = fread($fh, filesize($file));\n fclose($fh);\n $data = explode(\"\\n\", $data);\n return $data;\n}",
"protected function _readSvnLog($log)\n {\n $count = count($log);\n $entries = array();\n $entryBuffer = false;\n $entryBufferComment = '';\n\n for ($i = 0; $i < $count; $i++) {\n $line = $log[$i];\n if (substr($line, 0, 5) == '-----') {\n if ($entryBuffer) {\n // Save the last entry parsed\n $entryBuffer['comment'] = $entryBufferComment;\n $entries[$entryBuffer['revision']] = $entryBuffer;\n\n $entryBuffer = false;\n $entryBufferComment = '';\n }\n\n // parse an entry\n $i++;\n if (!isset($log[$i])) {\n // last line\n break;\n }\n $values = explode(' | ', $log[$i]);\n\n $timestamp = strtotime(substr($values[2], 0, 25));\n $entryBuffer = array(\n 'revision' => $values[0],\n 'user' => $values[1],\n 'datetime' => $values[2],\n 'ts' => $timestamp,\n 'lines' => $values[3],\n );\n } else {\n // gather the comments\n $entryBufferComment .= trim($line);\n }\n }\n\n return $entries;\n }",
"function getParsedData($file) {\r\n\r\n // Read everything from logs and write it to array $array\r\n $input = fopen($file, 'r');\r\n $array = null;\r\n \r\n if($input) {\r\n while(($buffer = fgets($input)) !== false) {\r\n $array[] = $buffer;\r\n }\r\n }\r\n \r\n fclose($input); // Close file\r\n \r\n $items = array();\r\n for($i = 0; $i < sizeof($array); $i++) {\r\n \r\n $matches = null; // IP\r\n $matches1 = null; // DATE & TIME\r\n $matches2 = null; // USER LOCATION\r\n \r\n preg_match(\"/[0-9]*\\.[0-9]*\\.[0-9]*\\.[0-9]*/\", $array[$i], $matches);\r\n preg_match(\"/[0-9]+\\-[0-9]+\\-[0-9]+ [0-9]+\\:[0-9]+\\:[0-9]+/\", $array[$i], $matches1);\r\n preg_match(\"/https:.*/\", $array[$i], $matches2);\r\n \r\n $items[] = array(\r\n \"date\" => $matches1[0],\r\n \"ip\" => $matches[0],\r\n \"location\" => $matches2[0]\r\n );\r\n }\r\n \r\n return $items;\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
updateSchedule(int, int, mysqli_object) Updates user schedule with new class id for existing course | public function updateSchedule($schedule_id, $class_id, $con)
{
$response = [];
$sql = "UPDATE `schedule` SET `class_id` = '$class_id'
WHERE `schedule_id` = '$schedule_id' LIMIT 1";
if(mysqli_query($con, $sql))
{
$response['success'] = true;
$response['message'] = "Schedule updated";
}
else
{
$response['success'] = false;
$response['message'] = "Failed to update schedule";
}
return($response);
} | [
"function updateSchedule($startH, $dayId){\n $DB = connect();\n $query = \"UPDATE \".SCHEDULE_TABLE.\" SET \";\n $query.= \"startHour='\" . $startH.\"' \";\n $query.= \"WHERE dayId='\".$dayId.\"';\";\n mysqli_query($DB, $query);\n}",
"public function update(Activity_schedule $activity_schedule) {\n\n $stmt = $this->db->prepare(\"UPDATE activity_schedule set id_activity=?, date=?,\n start_hour=?, end_hour=? where id=?\");\n $n = $stmt->execute(array($activity_schedule->getActivity()->getIdActivity(), $activity_schedule->getDate(),\n $activity_schedule->getStart_hour(), $activity_schedule->getEnd_hour(), $activity_schedule->getId()));\n\n }",
"public function changeCourseScheduleNotSection($request, $classroom, $courseSchedRecord)\n {\n // Editing Classroom schedule parameters cascades to PASH and CourseSchedule Models (no duplicate or existing cs_unique and section field data) e.g. LPE Written and LPE Oral switched schedules - Florence case\n foreach ($courseSchedRecord as $record) {\n // $record->Tch_ID = $request->Tch_ID;\n $record->schedule_id = $request->schedule_id;\n $record->cs_unique = $classroom->Te_Code_New . '-' . $request->schedule_id . '-' . $classroom->Te_Term;\n\n $record->save();\n }\n // update PASH records first to new schedule\n $pash_record = Repo::where('CodeClass', $classroom->Code)->get();\n foreach ($pash_record as $value) {\n $value->schedule_id = $request->schedule_id;\n $value->Code = $classroom->Te_Code_New . '-' . $request->schedule_id . '-' . $classroom->Te_Term;\n $value->CodeClass = $classroom->Te_Code_New . '-' . $request->schedule_id . '-' . $classroom->Te_Term . '-' . $classroom->sectionNo;\n $value->CodeIndexID = $classroom->Te_Code_New . '-' . $request->schedule_id . '-' . $classroom->Te_Term . '-' . $value->INDEXID;\n $value->CodeIndexIDClass = $classroom->Te_Code_New . '-' . $request->schedule_id . '-' . $classroom->Te_Term . '-' . $classroom->sectionNo . '-' . $value->INDEXID;\n $value->save();\n }\n\n // update Classroom Model parameters\n // $classroom->Tch_ID = $request->Tch_ID;\n $classroom->schedule_id = $request->schedule_id;\n $classroom->cs_unique = $classroom->Te_Code_New . '-' . $request->schedule_id . '-' . $classroom->Te_Term;\n $classroom->Code = $classroom->Te_Code_New . '-' . $request->schedule_id . '-' . $classroom->Te_Term . '-' . $classroom->sectionNo;\n\n // set day, time, and room fields to null \n $classroom->Te_Mon = null;\n $classroom->Te_Mon_BTime = null;\n $classroom->Te_Mon_ETime = null;\n $classroom->Te_Mon_Room = null;\n\n $classroom->Te_Tue = null;\n $classroom->Te_Tue_BTime = null;\n $classroom->Te_Tue_ETime = null;\n $classroom->Te_Tue_Room = null;\n\n $classroom->Te_Wed = null;\n $classroom->Te_Wed_BTime = null;\n $classroom->Te_Wed_ETime = null;\n $classroom->Te_Wed_Room = null;\n\n $classroom->Te_Thu = null;\n $classroom->Te_Thu_BTime = null;\n $classroom->Te_Thu_ETime = null;\n $classroom->Te_Thu_Room = null;\n\n $classroom->Te_Fri = null;\n $classroom->Te_Fri_BTime = null;\n $classroom->Te_Fri_ETime = null;\n $classroom->Te_Fri_Room = null;\n\n $schedule_fields = Schedule::find($request->schedule_id);\n if (isset($schedule_fields->day_1)) {\n $classroom->Te_Mon = 2;\n $classroom->Te_Mon_BTime = $schedule_fields->begin_time;\n $classroom->Te_Mon_ETime = $schedule_fields->end_time;\n $classroom->Te_Mon_Room = $request->Te_Mon_Room;\n }\n if (isset($schedule_fields->day_2)) {\n $classroom->Te_Tue = 3;\n $classroom->Te_Tue_BTime = $schedule_fields->begin_time;\n $classroom->Te_Tue_ETime = $schedule_fields->end_time;\n $classroom->Te_Tue_Room = $request->Te_Tue_Room;\n }\n if (isset($schedule_fields->day_3)) {\n $classroom->Te_Wed = 4;\n $classroom->Te_Wed_BTime = $schedule_fields->begin_time;\n $classroom->Te_Wed_ETime = $schedule_fields->end_time;\n $classroom->Te_Wed_Room = $request->Te_Wed_Room;\n }\n if (isset($schedule_fields->day_4)) {\n $classroom->Te_Thu = 5;\n $classroom->Te_Thu_BTime = $schedule_fields->begin_time;\n $classroom->Te_Thu_ETime = $schedule_fields->end_time;\n $classroom->Te_Thu_Room = $request->Te_Thu_Room;\n }\n if (isset($schedule_fields->day_5)) {\n $classroom->Te_Fri = 6;\n $classroom->Te_Fri_BTime = $schedule_fields->begin_time;\n $classroom->Te_Fri_ETime = $schedule_fields->end_time;\n $classroom->Te_Fri_Room = $request->Te_Fri_Room;\n }\n $classroom->save();\n\n return $request;\n }",
"public function updated(Schedule $schedule)\n {\n //\n }",
"function update_schedule()\n{\n\t$userID = $_SESSION['userid']; \n\n\t$s_check = \"SELECT trainID, entryt, vacatet, entryt2, vacatet2 FROM train WHERE userID = $userID\";\n\t$s_check_res=mysql_query($s_check);\n\t\t\n\t\twhile($s_check_arr = mysql_fetch_assoc($s_check_res)) {\n\n\t\t\t// set a var to 2 hours ahead of now\n\t\t\t$now = new DateTime();\t\n\t\t\t$schedulechange = $now->modify('+2 hours');\n\t\t\t$vacate = new DateTime($s_check_arr['vacatet']);\n\n\t\t\t\tif (($schedulechange > $vacate) && ($s_check_arr['vacatet2'] > '0000-00-00 00:00:00')) {\n\n\t\t\t\t\t$entryt = $s_check_arr['entryt2'];\n\t\t\t\t\t$vacatet = $s_check_arr['vacatet2'];\n\t\t\t\t\t$trainID = $s_check_arr['trainID'];\n\n\t\t\t\t\techo $trainID;\n\t\t\t\t\techo \"has has its schedule 2 set.\";\n\n\t\t\t\t\t$update = \"UPDATE train SET `entryt`= '$entryt', \n\t \t\t\t`vacatet`='$vacatet' WHERE trainID = '$trainID' \"; \n\n\t \t\t\t\tmysql_query($update); \t \n\n\t \t\t\t\t\t$remove = \"UPDATE train SET `entryt2`= '0000-00-00 00:00:00', \n\t \t\t\t\t\t`vacatet2`='0000-00-00 00:00:00' WHERE trainID = '$trainID' \"; \n\n\t \t\t\t\t\tmysql_query($remove); \t\n\n\t \t\t\t\t\t// pass id to function that resets the sandbox and checkedat fields. \n\n\t \t\t\t\t\treset_sandbox_data($trainID); \n\t\t\t}\n\t\t}\t\n}",
"function assignShift($userid, $shiftid)\n{\n $db = DB::getInstance();\n //assign the shift\n $query1 = $db->query(\"UPDATE sage_shifts SET user_id = '$userid' WHERE id = '$shiftid'\");\n}",
"public function update() {\n\n // Does the course object have an ID?\n if ( is_null( $this->courseId ) ) trigger_error ( \"Course::update(): Attempt to update Course object that does not have its ID property set.\", E_USER_ERROR );\n\n // Update the course\n $conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );\n $sql = \"UPDATE course SET courseCode=:courseCode, courseName=:courseName, description=:description, headTeacher=:headTeacher WHERE courseId = :courseId\";\n $st = $conn->prepare ( $sql );\n $st->bindValue( \":courseCode\", $this->courseCode, PDO::PARAM_INT );\n $st->bindValue( \":courseName\", $this->courseName, PDO::PARAM_INT );\n $st->bindValue( \":description\", $this->description, PDO::PARAM_STR );\n $st->bindValue( \":headTeacher\", $this->headTeacher, PDO::PARAM_STR );\n\n//\n $st->bindValue( \":courseId\", $this->courseId, PDO::PARAM_INT );\n $st->execute();\n $conn = null;\n }",
"function populateActSchedule(){\n global $con;\n global $pidArray;\n global $days;\n global $hours;\n global $openHours;\n global $preferences;\n global $tutorInfo;\n global $hoursWorking;\n global $hoursWorkingPerDay;\n global $sasbSchedule;\n global $glSchedule;\n\n // delete all previously existing rows\n $sql=\"delete from actSchedule\";\n if(mysqli_query($con,$sql)){\n }\n\n // initialize rows for every tutor\n foreach($pidArray as $thePid){\n // only initialize for grad and ugrad tutors\n if(($tutorInfo[$thePid][\"type\"] == \"grad\") or ($tutorInfo[$thePid][\"type\"] == \"ugrad\")){\n foreach($days as $theDay){\n $sql=\"insert into actSchedule (PID,day,h00,h01,h02,h03,h04,h05,h06,h07,h08,h09,h10,h11,h12,h13,h14,h15,h16,h17,h18,h19,h20,h21,h22,h23) \n values('$thePid','$theDay',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)\";\n if(mysqli_query($con,$sql)){\n }\n }\n }\n }\n\n // update rows based on sasbSchedule\n foreach($days as $theDay){\n foreach($hours as $theHour){\n // only bother scheduling if the writing centers are open\n if($openHours[$theDay][$theHour] == 1){\n foreach($pidArray as $thePid){\n // only look at pids who are ugrad or grad tutors, not admins\n if(($tutorInfo[$thePid][\"type\"] == \"grad\") or ($tutorInfo[$thePid][\"type\"] == \"ugrad\")){\n $tuple=$sasbSchedule[$theDay][$theHour][\"tuples\"][$thePid];\n if($tuple != NULL){ // if tuple exists, tutor is scheduled this hour\n $sql=\"update actSchedule set $theHour=1\n where PID='$thePid' and day='$theDay'\";\n if(mysqli_query($con,$sql)){\n }\n else{\n echo \"Error: \" . mysqli_error($con) . \"<br>\";\n }\n }\n }\n }\n }\n }\n }\n\n foreach($days as $theDay){\n foreach($hours as $theHour){\n // only bother scheduling if the writing centers are open\n if($openHours[$theDay][$theHour] == 1){\n foreach($pidArray as $thePid){\n // only look at pids who are ugrad or grad tutors, not admins\n if(($tutorInfo[$thePid][\"type\"] == \"grad\") or ($tutorInfo[$thePid][\"type\"] == \"ugrad\")){\n $tuple=$glSchedule[$theDay][$theHour][\"tuples\"][$thePid];\n if($tuple != NULL){ // if tuple exists, tutor is scheduled this hour\n $sql=\"update actSchedule set $theHour=2\n where PID='$thePid' and day='$theDay'\";\n if(mysqli_query($con,$sql)){\n }\n else{\n echo \"Error: \" . mysqli_error($con) . \"<br>\";\n }\n }\n }\n }\n }\n }\n }\n}",
"function remove_from_schedule($id) {\n $id = mysqli_real_escape_string($this->connection, $id); \n return $this->query(\"UPDATE class SET room_id=0 WHERE class.id='$id'\");\n }",
"function setScheduleId($a_schedule_id)\n\t{\n\t\t$this->schedule_id = (int)$a_schedule_id;\n\t}",
"function update_classroom($classroom_id,$params)\n {\n $this->db->where('classroom_id',$classroom_id);\n return $this->db->update('classroom',$params);\n }",
"function editAuditSchedule($auditSchedule) {\n\n //$this->perm_desc = $_POST['auditSchedule_desc'];\n\n // $modifieddate = date(\"d-m-Y H:i:s\");\n $modifiedby_id = $_SESSION[\"loggedid\"];\n\n $query = \"UPDATE audit_schedule SET from_date='$auditSchedule->from_date',scp_number='$auditSchedule->scp_number',dept_id='$auditSchedule->dept_id',section_id='$auditSchedule->section_id',unit_id='$auditSchedule->unit_id',to_date='$auditSchedule->to_date',\n \t\t\tmodifiedby_id='$modifiedby_id' WHERE id=\" . \"'$auditSchedule->id'\";\n mysqli_query($this->plink, $query);\n // close connection\n // mysqli_close($this->plink);\n $url = \"../view/auditScheduleList.php\";\n\n redirect($url);\n }",
"public function testUpdateValidSchedule() {\n\t\t$numRows = $this->getConnection()->getRowCount(\"schedule\");\n\n\t\t$schedule = new Schedule(null, $this->company->getCompanyId(), $this->VALID_SCHEDULEDAYOFWEEK1, $this->VALID_SCHEDULEENDTIME1, $this->VALID_SCHEDULELOCATIONADDRESS1, $this->VALID_SCHEDULELOCATIONNAME1, $this->VALID_SCHEDULESTARTTIME1);\n\n\t\t$schedule->insert($this->getPDO());\n\n\t\t//edit the info for the schedule object...se we can see if it changes properly\n\n\t\t$schedule->setScheduleDayOfWeek($this->VALID_SCHEDULEDAYOFWEEK2);\n\t\t$schedule->setScheduleEndTime($this->VALID_SCHEDULEENDTIME2);\n\t\t$schedule->setScheduleLocationAddress($this->VALID_SCHEDULELOCATIONADDRESS2);\n\t\t$schedule->setScheduleLocationName($this->VALID_SCHEDULELOCATIONNAME2);\n\t\t$schedule->setScheduleStartTime($this->VALID_SCHEDULESTARTTIME2);\n\n\t\t$schedule->update($this->getPDO());\n\n\t\t$pdoSchedule = Schedule::getScheduleByScheduleId($this->getPDO(), $schedule->getScheduleId());\n\n\t\t//Make sure there is a row in there and run the 2nd set of information\n\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"schedule\"));\n\n\t\t$this->assertEquals($pdoSchedule->getScheduleDayOfWeek(), $this->VALID_SCHEDULEDAYOFWEEK2);\n\t\t$this->assertEquals($pdoSchedule->getScheduleEndTime(), $this->VALID_SCHEDULEENDTIME2);\n\t\t$this->assertEquals($pdoSchedule->getScheduleLocationAddress(), $this->VALID_SCHEDULELOCATIONADDRESS2);\n\t\t$this->assertEquals($pdoSchedule->getScheduleLocationName(), $this->VALID_SCHEDULELOCATIONNAME2);\n\t\t$this->assertEquals($pdoSchedule->getScheduleStartTime(), $this->VALID_SCHEDULESTARTTIME2);\n\n\t}",
"function newSchedule($lotid, $pid, $starttime, $endtime){\r\n\tinclude 'config.php';\r\n\t$sql = \"INSERT INTO `schedule`(`ScheduleID`, `LotID`, `PermitID`, `StartTime`, `EndTime`) \r\n\tVALUES (NULL ,'$lotid', '$pid', '$starttime', '$endtime')\";\r\n\tif ($mysqli->query($sql)==true){\r\n\t\techo \"Successfully added: \" . mysqli_affected_rows($mysqli);\r\n\t}\r\n\telse{\r\n\techo(\"Error description: \" . mysqli_error($mysqli));\r\n\thttp_response_code(400);\r\n\t}\r\n}",
"function updateCourse(Course $course)\n {\n try\n {\n $dbObj = new Database();\n $db = $dbObj->getConnection();\n $result = $this->checkDuplicateCourseForTerm($course);\n if($result == FALSE):\n $db->beginTransaction();\n $query = \"Update Courses \"\n . \"SET CourseTitle=:cTitle, CourseNumber=:cNumber, \"\n . \"CourseSection=:cSection, Term=:term, \"\n . \"Description =:desc, Closed=:closed, \"\n . \"EnrollmentTotal=:enrollment, \"\n . \"AdminID= :aID, TeacherID=:tID , \"\n . \"CloseDate= :close \"\n . \"WHERE CourseID=:cID;\";\n $statement = $db->prepare($query);\n\n $statement->bindValue(':cTitle', $course->courseTitle, PDO::PARAM_STR);\n $statement->bindValue(':cNumber', $course->courseNumber, PDO::PARAM_INT);\n $statement->bindValue(':cSection', $course->courseSection, PDO::PARAM_INT);\n $statement->bindValue(':term', $course->term, PDO::PARAM_STR);\n $statement->bindValue(':desc', $course->description, PDO::PARAM_STR);\n $statement->bindValue(':closed', $course->closed, PDO::PARAM_BOOL);\n $statement->bindValue(':enrollment', $course->enrollment, PDO::PARAM_INT);\n $statement->bindValue(':aID', $course->adminID, PDO::PARAM_INT);\n $statement->bindValue(':tID', $course->teacherID, PDO::PARAM_INT);\n $statement->bindValue(':close', $course->closeDate, PDO::PARAM_STR);\n $statement->bindValue(':cID', $course->courseID, PDO::PARAM_INT);\n $statement->execute();\n $count = $statement->rowCount();\n $statement->closeCursor();\n\n if ($count == 1):\n $db->commit();\n return \"Course updated\";\n elseif($count != 0):\n $db->rollBack();\n throw new PDOException;\n endif;\n else:\n return \"Course already exists\";\n endif;\n } catch (PDOException $e)\n { \n //$error_message = $e->getMessage();\n //error_log($error_message, (int)0,\"./error.txt\");\n\n return \"Course not updated\";\n }\n }",
"function update_classroom($id,$params)\n {\n $this->db->where('id',$id);\n return $this->db->update('classrooms',$params);\n }",
"public function testUpdateInvalidSchedule() {\n\t\t// create a Schedule with a non null schedule id and watch it fail\n\t\t$schedule = new Schedule(null, $this->crew->getCrewId(), $this->VALID_SCHEDULESTARTDATE);\n\t\t$schedule->update($this->getPDO());\n\t}",
"public static function updateSchedule($id)\n {\n $team = Team::findOrFail($id);\n $users = $team->users();\n $game = $team->game()->first();\n \n $arSchedules = ScheduleHelper::getCrossingSchedule($users->get());\n $blockSchedules = ScheduleHelper::getCrossingBlocks($arSchedules, $game->cross_block);\n\n //send notify captain none crossing schedule\n if(count($blockSchedules)==0)\n {\n \n }\n \n $team->update([\n 'schedule' => $blockSchedules\n ]);\n }",
"function updateOrder($orderid,$classid,$courseid,$sid,$bankbranch,$status,$CRDate,$paymentdate){\r\n\trequire 'dbConnect.php';\r\n\t// Turn off autocommit, in order to make every query run successfully\r\n\tmysqli_autocommit($conn,FALSE);\r\n\t\r\n\tif($status == 'Approved'){\r\n\t\t$updatesql = 'UPDATE orders set Status = \"Approved\", BankBranch = \"'.$bankbranch.'\", PaymentDate = \"'.$paymentdate.'\"\r\n\t\t\t\t WHERE OrderID = '.$orderid.';';\r\n\t\t$updateresult = mysqli_query($conn, $updatesql);\r\n\t\t\r\n\t\t// Once approved, then insert into class reservation\r\n\t\tif($updateresult){\r\n\t\t\t// Check whether class reservation inserted\r\n\t\t\t$sqlcr = 'SELECT * FROM ClassReservation\r\n\t\t\t\t\tWHERE CourseID = '.$courseid.' AND ClassID = '.$classid.' AND SID = '.$sid.' AND CRDate = \"'.$CRDate.'\";';\r\n\t\t\t$resultcr = mysqli_query($conn, $sqlcr);\r\n\t\t\t\r\n\t\t\tif(!mysqli_num_rows($resultcr)>0){\r\n\t\t\t\t\r\n\t\t\t\t// Select course query to check how many session\r\n\t\t\t\t$sql = 'SELECT * FROM Course\r\n\t\t\t\t\t\tWHERE CourseID = '.$courseid.';';\r\n\t\t\t\t$result = mysqli_query($conn, $sql);\r\n\t\t\t\t$row = mysqli_fetch_assoc($result);\r\n\t\t\t\t\r\n\t\t\t\t$insertsql = 'INSERT INTO ClassReservation (ClassID, CourseID, SID, CRDate) VALUES ';\r\n\t\t\t\t// For loop - the number of inserting the class reservation is depend on the session (How many days for this training session)\r\n\t\t\t\tfor ($x = 1; $x <= $row['Session']; $x++) {\r\n\t\t\t\t\t$insertsql .= '('.$classid.', '.$courseid.', '.$sid.', \"'.$CRDate.'\")';\r\n\t\t\t\t\tif($x < ($row['Session'])){\r\n\t\t\t\t\t\t$CRDate = date('m/d/Y',strtotime($CRDate . \"+1 days\"));\r\n\t\t\t\t\t\t$insertsql .=\",\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$insert = mysqli_query($conn, $insertsql);\r\n\t\t\t\t\r\n\t\t\t\tif($insert){ // Insert Session Success!\r\n\t\t\t\t\tmysqli_commit($conn);\r\n\t\t\t\t\t$sql= 'SELECT Student.SEmail, Course.CourseName, Course.CoursePrice\r\n\t\t\t\t\tFROM ClassReservation\r\n\t\t\t\t\tINNER JOIN Student ON ClassReservation.SID = Student.SID\r\n\t\t\t\t\tINNER JOIN Classroom ON ClassReservation.ClassID = Classroom.ClassID\r\n\t\t\t\t\tINNER JOIN Course ON ClassReservation.CourseID = Course.CourseID\r\n\t\t\t\t\tWHERE ClassReservation.CourseID = '.$courseid.' AND ClassReservation.ClassID = '.$classid.' AND ClassReservation.SID = '.$sid.' AND ClassReservation.CRDate = \"'.$CRDate.'\";';\r\n\t\t\t\t\t$result = mysqli_query($conn, $sql);\r\n\t\t\t\t\t$row = mysqli_fetch_assoc($result);\r\n\t\t\t\t\t\r\n\t\t\t\t\t$coursename = $row['CourseName'];\r\n\t\t\t\t\t$price = $row['CoursePrice'];\r\n\t\t\t\t\t$todaydate = date('Y-m-d');\r\n\t\t\t\t\t$email = $row['SEmail'];\r\n\t\t\t\t\t\r\n\t\t\t\t\t$message = '<div class=\"alert alert-success\">\r\n\t\t\t\t\t\t\t\t Update successfully with insert student record into session - Approved\r\n\t\t\t\t\t\t\t\t</div>';\r\n\t\t\t\t\t$message .=\tsendreceiptmail($coursename,$price,$orderid,$todaydate,$email,$paymentdate);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tmysqli_rollback($conn);\r\n\t\t\t\t\t$message = '<div class=\"alert alert-danger\">\r\n\t\t\t\t\t\t\t\t Unable to insert student record into session. Please contact admin immediately!\r\n\t\t\t\t\t\t\t\t</div>';\t\r\n\t\t\t\t} // Insert Session Failed!\r\n\t\t\t}else{\r\n\t\t\t\tmysqli_commit($conn);\r\n\t\t\t\t$message = '<div class=\"alert alert-success\">\r\n\t\t\t\t\t\t\t\tUpdate successfully without insert student record into session (The student has been added into the session) - Approved\r\n\t\t\t\t\t\t\t</div>';\r\n\t\t\t} // Updated success without insert session of student\r\n\t\t}else{\r\n\t\t\tmysqli_rollback($conn);\r\n\t\t\t$message = '<div class=\"alert alert-danger\">\r\n\t\t\t\t\t\t Update Order Status Failed! Contact admin immediately! - Approved\r\n\t\t\t\t\t\t</div>';\r\n\t\t} // Failed to update the order\r\n\t// When admin selected pending, proceed this function\r\n\t}elseif($status == 'Pending'){\r\n\t\t$updatesql = 'UPDATE orders set Status = \"Pending\", BankBranch = \"'.$bankbranch.'\"\r\n\t\t\t\t\t WHERE OrderID = '.$orderid.';';\r\n\t\t$updateresult = mysqli_query($conn, $updatesql);\r\n\t\t\r\n\t\tif($updateresult){\r\n\t\t\t// Check whether class reservation inserted\r\n\t\t\t$sqlcr = 'SELECT * FROM ClassReservation\r\n\t\t\t\t\tWHERE CourseID = '.$courseid.' AND ClassID = '.$classid.' AND SID = '.$sid.' AND CRDate = \"'.$CRDate.'\";';\r\n\t\t\t$resultcr = mysqli_query($conn, $sqlcr);\r\n\t\r\n\t\t\tif(mysqli_num_rows($resultcr)>0){\r\n\t\t\t\t\r\n\t\t\t\t// Select course query to check how many session\r\n\t\t\t\t$sql = 'SELECT Session FROM Course\r\n\t\t\t\t\t\tWHERE CourseID = '.$courseid.';';\r\n\t\t\t\t$result = mysqli_query($conn, $sql);\r\n\t\t\t\t$row = mysqli_fetch_assoc($result);\r\n\t\t\t\t\r\n\t\t\t\t// For loop - the number of deleting the class reservation is depend on the session (How many days for this training session)\r\n\t\t\t\t$deletesql = 'DELETE FROM ClassReservation\r\n\t\t\t\tWHERE (ClassID, CourseID, SID, CRDate) IN (';\r\n\t\t\t\tfor ($x = 1; $x <= $row['Session']; $x++) {\r\n\t\t\t\t\t// if row exist then delete class reservation\r\n\t\t\t\t\t$deletesql .= '('.$classid.', '.$courseid.', '.$sid.', \"'.$CRDate.'\")';\r\n\t\t\t\t\tif($x < ($row['Session'])){\r\n\t\t\t\t\t\t$CRDate = date('m/d/Y',strtotime($CRDate . \"+1 days\"));\r\n\t\t\t\t\t\t$deletesql .=\",\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$deletesql .= ')';\r\n\t\t\t\t$delete = mysqli_query($conn, $deletesql);\r\n\t\t\t\tif($delete){ // Success Delete\r\n\t\t\t\t\tmysqli_commit($conn);\r\n\t\t\t\t\t$message = '<div class=\"alert alert-success\">\r\n\t\t\t\t\t\t\t\t Update Successfully - Deleted student record from session - Pending\r\n\t\t\t\t\t\t\t\t</div>';\r\n\t\t\t\t}else{\r\n\t\t\t\t\tmysqli_rollback($conn);\r\n\t\t\t\t\t$message = '<div class=\"alert alert-success\">\r\n\t\t\t\t\t\t\t\t Failed to process, as it unable to delete student record from session . Please contact admin immediately!\r\n\t\t\t\t\t\t\t\t</div>';\r\n\t\t\t\t} // Failed to delete the session of student.\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tmysqli_commit($conn);\r\n\t\t\t\t$message = '<div class=\"alert alert-success\">\r\n\t\t\t\t\t\t\t\tUpdate successfully without delete student record from session (The student has been deleted from session) - Pending\r\n\t\t\t\t\t\t\t</div>';\r\n\t\t\t} // Update success without delete student's session\r\n\t\t}else{\r\n\t\t\tmysqli_rollback($conn);\r\n\t\t\t$message = '<div class=\"alert alert-success\">\r\n\t\t\t\t\t\t Failed to update to pending. Please contact admin immediately!\r\n\t\t\t\t\t\t</div>';\r\n\t\t} // Failed to update the order\r\n\t}elseif($status == 'Cancel'){\r\n\t// Delete selected record from class reservation\r\n\t$deletesql = 'DELETE FROM Orders\r\n\t\t\t\t WHERE OrderID = '.$orderid.';';\r\n\t$deleteresult = mysqli_query($conn, $deletesql);\r\n\t\tif($deleteresult){\r\n\t\t\t// Update Classroom slot - Minus - 1\r\n\t\t\t$updatesql = 'UPDATE Classroom\r\n\t\t\t\t\t\tSET Slot = Slot - 1\r\n\t\t\t\t\t\tWHERE ClassID = '.$classid.';';\r\n\t\t\t$update = mysqli_query($conn, $updatesql);\r\n\t\t\t\r\n\t\t\tif($update){\t\t\t\t\r\n\t\t\t\t// Check whether class reservation inserted\r\n\t\t\t\t$sqlcr = 'SELECT * FROM ClassReservation\r\n\t\t\t\t\t\tWHERE CourseID = '.$courseid.' AND ClassID = '.$classid.' AND SID = '.$sid.' AND CRDate = \"'.$CRDate.'\";';\r\n\t\t\t\t$resultcr = mysqli_query($conn, $sqlcr);\r\n\t\t\r\n\t\t\t\tif(mysqli_num_rows($resultcr)>0){\r\n\t\t\t\t\t// Select course query to check how many session\r\n\t\t\t\t\t$sql = 'SELECT Session FROM Course\r\n\t\t\t\t\t\t\tWHERE CourseID = '.$courseid.';';\r\n\t\t\t\t\t$result = mysqli_query($conn, $sql);\r\n\t\t\t\t\t$row = mysqli_fetch_assoc($result);\r\n\t\t\t\t\t\r\n\t\t\t\t\t// For loop - the number of deleting the class reservation is depend on the session (How many days for this training session)\r\n\t\t\t\t\t$deletesql = 'DELETE FROM ClassReservation\r\n\t\t\t\t\tWHERE (ClassID, CourseID, SID, CRDate) IN (';\r\n\t\t\t\t\tfor ($x = 1; $x <= $row['Session']; $x++) {\r\n\t\t\t\t\t\t// if row exist then delete class reservation\r\n\t\t\t\t\t\t$deletesql .= '('.$classid.', '.$courseid.', '.$sid.', \"'.$CRDate.'\")';\r\n\t\t\t\t\t\tif($x < ($row['Session'])){\r\n\t\t\t\t\t\t\t$CRDate = date('m/d/Y',strtotime($CRDate . \"+1 days\"));\r\n\t\t\t\t\t\t\t$deletesql .=\",\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$deletesql .= ')';\r\n\t\t\t\t\t$delete = mysqli_query($conn, $deletesql);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif($delete){\r\n\t\t\t\t\t\t// Success Delete\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tmysqli_rollback($conn);\r\n\t\t\t\t\t\t$message = '<div class=\"alert alert-danger\">\r\n\t\t\t\t\t\t\t\t\t Failed to delete student session, as it unable to delete student record from session. Please contact admin immediately!\r\n\t\t\t\t\t\t\t\t\t</div>';\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\t// Success Update, but don't have class reservation in this particular order.\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// Wait List\r\n\t\t\t\t$sqlclass = 'SELECT * FROM Classroom\r\n\t\t\t\t\t\t\tWHERE ClassID = '.$classid.';';\r\n\t\t\t\t$resultclass = mysqli_query($conn, $sqlclass);\r\n\t\t\t\t$rowclass = mysqli_fetch_assoc($resultclass);\r\n\t\t\t\tif($rowclass['Capacity'] > $rowclass['Slot']){\t\r\n\t\t\t\t\t$sqlwl = 'SELECT WLID, Student.SID, Classroom.ClassID, Course.CourseID, Course.CoursePrice\r\n\t\t\t\t\t\t\tFROM waitinglist\r\n\t\t\t\t\t\t\tINNER JOIN Student ON waitinglist.SID = Student.SID\r\n\t\t\t\t\t\t\tINNER JOIN Classroom ON waitinglist.ClassID = Classroom.ClassID\r\n\t\t\t\t\t\t\tINNER JOIN Course ON waitinglist.CourseID = Course.CourseID\r\n\t\t\t\t\t\t\tWHERE Classroom.ClassID = '.$classid.' LIMIT 1;';\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t$resultwl = mysqli_query($conn, $sqlwl);\r\n\t\t\t\t\t// To check is there any waiting list record\r\n\t\t\t\t\tif(mysqli_num_rows($resultwl) > 0){\t\r\n\t\t\t\t\t$rowwl = mysqli_fetch_assoc($resultwl);\r\n\t\t\t\t\t$today = date(\"m/d/Y\");\r\n\t\t\t\t\t$insertsql = 'INSERT INTO Orders (SID, ClassID, CourseID, Price, Status, BankBranch, OrderDate) \r\n\t\t\t\t\tVALUES ('.$rowwl['SID'].', '.$rowwl['ClassID'].', '.$rowwl['CourseID'].', \"'.$rowwl['CoursePrice'].'\", \"Pending\", \"Maybank\", \"'.$today.'\")';\r\n\t\t\t\t\t$insert = mysqli_query($conn, $insertsql);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tif($insert){\r\n\t\t\t\t\t\t\t// Update Classroom slot - Plus 1\r\n\t\t\t\t\t\t\t$updatesql = 'UPDATE Classroom\r\n\t\t\t\t\t\t\t\t\t\tSET Slot = Slot + 1\r\n\t\t\t\t\t\t\t\t\t\tWHERE ClassID = '.$classid.';';\r\n\t\t\t\t\t\t\t$update = mysqli_query($conn, $updatesql);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif($update){ // Update classroom success\r\n\t\t\t\t\t\t\t\t$deletesql = 'DELETE FROM Waitinglist\r\n\t\t\t\t\t\t\t\t\t\tWHERE WLID = '.$rowwl['WLID'].';';\r\n\t\t\t\t\t\t\t\t$delete = mysqli_query($conn, $deletesql);\r\n\t\t\t\t\t\t\t\tif($delete){\r\n\t\t\t\t\t\t\t\t\tmysqli_commit($conn);\r\n\t\t\t\t\t\t\t\t\t$message = (\"<script LANGUAGE='JavaScript'>\r\n\t\t\t\t\t\t\t\t\t\t\twindow.alert('Succesfully cancelled the order! Successfully proceed the waiting list.');\r\n\t\t\t\t\t\t\t\t\t\t\twindow.location ='./vieworder.php';\r\n\t\t\t\t\t\t\t\t\t\t\t</script>\");\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tmysqli_rollback($conn);\r\n\t\t\t\t\t\t\t\t$message = '<div class=\"alert alert-danger\">\r\n\t\t\t\t\t\t\t\t\t\t\t Cancel Order Failed! Contact admin immediately! - Failed to proceed waiting list - (Update Classroom).\r\n\t\t\t\t\t\t\t\t\t\t\t</div>';\r\n\t\t\t\t\t\t\t}//Failed to update classroom\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tmysqli_rollback($conn);\r\n\t\t\t\t\t\t\t$message = '<div class=\"alert alert-danger\">\r\n\t\t\t\t\t\t\t\t\t\t Cancel Order Failed! Contact admin immediately! - Failed to proceed waiting list - (Insert Order).\r\n\t\t\t\t\t\t\t\t\t\t</div>';\r\n\t\t\t\t\t\t}//Failed to insert order\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tmysqli_commit($conn);\r\n\t\t\t\t\t\t$message = (\"<script LANGUAGE='JavaScript'>\r\n\t\t\t\t\t\t\t\twindow.alert('Succesfully cancelled the order! No waiting list record for this session.');\r\n\t\t\t\t\t\t\t\twindow.location ='./vieworder.php';\r\n\t\t\t\t\t\t\t\t</script>\");\r\n\t\t\t\t\t}//No Wait List record\r\n\t\t\t\t}else{\r\n\t\t\t\t\tmysqli_commit($conn);\r\n\t\t\t\t\t$message = (\"<script LANGUAGE='JavaScript'>\r\n\t\t\t\t\t\t\twindow.alert('Succesfully cancelled the order! Session is still unavailable');\r\n\t\t\t\t\t\t\twindow.location ='./vieworder.php';\r\n\t\t\t\t\t\t\t</script>\");\r\n\t\t\t\t}//Class is still unavailable\r\n\t\t\t}else{\r\n\t\t\t\tmysqli_rollback($conn);\r\n\t\t\t\t$message = '<div class=\"alert alert-danger\">\r\n\t\t\t\t\t\t\t Cancel Order Failed! Contact admin immediately! - Failed to update classroom capacity.\r\n\t\t\t\t\t\t\t</div>';\r\n\t\t\t}//Update classroom failed\r\n\t\t}else{\r\n\t\t\tmysqli_rollback($conn);\r\n\t\t\t$message = '<div class=\"alert alert-danger\">\r\n\t\t\t\t\t\t Cancel Order Failed! Contact admin immediately! - Delete Order.\r\n\t\t\t\t\t\t</div>';\r\n\t\t}// Failed to delete order\r\n\t}\r\n\t\t\t\r\n\treturn $message;\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function that returns meta array for give attachment url | function mkdf_tours_get_attachment_meta_from_url($attachment_url, $keys = array()) {
$attachment_meta = array();
//get attachment id for attachment url
$attachment_id = mkdf_tours_get_attachment_id_from_url($attachment_url);
//is attachment id set?
if(!empty($attachment_id)) {
//get post meta
$attachment_meta = mkdf_tours_get_attachment_meta($attachment_id, $keys);
}
//return post meta
return $attachment_meta;
} | [
"function affinity_mikado_get_attachment_meta_from_url($attachment_url, $keys = array()) {\n\t\t$attachment_meta = array();\n\n\t\t//get attachment id for attachment url\n\t\t$attachment_id = affinity_mikado_get_attachment_id_from_url($attachment_url);\n\n\t\t//is attachment id set?\n\t\tif (!empty($attachment_id)) {\n\t\t\t//get post meta\n\t\t\t$attachment_meta = affinity_mikado_get_attachment_meta($attachment_id, $keys);\n\t\t}\n\n\t\t//return post meta\n\t\treturn $attachment_meta;\n\t}",
"function biagiotti_mikado_get_attachment_meta_from_url( $attachment_url, $keys = array() ) {\n\t\t$attachment_meta = array();\n\t\t\n\t\t//get attachment id for attachment url\n\t\t$attachment_id = biagiotti_mikado_get_attachment_id_from_url( $attachment_url );\n\n\t\t//is attachment id set?\n\t\tif ( ! empty( $attachment_id ) ) {\n\t\t\t//get post meta\n\t\t\t$attachment_meta = biagiotti_mikado_get_attachment_meta( $attachment_id, $keys );\n\t\t\t$attachment_meta['attachment_id'] = $attachment_id;\n\t\t}\n\t\t\n\t\t//return post meta\n\t\treturn $attachment_meta;\n\t}",
"function fetchMeta($url = '')\n{\n if (!$url) return false;\n\n // check whether we have http at the zero position of the string\n if (strpos($url, 'http://') !== 0 && strpos($url, 'https://') !== 0) $url = 'http://' . $url; \n\n $fp = @fopen( $url, 'r' );\n\n if (!$fp) return false;\n\n $content = '';\n\n while( !feof( $fp ) ) {\n $buffer = trim( fgets( $fp, 4096 ) );\n $content .= $buffer;\n }\n\n $start = '<title>';\n $end = '<\\/title>';\n\n preg_match( \"/$start(.*)$end/s\", $content, $match );\n $title = isset($match) ? $match[1] : ''; \n\n $metatagarray = get_meta_tags( $url );\n\n $keywords = isset($metatagarray[ \"keywords\" ]) ? $metatagarray[ \"keywords\" ] : '';\n $description = isset($metatagarray[ \"description\" ]) ? $metatagarray[ \"description\" ] : '';\n\n return array('title' => $title, 'keywords' => $keywords, 'description' => $description);\n}",
"function image_url_meta() {\r\n global $post;\r\n $args = array(\r\n 'post_type' => 'attachment',\r\n 'numberposts' => -1,\r\n 'post_mime_type' => 'image',\r\n 'post_status' => null,\r\n 'post_parent' => $post->ID\r\n );\r\n $attachments = get_posts($args);\r\n if ($attachments) {\r\n foreach ( $attachments as $attachment ) {\r\n echo '<meta itemprop=\"image\" content=\"' . $attachment->guid . '\">';\r\n }\r\n } else {\r\n echo '<meta itemprop=\"image\" content=\"' . get_first_image() . '\">';\r\n }\r\n }",
"function emr_get_file_urls( $guid, $metadata ) {\n\t$urls = array();\n\n\t$guid = emr_remove_scheme( $guid );\n\t$guid= emr_remove_domain_from_filename($guid);\n\n\t$urls['guid'] = $guid;\n\n\tif ( empty( $metadata ) ) {\n\t\treturn $urls;\n\t}\n\n\t$base_url = dirname( $guid );\n\n\tif ( ! empty( $metadata['file'] ) ) {\n\t\t$urls['file'] = trailingslashit( $base_url ) . wp_basename( $metadata['file'] );\n\t}\n\n\tif ( ! empty( $metadata['sizes'] ) ) {\n\t\tforeach ( $metadata['sizes'] as $key => $value ) {\n\t\t\t$urls[ $key ] = trailingslashit( $base_url ) . wp_basename( $value['file'] );\n\t\t}\n\t}\n\n\treturn $urls;\n}",
"private function extract_metadata ()\n {\n $slug = $this->get_slug ();\n $page_id = $this->get_page_id ();\n\n if ($page_id === false) {\n return array (\n 2,\n sprintf (__ ('Error while extracting metadata: no page with slug %s.', 'capitularia'), $slug)\n );\n }\n // We proxy this action to the Meta Search plugin.\n $errors = apply_filters ('cap_meta_search_extract_metadata', array (), $page_id, $this->path);\n if ($errors) {\n return array (\n 2,\n sprintf (\n __ ('Errors while extracting metadata from file %s.', 'capitularia'),\n $this->get_slug_with_link ()\n ),\n $errors\n );\n }\n return array (\n 0,\n sprintf (__ ('Metadata extracted from file %s.', 'capitularia'), $this->get_slug_with_link ())\n );\n }",
"function acf_get_attachment($attachment) {}",
"function HTML_URL_metadata($file_path) {\n $image_info = array();\n $ext = get_file_extension($file_path);\n $image_info['guid'] = get_guid();\n $image_info['name'] = basename($file_path, \".\".$ext);\n $image_info['type'] = get_file_extension($file_path);\n $image_info['size'] = remote_filesize($file_path);\n $image_info['timeCreated'] = remote_time($file_path);\n $image_info['timeEntered'] = time();\n $image_info['path'] = $file_path;\n\n return $image_info;\n}",
"public function get_meta_as_array()\r\n\t{\r\n\t\tif(!$this->loaded()) return;\r\n\t\t$vid_meta_res = $this->meta->find_all();\r\n\r\n\t\t$retArr = array();\r\n\r\n\t\tforeach($vid_meta_res as $data)\r\n\t\t{\r\n\t\t\tif ($data->vid_val != \"\" && $data->vid_val != null)\r\n\t\t\t{\r\n\t\t\t\tif($data->vid_prop=='url') $retArr['url_streaming'] = Util::get_cdn($data->vid_val,true);\r\n\t\t\t\t$retArr[$data->vid_prop] = $data->vid_val;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $retArr;\r\n\t}",
"function get_social_media_links(){\n \n $social_array = get_transient_array('social_media_links', 'fetch_social_media_links', 'auto');\n \n return $social_array;\n \n}",
"public function getLinkingMetadata(): array;",
"function newrelic_get_linking_metadata(): array {}",
"function image_URL_metadata($file_path) {\n $image_info = array();\n $ext = get_file_extension($file_path);\n $image_info['guid'] = get_guid();\n $image_info['name'] = basename($file_path, \".\".$ext);\n $image_info['type'] = get_file_extension($file_path);\n $image_info['width'] = getimagesize($file_path)[0];\n $image_info['height'] = getimagesize($file_path)[1];\n $image_info['size'] = remote_filesize($file_path);\n $image_info['timeCreated'] = remote_time($file_path);\n $image_info['timeEntered'] = time();\n $image_info['path'] = $file_path;\n\n return $image_info;\n}",
"abstract protected function getHypermedia();",
"function get_imported_attachments() {\n\t\tglobal $wpdb;\n\n\t\t$hashtable = array ();\n\n\t\t// Get all vox attachments\n\t\t$sql = $wpdb->prepare( \"SELECT post_id, meta_value FROM $wpdb->postmeta WHERE meta_key = '%s'\", 'vox_attachment' );\n\t\t$results = $wpdb->get_results( $sql );\n\n\t\tif (! empty( $results )) {\n\t\t\tforeach ( $results as $r ) {\n\t\t\t\t// Set permalinks into array\n\t\t\t\t$hashtable[$r->meta_value] = (int) $r->post_id;\n\t\t\t}\n\t\t}\n\n\t\t// unset to save memory\n\t\tunset( $results, $r );\n\n\t\treturn $hashtable;\n\t}",
"public function get_attachment_media_slide() {\n\n\t\tglobal $socialflow;\n\t\t$socialflow_params = filter_input_array( INPUT_POST );\n\t\t$social_id = isset( $socialflow_params['social_id'] ) ? $socialflow_params['social_id'] : 0;\n\t\t$media = [];\n\t\tif ( $social_id ) {\n\t\t\t$media[ $social_id ] = $this->get_media( $social_id );\n\t\t} else {\n\t\t\t$media ['twitter'] = $this->get_media( 'twitter' );\n\t\t\t$media['facebook'] = $this->get_media( 'facebook' );\n\t\t\t$media['google_plus'] = $this->get_media( 'google_plus' );\n\t\t}\n\n\t\tforeach ( $media as $items ) {\n\t\t\tforeach ( $items as $item ) {\n\t\t\t\tif ( $item && ! is_wp_error( $item ) ) {\n\t\t\t\t\treturn $media;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$image = wp_get_attachment_image_src( $this->post->ID, 'full' );\n\t\tif ( ! $image ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$media = $socialflow->get_api()->add_media( $socialflow->get_output_image_url( $image[0] ) );\n\t\t// test localhost data.\n\t\tif ( $socialflow->is_localhost() ) {\n\t\t\treturn array(\n\t\t\t\t'medium_thumbnail_url' => 'https://s3.amazonaws.com/socialflow-image-upload-thumbs/med_385-b4f71e5a62ff898dfcede2d026f6da1e.jpg',\n\t\t\t\t'filename' => '385-b4f71e5a62ff898dfcede2d026f6da1e.jpg',\n\t\t\t\t'fullsize_url' => 'https://s3.amazonaws.com/prod-cust-photo-posts-jfaikqealaka/385-b4f71e5a62ff898dfcede2d026f6da1e.jpg',\n\t\t\t\t'thumbnail_url' => 'https://s3.amazonaws.com/socialflow-image-upload-thumbs/385-b4f71e5a62ff898dfcede2d026f6da1e.jpg',\n\t\t\t\t'size' => '370299',\n\t\t\t);\n\t\t}\n\t\tif ( is_wp_error( $media ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tupdate_post_meta( $this->post->ID, 'sf_media_' . $socialflow_params['social_id'], $media );\n\t\t// media already presents so we can call recursievly.\n\t\treturn $media;\n\t}",
"public function getMetaImageLinkAttributes()\n {\n return [\n 'href' => $this->owner->MetaImageLink,\n 'title' => $this->owner->MetaTitle\n ];\n }",
"function roots_get_all_attachements(){\n\t$attachments = array();\n\t$uploads = wp_upload_dir();\n\t\n\t// Custom post + text urls\n\t$custompostvalues = (array) array_filter((array) get_post_custom_values(\"_wp_format_media\"));\n\t$urls = array_merge($custompostvalues, roots_get_urls(get_the_content()));\n\t\n\t// Load all old-school attachments\n\t$args = array(\n\t\t'post_parent' => get_the_ID(),\n\t\t'post_type' => 'attachment',\n\t\t'orderby' => 'post_mime_type title',\n\t\t'order' => 'ASC'\n\t);\n\t$children =& get_children( $args );\n\tforeach($children as $child){\n\t\tif(($index = array_search(wp_get_attachment_url($child->ID), $urls)) || ($index = array_search($child->guid, $urls))){\n\t\t\tif(in_array($urls[$index], $custompostvalues))\n\t\t\t\t$child->featured = true;\n\t\t\tunset($urls[$index]);\n\t\t}\n\t\t$attachments[] = $child;\n\t}\n\n\t// Add all urls\n\tforeach($urls as $url){\n\t\t$filetype = wp_check_filetype($url);\n\t\t// If we can't find the filetype, it's probably not a file url\n\t\tif(empty($filetype['type'])) continue;\n\t\t\n\t\t// Try to find a local attachment\n\t\tif($id = roots_get_attachment_id_by_url($url)){\n\t\t\t$post = get_post($id);\n\t\t\tif(in_array($url, $custompostvalues))\n\t\t\t\t$post->featured = true;\n\t\t\t$attachments[] = $post;\n\t\t\tcontinue;\n\t\t}\n\t\t\n\t\t// Remote attachment\n\t\t$new = array(\n\t\t\t\"guid\" => $url,\n\t\t\t\"post_title\" => basename($url),\n\t\t\t\"post_type\" => \"attachment\",\n\t\t\t\"post_mime_type\" => $filetype['type']\n\t\t);\n\t\tif(in_array($url, $custompostvalues))\n\t\t\t$new['featured'] = true;\n\t\t\n\t\t$attachments[] = (object) $new;\n\t}\n\t\n\t// Remove duplicates\n\t$encountered = array();\n\tforeach($attachments as $k=>$a){\n\t\tif(in_array($a->guid, $encountered)) unset($attachments[$k]);\n\t\t$encountered[] = $a->guid;\n\t}\n\t\n\tuasort($attachments, '_roots_order_attachments');\n\treturn $attachments;\n}",
"function get_metabox_group_file_url($array, $key){\n $files = 0;\n if(isset($array[$key])){\n $files_id = $array[$key];\n }\n // = isset($array[$key] ) ? $array[$key] : array();\n $files = rwmb_meta( $files_id, array( 'limit' => 1 ) );\n $file = reset( $files );\n\n return $file['url'];\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return relative Offset Of Local File Header. | public function getLocalHeaderOffset(): int
{
return $this->localHeaderOffset;
} | [
"public function getFileOffset() {\n return $this->to->file() - $this->from->file();\n }",
"public function getHeaderOffset()\n {\n return $this->header_offset;\n }",
"public function get_file_position();",
"private function get_local_header() : string {\n # build extra data\n $extra_data = pack('vv',\n 0x01, # zip64 extended info header ID (2 bytes)\n 0 # field size (2 bytes)\n );\n\n # build and return local file header\n return pack('VvvvvvVVVvv',\n 0x04034b50, # local file header signature (4 bytes)\n VERSION_NEEDED, # version needed to extract (2 bytes)\n self::ENTRY_BIT_FLAGS, # general purpose bit flag (2 bytes)\n $this->method, # compression method (2 bytes)\n $this->date_time->dos_time, # last mod file time (2 bytes)\n $this->date_time->dos_date, # last mod file date (2 bytes)\n 0, # crc-32 (4 bytes, zero, in footer)\n 0, # compressed size (4 bytes, zero, in footer)\n 0, # uncompressed size (4 bytes, zero, in footer)\n strlen($this->name), # file name length (2 bytes)\n strlen($extra_data) # extra field length (2 bytes)\n ) . $this->name . $extra_data;\n }",
"public function currentOffset()\n {\n return $this->fileObject->ftell();\n }",
"protected function dataOffset()\n {\n if ($this->file) {\n return ftell($this->fh);\n } else {\n return strlen($this->memory);\n }\n }",
"protected function getRawFileHeader() {\n\t\t\treturn $this->read(FileHeader::LENGTH, true);\n\t\t}",
"public function getPositionOfFile()\n {\n return $this->positionOfFile;\n }",
"public function getFilePos()\n\t{\n\t\treturn $this->file_pos;\n\t}",
"function _getFilePosition()\n\t{\n\t\t// gzipped file... unpack it first\n\t\t$position = 0;\n\t\t$info = @ unpack('CCM/CFLG/VTime/CXFL/COS', substr($this->_data, $position +2));\n\t\tif (!$info) {\n\t\t\t$this->set('error.message', 'Unable to decompress data');\n\t\t\treturn false;\n\t\t}\n\t\t$position += 10;\n\n\t\tif ($info['FLG'] & $this->_flags['FEXTRA']) {\n\t\t\t$XLEN = unpack('vLength', substr($this->_data, $position +0, 2));\n\t\t\t$XLEN = $XLEN['Length'];\n\t\t\t$position += $XLEN +2;\n\t\t}\n\n\t\tif ($info['FLG'] & $this->_flags['FNAME']) {\n\t\t\t$filenamePos = strpos($this->_data, \"\\x0\", $position);\n\t\t\t$filename = substr($this->_data, $position, $filenamePos - $position);\n\t\t\t$position = $filenamePos +1;\n\t\t}\n\n\t\tif ($info['FLG'] & $this->_flags['FCOMMENT']) {\n\t\t\t$commentPos = strpos($this->_data, \"\\x0\", $position);\n\t\t\t$comment = substr($this->_data, $position, $commentPos - $position);\n\t\t\t$position = $commentPos +1;\n\t\t}\n\n\t\tif ($info['FLG'] & $this->_flags['FHCRC']) {\n\t\t\t$hcrc = unpack('vCRC', substr($this->_data, $position +0, 2));\n\t\t\t$hcrc = $hcrc['CRC'];\n\t\t\t$position += 2;\n\t\t}\n\n\t\treturn $position;\n\t}",
"public function getTraceOffset()\n {\n return $this->offset;\n }",
"private function parseHeader($fp) {\n $magic = fread($fp, 4);\n $data = fread($fp, 4);\n $header = unpack(\"lrevision\", $data);\n \n if (self::MAGIC1 != $magic\n && self::MAGIC2 != $magic) {\n return null;\n }\n\n if (0 != $header['revision']) {\n return null;\n }\n\n $data = fread($fp, 4 * 5);\n $offsets = unpack(\"lnum_strings/lorig_offset/\"\n . \"ltrans_offset/lhash_size/lhash_offset\", $data);\n return $offsets;\n }",
"public function getSeekPosition()\n\t{\n\t\treturn $this->seekPath;\n\t}",
"function loadOffset(){\n\t\t$op = $this->cache_dir.'/'.$this->cache_offset_file;\n\t\tif (file_exists($op))\n\t\t\t$offset = (int)file_get_contents($op);\n\t\telse $offset = 0;\n\t\treturn $offset;\n\t}",
"public function getOffset() : int;",
"private function getOffset(): int\n {\n if (Request::get('offset')) {\n $offset = (int) Request::get('offset');\n\n return $offset < 0 ? 0 : $offset;\n }\n\n return 0;\n }",
"protected function readFileHeader()\n\t{\n\t\t// If the current part is over, proceed to the next part please\n\t\tif ($this->isEOF(true))\n\t\t{\n\t\t\tdebugMsg('Opening next archive part');\n\t\t\t$this->nextFile();\n\t\t}\n\n\t\t$this->currentPartOffset = ftell($this->fp);\n\n\t\tif ($this->expectDataDescriptor)\n\t\t{\n\t\t\t// The last file had bit 3 of the general purpose bit flag set. This means that we have a\n\t\t\t// 12 byte data descriptor we need to skip. To make things worse, there might also be a 4\n\t\t\t// byte optional data descriptor header (0x08074b50).\n\t\t\t$junk = @fread($this->fp, 4);\n\t\t\t$junk = unpack('Vsig', $junk);\n\t\t\tif ($junk['sig'] == 0x08074b50)\n\t\t\t{\n\t\t\t\t// Yes, there was a signature\n\t\t\t\t$junk = @fread($this->fp, 12);\n\t\t\t\tdebugMsg('Data descriptor (w/ header) skipped at ' . (ftell($this->fp) - 12));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// No, there was no signature, just read another 8 bytes\n\t\t\t\t$junk = @fread($this->fp, 8);\n\t\t\t\tdebugMsg('Data descriptor (w/out header) skipped at ' . (ftell($this->fp) - 8));\n\t\t\t}\n\n\t\t\t// And check for EOF, too\n\t\t\tif ($this->isEOF(true))\n\t\t\t{\n\t\t\t\tdebugMsg('EOF before reading header');\n\n\t\t\t\t$this->nextFile();\n\t\t\t}\n\t\t}\n\n\t\t// Get and decode Local File Header\n\t\t$headerBinary = fread($this->fp, 30);\n\t\t$headerData =\n\t\t\tunpack('Vsig/C2ver/vbitflag/vcompmethod/vlastmodtime/vlastmoddate/Vcrc/Vcompsize/Vuncomp/vfnamelen/veflen', $headerBinary);\n\n\t\t// Check signature\n\t\tif (!($headerData['sig'] == 0x04034b50))\n\t\t{\n\t\t\tdebugMsg('Not a file signature at ' . (ftell($this->fp) - 4));\n\n\t\t\t// The signature is not the one used for files. Is this a central directory record (i.e. we're done)?\n\t\t\tif ($headerData['sig'] == 0x02014b50)\n\t\t\t{\n\t\t\t\tdebugMsg('EOCD signature at ' . (ftell($this->fp) - 4));\n\t\t\t\t// End of ZIP file detected. We'll just skip to the end of file...\n\t\t\t\twhile ($this->nextFile())\n\t\t\t\t{\n\t\t\t\t};\n\t\t\t\t@fseek($this->fp, 0, SEEK_END); // Go to EOF\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdebugMsg('Invalid signature ' . dechex($headerData['sig']) . ' at ' . ftell($this->fp));\n\t\t\t\t$this->setError(AKText::_('ERR_CORRUPT_ARCHIVE'));\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// If bit 3 of the bitflag is set, expectDataDescriptor is true\n\t\t$this->expectDataDescriptor = ($headerData['bitflag'] & 4) == 4;\n\n\t\t$this->fileHeader = new stdClass();\n\t\t$this->fileHeader->timestamp = 0;\n\n\t\t// Read the last modified data and time\n\t\t$lastmodtime = $headerData['lastmodtime'];\n\t\t$lastmoddate = $headerData['lastmoddate'];\n\n\t\tif ($lastmoddate && $lastmodtime)\n\t\t{\n\t\t\t// ----- Extract time\n\t\t\t$v_hour = ($lastmodtime & 0xF800) >> 11;\n\t\t\t$v_minute = ($lastmodtime & 0x07E0) >> 5;\n\t\t\t$v_seconde = ($lastmodtime & 0x001F) * 2;\n\n\t\t\t// ----- Extract date\n\t\t\t$v_year = (($lastmoddate & 0xFE00) >> 9) + 1980;\n\t\t\t$v_month = ($lastmoddate & 0x01E0) >> 5;\n\t\t\t$v_day = $lastmoddate & 0x001F;\n\n\t\t\t// ----- Get UNIX date format\n\t\t\t$this->fileHeader->timestamp = @mktime($v_hour, $v_minute, $v_seconde, $v_month, $v_day, $v_year);\n\t\t}\n\n\t\t$isBannedFile = false;\n\n\t\t$this->fileHeader->compressed = $headerData['compsize'];\n\t\t$this->fileHeader->uncompressed = $headerData['uncomp'];\n\t\t$nameFieldLength = $headerData['fnamelen'];\n\t\t$extraFieldLength = $headerData['eflen'];\n\n\t\t// Read filename field\n\t\t$this->fileHeader->file = fread($this->fp, $nameFieldLength);\n\n\t\t// Handle file renaming\n\t\t$isRenamed = false;\n\t\tif (is_array($this->renameFiles) && (count($this->renameFiles) > 0))\n\t\t{\n\t\t\tif (array_key_exists($this->fileHeader->file, $this->renameFiles))\n\t\t\t{\n\t\t\t\t$this->fileHeader->file = $this->renameFiles[$this->fileHeader->file];\n\t\t\t\t$isRenamed = true;\n\t\t\t}\n\t\t}\n\n\t\t// Handle directory renaming\n\t\t$isDirRenamed = false;\n\t\tif (is_array($this->renameDirs) && (count($this->renameDirs) > 0))\n\t\t{\n\t\t\tif (array_key_exists(dirname($this->fileHeader->file), $this->renameDirs))\n\t\t\t{\n\t\t\t\t$file =\n\t\t\t\t\trtrim($this->renameDirs[dirname($this->fileHeader->file)], '/') . '/' . basename($this->fileHeader->file);\n\t\t\t\t$isRenamed = true;\n\t\t\t\t$isDirRenamed = true;\n\t\t\t}\n\t\t}\n\n\t\t// Read extra field if present\n\t\tif ($extraFieldLength > 0)\n\t\t{\n\t\t\t$extrafield = fread($this->fp, $extraFieldLength);\n\t\t}\n\n\t\tdebugMsg('*' . ftell($this->fp) . ' IS START OF ' . $this->fileHeader->file . ' (' . $this->fileHeader->compressed . ' bytes)');\n\n\n\t\t// Decide filetype -- Check for directories\n\t\t$this->fileHeader->type = 'file';\n\t\tif (strrpos($this->fileHeader->file, '/') == strlen($this->fileHeader->file) - 1)\n\t\t{\n\t\t\t$this->fileHeader->type = 'dir';\n\t\t}\n\t\t// Decide filetype -- Check for symbolic links\n\t\tif (($headerData['ver1'] == 10) && ($headerData['ver2'] == 3))\n\t\t{\n\t\t\t$this->fileHeader->type = 'link';\n\t\t}\n\n\t\tswitch ($headerData['compmethod'])\n\t\t{\n\t\t\tcase 0:\n\t\t\t\t$this->fileHeader->compression = 'none';\n\t\t\t\tbreak;\n\t\t\tcase 8:\n\t\t\t\t$this->fileHeader->compression = 'gzip';\n\t\t\t\tbreak;\n\t\t}\n\n\t\t// Find hard-coded banned files\n\t\tif ((basename($this->fileHeader->file) == \".\") || (basename($this->fileHeader->file) == \"..\"))\n\t\t{\n\t\t\t$isBannedFile = true;\n\t\t}\n\n\t\t// Also try to find banned files passed in class configuration\n\t\tif ((count($this->skipFiles) > 0) && (!$isRenamed))\n\t\t{\n\t\t\tif (in_array($this->fileHeader->file, $this->skipFiles))\n\t\t\t{\n\t\t\t\t$isBannedFile = true;\n\t\t\t}\n\t\t}\n\n\t\t// If we have a banned file, let's skip it\n\t\tif ($isBannedFile)\n\t\t{\n\t\t\t// Advance the file pointer, skipping exactly the size of the compressed data\n\t\t\t$seekleft = $this->fileHeader->compressed;\n\t\t\twhile ($seekleft > 0)\n\t\t\t{\n\t\t\t\t// Ensure that we can seek past archive part boundaries\n\t\t\t\t$curSize = @filesize($this->archiveList[$this->currentPartNumber]);\n\t\t\t\t$curPos = @ftell($this->fp);\n\t\t\t\t$canSeek = $curSize - $curPos;\n\t\t\t\tif ($canSeek > $seekleft)\n\t\t\t\t{\n\t\t\t\t\t$canSeek = $seekleft;\n\t\t\t\t}\n\t\t\t\t@fseek($this->fp, $canSeek, SEEK_CUR);\n\t\t\t\t$seekleft -= $canSeek;\n\t\t\t\tif ($seekleft)\n\t\t\t\t{\n\t\t\t\t\t$this->nextFile();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->currentPartOffset = @ftell($this->fp);\n\t\t\t$this->runState = AK_STATE_DONE;\n\n\t\t\treturn true;\n\t\t}\n\n\t\t// Remove the removePath, if any\n\t\t$this->fileHeader->file = $this->removePath($this->fileHeader->file);\n\n\t\t// Last chance to prepend a path to the filename\n\t\tif (!empty($this->addPath) && !$isDirRenamed)\n\t\t{\n\t\t\t$this->fileHeader->file = $this->addPath . $this->fileHeader->file;\n\t\t}\n\n\t\t// Get the translated path name\n\t\tif (!$this->mustSkip())\n\t\t{\n\t\t\tif ($this->fileHeader->type == 'file')\n\t\t\t{\n\t\t\t\t$this->fileHeader->realFile = $this->postProcEngine->processFilename($this->fileHeader->file);\n\t\t\t}\n\t\t\telseif ($this->fileHeader->type == 'dir')\n\t\t\t{\n\t\t\t\t$this->fileHeader->timestamp = 0;\n\n\t\t\t\t$dir = $this->fileHeader->file;\n\n\t\t\t\t$this->postProcEngine->createDirRecursive($dir, 0755);\n\t\t\t\t$this->postProcEngine->processFilename(null);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Symlink; do not post-process\n\t\t\t\t$this->fileHeader->timestamp = 0;\n\t\t\t\t$this->postProcEngine->processFilename(null);\n\t\t\t}\n\n\t\t\t$this->createDirectory();\n\t\t}\n\n\t\t// Header is read\n\t\t$this->runState = AK_STATE_HEADER;\n\n\t\treturn true;\n\t}",
"private function getOffset()\n {\n if(is_integer($this->offset)){\n return $this->offset;\n }\n\n return $this->guessOffset();\n }",
"protected function getOffset()\n\t{\n\t\t$offset = $this->input->get->getInteger('offset');\n\n\t\t// Check if offset is set in input\n\t\tif (isset($offset))\n\t\t{\n\t\t\t// Check if offset is positive\n\t\t\tif ($offset >= 0)\n\t\t\t{\n\t\t\t\treturn $offset;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->app->errors->addError(\"302\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $this->offset;\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get list of webhook requests that have failed since provided date time. | public function getFailedRequestIds(DateTime $since): iterable; | [
"public function getFailedRequests()\n {\n return $this->data['failure'];\n }",
"public function getAllFailed();",
"private function getFailedList()\n\t{\n\t\treturn $this->failed_list;\n\t}",
"public function failed(Request $request){\n\n //Call orders() utility function with \"failed\" status\n return $this->ordersByStatus($request, $request->per_page, \"failed\");\n\n }",
"public function Get_Failed_Sends($date_start, $date_end)\n\t{\n\t\t$query_start_date = date(\"Y-m-d 00:00:00\", strtotime($date_start));\n\t\t$query_end_date = date(\"Y-m-d 23:59:59\", strtotime($date_end));\n\t\t\n\t\t$query = \"\n\t\t\t/* File: \".__FILE__.\", Line: \".__LINE__.\" */\n\t\t\tSELECT\n\t\t\t\tdh.date_created,\n\t\t\t\tds.name AS status,\n\t\t\t\tdd.document_id,\n\t\t\t\tdd.transport AS method\n\t\t\tFROM\n\t\t\t\t\".CONDOR_DB_NAME.\".dispatch_history AS dh\n\t\t\t\tJOIN \".CONDOR_DB_NAME.\".dispatch_status AS ds ON dh.dispatch_status_id = ds.dispatch_status_id\n\t\t\t\tJOIN \".CONDOR_DB_NAME.\".document_dispatch AS dd ON dh.document_dispatch_id = dd.document_dispatch_id\n\t\t\t\tJOIN agent AS a ON dd.user_id = a.agent_id\n\t\t\tWHERE\n\t\t\t\tdh.date_created BETWEEN '$query_start_date' AND '$query_end_date'\n\t\t\t\tAND ds.type = 'FAIL'\n\t\t\t\tAND a.company_id = {$this->server->company_id}\";\n\t\t\n\t\t$result = $this->mysqli->Query($query);\n\t\t\n\t\t$failed_sends = array();\n\t\twhile(($row = $result->Fetch_Object_Row()))\n\t\t{\n\t\t\t$failed_sends[] = $row;\n\t\t}\n\t\t\n\t\treturn $failed_sends;\n\t}",
"public function getFailedRecords()\n {\n return $this->failedRecords;\n }",
"public function getNewMissedCalls(): array\n {\n $endpoint = sprintf(\"%s/%s\", $this->apiManager->base, $this->apiManager->endpoints->call->newMissedCalls->endpoint);\n $response = Requests::get($endpoint, $this->requestHeader);\n return json_decode($response->body);\n }",
"public function getFailedEmails(Request $request){\n $failedEmails = ResendEmail::where('model_id', $request->input('model_id'))->with('user');\n return $failedEmails->paginate(20);\n }",
"public function fetchCampaignsWithErrorStatusInTimeWindow($timeWindow)\n {\n return $this->addFieldToFilter('send_status', \\Dotdigitalgroup\\Email\\Model\\Campaign::FAILED)\n ->addFieldToFilter('created_at', $timeWindow)\n ->setOrder('updated_at', 'DESC');\n }",
"public function failures(): array\n {\n return $this->getMailer()->failures();\n }",
"public function getCallsForRemind()\n {\n global $db;\n $query = \"\n SELECT id, date_start, email_reminder_time FROM calls\n WHERE email_reminder_time != -1\n AND deleted = 0\n AND email_reminder_sent = 0\n AND status != 'Held'\n AND date_start >= '{$this->now}'\n AND date_start <= '{$this->max}'\n \";\n $re = $db->query($query);\n $calls = array();\n while($row = $db->fetchByAssoc($re) ) {\n $remind_ts = $GLOBALS['timedate']->fromDb($db->fromConvert($row['date_start'],'datetime'))->modify(\"-{$row['email_reminder_time']} seconds\")->ts;\n $now_ts = $GLOBALS['timedate']->getNow()->ts;\n if ( $now_ts >= $remind_ts ) {\n $calls[] = $row['id'];\n }\n }\n return $calls;\n }",
"public function findWaitlistFailedByDaysAgo($daysAgo)\n {\n return $this->_userWaitlistDao->findFailedByDaysAgo($daysAgo);\n }",
"public function invalidRequests()\n {\n return [\n [\n HttpRequestMethod::GET,\n 'https://postman-echo.com/status/404',\n '',\n [],\n HttpClientErrorException::class\n ],\n [\n HttpRequestMethod::GET,\n 'https://postman-echo.com/status/500',\n '',\n [],\n HttpServerErrorException::class\n ],\n ];\n }",
"public function getFailures()\n {\n $errors = [];\n\n foreach ($this->getActionExceptions() as $actionException) {\n $errors[] = $actionException->getMessage();\n }\n\n return $errors;\n }",
"public function getSkippedRequests(): array\n {\n return $this->skipped;\n }",
"public function findRejectedRequestsForTeam($team, $page = 1, $size = 15);",
"public function getFailedItems()\n {\n $failedItems = [];\n foreach ($this->getAffectedItems() as $item) {\n if ($item['code'] != Data::ADD_ITEM_STATUS_SUCCESS) {\n $failedItems[] = $item;\n }\n }\n return $failedItems;\n }",
"public function getNotAnsweredRequests()\n {\n $gottenRequests = Auth::user()->gottenRequests()->whereNull('confirmed_at')->paginate(10);\n\n if ($gottenRequests->isEmpty()) {\n return response()->json([\n 'message' => 'No requests found!'\n ], 404);\n }\n\n return response()->json([\n 'gottenRequests' => $gottenRequests\n ]);\n }",
"public function getFailedJobs()\n {\n return $this->failed_jobs;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the current rendering mode (editPreviewMode). Will return a live mode when not in backend. | public function findModeByCurrentUser()
{
if ($this->userService->getBackendUser() === null || !$this->privilegeManager->isPrivilegeTargetGranted('Neos.Neos:Backend.GeneralAccess')) {
return $this->findModeByName('live');
}
/** @var \Neos\Neos\Domain\Model\User $user */
$editPreviewMode = $this->userService->getUserPreference('contentEditing.editPreviewMode');
if ($editPreviewMode === null) {
$editPreviewMode = $this->defaultEditPreviewMode;
}
$mode = $this->findModeByName($editPreviewMode);
return $mode;
} | [
"public function getPreviewMode();",
"public function getRenderMode()\n {\n return $this->renderMode;\n }",
"public function getRenderMode()\r\n {\r\n return $this->_renderMode;\r\n }",
"public function get_mode() {\n\n\t\tif ( is_null( $this->mode ) ) {\n\t\t\t$this->mode = $this->get( 'mode', 'grid' );\n\t\t}\n\n\t\treturn $this->mode;\n\t}",
"protected function getViewMode() {\n if ($this->useDisplay()) {\n return $this->traitGetViewMode();\n }\n return $this->getFieldDefinition()->getAdditionalValue('view_mode');\n }",
"public function getRenderMode()\r\n {\r\n return $this->getResultAdapter()->getRenderMode();\r\n }",
"private function getMode()\n {\n if ($this->getRequest()->getParam('store')) {\n return $this->_scopeConfig->getValue(\n Config::XML_PATH_API_DEV_MODE,\n ScopeInterface::SCOPE_STORE,\n $this->getRequest()->getParam('store')\n );\n } elseif ($this->getRequest()->getParam('website')) {\n return $this->_scopeConfig->getValue(\n Config::XML_PATH_API_DEV_MODE,\n ScopeInterface::SCOPE_WEBSITE,\n $this->getRequest()->getParam('website')\n );\n } else {\n return $this->_scopeConfig->getValue(Config::XML_PATH_API_DEV_MODE);\n }\n }",
"public function getViewMode()\n {\n return $this->viewMode;\n }",
"public function getMode ()\n {\n return $this->getConfigData('mode');\n }",
"public function getMode()\n {\n return $this->mode;\n }",
"public function getMode() {\n return $this->mode;\n }",
"public function getViewMode()\n {\n return $this->_viewMode;\n }",
"public static function getMode()\n\t{\n\t\treturn self::$mode;\n\t}",
"public function getMode()\n\t{\n\t\treturn $this->mode;\n\t}",
"function edit_mode()\n {\n return current_mode() === 'edit';\n }",
"public function getMode() {\n return $this->_workingMode;\n }",
"public function getMode()\n\t{\n\t\treturn $this->getRequest()->getMode();\n\t}",
"public static function getMode()\n {\n return self::$_mode;\n }",
"public function getViewMode() {\n return $this->viewMode;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ quick_merge_showthread_start() displays the Quick Merge option select box if appropriate | function quick_merge_showthread_start()
{
global $mybb, $thread, $qm_cache;
if($thread['replies'] >= $mybb->settings['quick_merge_max_replies'] || !quick_merge_check_user_permissions($mybb->settings['quick_merge_groups']))
{
return;
}
QuickMergeCache::load_cache();
$threads = $qm_cache->read('threads');
if(empty($threads))
{
return;
}
$tid_list = array_keys($threads);
if(in_array($thread['tid'], $tid_list))
{
return;
}
global $lang, $quick_merge, $templates;
if(!$lang->quick_merge)
{
$lang->load('quick_merge');
}
$thread_count = 0;
$options = '';
foreach($threads as $tid => $title)
{
if($tid == $thread['tid'])
{
continue;
}
if(strlen($title) > ($mybb->settings['quick_merge_title_length'] - 3))
{
$title = substr($title, 0, $mybb->settings['quick_merge_title_length']) . '...';
}
++$thread_count;
eval("\$options .= \"" . $templates->get('qm_thread_row') . "\";");
}
// only show the Quick Merge selector if there is at least one thread to choose from
if($thread_count)
{
// build the quick merge select box
eval("\$quick_merge = \"" . $templates->get('qm_form') . "\";");
}
} | [
"function quick_merge_admin_main()\n{\n\tglobal $page, $lang, $mybb, $db, $html, $qm_cache;\n\n\t// adding a dest TID\n\tif($mybb->request_method == 'post')\n\t{\n\t\tif($mybb->input['mode'] == 'add')\n\t\t{\n\t\t\t// get the info\n\t\t\t$tid = (int) $mybb->input['tid'];\n\t\t\t$query = $db->simple_select('threads', 'subject', \"tid='{$tid}'\");\n\t\t\t\n\t\t\tif($db->num_rows($query) == 0)\n\t\t\t{\n\t\t\t\tflash_message($lang->quick_merge_error_invalid_thread, 'error');\n\t\t\t\tadmin_redirect($html->url());\n\t\t\t}\n\n\t\t\t// already exists?\n\t\t\t$dup_query = $db->simple_select('quick_merge_threads', 'tid', \"tid='{$tid}'\");\n\t\t\tif($db->num_rows($dup_query) > 0)\n\t\t\t{\n\t\t\t\tflash_message($lang->quick_merge_error_thread_exists, 'error');\n\t\t\t\tadmin_redirect($html->url());\n\t\t\t}\n\n\t\t\t$order_query = $db->simple_select('quick_merge_threads');\n\t\t\t$display_order = ($db->num_rows($order_query) + 1) * 10;\n\n\t\t\t// save the dest thread\n\t\t\t$merge_thread = new MergeThread();\n\t\t\t$merge_thread->set('title', $db->fetch_field($query, 'subject'));\n\t\t\t$merge_thread->set('tid', $tid);\n\t\t\t$merge_thread->set('display_order', $display_order);\n\t\t\tif(!$merge_thread->save())\n\t\t\t{\n\t\t\t\tflash_message($lang->quick_merge_error_save_fail, 'error');\n\t\t\t\tadmin_redirect($html->url());\n\t\t\t}\n\t\t\t$qm_cache->update('has_changed', true);\n\t\t\tflash_message($lang->quick_merge_success_add, 'success');\n\t\t\tadmin_redirect($html->url());\n\t\t}\n\t\telseif($mybb->input['mode'] == 'order')\n\t\t{\n\t\t\tif(is_array($mybb->input['disp_order']) && !empty($mybb->input['disp_order']))\n\t\t\t{\n\t\t\t\tforeach($mybb->input['disp_order'] as $id => $order)\n\t\t\t\t{\n\t\t\t\t\t$merge_thread = new MergeThread($id);\n\t\t\t\t\t$merge_thread->set('display_order', $order);\n\t\t\t\t\t$merge_thread->save();\n\t\t\t\t}\n\t\t\t\tflash_message($lang->quick_merge_success_order, 'success');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tflash_message($lang->quick_merge_error_order_fail, 'error');\n\t\t\t}\n\t\t\tadmin_redirect($html->url());\n\t\t}\n\t}\n\n\t// delete\n\tif($mybb->input['mode'] == 'delete')\n\t{\n\t\t$merge_thread = new MergeThread($mybb->input['id']);\n\t\tif(!$merge_thread->is_valid())\n\t\t{\n\t\t\tflash_message($lang->quick_merge_error_delete_fail, 'error');\n\t\t\tadmin_redirect($html->url());\n\t\t}\n\t\tif(!$merge_thread->remove())\n\t\t{\n\t\t\tflash_message($lang->quick_merge_error_delete_fail, 'error');\n\t\t\tadmin_redirect($html->url());\n\t\t}\n\t\t$qm_cache->update('has_changed', true);\n\t\tflash_message($lang->quick_merge_success_delete, 'success');\n\t\tadmin_redirect($html->url());\n\t}\n\n\t// page start\n\t$page->add_breadcrumb_item($lang->quick_merge, $html->url);\n\t$page->output_header($lang->quick_merge);\n\n\t$form = new Form($html->url(array(\"mode\" => 'order')), 'post');\n\t$form_container = new FormContainer($lang->quick_merge_manage_threads);\n\n\t$form_container->output_row_header($lang->quick_merge_tid_title, array(\"width\" => '10%'));\n\t$form_container->output_row_header($lang->quick_merge_subject_title, array(\"width\" => '70%'));\n\t$form_container->output_row_header($lang->quick_merge_display_order_title, array(\"width\" => '10%'));\n\t$form_container->output_row_header($lang->quick_merge_controls_title, array(\"width\" => '10%'));\n\n\t$query = $db->simple_select('quick_merge_threads', '*', '', array(\"order_by\" => 'display_order', \"order_dir\" => 'ASC'));\n\tif($db->num_rows($query) > 0)\n\t{\n\t\twhile($thread = $db->fetch_array($query))\n\t\t{\n\t\t\t$form_container->output_cell($thread['tid']);\n\t\t\t$form_container->output_cell(\"<strong>{$thread['title']}</strong>\");\n\t\t\t$form_container->output_cell($form->generate_text_box(\"disp_order[{$thread['id']}]\", $thread['display_order'], array(\"style\" => 'width: 50px;')));\n\t\t\t$form_container->output_cell($html->link($html->url(array(\"mode\" => 'delete', \"id\" => $thread['id'])), 'Delete', array(\"style\" => 'font-weight: bold;')));\n\t\t\t$form_container->construct_row();\n\t\t}\n\t}\n\telse\n\t{\n\t\t$form_container->output_cell(\"<span style=\\\"color: gray;\\\">{$lang->quick_merge_no_threads}</span>\", array(\"colspan\" => 4));\n\t\t$form_container->construct_row();\n\t}\n\t$form_container->end();\n\t$buttons = array($form->generate_submit_button($lang->quick_merge_order_title, array('name' => 'order')));\n\t$form->output_submit_wrapper($buttons);\n\t$form->end();\n\n\t// display add form\n\t$form = new Form($html->url(array(\"mode\" => 'add')), \"post\");\n\t$form_container = new FormContainer($lang->quick_merge_add_threads);\n\t$form_container->output_row('', '', $form->generate_text_box('tid'));\n\t$form_container->end();\n\t$buttons = array($form->generate_submit_button($lang->quick_merge_add_title, array('name' => 'add_thread_submit')));\n\t$form->output_submit_wrapper($buttons);\n\t$form->end();\n\n\t// be done\n\t$page->output_footer();\n\texit();\n}",
"function cbone_listing_merge_selection($uid){\n\tglobal $user;\n\t$output = '';\n\tif(isset($_SESSION['my_listing_back']) && $_SESSION['my_listing_back'] != '') {\n\t\t$my_listing_back = '/'.$_SESSION['my_listing_back'];\n\t}\n\telse {\n\t\t$my_listing_back = '/node/510';\n\t}\n\t$output .= '<div class=\"manage-listing-back\"><a href=\"'.$my_listing_back.'\"><img src=\"/sites/all/modules/custom/listing_marketing_system/images/back-curved-arrow.png\"></a></div>';\n\t\n\t$output .= '<div class=\"find-merge-listing\"><div class=\"merge-listing-title\">Find and Merge Listings</div><div class=\"merge-listing-description\">Select no more than 2 listings at one time to merge, then click the \\'NEXT\\' button to continue.</div>';\n\t\n\t$filter_form = drupal_get_form('merge_list_filter_form');\n\t$output .= drupal_render($filter_form).'</div>';\n\t\n\t$select_form = drupal_get_form('listing_merge_selection_form');\n\t$output .= drupal_render($select_form);\n\n\t//print \"<pre>\";print_r($user);exit;\n\treturn $output;\n}",
"function quick_merge_activate()\n{\n\tglobal $templates;\n\n\t// change the permissions to on by default\n\tchange_admin_permission('config', 'quick_merge');\n\n\trequire_once MYBB_ROOT . '/inc/adminfunctions_templates.php';\n\tfind_replace_templatesets('showthread', \"#\" . preg_quote('{$newreply}') . \"#i\", '{$quick_merge}{$newreply}');\n\n\tquick_merge_set_cache_version();\n}",
"function showMergeCandidates() {\n global $DB;\n\n $ID = $this->getField('id');\n $this->check($ID, UPDATE);\n $rand = mt_rand();\n\n echo \"<div class='center'>\";\n $iterator = $DB->request([\n 'SELECT' => [\n 'glpi_softwares.id',\n 'glpi_softwares.name',\n 'glpi_entities.completename AS entity'\n ],\n 'FROM' => 'glpi_softwares',\n 'LEFT JOIN' => [\n 'glpi_entities' => [\n 'ON' => [\n 'glpi_softwares' => 'entities_id',\n 'glpi_entities' => 'id'\n ]\n ]\n ],\n 'WHERE' => [\n 'glpi_softwares.id' => ['!=', $ID],\n 'glpi_softwares.name' => addslashes($this->fields['name']),\n 'glpi_softwares.is_deleted' => 0,\n 'glpi_softwares.is_template' => 0\n ] + getEntitiesRestrictCriteria(\n 'glpi_softwares',\n 'entities_id',\n getSonsOf(\"glpi_entities\", $this->fields[\"entities_id\"]),\n false\n ),\n 'ORDERBY' => 'entity'\n ]);\n $nb = count($iterator);\n\n if ($nb) {\n $link = Toolbox::getItemTypeFormURL('Software');\n Html::openMassiveActionsForm('mass'.__CLASS__.$rand);\n $massiveactionparams\n = ['num_displayed' => min($_SESSION['glpilist_limit'], $nb),\n 'container' => 'mass'.__CLASS__.$rand,\n 'specific_actions'\n => [__CLASS__.MassiveAction::CLASS_ACTION_SEPARATOR.'merge'\n => __('Merge')],\n 'item' => $this];\n Html::showMassiveActions($massiveactionparams);\n\n echo \"<table class='tab_cadre_fixehov'>\";\n echo \"<tr><th width='10'>\";\n echo Html::getCheckAllAsCheckbox('mass'.__CLASS__.$rand);\n echo \"</th>\";\n echo \"<th>\".__('Name').\"</th>\";\n echo \"<th>\".__('Entity').\"</th>\";\n echo \"<th>\"._n('Installation', 'Installations', Session::getPluralNumber()).\"</th>\";\n echo \"<th>\"._n('License', 'Licenses', Session::getPluralNumber()).\"</th></tr>\";\n\n while ($data = $iterator->next()) {\n echo \"<tr class='tab_bg_2'>\";\n echo \"<td>\".Html::getMassiveActionCheckBox(__CLASS__, $data[\"id\"]).\"</td>\";\n echo \"<td><a href='\".$link.\"?id=\".$data[\"id\"].\"'>\".$data[\"name\"].\"</a></td>\";\n echo \"<td>\".$data[\"entity\"].\"</td>\";\n echo \"<td class='right'>\".Item_SoftwareVersion::countForSoftware($data[\"id\"]).\"</td>\";\n echo \"<td class='right'>\".SoftwareLicense::countForSoftware($data[\"id\"]).\"</td></tr>\\n\";\n }\n echo \"</table>\\n\";\n $massiveactionparams['ontop'] =false;\n Html::showMassiveActions($massiveactionparams);\n Html::closeForm();\n\n } else {\n echo __('No item found');\n }\n\n echo \"</div>\";\n }",
"function quick_merge_info()\n{\n\tglobal $mybb, $lang;\n\n\tif(!$lang->quick_merge)\n\t{\n\t\t$lang->load('quick_merge');\n\t}\n\n\t$settings_link = quick_merge_build_settings_link();\n\tif($settings_link)\n\t{\n\t\t$extra_links = <<<EOF\n<ul>\n\t<li style=\"list-style-image: url(styles/default/images/icons/custom.gif)\">\n\t\t{$settings_link}\n\t</li>\n</ul>\nEOF;\n\t}\n\telse\n\t{\n\t\t$extra_links = \"<br />\";\n\t}\n\n\t$button_pic = $mybb->settings['bburl'] . '/inc/plugins/quick_merge/images/donate.gif';\n\t$border_pic = $mybb->settings['bburl'] . '/inc/plugins/quick_merge/images/pixel.gif';\n\t$quick_merge_description = <<<EOF\n<table width=\"100%\">\n\t<tbody>\n\t\t<tr>\n\t\t\t<td>\n\t\t\t\t{$lang->quick_merge_description}{$extra_links}\n\t\t\t</td>\n\t\t\t<td style=\"text-align: center;\">\n\t\t\t\t<form action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\" target=\"_top\">\n\t\t\t\t\t<input type=\"hidden\" name=\"cmd\" value=\"_s-xclick\">\n\t\t\t\t\t<input type=\"hidden\" name=\"hosted_button_id\" value=\"VA5RFLBUC4XM4\">\n\t\t\t\t\t<input type=\"image\" src=\"{$button_pic}\" border=\"0\" name=\"submit\" alt=\"PayPal - The safer, easier way to pay online!\">\n\t\t\t\t\t<img alt=\"\" border=\"0\" src=\"{$border_pic}\" width=\"1\" height=\"1\">\n\t\t\t\t</form>\n\t\t\t</td>\n\t\t</tr>\n\t</tbody>\n</table>\nEOF;\n\n\t$name = <<<EOF\n<span style=\"font-familiy: arial; font-size: 1.5em; color: #a0a; text-shadow: 2px 2px 2px #a8a;\">{$lang->quick_merge}</span>\nEOF;\n\t$author = <<<EOF\n</a></small></i><a href=\"http://www.rantcentralforums.com\" title=\"Rant Central\"><span style=\"font-family: Courier New; font-weight: bold; font-size: 1.2em; color: #0e7109;\">Wildcard</span></a><i><small><a>\nEOF;\n\n\t// This array returns information about the plug-in, some of which was prefabricated above based on whether the plugin has been installed or not.\n\treturn array\n\t(\n\t\t\"name\" => $name,\n\t\t\"description\" => $quick_merge_description,\n\t\t\"website\" => \"https://github.com/WildcardSearch/QuickMerge\",\n\t\t\"author\" => $author,\n\t\t\"authorsite\" => \"http://www.rantcentralforums.com\",\n\t\t\"version\" => \"1.0.2\",\n\t\t\"compatibility\" => \"16*\",\n\t\t\"guid\" => \"90cc9bac4e5d4111fbb66552b0d4dda9\",\n\t);\n}",
"public function showThread()\n\t{\n\t}",
"public function startMerge()\n {\n $this->startOperation('merge');\n }",
"function widget_selection($options){\n\tglobal $widget_selection, $fl, $ln, $qr, $fromHdrBugs, $developerEmail;\n\textract($options);\n\tob_start();\n\tif(count($_SESSION['userSettings']))\n\tforeach($_SESSION['userSettings'] as $n=>$v){\n\t\tif(!stristr($n,$filterNode))continue;\n\t\tif($v /* must have at least one \"status\" requested */)$filterSelWSet=true;\n\t}\n\tif(!$filterSelWSet || strtolower($GLOBALS['selWRefreshFilter'])==strtolower($filterNode)){\n\t\t//get db filters\n\t\t$o=q(\"SELECT varkey, varvalue FROM bais_settings WHERE UserName='\".$_SESSION['admin']['userName'].\"' AND vargroup='$varGroup' AND varnode='$filterNode'\", O_COL_ASSOC);\n\t\t//reset if out of synch\n\t\tif(count($selOptions)!==count($o)){\n\t\t\tq(\"DELETE FROM bais_settings WHERE UserName='\".$_SESSION['admin']['userName'].\"' AND vargroup='$varGroup' AND varnode='$filterNode'\");\n\t\t\tforeach($_SESSION['userSettings'] as $n=>$v){\n\t\t\t\tif(stristr($n,'$filterNode'))unset($_SESSION['userSettings'][$n]);\n\t\t\t}\n\t\t\tforeach($selOptions as $n=>$v){\n\t\t\t\tq(\"REPLACE INTO bais_settings SET UserName='\".$_SESSION['admin']['userName'].\"', \n\t\t\t\tvargroup='$varGroup', varnode='$filterNode', varkey='$n', varvalue=1\");\n\t\t\t\t$_SESSION['userSettings'][$filterNode.':'.$n]=1;\n\t\t\t}\n\t\t}else if($o){\n\t\t\tforeach($o as $n=>$v)$_SESSION['userSettings'][$filterNode.':'.$n]=$v;\n\t\t}\n\t}\n\t//now unfortunately we must loop through one more time to get selected statuses count\n\tif(count($_SESSION['userSettings']))\n\tforeach($_SESSION['userSettings'] as $n=>$v){\n\t\tif(!stristr($n,$filterNode))continue;\n\t\tif($v)$optionsCount++;\n\t}\n\t\n\t//handle incoming request - overwrite both db and session settings from above\n\tif($GLOBALS['filterSelW'] && $GLOBALS['targetFilterNode']==$filterNode){\n\t\tif($GLOBALS['current']==1 && $optionsCount<2)error_alert('You must have at least one '.$optionLabel.' selected');\n\t\t$_SESSION['userSettings'][$filterNode.':'.$GLOBALS['filterSelW']]=($GLOBALS['current'] ? 0 : 1);\n\t\tq(\"REPLACE INTO bais_settings SET UserName='\".$_SESSION['admin']['userName'].\"', \n\t\tvargroup='$varGroup', varnode='$filterNode', varkey='\".$GLOBALS['filterSelW'].\"', varvalue=\".($GLOBALS['current'] ? 0 : 1));\n\t}\n\t//and loop AGAIN.. this codeblock can certainly be cleaned up!!!\n\tforeach($_SESSION['userSettings'] as $n=>$v){\n\t\tif(!$v || !stristr($n,$filterNode))continue;\n\t\t//global settings\n\t\t$widget_selection[$filterNode]['statusSet'][]=end(explode(':',$n));\n\t}\n\t$widget_selection['widgets']++;\n\t?>\n\t<!-- selection widget generated by <?php __FILE__?>; <?php echo date('Y-m-d g:iA');?> -->\n\t<style type=\"text/css\">\n\t#selWList<?php echo $widget_selection['widgets'];?>{\n\t\tposition:relative;\n\t\tcursor:pointer;\n\t\t}\n\t#selWList_head_<?php echo $filterNode?>{\n\t\t}\n\t#selWList_sub_<?php echo $filterNode?>{\n\t\tposition:absolute;\n\t\tleft:0px;\n\t\ttop:35px;\n\t\twidth:205px;\n\t\tbackground-color:#ccc;\n\t\t}\n\t.selWListopt{\n\t\tclear:both;\n\t\tpadding:1px 7px;\n\t\t}\n\t#selWList<?php echo $widget_selection['widgets'];?> .on{\n\t\tbackground-color:darkblue;\n\t\tcolor:white;\n\t\t}\n\t/*\n\t#selWList_sub_<?php echo $filterNode?>{\n\t\tvisibility:hidden;\n\t\t}\n\t*/\n\t.ck{\n\t\twidth:20px;\n\t\ttext-align:center;\n\t\t}\n\t\n\t\n\t.age{\n\t\tfloat:left;width:3.0em;\n\t\t}\n\t</style>\n\t<script language=\"javascript\" type=\"text/javascript\">\n\t<?php \n\tglobal $widget_selection_js_function;\n\tif(!$widget_selection_js_function){ $widget_selection_js_function=true;\n\t?>\n\tfunction selWidget(o,a,f,s){\n\t\tswitch(a){\n\t\t\tcase 0:\n\t\t\t\to.className='selWListopt';\n\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\to.className='selWListopt on';\n\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\twindow.open('/gf5/console/resources/bais_01_exe.php?mode=refreshComponent&component=<?php echo $GLOBALS['datasetComponent'];?>&targetFilterNode='+f+'&filterSelW='+o.id.replace('selWListoption_'+f+'_','')+'¤t='+s+'&componentFile=<?php echo $GLOBALS['datasetReferenceFile']?>&componentKey=<?php echo $GLOBALS['datasetReferenceFileKey']?>','w2');\n\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tg('selWList_sub_'+f).style.visibility='hidden';\n\t\t\tbreak;\n\t\t}\n\t}\n\tfunction showoptions(n){\n\t\teval(\"document.getElementById('selWList_sub_'+n).style.visibility=(selWon_\"+n+\"?'visible':'hidden');\");\n\t\tsetTimeout('showoptions(\\''+n+'\\')',100);\n\t}\n\t<?php } ?>\n\tvar selWon_<?php echo $filterNode?>=false;\n\tsetTimeout('showoptions(\\'<?php echo $filterNode?>\\')',1000);\n\t</script>\n\t<div id=\"selWList<?php echo $widget_selection['widgets'];?>\" class=\"frb\">\n\t\t<div id=\"selWList_head_<?php echo $filterNode?>\" onClick=\"selWidget(this,3,'<?php echo $filterNode?>');\" onMouseOver=\"selWon_<?php echo $filterNode;?>=true;\" onMouseOut=\"selWon_<?php echo $filterNode;?>=false;\">\n\t\t<div><img src=\"<?php echo $anchorImgPath?>\" alt=\"<?php echo $anchorLabel?>\" /> <?php echo $anchorLabel?></div>\n\t\t</div>\n\t\t<div id=\"selWList_sub_<?php echo $filterNode?>\" style=\"visibility:<?php echo 'hidden';?>;\" onmouseover=\"selWon_<?php echo $filterNode;?>=true;\" onMouseOut=\"selWon_<?php echo $filterNode;?>=false;\">\n\t\t\t<?php\n\t\t\tforeach($selOptions as $n=>$v){\n\t\t\t\t?><div id=\"selWListoption_<?php echo $filterNode?>_<?php echo $n?>\" class=\"selWListopt\" onMouseOver=\"selWidget(this,1,'<?php echo $filterNode?>');\" onMouseOut=\"selWidget(this,0,'<?php echo $filterNode?>');\" onClick=\"selWidget(this,2,'<?php echo $filterNode?>',<?php echo $_SESSION['userSettings'][$filterNode.':'.$n] ? 1 : 0;?>);\" title=\"<?php echo $_SESSION['userSettings'][$filterNode.':'.$n] ? 'Hide' : 'Show'?> this category of invoices\">\n\t\t\t\t<div class=\"frb\"><?php echo $selWOptionCount[$n]?></div>\n\t\t\t\t<div id=\"selWck_<?php echo $n?>\" class=\"flb ck\"><?php \n\t\t\t\tif($_SESSION['userSettings'][$filterNode.':'.$n]){\n\t\t\t\t\t?><img src=\"/images/i/check1.png\" width=\"16\" height=\"16\" alt=\"x\" /><?php\n\t\t\t\t}else{\n\t\t\t\t\techo ' ';\n\t\t\t\t}?></div>\n\t\t\t\t<div class=\"\" id=\"selWListoption_<?php echo $filterNode?>_<?php echo $n?>_name\"><?php echo $v?></div>\n\t\t\t\t</div><?php\n\t\t\t}\n\t\t\t?>\n\t\t</div>\n\t</div>\n\t<?php\n\t$selWOutput=ob_get_contents();\n\tob_end_clean();\n\treturn $selWOutput;\n}",
"public function action_mergeDone()\n\t{\n\t\tglobal $txt, $context;\n\n\t\t// Make sure the template knows everything...\n\t\t$context['target_board'] = (int) $this->_req->query->targetboard;\n\t\t$context['target_topic'] = (int) $this->_req->query->to;\n\n\t\t$context['page_title'] = $txt['merge'];\n\t\t$context['sub_template'] = 'merge_done';\n\t}",
"function FDISK_showCombinedFdiskGUIDialog()\n{\n\tinclude(\"/m23/inc/i18n/\".$GLOBALS[\"m23_language\"].\"/m23base.php\");\n\n\techo('\n\t\t<tr>\n\t\t\t<td align=\"center\" colspan=3\">\n\t\t\t\t<span class=\"title\">'.FDISK_fdiskSessionClient().'</span>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td width=\"24%\" rowspan=3 valign=\"top\" bgcolor=\"#E0E0E0\">');\n\t\t\tif (!FDISK_showFdiskCombinedGUIFunctions())\n\techo('</td></tr>');\n\telse\n\t{\n\t\techo('\n\t\t\t\t</td>\n\t\t\t\t<td width=\"76%\" colspan=2 valign=\"top\">');\n\t\t\t\t\tFDISK_printAllBars2();\n\t\techo('\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr valign=\"top\">\n\t\t\t\t<td width=\"38%\" valign=\"top\">\n\t\t\t\t\t<span class=\"title\">'.$I18N_waitingPartitioningAndFormatingJobs.'</span><br><br>');\n\t\t\t\t\tFDISK_listPartJobs(FDISK_fdiskSessionPartJobs());\n\t\techo('\n\t\t\t\t</td>\n\t\t\t\t<td width=\"38%\" valign=\"top\">');\n\t\t\t\t\tFDISK_showAllPartTables();\n\t\t\t\t\tFDISK_printColorDefinitions();\n\t\techo('\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td width=\"76%\" colspan=2 valign=\"top\">');\n\t\t\t\tFDISK_fstabAddDialog2();\n\t\techo('\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td align=\"center\" colspan=3 valign=\"top\">\n\t\t\t\t\t<input type=\"submit\" name=\"BUT_refresh\" value=\"'.$I18N_refresh.'\"> '.BUT_reset.' '.BUT_finalisePartitioningAndselectClientDistribution.'\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\n\t\t\t<script>\n\t\n\t\t\tfunction setSelectionElement(selName, val)\n\t\t\t{\n\t\t\t\t//Get the dialog element with the name \"selName\"\n\t\t\t\tvar sel = document.getElementsByName(selName);\n\t\t\t\tvar i;\n\t\n\t\t\t\t//Run thru all its options\n\t\t\t\tfor (i=0; i < sel[0].options.length; i++)\n\t\t\t\t{\n\t\t\t\t\t//Check, if the option with the desired value was found.\n\t\t\t\t\tif (sel[0].options[i].value == val)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\n\t\t\t\t//Make the found option the selected\n\t\t\t\tsel[0].selectedIndex = i;\n\t\t\t}\n\t\n\t\t\tfunction selectDrive(drive)\n\t\t\t{\n\t\t\t\tsetSelectionElement(\"SEL_instDrive\", drive);\n\t\t\t}\n\t\n\t\t\tfunction showPartTable(it)\n\t\t\t{\n\t\t\t\tvar i;\n\t\t\t\tfor (i=0; i < document.getElementsByName(\"partTables\").length; i++)\n\t\t\t\t\tdocument.getElementsByName(\"partTables\")[i].style.display = \"none\";\n\t\t\t\tdocument.getElementById(it).style.display = \"block\";\n\t\t\t}\n\t\n\t\t\tfunction emptySpace(from, to, drive)\n\t\t\t{\n\t\t\t\tdocument.getElementsByName(\"ED_newPart_start\")[0].value=from;\n\t\t\t\tdocument.getElementsByName(\"ED_newPart_end\")[0].value=to;\n\t\t\t\tselectDrive(drive);\n\t\t\t}\n\t\n\t\t\tfunction selectPartition(dev, drive)\n\t\t\t{\n\t\t\t\tsetSelectionElement(\"SEL_part\", dev);\n\t\t\t\tselectDrive(drive);\n\t\t\t\tsetSelectionElement(\"SEL_fstabPart\", dev);\n\t\t\t}\n\t\t\t\n\t\t\tfunction markPartTableEntry(id)\n\t\t\t{\n\t\t\t\t//Get all HTML elements\n\t\t\t\tvar allElems=document.getElementsByTagName(\\'*\\');\n\n\t\t\t\t//Run thru the elements\n\t\t\t\tfor (var i = 0; i < allElems.length; i++)\n\t\t\t\t{\n\t\t\t\t\t//Get the ID of the current element\n\t\t\t\t\tvar elemID = allElems[i].getAttribute(\"id\");\n\n\t\t\t\t\t//Check if it has an ID and if it is an PartTableEntry. If yes => Make it transparent\n\t\t\t\t\tif ((elemID != null) && (elemID.search(/PartTableEntry.+/) != -1))\n\t\t\t\t\t\tallElems[i].style.backgroundColor = \"transparent\";\n\t\t\t\t}\n\n\t\t\t\t//Make the choosen partition table entry orange\n\t\t\t\tdocument.getElementById(id).style.backgroundColor = \"#FF9933\";\n\t\t\t}\n\t\n\t\t\tshowPartTable(\\'partTables'.FDISK_fdiskSessionInstallDrive().'\\');\n\t\t\t</script>\n\t\t');\n\t}\n\t\n\tHTML_JSMenuCloseAllEntries('fdiskMenu');\n}",
"protected function _threadListOptions()\r\n\t{\r\n\t}",
"function mysupport_inline_thread_moderation()\r\n{\r\n\tglobal $mybb, $db, $lang, $templates, $foruminfo, $mysupport_inline_thread_moderation;\r\n\t\r\n\t$lang->load(\"mysupport\");\r\n\t\r\n\tif(mysupport_usergroup(\"canmarksolved\"))\r\n\t{\r\n\t\t$mysupport_solved = \"<option value=\\\"mysupport_status_1\\\">-- \" . $lang->solved . \"</option>\";\r\n\t\t$mysupport_not_solved = \"<option value=\\\"mysupport_status_0\\\">-- \" . $lang->not_solved . \"</option>\";\r\n\t\tif($mybb->settings['mysupportclosewhensolved'] != \"never\")\r\n\t\t{\r\n\t\t\t$mysupport_solved_and_close = \"<option value=\\\"mysupport_status_3\\\">-- \" . $lang->solved_close . \"</option>\";\r\n\t\t}\r\n\t}\r\n\tif(mysupport_usergroup(\"canmarktechnical\"))\r\n\t{\r\n\t\t$mysupport_technical = \"<option value=\\\"mysupport_status_2\\\">-- \" . $lang->technical . \"</option>\";\r\n\t\t$mysupport_not_technical = \"<option value=\\\"mysupport_status_4\\\">-- \" . $lang->not_technical . \"</option>\";\r\n\t}\r\n\t\r\n\t$mysupport_assign = \"\";\r\n\t$assign_users = mysupport_get_assign_users();\r\n\t// only continue if there's one or more users that can be assigned threads\r\n\tif(!empty($assign_users))\r\n\t{\r\n\t\tforeach($assign_users as $assign_userid => $assign_username)\r\n\t\t{\r\n\t\t\t$mysupport_assign .= \"<option value=\\\"mysupport_assign_\" . intval($assign_userid) . \"\\\">-- \" . htmlspecialchars_uni($assign_username) . \"</option>\\n\";\r\n\t\t}\r\n\t}\r\n\t\r\n\t$mysupport_priorities = \"\";\r\n\t$query = $db->simple_select(\"mysupport\", \"*\", \"type = 'priority'\");\r\n\t$priorities_list = \"\";\r\n\t// only continue if there's any priorities\r\n\tif($db->num_rows($query) > 0)\r\n\t{\r\n\t\twhile($priority = $db->fetch_array($query))\r\n\t\t{\r\n\t\t\t$mysupport_priorities .= \"<option value=\\\"mysupport_priority_\" . intval($priority['mid']) . \"\\\">-- \" . htmlspecialchars_uni($priority['name']) . \"</option>\\n\";\r\n\t\t}\r\n\t}\r\n\t\r\n\t$mysupport_categories = \"\";\r\n\t$categories_users = mysupport_get_categories($foruminfo['fid']);\r\n\t// only continue if there's any priorities\r\n\tif(!empty($categories_users))\r\n\t{\r\n\t\tforeach($categories_users as $category_id => $category_name)\r\n\t\t{\r\n\t\t\t$mysupport_categories .= \"<option value=\\\"mysupport_priority_\" . intval($category_id) . \"\\\">-- \" . htmlspecialchars_uni($category_name) . \"</option>\\n\";\r\n\t\t}\r\n\t}\r\n\t\r\n\teval(\"\\$mysupport_inline_thread_moderation = \\\"\".$templates->get('mysupport_inline_thread_moderation').\"\\\";\");\r\n}",
"function actionShowHelpSelection() {\n\t $this->getInputManager()->setLookupGlobals(utilityInputManager::LOOKUPGLOBALS_GET);\n\t $data = $this->getInputManager()->doFilter();\n\n\t $this->addInputToModel($data, $this->getModel());\n\t \n\t $oView = new helpPagesView($this);\n\t $oView->showHelpContentsSelection();\n }",
"function mention_showthread_start()\n{\n\tglobal $mybb, $mention_script, $mention_quickreply,\n\t$mentioned_ids, $lang, $tid, $templates;\n\n\t// we only need the extra JS and Quick Reply additions if we are allowing multiple mentions\n\tif($mybb->settings['mention_multiple'])\n\t{\n\t\t$multi = '_multi';\n\t\teval(\"\\$mention_quickreply = \\\"\" . $templates->get('mentionme_quickreply_notice') . \"\\\";\");\n\n\t\t$mentioned_ids = <<<EOF\n\n\t<input type=\"hidden\" name=\"mentioned_ids\" value=\"\" id=\"mentioned_ids\" />\nEOF;\n\t}\n\n\tif($mybb->settings['mention_minify_js'])\n\t{\n\t\t$min = '.min';\n\t}\n\n\t$mention_script = <<<EOF\n<script type=\"text/javascript\" src=\"jscripts/MentionMe/mention_thread{$multi}{$min}.js\"></script>\n\nEOF;\n}",
"function quick_merge_install()\n{\n\tglobal $lang;\n\n\tif(!$lang->quick_merge)\n\t{\n\t\t$lang->load('quick_merge');\n\t}\n\n\t// settings tables, templates, groups and setting groups\n\tif(!class_exists('WildcardPluginInstaller'))\n\t{\n\t\trequire_once MYBB_ROOT . 'inc/plugins/quick_merge/classes/installer.php';\n\t}\n\t$installer = new WildcardPluginInstaller(MYBB_ROOT . 'inc/plugins/quick_merge/install_data.php');\n\t$installer->install();\n}",
"function display_upload_options()\n {\n global $metadata_read, $enable_add_collection_on_upload, $relate_on_upload, $camera_autorotation;\n if ($metadata_read || $enable_add_collection_on_upload || $relate_on_upload || $camera_autorotation)\n {\n return true;\n }\n else\n {\n return false;\n }\n }",
"function b_tutorials_top_show($options) {\r\n global $db, $framebrowse, $myts;\r\n include_once XOOPS_ROOT_PATH.\"/modules/tutorials/cache/config.php\";\r\n $block = array();\r\n $block['content'] = \"<div style=\\\"text-align:left;\\\"><small>\";\r\n\r\n $result = $db->query(\"select tid, tname, tlink, codes, status, hits, date from \".$db->prefix(\"tutorials\").\" WHERE status=1 or status=3 ORDER BY \".$options[0].\" DESC\",$options[1],0);\r\n while (list($tid, $tname, $tlink, $codes, $status, $hits, $date) = $db->fetch_row($result) ) {\r\n $tname = $myts->makeTboxData4Show($tname);\r\n if ( !XOOPS_USE_MULTIBYTES ){\r\n if (strlen($tname) >= 19) {\r\n $tname = substr($tname,0,18).\"...\";\r\n }\r\n }\r\n if ($tlink != \"\") {\r\n if ($framebrowse == 1 || $codes >= 10) {\r\n $link_url = \"\".XOOPS_URL.\"/modules/tutorials/viewexttutorial.php?tid=$tid\";\r\n $link_target = \"\";\r\n } else {\r\n $link_url = $tlink;\r\n $link_target = \" target=\\\"_blank\\\"\";\r\n }\r\n $block['content'] .= \" <strong><big>·</big></strong> <a href=\\\"\".$link_url.\"\\\" \".$link_target.\">\".$tname.\"</a>\";\r\n } else {\r\n $block['content'] .= \" <strong><big>·</big></strong> <a href=\\\"\".XOOPS_URL.\"/modules/tutorials/viewtutorial.php?tid=$tid\\\">$tname</a>\";\r\n }\r\n $count = 7; //7 days\r\n $startdate = (time()-(86400 * $count));\r\n if ($startdate < $time) {\r\n if($status==1){\r\n $block['content'] .= \" <img src=\\\"\".XOOPS_URL.\"/modules/tutorials/images/newred.gif\\\" />\";\r\n } elseif ($status==3){\r\n $block['content'] .= \" <img src=\\\"\".XOOPS_URL.\"/modules/tutorials/images/update.gif\\\" />\";\r\n }\r\n }\r\n if($options[0] == \"date\"){\r\n $block['content'] .= \" <small>(\".formatTimestamp($date,\"s\").\")</small><br />\";\r\n $block['title'] = _MB_BLOCK_TITLE1;\r\n }elseif($options[0] == \"hits\"){\r\n $block['content'] .= \" <small>(\".$hits.\")</small><br />\";\r\n $block['title'] = _MB_BLOCK_TITLE2;\r\n }\r\n }\r\n $block['content'] .= \"</small></div>\";\r\n return $block;\r\n}",
"function mysupport_inline_thread_moderation()\r\n{\r\n\tglobal $mybb, $db, $cache, $lang, $templates, $foruminfo, $mysupport_inline_thread_moderation;\r\n\t\r\n\t$lang->load(\"mysupport\");\r\n\t\r\n\t$mysupport_solved = $mysupport_not_solved = $mysupport_solved_and_close = $mysupport_technical = $mysupport_not_technical = \"\";\r\n\tif(mysupport_usergroup(\"canmarksolved\"))\r\n\t{\r\n\t\t$mysupport_solved = \"<option value=\\\"mysupport_status_1\\\">-- \".$lang->solved.\"</option>\";\r\n\t\t$mysupport_not_solved = \"<option value=\\\"mysupport_status_0\\\">-- \".$lang->not_solved.\"</option>\";\r\n\t\tif($mybb->settings['mysupportclosewhensolved'] != \"never\")\r\n\t\t{\r\n\t\t\t$mysupport_solved_and_close = \"<option value=\\\"mysupport_status_3\\\">-- \".$lang->solved_close.\"</option>\";\r\n\t\t}\r\n\t}\r\n\tif($mybb->settings['enablemysupporttechnical'] == 1)\r\n\t{\r\n\t\tif(mysupport_usergroup(\"canmarktechnical\"))\r\n\t\t{\r\n\t\t\t$mysupport_technical = \"<option value=\\\"mysupport_status_2\\\">-- \".$lang->technical.\"</option>\";\r\n\t\t\t$mysupport_not_technical = \"<option value=\\\"mysupport_status_4\\\">-- \".$lang->not_technical.\"</option>\";\r\n\t\t}\r\n\t}\r\n\t\r\n\t$mysupport_onhold = $mysupport_offhold = \"\";\r\n\tif($mybb->settings['enablemysupportonhold'] == 1)\r\n\t{\r\n\t\tif(mysupport_usergroup(\"canmarksolved\"))\r\n\t\t{\r\n\t\t\t$mysupport_onhold = \"<option value=\\\"mysupport_onhold_1\\\">-- \".$lang->hold_status_onhold.\"</option>\";\r\n\t\t\t$mysupport_offhold = \"<option value=\\\"mysupport_onhold_0\\\">-- \".$lang->hold_status_offhold.\"</option>\";\r\n\t\t}\r\n\t}\r\n\t\r\n\tif($mybb->settings['enablemysupportassign'] == 1)\r\n\t{\r\n\t\t$mysupport_assign = \"\";\r\n\t\t$assign_users = mysupport_get_assign_users();\r\n\t\t// only continue if there's one or more users that can be assigned threads\r\n\t\tif(!empty($assign_users))\r\n\t\t{\r\n\t\t\tforeach($assign_users as $assign_userid => $assign_username)\r\n\t\t\t{\r\n\t\t\t\t$mysupport_assign .= \"<option value=\\\"mysupport_assign_\".intval($assign_userid).\"\\\">-- \".htmlspecialchars_uni($assign_username).\"</option>\\n\";\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tif($mybb->settings['enablemysupportpriorities'] == 1)\r\n\t{\r\n\t\t$mysupport_cache = $cache->read(\"mysupport\");\r\n\t\t$mysupport_priorities = \"\";\r\n\t\t// only continue if there's any priorities\r\n\t\tif(!empty($mysupport_cache['priorities']))\r\n\t\t{\r\n\t\t\tforeach($mysupport_cache['priorities'] as $priority)\r\n\t\t\t{\r\n\t\t\t\t$mysupport_priorities .= \"<option value=\\\"mysupport_priority_\".intval($priority['mid']).\"\\\">-- \".htmlspecialchars_uni($priority['name']).\"</option>\\n\";\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t$mysupport_categories = \"\";\r\n\t$categories_users = mysupport_get_categories($foruminfo['fid']);\r\n\t// only continue if there's any priorities\r\n\tif(!empty($categories_users))\r\n\t{\r\n\t\tforeach($categories_users as $category_id => $category_name)\r\n\t\t{\r\n\t\t\t$mysupport_categories .= \"<option value=\\\"mysupport_priority_\".intval($category_id).\"\\\">-- \".htmlspecialchars_uni($category_name).\"</option>\\n\";\r\n\t\t}\r\n\t}\r\n\t\r\n\teval(\"\\$mysupport_inline_thread_moderation = \\\"\".$templates->get('mysupport_inline_thread_moderation').\"\\\";\");\r\n}",
"public static function drawLoggingOptions()\n {\n $buildopts = array(\n 'files' => jgettext('Log file contents')\n , 'profile' => jgettext('Profile')\n );\n\n //--Get component parameters\n $params = JComponentHelper::getParams('com_easycreator');\n\n echo NL.'<div class=\"logging-options\">';\n\n $js = \"v =( $('div_buildopts').getStyle('display') == 'block') ? 'none' : 'block';\";\n $js .= \"$('div_buildopts').setStyle('display', v);\";\n\n $checked =($params->get('logging')) ? ' checked=\"checked\"' : '';\n echo NL.'<input type=\"checkbox\" onchange=\"'.$js.'\" name=\"buildopts[]\"'.$checked.' value=\"logging\" id=\"logging\" />';\n echo NL.'<label for=\"logging\">'.jgettext('Activate logging').'</label>';\n\n $style =($params->get('logging')) ? '' : ' style=\"display: none;\"';\n echo NL.' <div id=\"div_buildopts\"'.$style.'>';\n\n foreach($buildopts as $name => $titel)\n {\n //--Get component parameters\n $checked =($params->get($name)) ? ' checked=\"checked\"' : '';\n\n echo NL.' |__';\n echo NL.'<input type=\"checkbox\" name=\"buildopts[]\"'.$checked.' value=\"'.$name.'\" id=\"'.$name.'\" />';\n echo NL.'<label for=\"'.$name.'\">'.$titel.'</label><br />';\n }//foreach\n\n echo NL.' </div>';\n echo NL.'</div>';\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Function: PCO_ImportarScriptsPHP Busca definiciones de scripts PHP almacenadas sobre xml/ (carpeta del sistema para importar elementos y ejecuta cada uno automaticamente durante cada cargue de pagina por algun usuario disenador de aplicacion. Salida: Ejecucion automatica de los scripts residentes y renombrado de los mismos para evitar su posterior ejecucion | function PCO_ImportarScriptsPHP($ByPassControlDesarrollo)
{
global $ModoDesarrolladorPractico;
//Hace ejecucion de solamente si no esta en desarrollo de framework
//Esto permite que los fuentes permanezcan con los XML y scripts en trazabilidad
if ($ModoDesarrolladorPractico>=0 || $ByPassControlDesarrollo>0)
{
global $PCO_FechaOperacion,$PCO_HoraOperacion;
$ArregloElementos = array();
//Obtiene lista de archivos en xml/ para ser ejecutados
$DirectorioScripts = dir("xml/");
while (false !== ($ArchivoPHP = $DirectorioScripts->read()))
if(strtolower(substr($ArchivoPHP, -4))==".php") //Considera solo los PHP
$ArregloElementos[]=$ArchivoPHP;
$DirectorioScripts->close();
//Por cada archivo ejecuta el proceso de ejecucion correspondiente
foreach ($ArregloElementos as $ArchivoPHP)
{
//Incluye el codigo
include_once("xml/".$ArchivoPHP);
//Una vez procesado el archivo lo renombra para no ser ejecutado mas
if ($ByPassControlDesarrollo<2)
rename("xml/".$ArchivoPHP, "xml/".$ArchivoPHP.".Run_".$PCO_FechaOperacion."-".$PCO_HoraOperacion);
}
}
} | [
"function PCO_EvaluarCodigoExterno($CodigoUnicoScript,$Silenciar)\n {\n global $PCO_ArchivoScript,$PCOSESS_LoginUsuario;\n \n //Determina si debe o no silenciar la salida de la ejecucion. Cualquier valor silencia la salida\n $SilenciarSalida=\"No\";\n if ($Silenciar!=\"\") \n $SilenciarSalida=\"Si\";\n \n $ResultadoEvaluacionScript=\"\";\n \n //Recupera detalles del script \n $RegistroScript=PCO_EjecutarSQL(\"SELECT * FROM core_scripts WHERE codigo='$CodigoUnicoScript'\")->fetch();\n if ($RegistroScript[\"id\"]!=\"\")\n {\n //Lleva estadística de ejecuciones \n PCO_EjecutarSQLUnaria(\"UPDATE core_scripts SET ejecuciones=ejecuciones+1 WHERE codigo='$CodigoUnicoScript'\");\n \n //Sin importar el lenguaje, reemplaza cualquier variable en notacion PHP sobre el script deseado dando asi compatibilidad al transporte de variables entre lenguajes\n $Script_CUERPO=PCO_ReemplazarVariablesPHPEnCadena($RegistroScript[\"cuerpo\"]);\n $Script_LENGUAJE=trim($RegistroScript[\"lenguaje\"]);\n $Script_MODOEJECUCION=trim($RegistroScript[\"modo_ejecucion\"]);\n \n //Segun el lenguaje busca como ejecutarlo\n $RegistroLenguaje=PCO_EjecutarSQL(\"SELECT * FROM core_scripts_lenguajes WHERE nombre='$Script_LENGUAJE'\")->fetch();\n $Lenguaje_CMD_COMPILACION=trim($RegistroLenguaje[\"comando_compilacion\"]);\n $Lenguaje_CMD_EJECUCION=trim($RegistroLenguaje[\"comando_ejecucion\"]);\n $Lenguaje_EXTENSIONES=trim($RegistroLenguaje[\"extensiones\"]);\n $Lenguaje_PRIMERAEXTENSION=explode(\"|\",$Lenguaje_EXTENSIONES);\n $Lenguaje_PRIMERAEXTENSION=$Lenguaje_PRIMERAEXTENSION[0];\n \n //Escapa las cadenas asociadas a compilacion y ejecucion\n //Advertencia: Si se va a permitir que datos provenientes del usuario son escapados para asegurarse que el usuario no intenta engañar al sistema para que ejecute comandos arbitrarios\n $Lenguaje_CMD_COMPILACION = escapeshellcmd($Lenguaje_CMD_COMPILACION);\n $Lenguaje_CMD_EJECUCION = escapeshellcmd($Lenguaje_CMD_EJECUCION);\n //Escapa espacios, en caso de estar corriendo un PHP bajo windows y donde el comando tenga espacios en su path\n $Lenguaje_CMD_COMPILACION = preg_replace('`(?<!^) `', '^ ', escapeshellcmd($Lenguaje_CMD_COMPILACION));\n $Lenguaje_CMD_EJECUCION = preg_replace('`(?<!^) `', '^ ', escapeshellcmd($Lenguaje_CMD_EJECUCION));\n\n //Valida que el lenguaje si este configurado para ejecutarse en el entorno actual\n if ($Lenguaje_CMD_EJECUCION!=\"\")\n {\n //Si el lenguaje es PHP no usa el metodo externo, se redirecciona al interno para tomar todos los contextos y funciones del framework\n if($Script_LENGUAJE==\"PHP\")\n {\n PCO_Auditar(\"Usuario={$PCOSESS_LoginUsuario} EjecutaScript={$CodigoUnicoScript} Lenguaje={$Script_LENGUAJE}\",\"SQLog:scripts\");\n PCO_EvaluarCodigo($Script_CUERPO);\n }\n else\n {\n //Crea un archivo temporal con el contenido del script\n \t$ArchivoInclusionTemporal=PCO_GenerarArchivoTemporal();\n \t$MetadatosArchivoCreado = stream_get_meta_data ( $ArchivoInclusionTemporal );\n \t$RutaArchivoTemporal = $MetadatosArchivoCreado ['uri'];\n \n fwrite ( $ArchivoInclusionTemporal, $Script_CUERPO );\n \n //Hace una copia del archivo temporal sobre la carpeta temporal del framework que se garantiza escritura para proceso de compilacion\n $ArchivoAleatorio=\"PCOScript_\".PCO_TextoAleatorio(20);\n $RutaArchivoFuente = \"tmp/practico_scripts/\".$ArchivoAleatorio.\".\".$Lenguaje_PRIMERAEXTENSION;\n @copy($RutaArchivoTemporal, $RutaArchivoFuente);\n \n //Si el lenguaje esta configurado para ser compilado entonces hace proceso de compilacion\n //TODO\n if (trim($Lenguaje_CMD_COMPILACION)!=\"\")\n {\n echo \"Scripts externos compilados no disponibles en este sistema.\";\n /*\n //Ejecuta reemplazo de variable PCO_ArchivoScript dentro de los compandos en caso que se requiera\n $PCO_ArchivoScript=$RutaArchivoFuente; //Asigna ruta generada temporal a la variable para que sea reemplazada en el comando\n $Lenguaje_CMD_COMPILACION=PCO_ReemplazarVariablesPHPEnCadena($Lenguaje_CMD_COMPILACION);\n \n //Su ubica en el path de instalacion del Framework para correr desde alli los comandos de compilacion\n chdir(getcwd().\"/tmp/practico_scripts\");\n //echo system(\"cd \".getcwd().\"/tmp\".\"; \".$Lenguaje_CMD_COMPILACION.\" \".$RutaArchivoFuente);\n \n //system(\"gcc -o {$ArchivoAleatorio}.out {$ArchivoAleatorio}.c \");\n //system(\"./{$ArchivoAleatorio}.out\");\n \n \n $ResultadoCompilacion=system($Lenguaje_CMD_COMPILACION.\" \".$RutaArchivoFuente);\n \n // echo \"Temp=\".$RutaArchivoTemporal;\n // echo \"Comp=\".$RutaArchivoFuente;\n // echo \"CMD=\".$Lenguaje_CMD_COMPILACION.\" \".$RutaArchivoFuente;\n // $RutaArchivoTemporal=$RutaArchivoTemporal.\".out\";\n // $Lenguaje_CMD_EJECUCION=\"./\";\n // $ResultadoEvaluacionScript=system($Lenguaje_CMD_EJECUCION.\" \".$RutaArchivoTemporal);\n \n //Elimina archivo fuente copiado para compilacio\n @unlink ($RutaArchivoFuente);\n */\n }\n \n \n //Ejecuta el script\n try\n {\n //Ejecuta reemplazo de variable PCO_ArchivoScript dentro de los compandos en caso que se requiera\n $PCO_ArchivoScript=$RutaArchivoTemporal; //Asigna ruta generada temporal a la variable para que sea reemplazada en el comando\n $Lenguaje_CMD_EJECUCION=PCO_ReemplazarVariablesPHPEnCadena($Lenguaje_CMD_EJECUCION);\n \n //TODO OPCIONAL: intentar la ejecucion del comando base para determinar su codigo de salida y posible error previamente\n \n //Por ahora asume comando solo de ejecucion (lenguajes interpretados)\n PCO_Auditar(\"Usuario={$PCOSESS_LoginUsuario} EjecutaScript={$CodigoUnicoScript} Lenguaje={$Script_LENGUAJE} Modo={$Script_MODOEJECUCION} Comando={$Lenguaje_CMD_EJECUCION} Archivo={$ArchivoAleatorio}\",\"SQLog:scripts\");\n \n \n if ($Script_MODOEJECUCION==\"shell_exec\")\n {\n \tif (function_exists('shell_exec'))\n $ResultadoEvaluacionScript=shell_exec($Lenguaje_CMD_EJECUCION.\" \".$RutaArchivoTemporal);\n else\n echo \"Su instalacion de PHP en el servidor no tiene soporte para la funcion shell_exec\";\n }\n if ($Script_MODOEJECUCION==\"exec\")\n {\n if (function_exists('exec'))\n $ResultadoEvaluacionScript=exec($Lenguaje_CMD_EJECUCION.\" \".$RutaArchivoTemporal);\n else\n echo \"Su instalacion de PHP en el servidor no tiene soporte para la funcion exec\";\n }\n if ($Script_MODOEJECUCION==\"system\")\n {\n if (function_exists('system'))\n $ResultadoEvaluacionScript=system($Lenguaje_CMD_EJECUCION.\" \".$RutaArchivoTemporal);\n else\n echo \"Su instalacion de PHP en el servidor no tiene soporte para la funcion system\";\n }\n if ($Script_MODOEJECUCION==\"passthru\")\n {\n if (function_exists('passthru'))\n $ResultadoEvaluacionScript=passthru($Lenguaje_CMD_EJECUCION.\" \".$RutaArchivoTemporal);\n else\n echo \"Su instalacion de PHP en el servidor no tiene soporte para la funcion passthru\";\n }\n }\n catch (Exception $e)\n {\n $MensajeErrorEjecucion=\"Usuario={$PCOSESS_LoginUsuario} ErrorDeScript={$CodigoUnicoScript} Lenguaje={$Script_LENGUAJE} Archivo={$ArchivoAleatorio}: \".$e->getMessage();\n echo $MensajeErrorEjecucion;\n PCO_Auditar($MensajeErrorEjecucion,\"SECLog:event\");\n }\n \n //Cierra el archivo de script y ademas lo elimina\n fclose ( $ArchivoInclusionTemporal );\n } //Fin Si no es PHP\n }\n else\n {\n PCO_Auditar(\"{$PCOSESS_LoginUsuario} Error Script={$CodigoUnicoScript} Lenguaje={$Script_LENGUAJE}: Entorno de ejecucion no configurado\",\"SECLog:event\");\n }\n }\n else\n {\n PCO_Auditar(\"{$PCOSESS_LoginUsuario} Error Script={$CodigoUnicoScript} inexistente!\",\"SECLog:event\");\n }\n \n //Entrega salida de ejecucion del script (si se requiere)\n if ($SilenciarSalida==\"No\")\n echo($ResultadoEvaluacionScript);\n else\n echo \"\";\n }",
"function imprimirScriptsPedidos() {?>\n\t<script language=\"JavaScript\" type=\"text/javascript\">\n\t\n\t\tfunction modificar_pedido(id_pedido){\n\t\t\tventana=window.open(\"modificar_pedido.php?id_pedido=\"+id_pedido,\"\",\"dependent=yes,toolbar=no,width=700 ,height=500, scrollbars=yes\"); \n\t\t}\n\t \n\t \tfunction mostrar_busquedas(id_pedido){\n\t\t\tventana=window.open(\"mostrar_busquedas.php?id_pedido=\"+id_pedido, \"\" , \"dependent=yes,toolbar=no, width=\"+(screen.width - 300)+\",height=\"+(screen.height - 300)+\",scrollbars=yes\");\n\t\t}\n\t\t\n\t\tfunction generar_evento(codigo_evento, id_pedido){\n\t\t\tventana=window.open(\"generar_evento.php?id_pedido=\"+id_pedido+\"&codigo_evento=\" + codigo_evento, \"\", \"dependent=yes,toolbar=no,width=530 ,height=380\");\n\t\t}\n\t\t\n\t\tfunction mostrar_evento(id_evento){\n\t\t\tventana=window.open(\"mostrar_evento.php?id_evento=\"+id_evento, \"\", \"dependent=yes,toolbar=no, width=530 ,height=450,scrollbars=yes\");\n\t\t}\n\t\t\n\t\tfunction entregar_todo(codigo_evento,id_usuario,id_estado){\n\t\t\tventana=window.open(\"registrar_entregas.php?id_usuario=\"+id_usuario+\"&codigo_evento=\"+codigo_evento+\"&id_estado=\"+id_estado, \"\", \"dependent=yes,toolbar=no,width=530 ,height=380\");\n\t\t}\n\t\t\n\t\tfunction mostar_eventos_simple(id_pedido,codigo_evento){\n\t\t\tventana=window.open(\"../pedidos2/listar_eventos_simple.php?id_pedido=\" + id_pedido + \"&codigo_evento=\" + codigo_evento, \"\", \"dependent=yes,toolbar=no,width=630 ,height=250\");\n\t\t}\n\t\t\n\t\tfunction revisar_solicitud(id_instancia_celsius,id_pedido){\n\t\t\tventana=window.open(\"mostrar_eventos_destino_remoto.php?id_pedido=\"+id_pedido+'&id_instancia_remota='+id_instancia_celsius, \"Evento Destino Remoto\" + id_pedido, \"dependent=yes,toolbar=no, width=800 ,height=600,scrollbars=yes\");\n\t\t}\n\t</script>\n\t<?\n}",
"public function importScriptingToRegistry()\n\t{\n\t\t$scripting = $this->loadScripting();\n\t\t$configuration = Factory::getConfiguration();\n\t\t$configuration->mergeArray($scripting['data'], false);\n\t}",
"private function antes_de_executar_sql(){\r\n if ($this->inc_antes_de_executar_sql != \"\"){\r\n \t\t//Adiciona arquivo que deve ser executa antes de executar o SQL\r\n\t \tinclude($this->inc_antes_de_executar_sql);\r\n\t }\r\n\t}",
"function SCREDIT_newScriptTemplate()\n{\n\treturn('<?PHP\n/*\nDescription: Enter your description here\nPriority: Enter the priority number here (scripts with lower numbers get executed earlier)\n*/\n\n/*\n\tThis program is free software: you can redistribute it and/or modify\n\tit under the terms of the GNU General Public License as published by\n\tthe Free Software Foundation, either version 3 of the License, or\n\t(at your option) any later version.\n\n\tThis program is distributed in the hope that it will be useful,\n\tbut WITHOUT ANY WARRANTY; without even the implied warranty of\n\tMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\tGNU General Public License for more details.\n\n\tYou should have received a copy of the GNU General Public License\n\talong with this program. If not, see <http://www.gnu.org/licenses/>.\n*/\n\ninclude (\"/m23/data+scripts/packages/m23CommonInstallRoutines.php\");\ninclude (\"/m23/inc/distr/debian/clientConfigCommon.php\");\n\nfunction run($id)\n{\n\t/*\n\t\tSet variables:\n\t\t\t$id: is the numer of the current job\n\t\t\t\n\t\tUsefull funtion calls:\n\t\t\tPKG_getPackageParams($id): Get all parameters of the packages\n\t\t\t$clientParams=CLIENT_getAskingParams(): Get all parameters of the client\n\t\t\tsendClientStatus($id,\"done\"): Change the status of the current script\n\t\t\tMSR_logCommand($logFile): A text file from the client to the client\\'s log in the m23 database\n\t\t\t\n\t\tExample (Send last 5 lines of the sources.list to the m23 client\\'s log):\n\t\t\n\t\t\techo(\"cat /etc/apt/sources.list | tail -5 > /tmp/last5Lines\n\t\t\t\");\n\t\t\tMSR_logCommand(\"/tmp/last5Lines\");\n\t\t\t\n\t*/\n\n\tsendClientStatus($id,\"done\");\n\texecuteNextWork();\n};\n?>');\n}",
"public function taskParseXMLLibraries(): void\n {\n $objectManager = GeneralUtility::makeInstance(ObjectManager::class);\n $uniqueId = null;\n $key = null;\n try {\n $dir = GeneralUtility::getFileAbsFileName('fileadmin/user_upload/citavi_upload/');\n //$this->initTSFE($this->getRootpage($objectManager));\n //$settings = $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_nwcitavi.']['settings.'];\n $configurationManager = $objectManager->get(ConfigurationManager::class);\n $fullTs = $configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT);\n $settings = $fullTs['plugin.']['tx_nwcitavi.']['settings.'];\n $check = file_exists($dir.'/scheduler.txt');\n if($check) {\n $taskExists = file_exists($dir.'/task.txt');\n if($taskExists) {\n $taskString = file_get_contents ( $dir.'/task.txt' );\n $taskCols = explode('|', $taskString);\n if((int)$taskCols[0] === 2) {\n $schedulerString = file_get_contents ( $dir.'/scheduler.txt' );\n $schedulerCols = explode('|', $schedulerString);\n [$fileName, $key, $uniqueId] = $schedulerCols;\n $xml = new \\XMLReader();\n $xml->open($fileName);\n $xmlString = implode('', file($fileName));\n $xml = simplexml_load_string($xmlString);\n $json = json_encode($xml);\n $array = json_decode($json,TRUE);\n try {\n \tif ( is_array( $array['Libraries']['Library'] ) ) {\n $this->truncateDatabase('tx_nwcitavi_domain_model_libraryhash');\n foreach ($array['Libraries']['Library'] as $iValue) {\n if($array['Libraries']['Library']['@attributes']) {\n $library = $array['Libraries']['Library'];\n } else {\n $library = $iValue;\n }\n if(!empty($library['@attributes']['ID'])) {\n $refStr = $this->generatedHash($library);\n $hash = hash('md5', $refStr);\n $this->insertInHashTable( 'LibraryHash', $hash, ($settings['sPid']) ?: '0');\n $columnExists = $this->columnExists('LibraryRepository', $library['@attributes']['ID'], 'tx_nwcitavi_domain_model_library');\n $this->setDatabase($library, 'Library', $columnExists, $hash, $key, $uniqueId, $settings);\n }\n unset($library, $libraryAttributes, $db_library, $libraryUid);\n }\n $this->deletedDatabaseColumns('tx_nwcitavi_domain_model_library', 'tx_nwcitavi_domain_model_libraryhash', $settings);\n file_put_contents($dir.'/task.txt', 3);\n \t} else {\n \t file_put_contents($dir.'/task.txt', 3);\n \t}\n } catch (Exception $e) {\n $this->logRepository->addLog(1, 'Libraries could not be generated. Fehler: '.$e, 'Parser', ''.$uniqueId.'', '[Citavi Parser]: Task was terminated.', ''.$key.'');\n }\n }\n }\n }\n } catch (Exception $e) {\n $this->logRepository->addLog(1, 'Fehler: '.$e.'', 'Parser', ''.$uniqueId.'', '[Citavi Parser]: Task was terminated.', ''.$key.'');\n }\n }",
"function script() {\n\n global $server, $user, $password, $drupal5, $drupal6;\n\n $string = array($drupal5, $drupal6, $user);\n $search = array(\n 'DATABASE_PLACEHOLDER_DRUPAL5',\n 'DATABASE_PLACEHOLDER_DRUPAL6',\n 'DATABASE_PLACEHOLDER_USER',\n );\n\n e('Preparando base de datos NUEVA ' . $drupal6 . '...');\n $dump = 'DUMP.sql';\n $temp = 'COMPANY.sql';\n if (file_exists($temp)) {\n $data = \"/**\n * tecnocat\n *\n * @section LICENSE\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n * @details Company migration proccess\n * @category Migration\n * @version \\$Id: Script.sql 0 2012-02-22 09:14:34 $\n * @author tecnocat\n * @file /Script.sql\n * @date 2012-02-22 09:14:34\n * @copyright GNU Public License.\n * @link http://www.gnu.org/licenses/gpl.html\n */\n\n/*!40101 SET NAMES utf8 */;\n\n/*!40101 SET SQL_MODE=''*/;\n\n/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;\n/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;\n/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;\n/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;\nCREATE DATABASE /*!32312 IF NOT EXISTS*/`DATABASE_PLACEHOLDER_DRUPAL6` /*!40100 DEFAULT CHARACTER SET latin1 */;\n\nUSE `DATABASE_PLACEHOLDER_DRUPAL6`;\\n\\n\";\n $data .= file_get_contents($temp);\n $data = str_replace($search, $string, $data);\n $fp = fopen($dump, 'w');\n fwrite($fp, $data);\n fclose($fp);\n if (file_exists($dump)) {\n exec(\"mysql -u$user -p$password -h$server < $dump\");\n unlink($dump);\n }\n else {\n die(e('ERROR: No se puede crear archivo necesario ' . $dump . ', abortando...'));\n }\n }\n else {\n die(e('ERROR: No se encuentra archivo necesario ' . $temp . ', abortando...'));\n }\n\n e('Abriendo base de datos VIEJA ' . $drupal5 . '...');\n $link5 = db_open($drupal5);\n e('Abriendo base de datos NUEVA ' . $drupal6 . '...');\n $link6 = db_open($drupal6);\n\n $file = 'Script.sql';\n e('Preparando archivo de salida ' . $file . '...');\n\n if (file_exists($file)) {\n e('Archivo existente, BORRANDO...');\n unlink($file);\n }\n e('Abriendo archivo ' . $file . ' para escribir...');\n $fp = fopen($file, 'w');\n $temp = 'SQL1.sql';\n if (file_exists($temp)) {\n $data = file_get_contents($temp);\n $data = str_replace($search, $string, $data);\n fwrite($fp, $data);\n }\n else {\n die(e('ERROR: No se encuentra archivo necesario ' . $temp . ', abortando...'));\n }\n\n e('Procesando palabras clave...');\n $data = \"\n-- Reset some terms\nDELETE FROM `$drupal6`.`term_data` WHERE `term_data`.`vid` IN (6, 9, 15);\nDELETE FROM `$drupal6`.`term_node`;\n\n-- Copy terms\";\n fwrite($fp, $data);\n\n $query = \"SELECT * FROM `content_field_palabras_clave`\";\n $rows = db_fetch(db_query($link5, $query));\n\n foreach ($rows as $row) {\n\n extract($row);\n $tags = explode(',', $field_palabras_clave_value);\n\n foreach ($tags as $tag) {\n\n $tag = trim($tag);\n $query = \"SELECT `tid` FROM `$drupal6`.`term_data` WHERE `vid` = '9' AND `name` = '$tag'\";\n $result = db_fetch(db_query($link6, $query));\n\n if (!$result) {\n $query = \"INSERT INTO `$drupal6`.`term_data` (`vid`, `name`, `description`) VALUES ('9', '$tag', '');\";\n fwrite($fp, \"\\n$query\");\n db_query($link6, $query);\n }\n\n $query = \"INSERT INTO `$drupal6`.`term_node` (`nid`, `vid`, `tid`) VALUES ('$nid', '$vid', (SELECT `tid` FROM `$drupal6`.`term_data` WHERE `vid` = '9' AND `name` = '$tag'));\";\n fwrite($fp, \"\\n$query\");\n db_query($link6, $query);\n }\n }\n\n $temp = 'SQL2.sql';\n if (file_exists($temp)) {\n $data = file_get_contents($temp);\n $data = str_replace($search, $string, $data);\n fwrite($fp, \"\\n\\n\" . $data);\n }\n else {\n die(e('ERROR: No se encuentra archivo necesario ' . $temp . ', abortando...'));\n }\n\n e('Procesando permisos antiguos...');\n $data = \"\n/*******************************************************************************\n * PERMISSIONS PROCCESS\n ******************************************************************************/\n-- Reset all perms\nTRUNCATE `$drupal6`.`acl`;\nTRUNCATE `$drupal6`.`acl_node`;\nTRUNCATE `$drupal6`.`acl_user`;\nTRUNCATE `$drupal6`.`content_access`;\nTRUNCATE `$drupal6`.`node_access`;\n\";\n fwrite($fp, \"\\n\" . $data);\n $query = \"\n SELECT `node`.`nid`, `term_node`.`tid`\n FROM `node`\n INNER JOIN `term_node` ON `term_node`.`nid` = `node`.`nid`\n WHERE `term_node`.`tid` BETWEEN 100 AND 102\n ORDER BY `node`.`nid` ASC\n \";\n $rows = db_fetch(db_query($link5, $query));\n $aclid = 0;\n $data = '-- Copy perms';\n\n foreach ($rows as $row) {\n\n extract($row);\n\n foreach (array('view', 'update', 'delete') as $state) {\n\n $aclid++;\n $grant_view = ($state == 'view') ? 1 : 0;\n $grant_update = ($state == 'update') ? 1 : 0;\n $grant_delete = ($state == 'delete') ? 1 : 0;\n $data .= \"\nINSERT INTO `$drupal6`.`acl` (`acl_id`, `module`, `name`) VALUES ('$aclid', 'content_access', '{$state}_{$nid}');\nINSERT INTO `$drupal6`.`acl_node` (`acl_id`, `nid`, `grant_view`, `grant_update`, `grant_delete`) VALUES ('$aclid', '$nid', '$grant_view', '$grant_update', '$grant_delete');\";\n }\n\n $roles = array(\n '4' => 'Servicios Centrales',\n '5' => 'Servicios Provinciales',\n '6' => 'Editor',\n '7' => 'Administrator',\n );\n\n // Default settings\n $permissions = array(\n 'view' => array(6, 7),\n 'view_own' => array(6, 7),\n 'update' => array(7),\n 'update_own' => array(7),\n 'delete' => array(7),\n 'delete_own' => array(7),\n );\n\n foreach ($roles as $rol => $dummy) {\n\n // 100 = Servicios Provinciales\n // 101 = Servicios Centrales\n // 102 = Ambos\n\n if ($tid == 100) {\n if ($rol == 4) {\n continue;\n }\n if (!in_array($rol, $permissions['view'])) {\n $permissions['view'][] = $rol;\n }\n }\n elseif ($tid == 101) {\n if ($rol == 5) {\n continue;\n }\n if (!in_array($rol, $permissions['view'])) {\n $permissions['view'][] = $rol;\n }\n }\n elseif ($tid == 102) {\n if (!in_array(4, $permissions['view'])) {\n $permissions['view'][] = 4;\n }\n if (!in_array(5, $permissions['view'])) {\n $permissions['view'][] = 5;\n }\n }\n\n $settings = serialize($permissions);\n $state = 'view'; // Maybe change this?\n $grant_view = ($state == 'view') ? 1 : 0;\n $grant_update = ($state == 'update') ? 1 : 0;\n $grant_delete = ($state == 'delete') ? 1 : 0;\n $data .= \"\n\" . (($rol == 7) ? \"INSERT INTO `$drupal6`.`content_access` (`nid`, `settings`) VALUES ('$nid', '$settings');\\n\" : '') . \"INSERT INTO `$drupal6`.`node_access` (`nid`, `gid`, `realm`, `grant_view`, `grant_update`, `grant_delete`) VALUES ('$nid', '$rol', 'content_access_rid', '$grant_view', '$grant_update', '$grant_delete');\";\n }\n }\n fwrite($fp, \"\\n\" . $data);\n\n e('Procesando sistema de validación final...');\n $data = \"\n/*******************************************************************************\n * VALIDATION PROCCESS\n ******************************************************************************/\n-- Check results\nSELECT DISTINCT\n (SELECT COUNT(`users`.`name`) FROM `$drupal5`.`users`) AS 'Usuarios Vieja',\n (SELECT COUNT(`users`.`name`) FROM `$drupal6`.`users`) AS 'Usuarios Nueva',\n COUNT(v.`nid`) AS 'Contenidos Vieja',\n v.`type` AS 'Type',\n COUNT(n.`nid`) AS 'contenidos Nueva'\nFROM `$drupal5`.`node` v\nLEFT JOIN `$drupal6`.`node` n ON v.`type` = n.`type`\nGROUP BY v.`nid`, v.`type`, n.`type`\nORDER BY COUNT(v.`type`) DESC;\";\n fwrite($fp, \"\\n\" . $data);\n\n e('Cerrando archivo ' . $file . '...');\n fclose($fp);\n e('Cerrando base de datos NUEVA ' . $drupal6 . '...');\n db_close($link6);\n e('Cerrando base de datos VIEJA ' . $drupal5 . '...');\n db_close($link5);\n e('Finalizado, ejecute el archivo ' . realpath($file) . ' con un gestor de MySQL.');\n}",
"public function register_scripts(){}",
"public function getInsertScripts()\n\t{\n\t\t$escaper = new Escaper();\n\t\t$url = $this->getDI()->get('url');\n\t\t$scripts = \"\";\n\n\t\t$css = array('/pdw-assets/style.css', '/pdw-assets/lib/prism/prism.css');\n\t\tforeach ($css as $src) {\n\t\t\t$link = $url->get($src);\n\t\t\t$link = str_replace(\"//\", \"/\", $link);\n\t\t\t$scripts .= \"<link rel='stylesheet' type='text/css' href='\" . $escaper->escapeHtmlAttr($link) . \"' />\";\n\t\t}\n\n\t\t$js = array(\n\t\t\t\t'/pdw-assets/jquery.min.js',\n\t\t\t\t'/pdw-assets/lib/prism/prism.js',\n\t\t\t\t'/pdw-assets/pdw.js'\n\t\t);\n\t\tforeach ($js as $src) {\n\t\t\t$link = $url->get($src);\n\t\t\t$link = str_replace(\"//\", \"/\", $link);\n\t\t\t$scripts .= \"<script tyle='text/javascript' src='\" . $escaper->escapeHtmlAttr($link) . \"'></script>\";\n\t\t}\n\n\t\treturn $scripts;\n\t}",
"public abstract static function maybe_load_scripts();",
"function getScripts () {\r\n\r\n }",
"public function _prepare_admin_scripts() {\n\t\t$this->forward_known_scripts();\n\t\t$this->autoload_known_scripts();\n\t}",
"function PCO_ImportarXMLFormulario($xml_importado)\n {\n global $ListaCamposSinID_menu,$ListaCamposSinID_evento_objeto,$_SeparadorCampos_,$TablasCore,$ListaCamposSinID_formulario,$ConexionPDO,$ListaCamposSinID_formulario_objeto,$ListaCamposSinID_formulario_boton;\n $xml_importado = @simplexml_load_string($xml_importado); // Usa SimpleXML Directamente para interpretar cadena\n\n\t\t\t\t//Si es tipo estatico elimina el formulario existente con el mismo ID\n\t\t\t\t$ListaCamposParaID=\"\";\n\t\t\t\t$InterroganteParaID=\"\";\n\t\t\t\t$ValorInsercionParaID=\"\";\n\t\t\t\tif ($xml_importado->descripcion[0]->tipo_exportacion==\"XML_IdEstatico\")\n\t\t\t\t\t{\n\t\t\t\t\t\t$ListaCamposParaID=\"id,\";\n\t\t\t\t\t\t$InterroganteParaID=\"?,\";\n\t\t\t\t\t\t$ValorInsercionParaID=base64_decode($xml_importado->core_formulario[0]->id).$_SeparadorCampos_;\n\t\t\t\t\t\tPCO_EliminarFormulario(base64_decode($xml_importado->core_formulario[0]->id));\n\t\t\t\t\t}\n\n\t\t\t\t// Establece valores para cada campo a insertar en el nuevo form\n\t\t\t\t/* ##########################################################################################################*/\n\t\t\t\t/* ####### IMPORTANTE: Ajustes sobre esta funcion se deberian replicar en funcion de copia asociadas ########*/\n\t\t\t\t/* ##########################################################################################################*/\n\t\t\t\t$titulo=base64_decode($xml_importado->core_formulario[0]->titulo);\n\t\t\t\t$ayuda_titulo=base64_decode($xml_importado->core_formulario[0]->ayuda_titulo);\n\t\t\t\t$ayuda_texto=base64_decode($xml_importado->core_formulario[0]->ayuda_texto);\n\t\t\t\t$tabla_datos=base64_decode($xml_importado->core_formulario[0]->tabla_datos);\n\t\t\t\t$columnas=base64_decode($xml_importado->core_formulario[0]->columnas);\n\t\t\t\t$javascript=base64_decode($xml_importado->core_formulario[0]->javascript);\n\t\t\t\t$borde_visible=base64_decode($xml_importado->core_formulario[0]->borde_visible);\n\t\t\t\t$estilo_pestanas=base64_decode($xml_importado->core_formulario[0]->estilo_pestanas);\n\t\t\t\t$id_html=base64_decode($xml_importado->core_formulario[0]->id_html);\n\t\t\t\t$tipo_maquetacion=base64_decode($xml_importado->core_formulario[0]->tipo_maquetacion);\n\t\t\t\t$css_columnas=base64_decode($xml_importado->core_formulario[0]->css_columnas);\n\t\t\t\t$estilo_ventana=base64_decode($xml_importado->core_formulario[0]->estilo_ventana);\n\t\t\t\t$pre_script=base64_decode($xml_importado->core_formulario[0]->pre_script);\n\t\t\t\t$post_script=base64_decode($xml_importado->core_formulario[0]->post_script);\n\t\t\t\t$modulo=base64_decode($xml_importado->core_formulario[0]->modulo);\n\t\t\t\t// Inserta el nuevo objeto al form\n\t\t\t\tPCO_EjecutarSQLUnaria(\"INSERT INTO \".$TablasCore.\"formulario (\".$ListaCamposParaID.$ListaCamposSinID_formulario.\") VALUES (\".$InterroganteParaID.\"?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) \",\"$ValorInsercionParaID$titulo$_SeparadorCampos_$ayuda_titulo$_SeparadorCampos_$ayuda_texto$_SeparadorCampos_$tabla_datos$_SeparadorCampos_$columnas$_SeparadorCampos_$javascript$_SeparadorCampos_$borde_visible$_SeparadorCampos_$estilo_pestanas$_SeparadorCampos_$id_html$_SeparadorCampos_$tipo_maquetacion$_SeparadorCampos_$css_columnas$_SeparadorCampos_$estilo_ventana$_SeparadorCampos_$pre_script$_SeparadorCampos_$post_script$_SeparadorCampos_$modulo\");\n\n\t\t\t\t//Determina el ID del registro\n\t\t\t\tif ($xml_importado->descripcion[0]->tipo_exportacion==\"XML_IdEstatico\")\n\t\t\t\t\t$idObjetoInsertado=base64_decode($xml_importado->core_formulario[0]->id);\n\t\t\t\telse\n\t\t\t\t\t$idObjetoInsertado=PCO_ObtenerUltimoIDInsertado($ConexionPDO);\n\n\t\t\t\t// Busca los elementos que componen el formulario para hacerles la copia\n\t\t\t\t//Determina cuantos campos tiene la tabla\n\t\t\t\t$ArregloCampos=explode(',',$ListaCamposSinID_formulario_objeto);\n\t\t\t\t$TotalCampos=count($ArregloCampos);\n\t\t\t\t// Registros de formulario_objeto\n\t\t\t\tfor ($PCO_i=0;$PCO_i<$xml_importado->total_core_formulario_objeto[0]->cantidad_objetos;$PCO_i++)\n\t\t\t\t\t{\n\t\t\t\t\t\t//Genera cadena de interrogantes y valores segun cantidad de campos\n\t\t\t\t\t\t$CadenaInterrogantes='?'; //Agrega el primer interrogante\n\t\t\t\t\t\t$CadenaValores=base64_decode($xml_importado->core_formulario_objeto[$PCO_i]->tipo);\n\n\t\t\t\t\t\tfor ($PCOCampo=1;$PCOCampo<$TotalCampos;$PCOCampo++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//Cadena de interrogantes\n\t\t\t\t\t\t\t\t$CadenaInterrogantes.=',?';\n\t\t\t\t\t\t\t\t//Cadena de valores (el campo No 5 corresponde al ID de formulario nuevo)\n\t\t\t\t\t\t\t\tif ($PCOCampo!=5)\n\t\t\t\t\t\t\t\t\t$CadenaValores.=$_SeparadorCampos_.base64_decode($xml_importado->core_formulario_objeto[$PCO_i]->{$ArregloCampos[$PCOCampo]});\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t$CadenaValores.=$_SeparadorCampos_.$idObjetoInsertado;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t//Inserta el nuevo objeto al form\n\t\t\t\t\t\tPCO_EjecutarSQLUnaria(\"INSERT INTO \".$TablasCore.\"formulario_objeto ($ListaCamposSinID_formulario_objeto) VALUES ($CadenaInterrogantes) \",\"$CadenaValores\");\n\n //Determina cual fue el ID para el ultimo elemento insertado\n\t\t\t\t\t\t$idObjetoInsertadoParaEvento=PCO_ObtenerUltimoIDInsertado($ConexionPDO);\n //Averigua el ID ORIGINAL del objeto recien insertado\n $IDOriginalObjeto=base64_decode($xml_importado->core_formulario_objeto[$PCO_i]->id);\n //Recorre la lista de todos los eventos en el XML\n \t\t\t\tfor ($PCO_iEvento=0;$PCO_iEvento<$xml_importado->total_core_evento_objeto[0]->cantidad_objetos;$PCO_iEvento++)\n \t\t\t\t\t{\n \t\t\t\t\t $RegistroEvento_id=base64_decode($xml_importado->core_evento_objeto[$PCO_iEvento]->id);\n \t\t\t\t\t $RegistroEvento_objeto=base64_decode($xml_importado->core_evento_objeto[$PCO_iEvento]->objeto);\n \t\t\t\t\t $RegistroEvento_evento=base64_decode($xml_importado->core_evento_objeto[$PCO_iEvento]->evento);\n \t\t\t\t\t $RegistroEvento_javascript=base64_decode($xml_importado->core_evento_objeto[$PCO_iEvento]->javascript);\n //Si el objeto del evento original es igual al id original del evento recien insertado crea el nuevo registro de evento\n if ($RegistroEvento_objeto==$IDOriginalObjeto)\n {\n \t\t\t\t\t\t\t\t\t$CadenaValoresEventos=\"{$idObjetoInsertadoParaEvento}{$_SeparadorCampos_}{$RegistroEvento_evento}{$_SeparadorCampos_}{$RegistroEvento_javascript}\";\n \t\t\t\t\t\t\t\t\tPCO_EjecutarSQLUnaria(\"INSERT INTO \".$TablasCore.\"evento_objeto ($ListaCamposSinID_evento_objeto) VALUES (?,?,?) \",\"$CadenaValoresEventos\");\n }\n \t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t//Determina cuantos campos tiene la tabla\n\t\t\t\t$ArregloCampos=explode(',',$ListaCamposSinID_formulario_boton);\n\t\t\t\t$TotalCampos=count($ArregloCampos);\n\t\t\t\t// Registros de formulario_boton\n\t\t\t\tfor ($PCO_i=0;$PCO_i<$xml_importado->total_core_formulario_boton[0]->cantidad_objetos;$PCO_i++)\n\t\t\t\t\t{\n\t\t\t\t\t\t//Genera cadena de interrogantes y valores segun cantidad de campos\n\t\t\t\t\t\t$CadenaInterrogantes='?'; //Agrega el primer interrogante\n\t\t\t\t\t\t$CadenaValores=base64_decode($xml_importado->core_formulario_boton[$PCO_i]->titulo);\n\n\t\t\t\t\t\tfor ($PCOCampo=1;$PCOCampo<$TotalCampos;$PCOCampo++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//Cadena de interrogantes\n\t\t\t\t\t\t\t\t$CadenaInterrogantes.=',?';\n\t\t\t\t\t\t\t\t//Cadena de valores (el campo No 2 corresponde al ID de formulario nuevo)\n\t\t\t\t\t\t\t\tif ($PCOCampo!=2)\n\t\t\t\t\t\t\t\t\t$CadenaValores.=$_SeparadorCampos_.base64_decode($xml_importado->core_formulario_boton[$PCO_i]->{$ArregloCampos[$PCOCampo]});\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t$CadenaValores.=$_SeparadorCampos_.$idObjetoInsertado;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t//Inserta el nuevo objeto al form\n\t\t\t\t\t\tPCO_EjecutarSQLUnaria(\"INSERT INTO \".$TablasCore.\"formulario_boton ($ListaCamposSinID_formulario_boton) VALUES ($CadenaInterrogantes) \",\"$CadenaValores\");\n\t\t\t\t\t}\n\n\t\t\t\t//Determina cuantos campos tiene la tabla\n\t\t\t\t$ArregloCampos=explode(',',$ListaCamposSinID_menu);\n\t\t\t\t$TotalCampos=count($ArregloCampos);\n\t\t\t\t// Registros de formulario_boton\n\t\t\t\tfor ($PCO_i=0;$PCO_i<$xml_importado->total_core_menu[0]->cantidad_objetos;$PCO_i++)\n\t\t\t\t\t{\n\t\t\t\t\t\t//Genera cadena de interrogantes y valores segun cantidad de campos\n\t\t\t\t\t\t$CadenaInterrogantes='?'; //Agrega el primer interrogante\n\t\t\t\t\t\t$CadenaValores=base64_decode($xml_importado->core_menu[$PCO_i]->texto);\n\n\t\t\t\t\t\tfor ($PCOCampo=1;$PCOCampo<$TotalCampos;$PCOCampo++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//Cadena de interrogantes\n\t\t\t\t\t\t\t\t$CadenaInterrogantes.=',?';\n\t\t\t\t\t\t\t\t//Cadena de valores (el campo No 2 corresponde al ID de formulario nuevo)\n\t\t\t\t\t\t\t\tif ($PCOCampo!=16)\n\t\t\t\t\t\t\t\t\t$CadenaValores.=$_SeparadorCampos_.base64_decode($xml_importado->core_menu[$PCO_i]->{$ArregloCampos[$PCOCampo]});\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t$CadenaValores.=$_SeparadorCampos_.$idObjetoInsertado;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t//Inserta el nuevo objeto al form\n\t\t\t\t\t\tPCO_EjecutarSQLUnaria(\"INSERT INTO \".$TablasCore.\"menu ($ListaCamposSinID_menu) VALUES ($CadenaInterrogantes) \",\"$CadenaValores\");\n\t\t\t\t\t}\n\n return $idObjetoInsertado;\n }",
"function getScripts()\n{\n $iterator = new GlobIterator( 'bin/php/*.php' );\n foreach( $iterator as $key => $script )\n {\n if ( !$script->isFile() )\n continue;\n\n // $scriptName = str_replace( '.php', '', $script->getFilename() );\n $scriptName = preg_replace( '#(ezp?)?(.*)\\.php#', '$2', $script->getFilename() );\n $scripts[] = \"$scriptName \";\n }\n $scripts[] = 'runcronjobs ';\n return $scripts;\n}",
"public function taskParseXMLPublishers(): void\n {\n $objectManager = GeneralUtility::makeInstance(ObjectManager::class);\n $uniqueId = null;\n $key = null;\n try {\n $dir = GeneralUtility::getFileAbsFileName('fileadmin/user_upload/citavi_upload/');\n $configurationManager = $objectManager->get(ConfigurationManager::class);\n $fullTs = $configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT);\n $settings = $fullTs['plugin.']['tx_nwcitavi.']['settings.'];\n //$this->initTSFE($this->getRootpage($objectManager));\n //$settings = $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_nwcitavi.']['settings.'];\n $check = file_exists($dir.'/scheduler.txt');\n if($check) {\n $taskExists = file_exists($dir.'/task.txt');\n if($taskExists) {\n $taskString = file_get_contents ( $dir.'/task.txt' );\n $taskCols = explode('|', $taskString);\n if((int)$taskCols[0] === 5) {\n $schedulerString = file_get_contents ( $dir.'/scheduler.txt' );\n $schedulerCols = explode('|', $schedulerString);\n [$fileName, $key, $uniqueId] = $schedulerCols;\n $xml = new \\XMLReader();\n $xml->open($fileName);\n $xmlString = implode('', file($fileName));\n $xml = simplexml_load_string($xmlString);\n $json = json_encode($xml);\n $array = json_decode($json,TRUE);\n try {\n if ( is_array( $array['Publishers']['Publisher'] ) ) {\n $this->truncateDatabase('tx_nwcitavi_domain_model_publisherhash');\n foreach ($array['Publishers']['Publisher'] as $iValue) {\n if($array['Publishers']['Publisher']['@attributes']) {\n $publisher = $array['Publishers']['Publisher'];\n } else {\n $publisher = $iValue;\n }\n if(!empty($publisher['@attributes']['ID'])) {\n $refStr = $this->generatedHash($publisher);\n $hash = hash('md5', $refStr);\n $this->insertInHashTable( 'PublisherHash', $hash, ($settings['sPid']) ?: '0');\n $columnExists = $this->columnExists('PublisherRepository', $publisher['@attributes']['ID'], 'tx_nwcitavi_domain_model_publisher');\n $this->setDatabase($publisher, 'Publisher', $columnExists, $hash, $key, $uniqueId, $settings);\n }\n unset($publisher, $publisherAttributes, $db_publisher, $publisherUid);\n }\n $this->deletedDatabaseColumns('tx_nwcitavi_domain_model_publisher', 'tx_nwcitavi_domain_model_publisherhash', $settings);\n file_put_contents($dir.'/task.txt', 6);\n } else {\n file_put_contents($dir.'/task.txt', 6);\n }\n } catch (Exception $e) {\n $this->logRepository->addLog(1, 'Publishers could not be generated. Fehler: '.$e, 'Parser', ''.$uniqueId.'', '[Citavi Parser]: Task was terminated.', ''.$key.'');\n }\n }\n }\n }\n } catch (Exception $e) {\n $this->logRepository->addLog(1, 'Fehler: '.$e.'', 'Parser', ''.$uniqueId.'', '[Citavi Parser]: Task was terminated.', ''.$key.'');\n }\n }",
"function initPostinstallScripts()\n {\n $filelist = $this->getFilelist();\n $contents = $this->getContents();\n $contents = $contents['dir']['file'];\n if (!is_array($contents) || !isset($contents[0])) {\n $contents = array($contents);\n }\n $taskfiles = array();\n foreach ($contents as $file) {\n $atts = $file['attribs'];\n unset($file['attribs']);\n if (count($file)) {\n $taskfiles[$atts['name']] = $file;\n }\n }\n $common = new PEAR_Common;\n $common->debug = $this->_config->get('verbose');\n $this->_scripts = array();\n foreach ($taskfiles as $name => $tasks) {\n if (!isset($filelist[$name])) {\n // file was not installed due to installconditions\n continue;\n }\n $atts = $filelist[$name];\n foreach ($tasks as $tag => $raw) {\n $taskname = $this->getTask($tag);\n $task = &new $taskname($this->_config, $common, PEAR_TASK_INSTALL);\n if (!$task->isScript()) {\n continue; // scripts are only handled after installation\n }\n $lastversion = isset($this->_packageInfo['_lastversion']) ?\n $this->_packageInfo['_lastversion'] : null;\n $task->init($raw, $atts, $lastversion);\n $res = $task->startSession($this, $atts['installed_as']);\n if (!$res) {\n continue; // skip this file\n }\n if (PEAR::isError($res)) {\n return $res;\n }\n $assign = &$task;\n $this->_scripts[] = &$assign;\n }\n }\n if (count($this->_scripts)) {\n return true;\n }\n return false;\n }",
"public static function register_scripts()\n {\n }",
"public static function getScripts()\r\n\t\t{\r\n\t\t\t$sql = new DBQuery();\r\n\t\t\t$sql->select('*');\r\n\t\t\t$sql->from(self::$moduleDb);\r\n\t\t\t$scripts = Db::getInstance()->executeS($sql);\r\n\t\t\treturn $scripts;\r\n\t\t}",
"function parse_script()\r\n {\r\n // include config file\r\n if (!SMSSend_Site::script_exists($this->get_site_name())) {\r\n Debug::debug('SMSSend script/config file for \"'.$this->get_site_name().'\" not readable', __FILE__, __LINE__);\r\n $this->set_error('SMSSend script/config file does not exist or is not readable');\r\n return false;\r\n }\r\n $file = SWS_SMSSEND_SITE_DIR.'config/'.$this->get_site_name().'.php';\r\n include($file);\r\n // set country codes\r\n if (isset($country_codes)) $this->country_codes = $country_codes;\r\n // set param mapping\r\n if (isset($param_mapping)) $this->param_mapping = array_change_key_case($param_mapping, CASE_LOWER);\r\n // set error mapping\r\n if (isset($error_mapping)) $this->error_mapping = $error_mapping;\r\n // set param values\r\n if (isset($param_values)) $this->param_values = array_change_key_case($param_values, CASE_LOWER);\r\n // set number format\r\n if (isset($number_format)) $this->number_format = $number_format;\r\n\r\n // get script to parse\r\n $file = SWS_SMSSEND_SITE_DIR.$this->get_site_name().'.sms';\r\n $this->script = array_map('trim', file($file));\r\n // remove empty lines or comment lines\r\n foreach ($this->script as $idx => $line) {\r\n if (($line == '') || (substr($line, 0, 1) == '#')) {\r\n unset($this->script[$idx]);\r\n }\r\n }\r\n\r\n // parse params\r\n while ($line = array_shift($this->script)) {\r\n // extract first char\r\n $char = substr($line, 0, 1);\r\n // process if param\r\n if ($char == '%') {\r\n $this->process_param($line);\r\n // process if alias\r\n } elseif ($char == '$') {\r\n // skip for now\r\n // $this->process_alias($line);\r\n // process if setCookie line\r\n } elseif (substr($line, 0, 9) == 'SetCookie') {\r\n $this->command_setcookie(substr($line, 10));\r\n // process get block\r\n } elseif (substr($line, 0, 6) == 'GetURL') {\r\n // if process of block not successful, we exit method\r\n if (!$this->process_block('GET', substr($line, 7))) {\r\n return false;\r\n }\r\n // process post block\r\n } elseif (substr($line, 0, 7) == 'PostURL') {\r\n // if process of block not successful, we exit method\r\n if (!$this->process_block('POST', substr($line, 8))) {\r\n return false;\r\n }\r\n }\r\n }\r\n return true;\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine whether a session cookie needs to be set (lifetime=0) | public function isSetSessionCookie() {} | [
"public function isSessionCookie()\n\t{\n\t\treturn $this->expires === 0;\n\t}",
"public function isSetSessionCookie()\n {\n return ($this->newSessionID || $this->forceSetCookie) && $this->lifetime == 0;\n }",
"function hasSessionCookie() {\n\t\tglobal $wgDisableCookieCheck;\n\n\t\treturn $wgDisableCookieCheck ? true : $this->getRequest()->checkSessionCookie();\n\t}",
"public function us_is_cookie_session(){\n\t\treturn (!h::cC('usID') or h::cC('usID', $this->us->usID));\n\t\t}",
"public static function sessionCookieExists(){\n\t\treturn \\filter_has_var(\\INPUT_COOKIE, \\session_name());\n\t}",
"public function sessionCheck() {\n\t\treturn !CommonComponent::cookiesDisabled();\n\t\t/*\n\t\tif (!empty($_COOKIE) && !empty($_COOKIE[Configure::read('Session.cookie')])) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t\t*/\n\t}",
"protected function isSetSessionCookie()\n {\n return isset($_COOKIE[$this->name])\n ? true\n : false;\n }",
"public static function check ()\n\t{\n\t\treturn isset($_COOKIE[SESSION_COOKIE]);\n\t}",
"public function is_cookie_set()\n {\n }",
"function lookup_sessions(){\n\n\t\tif( empty($_SESSION[COOKIE_NAME]) || empty($_SESSION[COOKIE_KEY]))\n\t\t\treturn 0;\n\treturn 1;\n}",
"private function hasNoSession(): bool\n {\n if ($this->isInitialized) {\n return false;\n }\n\n if (!boolval(ini_get('session.use_only_cookies'))) {\n // Can't tell for sure, since only cookie is checked.\n return false;\n }\n\n if (isset($_COOKIE[session_name()])) {\n return false;\n }\n\n return true;\n }",
"protected function isSetSessionExpire()\n {\n return isset($_SESSION[$this->name]['expire'])\n ? true\n : false;\n }",
"public static function checkExpiredSession()\n\t{\n\t\tglobal $ilSetting;\n\t\t\n\t\t// do not check session in fixed duration mode\n\t\tif( $ilSetting->get('session_handling_type', 0) != 1 )\n\t\t\treturn;\n\n\t\t// check for expired sessions makes sense\n\t\t// only when public section is not enabled\n\t\t// because it is not possible to determine\n\t\t// wether the sid cookie relates to a session of an\n\t\t// authenticated user or a anonymous user\n\t\t// when the session dataset has allready been deleted\n\n\t\tif(!$ilSetting->get(\"pub_section\"))\n\t\t{\n\t\t\tglobal $lng;\n\n\t\t\t$sid = null;\n\n\t\t\tif( !isset($_COOKIE[session_name()]) || !strlen($_COOKIE[session_name()]) )\n\t\t\t{\n\t\t\t\tself::debug('Browser did not send a sid cookie');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$sid = $_COOKIE[session_name()];\n\n\t\t\t\tself::debug('Browser sent sid cookie with value ('.$sid.')');\n\n\t\t\t\tif(!self::isValidSession($sid))\n\t\t\t\t{\n\t\t\t\t\tself::debug('remove session cookie for ('.$sid.') and trigger event');\n\n\t\t\t\t\t// raw data will be updated (later) with garbage collection [destroyExpired()]\n\t\t\t\t\t\n\t\t\t\t\tself::removeSessionCookie();\n\n\t\t\t\t\t// Trigger expiredSessionDetected Event\n\t\t\t\t\tglobal $ilAppEventHandler;\n\t\t\t\t\t$ilAppEventHandler->raise(\n\t\t\t\t\t\t'Services/Authentication', 'expiredSessionDetected', array()\n\t\t\t\t\t);\n\n\t\t\t\t\tilUtil::redirect('login.php?expired=true'.'&target='.$_GET['target']);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function isCookieEnabled(){\n return $this->_getSession()->_isCookieEnabled();\n }",
"protected function _isCheckCookieRequired()\n {\n return false;\n }",
"protected static\n\tfunction validateSession()\n\t{\n\t\tif (isset($_SESSION['OBSOLETE']) && !isset($_SESSION['EXPIRES'])) return false;\n\t\tif (isset($_SESSION['EXPIRES']) && $_SESSION['EXPIRES'] < time()) return false;\n\t\treturn true;\n\t}",
"public static function isCookieCreated(){\n\t\treturn !!OptionHelper::getOption('init_cookie');\n\t}",
"function session_is_valid() {\n if(!last_login_is_recent()) { return false; }\n if(!user_agent_matches_session()) { return false; }\n return true;\n }",
"public static function check_session() {\n\n $session_name = Config::get('session_name');\n\n // No cookie no go!\n if (!isset($_COOKIE[$session_name])) { return false; }\n\n // Check for a remember me\n if (isset($_COOKIE[$session_name . '_remember'])) {\n self::create_remember_cookie();\n }\n\n // Set up the cookie params before we start the session.\n // This is vital\n session_set_cookie_params(\n Config::get('cookie_life'),\n Config::get('cookie_path'),\n Config::get('cookie_domain'),\n Config::get('cookie_secure'));\n\n // Set name\n session_name($session_name);\n\n // Ungimp IE and go\n self::ungimp_ie();\n session_start();\n\n return true;\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Clean cache files after tests | protected function tearDown()
{
$cache_path = __DIR__.'/src/caches';
$ignored_files = ['.', '..', '.gitkeep'];
$cache_files = array_diff(scandir($cache_path), $ignored_files);
if(empty($cache_files)) return;
foreach($cache_files as $file) {
unlink($cache_path.'/'.$file);
}
} | [
"private function clearTestCache()\n {\n $finder = (new Finder())\n ->in(self::CACHE_ROOT)\n ->ignoreDotFiles(Finder::IGNORE_DOT_FILES);\n\n $filesystem = new Filesystem();\n\n $filesystem->remove($finder->files());\n $filesystem->remove($finder->directories());\n }",
"public static function cache_clean(){\n chdir(App.'storage/cache/data_cache/');\n $cache_list = glob('*.json');\n foreach ($cache_list as $cache){\n unlink(App.'storage/cache/data_cache/'.$cache);\n }\n }",
"private function _emptyAllCache() {\n array_map( 'unlink', glob( $this->storePath . \"cache/*\" ) );\n }",
"private function delete_cache_files() {\n\t\tforeach ( $this->cache_dirs as $dir ) {\n\t\t\t$this->delete( $this->cache_path . $dir );\n\t\t}\n\t}",
"private function __clearCache()\n {\n $fixedAppPath = ROOT . DS . APP_DIR . DS;\n\n $cakeCacheFolders = array(\n $fixedAppPath .'tmp' .DS. 'cache' .DS. 'persistent' .DS,\n $fixedAppPath .'tmp' .DS. 'cache' .DS. 'models' .DS,\n $fixedAppPath .'tmp' .DS. 'cache' .DS. 'views' .DS,\n );\n\n foreach ($cakeCacheFolders as $tempFolder) {\n if(is_dir($tempFolder)) {\n $files = glob($tempFolder . 'myapp_cake*', GLOB_MARK);\n array_push($files, $fixedAppPath .'tmp/cache/persistent/doc_index');\n\n foreach($files as $tempFile) {\n if(is_file($tempFile)) {\n unlink($tempFile);\n }\n }\n }\n }\n\n //JS and CSS resource cache (Generated by the asset plugin)\n $resourceCacheFolders = array(\n $fixedAppPath .'webroot' .DS. 'cache' .DS. 'css' .DS,\n $fixedAppPath .'webroot' .DS. 'cache' .DS. 'js' .DS,\n );\n\n foreach ($resourceCacheFolders as $tempFolder) {\n if(is_dir($tempFolder)) {\n $filesJs = glob($tempFolder . '*.js', GLOB_MARK);\n $filesCss = glob($tempFolder . '*.css', GLOB_MARK);\n\n $files = array_merge($filesJs, $filesCss);\n\n foreach($files as $tempFile) {\n if(is_file($tempFile)) {\n unlink($tempFile);\n }\n }\n }\n }\n }",
"function empty_cache()\n\t{\n\t\tdelete_files($this->data['cache_dir']);\n\t}",
"public static function clean_cache_dir() : void\n\t{\n\t\t$files = new RecursiveIteratorIterator(\n\t\t\tnew RecursiveDirectoryIterator(KO7::$cache_dir, RecursiveDirectoryIterator::SKIP_DOTS),\n\t\t\tRecursiveIteratorIterator::CHILD_FIRST\n\t\t);\n\n\t\tforeach ($files as $file) {\n\t\t\tif ($file->getExtension() === 'gitignore') {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$todo = ($file->isDir() ? 'rmdir' : 'unlink');\n\t\t\t$todo($file->getRealPath());\n\t\t}\n\t}",
"public function flushCache()\n {\n $iterator = new \\DirectoryIterator($this->getConfig('cache_folder'));\n\n foreach ($iterator as $file) {\n if (! $file->isDot()) {\n unlink($file->getPathname());\n }\n }\n }",
"private function clean_cache() {\r\n if ($this->is_local === true && $this->is_expired === true) {\r\n unlink($this->local);\r\n }\r\n }",
"public function clearCacheFiles()\n {\n if (false === $this->cache) {\n return;\n }\n foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($this->cache), RecursiveIteratorIterator::LEAVES_ONLY) as $file) {\n if ($file->isFile()) {\n @unlink($file->getPathname());\n }\n }\n }",
"public function delete_cache()\r\n {\r\n // empty the cache folder\r\n foreach (new \\DirectoryIterator('cache') as $fileInfo) {\r\n if(!$fileInfo->isDot()) {\r\n unlink($fileInfo->getPathname());\r\n }\r\n }\r\n }",
"function reset_cache()\r\n {\r\n if (file_exists($this->cache_file))\r\n \tunlink($this->cache_file);\r\n }",
"protected function cleanupLibraryCache()\n {\n @mkdir($dir = dirname(static::DEFERJS_CACHE), 0755, true);\n\n $files = glob($dir . '/*.php', GLOB_MARK);\n\n if (!empty($files)) {\n foreach ($files as $file) {\n @unlink($file);\n }\n }\n }",
"function clearSiteCacheFiles() {\n\t\t$folderName = str_replace('.','_', $this->getDomainName());\n\t\t\n\t\ttry {\n\t\t\t$oEngine = mvcViewEngineFactory::getEngine($this->getSiteConfig()->getTemplateEngine()->getParamValue());\n\t\t\t$oEngine->setCacheDir($folderName);\n\t\t\t$oEngine->setCompileDir($folderName);\n\t\t\t$oEngine->setUseSubDirs(true);\n\t\t\t$oEngine->clearCache();\n\t\t\t$oEngine = null;\n\t\t\tunset($oEngine);\n\t\t} catch ( Exception $e ) {\n\t\t\tsystemLog::error($e->getMessage());\n\t\t}\n\t\t\n\t\tif ( $this->getSiteConfig()->isAutoloadCacheEnabled() ) {\n\t\t\t$dir = \n\t\t\t\tmvcAutoload::getCacheFolder().\n\t\t\t\tsystem::getDirSeparator().\n\t\t\t\t$this->getDomainName().mvcAutoload::AUTOLOAD_CACHE_FILE;\n\t\t\t\n\t\t\tif ( @file_exists($dir) && @is_writable($dir) ) {\n\t\t\t\t$oFile = new fileObject($dir);\n\t\t\t\tif ( !$oFile->delete() ) {\n\t\t\t\t\tsystemLog::error('Failed to remove file ('.$oFile->getOriginalFilename().') - check permissions');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"function clean_cache() {\n\t\n\t\t// Reduces the amount of cache clearing to save some processor speed\n\t\tif (rand (1, 100) > 10) {\n\t\t\treturn true;\n\t\t}\n\t\n\t\t$files = glob($this->cache_dir . '*', GLOB_BRACE);\n\t\tif (count($files) > $this->cache_max_files) {\n\t\t\t\n\t $yesterday = time () - (24 * 60 * 60);\n\t usort ($files, 'simple_thumbs_filemtime_compare');\n\t $i = 0;\n\t\t\tforeach ($files as $file) {\n\t\t\t\t$i ++;\n\t\n\t\t\t\tif ($i >= $this->cache_max_files_to_delete) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\n\t\t\t\tif (@filemtime ($file) > $yesterday) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\n\t\t\t\tif (file_exists ($file)) {\n\t\t\t\t\tunlink ($file);\n\t\t\t\t}\n\t\n\t\t\t}\n\t\n\t }\n\t\n\t}",
"protected function clearCache() {\n\t\n\t\t$del_dir = dir($this->cache_dir);\n\t\t\n\t while(false !== ($file = $del_dir->read())) {\n \t unlink($file);\n\t }\n \t\n\t\t$dir->close();\n\t\t\n\t}",
"function clean() {\n\t\tdelete_files('content/cache/upgrade/', TRUE);\n\t}",
"public function clearCache()\n {\n $files = $this->ls('/', 'cache');\n foreach ($files as $file)\n {\n if (is_dir($this->cachePath . '/' . $file))\n {\n $this->$this->recurciveDelete($this->cachePath . '/' . $file);\n } else\n {\n unlink($this->cachePath . '/' . $file);\n }\n }\n }",
"private function deleteCachedData()\n {\n $finder = new Finder();\n $fs = new Filesystem();\n foreach ($finder->files()->in(BACKEND_CACHE_PATH)->in(FRONTEND_CACHE_PATH) as $file) {\n /** @var $file \\SplFileInfo */\n $fs->remove($file->getRealPath());\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Print datetime in standard DB format Set $tz parameter to false if you are sure that the date is in UTC. | function asDb($tz = true)
{
if($tz) {
if(empty(self::$_gmt)) {
self::$_gmt = new DateTimeZone("UTC");
}
$this->setTimezone(self::$_gmt);
}
return $this->format(TimeDate::DB_DATETIME_FORMAT);
} | [
"function core_display_datetime($time, $tz=0) {\n\tglobal $core_config;\n\t$gw = gateway_get();\n\t$time = trim($time);\n\t$ret = $time;\n\tif ($time && ($time != '0000-00-00 00:00:00')) {\n\t\tif (! $tz) {\n\t\t\tif (! ($tz = $core_config['user']['datetime_timezone'])) {\n\t\t\t\tif (! ($tz = $core_config['plugin'][$gw]['datetime_timezone'])) {\n\t\t\t\t\t$tz = $core_config['main']['cfg_datetime_timezone'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$time = strtotime($time);\n\t\t$off = core_datetime_offset($tz);\n\t\t// the difference between core_display_datetime() and core_adjust_datetime()\n\t\t// core_display_datetime() will set to user's timezone (+offset)\n\t\t$ret = $time + $off;\n\t\t$ret = date($core_config['datetime']['format'], $ret);\n\t}\n\treturn $ret;\n}",
"public function getDateTimeTzFormatString()\n {\n return 'Y-m-d H:i:s';\n }",
"public static function datetime_mysql_format() {\n\n\t\treturn 'Y-m-d H:i:s';\n\t}",
"public final function formatSqlDateTime() : string\n {\n\n return $this->format( DateTimeFormat::SQL );\n\n }",
"public static function getPrintableDatetime(): string\n {\n return (new DateTime())->format(\"Y-m-d\\TH:i:s.vP\");\n }",
"function show_date($date){\n $date = new datetime($date, new datetimezone('UTC'));\n $str_date = $date->format('l, F j, Y');\n\n\treturn $str_date;\n}",
"function dt_display_datetime($_uts='', $_format='%Y-%m-%d %H:%M:%S') {\n\t# Format examples:\n\t#\tlong\t- $_format='%A- %B %d, %Y @ %H:%M:%S %Z'\n\t#\tshort\t- $_format='%Y-%m-%d %H:%M:%S'\n\t#\tmisc\t- $_format='%A- %B %d, %Y'\n\tglobal $_CCFG;\n\tIF ($_uts == '' || $_uts == 0) {$_uts = dt_get_uts();}\n\tsetlocale(LC_TIME, $_CCFG['_DB_PKG_LOCALE']);\n\treturn strftime($_format, $_uts);\n}",
"function formatDateTimeNow() {\n return $this->formatTimeStamp(time(),true);\n }",
"abstract public function formatDateTime(): string;",
"function print_timestamp()\n\t{\n\t\tdate_default_timezone_set($this->timezone);\n\t\t$formatted = date('m/d/Y', time());\n\t\t$formatted .= ' @ ';\n\t\t$formatted .= date('g:ia', time());\n\t\treturn $formatted;\n\t}",
"private function logTimezone()\n {\n $dateTimezone = \\ini_get('date.timezone');\n if ($dateTimezone) {\n $this->debug->log('date.timezone', $dateTimezone);\n return;\n }\n $this->debug->assert(false, '%cdate.timezone%c is not set', 'font-family:monospace;', '');\n $this->debug->log('date_default_timezone_get()', \\date_default_timezone_get());\n }",
"private function logTimezone()\n {\n $dateTimezone = \\ini_get('date.timezone');\n if ($dateTimezone) {\n $this->debug->log('date.timezone', $dateTimezone);\n return;\n }\n $this->debug->assert(false, '%cdate.timezone%c is no set', 'font-family:monospace;', '');\n $this->debug->log('date_default_timezone_get()', \\date_default_timezone_get());\n }",
"function convert_mysql_timezone($datetime, $format = 'Y-m-d', $reverse =FALSE) {\n\t$tz_from = ($reverse)? DEFAULT_TIMEZONE : MYSQL_TIMEZONE;\n\t$tz_to = ($reverse)? MYSQL_TIMEZONE : DEFAULT_TIMEZONE;\n\t$dt = new DateTime($datetime, new DateTimeZone($tz_from));\n\t$dt->setTimezone(new DateTimeZone($tz_to));\n\treturn $dt->format($format);\n}",
"function formatDateTimeSQL($timeString='now') {\n return strftime('%F %T', strtotime($timeString));\n}",
"public function toString () {\n\t\treturn date(\"Y-m-d H:i:s\", (int)($this->__t));\n\t}",
"function tzRetQueryStringDTime($tbl_col_name,$dt_type,$separator)\n\t{\n\t\tglobal $user_timezone;\n\t\t$TzConvert=\"CONVERT_TZ(\".$tbl_col_name.\",'SYSTEM','\".$user_timezone[1].\"')\";\n\t\treturn \"DATE_FORMAT(\".$TzConvert.\",'\".getMySQLDateFormat($dt_type,$separator).\"')\";\n\n\t}",
"public function getTimezoneString();",
"public function testToDb()\n {\n $ilchDate = new \\Ilch\\Date('2013-09-24 15:44:53');\n\n $this->assertEquals('2013-09-24 15:44:53', $ilchDate->toDb(), 'The date was not returned in UTC.');\n }",
"public function newUtcMysqlDateString() {\n return self::dateTimeToMysqlDateString(self::newUtcDateTime());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Lists all Codes models. | public function actionIndex()
{
$searchModel = new CodesSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
} | [
"public function listModels()\n\t{\n\t\t$classes = \\SeanMorris\\Ids\\Linker::classes('SeanMorris\\Ids\\Model');\n\n\t\t$classes = array_map(\n\t\t\tfunction($class)\n\t\t\t{\n\t\t\t\treturn str_replace('\\\\', '/', $class);\n\t\t\t}\n\t\t\t, $classes\n\t\t);\n\n\t\tprint implode(PHP_EOL, $classes) . PHP_EOL;\n\t}",
"public function listing() {\n\t\t$codes = Code::where('active', '=', true)->get();\n\t\treturn view('admin.code.list')\n\t\t\t->with('codes', $codes);\n\t}",
"function _listAll()\n {\n $this->_getTables();\n $this->out('');\n $this->out('Possible Models based on your current database:');\n $this->hr();\n $this->_modelNames = array();\n $i=1;\n foreach ($this->__tables as $table) {\n $this->_modelNames[] = $this->_modelName($table);\n $this->out($i++ . \". \" . $this->_modelName($table));\n }\n }",
"public function getModels();",
"public function all() {\n return $this->app->entityManager->getRepository($this->model_name)->findAll();\n }",
"public function getModelsList(){\r\n\t\t$this->db->select(\"id, nome\");\r\n\t\t$this->db->from(\"modelos\");\r\n\t\treturn $this->db->get()->result();\r\n\t}",
"function GetAllModels()\n\t{\n\t}",
"public function listcodesAction()\n {\n \t$fitnessPromotion = new FitnessPromotionCodes();\n\t\t$promotionArray = array();\n\t\t\n\t\t$this->view->promotioncodes = $fitnessPromotion->getCodes();\n\t\t\n }",
"public function List()\n {\n $req = $this->_db->query('SELECT * from coders');\n $coders_fetched = $req->fetchAll();\n $req->closeCursor();\n\n $coders = [];\n\n foreach ($coders_fetched as $coder) {\n\n $c = new Coder();\n \n $c->id = $coder['id'];\n $c->name = $coder['name'];\n $c->phone_number = $coder['phone_number'];\n $c->country = $coder['country'];\n $c->sex = $coder['sex'];\n \n $coders[] = $c;\n }\n \n return $coders;\n }",
"public static function List() {\n\t\t$models = array();\n\n\t\t// Get models from the database ordered.\n\t\t$dbh = Database::connect();\n\t\t$query = $dbh->prepare(\"SELECT id FROM device_models\");\n\t\t$query->execute();\n\t\t$rows = $query->fetchAll(PDO::FETCH_ASSOC);\n\n\t\t// Go through the results creating Model objects.\n\t\tforeach ($rows as $model)\n\t\t\tarray_push($models, Model::FromID($model[\"id\"]));\n\n\t\treturn $models;\n\t}",
"public function getAllModels(){\n if($this->getRequestType() !== \"GET\") {\n $this->requestError(405);\n }\n $autoModel = AutoModels::model()->findAll();\n\n $this->sendResponse([\"success\" => 1, \"data\" => $autoModel]);\n exit();\n }",
"public function dbGetModels() {\n header('Content-Type: application/json');\n $data = $this->model->getModels();\n $this->load->raw(json_encode($data));\n }",
"public function actionCodes()\n {\n $searchModel = new PromotionCodeSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n // For store admin index\n if (CurrentStore::isNone()) {\n $codes = PromotionCode::findAll(['is_active' => true, 'is_deleted' => false]);\n } else {\n $codes = PromotionCode::find()\n ->where([\n 'is_active' => true,\n 'is_deleted' => false\n ])\n ->all();\n }\n\n return $this->render('code/index', [\n 'codes' => $codes,\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function models()\n {\n $this->_display('models');\n }",
"public function getAll()\n {\n return\n DB::table('lov_types')\n ->select('code', 'name')\n ->get();\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('ItesACBackendBundle:Modelo')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }",
"public static function models()\n {\n return self::fetch(\"models\");\n }",
"public function index() {\n return Business::all();\n }",
"public function get_models(){\n\t\techo $this->manufacturer_model->getModelsData();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Saves an gestionnaire into the database. | public function save(Gestionnaire $gestionnaire) {
$gestionnaireData = array(
'login' => $gestionnaire->getLoginGestionnaire(),
'mdp' => $gestionnaire->getMdpGestionnaire(),
);
if ($gestionnaire->getLoginGestionnaire()) {
// The gestionnaire has already been saved : update it
$this->getDb()->update('gestionnaire', $gestionnaireData, array('login' => $gestionnaire->getLoginGestionnaire()));
} else {
// The gestionnaire has never been saved : insert it
$this->getDb()->insert('gestionnaire', $gestionnaireData);
// Get the login of the newly created gestionnaire and set it on the entity.
$login = $this->getDb()->lastInsertId();
$gestionnaire->setLoginGestionnaire($login);
}
} | [
"public function save() {\n $fields = $this->getDbFields();\n\n db_merge('sm_form_submission')\n ->key([\n 'sid' => $this->getSid(),\n ])\n ->fields($fields)\n ->execute();\n }",
"public function saveToDb()\n\t{\n\t\t$this->saveQuestionSequence();\n\t\t$this->saveNewlyCheckedQuestion();\n\t}",
"function save(){\n\t\tglobal $deal_controller;\n\t\t$deal_controller->load_script($deal_controller->get_path('/classes/db.php'), 'class', 'DealImportDb');\n\t\t\n\t\t$a_deal = new DealImportDb();\n\t\t$deal_id = $a_deal->insert_deal($this->deal_id, $this->post_title, $this->post_content, $this->end_date);\n\t\t$a_deal->insert_deal_meta($deal_id, $this->meta_info);\t\t\n\t}",
"public function saving(Nomination $Nomination)\n {\n //code...\n }",
"public function save()\n {\n // Create submission data, insert and update take the same format\n $data = [\n 'news_category' => $this->category,\n 'user_id' => $this->user,\n 'news_timestamp' => $this->time,\n 'news_title' => $this->title,\n 'news_content' => $this->text,\n ];\n\n // Update if id isn't 0\n if ($this->id) {\n DB::table('news')\n ->where('news_id', $this->id)\n ->update($data);\n } else {\n $this->id = DB::table('news')\n ->insertGetId($data);\n }\n }",
"function save(){\n\n\t\t//if(isset($_SESSION['id_sucursal']) && isset($_POST['semana']) && isset($_POST['fecha_inicio']) && isset($_POST['fecha_termino'])){\n\t//Formulario para guardar datos en la tabla de nomina sucursal \n\t\t$idSucursal=$_SESSION[\"id_sucursal\"];\n\t\t$NoSemana=$_POST['semana'];\n\t\t$FechaInicio=$_POST['fecha_inicio'];\n\t\t$FechaTermino=$_POST['fecha_termino'];\n\n\t\tNominaModel::save($idSucursal,$NoSemana,$FechaInicio,$FechaTermino);\n\n\n\t}",
"public function save($decision) {\n \t\n \t$this->_loadSources();\n \t$this->_decisionsDatasource->upsertDecision($decision);\n\t\t$this->_decisionCaveatsDatasource->upsertCaveats($decision);\n }",
"public function save($persistenceIdentifier, array $formDefinition);",
"public function save()\n {\n NominationModel::update(Request::post('nomination_id'), Request::post('nomination_name'));\n Redirect::to('nomination');\n }",
"public function save()\n {\n $this->log(\"save start\");\n }",
"function Save() {\n\n\t\t\t$dbMain = db_getDBObject(DEFAULT_DB, true);\n\t\t\tif ($this->domain_id){\n\t\t\t\t$dbObj = db_getDBObjectByDomainID($this->domain_id, $dbMain);\n\t\t\t} else if (defined(\"SELECTED_DOMAIN_ID\")) {\n\t\t\t\t$dbObj = db_getDBObjectByDomainID(SELECTED_DOMAIN_ID, $dbMain);\n\t\t\t} else {\n\t\t\t\t$dbObj = db_getDBObject();\n\t\t\t}\n\n\t\t\t$this->PrepareToSave();\n\n\t\t\t$sql = \"INSERT INTO Payment_Event_Log\"\n\t\t\t\t. \" (payment_log_id,\"\n\t\t\t\t. \" event_id,\"\n\t\t\t\t. \" event_title,\"\n\t\t\t\t. \" discount_id,\"\n . \" level,\"\n\t\t\t\t. \" level_label,\"\n\t\t\t\t. \" renewal_date,\"\n\t\t\t\t. \" amount\"\n\t\t\t\t. \" )\"\n\t\t\t\t. \" VALUES\"\n\t\t\t\t. \" (\"\n\t\t\t\t. \" $this->payment_log_id,\"\n\t\t\t\t. \" $this->event_id,\"\n\t\t\t\t. \" $this->event_title,\"\n\t\t\t\t. \" $this->discount_id,\"\n . \" $this->level,\"\n\t\t\t\t. \" $this->level_label,\"\n\t\t\t\t. \" $this->renewal_date,\"\n\t\t\t\t. \" $this->amount\"\n\t\t\t\t. \" )\";\n\n\t\t\t$dbObj->query($sql);\n\n\t\t\t$this->id = ((is_null($___mysqli_res = mysqli_insert_id($dbObj->link_id))) ? false : $___mysqli_res);\n\n\t\t\t$this->PrepareToUse();\n\n\t\t}",
"function save() {\n\t\t// Check the preconditions\n\t\t$this->checkId();\n\t\t\n\t\t// Build the query\n\t\t$query = new InsertUpdateQuery($this->db);\n\t\t$query->setTable('abstract_affiliation');\n\t\tforeach ($this->data as $col => $val) {\n\t\t\t$query->setColumn($col, $val, self::$columnTypes[$col][0]);\n\t\t}\n\t\t\n\t\t// Run it\n\t\t$query->execute();\n\t}",
"public function save(Habiter $habiter)\n {\n $this->em->persist($habiter);\n $this->em->flush();\n }",
"public function save()\n {\n if ($this->workflow) {\n $transaction = transaction(container('docoflow.connection'));\n\n try {\n $this->workflow->save();\n\n if (($steps = $this->steps()) instanceof Step) {\n $steps->save();\n }\n\n if (($groups = $this->groups()) instanceof Group) {\n $groups->save();\n }\n\n if (($verificators = $this->verificators()) instanceof Verificator) {\n $verificators->save();\n }\n\n $transaction->commit();\n } catch (Exception $e) {\n $transaction->rollback();\n\n throw $e;\n }\n }\n }",
"function saveToDb($original_id = \"\")\n\t{\n\t\tglobal $ilDB;\n\n\t\t// save the basic data (implemented in parent)\n\t\t// a new question is created if the id is -1\n\t\t// afterwards the new id is set\n\t\t$this->saveQuestionDataToDb($original_id);\n\t\t$this->saveAdditionalQuestionDataToDb();\n\t\t$this->saveAnswerSpecificDataToDb();\n\t\t\n\t\t// save stuff like suggested solutions\n\t\t// update the question time stamp and completion status\n\t\tparent::saveToDb();\n\t}",
"public function saveTreatment()\n {\n\n $group_bin_table = Input::get('group_type');\n $unique_id = Input::get('unique_id');\n $bin_id = Input::get('bin_id');\n $deceased_pigs = Input::get('pigs');\n\n $pigs = DB::table($group_bin_table)->where('unique_id',$unique_id)->where('bin_id',$bin_id)->select('number_of_pigs')->first();\n\n $group_type = str_replace(\"feeds_movement_\",\"\",$group_bin_table);\n $group_type = str_replace(\"_bins\",\"\",$group_type);\n $data = array(\n 'group_id'\t\t=>\tInput::get('group_id'),\n 'group_type'\t=>\t$group_type,\n 'farm_id'\t\t\t=>\tInput::get('farm_id'),\n 'bin_id'\t\t\t=>\t$bin_id,\n 'created_at'\t=>\tdate(\"Y-m-d\",strtotime(Input::get('created_at'))),\n 'pigs'\t\t\t\t=>\t$deceased_pigs,\n 'illness'\t\t\t=>\tInput::get('illness'),\n 'drug_used'\t\t=>\tInput::get('drug_used'),\n 'notes' =>\tInput::get('notes'),\n 'user_id' => Auth::id()\n );\n\n DB::table('feeds_treatment')->insert($data);\n }",
"public function saveAction()\n {\n\n if (!$this->request->isPost()) {\n return $this->dispatcher->forward(array(\n \"controller\" => \"categoria_ingresos\",\n \"action\" => \"index\"\n ));\n }\n\n $id_categoria_ingresos = $this->request->getPost(\"id_categoria_ingresos\");\n\n $categoria_ingreso = CategoriaIngresos::findFirstByid_categoria_ingresos($id_categoria_ingresos);\n if (!$categoria_ingreso) {\n $this->flash->error(\"categoria_ingreso does not exist \" . $id_categoria_ingresos);\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"categoria_ingresos\",\n \"action\" => \"index\"\n ));\n }\n\n $categoria_ingreso->setDescripcion($this->request->getPost(\"descripcion\"));\n \n\n if (!$categoria_ingreso->save()) {\n\n foreach ($categoria_ingreso->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"categoria_ingresos\",\n \"action\" => \"edit\",\n \"params\" => array($categoria_ingreso->id_categoria_ingresos)\n ));\n }\n\n $this->flash->success(\"categoria_ingreso was updated successfully\");\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"categoria_ingresos\",\n \"action\" => \"index\"\n ));\n\n }",
"public function save() {\n\t\tself::getEntityManager()->persist($this);\n\t}",
"function save() {\n $statement = $GLOBALS['DB']->exec(\"INSERT INTO students (student_name, enroll_date)\n VALUES ('{$this->getStudentName()}', '{$this->getEnrollDate()}');\");\n $this->id = $GLOBALS['DB']->lastInsertId();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to compare allocation by over all value | public static function compareAllocationByOverAllValue($asignAlgoAdap1, $asignAlgoAdap2) {
if ($asignAlgoAdap1->overAllValue > $asignAlgoAdap2->overAllValue)
return -1;
else if ($asignAlgoAdap1->overAllValue == $asignAlgoAdap2->overAllValue)
return 0;
else
return 1;
} | [
"public static function compareMemory($a, $b) {}",
"function avai_sizes_cmp($p1, $p2) {\n // prevent calling count() on non-array object\n // by assigning an empty array if needed\n if (!is_array($p1['sizes'])) {\n $p1['sizes'] = [];\n }\n if (!is_array($p2['sizes'])) {\n $p2['sizes'] = [];\n }\n\n return count($p1['sizes']) - count($p2['sizes']);\n }",
"function check_constraint_3($schedule_answer)\n{\n $ra = $schedule_answer->getRoomAllocation();\n foreach ($ra as $room_name => $lectures) {\n $occupied_arr = [9 => false, 10 => false, 11 => false, 12 => false,\n 13 => false, 14 => false, 15 => false, 16 => false, 17 => false];\n foreach ($lectures as $lecture) {\n $start_time = $lecture->getStartTime();\n $duration = $lecture->getDuration();\n for ($i = 0; $i < $duration; $i++) {\n $start_time_cons = $start_time + $i;\n if (array_key_exists($start_time_cons, $occupied_arr)) {\n if (!$occupied_arr[$start_time_cons]) {\n $occupied_arr[$start_time_cons] = true;\n } else {\n return false;\n }\n } else {\n return false;\n }\n }\n }\n }\n return true;\n}",
"function BySize($a, $b) {\n return ($a[1] < $b[1]);\n}",
"function compare_costs($costs) {\n if ( $costs[2] <= $costs[0]+$costs[1] ) {\n return true;\n } else {\n return false;\n }\n}",
"function block_recblock_same_size_vectors($v1,$v2){\n\tif(count($v1)==count($v2)){\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\n}",
"public function testComparisonConstraints() {\n $this->markTestIncomplete();\n }",
"public function compareValue();",
"function lowcomp($a, $b) {\n if ((double)$a->getTotal() == (double)$b->getTotal()) {return 0; }\n if ((double)$a->getTotal() > (double)$b->getTotal()) {\n //echo \"jackpot\";\n return 1;\n } else {\n // echo \"meh\";\n return -1;\n }\n\n\n\n }",
"public function compare_results() {\n\t\t$identical = false;\n\n\t\t$this->filter_irrelevant_nbe();\n\t\t$this->filter_unchanged_nbe();\n\n\t\t$identical = $this->check_for_identity($this->from->nbe, $this->to->nbe);\n\n\t\tif ($identical) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Changed hosts mean that the host existed in the 'from'\n\t\t// NBE, but the specific NBE line is either new or different\n\t\t$this->find_changed_hosts($this->to->nbe, $this->from->hosts);\n\t\t\n\t\t$this->from->parse_nbe();\n\t\t$this->to->parse_nbe();\n\n\t\t#$this->gather_fixed(\"holes\");\n\t\t#$this->gather_unchanged(\"holes\");\n\t}",
"function checkGraderParamSizes($q, $p, $a, $tcin, $tcout, $name, $c)\n{\n $allequal = false;\n if (\n sizeof($q) == sizeof($p) &&\n sizeof($p) == sizeof($a) &&\n sizeof($a) == sizeof($name) &&\n sizeof($name) == sizeof($c)\n )\n // sizeof($a) == sizeof($tcin) &&\n // sizeof($tcin) == sizeof($tcout) &&\n // sizeof($tcout) == sizeof($name) &&\n {\n return \"true\";\n }\n else\n {\n echo sizeof($q);\n echo sizeof($p);\n echo sizeof($a);\n // echo sizeof($tcin);\n // echo sizeof($tcout);\n echo sizeof($name);\n echo sizeof($c);\n return \"false\";\n }\n}",
"protected function checkCapacity()\n {\n }",
"function common_availability($activity, $resources) \n{ \n $class_avl = $resources[$activity['class']]['avl'];\n\t\n $prof_avl = $resources[$activity['prof']]['avl'];\n $avl = array_intersect($class_avl,$prof_avl);\n return $avl;\n\n}",
"public function testObjectsScannedEqualsObjectsReturned()\n {\n $this->assertEquals($this->explain['n'], $this->explain['nscannedObjects']);\n }",
"private function checkCommonLocality() {\n $lastNode = NULL;\n foreach($this->data as $k => $v) {\n $node = $this->ra->_target($k);\n if($lastNode) {\n $this->assertTrue($node === $lastNode);\n }\n $this->assertTrue($this->ra->get($k) == $v);\n $lastNode = $node;\n }\n }",
"function _checkMultiPK(){\n \n if((!isset($this->oldElemId) && !isset($this->oldIdArea)) || ($this->oldElemId != $this->idElem || $this->oldIdArea != $this->idArea)) {\n \n SHIN_Core::$_db[SHIN_Core::$_shdb->active_group]->select('COUNT(*) as count');\n SHIN_Core::$_db[SHIN_Core::$_shdb->active_group]->from($this->table_name);\n SHIN_Core::$_db[SHIN_Core::$_shdb->active_group]->where('idElem', $this->idElem);\n SHIN_Core::$_db[SHIN_Core::$_shdb->active_group]->where('idArea', $this->idArea);\n $query = SHIN_Core::$_db[SHIN_Core::$_shdb->active_group]->get();\n $result = $query->row(0, 'array');\n \n if($result['count'] > 0) {\n return false;\n }\n }\n \n return true;\n }",
"function comp($a1, $a2) {\n if (is_null($a1) || is_null($a2)) return false;\n sort($a1);\n sort($a2);\n // There is no comparison of arrays, only values.\n // The minimum number of iterations is 1, the maximum is n.\n foreach ($a2 as $key => $value) {\n if($a1[$key] ** 2 !== $value) return false;\n }\n return true;\n}",
"function allEqual() { return allEqualValues(func_get_args()); }",
"public function comparisonProvider()\n {\n return [\n ['1', '0', 1],\n ['1', '1', 0],\n ['0', '1', -1],\n ['12345678901234567890', '1234567890123456789', 1],\n ['12345678901234567890', '12345678901234567890', 0],\n ['1234567890123456789', '12345678901234567890', -1],\n ];\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generated from protobuf field .centrifugal.centrifugo.api.InfoResult info = 13; | public function setInfo($var)
{
GPBUtil::checkMessage($var, \RoadRunner\Centrifugal\API\DTO\V1\InfoResult::class);
$this->info = $var;
return $this;
} | [
"public function setInfo($var)\n {\n GPBUtil::checkMessage($var, \\Chat\\proto\\Info::class);\n $this->info = $var;\n\n return $this;\n }",
"public static function info(): self\n {\n return new self(self::INFO);\n }",
"public function getResponseInfo();",
"public function getInfo();",
"function set_api_info($info) {\n $response = $this->api_query(array('mode' => 'set_api_info', 'data' => $info));\n\n if ($response['error']) {\n return false;\n }\n return ($response['data']);\n }",
"public function silo_info();",
"public function infoAction() {\n $http = $this->app[\"my\"]->get('http');\n $crXml = $this->app[\"my\"]->get('xml');\n //------------------\n\n try {\n \n // Initialization\n $this->init(__CLASS__ . \"/\" . __FUNCTION__);\n \n // Get XML request\n $xmlStr = $http->getInputPHP();\n\n // Validate XML request\n if (!$crXml->isValidXml($xmlStr)) {\n $this->app->abort(406, \"Invalid format XML\");\n }\n\n // Load XML\n $crXml->loadXML($xmlStr);\n\n // Define the number of the request\n $encodeRequest = (string) $crXml->doc->ubki->req_envelope->req_xml;\n $decodeRequest = base64_decode($encodeRequest);\n $strRequest = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>' . $decodeRequest;\n $crXml->loadXML($strRequest);\n\n // Get XML response\n $file = $this->getLibPath() . \"/resGetInfo.xml\";\n $resXml = file_get_contents($file);\n\n // Load XML response\n $crXml->loadXML($resXml);\n $xml = $crXml->xml();\n } catch (\\Exception $exc) {\n // Get error code\n $code = $this->getCodeException($exc);\n\n // Get XML response for error\n $file = $this->getLibPath() . '/resError.xml';\n $resXml = file_get_contents($file);\n\n // Load XML response for error\n $crXml->loadXML($resXml);\n // Set error code and error message\n $crXml->ubkidata->tech->error['errtype'] = $code;\n $crXml->ubkidata->tech->error['errtext'] = $exc->getMessage();\n $xml = $crXml->xml();\n }\n // Send XML response\n return $this->sendXml($xml);\n }",
"public function apiInfo()\n { \n $response = $this->request('Info', '');\n $Info = array(\n 'Info' => $response,\n 'timestamp'=>time()\n ); \n return $Info;\n }",
"function setInfo($info) {\n\t\t\t$this->updateResponse('info', $info);\n\t\t}",
"public function getInfoType()\n {\n return $this->info_type;\n }",
"public function getInfo()\n {\n $value = $this->get(self::INFO);\n return $value === null ? (string)$value : $value;\n }",
"public function sendInfo($info)\n {\n return $info;\n }",
"public function getInfoCode()\n {\n return $this->infoCode;\n }",
"public function setInfo($var)\n {\n GPBUtil::checkMessage($var, \\Grpc\\Gateway\\Protoc_gen_openapiv2\\Options\\Info::class);\n $this->info = $var;\n\n return $this;\n }",
"public function isInfo()\n {\n return $this->status() == static::STATUS_INFO;\n }",
"public function getInfo()\n {\n return $this->oInfo;\n }",
"public function getInfo()\n {\n return $this->getProperty('info');\n }",
"public function getPushInfoMessage()\n {\n $config[ServiceProvider::APP_SERVER_CONFIG] = $this->config[ServiceProvider::APP_SERVER_CONFIG];\n $config[ServiceProvider::APP_SERVER_CONFIG]['consumer_key'] = self::CONSUMER_KEY;\n $config[ServiceProvider::APP_SERVER_CONFIG]['consumer_secret'] = self::CONSUMER_SECRET;\n $this->serviceProvider->setConfig($config);\n \n $server = $this->serviceProvider->getServerClient();\n $server->addSubscriber($this);\n \n try {\n $server->pushInfo('author', 'name', \\Metagist\\Metainfo::fromValue('testInteger', 1, '0.1.1'));\n } catch (\\Guzzle\\Http\\Exception\\ClientErrorResponseException $exception) {\n /*\n * do nothing.\n * @see dump()\n */\n }\n \n return $this->message;\n }",
"public function GetInfo() {\n $input[0] = 0x81; //get info \n \n $this->udp->send($input);\n $reply = $this->udp->receive();\n \n if($reply) {\n for($i = 1; $i <= 6; $i++) {\n $result['version'].= chr($reply[$i]);\n } \n for($i = 7; $i <= 18; $i++) {\n $result['mac'].= strtoupper(chr($reply[$i]));\n if(($i+1) % 2 && $i < 18) {\n $result['mac'].= ':';\n }\n } \n return $result;\n }\n return NULL;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns new object of search main model. | protected function getNewSearchModel()
{
$searchModelName = $this->getSearchModelName();
return new $searchModelName;
} | [
"public function searchModel()\n\t{\n\t\t$className = get_class($this);\n\t\t$model = new $className('search');\n\t\t$model->unsetAttributes();\n\t\tif(isset($_GET[$className]))\n\t\t\t$model->attributes = $_GET[$className];\n\t\treturn $model;\n\t}",
"protected function getSearchModel(): ActiveRecord\n {\n return new ProductSearch;\n }",
"public function getSearchModel();",
"protected function getSearchModel(): ActiveRecord\n {\n return new ProviderSearch;\n }",
"public static function getSearchObj()\n {\n return $srch = new SearchBase(static::DB_TBL, 'sprating');\n }",
"public static function new_search_record()\n\t{\n\t\treturn new match_record_search();\n\t}",
"static public function newSearchAll()\n {\n $searchAll = new Core_Model_SearchManager();\n $searchAll->setProvider(Core_Model_Dataprovider_DiFactory::getSearchAll());\n \n return $searchAll;\n }",
"public function createSearch();",
"public function createCorrespondingBookModelForSearch() {\n\t\t$searchModel = new Book('search');\n\t\t$searchModel->unsetAttributes();\n\t\t\n\t\t$searchInput = $this->searchInput;\n\t\t\n\t\tif ($searchInput==\"Suggestions\") {\n\t\t\t$searchModel->title = null;\n\t\t} else {\n\t\t\t$searchModel->title = $searchInput;\n\t\t}\n\t\treturn $searchModel;\n\t}",
"public function createSearch()\n\t{\n\t\t$conn = $this->dbm->acquire( $this->dbname );\n\t\t$search = new \\Aimeos\\MW\\Criteria\\SQL( $conn );\n\t\t$this->dbm->release( $conn, $this->dbname );\n\n\t\treturn $search;\n\t}",
"public function __construct(){\n $this->manager = new SearchModel();\n }",
"function getClone ()\n\t\t{\t\t\t\n\t\t\t$rupaSearch = new RupaSearch();\n\t\t\t$rupaSearch->appliance = $this->appliance;\n\t\t\t$rupaSearch->collectionNames = $this->collectionNames;\n\t\t\t$rupaSearch->query = $this->query;\n\t\t\t$rupaSearch->excludeWords = $this->excludeWords;\n\t\t\t$rupaSearch->orQuery = $this->orQuery;\n\t\t\t$rupaSearch->quoteQuery = $this->quoteQuery;\n\t\t\t$rupaSearch->startNum = $this->startNum;\n\t\t\t$rupaSearch->numToShow = $this->numToShow;\n\t\t\t$rupaSearch->sortBy = $this->sortBy;\n\t\t\t$rupaSearch->categoryIDs = $this->categoryIDs;\n\t\t\t$rupaSearch->sites = $this->sites;\n\t\t\t$rupaSearch->fullQuery = $this->fullQuery;\n\t\t\t$rupaSearch->partialFieldsNames = $this->partialFieldsNames;\n\t\t\t$rupaSearch->partialFieldsValues = $this->partialFieldsValues;\n\t\t\t$rupaSearch->metadataFieldsNames = $this->metadataFieldsNames;\n\t\t\t$rupaSearch->fileFormats = $this->fileFormats;\n\t\t\t$rupaSearch->fileFormatInclusion = $this->fileFormatInclusion;\n\t\t\t$rupaSearch->allSites = $this->allSites;\n\t\t\t$rupaSearch->collections = $this->collections;\n\t\t\t$rupaSearch->outputFormat = $this->outputFormat;\n\t\t\t$rupaSearch->filterResults = $this->filterResults;\n\t\t\t$rupaSearch->defaultFilter = $this->defaultFilter;\n\t\t\t\n\t\t\treturn $rupaSearch;\n\t\t}",
"public function loadSearch() {\n $searchClass = $this->modx->getOption('discuss.search_class',null,'disSearch');\n $searchClassPath = $this->modx->getOption('discuss.search_class_path',null,$this->config['modelPath'].'discuss/search/');\n if (empty($searchClassPath)) $searchClassPath = $this->config['modelPath'].'discuss/search/';\n \n if ($className = $this->modx->loadClass($searchClass,$searchClassPath,true,true)) {\n $this->search = new $className($this);\n } else {\n $this->modx->log(modX::LOG_LEVEL_ERROR,'Could not load '.$searchClass.' from '.$searchClassPath);\n }\n return $this->search;\n }",
"public static function new_info_search_record()\n\t{\n\t\treturn new squad_record_info_search();\n\t}",
"public static function indexSearch()\n {\n return (new static)->newIndexSearch();\n }",
"public function new_search_query();",
"public function pushCriteria(){\n\t\t$model = $this->model;\n\n return $model;\n\t}",
"protected function getSearchInstance () {\n $search = Search::getInstance($this->data['attrs']['source_id']);\n\n if ($this->displayNotices($search->getErrors())) {\n return false;\n }\n $this->displayNotices($search->getWarnings(), true);\n\n return $search;\n }",
"public function getSearchableModel()\n\t{\n\t\t$componentName = $this->get('name');\n\t\t$model = DiscoveryHelper::getSearchableModel($componentName);\n\t\treturn $model;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the supported databases | public function getSupportedDatabases()
{
return $this->_supportedDatabases;
} | [
"public function getDatabases();",
"function getDatabases() \n {\n \t\n \t\n $dbi = & VDBI::getInstance();\n \n $dblist = $dbi->listDatabases(); \n if (VWP::isWarning($dblist)) {\n return $dblist;\n }\n \n $databases = array();\n foreach($dblist as $dbid) { \t\n $dbinfo = $this->getDatabaseInfo($dbid); \n if (!VWP::isWarning($dbinfo)) {\n array_push($databases,$dbinfo);\n }\n }\n \n return $databases;\n }",
"public function listDatabases()\n {\n return $this->queryAndValid('GET', '/_all_dbs', [200]);\n }",
"public function listDatabases() {\n\t\t$res = $this->client->parseResponse($this->client->query('GET', '_all_dbs'));\n\t\treturn $res['body'];\n\t}",
"public function get_databases() {\n $array_DB = $this->_db->db_array(\"SHOW DATABASES;\");\n $result = '';\n\n if (!is_array($array_DB)) {\n $array_DB = array(0 => array('Database' => $this->_db->_db_selected));\n }\n\n foreach ($array_DB as $db) {\n $base = $db['Database'];\n $selected = '';\n\n if ($this->_db_choosen) {\n $selected = in_array($base, $this->_db_choosen) ? 'selected' : '';\n }\n\n $result .= \"<option value='$base'\" . $selected . \">$base</option>\";\n }\n\n return $result;\n }",
"public function getDatabaseList() {\n\t\t$dbs = $this->getAll(\"show databases\");\n\t\t$list = array();\n\t\tforeach ($dbs as $db_name)\n\t\t{\n\t\t\t$list[] = $db_name['Database'];\n\t\t}\n\t\treturn $list;\n\t}",
"function databases()\r\n {\r\n if ($this->_connection==null)\r\n {\r\n $this->open();\r\n }\r\n return($this->_connection->MetaDatabases());\r\n }",
"public function getSupportedDbVersions()\n {\n return $this->supported_db_versions;\n }",
"function database_list(){\n\t\treturn($this->q2obj(\"show databases\"));\n\t}",
"public static function supportDatabasesTypes(){\n return array(\n 'mysql'=>'MySQL',\n );\n }",
"public function listDatabases();",
"public static function getAvailableDBMS() {\n\t\t\t$engines = scandir( dirname(__FILE__) . \"/engine/\" );\n\t\t\t\n\t\t\t$available_DBMS = array();\n\t\t\t\n\t\t\tforeach( $engines as $entry ) {\n\t\t\t\tif( preg_match( \"~\\.engine\\.php$~\", $entry ) ) {\n\t\t\t\t\t$available_DBMS[] = str_replace( '.engine.php', '', $entry );\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn ( count( $available_DBMS ) ? $available_DBMS : false );\n\t\t}",
"private function getAllDatabases() {\n $return = array();\n //$db_list = mysql_list_dbs($this->conn);\n\n\t\t$sql=\"SHOW DATABASES\";\n\t\t$db_list = mysqli_query($this->conn,$sql);\n\n while ($row = mysqli_fetch_object($db_list)) {\n if (!in_array($row->Database, $this->protectedDatabases)) {\n\t\t\t\t$getPrefix = explode(\"_\",$row->Database);\n\t\t\t\tif( $getPrefix[0].'_' == DOMAINPREFIX ){\n\t\t\t\t\t$return [] = $row->Database;\n\t\t\t\t}\n }\n }\n\n return $return;\n }",
"public function showDatabases()\n\t{\n\t\t$qery_result = $this->dbh->query('SHOW DATABASES');\n\n\t\t$reqult = [];\n\n\t\tforeach ($qery_result as $q)\n\t\t{\n\t\t\t// Skip of database is listed in ignored_dbs\n\t\t\tif ( in_array($q['Database'], $this->ignored_dbs))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$result[] = $q['Database'];\n\t\t}\n\n\t\treturn $result;\n\t}",
"public function getDatabases() {\n $url = \"services/\" . $this->getId() . \"/gameservers/mariadbs\";\n $result = $this->getApi()->dataGet($url);\n return $result['databases'];\n }",
"public function listDatabases() {\n \n /* are we ready to query? */\n \t\n if(!$this->isReady()) {\n $this->error(\"Can not list databases, adaptor not ready.\");\n return false; \t\n }\n \n if(count(self::$dbList) != 0) {\n return self::$dbList; \n }\n \n $this->info(\"listing databases...\");\n \t\n $sql = \"SHOW DATABASES;\";\n \n $this->info(\". listing...\");\n \n $result = $this->query($sql);\n if($result === false) {\n $this->error(\"Can not list databases, problem running SQL: \".$this->getError());\n return false;\t\n }\n \n foreach($result as $idx => $attr) {\n \n $values = array_values($attr);\n $first = array_pop($values);\n \n self::$dbList[] = $first;\n }\n \n /* all done */\n \n return self::$dbList;\n }",
"protected function getAvailableDbalDrivers() {}",
"public function getDatabases()\n {\n if (false === $this->connectionHandle) $this->dbConnect();\n $this->databases = array();\n $databases = @mysql_list_dbs($this->connectionHandle);\n if (is_resource($databases)) {\n WHILE ($row = mysql_fetch_array($databases, MYSQL_ASSOC)) {\n $this->databases[] = $row['Database'];\n }\n } else {\n //mysql_list_dbs seems not to be allowed for this user\n // try to get list via \"SHOW DATABASES\"\n $res = $this->query('SHOW DATABASES', self::ARRAY_ASSOC);\n foreach ($res as $r) {\n $this->databases[] = $r['Database'];\n }\n }\n sort($this->databases);\n return $this->databases;\n }",
"public function getAppDatabases()\n {\n try {\n $stmt = $this->_conn->execute('SHOW DATABASES');\n $rows = Hash::extract($stmt->fetchall(), '{n}.{n}');\n $stripped = array_diff($rows, $this->databaseMeta['mysql']['system_databases']);\n $result = [];\n foreach ($stripped as $databaseName) {\n $result[] = ['name' => $databaseName];\n }\n } catch (\\Exception $e) {\n throw new \\Exception(\"Error generating database list: \" . $e->getMessage());\n }\n\n return $result;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handle the approved process "restored" event. | public function restored(ApprovedProcess $approvedProcess)
{
//
} | [
"function post_restoreItem() {\n }",
"protected function afterRestore() {}",
"protected function beforeRestore() {}",
"public function restored(Event $event)\n {\n //\n }",
"public function action_restore_events() {\n\t\t\tif ( ! isset( $_GET['action'] ) || 'tribe-restore' !== $_GET['action'] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$event = get_post( absint( $_GET['post'] ) );\n\n\t\t\tif ( ! $event instanceof WP_Post ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( Tribe__Events__Main::POSTTYPE !== $event->post_type ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( self::$ignored_status !== $event->post_status ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( ! function_exists( 'wp_get_referer' ) ) {\n\t\t\t\tif ( ! empty( $_SERVER['REQUEST_URI'] ) ) {\n\t\t\t\t\t$sendback = $_SERVER['REQUEST_URI'];\n\t\t\t\t} elseif ( ! empty( $_REQUEST['_wp_http_referer'] ) ) {\n\t\t\t\t\t$sendback = $_REQUEST['_wp_http_referer'];\n\t\t\t\t} elseif ( ! empty( $_SERVER['HTTP_REFERER'] ) ) {\n\t\t\t\t\t$sendback = $_SERVER['HTTP_REFERER'];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$sendback = wp_get_referer();\n\t\t\t}\n\n\t\t\t$sendback = remove_query_arg( array( 'trashed', 'untrashed', 'deleted', 'locked', 'ids' ), $sendback );\n\n\t\t\tif ( isset( $_REQUEST['ids'] ) ) {\n\t\t\t\t$post_ids = explode( ',', $_REQUEST['ids'] );\n\t\t\t} elseif ( ! empty( $_REQUEST['post'] ) ) {\n\t\t\t\t$post_ids = array_map( 'intval', (array) $_REQUEST['post'] );\n\t\t\t}\n\n\t\t\t$restored = 0;\n\t\t\tforeach ( (array) $post_ids as $post_id ) {\n\t\t\t\tif ( ! current_user_can( 'delete_post', $post_id ) ) {\n\t\t\t\t\twp_die( esc_html__( 'You do not have permission to restore this post.', 'the-events-calendar' ) );\n\t\t\t\t}\n\n\t\t\t\tif ( ! $this->restore_event( $post_id ) ) {\n\t\t\t\t\twp_die( esc_html__( 'Error restoring from Ignored Events.', 'the-events-calendar' ) );\n\t\t\t\t}\n\n\t\t\t\t$restored++;\n\t\t\t}\n\t\t\t$sendback = add_query_arg( 'restored', $restored, $sendback );\n\n\t\t\twp_redirect( $sendback );\n\t\t\texit;\n\t\t}",
"public function restored(EventA $eventA)\n {\n //\n }",
"public function restored(Employee $employee)\n {\n event(new EmployeeUpdated($employee, \"restore\"));\n }",
"function restoreEvent($eventId)\n {\n // restore the event\n mysql_query(\"UPDATE argus_events SET status = 'SAVED' where event_id = '\".$eventId.\"' AND status = 'DELETED'\") or die(mysql_error());\n \n return;\n }",
"public function handle_exit_recovery_mode()\n {\n }",
"public function restored(Recordable $model): void\n {\n Accountant::record($model, 'restored');\n\n // Once the event terminates, the state is reverted\n static::$restoring = false;\n }",
"public function handle_restore_site_request() {\n\t\t$this->verify_request( 'wpseo-network-restore', 'restore_site_nonce' );\n\n\t\t$option_group = 'wpseo_ms';\n\n\t\t$site_id = ! empty( $_POST[ $option_group ]['site_id'] ) ? (int) $_POST[ $option_group ]['site_id'] : 0; // WPCS: CSRF ok.\n\t\tif ( ! $site_id ) {\n\t\t\tadd_settings_error( $option_group, 'settings_updated', __( 'No site has been selected to restore.', 'wordpress-seo' ), 'error' );\n\n\t\t\t$this->terminate_request();\n\t\t\treturn;\n\t\t}\n\n\t\t$site = get_site( $site_id );\n\t\tif ( ! $site ) {\n\t\t\t/* translators: %s expands to the ID of a site within a multisite network. */\n\t\t\tadd_settings_error( $option_group, 'settings_updated', sprintf( __( 'Site with ID %d not found.', 'wordpress-seo' ), $site_id ), 'error' );\n\t\t}\n\t\telse {\n\t\t\tWPSEO_Options::reset_ms_blog( $site_id );\n\n\t\t\t/* translators: %s expands to the name of a site within a multisite network. */\n\t\t\tadd_settings_error( $option_group, 'settings_updated', sprintf( __( '%s restored to default SEO settings.', 'wordpress-seo' ), esc_html( $site->blogname ) ), 'updated' );\n\t\t}\n\n\t\t$this->terminate_request();\n\t}",
"public function handleAfterRestoreOrderEvent(Event $e)\n {\n $subOrders = SubOrder::find()->commerceOrderId($e->sender->id)->trashed()->all();\n if( empty($subOrders) ) return;\n\n Craft::$app->getElements()->restoreElements($subOrders);\n }",
"public function restored(SalesReceipt $salesReceipt)\n {\n //\n }",
"public function restored(RequestForQuotationPending $requestForQuotationPending)\n {\n //\n }",
"public function onCartRestored(){\n\n }",
"public function after_restore() {\n global $DB;\n $attendanceid = $this->get_activityid();\n $courseid = $this->get_courseid();\n if (empty($courseid) || empty($attendanceid)) {\n return;\n }\n if (empty(get_config('attendance', 'enablecalendar'))) {\n // Attendance isn't using Calendar - delete anything that was created.\n $DB->delete_records('event', ['modulename' => 'attendance', 'instance' => $attendanceid, 'courseid' => $courseid]);\n } else {\n // Clean up any orphaned events.\n $sql = \"modulename = 'attendance' AND courseid = :courseid AND id NOT IN (SELECT s.caleventid\n FROM {attendance_sessions} s\n JOIN {attendance} a on a.id = s.attendanceid\n WHERE a.course = :courseid2)\";\n $params = ['courseid' => $courseid, 'courseid2' => $courseid];\n $DB->delete_records_select('event', $sql, $params);\n }\n }",
"public static function course_restored(course_restored $event) {\n if (!static::is_enabled()) {\n return;\n }\n\n course_helper::set_added($event->objectid, $event->timecreated);\n\n /* This will affect all modules, not just those that were restored. Can\n * we be a bit less heavy handed? */\n switch ($event->other['target']) {\n case backup::TARGET_NEW_COURSE:\n course_helper::set_all_modules_added($event->objectid,\n $event->timecreated);\n break;\n }\n }",
"public function restored(RequestOrder $requestOrder)\n {\n //\n }",
"public function restore()\r\n {\r\n $handlerFunctionName = 'restore_'.$this->handlerType.'_handler';\r\n $handlerFunctionName();\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
register a user defined function $function function name used in the Reverse Polish Notation input $callback name of the function to call for processing $minparams minimum parameters the function recieves $maxparams maxmimum parameters the function can recieve | function register($function, $callback, $minparams, $maxparams=null)
{
if (! function_exists ($callback))
return false;
if (!is_null($maxparams) && ($maxparams < $minparams))
return false;
$this->functions[$function] = array('minparams' => $minparams, 'maxparams' => $maxparams, 'callback' => $callback);
return true;
} | [
"function cb_register_function($func_name,$place,$params=NULL)\n {\n global $Cbucket;\n\n if(function_exists($func_name))\n {\n $Cbucket->clipbucket_functions[$place][] = array('func'=>$func_name,'params'=>$params);\n }\n }",
"function func($user_func, $x){\n\t$fun_pos=strlen($user_func)-1;\n\twhile($fun_pos>=0){\n\t\tif($user_func[$fun_pos]=='x'){\n\t\t\tif($fun_pos>0 && $fun_pos<(strlen($user_func)-1)){\n\t\t\tif($user_func[$fun_pos+1]!='p' && $user_func[$fun_pos-1]!='a'){\n\t\t\t\t$user_func = substr_replace($user_func,\"$\",$fun_pos,0);\n\t\t\t}\n\t\t\t}else{$user_func = substr_replace($user_func,\"$\",$fun_pos,0);}\n\t\t}\n\t\t$fun_pos--;\n\t}\n\teval(\"\\$out=$user_func;\");\n\treturn $out;\n}",
"public static function callbackStringToFunction($callback) {\n if (is_callable($callback)) {\n $cb = $callback;\n } elseif (is_string($callback)) {\n // Create a callable\n $cb = create_function('', '$args = func_get_args(); ?>' . $callback);\n }\n\n return $cb;\n }",
"public function addFunction ($functions) {}",
"function registerFunction($mFunction,$sRequestType=AJAX_POST)\n\t{\n\t\tif (is_array($mFunction)) {\n\t\t\t$this->aFunctions[$mFunction[0]] = 1;\n\t\t\t$this->aFunctionRequestTypes[$mFunction[0]] = $sRequestType;\n\t\t\t$this->aObjects[$mFunction[0]] = array_slice($mFunction, 1);\n\t\t}\t\n\t\telse {\n\t\t\t$this->aFunctions[$mFunction] = 1;\n\t\t\t$this->aFunctionRequestTypes[$mFunction] = $sRequestType;\n\t\t}\n\t}",
"function runkit_function_add($function_name, $args, $code) {}",
"function registerPhpCallback($callback)\n {\n $this->_validCallbacks[md5(serialize($callback))] = 1;\n }",
"protected function create_callback_name( $callback ) {\n\t\t$callable_name = null;\n\n\t\tif ( is_string( $callback ) && method_exists( 'IWF_Validation', $callback ) ) {\n\t\t\t$callback = array( 'IWF_Validation', $callback );\n\t\t}\n\n\t\tif ( ! is_callable( $callback, null, $callable_name ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( strpos( $callable_name, 'IWF_Validation::' ) ) {\n\t\t\t$callable_name = str_replace( 'IWF_Validation::', '', $callable_name );\n\t\t}\n\n\t\tif ( ! empty( $this->current_field ) && ! empty( $this->rules[ $this->current_field ] ) ) {\n\t\t\t$same_rules = array();\n\n\t\t\tforeach ( array_keys( $this->rules[ $this->current_field ] ) as $rule ) {\n\t\t\t\tif ( preg_match( '|^' . $callable_name . '(?:\\(([0-9]+?)\\))?$|', $rule, $matches ) ) {\n\t\t\t\t\t$same_rules[] = array( $rule, ! empty( $matches[1] ) ? $matches[1] : 1 );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( $same_rules ) {\n\t\t\t\tusort( $same_rules, create_function( '$a, $b', 'return (int)$a[1] < (int)$b[1];' ) );\n\t\t\t\t$callable_name = $callable_name . '(' . ( (int) $same_rules[0][1] + 1 ) . ')';\n\t\t\t}\n\t\t}\n\n\t\treturn $callable_name;\n\t}",
"protected function featureCallback($callback,$params)\r\n {\r\n if (is_callable($callback)) {\r\n call_user_func($callback,$params);\r\n }\r\n }",
"function create_function($args, $code)\n{\n}",
"function api_output_jsonp_ensure_valid_function_name($callback) {\n\t\t//as far as XSS is concerned, it means callback \"names\" containing parens, curly braces, semicolons and slashes will result in a 400\n\t\t//see: http://www.geekality.net/2011/08/03/valid-javascript-identifier/\n\n\t\t$identifier_syntax = '/^[$_\\p{L}\\.][$_\\p{L}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\x{200C}\\x{200D}\\.]*+$/u';\n\t\treturn preg_match($identifier_syntax, $callback);\n\t}",
"protected function _parseFunction($input = null)\n\t{\n\t\t$output = str_replace(array(\n\t\t\t'<function>',\n\t\t\t'</function>'\n\t\t), $this->_delimiter, $input);\n\t\t$parts = explode($this->_delimiter, $output);\n\n\t\t/* parse needed parts */\n\n\t\tforeach ($parts as $key => $value)\n\t\t{\n\t\t\tif ($key % 2)\n\t\t\t{\n\t\t\t\t/* decode to array */\n\n\t\t\t\t$json = json_decode($value, true);\n\t\t\t\tob_start();\n\n\t\t\t\t/* multiple calls with parameter */\n\n\t\t\t\tif (is_array($json))\n\t\t\t\t{\n\t\t\t\t\tforeach ($json as $function => $parameter)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!in_array($function, $this->_forbiddenFunctions))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\techo call_user_func_array($function, $parameter);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t/* else single call */\n\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (!in_array($value, $this->_forbiddenFunctions))\n\t\t\t\t\t{\n\t\t\t\t\t\techo call_user_func($value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$parts[$key] = ob_get_clean();\n\t\t\t}\n\t\t}\n\t\t$output = implode($parts);\n\t\treturn $output;\n\t}",
"function registerFunction( $name, $function ) {\r\n\t\t\t$this->_functions[ $name ] = $function;\r\n\t\t}",
"function addCallback( callable $Callback );",
"function functionRegister($short_name,$ns_called_from=false,$namespaced_function=false)\n{\n static $functions=[];\n if(!$namespaced_function) {\n return functionRegisterGet($functions, $short_name,$ns_called_from);\n // return $functions[$short_name][$ns_called_from];\n }\n return functionRegisterSet($functions,$short_name,$ns_called_from,$namespaced_function);\n // echo \"Registering `$short_name` as `$namespaced_function`\n // for calls from `$ns_called_from`\",\"\\n\";\n\n}",
"function regularFunctionCallbackArray($callbackFunction, $param_array)\n{\n echo $callbackFunction(...$param_array); //Call the callback and passing the parameters by using ... for variable arguments PHP 5.6+\n}",
"function f($definition,$parameter_placeholder='_')\n{\n\t$code=$definition;\n\tif (strpos($code,\";\")===false)\n\t\t$code=\"return {$code};\";\n\n\t$arg_count_max=ceil(sqrt(2*substr_count($code,$parameter_placeholder))); //cuz to have X args, we need X*(X+1)/2 _s.\n\t$argCount=0;\n\tfor ($i=$arg_count_max;$i>=1;--$i)\n\t\tif (strpos($code, str_repeat($parameter_placeholder,$i))!==false)\n\t\t{\n\t\t\t$argCount=$i;\n\t\t\tbreak;\n\t\t}\n\t$args=[];\n\tif ($argCount)\n\t\t$args=array_map(function($t) {return '$arg'.($t+1);},range(0,$argCount-1));\n\t$argString=implode(\",\",$args);\n\tfor ($i=$argCount;$i>=1;--$i)\n\t\t$code=str_replace(str_repeat($parameter_placeholder,$i), '$arg'.$i, $code);\n\n\n\t$eval_code=\"return function ({$argString}) { {$code} };\";\n\t//var_dump($eval_code);\n\t$f=eval($eval_code);\n\tif ($f===false)\n\t\ttrigger_error(\"Can not create anonymous function: '{$eval_code}'\",E_USER_ERROR);\n\t// var_dump($f);\n\treturn $f;\n}",
"function yRegisterDeviceArrivalCallback($func_arrivalCallback)\n{\n return YAPI::RegisterDeviceArrivalCallback($func_arrivalCallback);\n}",
"public function registerCallbackFunctions($conn) {\n sqlite_create_function($conn, 'cast', array($this, '_cast'), 2);\n sqlite_create_function($conn, 'sign', array($this, '_sign'), 1);\n sqlite_create_function($conn, 'dateadd', array($this, '_dateadd'), 3);\n sqlite_create_function($conn, 'locate', array($this, '_locate'), 3);\n sqlite_create_function($conn, 'nullif', array($this, '_nullif'), 2);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The getter for the field confirmCode | public function getConfirmCode()
{
return $this->_confirmCode;
} | [
"public function getConfirmCode()\n\t{\n\t\treturn $this->confirm_code;\n\t}",
"public function getOedhconfirmcode()\n {\n return $this->oedhconfirmcode;\n }",
"public function getConfirmCode()\n {\n return $this->smsConfirm.$this->userID;\n }",
"public function getConfirmationCode()\n\t{\n return UserPeer::generateConfirmationCode( $this );\n\t}",
"public function getConfirmKey()\r\n {\r\n return $this->_confirmField;\r\n }",
"public function getConfirmationCode() {\n if (!$this->confirmationCode) {\n $this->confirmationCode = md5(microtime());\n }\n return $this->confirmationCode;\n }",
"public function getConfirm()\n {\n return $this->confirm;\n }",
"public function getPromoCode();",
"public function getConfirmKey()\n {\n return $this->confirmKey;\n }",
"public function getConfirm()\n\t{\n\t\treturn $this->confirm;\n\t}",
"public function getCode()\n\t{\n\t\tif( isset( $this->values['coupon.code.code'] ) ) {\n\t\t\treturn (string) $this->values['coupon.code.code'];\n\t\t}\n\t}",
"public function getCouponCode();",
"public function getCodeActivite() {\n return $this->codeActivite;\n }",
"public function getConfirmationNumber()\n {\n return $this->confirmationNumber;\n }",
"public function setOedhconfirmcode($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->oedhconfirmcode !== $v) {\n $this->oedhconfirmcode = $v;\n $this->modifiedColumns[SalesHistoryDetailTableMap::COL_OEDHCONFIRMCODE] = true;\n }\n\n return $this;\n }",
"function GetCode()\r\n\t{\r\n\t\treturn $this->m_code;\r\n\t}",
"public function getCouponCode()\n {\n return $this->couponCode;\n }",
"public function getConfirmationNumber() {\n\t\treturn ($this->confirmationNumber);\n\t}",
"public function getConfirmMessage()\n\t{\n\t\treturn $this->confirmMessage;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets a new invBlockGroupingCode This code identifies the inventory group that contains multiple blocks. This allows for nested blocks. | public function setInvBlockGroupingCode($invBlockGroupingCode)
{
$this->invBlockGroupingCode = $invBlockGroupingCode;
return $this;
} | [
"public function setGroupCode($code);",
"public function groupByBlockName()\n {\n foreach ($this->list as $block) {\n if (!isset($this->groupedList[$block->getOxBlockName()])) {\n $this->groupedList[$block->getOxBlockName()] = array($block);\n } else {\n array_push($this->groupedList[$block->getOxBlockName()], $block);\n }\n }\n }",
"public static function get_block_groups() {\n\t\treturn self::$block_groups;\n\t}",
"public function setRegionGroup($val)\n {\n $this->_propDict[\"regionGroup\"] = $val;\n return $this;\n }",
"private function createGroupCode()\n {\n $this->setTaxClassId();\n\n $priceList = $this->priceListRepository->getById($this->customerPriceList);\n\n $taxClass = $this->taxClassRepository->get($this->taxClassId);\n\n $taxAddition = '';\n switch ($taxClass->getClassName()) {\n case XcoreTaxClass::WITH_VAT:\n $taxAddition = ' with vat';\n break;\n case XcoreTaxClass::WITHOUT_VAT:\n $taxAddition = ' without vat';\n break;\n }\n\n if ($priceList) {\n $this->groupCode = sprintf('PL %s%s #%s', $priceList->getCode(), $taxAddition, $priceList->getId());\n }\n }",
"public function updateInviteCodes($groupName) {\n\t\t$codes = [\n\t\t\tRoles::PROJECT_ADMIN => Input::get('adminsICode'),\n\t\t\tRoles::PROJECT_MEMBER => Input::get('membersICode'),\n\t\t\tRoles::PROJECT_GUEST => Input::get('guestsICode')\n\t\t];\n\t\t\n\t\tforeach(Roles::$PROJECT_ROLES as $role) {\n\t\t\t$sentryGroup = Sentry::findGroupByName(str_replace('#', $groupName, $role));\n\t\t\t$sentryGroup['invite_code'] = $codes[$role];\n\t\t\t$sentryGroup->save();\n\t\t}\n\t\t\n\t\treturn Redirect::back()\n\t\t\t->with('flashSuccess', 'Invitation code successfully updated.');\n\t}",
"public function new($id = '') {\n\t\t$this->initFieldAttributes();\n\t\t/** @var InvGroupCode */\n\t\t$code = parent::new($id);\n\t\t$code->setSurchargetype($this->fieldAttribute('surchargetype', 'default'));\n\t\t$code->setWebgroup($this->fieldAttribute('webgroup', 'default'));\n\t\t$code->setSalesprogram($this->fieldAttribute('salesprogram', 'default'));\n\t\t$code->setMaxqtysmall($this->fieldAttribute('maxqtysmall', 'default'));\n\t\t$code->setMaxqtymedium($this->fieldAttribute('maxqtymedium', 'default'));\n\t\t$code->setMaxqtylarge($this->fieldAttribute('maxqtylarge', 'default'));\n\t\treturn $code;\n\t}",
"public function addGroupToVoucher()\n {\n $oConfig = oxRegistry::getConfig();\n $aChosenCat = $this->_getActionIds( 'oxgroups.oxid' );\n $soxId = $oConfig->getRequestParameter( 'synchoxid');\n\n if ( $oConfig->getRequestParameter( 'all' ) ) {\n $sGroupTable = $this->_getViewName('oxgroups');\n $aChosenCat = $this->_getAll( $this->_addFilter( \"select $sGroupTable.oxid \".$this->_getQuery() ) );\n }\n if ( $soxId && $soxId != \"-1\" && is_array( $aChosenCat ) ) {\n foreach ( $aChosenCat as $sChosenCat) {\n $oNewGroup = oxNew(\"oxbase\");\n $oNewGroup->init( \"oxobject_block2group\" );\n $oNewGroup->oxobject_block2group__oxobjectid = new oxField($soxId);\n $oNewGroup->oxobject_block2group__oxgroupsid = new oxField($sChosenCat);\n $oNewGroup->save();\n }\n }\n }",
"public function setGrouping($val);",
"public function setInvBlockStatusCode($invBlockStatusCode)\n {\n $this->invBlockStatusCode = $invBlockStatusCode;\n return $this;\n }",
"private function _prepareWPGroupByBlock()\n {\n if (!$this->_has_groups) {\n return;\n }\n\n foreach ($this->_table_data['groupingRules'] AS $grouping_rule) {\n if (empty($grouping_rule)) {\n continue;\n }\n $this->_group_arr[] = $this->_column_aliases[$grouping_rule];\n }\n\n }",
"public function setRegionGroup(?CloudPcRegionGroup $value): void {\n $this->getBackingStore()->set('regionGroup', $value);\n }",
"public function getGroupedBlocks() {\n $definitions = $this->getBlocks();\n $definitions = $this->blockManager->getGroupedDefinitions($definitions);\n $keys = array_map(function ($key) {\n return preg_replace('@[^a-z0-9-]+@', '_', strtolower($key));\n }, array_keys($definitions));\n\n return array_combine($keys, array_values($definitions));\n }",
"function setGroupId($value) {\n return $this->setFieldValue('group_id', $value);\n }",
"public function setGroupId(&$data)\n {\n $data['User']['group_id'] = 2;\n\n }",
"function bp_groups_render_group_block( $attributes = array() ) {\n\t$bp = buddypress();\n\n\t$block_args = wp_parse_args(\n\t\t$attributes,\n\t\tarray(\n\t\t\t'itemID' => 0,\n\t\t\t'avatarSize' => 'full',\n\t\t\t'displayDescription' => true,\n\t\t\t'displayActionButton' => true,\n\t\t\t'displayCoverImage' => true,\n\t\t)\n\t);\n\n\tif ( ! $block_args['itemID'] ) {\n\t\treturn;\n\t}\n\n\t// Set the group ID and container classes.\n\t$group_id = (int) $block_args['itemID'];\n\t$container_classes = array( 'bp-block-group' );\n\n\t// Group object.\n\t$group = groups_get_group( $group_id );\n\n\tif ( ! $group->id ) {\n\t\treturn;\n\t}\n\n\t// Avatar variables.\n\t$avatar = '';\n\t$avatar_container = '';\n\n\t// Cover image variable.\n\t$cover_image = '';\n\t$cover_style = '';\n\t$cover_container = '';\n\n\t// Group name/link/description variables.\n\t$group_name = bp_get_group_name( $group );\n\t$group_link = bp_get_group_permalink( $group );\n\t$group_description = '';\n\t$group_content = '';\n\n\t// Group action button.\n\t$action_button = '';\n\t$display_action_button = (bool) $block_args['displayActionButton'];\n\n\tif ( $bp->avatar && $bp->avatar->show_avatars && ! bp_disable_group_avatar_uploads() && in_array( $block_args['avatarSize'], array( 'thumb', 'full' ), true ) ) {\n\t\t$avatar = bp_core_fetch_avatar(\n\t\t\tarray(\n\t\t\t\t'item_id' => $group->id,\n\t\t\t\t'object' => 'group',\n\t\t\t\t'type' => $block_args['avatarSize'],\n\t\t\t\t'html' => false,\n\t\t\t)\n\t\t);\n\n\t\t$container_classes[] = 'avatar-' . $block_args['avatarSize'];\n\t} else {\n\t\t$container_classes[] = 'avatar-none';\n\t}\n\n\tif ( $avatar ) {\n\t\t$avatar_container = sprintf(\n\t\t\t'<div class=\"item-header-avatar\">\n\t\t\t\t<a href=\"%1$s\">\n\t\t\t\t\t<img src=\"%2$s\" alt=\"%3$s\" class=\"avatar\">\n\t\t\t\t</a>\n\t\t\t</div>',\n\t\t\tesc_url( $group_link ),\n\t\t\tesc_url( $avatar ),\n\t\t\t// Translators: %s is the group's name.\n\t\t\tsprintf( esc_html__( 'Group Profile photo of %s', 'buddypress' ), $group_name )\n\t\t);\n\t}\n\n\t$display_cover_image = (bool) $block_args['displayCoverImage'];\n\tif ( bp_is_active( 'groups', 'cover_image' ) && $display_cover_image ) {\n\t\t$cover_image = bp_attachments_get_attachment(\n\t\t\t'url',\n\t\t\tarray(\n\t\t\t\t'item_id' => $group->id,\n\t\t\t\t'object_dir' => 'groups',\n\t\t\t)\n\t\t);\n\n\t\tif ( $cover_image ) {\n\t\t\t$cover_style = sprintf(\n\t\t\t\t' style=\"background-image: url( %s );\"',\n\t\t\t\tesc_url( $cover_image )\n\t\t\t);\n\t\t}\n\n\t\t$cover_container = sprintf(\n\t\t\t'<div class=\"bp-group-cover-image\"%s></div>',\n\t\t\t$cover_style\n\t\t);\n\n\t\t$container_classes[] = 'has-cover';\n\t}\n\n\t$display_description = (bool) $block_args['displayDescription'];\n\tif ( $display_description ) {\n\t\t$group_description = bp_get_group_description( $group );\n\t\t$group_content = sprintf(\n\t\t\t'<div class=\"group-description-content\">%s</div>',\n\t\t\t$group_description\n\t\t);\n\n\t\t$container_classes[] = 'has-description';\n\t}\n\n\tif ( $display_action_button ) {\n\t\t$action_button = sprintf(\n\t\t\t'<div class=\"bp-profile-button\">\n\t\t\t\t<a href=\"%1$s\" class=\"button large primary button-primary\" role=\"button\">%2$s</a>\n\t\t\t</div>',\n\t\t\tesc_url( $group_link ),\n\t\t\tesc_html__( 'Visit Group', 'buddypress' )\n\t\t);\n\t}\n\n\t$output = sprintf(\n\t\t'<div class=\"%1$s\">\n\t\t\t%2$s\n\t\t\t<div class=\"group-content\">\n\t\t\t\t%3$s\n\t\t\t\t<div class=\"group-description\">\n\t\t\t\t\t<strong><a href=\"%4$s\">%5$s</a></strong>\n\t\t\t\t\t%6$s\n\t\t\t\t\t%7$s\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>',\n\t\timplode( ' ', array_map( 'sanitize_html_class', $container_classes ) ),\n\t\t$cover_container,\n\t\t$avatar_container,\n\t\tesc_url( $group_link ),\n\t\tesc_html( $group_name ),\n\t\t$group_content,\n\t\t$action_button\n\t);\n\n\t// Compact all interesting parameters.\n\t$params = array_merge( $block_args, compact( 'group_name', 'group_link', 'group_description', 'avatar', 'cover_image' ) );\n\n\t/**\n\t * Filter here to edit the output of the single group block.\n\t *\n\t * @since 6.0.0\n\t *\n\t * @param string $output The HTML output of the block.\n\t * @param BP_Groups_Group $group The group object.\n\t * @param array $params The block extended parameters.\n\t */\n\treturn apply_filters( 'bp_groups_render_group_block_output', $output, $group, $params );\n}",
"function block_openshare_groupingset($recordset,$ogid){\r\n\t\r\n\t\tforeach ($recordset as $key => $value) {\r\n\t\t\t//print \"key (id): \".$key.\" value(status): \".$value.\" <br/>\";\r\n\t\t\t$opengrouped = new object();\r\n\t\t\t$opengrouped->timemodifed = time();\r\n\t\t\tif ($value > 1) {\r\n\t\t\t\t$opengrouped->groupmembersonly = 0;\r\n\t\t\t\t$opengrouped->groupingid = 0;\r\n\t\t\t\t//print \"Module \".$key.\" removed from Closed Grouping. \";\r\n\t\t\t} else if (($value==1)) {\r\n\t\t\t\t$opengrouped->groupmembersonly = 1;\r\n\t\t\t\t$opengrouped->groupingid = $ogid;\r\n\t\t\t\t//print \"Module \".$key.\" added to Closed Grouping. \";\r\n\t\t\t}\r\n\t\t\t//make sure this module \r\n\t\t\t//add to date object and update record\r\n\t\t\t$opengrouped->id = $key;\r\n\t\t\tupdate_record(\"course_modules\", $opengrouped);\r\n\t\t}\r\n\t\treset($recordset);\r\n\t}",
"public function setBlockId($block_id);",
"public function setStackGroup($value) {\r\n $this->stackGroup = $this->setIntegerProperty($this->stackGroup, $value);\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
searchEol. Scans the buffer for an occurrence of an end of line. | public function searchEol(int $start = 1, int $eol_style = EventBuffer::EOL_ANY): int|false {} | [
"public function getEndLine();",
"public function next($search) {\n foreach ((array)$search as $str) {\n $s= strpos($this->buffer, $str, $this->pos + strlen($str));\n if (false !== $s) return $s;\n }\n return -1;\n }",
"function Arrayfindall($needle, $haystack)\n {\n\t//Setting up\n\t$buffer=''; //We will use a 'frameshift' buffer for this search\n\t$pos=0; //Pointer\n\t$end = strlen($haystack); //The end of the string\n\t$getchar=''; //The next character in the string\n\t$needlelen=strlen($needle); //The length of the needle to find (speeds up searching)\n\t$found = array(); //The array we will store results in\n\n\twhile($pos<$end)//Scan file\n\t{\n\t $getchar = substr($haystack,$pos,1); //Grab next character from pointer\n\t if($getchar!=\"\\n\" || $buffer < $needlelen) //If we fetched a line break, or the buffer is still smaller than the needle, ignore and grab next character\n\t {\n\t\t$buffer = $buffer . $getchar; //Build frameshift buffer\n\t\tif(strlen($buffer)>$needlelen) //If the buffer is longer than the needle\n\t\t{\n\t\t $buffer = substr($buffer,-$needlelen);//Truncunate backwards to needle length (backwards so that the frame 'moves')\n\t\t}\n\t\tif($buffer==$needle) //If the buffer matches the needle\n\t\t{\n\t\t $found[]=$pos-$needlelen+1; //Add the location of the needle to the array. Adding one fixes the offset.\n\t\t}\n\t }\n\t $pos++; //Increment the pointer\n\t}\n\tif(array_key_exists(0,$found)) //Check for an empty array\n\t{\n\t return $found; //Return the array of located positions\n\t}\n\telse\n\t{\n\t return false; //Or if no instances were found return false\n\t}\n }",
"public function scanUntilExclusive($re) {\n $pos = $this->pos;\n if ($this->scanUntil($re) !== null) {\n $this->pos -= $this->getMatchedSize();\n return substr($this->getPreMatch(), $pos);\n } else {\n return null;\n }\n }",
"public function scopeCheckEnd($query, $string) {\n\t\treturn $query->whereRaw(\"position({$this->searchColumn} in ?) = length($this->searchColumn) - length(?) + 1\", [$string, $string])->where('match_type', '=' ,'end' );\n\t}",
"public function eof()\r\n\t{\r\n\t\treturn ($this->cursor >= count($this->tokens));\r\n\t}",
"function strrpos_ex($haystack, $needle, $offset=0) {\n\t\t$pos_rule = ($offset<0)?strlen($haystack)+($offset-1):$offset;\n\t\t$last_pos = false; $first_run = true;\n\t\tdo {\n\t\t\t$pos=strpos($haystack, $needle, (intval($last_pos)+(($first_run)?0:strlen($needle))));\n\t\t\tif ($pos!==false && (($offset<0 && $pos <= $pos_rule)||$offset >= 0)) {\n\t\t\t\t$last_pos = $pos;\n\t\t\t} else { break; }\n\t\t\t$first_run = false;\n\t\t} while ($pos !== false);\n\t\tif ($offset>0 && $last_pos<$pos_rule) { $last_pos = false; }\n\t\treturn $last_pos;\n\t}",
"private function endsWithEol($message)\n {\n $expectedPosition = strlen($message) - strlen(PHP_EOL);\n return strrpos($message, PHP_EOL) === $expectedPosition;\n }",
"public function atEof()\n {\n return $this->position() >= strlen($this->file->data());\n }",
"private function findNextMessage()\n {\n do\n {\n $data = fgets( $this->fh );\n } while ( !feof( $this->fh ) && substr( $data, 0, 5 ) !== \"From \" );\n\n if ( feof( $this->fh ) )\n {\n return false;\n }\n return ftell( $this->fh );\n }",
"function f_revsrch_StrposUntilOffset($txt, $what, $offset) {\r\n\t$p = $offset;\r\n\t$b = -1;\r\n\twhile ( (($p=strpos($txt, $what,$b+1))!==false) && ($p<$offset) ) {\r\n\t\t$b = $p; // continue to search\r\n\t}\r\n\tif ($b<0) {\r\n\t\treturn false;\r\n\t} elseif ($p===$offset) {\r\n\t\treturn $offset;\r\n\t} else {\r\n\t\treturn $b;\r\n\t}\r\n}",
"private function viSearch($searchChar) {\n\t\t$isForward = ($searchChar == '/');\n\n\t\t/*\n\t\t * This is a little gross, I'm sure there is a more appropriate way\n\t\t * of saving and restoring state.\n\t\t */\n\t\t$origBuffer = $this->buf->copy();\n\n\t\t// Clear the contents of the current line and\n\t\t$this->setCursorPosition (0);\n\t\t$this->killLine();\n\n\t\t// Our new \"prompt\" is the character that got us into search mode.\n\t\t$this->putString($searchChar);\n\t\t$this->flush();\n\n\t\t$isAborted = false;\n\t\t$isComplete = false;\n\n\t\t/*\n\t\t * Readline doesn't seem to do any special character map handling\n\t\t * here, so I think we are safe.\n\t\t */\n\t\t$ch = -1;\n\t\twhile (!$isAborted && !$isComplete && ($ch = $this->readCharacter()) != -1) {\n\t\t\tswitch ($ch) {\n\t\t\t\tcase \"\\033\": // ESC\n\t\t\t\t\t/*\n\t\t\t\t\t * The ESC behavior doesn't appear to be readline behavior,\n\t\t\t\t\t * but it is a little tweak of my own. I like it.\n\t\t\t\t\t */\n\t\t\t\t\t$isAborted = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"\\010\": // Backspace\n\t\t\t\tcase \"\\177\": // Delete\n\t\t\t\t\t$this->backspace();\n\t\t\t\t\t/*\n\t\t\t\t\t * Backspacing through the \"prompt\" aborts the search.\n\t\t\t\t\t */\n\t\t\t\t\tif ($this->buf->cursor == 0) {\n\t\t\t\t\t\t$isAborted = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"\\012\": // NL\n\t\t\t\tcase \"\\015\": // CR\n\t\t\t\t\t$isComplete = true;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$this->putString($ch);\n\t\t\t}\n\n\t\t\t$this->flush();\n\t\t}\n\n\t\t// If we aborted, then put ourself at the end of the original buffer.\n\t\tif ($ch == -1 || $isAborted) {\n\t\t\t$this->setCursorPosition(0);\n\t\t\t$this->killLine();\n\t\t\t$this->putString($origBuffer->buffer);\n\t\t\t$this->setCursorPosition($origBuffer->cursor);\n\t\t\treturn -1;\n\t\t}\n\n\t\t/*\n\t\t * The first character of the buffer was the search character itself\n\t\t * so we discard it.\n\t\t */\n\t\t$searchTerm = $this->buf->buffer->substring(1);\n\t\t$idx = -1;\n\n\t\t/*\n\t\t * The semantics of the history thing is gross when you want to\n\t\t * explicitly iterate over entries (without an iterator) as size()\n\t\t * returns the actual number of entries in the list but get()\n\t\t * doesn't work the way you think.\n\t\t */\n\t\t$end = $this->history->key();\n\t\t$start = ($end <= count($this->history)) ? 0 : $end - count($this->history);\n\n\t\tif ($isForward) {\n\t\t\tfor ($i = $start; $i < $end; $i++) {\n\t\t\t\tif (strpos($this->history->get($i), $searchTerm) !== false) {\n\t\t\t\t\t$idx = $i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tfor ($i = $end-1; $i >= $start; $i--) {\n\t\t\t\tif (strpos($this->history->get($i), $searchTerm) !== false) {\n\t\t\t\t\t$idx = $i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/*\n\t\t * No match? Then restore what we were working on, but make sure\n\t\t * the cursor is at the beginning of the line.\n\t\t */\n\t\tif ($idx == -1) {\n\t\t\t$this->setCursorPosition(0);\n\t\t\t$this->killLine();\n\t\t\t$this->putString($origBuffer->buffer);\n\t\t\t$this->setCursorPosition(0);\n\t\t\treturn -1;\n\t\t}\n\n\t\t/*\n\t\t * Show the match.\n\t\t */\n\t\t$this->setCursorPosition(0);\n\t\t$this->killLine();\n\t\t$this->putString($this->history->get($idx));\n\t\t$this->setCursorPosition(0);\n\t\t$this->flush();\n\n\t\t/*\n\t\t * While searching really only the \"n\" and \"N\" keys are interpreted\n\t\t * as movement, any other key is treated as if you are editing the\n\t\t * line with it, so we return it back up to the caller for interpretation.\n\t\t */\n\t\t$isComplete = false;\n\t\twhile (!$isComplete && ($ch = $this->readCharacter()) !== -1) {\n\t\t\t$forward = $isForward;\n\t\t\tswitch ($ch) {\n\t\t\t\tcase 'p': case 'P':\n\t\t\t\t\t$forward = !$isForward;\n\t\t\t\t\t// Fallthru\n\t\t\t\tcase 'n': case 'N':\n\t\t\t\t\t$isMatch = false;\n\t\t\t\t\tif ($forward) {\n\t\t\t\t\t\tfor ($i = $idx+1; !$isMatch && $i < $end; $i++) {\n\t\t\t\t\t\t\tif (strpos($this->history->get($i), $searchTerm) !== false) {\n\t\t\t\t\t\t\t\t$idx = $i;\n\t\t\t\t\t\t\t\t$isMatch = true;\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\telse {\n\t\t\t\t\t\tfor ($i = idx - 1; !$isMatch && $i >= $start; $i--) {\n\t\t\t\t\t\t\tif (strpos($this->history->get($i), $searchTerm) !== false) {\n\t\t\t\t\t\t\t\t$idx = $i;\n\t\t\t\t\t\t\t\t$isMatch = true;\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\tif ($isMatch) {\n\t\t\t\t\t\t$this->setCursorPosition(0);\n\t\t\t\t\t\t$this->killLine();\n\t\t\t\t\t\t$this->putString($this->history->get($idx));\n\t\t\t\t\t\t$this->setCursorPosition(0);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$isComplete = true;\n\t\t\t}\n\t\t\t$this->flush();\n\t\t}\n\n\t\t/*\n\t\t * Complete?\n\t\t */\n\t\treturn $ch;\n\t}",
"private function _readToEndOfBlock($patternStop)\r\n {\r\n $buffer = \"\";\r\n\r\n do {\r\n $buffer .= $this->_fileBuffer;\r\n \r\n if (1 == preg_match($patternStop, trim($this->_fileBuffer), $matches))\r\n break;\r\n \r\n } while ($this->_readLine());\r\n \r\n return $buffer;\r\n \r\n }",
"public function readLineAndFilterUntilEnd()\n {\n $this->mockInputStream->expects($this->exactly(2))\n ->method('eof')\n ->will($this->onConsecutiveCalls(false, true));\n $this->mockInputStream->expects($this->once())\n ->method('readLine')\n ->with($this->equalTo(8192))\n ->will($this->returnValue('foo'));\n $this->mockPredicate->expects($this->once())\n ->method('test')\n ->will($this->returnValue(false));\n $this->assertEquals('', $this->filteredInputStream->readLine());\n }",
"public function afterLastBytes($search) {\n\t\treturn self::sideInternal($this->rawString, $this->charset, true, false, 'strrpos', $search, 1);\n\t}",
"function scanFull($re, $returnStringP = false, $advanceScanPointerP = false) {\n $this->pushState();\n \n $res = $this->isMatch($re);\n if ($res !== null) {\n if ($advanceScanPointerP) {\n $this->pos += $this->match_length;\n }\n if ($returnStringP) {\n return $this[0];\n } else {\n return $res > 0;\n }\n } else {\n return null;\n }\n }",
"private function eof() : bool\n {\n return $this->current >= $this->expressionEnd;\n }",
"public function beforeLast($search) {\n\t\treturn $this->sideInternal('mb_strrpos', $search, -1);\n\t}",
"protected function scanEOS()\n {\n if (!$this->eos) {\n return null;\n }\n\n return $this->takeToken('EOS');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Print output in red color | private function redOutput(string $string)
{
$this->printOut((new Formatter($string) )->red() );
} | [
"static function red($text) {\n\t\techo (self::$colorize) ? \"\\033[31m\".$text.\"\\033[0m\" : $text;\n\t}",
"public function printResult()\n {\n if($this->current->result == 'pass') $resultInfo = $this->colorString('PASS ', $this->config->ansi->green);\n if($this->current->result == 'fail') $resultInfo = $this->colorString('FAIL ', $this->config->ansi->red);\n if($this->current->result == 'skip') $resultInfo = $this->colorString('SKIP ', $this->config->ansi->purple);\n\n (print($resultInfo)) && $this->reportInfo .= $resultInfo;\n }",
"public function red($text, $sameLine = false)\n {\n $output = $this->console->red($text);\n //\n if ($sameLine) {\n $this->console->write($output);\n } else {\n $this->console->line($output);\n }\n }",
"public function testPrintWithColor()\n {\n $this->object->setFormat($this->testLongFormat)->setColor(true);\n $this->object->debug('DEBUG', true);\n $this->object->warn('WARN', true);\n $this->object->error('ERROR', true);\n $this->object->crit('CRIT', true);\n $this->object->info('INFO', true);\n\n $this->assertEquals(\n \"\\033[34mstring(5) \\\"DEBUG\\\"\\n\\033[0m\\n\\033[0mINFO\\033[0m\\n\",\n $GLOBALS['stdout']\n );\n $this->assertEquals(\n \"\\033[33mWARN\\033[0m\\n\\033[31mERROR\\033[0m\\n\\033[31mCRIT\\033[0m\\n\",\n $GLOBALS['stderr']\n );\n }",
"function script_print($message, $color_code) {\n global $args;\n if ($args['color']) {\n echo \"\\033[\" . $color_code . \"m\" . $message . \"\\033[0m\";\n }\n else {\n echo $message;\n }\n}",
"public static function sayColor() {\n $args = func_get_args();\n while (count($args)) {\n $color = null;\n $str = array_shift($args);\n if (is_integer($str)) {\n $color = $str;\n if (self::$use_color) {\n print \"\\033[0;${color}m\";\n }\n $str = array_shift($args);\n }\n\n print $str;\n\n if (self::$use_color && !is_null($color)) {\n print \"\\033[0m\";\n }\n }\n }",
"function colorize($text, $status) {\n\t$out = \"\";\n\tswitch($status) {\n\t\tcase \"SUCCESS\":\n\t\t\t$out = \"[42m\"; //Green background\n\t\t\tbreak;\n\t\tcase \"FAILURE\":\n\t\t\t$out = \"[41m\"; //Red background\n\t\t\tbreak;\n\t\tcase \"WARNING\":\n\t\t\t$out = \"[43m\"; //Yellow background\n\t\t\tbreak;\n\t\tcase \"NOTE\":\n\t\t\t$out = \"[44m\"; //Blue background\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow new Exception(\"Invalid status: \" . $status);\n\t}\n\treturn chr(27) . \"$out\" . \"$text\" . chr(27) . \"[0m\";\n}",
"public static function red($text)\n {\n return \"\\033[0;31m\" . $text . \"\\033[0m\";\n }",
"public function flagRed()\n {\n $this->Write([\"thing\", \"status\"], \"red\");\n $this->Get();\n }",
"function fmt_errmsg ($msg) {\n\treturn \"<font color=\\\"#ff0000\\\">\" . $msg . \"</font><br>\\n\";\n}",
"public function green($text, $sameLine = false)\n {\n $output = $this->console->green($text);\n //\n if ($sameLine) {\n $this->console->write($output);\n } else {\n $this->console->line($output);\n }\n }",
"function customize_print1() \n { \n echo \"<p style=color:\".$this->font_color.\";>\".$this->string_value.\"</p>\"; \n }",
"function print_failed($line_break = true) {\n\tprint \"\\033[1;31mFAILED\\033[0m\";\n\tif ($line_break)\n\t\tprint \"\\n\";\n}",
"function showCheckResult($check_result_arr)\n\t{\n # http://jira:8080/browse/MINFO-10\n # 25.11.2008\n\t \n\t\t//$result_color=($check_result_arr['check_result_status'] == \"OK\")?\"green\":\"red\";\n\t\tswitch ($check_result_arr['check_result_status']) {\n\t\t\t\n\t\t\tcase 'OK':\n\t\t\t\t$result_color = 'green';\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'BAD':\n\t\t\t\t$result_color = 'red';\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tdefault:\n\t\t\t\t$result_color = 'gray';\n\t\t\t\tbreak;\n\t\t}\n\t\t\n # End of tsergiy's modification\n\t\t\n\t\techo \"<tr>\n\t\t\t\t\t<td nowrap style='font-weight:bold'>\".$check_result_arr['check_title'].\"</td>\n\t\t\t\t\t<td style='color:\".$result_color.\"'>\".$check_result_arr['check_result'].\"</td>\n\t\t\t\t\t<td style='color: gray;'>\".$check_result_arr['check_issue_solution'].\"</td>\n\t\t\t\t\t</tr>\";\n\t\t\n\t}",
"private function printToConsole($text, $red = false, $back = false){\n if(self::CONSOLE_OUTPUT){\n $text = $red?\"\\033[1;41m$text\\033[m\":$text;\n $text = $back?\"\\033[1A$text\":$text;\n echo $text.\"\\n\\r\";\n }\n }",
"public function testPrintUncolorizedOutput(): void\n {\n $actual_output = self::generatePhanOutput(\n new IssueInstance(Issue::fromType(Issue::UndeclaredVariableDim), 'dim.php', 10, ['varName']),\n new IssueInstance(Issue::fromType(Issue::SyntaxError), 'test.php', 1, ['fake error']),\n new IssueInstance(Issue::fromType(Issue::UndeclaredMethod), 'undefinedmethod.php', 1, ['\\\\Foo::bar'])\n );\n $expected_output = '';\n // phpcs:disable\n $expected_output .= 'dim.php:10 PhanUndeclaredVariableDim Variable $varName was undeclared, but array fields are being added to it.' . \\PHP_EOL;\n $expected_output .= 'test.php:1 PhanSyntaxError fake error' . \\PHP_EOL;\n $expected_output .= 'undefinedmethod.php:1 PhanUndeclaredMethod Call to undeclared method \\Foo::bar' . \\PHP_EOL;\n // phpcs:enable\n $this->assertSame($expected_output, $actual_output);\n }",
"function generateFail($testName) {\n echo \"<h3 style=\\\"color:red;\\\">$testName: FAIL</h3>\\n\";\n}",
"protected function options_output()\n {\n ob_start();\n\n echo ( '$primary_color: #f9b128;' );\n echo ( '$secondary_color: #464646;' );\n\n return ob_get_clean();\n }",
"public static function colorPrint($color, $text) {\n print $color . $text . self::WHITE . \"\\n\";\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Should return unprocessable entity if email belongs to another user | public function should_return_unprocessable_entity_if_email_belongs_to_another_user()
{
$this->post('/v1/users', [
'firstname' => 'Berzel',
'lastname' => 'Tumbude',
'email' => 'berzel@app.com',
'password' => 'secret123',
'password_confirmation' => 'secret123'
]);
$this->post('/v1/users', [
'firstname' => 'John',
'lastname' => 'Doe',
'email' => 'john@app.com',
'password' => 'secret123',
'password_confirmation' => 'secret123'
]);
$response = $this->call('PUT', '/v1/users/1', [
'lastname' => 'Tumbude',
'firstname' => 'Berzel',
'email' => 'john@app.com'
]);
$this->seeStatusCode(HttpStatus::UNPROCESSABLE_ENTITY);
$this->seeJsonContains([
'email' => ['The email has already been taken.']
]);
} | [
"function checkCustomerEmail($gotData){\n $customerEmail=$gotData->user->customerEmail;\n $u=getUserDataUsingEmail($gotData->con,$customerEmail);\n if($u->error==false){\n $gotData->user->customerEmailExists=true;\n $gotData->user->customer=$u;\n }else{\n $gotData->user->customerEmailExists=false;\n }\n return $gotData;\n}",
"public function avoidDuplicateEmail()\n {\n $query = \"select * from `user` where `email`=:email\";\n $query_category = Yii::app()->db->createCommand($query);\n $query_category->bindParam( ':email', $this->email);\n $results = $query_category->queryAll();\n\n if(count($results)>0)\n {\n $this->addError('email','This email already exists in database');\n return false;\n }\n else return true;\n }",
"public function test_admin_edit_user_email_with_already_used_email() {\n\n $user = factory(App\\User::class)->create();\n\n $data = [\n 'email' => $user->email\n ];\n\n $this->actingAs($this->admin)\n ->post('/admin-center/users-manager/user/' . $this->user->id . '/edit-email', $data)\n ->seeJson([\n 'success' => false,\n 'message' => trans('users_manager.email_already_used')\n ]);\n }",
"private function checkEmail() {\n $Where = ( isset($this->Post) ? \"id != {$this->Post} AND\" : '');\n $readUser = new Read;\n $readUser->ExeRead(self::Entity, \"WHERE {$Where} email = :email\", \"email={$this->Data['email']}\");\n if ($readUser->getRowCount()):\n $this->Error = [\"O e-email informado já está cadastrado no sistema! Informe outro e-mail!\", RM_ERROR];\n $this->Result = false;\n else:\n $this->Result = true;\n endif;\n }",
"public function testGetByEmail() {\n\t\t$newUserId = '9879fgj4-dsd-fsdf-3s3u54bd-fgh4f878776sf8s7d-4535lou345';\n\t\t// Deletes user\n\t\t$this -> elasticaService -> deleteUser($newUserId);\n\n\t\t$newUser = new User();\n\t\t$newUser -> setId($newUserId) -> setName('John') -> setEmail('john@doe.com') -> setPassword('test');\n\n\t\t$this -> elasticaService -> addUser($newUser);\n\n\t\t// Check if user exists\n\t\t$user = $this -> elasticaService -> getByEmail('john@doe.com');\n\t\t$this -> assertTrue(!empty($user));\n\n\t\t// Deletes user\n\t\t$this -> elasticaService -> deleteUser($newUserId);\n\t}",
"public function doesUserExistByEmail($email);",
"function emailAddressAlreadyInUse($emailAddress) {\r\n\treturn (boolean) User::getUserByEmailAddress($emailAddress);\r\n}",
"protected function _checkDupEmail()\r\n {\r\n $email = BizSystem::ClientProxy()->GetFormInputs(\"fld_email\");\r\n $searchTxt = \"[email]='$email'\"; \r\n // query UserDO by the email\r\n $userDO = $this->getDataObj(); \r\n \r\n //include optional ID when editing records\r\n if ($this->m_RecordId > 0 ) {\r\n $searchTxt .= \" AND [Id]<>$this->m_RecordId\"; \r\n } \r\n $records = $userDO->directFetch($searchTxt,1);\r\n if (count($records)==1)\r\n return true;\r\n return false;\r\n }",
"public function emailCheckAction()\n {\n $checkerRequest = new EmailCheckRequest();\n $checkerRequest->setEmail($this->getRequest()->request->get('email'));\n\n $checkerService = $this->getContainer()->get('user.email_check');\n $checkerResponse = $checkerService->process($checkerRequest);\n\n if(!$checkerResponse->isSuccess()){\n return $this->json(['This email address is already taken.']);\n }\n\n return $this->json([\"true\"]);\n }",
"public function testGetExistingUserEmail()\n {\n $this->markTestIncomplete('not yet implemented');\n }",
"public function findUserByEmailId($email);",
"public function user_email(){\n return $this->hasOne(UserEmail::class);\n }",
"protected function isEmailUnique(): bool {\n\t\t$em = $this->doctrine->getManager();\n $qb = $em->createQueryBuilder();\n $qb->select('p')\n ->from('AppBundle:PortersDB', 'p')\n ->where('p.email = ?1')\n ->setParameter(1, $this->getRequestData()['email']);\n\n return $qb->getQuery()->getOneOrNullResult() === null;\n\t}",
"public function validateUserEmail()\n {\n if (!$this->hasErrors() && !$this->getUser()) {\n $this->addError('id', Yii::t('skeleton', 'Your email was not found.'));\n }\n }",
"public function test_not_logged_in_user_tries_to_edit_user_email() {\n\n $newUser = factory(App\\User::class)->make();\n\n $data = [\n 'email' => $newUser->email\n ];\n\n $this->post('/admin-center/users-manager/user/' . $this->user->id . '/edit-email', $data)\n ->notSeeInDatabase('users', [\n 'email' => $newUser->email\n ]);\n }",
"public function test_normal_user_tries_to_edit_user_email() {\n\n $newUser = factory(App\\User::class)->make();\n\n $data = [\n 'email' => $newUser->email\n ];\n\n $this->actingAs($newUser)\n ->post('/admin-center/users-manager/user/' . $this->user->id . '/edit-email', $data)\n ->notSeeInDatabase('users', [\n 'email' => $newUser->email\n ]);\n }",
"public function testGetInvalidUserByEmail() : void {\n\t\t// grab an email that does not exist\n\t\t$user = User::getUserByUserEmail($this->getPDO(), \"does@not.exist\");\n\t\t$this->assertNull($user);\n\t}",
"function getOrCreateUserByEmail(EmailValue $email);",
"public function verifyEmailAddress() {\n if(!empty($this->request->params['named']['email_address_id'])) {\n $args = array();\n $args['conditions']['EmailAddress.id'] = $this->request->params['named']['email_address_id'];\n $args['contain'] = false;\n \n $ea = $this->EmailAddress->find('first', $args);\n \n if(!empty($ea)) {\n // We currently need a CO Person ID, even if verifying an org identity email address.\n // CoInvite stores the CO Person ID and uses the Org Identity ID in generating history.\n // For now, we'll just map using co_org_identity_links and hope we pull the right\n // record. This should get fixed as part of CO-753.\n \n $largs = array();\n $largs['contain'] = false;\n \n if(!empty($ea['EmailAddress']['co_person_id'])) {\n $largs['conditions']['CoOrgIdentityLink.co_person_id'] = $ea['EmailAddress']['co_person_id'];\n } elseif(!empty($ea['EmailAddress']['org_identity_id'])) {\n $largs['conditions']['CoOrgIdentityLink.org_identity_id'] = $ea['EmailAddress']['org_identity_id'];\n }\n \n $lnk = $this->CoOrgIdentityLink->find('first', $largs);\n \n if(!empty($lnk)) {\n if($this->request->is('restful')) {\n // XXX implement this (CO-754)\n throw new RuntimeException(\"Not implemented\");\n } else {\n try {\n $this->CoInvite->send($lnk['CoOrgIdentityLink']['co_person_id'],\n $lnk['CoOrgIdentityLink']['org_identity_id'],\n $this->Session->read('Auth.User.co_person_id'),\n $ea['EmailAddress']['mail'],\n null, // use default from address\n (!empty($this->cur_co['Co']['name']) ? $this->cur_co['Co']['name'] : _txt('er.unknown.def')),\n _txt('em.invite.subject.ver'),\n _txt('em.invite.body.ver'),\n $ea['EmailAddress']['id']);\n \n $this->set('vv_co_invite', $this->CoInvite->findById($this->CoInvite->id));\n $this->set('vv_recipient', $ea);\n \n $this->Flash->set(_txt('rs.ev.sent', array($ea['EmailAddress']['mail'])), array('key' => 'success'));\n }\n catch(Exception $e) {\n $this->Flash->set($e->getMessage(), array('key' => 'error'));\n }\n \n $debug = Configure::read('debug');\n \n if(!$debug) {\n if(!empty($ea['EmailAddress']['co_person_id'])) {\n // Redirect to the CO Person view\n $nextPage = array('controller' => 'co_people',\n 'action' => 'canvas',\n $lnk['CoOrgIdentityLink']['co_person_id']);\n } elseif(!empty($ea['EmailAddress']['org_identity_id'])) {\n // Redirect to the CO Person view\n $nextPage = array('controller' => 'org_identities',\n 'action' => 'edit',\n $lnk['CoOrgIdentityLink']['org_identity_id']);\n }\n \n $nextPage['tab'] = 'email';\n \n $this->redirect($nextPage);\n }\n }\n } else {\n $this->Flash->set(_txt('er.person.noex'), array('key' => 'error'));\n }\n } else {\n $this->Flash->set(_txt('er.notfound',\n array(_txt('ct.email_addresses.1'),\n filter_var($this->request->params['named']['email_address_id'],FILTER_SANITIZE_SPECIAL_CHARS))),\n array('key' => 'error'));\n }\n } else {\n $this->Flash->set(_txt('er.notprov.id', array(_txt('ct.email_addresses.1'))), array('key' => 'error'));\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the document type of the ACL that is being queried. | public function getDocumentType()
{
return $this->_documentType;
} | [
"public function getDocumentType() {\n return $this->document['type'];\n }",
"public function getDocumentType()\n {\n return $this->documentType;\n }",
"public function getDocType() : string\n {\n return $this->docType;\n }",
"public function getDocumentType(): string;",
"public static function getDocType(){ }",
"public function getDocType()\n {\n return $this->hasOne(DocumentType::className(), ['document_type_id' => 'doc_type']);\n }",
"public function getDocType(): int\n {\n return $this->docType;\n }",
"public function getTaxDocumentType()\n {\n return $this->getIfSet('type', $this->data->holder->taxDocument);\n }",
"public function getDocumentTypeId()\n {\n return $this->documentTypeId;\n }",
"public function getTipo_documento()\r\n\t{\r\n\t\treturn($this->tipo_documento);\r\n\t}",
"function getDocumentType()\n\t{\n\t\t$model = getModel('module');\n\t\t$module = $model->getModuleInfoByModuleSrl($this->get('module_srl'));\n\t\treturn $module->module;\n\t}",
"public function getAppDocType ()\n {\n\n return $this->app_doc_type;\n }",
"public function getTipo_doc()\r\n\t{\r\n\t\treturn($this->tipo_doc);\r\n\t}",
"public function getTypeByDocumentType(string $documentType): ?string;",
"public function getType()\n {\n $type = false;\n if (!$this->getObject()->isNew()) {\n // You can't change the major type of an existing media object as\n // this would break slots (a .doc where a .gif should be...)\n $type = $this->getObject()->type;\n }\n // What we are selecting to add to a page\n if (!$type)\n {\n $type = aMediaTools::getType();\n }\n if (!$type)\n {\n // What we are filtering for \n $type = aMediaTools::getSearchParameter('type');\n }\n return $type;\n }",
"public function getEntityType() {\n\t\treturn self::ELASTICSEARCH_TYPE_DOCUMENT;\n\t}",
"public function getSchemaType();",
"public function getType()\n {\n $type = $this->data['type'];\n if ($type === null) {\n $type = Reader\\Reader::detectType($this->getEntryElement(), true);\n $this->setType($type);\n }\n\n return $type;\n }",
"public function getType()\n\t{\n\t\t$type = $_GET['type'];\n\t\t$validTypes = array(CAuthItem::TYPE_OPERATION, CAuthItem::TYPE_TASK, CAuthItem::TYPE_ROLE);\n\t\tif( in_array($type, $validTypes)===true )\n\t\t\treturn $type;\n\t\telse\n\t\t\tthrow new CException(Rights::t('core', 'Invalid authorization item type.'));\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get the storage address of a coin | public function getStorageAddress($coin)
{
$data = file('./data/pairing'.$coin);
switch($this->config['coins'][$coin]['cointype'])
{
case 'btc':
$storageaddress = explode('::|::', $data[3])[0];
break;
case 'nxt':
$storageaddress = trim($data[2]);
break;
case 'bts':
$storageaddress = trim($data[3]);
break;
}
return $storageaddress;
} | [
"function getSpecificAddressCode($coin){\n\tglobal $user;\n\t\t\t/// query withdraw address code\n\t\t\t$query = new EntityFieldQuery();\n\t\t\t$query->entityCondition('entity_type', 'ccdev_coin')\n\t\t\t ->entityCondition('bundle', 'coin_bundle')\n\t\t\t ->propertyCondition('coin_code', $coin)\n\t\t\t ->addMetaData('account', user_load($user->uid)); // Run the query as user 1.\n\t\t\t$result = $query->execute();\n\t\t\t if (isset($result['ccdev_coin'])) {\n\t\t\t\t $coin_nids = array_keys($result['ccdev_coin']);\n\t\t\t\t $coins = entity_load('ccdev_coin', $coin_nids);\n\t\t \tforeach ($coins as $coin) {\n\t\t\t\t\t$coin_name = $coin->coin_name;\n\t\t\t\t \t$fee = $coin->coin_fee;\n\t\t\t\t \t$TxFee = $coin->coin_txfee;\n\t\t\t\t\t$minAmt = $coin->min_amount;\n\t\t\t\t\t$maxAmt = $coin->max_amount;\n\t\t\t\t\t$address_code = $coin->coin_validate;\n\t\t \t}\n\t\t\t}\n\treturn $address_code;\n}",
"public function getCoin()\n {\n return $this->coin;\n }",
"public function getCoinId()\n {\n $this->checkIfKeyExistsAndIsInteger('coin_id');\n\n return $this->data['coin_id'];\n }",
"public function getCoin()\n {\n return $this->coin;\n }",
"public function getBitcoin ()\n {\n $bitcoin = $this->coinmarketcap->getBitcoinDetailsFromFile();\n $bitcoin = json_decode($bitcoin, TRUE);\n $bitcoin = $bitcoin[0];\n return $bitcoin;\n }",
"public function getUsercoin()\n {\n return $this->usercoin;\n }",
"function get_wallet_id() {\n\t\trequire '../config.php';\n\t\tglobal $con;\n\t\t$con = mysqli_connect($hostname, $dbusername, $dbpassword, $dbname);\n\t\tglobal $currentfbid;\n\t\t$query = \" SELECT btcaddress FROM data WHERE fbid = '$currentfbid' \";\n\t\t$result = mysqli_query($con, $query);\n\t\t$row = mysqli_fetch_array($result);\n\t\tmysqli_close($con);\n\t\treturn $row[0];\n\t}",
"public function getCoinID() {\n return $this->_coinID;\n }",
"public function getAddressByte(): string;",
"public function getDataCoinPath()\n {\n return $this->dataCoinPath . '/' . $this->getCurrentSym(true);\n }",
"public function getCryptoAddress(): string\n {\n return $this->cryptoAddress;\n }",
"public function coin()\n {\n return $this->hasOne('App\\Coins', 'coin_id', 'address_coin');\n }",
"public function getCoinAddress($userID) {\n $this->debug->append(\"STA \" . __METHOD__, 4);\n return $this->getSingle($userID, 'coin_address', 'id');\n }",
"public function walletAttr()\n {\n return $this->get('/api/wallet-addr/');\n }",
"function getAssetAddress($asset) {\n\n $bapi = new BittrexAPI(config(\"bittrex.auth\"), config(\"bittrex.urls\"));\n $bapi->setAPI($this->api_key, $this->api_secret);\n $result = $bapi->depositAddress($asset);\n \n if($result['success']) return $result['result']['Address'];\n else return false;\n\n }",
"public function getAccount($bitcoinaddress);",
"public function getStoreAddress()\n {\n return $this->_getData(self::STORE_ADDRESS);\n }",
"public function _getCoinFullName(){\n return $this->_getDataKey('FullName');\n }",
"public function getCoinData($key)\n {\n //can co ham get data\n return isset($this->currentCoin[$key]) ? $this->currentCoin[$key] : null;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Schedules a statistic report Job. | public function scheduleReportJob(scheduleReportJob $parameters) {
return $this->__soapCall('scheduleReportJob', array($parameters), array(
'uri' => 'https://advertising.criteo.com/API/v201010',
'soapaction' => ''
)
);
} | [
"public function manageReportSchedule()\n {\n if (! array_key_exists('ReportType', $this->options)) {\n $this->log('Report Type must be set in order to manage a report schedule!', 'Warning');\n\n return false;\n }\n if (! array_key_exists('Schedule', $this->options)) {\n $this->log('Schedule must be set in order to manage a report schedule!', 'Warning');\n\n return false;\n }\n\n $url = $this->urlbase.$this->urlbranch;\n\n $query = $this->genQuery();\n\n $path = $this->options['Action'].'Result';\n\n if ($this->mockMode) {\n $xml = $this->fetchMockFile()->$path;\n } else {\n $response = $this->sendRequest($url, ['Post' => $query]);\n\n if (! $this->checkResponse($response)) {\n return false;\n }\n\n $xml = simplexml_load_string($response['body'])->$path;\n }\n\n $this->parseXML($xml);\n }",
"public function execute()\n {\n if (!$this->_config->getCoreValue('reporting')) {\n return;\n }\n\n if ($this->_config->getCoreValue('reportingtime') == date('H')) {\n $this->_reporter->sendOrderWithShipment();\n $this->_logger->info(\"SEQURA: report sent\");\n } else {\n $this->_logger->info(date('H') . \"SEQURA: It isn't time to send the report, it is programmed at 0\" . $this->_config->getCoreValue('reportingtime') . ':00 AM');\n }\n }",
"function storeStats(){\n $this->logger->debug('Storing stats');\n $this->report['finished'] = date('c');\n $this->report['_id'] = $this->_id;\n if (!ReportsManager::storeStats($this)) {\n throw new \\Exception('Error saving job statistics.');\n };\n }",
"public function createReportTask() {\n $this->type = \"report\";\n return $this->createTask();\n }",
"public function runWithReport(TaskReportInterface $report): void;",
"public function runScheduledReports() {\n\t\t\n\t\t$this->rescheduleStaleReports();\n\t\t$this->initGlobalVars();\n\t\t\n\t\twhile ($reportid = $this->getNextScheduledReport()) {\n\t\t\t$this->executeReport($reportid);\n\t\t}\n\n\t\t$this->restoreGlobalVars();\n\t}",
"public function schedule(ISuite $suite);",
"public function cron() {\n\n\t\t$entries = $this->get_entries();\n\n\t\t// Email won't be sent if there are no form entries.\n\t\tif ( empty( $entries ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$info_blocks = new InfoBlocks();\n\n\t\t$next_block = $info_blocks->get_next();\n\n\t\t$args = array(\n\t\t\t'body' => array(\n\t\t\t\t'entries' => $entries,\n\t\t\t\t'info_block' => $next_block,\n\t\t\t),\n\t\t);\n\n\t\t$template = ( new Templates\\Summary() )->set_args( $args );\n\t\t$template = \\apply_filters( 'wpforms_emails_summaries_template', $template );\n\n\t\t$content = $template->get();\n\n\t\tif ( ! $content ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$to_email = \\apply_filters( 'wpforms_emails_summaries_cron_to_email', \\get_option( 'admin_email' ) );\n\t\t$subject = \\apply_filters( 'wpforms_emails_summaries_cron_subject', \\esc_html__( 'WPForms Summary', 'wpforms-lite' ) );\n\n\t\t$sent = ( new Mailer() )\n\t\t\t->template( $template )\n\t\t\t->subject( $subject )\n\t\t\t->to_email( $to_email )\n\t\t\t->send();\n\n\t\tif ( true === $sent ) {\n\t\t\t$info_blocks->register_sent( $next_block );\n\t\t}\n\t}",
"function run($job)\n{\n global $errorClass;\n global $configData;\n global $queries;\n global $databaseClass;\n global $szopDbClass;\n global $StartRunTime;\n\n //echo \"Job data = \" . print_r($job) . \"\\n\";\n //die;\n // Calculate the start and end time for the reports.\n // The time differences are calculated to include the FULL number of\n // seconds. I.e. one whole day = 86400 seconds and the time difference is\n // set at that.\n switch($job[\"duration\"])\n {\n case 1: // Daily, last 24 hours of previous day\n $startDate = date(\"Y-m-d H:i:s\", mktime(\n 0, 0, 0,\n date(\"m\", $StartRunTime),\n date(\"d\", $StartRunTime) - 1,\n date(\"Y\", $StartRunTime) ));\n $endDate = date(\"Y-m-d H:i:s\", mktime(\n 0, 0, 0,\n date(\"m\", $StartRunTime),\n date(\"d\", $StartRunTime),\n date(\"Y\", $StartRunTime) ));\n break;\n case 7: // Weekly, last 7 days of the previous whole week\n // Starting with a Monday to a Sunday\n $currWeekDay = date(\"w\", $StartRunTime);\n\n if ($currWeekDay == 0)\n {\n // Sunday\n $daysToRemove = 13;\n }\n else\n {\n $daysToRemove = 6 + $currWeekDay;\n }\n\n $startDate = date(\"Y-m-d H:i:s\", mktime(\n 0, 0, 0,\n date(\"m\", $StartRunTime),\n date(\"d\", $StartRunTime) - $daysToRemove,\n date(\"Y\", $StartRunTime) ));\n $endDate = date(\"Y-m-d H:i:s\", mktime(\n 0, 0, 0,\n date(\"m\", $StartRunTime),\n date(\"d\", $StartRunTime) - $daysToRemove + 7,\n date(\"Y\", $StartRunTime) ));\n break;\n case 30: // Monthly, last month\n $startDate = date(\"Y-m-d H:i:s\", mktime(\n 0, 0, 0,\n date(\"m\", $StartRunTime) - 1,\n 1,\n date(\"Y\", $StartRunTime) ));\n $endDate = date(\"Y-m-d H:i:s\", mktime(\n 0, 0, 0,\n date(\"m\", $StartRunTime),\n 1,\n date(\"Y\", $StartRunTime) ));\n break;\n default:\n // Don't know what the duration is, do nothing instead.\n return;\n break;\n }\n\n echo \"Start Date \" . $startDate . \"\\nEnd Date \" . $endDate . \"\\n\";\n\n $headers = \"\";\n $xmlWidth = array();\n $xmlType = array();\n $coreQuery = true;\n $name = \"\";\n\n // Set the correct query for the report\n // The situation is more complex for ad-hoc reports. We have to pickup\n // the correct bind variables to ensure that the query will work.\n // For the main queries they all take customer_id, start_date and\n // end_date.\n //\n switch($job[\"type\"])\n {\n case 'R1_RetentionPeriod':\n echo \"Retention Period\\n\";\n if ($queries[\"dbRetentionPeriod\"] == \"local\")\n {\n $localDbClass = $databaseClass;\n }\n else\n {\n $localDbClass = $szopDbClass;\n }\n $databaseClass->query($queries[\"qRetentionPeriod\"]);\n $headers = $queries[\"dRetentionPeriod\"];\n $xmlWidth = $queries[\"xmlRetentionPeriodColumnWidth\"];\n $xmlType = $queries[\"xmlRetentionPeriodColumnType\"];\n break;\n case 'R2_Delivered':\n echo \"Delivered\\n\";\n if ($queries[\"dbDelivered\"] == \"local\")\n {\n $localDbClass = $databaseClass;\n }\n else\n {\n $localDbClass = $szopDbClass;\n }\n $databaseClass->query($queries[\"qDelivered\"]);\n $headers = $queries[\"dDelivered\"];\n $xmlWidth = $queries[\"xmlDeliveredColumnWidth\"];\n $xmlType = $queries[\"xmlDeliveredColumnType\"];\n break;\n case 'R3_Stored':\n echo \"Stored\\n\";\n if ($queries[\"dbStored\"] == \"local\")\n {\n $localDbClass = $databaseClass;\n }\n else\n {\n $localDbClass = $szopDbClass;\n }\n $databaseClass->query($queries[\"qStored\"]);\n $headers = $queries[\"dStored\"];\n $xmlWidth = $queries[\"xmlStoredColumnWidth\"];\n $xmlType = $queries[\"xmlStoredColumnType\"];\n break;\n case 'R4_Collected':\n echo \"Collected\\n\";\n if ($queries[\"dbCollected\"] == \"local\")\n {\n $localDbClass = $databaseClass;\n }\n else\n {\n $localDbClass = $szopDbClass;\n }\n $databaseClass->query($queries[\"qCollected\"]);\n $headers = $queries[\"dCollected\"];\n $xmlWidth = $queries[\"xmlCollectedColumnWidth\"];\n $xmlType = $queries[\"xmlCollectedColumnType\"];\n break;\n case 'R5_Expired':\n echo \"Expired\\n\";\n if ($queries[\"dbExpired\"] == \"local\")\n {\n $localDbClass = $databaseClass;\n }\n else\n {\n $localDbClass = $szopDbClass;\n }\n $databaseClass->query($queries[\"qExpired\"]);\n $headers = $queries[\"dExpired\"];\n $xmlWidth = $queries[\"xmlExpiredColumnWidth\"];\n $xmlType = $queries[\"xmlExpiredColumnType\"];\n break;\n case 'R6_Exception':\n echo \"Excpetion\\n\";\n if ($queries[\"dbExxeption\"] == \"local\")\n {\n $localDbClass = $databaseClass;\n }\n else\n {\n $localDbClass = $szopDbClass;\n }\n $databaseClass->query($queries[\"qException\"]);\n $headers = $queries[\"dException\"];\n $xmlWidth = $queries[\"xmlExceptionColumnWidth\"];\n $xmlType = $queries[\"xmlExceptionColumnType\"];\n break;\n case 'R7_Invoice':\n echo \"Invoice\\n\";\n if ($queries[\"dbInvoice\"] == \"local\")\n {\n $localDbClass = $databaseClass;\n }\n else\n {\n $localDbClass = $szopDbClass;\n }\n $localDbClass->query($queries[\"qInvoice\"]);\n $headers = $queries[\"dInvoice\"];\n $xmlWidth = $queries[\"xmlInvoiceColumnWidth\"];\n $xmlType = $queries[\"xmlInvoiceColumnType\"];\n break;\n default:\n echo \"Ad-hoc report\\n\";\n $name = $job[\"type\"];\n\n if ($queries[\"db\" . $name] == \"local\")\n {\n $localDbClass = $databaseClass;\n }\n else\n {\n $localDbClass = $szopDbClass;\n }\n $localDbClass->query($queries[\"q\" . $name]);\n $headers = $queries[\"d\" . $name];\n $xmlWidth = $queries[\"xml\" . $name . \"ColumnWidth\"];\n $xmlType = $queries[\"xml\" . $name . \"ColumnType\"];\n\n $coreQuery = false;\n break;\n }\n\n // Bind the variables to the query\n if ($coreQuery == true)\n {\n $localDbClass->bind(\":customer_id\", $job[\"customerId\"]);\n $localDbClass->bind(\":start_date\", $startDate);\n $localDbClass->bind(\":end_date\", $endDate);\n }\n else\n {\n foreach($queries[\"bindVar\" . $name] as $key => $field)\n {\n // We know about some fields.\n switch($field)\n {\n case \"none\":\n continue 2;\n case \"customer_id\":\n $localDbClass->bind(\":customer_id\", $job[\"customerId\"]);\n continue 2;\n case \"start_date\":\n $localDbClass->bind(\":start_date\", $startDate);\n continue 2;\n case \"end_date\":\n $localDbClass->bind(\":end_date\", $endDate);\n continue 2;\n }\n // We need to get the value from somewhere, try the query itself.\n $localDbClass->bind(\":\" . $field,\n $queries[\"dataVar\" . $name][$key]);\n }\n }\n\n $localDbClass->execute();\n \n buildInvoiceData($job['customerId']);\n\n outputData($localDbClass, $job, $headers, $xmlWidth, $xmlType);\n sendData($job);\n}",
"public static function scheduleAllDailyJobs()\n {\n $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n $logger = $objectManager->get(\"\\Reflektion\\Catalogexport\\Logger\\Logger\");\n $storeManager = $objectManager->get(\"\\Magento\\Store\\Model\\StoreManagerInterface\");\n $websites = $storeManager->getWebsites(false, true);\n /* new code as per cron configuration at website level */\n $jobModel = $objectManager->get(\"Reflektion\\Catalogexport\\Model\\Job\");\n $match = $jobModel->checkWebsiteCron();\n foreach ($websites as $website) {\n $checkWebFreq = isset($match[$website->getId()]) ? $match[$website->getId()] : false;\n if ($checkWebFreq !== false) {\n $jobModel->scheduleJobs($website->getId(), false);\n $logger->info(\n 'export for website with id ' .\n $website->getId() . ' is completed'\n );\n }\n }\n }",
"public function syncScheduledJobs();",
"public function auditReportCron() {\r\n\t\tif ( wp_defender()->isFree ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$settings = Settings::instance();\r\n\r\n\t\tif ( $settings->notification == false ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$lastReportSent = $settings->lastReportSent;\r\n\t\tif ( $lastReportSent == null ) {\r\n\t\t\t//no sent, so just assume last 30 days, as this only for monthly\r\n\t\t\t$lastReportSent = strtotime( '-31 days', current_time( 'timestamp' ) );\r\n\t\t}\r\n\r\n\t\tif ( ! $this->isReportTime( $settings->frequency, $settings->day, $lastReportSent ) ) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tswitch ( $settings->frequency ) {\r\n\t\t\tcase 1:\r\n\t\t\t\t$date_from = strtotime( '-24 hours' );\r\n\t\t\t\t$date_to = time();\r\n\t\t\t\tbreak;\r\n\t\t\tcase 7:\r\n\t\t\t\t$date_from = strtotime( '-7 days' );\r\n\t\t\t\t$date_to = time();\r\n\t\t\t\tbreak;\r\n\t\t\tcase 30:\r\n\t\t\t\t$date_from = strtotime( '-30 days' );\r\n\t\t\t\t$date_to = time();\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\t//param not from the button on frontend, log it\r\n\t\t\t\terror_log( sprintf( 'Unexpected value %s from IP %s', $settings->frequency, Utils::instance()->getUserIp() ) );\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tif ( ! isset( $date_from ) && ! isset( $date_to ) ) {\r\n\t\t\t//something wrong\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$date_from = date( 'Y-m-d', $date_from );\r\n\t\t$date_to = date( 'Y-m-d', $date_to );\r\n\t\t$filters = [\r\n\t\t\t'date_from' => $date_from . ' 0:00:00',\r\n\t\t\t'date_to' => $date_to . ' 23:59:59',\r\n\t\t\t'paged' => - 1,\r\n\t\t];\r\n\t\tif ( Events::instance()->hasData() ) {\r\n\t\t\t$logs = Events::instance()->getData( $filters );\r\n\t\t} else {\r\n\t\t\t$logs = Audit_API::pullLogs( $filters );\r\n\t\t\tif ( is_wp_error( $logs ) ) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$data = $logs['data'];\r\n\t\t$email_data = array();\r\n\t\tforeach ( $data as $row => $val ) {\r\n\t\t\tif ( ! isset( $email_data[ $val['event_type'] ] ) ) {\r\n\t\t\t\t$email_data[ $val['event_type'] ] = array(\r\n\t\t\t\t\t'count' => 0\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t\tif ( ! isset( $email_data[ $val['event_type'] ][ $val['action_type'] ] ) ) {\r\n\t\t\t\t$email_data[ $val['event_type'] ][ $val['action_type'] ] = 1;\r\n\t\t\t} else {\r\n\t\t\t\t$email_data[ $val['event_type'] ][ $val['action_type'] ] += 1;\r\n\t\t\t}\r\n\t\t\t$email_data[ $val['event_type'] ]['count'] += 1;\r\n\t\t}\r\n\r\n\t\tuasort( $email_data, array( &$this, 'sort_email_data' ) );\r\n\r\n\t\t//now we create a table\r\n\t\tif ( is_array( $email_data ) && count( $email_data ) ) {\r\n\t\t\tob_start();\r\n\t\t\t?>\r\n\t\t\t<table class=\"wrapper main\" align=\"center\"\r\n\t\t\t style=\"border-collapse: collapse; border-spacing: 0; padding: 0; text-align: left; vertical-align: top; width: 100%;\">\r\n\t\t\t\t<tbody>\r\n\t\t\t\t<tr style=\"padding: 0; text-align: left; vertical-align: top;\">\r\n\t\t\t\t\t<td class=\"wrapper-inner main-inner\"\r\n\t\t\t\t\t style=\"-moz-hyphens: auto; -webkit-hyphens: auto; Margin: 0; border-collapse: collapse !important; color: #555555; font-family: Helvetica, Arial, sans-serif; font-size: 15px; font-weight: normal; hyphens: auto; line-height: 26px; margin: 0; padding: 40px; text-align: left; vertical-align: top; word-wrap: break-word;\">\r\n\r\n\t\t\t\t\t\t<table class=\"main-intro\"\r\n\t\t\t\t\t\t style=\"border-collapse: collapse; border-spacing: 0; padding: 0; text-align: left; vertical-align: top;\">\r\n\t\t\t\t\t\t\t<tbody>\r\n\t\t\t\t\t\t\t<tr style=\"padding: 0; text-align: left; vertical-align: top;\">\r\n\t\t\t\t\t\t\t\t<td class=\"main-intro-content\"\r\n\t\t\t\t\t\t\t\t style=\"-moz-hyphens: auto; -webkit-hyphens: auto; Margin: 0; border-collapse: collapse !important; color: #555555; font-family: Helvetica, Arial, sans-serif; font-size: 15px; font-weight: normal; hyphens: auto; line-height: 26px; margin: 0; padding: 0; text-align: left; vertical-align: top; word-wrap: break-word;\">\r\n\t\t\t\t\t\t\t\t\t<h3 style=\"Margin: 0; Margin-bottom: 0; color: #555555; font-family: Helvetica, Arial, sans-serif; font-size: 32px; font-weight: normal; line-height: 32px; margin: 0; margin-bottom: 0; padding: 0 0 28px; text-align: left; word-wrap: normal;\"><?php _e( \"Hi {USER_NAME},\", wp_defender()->domain ) ?></h3>\r\n\t\t\t\t\t\t\t\t\t<p style=\"Margin: 0; Margin-bottom: 0; color: #555555; font-family: Helvetica, Arial, sans-serif; font-size: 15px; font-weight: normal; line-height: 26px; margin: 0; margin-bottom: 0; padding: 0 0 24px; text-align: left;\">\r\n\t\t\t\t\t\t\t\t\t\t<?php printf( __( \"It's WP Defender here, reporting from the frontline with a quick update on what's been happening at <a href=\\\"%s\\\">%s</a>.\", wp_defender()->domain ), network_site_url(), network_site_url() ) ?></p>\r\n\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t</tbody>\r\n\t\t\t\t\t\t</table>\r\n\r\n\t\t\t\t\t\t<table class=\"results-list\"\r\n\t\t\t\t\t\t style=\"border-collapse: collapse; border-spacing: 0; padding: 0; text-align: left; vertical-align: top;\">\r\n\t\t\t\t\t\t\t<thead class=\"results-list-header\" style=\"border-bottom: 2px solid #ff5c28;\">\r\n\t\t\t\t\t\t\t<tr style=\"padding: 0; text-align: left; vertical-align: top;\">\r\n\t\t\t\t\t\t\t\t<th class=\"result-list-label-title\"\r\n\t\t\t\t\t\t\t\t style=\"Margin: 0; color: #ff5c28; font-family: Helvetica, Arial, sans-serif; font-size: 22px; font-weight: 700; line-height: 48px; margin: 0; padding: 0; text-align: left; width: 35%;\">\r\n\t\t\t\t\t\t\t\t\t<?php _e( \"Event Type\", wp_defender()->domain ) ?>\r\n\t\t\t\t\t\t\t\t</th>\r\n\t\t\t\t\t\t\t\t<th class=\"result-list-data-title\"\r\n\t\t\t\t\t\t\t\t style=\"Margin: 0; color: #ff5c28; font-family: Helvetica, Arial, sans-serif; font-size: 22px; font-weight: 700; line-height: 48px; margin: 0; padding: 0; text-align: left;\">\r\n\t\t\t\t\t\t\t\t\t<?php _e( \"Action Summaries\", wp_defender()->domain ) ?>\r\n\t\t\t\t\t\t\t\t</th>\r\n\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t</thead>\r\n\t\t\t\t\t\t\t<tbody class=\"results-list-content\">\r\n\t\t\t\t\t\t\t<?php $count = 0; ?>\r\n\t\t\t\t\t\t\t<?php foreach ( $email_data as $key => $row ): ?>\r\n\t\t\t\t\t\t\t\t<tr style=\"padding: 0; text-align: left; vertical-align: top;\">\r\n\t\t\t\t\t\t\t\t\t<?php if ( $count == 0 ) {\r\n\t\t\t\t\t\t\t\t\t\t$style = '-moz-hyphens: auto; -webkit-hyphens: auto; Margin: 0; border-collapse: collapse !important; color: #555555; font-family: Helvetica, Arial, sans-serif; font-size: 15px; font-weight: 700; hyphens: auto; line-height: 28px; margin: 0; padding: 20px 5px; text-align: left; vertical-align: top; word-wrap: break-word;';\r\n\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t$style = '-moz-hyphens: auto; -webkit-hyphens: auto; Margin: 0; border-collapse: collapse !important; border-top: 2px solid #ff5c28; color: #555555; font-family: Helvetica, Arial, sans-serif; font-size: 15px; font-weight: 700; hyphens: auto; line-height: 28px; margin: 0; padding: 20px 5px; text-align: left; vertical-align: top; word-wrap: break-word;';\r\n\t\t\t\t\t\t\t\t\t} ?>\r\n\t\t\t\t\t\t\t\t\t<td class=\"result-list-label bordered\"\r\n\t\t\t\t\t\t\t\t\t style=\"<?php echo $style ?>\">\r\n\t\t\t\t\t\t\t\t\t\t<?php echo ucfirst( Audit_API::get_action_text( strtolower( $key ) ) ) ?>\r\n\t\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t\t<td class=\"result-list-data bordered\"\r\n\t\t\t\t\t\t\t\t\t style=\"<?php echo $style ?>\">\r\n\t\t\t\t\t\t\t\t\t\t<?php foreach ( $row as $i => $v ): ?>\r\n\t\t\t\t\t\t\t\t\t\t\t<?php if ( $i == 'count' ) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\t\t\t\t\t} ?>\r\n\t\t\t\t\t\t\t\t\t\t\t<span\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tstyle=\"display: inline-block; font-weight: 400; width: 100%;\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t<?php echo ucwords( Audit_API::get_action_text( strtolower( $i ) ) ) ?>\r\n : <?php echo $v ?>\r\n\t\t\t\t\t\t\t\t\t\t\t</span>\r\n\t\t\t\t\t\t\t\t\t\t<?php endforeach; ?>\r\n\t\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t\t<?php $count ++; ?>\r\n\t\t\t\t\t\t\t<?php endforeach; ?>\r\n\t\t\t\t\t\t\t</tbody>\r\n\t\t\t\t\t\t\t<tfoot class=\"results-list-footer\">\r\n\t\t\t\t\t\t\t<tr style=\"padding: 0; text-align: left; vertical-align: top;\">\r\n\t\t\t\t\t\t\t\t<td colspan=\"2\"\r\n\t\t\t\t\t\t\t\t style=\"-moz-hyphens: auto; -webkit-hyphens: auto; Margin: 0; border-collapse: collapse !important; color: #555555; font-family: Helvetica, Arial, sans-serif; font-size: 15px; font-weight: normal; hyphens: auto; line-height: 26px; margin: 0; padding: 10px 0 0; text-align: left; vertical-align: top; word-wrap: break-word;\">\r\n\t\t\t\t\t\t\t\t\t<p style=\"Margin: 0; Margin-bottom: 0; color: #555555; font-family: Helvetica, Arial, sans-serif; font-size: 15px; font-weight: normal; line-height: 26px; margin: 0; margin-bottom: 0; padding: 0 0 24px; text-align: left;\">\r\n\t\t\t\t\t\t\t\t\t\t<a class=\"plugin-brand\"\r\n\t\t\t\t\t\t\t\t\t\t href=\"{LOGS_URL}\"\r\n\t\t\t\t\t\t\t\t\t\t style=\"Margin: 0; color: #ff5c28; display: inline-block; font: inherit; font-family: Helvetica, Arial, sans-serif; font-weight: normal; line-height: 1.3; margin: 0; padding: 0; text-align: left; text-decoration: none;\"><?php _e( \"You can view the full audit report for your site here.\", wp_defender()->domain ) ?>\r\n\t\t\t\t\t\t\t\t\t\t\t<img\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tclass=\"icon-arrow-right\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tsrc=\"<?php echo wp_defender()->getPluginUrl() ?>assets/email-images/icon-arrow-right-defender.png\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\talt=\"Arrow\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tstyle=\"-ms-interpolation-mode: bicubic; border: none; clear: both; display: inline-block; margin: -2px 0 0 5px; max-width: 100%; outline: none; text-decoration: none; vertical-align: middle; width: auto;\"></a>\r\n\t\t\t\t\t\t\t\t\t</p>\r\n\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t</tfoot>\r\n\t\t\t\t\t\t</table>\r\n\t\t\t\t\t\t<table class=\"main-signature\"\r\n\t\t\t\t\t\t style=\"border-collapse: collapse; border-spacing: 0; padding: 0; text-align: left; vertical-align: top;\">\r\n\t\t\t\t\t\t\t<tbody>\r\n\t\t\t\t\t\t\t<tr style=\"padding: 0; text-align: left; vertical-align: top;\">\r\n\t\t\t\t\t\t\t\t<td class=\"main-signature-content\"\r\n\t\t\t\t\t\t\t\t style=\"-moz-hyphens: auto; -webkit-hyphens: auto; Margin: 0; border-collapse: collapse !important; color: #555555; font-family: Helvetica, Arial, sans-serif; font-size: 15px; font-weight: normal; hyphens: auto; line-height: 26px; margin: 0; padding: 0; text-align: left; vertical-align: top; word-wrap: break-word;\">\r\n\t\t\t\t\t\t\t\t\t<p style=\"Margin: 0; Margin-bottom: 0; color: #555555; font-family: Helvetica, Arial, sans-serif; font-size: 15px; font-weight: normal; line-height: 26px; margin: 0; margin-bottom: 0; padding: 0 0 24px; text-align: left;\">\r\n\t\t\t\t\t\t\t\t\t\tStay safe,</p>\r\n\t\t\t\t\t\t\t\t\t<p class=\"last-item\"\r\n\t\t\t\t\t\t\t\t\t style=\"Margin: 0; Margin-bottom: 0; color: #555555; font-family: Helvetica, Arial, sans-serif; font-size: 15px; font-weight: normal; line-height: 26px; margin: 0; margin-bottom: 0; padding: 0; text-align: left;\">\r\n\t\t\t\t\t\t\t\t\t\tWP Defender <br><strong>WPMU DEV Security Hero</strong></p>\r\n\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t</tbody>\r\n\t\t\t\t\t\t</table>\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t</tbody>\r\n\t\t\t</table>\r\n\t\t\t<?php\r\n\t\t\t$table = ob_get_clean();\r\n\t\t} else {\r\n\t\t\t$table = '<p>' . sprintf( esc_html__( \"There were no events logged for %s\", wp_defender()->domain ), network_site_url() ) . '</p>';\r\n\t\t}\r\n\r\n\t\t$template = $this->renderPartial( 'email_template', array(\r\n\t\t\t'message' => $table,\r\n\t\t\t'subject' => sprintf( esc_html__( \"Here's what's been happening at %s\", wp_defender()->domain ), network_site_url() )\r\n\t\t), false );\r\n\r\n\r\n\t\tforeach ( Settings::instance()->receipts as $item ) {\r\n\t\t\t//prepare the parameters\r\n\t\t\t$email = $item['email'];\r\n\r\n\t\t\t$logs_url = network_admin_url( 'admin.php?page=wdf-logging&date_from=' . date( 'm/d/Y', strtotime( $date_from ) ) . '&date_to=' . date( 'm/d/Y', strtotime( $date_to ) ) );\r\n\t\t\t$logs_url = apply_filters( 'report_email_logs_link', $logs_url, $email );\r\n\t\t\t$no_reply_email = \"noreply@\" . parse_url( get_site_url(), PHP_URL_HOST );\r\n\t\t\t$no_reply_email = apply_filters( 'wd_audit_noreply_email', $no_reply_email );\r\n\t\t\t$headers = array(\r\n\t\t\t\t'From: Defender <' . $no_reply_email . '>',\r\n\t\t\t\t'Content-Type: text/html; charset=UTF-8'\r\n\t\t\t);\r\n\t\t\t$params = array(\r\n\t\t\t\t'USER_NAME' => $item['first_name'],\r\n\t\t\t\t'SITE_URL' => network_site_url(),\r\n\t\t\t\t'LOGS_URL' => $logs_url\r\n\t\t\t);\r\n\t\t\t$email_content = $template;\r\n\t\t\tforeach ( $params as $key => $val ) {\r\n\t\t\t\t$email_content = str_replace( '{' . $key . '}', $val, $email_content );\r\n\t\t\t}\r\n\t\t\twp_mail( $email, sprintf( __( \"Here's what's been happening at %s\", wp_defender()->domain ), network_site_url() ), $email_content, $headers );\r\n\t\t}\r\n\r\n\t\t$settings->lastReportSent = time();\r\n\t\t$settings->save();\r\n\t}",
"public function mass_CRON()\n {\n ini_set('MAX_EXECUTION_TIME', -1);\n $this->mc_check_techadress(); //ATTENTION! Mailchimp takes time for report to show up. If you try to check before report show up - update still work, but info about statuses can be incorrect, bounced emails cant be detected\n //Time to report show up varies. Observed min time - 15 minutes. Observed max time 120 minutes. (yes, mc is shit)\n $this->email_mass_send_expired_waiting();\n }",
"function wphb_performance_cron_report() {\r\n\treturn WP_Hummingbird_Module_Performance::cron_scan();\r\n}",
"public function actionStatisticsUhkklp()\n {\n $dailyArgs = [\n 'description' => 'Direct: Stats of StatsMemberDaily',\n 'runNextJob' => true,\n 'accountId' => self::ACCOUND_ID,\n 'properties' => $this->properties,\n ];\n\n $dailyArgs['description'] = 'Direct: Stats of StatsMemberCampaignLogDaily';\n Yii::$app->job->create('backend\\modules\\uhkklp\\job\\StatsMemberCampaignLogDaily', $dailyArgs);\n\n $dailyArgs['description'] = 'Direct: Stats of StatsMemberPropertyMonthly';\n Yii::$app->job->create('backend\\modules\\uhkklp\\job\\StatsMemberPropertyMonthly', $dailyArgs);\n }",
"public function schedule(JobInterface $job): void;",
"public function my_job_reports()\n\t{\n\t\trequire_once(APP_DIR.'controllers/contractor/my_job_reports.php');\n\t}",
"protected function sendReport()\n {\n $payload = json_encode($this['sysinfo']->all());\n\n $uri = $this->cfg('report.uri');\n\n $signature = $this['signer']->signature($payload);\n\n $headers = [\n 'Content-Type: application/json',\n sprintf('X-Signature: %s', $signature),\n ];\n\n $this['http']->makeRequest(\n $uri,\n $payload,\n $headers,\n 'POST'\n );\n }",
"public function schedule_tracking_task() {\n\t\tif ( ! wp_next_scheduled( $this->job_name ) ) {\n\t\t\twp_schedule_event( time(), $this->get_prefix() . '_usage_tracking_two_weeks', $this->job_name );\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns true if user is allowed to change his password. | protected function ChangePasswordIsAllowed()
{
return $this->IsLoggedIn() || $this->IsOwner();
} | [
"function can_change_password() {\n return true;\n }",
"public function can_change_password() {\n return false;\n }",
"public function can_change_password() {\r\n return false;\r\n }",
"function can_change_password(){\r\n\t\treturn true;\r\n\t}",
"function can_change_password() {\n\t\t\t\treturn false;\n\t\t\t}",
"function can_change_password() {\n return false;\n }",
"function can_change_password() {\n global $USER;\n return(is_enabled_auth('openid') && !empty($USER) && $USER->id > 0 &&\n property_exists($USER, 'auth') && $USER->auth == 'openid' &&\n ($this->config->auth_openid_allow_muliple == 'true' ||\n count_records('openid_urls', 'userid', $USER->id) > 1));\n }",
"function allowPasswordChange() {\n\t\tif ($this->canHaveLoginForm) { return true; }\n\t\treturn false;\n\n\t}",
"public function canChangePasswords(): bool;",
"public function canChangePasswords();",
"public function mustChangePassword() {\n\t\n\t\t// get a copy of the application configuration\n\t\t$conf = new AppConfiguration();\n\t\t\n\t\t$class = LS_LOGIN_TABLE;\n\t\t\n\t\t// create a new user record\n\t\t$user = new $class( $_REQUEST[LS_USERNAME_FIELDNAME], true );\n\t\n\t\t// get the age of the password in months\n\t\t$pwd_age = Utility::get_time_difference( $user->get('password_age'), date('Y-m-d',time()));\n\t\n\t\tif ( $conf->getMaxPasswordAge() && $pwd_age['days'] > ( $conf->getMaxPasswordAge() * 30))\n\t\t\treturn true;\n\t\telse return false;\n\t\t\n\t}",
"public function passwordChangeRequested()\n {\n return (bool)$GLOBALS['session']->get('horde', 'auth/change');\n }",
"public function canSetPassword()\n {\n return $this->isActive() && $this->definition->canSetPassword();\n }",
"public function shouldChangePassword() {\n global $CFG_GLPI;\n\n if ($this->hasPasswordExpired()) {\n return true; // too late to change password, but returning false would not be logical here\n }\n\n $expiration_time = $this->getPasswordExpirationTime();\n if (null === $expiration_time) {\n return false;\n }\n\n $notice_delay = (int)$CFG_GLPI['password_expiration_notice'];\n if (-1 === $notice_delay) {\n return false;\n }\n\n $notice_time = strtotime('- ' . $notice_delay . ' days', $expiration_time);\n\n return $notice_time < time();\n }",
"public function requirePasswordChange()\n {\n return $this->require_password_change ? true : false;\n }",
"static function changePasswordEnabled()\r\n\t{\r\n\t\t$authDriver = ConfService::getAuthDriverImpl();\r\n\t\treturn $authDriver->passwordsEditable();\r\n\t}",
"public function canSetPassword(\\Gems_User_User $user = null);",
"function allowPasswordChange() {\n\t\tglobal $wgLDAPUpdateLDAP, $wgLDAPMailPassword;\n\t\tglobal $wgLDAPUseLocal;\n\n\t\t$this->printDebug( \"Entering allowPasswordChange\", NONSENSITIVE );\n\n\t\t$retval = false;\n\n\t\t// Local domains need to be able to change passwords\n\t\tif ( (isset($wgLDAPUseLocal) && $wgLDAPUseLocal) && 'local' == $_SESSION['wsDomain'] ) {\n\t\t\t$retval = true;\n\t\t}\n\n\t\tif ( isset( $wgLDAPUpdateLDAP[$_SESSION['wsDomain']] ) && $wgLDAPUpdateLDAP[$_SESSION['wsDomain']] ) {\n\t\t\t$retval = true;\n\t\t}\n\n\t\tif ( isset( $wgLDAPMailPassword[$_SESSION['wsDomain']] ) && $wgLDAPMailPassword[$_SESSION['wsDomain']] ) {\n\t\t\t$retval = true;\n\t\t}\n\n\t\treturn $retval;\n\t}",
"function hasChangePasswordAccess($user_id,$password){\n \n $query = $this->db->query(\"SELECT password from users where user_id='\".$user_id.\"'\");\n\n if($this->db->affected_rows() > 0){\n $row = $query->result_array();\n if($password==md5($row[0]['password']))\n return true;\n } \n return false;\n \n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get details of a commit: tree, parents, author/committer (name, mail, date), message | function git_get_commit_info($project, $hash = 'HEAD', $path = null)
{
global $conf;
$info = array();
$info['h_name'] = $hash;
$info['message_full'] = '';
$info['parents'] = array();
$extra = '';
if (isset($path)) {
$extra = '-- '. escapeshellarg($path);
}
$output = run_git($project, "rev-list --header --max-count=1 $hash $extra");
// tree <h>
// parent <h>
// author <name> "<"<mail>">" <stamp> <timezone>
// committer
// <empty>
// <message>
$pattern = '/^(author|committer) ([^<]+) <([^>]*)> ([0-9]+) (.*)$/';
foreach ($output as $line) {
if (substr($line, 0, 4) === 'tree') {
$info['tree'] = substr($line, 5);
}
// may be repeated multiple times for merge/octopus
elseif (substr($line, 0, 6) === 'parent') {
$info['parents'][] = substr($line, 7);
}
elseif (preg_match($pattern, $line, $matches) > 0) {
$info[$matches[1] .'_name'] = $matches[2];
$info[$matches[1] .'_mail'] = $matches[3];
$info[$matches[1] .'_stamp'] = $matches[4] + ((intval($matches[5]) / 100.0) * 3600);
$info[$matches[1] .'_timezone'] = $matches[5];
$info[$matches[1] .'_utcstamp'] = $matches[4];
if (isset($conf['mail_filter'])) {
$info[$matches[1] .'_mail'] = $conf['mail_filter']($info[$matches[1] .'_mail']);
}
}
// Lines starting with four spaces and empty lines after first such line are part of commit message
elseif (substr($line, 0, 4) === ' ' || (strlen($line) == 0 && isset($info['message']))) {
$info['message_full'] .= substr($line, 4) ."\n";
if (!isset($info['message'])) {
$info['message'] = substr($line, 4, $conf['commit_message_maxlen']);
$info['message_firstline'] = substr($line, 4);
}
}
elseif (preg_match('/^[0-9a-f]{40}$/', $line) > 0) {
$info['h'] = $line;
}
}
// This is a workaround for the unlikely situation where a commit does
// not have a message. Such a commit can be created with the following
// command:
// git commit --allow-empty -m '' --cleanup=verbatim
if (!array_key_exists('message', $info)) {
$info['message'] = '(no message)';
$info['message_firstline'] = '(no message)';
}
$info['author_datetime'] = strftime($conf['datetime_full'], $info['author_utcstamp']);
$info['author_datetime_local'] = strftime($conf['datetime_full'], $info['author_stamp']) .' '. $info['author_timezone'];
$info['committer_datetime'] = strftime($conf['datetime_full'], $info['committer_utcstamp']);
$info['committer_datetime_local'] = strftime($conf['datetime_full'], $info['committer_stamp']) .' '. $info['committer_timezone'];
return $info;
} | [
"function git_get_commit_info($project, $hash = 'HEAD')\n{\n\tglobal $conf;\n\n\t$info = array();\n\t$info['h_name'] = $hash;\n\t$info['message_full'] = '';\n\t$info['parents'] = array();\n\n\t$output = run_git($project, \"rev-list --header --max-count=1 $hash\");\n\t// tree <h>\n\t// parent <h>\n\t// author <name> \"<\"<mail>\">\" <stamp> <timezone>\n\t// committer\n\t// <empty>\n\t// <message>\n\t$pattern = '/^(author|committer) ([^<]+) <([^>]*)> ([0-9]+) (.*)$/';\n\tforeach ($output as $line) {\n\t\tif (substr($line, 0, 4) === 'tree') {\n\t\t\t$info['tree'] = substr($line, 5);\n\t\t}\n\t\t// may be repeated multiple times for merge/octopus\n\t\telseif (substr($line, 0, 6) === 'parent') {\n\t\t\t$info['parents'][] = substr($line, 7);\n\t\t}\n\t\telseif (preg_match($pattern, $line, $matches) > 0) {\n\t\t\t$info[$matches[1] .'_name'] = $matches[2];\n\t\t\t$info[$matches[1] .'_mail'] = $matches[3];\n\t\t\t$info[$matches[1] .'_stamp'] = $matches[4] + ((intval($matches[5]) / 100.0) * 3600);\n\t\t\t$info[$matches[1] .'_timezone'] = $matches[5];\n\t\t\t$info[$matches[1] .'_utcstamp'] = $matches[4];\n\n\t\t\tif (isset($conf['mail_filter'])) {\n\t\t\t\t$info[$matches[1] .'_mail'] = $conf['mail_filter']($info[$matches[1] .'_mail']);\n\t\t\t}\n\t\t}\n\t\t// Lines starting with four spaces and empty lines after first such line are part of commit message\n\t\telseif (substr($line, 0, 4) === ' ' || (strlen($line) == 0 && isset($info['message']))) {\n\t\t\t$info['message_full'] .= substr($line, 4) .\"\\n\";\n\t\t\tif (!isset($info['message'])) {\n\t\t\t\t$info['message'] = substr($line, 4, $conf['commit_message_maxlen']);\n\t\t\t\t$info['message_firstline'] = substr($line, 4);\n\t\t\t}\n\t\t}\n\t\telseif (preg_match('/^[0-9a-f]{40}$/', $line) > 0) {\n\t\t\t$info['h'] = $line;\n\t\t}\n\t}\n\n\treturn $info;\n}",
"public function commitInfos($hash='HEAD'){\n\t\t$infos=array('name'=>$hash,'message'=>'');\n\t\t$output = $this->run('rev-list --header --max-count=1 '.$hash);\n\t\t// tree <h>\n\t\t// parent <h>\n\t\t// author <name> \"<\"<mail>\">\" <stamp> <timezone>\n\t\t// committer\n\t\t// <empty>\n\t\t// <message>\n\t\t$pattern='/^(author|committer) ([^<]+) <([^>]*)> ([0-9]+) (.*)$/';\n\t\tforeach($output as $line){\n\t\t\tif(substr($line,0,4) === 'tree') $infos['tree']=substr($line,5);\n\t\t\t// may be repeated multiple times for merge/octopus\n\t\t\telseif(substr($line,0,6) === 'parent') $infos['parents'][] = substr($line,7);\n\t\t\telseif(preg_match($pattern,$line,$matches) > 0){\n\t\t\t\t$infos[$matches[1] .'_name'] = $matches[2];\n\t\t\t\t$infos[$matches[1] .'_mail'] = $matches[3];\n\t\t\t\t$infos[$matches[1] .'_stamp'] = $matches[4] + ((intval($matches[5]) / 100.0) * 3600);\n\t\t\t\t$infos[$matches[1] .'_timezone'] = $matches[5];\n\t\t\t\t$infos[$matches[1] .'_utcstamp'] = $matches[4];\n\t\t\t\t \n\t\t\t\tif(isset($conf['mail_filter'])) $info[$matches[1] .'_mail'] = $conf['mail_filter']($infos[$matches[1] .'_mail']);\n\t\t\t}\n\t\t\t// Lines starting with four spaces and empty lines after first such line are part of commit message\n\t\t\telseif(substr($line, 0, 4) === ' ') $infos['message'].=substr($line,4).\"\\n\";\n\t\t\telseif(strlen($line) == 0 && isset($infos['message'])) $infos['message'].=\"\\n\";\n\t\t\telseif(preg_match('/^[0-9a-f]{40}$/',$line) > 0) $infos['h'] = $line;\n\t\t}\n\n\t\t$infos['author_datetime'] = gmstrftime('%Y-%m-%d %H:%M:%S', $infos['author_utcstamp']);\n\t\t$infos['author_datetime_local'] = gmstrftime('%Y-%m-%d %H:%M:%S', $infos['author_stamp']) .' '. $infos['author_timezone'];\n\t\t$infos['committer_datetime'] = gmstrftime('%Y-%m-%d %H:%M:%S', $infos['committer_utcstamp']);\n\t\t$infos['committer_datetime_local'] = gmstrftime('%Y-%m-%d %H:%M:%S', $infos['committer_stamp']) .' '. $infos['committer_timezone'];\n\t\t\n\t\treturn $infos;\n\t}",
"public function parseCommit($commit) {\n\t\t$result = ['parent' => []];\n\t\t$lines = explode(\"\\n\", trim($commit));\n\n\t\twhile (!is_null($line = array_shift($lines))) {\n\n\t\t\tif (empty(trim($line))) {\n\t\t\t\t$result['message'] = implode(\"\\n\", $lines);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tlist($name, $value) = explode(\" \", $line, 2);\n\n\t\t\tif ($name == 'parent') {\n\t\t\t\t$result['parent'][] = $value;\n\t\t\t} else {\n\t\t\t\t$result[$name] = $value;\n\t\t\t}\n\n\t\t\tif ($name == 'author' || $name == 'committer') {\n\t\t\t\t$matches = [];\n\t\t\t\tif (preg_match('/^(.*)<(.*)>(.*)$/', $value, $matches)) {\n\t\t\t\t\t$result[\"{$name}_name\"] = $matches[1];\n\t\t\t\t\t$result[\"{$name}_email\"] = $matches[2];\n\t\t\t\t\t$result[\"{$name}_date\"] = $matches[3];\n\t\t\t\t} else {\n\t\t\t\t\t// what??\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}",
"public static function getCommitMessage() {\n return self::_gitParseDefault('commit_message', 'git log -1 --pretty=%s');\n }",
"public function get_commit_message() {\n\t\treturn $this->commit_message;\n\t}",
"function process_commit($commit){\n $columns = explode(chr(0x01), $commit);\n $datetext = '';\n $author = '';\n $msg = '';\n $cnt = count($columns);\n if($cnt > 2){\n $datetext = $columns[0]; //0 = datetime\n $author = $columns[1]; //1 = author\n $msg = $columns[2];//2 = msg\n }\n\n return ['date' => $datetext, 'author'=>$author, 'message' => $msg];\n}",
"public function getCommitMessage() {\n $subject = $this->getChangeDescription();\n\n $bodies = array();\n foreach ($this->getSortedChangeInfoList() as $changeInfo) {\n $bodies[] = $changeInfo->getCommitMessage()->getBody();\n }\n\n $body = join(\"\\n\\n\", $bodies);\n\n return new CommitMessage($subject, $body);\n }",
"function github_commit_detail($repo, $commit)\n{\n global $curlBaseOpts;\n\n $ch = curl_init();\n curl_setopt_array($ch, $curlBaseOpts);\n curl_setopt($ch, CURLOPT_URL, 'https://api.github.com/repos/' . $repo . '/commits/' . $commit);\n\n //execute post\n $result = curl_exec($ch);\n\n continueOrFailOnHttpCode(curl_getinfo($ch, CURLINFO_HTTP_CODE));\n\n //close connection\n curl_close($ch);\n\n return json_decode($result, true);\n}",
"public function getCommitMessage() {\n\t\t$commit = $this->getCommit();\n\t\tif($commit) {\n\t\t\ttry {\n\t\t\t\treturn Convert::raw2xml($this->Environment()->getCommitMessage($commit));\n\t\t\t} catch(Gitonomy\\Git\\Exception\\ReferenceNotFoundException $e) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"public function getCommitMessage() : string\n {\n return $this->commitMessage;\n }",
"abstract protected function getCommitMessageHead();",
"function generate_message($commit) {\n return \"Commit Pushed\\n----------\\nAuthor : \" . $commit->author->email . \"\\nMessage : \" . $commit->message.\"\\nURL : \".$commit->url;\n}",
"public function GetCommit()\n\t{\n\t\treturn $this->GetProject()->GetCommit($this->commitHash);\n\t}",
"private function getLastCommitMessage()\n {\n // hash\n // subject\n // body\n $process = new Process('git log -1 --format=\"%h%n%s%n%b\"');\n $process->run();\n\n return \\trim($process->getOutput());\n }",
"public function getGitCommit(): string;",
"function xsvn_get_commit_author($rev_or_tx, $repo, $is_revision = TRUE) {\n $rev_str = $is_revision ? '-r' : '-t';\n return trim(shell_exec(\"svnlook author $rev_str $rev_or_tx $repo\"));\n}",
"public function getCommitter() { return $this->committer; }",
"function get_composer_content($commit, $filename) {\n\n return json_decode(shell_exec('git show ' . $commit . ':' . $filename));\n}",
"private function getCommitHistory() {\n $master_commits = $this->git_object->getObject($this->git_object->getTip($this->active_branch));\n return $master_commits->getHistory($this->git_object);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
determine primary key and value | function determine_primary() {
$this->dao->myquery("SHOW index FROM $this->table where Key_name = 'PRIMARY';");
// var_dump($this->dao->fetch_one_obj());
$this->primary_key = $this->dao->fetch_one_obj()->Column_name;
if (isset($this->{$this->primary_key})) {
$this->primary_id = $this->{$this->primary_key};
}
} | [
"function primary_key_value()\n\t{\n\t\treturn( $this->details_id );\n\t\t\n\t}",
"function primary_key_value()\n\t{\n\t\treturn( $this->data_id );\n\t\t\n\t}",
"public static function get_primary_key();",
"function get_primary_key_value()\r\n\t{\r\n\t\t$name = $this->primary_key();\r\n\t\treturn $this->getReflection()->get_as_mixed($name);\r\n\t}",
"abstract public function get_primary_key($object);",
"public function ormGetPrimaryKeyValue()\n {\n $p = $this->orm['primaryKey'];\n\n if (isset($this->$p))\n {\n return $this->$p;\n }\n else\n {\n return NULL;\n }\n }",
"private function _fetch_primary_key()\n {\n if($this->primaryKey == NULl)\n {\n $this->primaryKey = $this->db->query(\"SHOW KEYS FROM `\".$this->_table.\"` WHERE Key_name = 'PRIMARY'\")->row()->Column_name;\n }\n }",
"public function primary_key() {\n $field = $this->_primary_key;\n return $this->$field;\n }",
"public function primaryKeyValue() {\n return $this->get($this->primaryKeyName())->int();\n }",
"function getPrimaryKey()\n {\n }",
"public function get_primary_row(){\r\n $result = $this->db->query(\"SHOW KEYS FROM \". $this->db->formatTableName($this->table). \"\r\n WHERE Key_name = %s\"\r\n , \"PRIMARY\");\r\n $pk = \"\";\r\n foreach ($result as $res){\r\n $pk = $res[\"Column_name\"];\r\n }\r\n return $pk;\r\n }",
"public static function primary_key() {\n\t\treturn static::$_primary_key;\n\t}",
"public function getPrimaryKeyUtil();",
"public function get_primary_key() {\n return $this->primary_key;\n }",
"function getPrimaryKey() {\n $pks = $this->getPrimaryKeys();\n if (count($pks)) $res = $pks[0];\n else $res = false;\n if ($this->_isNewRecord && !$this->_recordStored) $res = false;\n return $res;\n }",
"function getPrimaryKey($tablename){\r\n\t\tif ($this->_primaryKeys==null) $this->_loadPrimaryKeyData();\r\n\t\tif (array_key_exists($tablename,$this->_primaryKeys)) return $this->_primaryKeys[$tablename];\r\n\t\telse return \"id\";\r\n\t}",
"function primaryKey() {\n\t\tglobal $connDBA;\n\t\t\n\t\treturn mysql_insert_id($connDBA);\n\t}",
"public function getPrimaryKey($row);",
"public function isPrimaryKEY()\r\n\t{return $this->KEY == KEY::$PK;}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Lists all gift entities. | public function indexAction()
{
$em = $this->getDoctrine()->getManager();
$gifts = $em->getRepository('ApiSikaBundle:Gift')->findAll();
return $this->render('gift/index.html.twig', array(
'gifts' => $gifts,
));
} | [
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('svplocationAdminBundle:Entrepot')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n $entities = $em->getRepository('HCocktailBundle:Ingredient')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('uesperaBundle:GastosFamiliares')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }",
"public function indexAction() {\n $em = $this->getDoctrine()->getEntityManager();\n $entities = $em->getRepository('EphpGestoriBundle:Gestore')->findAll();\n\n return array('entities' => $entities);\n }",
"public function getAllEntities()\n {\n return $this->getRepository()->findAll();\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('GarnetTaxiBeBundle:Ligne')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }",
"public function getEntityList();",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('OGInversaBundle:GalleryItem')->findAll();\n\n return array('entities' => $entities);\n }",
"public function indexAction()\r\n {\r\n $em = $this->getDoctrine()->getManager();\r\n\r\n $entities = $em->getRepository('LooninsIncidentBundle:GdpMails')->findAll();\r\n\r\n return array(\r\n 'entities' => $entities,\r\n );\r\n }",
"public function getAllAction() {\n $em = $this->getDoctrine()->getManager();\n $entities = $em->getRepository('MiwClubPadelBundle:Users')->findAll();\n return $entities;\n }",
"public function indexAction() {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('BackOfficebackBundle:Extraitnaissances')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('AppBundle:Entity')->findAll();\n\n return $this->render('entity/index.html.twig', array(\n 'entities' => $entities,\n ));\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('Area4ContableBundle:Egreso')->findAll();\n\n return array('entities' => $entities);\n }",
"public function getAllEntries()\n {\n return $this->createEntity('Indgang')->findAll();\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('LvSaladeBundle:Famille')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }",
"public function indexAction() {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('CMSBundle:IngredientCategory')->findAll();\n return array(\n 'entities' => $entities,\n );\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('BackendBundle:Gasto')->findAll();\n\n return $this->render('BackendBundle:Gasto:index.html.twig', array(\n 'entities' => $entities,\n ));\n }",
"public function indexAction() {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DalilakVenueBundle:Venue')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entrepots = $em->getRepository('AdminBundle:Entrepot')->findAll();\n\n return $this->render('AdminBundle:Entrepot:index.html.twig', array(\n 'entrepots' => $entrepots,\n ));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method to set the value of field rgst_date | public function setRgstDate($rgst_date)
{
$this->rgst_date = $rgst_date;
return $this;
} | [
"function setRFODate($rfo)\n {\n $this->rfoDate = $rfo;\n }",
"public function setDateTimeValue($field,$date);",
"function setDate( $value )\r\n {\r\n $this->Date = $value;\r\n }",
"function setDate($date)\r\n {\r\n $this->_date = $date;\r\n }",
"public function setRegistrationDate($value){\n\t\t\t$this->registration_date = $value;\n\t\t}",
"public function getRgstDate()\n {\n return $this->rgst_date;\n }",
"function setDate($value = '') {\n $this->date = ($value == '' ? DateManager::get_Date() : DateManager::format_Date($value));\n }",
"function setDate( $value )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n $this->Date = $value;\n }",
"public function setDate($date)\n {\n }",
"function setDateField($field) {\n\t\t$this->date_field = $field;\n\t}",
"public function setStartDate($date = '1/1/1900');",
"function setDate(ilDateTime $a_date = NULL)\n\t{\n\t\t$this->date = $a_date;\n\t}",
"public function setValutaDate($valutaDate) {\n\t\t$this->valutaDate = $valutaDate;\n\t\t\n\t\t$this->doUpdate(\"SET valuta_date = '\" . $valutaDate->getDate() . \"'\");\n\t}",
"public function setRecipeSubmissionDate($newRecipeSubmissionDate = null): void {\n\n\t\t// if date is null, use the current date and time\n\t\tif($newRecipeSubmissionDate === null) {\n\t\t\t$this->recipeSubmissionDate = new \\DateTime();\n\t\t\treturn;\n\t\t}\n\n\t\t// store the submission date with ValidateDate trait\n\t\ttry {\n\t\t\t$newRecipeSubmissionDate = self::validateDateTime($newRecipeSubmissionDate);\n\t\t} catch(\\InvalidArgumentException | \\RangeException $exception) {\n\t\t\t$exceptionType = get_class($exception);\n\t\t\tthrow (new $exceptionType($exception->getMessage(), 0, $exception));\n\t\t}\n\n\t\t// store the recipe submission date\n\t\t$this->recipeSubmissionDate = $newRecipeSubmissionDate;\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}",
"public function setGregorianChange($date){}",
"public function set_contract_date($value) {\r\n $this->contract_date = $value;\r\n data::add(\"contract_date\", $this->contract_date !== \"\" ? $this->contract_date : NOTIME, $this->table_fields);\r\n }",
"function setDate( $value )\r\n {\r\n $this->SentDate = $value;\r\n }",
"public function setDate($newDate)\n\t{\n\t\tif (is_int($newDate))\n\t\t{\n\t\t\t$this->date = $newDate;\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Lists all Live entities. | public function indexAction()
{
$em = $this->getDoctrine()->getManager();
$entities = $em->getRepository('AppBundle:Live')->findAll();
return array(
'entities' => $entities,
);
} | [
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('SiteBundle:Video')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }",
"public function findLiveLoans()\n {\n return $this->em->getRepository('MarketplaceBundle\\Entity\\Loan')->findBy(\n array('live' => true),\n array('creationDate' => 'DESC')\n );\n }",
"public function indexAction() {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DalilakVenueBundle:Venue')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('MNMatchBundle:TeamPlayer')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('GolfEnLaNubeBundle:TemporadaClub')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('GarnetTaxiBeBundle:Ligne')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }",
"public function getAllAction() {\n $em = $this->getDoctrine()->getManager();\n $entities = $em->getRepository('MiwClubPadelBundle:Users')->findAll();\n return $entities;\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('svplocationAdminBundle:Entrepot')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }",
"public function getAllEntities()\n {\n return $this->getRepository()->findAll();\n }",
"public function indexAction() {\n $em = $this->getDoctrine()->getManager();\n $entities = $em->getRepository('PolmediaBundle:Video')->getAllVideos();\n return array(\n 'entities' => $entities,\n );\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('EvidenciaBundle:Evidencia')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('bonavallBancdeltempsBundle:EstatServei')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('AdminCommonBundle:Vitrine')->findAllByOrder();\n return array(\n 'entities' => $entities,\n );\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('TestAppBundle:Personel')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('BackendBundle:Tour')->findAll();\n\n return $this->render('BackendBundle:Tour:index.html.twig', array(\n 'entities' => $entities\n ));\n }",
"public function allAction()\n {\n $ventes = $this->get('oc_fidelite.vente_manager')->readAll();\n\n return $this->render('OCFideliteBundle:Vente:all_vte.html.twig', array(\n 'ventes' => $ventes,\n ));\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('Area4ContableBundle:Egreso')->findAll();\n\n return array('entities' => $entities);\n }",
"public function getEntityList();",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('VentasBundle:Venta')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
delete listing type preparation | function ajaxPrepareDeleting( $key = false )
{
global $_response, $rlSmarty, $rlHook, $delete_details, $lang, $delete_total_items, $config, $rlListingTypes;
// check admin session expire
if ( $this -> checkSessionExpire() === false )
{
$redirect_url = RL_URL_HOME . ADMIN ."/index.php";
$redirect_url .= empty($_SERVER['QUERY_STRING']) ? '?session_expired' : '?'. $_SERVER['QUERY_STRING'] .'&session_expired';
$_response -> redirect( $redirect_url );
}
if ( count($rlListingTypes -> types) <= 1 )
{
$_response -> script("printMessage('alert', '{$lang['limit_listing_types_remove']}')");
return $_response;
}
/* get listing type details */
$type_info = $rlListingTypes -> types[$key];
$rlSmarty -> assign_by_ref('type_info', $type_info);
/* check listings */
$sql = "SELECT COUNT(`T1`.`ID`) AS `Count` FROM `". RL_DBPREFIX ."listings` AS `T1` ";
$sql .= "LEFT JOIN `". RL_DBPREFIX ."categories` AS `T2` ON `T1`.`Category_ID` = `T2`.`ID` ";
$sql .= "WHERE `T2`.`Type` = '{$key}' AND `T1`.`Status` <> 'trash' AND `T2`.`Status` <> 'trash' ";
$listings = $this -> getRow($sql);
$delete_details[] = array(
'name' => $lang['listings'],
'items' => $listings['Count'],
'link' => RL_URL_HOME . ADMIN . '/index.php?controller=listings&listing_type='. $key
);
$delete_total_items += $listings['Count'];
/* check categories */
$categories = $this -> getRow("SELECT COUNT(`ID`) AS `Count` FROM `". RL_DBPREFIX ."categories` WHERE `Type` = '{$key}' AND `Status` <> 'trash'");
$delete_details[] = array(
'name' => $lang['categories'],
'items' => $categories['Count'],
'link' => RL_URL_HOME . ADMIN . '/index.php?controller=categories&listing_type='. $key
);
$delete_total_items += $categories['Count'];
/* check custom categories */
$sql = "SELECT COUNT(`T1`.`ID`) AS `Count` FROM `". RL_DBPREFIX ."tmp_categories` AS `T1` ";
$sql .= "LEFT JOIN `". RL_DBPREFIX ."categories` AS `T2` ON `T1`.`Parent_ID` = `T2`.`ID` ";
$sql .= "WHERE `T2`.`Type` = '{$key}' AND `T2`.`Status` <> 'trash' ";
$custom_categories = $this -> getRow($sql);
$delete_details[] = array(
'name' => $lang['admin_controllers+name+custom_categories'],
'items' => $custom_categories['Count'],
'link' => RL_URL_HOME . ADMIN . '/index.php?controller=custom_categories'
);
$delete_total_items += $custom_categories['Count'];
$rlHook -> load('deleteListingTypeDataCollection');
$rlSmarty -> assign_by_ref('delete_details', $delete_details);
if ( $delete_total_items )
{
$tpl = 'blocks' . RL_DS . 'delete_preparing_listing_type.tpl';
$_response -> assign("delete_container", 'innerHTML', $GLOBALS['rlSmarty'] -> fetch( $tpl, null, null, false ));
$_response -> script("
$('#delete_block').slideDown();
");
}
else
{
$phrase = $config['trash'] ? str_replace('{type}', $type_info['name'], $lang['notice_drop_empty_listing_type']) : str_replace('{type}', $type_info['name'], $lang['notice_delete_empty_listing_type']);
$_response -> script("
$('#delete_block').slideUp();
rlPrompt('{$phrase}', 'xajax_deleteListingType', '{$type_info['Key']}');
");
}
return $_response;
} | [
"function deleteListingTypeData($key = false)\n\t{\n\t\tglobal $rlActions;\n\t\t\n\t\tif ( !$key )\n\t\t\treturn false;\n\t\t\t\n\t\t// remove enum option from listing plans table\n\t\t$rlActions -> enumRemove('search_forms', 'Type', $key);\n\t\t$rlActions -> enumRemove('categories', 'Type', $key);\n\t\t$rlActions -> enumRemove('account_types', 'Abilities', $key);\n\t\t$rlActions -> enumRemove('saved_search', 'Listing_type', $key);\n\t\t\n\t\t// delete custom categories page\n\t\t$sql = \"DELETE `T1` FROM `\". RL_DBPREFIX .\"tmp_categories` AS `T1` \";\n\t\t$sql .= \"LEFT JOIN `\". RL_DBPREFIX .\"categories` AS `T2` ON `T1`.`Parent_ID` = `T2`.`ID` \";\n\t\t$sql .= \"WHERE `T2`.`Type` = '{$key}' \";\n\t\t$this -> query($sql);\n\t\t\n\t\t// delete individual page\n\t\t$this -> query(\"DELETE FROM `\". RL_DBPREFIX .\"pages` WHERE `Key` = 'lt_{$key}' LIMIT 1\");\n\t\t\n\t\t// delete my listings page\n\t\t$this -> query(\"DELETE FROM `\". RL_DBPREFIX .\"pages` WHERE `Key` = 'my_{$key}' LIMIT 1\");\n\t\t\n\t\t// delete quick search form\n\t\t$search_form_id = $this -> getOne('ID', \"`Key` = '{$key}_quick'\", 'search_forms');\n\t\tif ( $search_form_id )\n\t\t{\n\t\t\t$this -> query(\"DELETE FROM `\". RL_DBPREFIX .\"search_forms` WHERE `Key` = '{$key}_quick' LIMIT 1\");\n\t\t\t$this -> query(\"DELETE FROM `\". RL_DBPREFIX .\"search_forms_relations` WHERE `Category_ID` = '{$search_form_id}'\");\n\t\t}\n\t\t\n\t\t// delete advanced search form\n\t\t$adv_search_form_id = $this -> getOne('ID', \"`Key` = '{$key}_advanced'\", 'search_forms');\n\t\tif ( $adv_search_form_id )\n\t\t{\n\t\t\t$this -> query(\"DELETE FROM `\". RL_DBPREFIX .\"search_forms` WHERE `Key` = '{$key}_advanced' LIMIT 1\");\n\t\t\t$this -> query(\"DELETE FROM `\". RL_DBPREFIX .\"search_forms_relations` WHERE `Category_ID` = '{$adv_search_form_id}'\");\n\t\t}\n\t\t\n\t\t// delete arranged search form\n\t\tif ( $type_info['Arrange_field'] )\n\t\t{\n\t\t\t$arranged_search_forms = $this -> getOne('ID', \"`Key` LIKE '{$key}_tab%'\", 'search_forms');\n\t\t\tif ( $arranged_search_forms )\n\t\t\t{\n\t\t\t\tforeach ($arranged_search_forms as $arranged_search_form_id)\n\t\t\t\t{\n\t\t\t\t\t$this -> query(\"DELETE FROM `\". RL_DBPREFIX .\"search_forms` WHERE `ID` = '{$arranged_search_form_id}' LIMIT 1\");\n\t\t\t\t\t$this -> query(\"DELETE FROM `\". RL_DBPREFIX .\"search_forms_relations` WHERE `Category_ID` = '{$arranged_search_form_id}'\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// delete categories block\n\t\t$this -> query(\"DELETE FROM `\". RL_DBPREFIX .\"blocks` WHERE `Key` = 'ltcb_{$key}' LIMIT 1\");\n\t\t\n\t\t// delete featured block\n\t\t$this -> query(\"DELETE FROM `\". RL_DBPREFIX .\"blocks` WHERE `Key` = 'ltfb_{$key}' LIMIT 1\");\n\t\t\n\t\t// delete search block\n\t\t$this -> query(\"DELETE FROM `\". RL_DBPREFIX .\"blocks` WHERE `Key` = 'ltsb_{$key}' LIMIT 1\");\n\t\t\n\t\t// delete arranged featured blocks\n\t\tif ( $type_info['Arrange_field'] )\n\t\t{\n\t\t\t$arranged_blocks = $this -> getOne('ID', \"`Key` LIKE 'ltfb_{$key}_box%'\", 'blocks');\n\t\t\tif ( $arranged_blocks )\n\t\t\t{\n\t\t\t\tforeach ($arranged_blocks as $arranged_block_id)\n\t\t\t\t{\n\t\t\t\t\t$this -> query(\"DELETE FROM `\". RL_DBPREFIX .\"blocks` WHERE `ID` = '{$arranged_block_id}' LIMIT 1\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function deleteListingTypeData($key = false)\n {\n global $rlActions, $type_info, $rlDb;\n\n if (!$key) {\n return false;\n }\n\n // remove enum option from listing plans table\n $rlActions->enumRemove('search_forms', 'Type', $key);\n $rlActions->enumRemove('categories', 'Type', $key);\n $rlActions->enumRemove('account_types', 'Abilities', $key);\n $rlActions->enumRemove('saved_search', 'Listing_type', $key);\n\n // delete custom categories page\n $sql = \"DELETE `T1` FROM `{db_prefix}tmp_categories` AS `T1` \";\n $sql .= \"LEFT JOIN `{db_prefix}categories` AS `T2` ON `T1`.`Parent_ID` = `T2`.`ID` \";\n $sql .= \"WHERE `T2`.`Type` = '{$key}' \";\n $this->query($sql);\n\n // delete individual page\n $this->query(\"DELETE FROM `{db_prefix}pages` WHERE `Key` = 'lt_{$key}' LIMIT 1\");\n\n // delete individual add listing page\n $this->query(\"DELETE FROM `{db_prefix}pages` WHERE `Key` = 'al_{$key}' LIMIT 1\");\n $this->query(\"DELETE FROM `{db_prefix}lang_keys` WHERE `Key` = 'pages+name+al_{$key}' OR `Key` = 'pages+title+al_{$key}' OR `Key` = 'pages+h1+al_{$key}'\");\n\n // delete my listings page\n $this->query(\"DELETE FROM `{db_prefix}pages` WHERE `Key` = 'my_{$key}' LIMIT 1\");\n\n // delete quick search form\n $search_form_id = $this->getOne('ID', \"`Key` = '{$key}_quick'\", 'search_forms');\n if ($search_form_id) {\n $this->query(\"DELETE FROM `{db_prefix}search_forms` WHERE `Key` = '{$key}_quick' LIMIT 1\");\n $this->query(\"DELETE FROM `{db_prefix}search_forms_relations` WHERE `Category_ID` = '{$search_form_id}'\");\n }\n\n // delete advanced search form\n $adv_search_form_id = $this->getOne('ID', \"`Key` = '{$key}_advanced'\", 'search_forms');\n if ($adv_search_form_id) {\n $this->query(\"DELETE FROM `{db_prefix}search_forms` WHERE `Key` = '{$key}_advanced' LIMIT 1\");\n $this->query(\"DELETE FROM `{db_prefix}search_forms_relations` WHERE `Category_ID` = '{$adv_search_form_id}'\");\n }\n\n // delete my listings form\n if ($my_search_form_id = $rlDb->getOne('ID', \"`Key` = '{$key}_myads'\", 'search_forms')) {\n $rlDb->query(\"DELETE FROM `{db_prefix}search_forms` WHERE `Key` = '{$key}_myads' LIMIT 1\");\n $rlDb->query(\"DELETE FROM `{db_prefix}search_forms_relations` WHERE `Category_ID` = '{$my_search_form_id}'\");\n $rlDb->query(\"DELETE FROM `{db_prefix}lang_keys` WHERE `Key` = 'search_forms+name+{$key}_myads'\");\n }\n\n // delete arranged search form\n if ($type_info['Arrange_field']) {\n $arranged_search_forms = $this->getOne('ID', \"`Key` LIKE '{$key}_tab%'\", 'search_forms');\n if ($arranged_search_forms) {\n foreach ($arranged_search_forms as $arranged_search_form_id) {\n $this->query(\"DELETE FROM `{db_prefix}search_forms` WHERE `ID` = '{$arranged_search_form_id}' LIMIT 1\");\n $this->query(\"DELETE FROM `{db_prefix}search_forms_relations` WHERE `Category_ID` = '{$arranged_search_form_id}'\");\n }\n }\n }\n\n // delete categories block\n $rlDb->query(\"DELETE FROM `{db_prefix}blocks` WHERE `Key` = 'ltcb_{$key}' LIMIT 1\");\n\n // delete categories block\n $rlDb->query(\"DELETE FROM `{db_prefix}blocks` WHERE `Key` = 'ltcategories_{$key}' LIMIT 1\");\n\n // delete featured block\n $rlDb->query(\"DELETE FROM `{db_prefix}blocks` WHERE `Key` = 'ltfb_{$key}' LIMIT 1\");\n\n // delete search block\n $rlDb->query(\"DELETE FROM `{db_prefix}blocks` WHERE `Key` = 'ltsb_{$key}' LIMIT 1\");\n\n // delete my {type} search block\n $rlDb->query(\"DELETE FROM `{db_prefix}blocks` WHERE `Key` = 'ltma_{$key}' LIMIT 1\");\n\n // delete {type} search block\n $rlDb->query(\"DELETE FROM `{db_prefix}blocks` WHERE `Key` = 'ltpb_{$key}' LIMIT 1\");\n\n // delete arranged featured blocks\n if ($type_info['Arrange_field']) {\n $arranged_blocks = $this->getOne('ID', \"`Key` LIKE 'ltfb_{$key}_box%'\", 'blocks');\n if ($arranged_blocks) {\n foreach ($arranged_blocks as $arranged_block_id) {\n $this->query(\"DELETE FROM `{db_prefix}blocks` WHERE `ID` = '{$arranged_block_id}' LIMIT 1\");\n }\n }\n }\n }",
"public function cleanContentTypes() {\n foreach ($this->contentTypes as $type) {\n $this->visitPath('/admin/structure/types/manage/' . $type . '/delete');\n\n // If we can't access the page, don't bother. We did our due diligence.\n if ($this->getSession()->getStatusCode() == 200) {\n $this->minkContext->pressButton('Delete');\n }\n }\n }",
"function content_type_delete($info) {\n // Don't delete data for content-types defined by disabled modules.\n if (!empty($info->disabled)) {\n return;\n }\n\n // TODO : What about inactive fields ?\n // Currently, content_field_instance_delete doesn't work on those...\n $fields = content_field_instance_read(array('type_name' => $info->type));\n foreach ($fields as $field) {\n content_field_instance_delete($field['field_name'], $info->type, FALSE);\n }\n $table = _content_tablename($info->type, CONTENT_DB_STORAGE_PER_CONTENT_TYPE);\n if (db_table_exists($table)) {\n $ret = array();\n db_drop_table($ret, $table);\n watchdog('content', 'The content fields table %name has been deleted.', array('%name' => $table));\n }\n // Menu needs to be rebuilt as well, but node types need to be rebuilt first.\n // node_type_form_submit() takes care of this.\n content_clear_type_cache(TRUE);\n}",
"function deleteType()\n {\n global $objDatabase, $_ARRAYLANG;\n\n if (isset($_GET['typeId'])) {\n $typeId=intval($_GET['typeId']);\n $objResult = $objDatabase->Execute(\"SELECT id FROM \".DBPREFIX.\"module_news WHERE typeid=\".$typeId);\n\n if ($objResult !== false) {\n if (!$objResult->EOF) {\n $this->strErrMessage = $_ARRAYLANG['TXT_TYPE_NOT_DELETED_BECAUSE_IN_USE'];\n }\n else {\n if ($objDatabase->Execute(\n \"DELETE tblC, tblL\n FROM \".DBPREFIX.\"module_news_types AS tblC\n INNER JOIN \".DBPREFIX.\"module_news_types_locale AS tblL ON tblL.type_id=tblC.typeid\n WHERE tblC.typeid=\".$typeId\n ) !== false\n ) {\n $this->strOkMessage = $_ARRAYLANG['TXT_DATA_RECORD_DELETED_SUCCESSFUL'];\n } else {\n $this->strErrMessage = $_ARRAYLANG['TXT_DATABASE_QUERY_ERROR'];\n }\n }\n }\n }\n }",
"function og_micro_type_delete($info) {\n variable_del('og_group_type_' . $info->machine_name);\n variable_del('og_group_content_type_' . $info->machine_name);\n}",
"function local_cms_delete($info, $itemtype) {\n $object->id = $info;\n $object->itemtype = $itemtype;\n return $object;\n}",
"function basiclti_delete_type($id){\r\n\tdelete_records('basiclti_types', 'id', $id);\r\n\tdelete_records('basiclti_types_config', 'typeid', $id);\r\n}",
"function removeType()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n\r\n // delete values\r\n $db->query( \"DELETE FROM eZMediaCatalogue_AttributeValue WHERE MediaID='$this->ID'\" );\r\n\r\n $db->query( \"DELETE FROM eZMediaCatalogue_TypeLink WHERE MediaID='$this->ID'\" );\r\n\r\n }",
"function _acf_query_remove_post_type($sql) {}",
"function removeType()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n\r\n // delete values\r\n $db->query( \"DELETE FROM eZLink_AttributeValue WHERE LinkID='$this->ID'\" );\r\n\r\n $db->query( \"DELETE FROM eZLink_TypeLink WHERE LinkID='$this->ID'\" );\r\n\r\n }",
"function remove_by_type($type) {\n\t\t$db=openqrm_get_db_connection();\n\t\t$rs = $db->Execute(\"delete from $this->_db_table where deployment_type='$type'\");\n\t}",
"function removeType()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n $db->begin();\r\n\r\n // delete values\r\n $res[] = $db->query( \"DELETE FROM eZTrade_AttributeValue\r\n WHERE ProductID='$this->ID'\" );\r\n\r\n $res[] = $db->query( \"DELETE FROM eZTrade_ProductTypeLink\r\n WHERE ProductID='$this->ID'\" );\r\n eZDB::finish( $res, $db );\r\n\r\n }",
"function _delete_custom_listing()\n{\n\tglobal $dbpdo;\n\t\n\t$sql = $dbpdo->prepare(\"DELETE FROM `custom_listings` WHERE `id` = :custom_listing_id\");\n\t\n\t$data = array(\n\t'custom_listing_id' => (int)$_REQUEST['custom_listing_id']\n\t);\n\t\n\tif($sql->execute($data))\n\t{\n\t\treturn \"pass\";\n\t}\n\telse\n\t{\n\t\treturn false;\n\t}\n\t\n\treturn false;\n}",
"function deleteAllParts() {\n sql_query('DELETE FROM '.sql_table('template').' WHERE tdesc='.$this->getID());\n }",
"function delete_course_type_tool($course_type_tool);",
"function cleanRelationTable() {\n global $CFG_GLPI, $DB;\n\n // If this type have INFOCOM, clean one associated to purged item\n if (Infocom::canApplyOn($this)) {\n $infocom = new Infocom();\n\n if ($infocom->getFromDBforDevice($this->getType(), $this->fields['id'])) {\n $infocom->delete(['id' => $infocom->fields['id']]);\n }\n }\n\n // If this type have NETPORT, clean one associated to purged item\n if (in_array($this->getType(), $CFG_GLPI['networkport_types'])) {\n // If we don't use delete, then cleanDBonPurge() is not call and the NetworkPorts are not\n // clean properly\n $networkPortObject = new NetworkPort();\n $networkPortObject->cleanDBonItemDelete($this->getType(), $this->getID());\n // Manage networkportmigration if exists\n if ($DB->tableExists('glpi_networkportmigrations')) {\n $networkPortMigObject = new NetworkPortMigration();\n $networkPortMigObject->cleanDBonItemDelete($this->getType(), $this->getID());\n }\n }\n\n // If this type is RESERVABLE clean one associated to purged item\n if (in_array($this->getType(), $CFG_GLPI['reservation_types'])) {\n $rr = new ReservationItem();\n\n if ($rr->getFromDBbyItem($this->getType(), $this->fields['id'])) {\n $rr->delete(['id' => $infocom->fields['id']]);\n }\n }\n\n // If this type have CONTRACT, clean one associated to purged item\n if (in_array($this->getType(), $CFG_GLPI['contract_types'])) {\n $ci = new Contract_Item();\n $ci->cleanDBonItemDelete($this->getType(), $this->fields['id']);\n }\n\n // If this type have DOCUMENT, clean one associated to purged item\n if (Document::canApplyOn($this)) {\n $di = new Document_Item();\n $di->cleanDBonItemDelete($this->getType(), $this->fields['id']);\n }\n\n // If this type have NOTEPAD, clean one associated to purged item\n if ($this->usenotepad) {\n $note = new Notepad();\n $note->cleanDBonItemDelete($this->getType(), $this->fields['id']);\n }\n\n }",
"function removeFromType($entryId, $type)\r\n {\r\n \r\n }",
"function hook_simple_entity_type_delete(SimpleEntityType $simple_entity_type) {\n db_delete('mytable')\n ->condition('pid', entity_id('simple_entity_type', $simple_entity_type))\n ->execute();\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Process the item object to extract keywords. | public function getItemKeywords($item, $type=NULL){
$keywordArray = array();
//$this->convertToArray($titleObject);
if(isset($item->typeOfResource) && (!$type || $type == "type")){
foreach($item->typeOfResource as $t){
$keywordArray[] = (string) $t;
}
}
if(isset($item->physicalDescription) && (!$type || $type == "form")){
foreach($item->physicalDescription as $p){
foreach($p->form as $f){
$keywordArray[] = (string) $f;
}
}
}
if(isset($item->genre) && (!$type || $type == "genre")){
foreach($item->genre as $g){
$keywordArray[] = (string) $g;
}
}
if(isset($item->targetAudience) && (!$type || $type == "audience")){
foreach($item->targetAudience as $a){
$keywordArray[] = (string) $a;
}
}
if(isset($item->subject) && (!$type || $type == "topic")){
foreach($item->subject as $s){
foreach($s->topic as $t){
$keywordArray[] = (string) $t;
}
}
}
if(isset($item->relatedItem) && (!$type || $type == "topic")){
foreach($item->relatedItem as $r){
$attributes = $r->attributes();
if(isset($attributes->type)){
$type = (string) $attributes->type;
if($type == 'series'){
foreach($r->titleInfo as $t){
$series = explode(";", (string) $t->title);
$keywordArray[] = trim($series[0]);
}
}
}
}
}
if(isset($item->originInfo)){
$edition = $this->getOriginInfo($item, 'edition');
$keywordArray = array_merge($keywordArray, $edition);
}
if(isset($item->classification) && (!$type || $type == "classification" || $type == 'ddc')){
foreach($item->classification as $c){
$auth = '';
$attributes = $c->attributes();
if(isset($attributes->authority)){
$auth = (string) $attributes->authority;
}
$dewey = '';
if($auth){
if(strtolower($auth) == 'ddc'){
$c = (string) $c;
$dewey = preg_replace('/[^ .0-9]/', '', $c);
$dewey = floatval(trim($dewey, ". "));
$dewey = !empty($dewey) && $dewey > 0 ? $dewey : trim(strtolower(preg_replace('/[\d\/\\.\[\]]/', ' ', $dewey)));
if($type == "ddc" && is_numeric($dewey)){
return $dewey;
}
}
if($type == 'ddc'){
return '';
}
$keywordArray[] = $this->keywordsFromClassification($c, $dewey);
}
}
}
if(isset($item->language) && (!$type || $type == "lang")){
foreach($item->language as $l){
foreach($l->languageTerm as $t){
$keywordArray[] = (string) $t;
}
}
}
$keywordArray = array_map(function($item) {
return trim(strtolower($item), '= / . : , ; - ');
}, $keywordArray);
$keywordArray = array_filter($keywordArray);
return array_unique(array_map('strtolower', $keywordArray));
} | [
"function getKeywords($item)\n\t{\n\t\t$keywords = array();\n\t\tif ($item->scripture)\n\t\t{\n\t\t\t$scripture\t= SermonspeakerHelperSermonspeaker::insertScriptures($item->scripture, '-/*', false);\n\t\t\tif ($this->params->get('prepare_content', 1))\n\t\t\t{\n\t\t\t\t$scripture\t= JHtml::_('content.prepare', $scripture);\n\t\t\t}\n\t\t\t$scripture\t= str_replace(',', ':', $scripture); // Make english scripture format\n\t\t\t$scripture\t= str_replace(\"\\n\", '', $this->make_xml_safe($scripture));\n\t\t\t$keywords\t= explode('-/*', $scripture);\n\t\t}\n\t\tif ($item->series_title)\n\t\t{\n\t\t\t$keywords[]\t= $this->make_xml_safe($item->series_title);\n\t\t}\n\n\t\treturn implode(',', $keywords);\n\t}",
"protected function processItem()\n {\n $this->extractFootnotes();\n $this->inlineFootnotes();\n }",
"protected function getKeywords()\n {\n }",
"abstract function process_item( $item );",
"public function readKeywords()\n\t{\n\t\t$this->testForParentID();\n\t\t$this->testForContentType();\n\n\t\t$this->clearKeywordList();\n\t\t$this->connectToDatabase();\n\t\t$query = \"CALL keywordSelectLinked(\".\n\t\t\t$this->id->escapeSQL($this->mysqli).\",\".\n\t\t\t$this->contentProperties->id->escapeSQL($this->mysqli).\")\";\n\t\t$data = $this->fetchRecords($query);\n\n\t\tforeach($data as $row) {\n\t\t\t$i = count($this->keywords);\n\t\t\t$this->keywords[$i] = new Keyword($row->term, $this->id->value, $this->contentProperties->id->value, $row->count);\n\t\t}\n\t}",
"public function getMetaKeywords();",
"protected function doKeywords()\n {\n $keywords = $this->getSubject();\n\n foreach ($this->getMessages() as $message) {\n $keywords .= ' '.$message->getBody();\n }\n\n // we only need each word once\n $this->keywords = implode(' ', array_unique(str_word_count(mb_strtolower($keywords, 'UTF-8'), 1)));\n }",
"protected function parseKeywords() {\n\t\treturn $this->selectMany(array('ows:ServiceIdentification', 'ows:Keywords', 'ows:Keyword'));\n\t}",
"abstract protected function keywords();",
"protected function doKeywords()\n {\n $keywords = $this->getSubject();\n\n foreach ($this->getMessages() as $message) {\n $body = $message->getBody();\n if('array' === gettype($body)) {\n $blocks = $body['blocks'];\n foreach ($blocks as $block) {\n $keywords .= ' '.$block['text'];\n }\n } else {\n $keywords .= ' '.strip_tags($body); //delete all html tag\n }\n }\n\n // we only need each word once\n $this->keywords = implode(' ', array_unique(str_word_count(mb_strtolower($keywords, 'UTF-8'), 1)));\n }",
"public function process($item);",
"function keywords() {\n $keywords = $this->find_meta( $this->meta_types['keywords'], $this->entity_being_viewed(), true );\n if ( !empty( $keywords ) )\n echo \"<meta name=\\\"keywords\\\" content=\\\"\" . apply_filters( \"onpage_seo_prepare_keywords\", $keywords ) . \"\\\">\\n\";\n }",
"abstract function processItem($params, $data, $entities);",
"private function _preProcessItem($item_id) {\r\n $db = get_db();\r\n\r\n if ($item_id) {\r\n $sql = \"delete from `$db->MeasurementSearchValues` where item_id=$item_id\";\r\n $db->query($sql);\r\n\r\n $text = false;\r\n\r\n $searchAllFields = (int)(boolean) get_option('measurement_search_search_all_fields');\r\n\r\n if ($searchAllFields) {\r\n $text = $db->fetchOne(\"select text from `$db->SearchTexts` where record_type='Item' and record_id=$item_id\");\r\n $text = ( $text ? $text : \"\" );\r\n\r\n $text .= SELF::_relationshipCommentText($item_id);\r\n $text = ( $text ? $text : false );\r\n } # if ($searchAllFields)\r\n\r\n else { # !$searchAllFields\r\n\r\n $limitFields = get_option('measurement_search_limit_fields');\r\n $limitFields = ( $limitFields ? json_decode($limitFields) : array() );\r\n\r\n $elementIds=array();\r\n if (is_array($limitFields)) {\r\n foreach($limitFields as $limitField) {\r\n $limitField = intval($limitField);\r\n if ($limitField) { $elementIds[] = $limitField; }\r\n }\r\n sort($elementIds);\r\n }\r\n\r\n if ($elementIds) {\r\n $elementIds = \"(\" . implode(\",\", $elementIds) . \")\";\r\n\r\n $elementTexts = $db -> fetchAll(\"select text from `$db->ElementTexts`\".\r\n \" where record_id=$item_id\".\r\n \" and element_id in $elementIds\");\r\n if ($elementTexts) {\r\n $text = \"\";\r\n foreach($elementTexts as $elementText) { $text .= \" \" . $elementText[\"text\"]; }\r\n } # if ($elementTexts)\r\n } # if ($elementIds)\r\n\r\n $searchRelComments = (int)(boolean) get_option('measurement_search_search_rel_comments');\r\n\r\n if ($searchRelComments) {\r\n $text = ( $text ? $text : \"\" );\r\n $text .= SELF::_relationshipCommentText($item_id);\r\n $text = ( $text ? $text : false );\r\n }\r\n\r\n } # !$searchAllFields\r\n\r\n if ($text !== false) {\r\n\r\n $cookedMeasurements = SELF::_processMeasurementText($text);\r\n // echo \"<pre>\" . print_r($cookedMeasurements,true) . \"</pre>\";\r\n // die();\r\n\r\n if ($cookedMeasurements) {\r\n\r\n $values = array();\r\n foreach($cookedMeasurements as $cookedMeasurement) {\r\n $values[] =\r\n '('.\r\n $item_id . ',\"' .\r\n str_pad($cookedMeasurement[0], MEASUREMENTSEARCH_NUM_MAXLEN, \"0\", STR_PAD_LEFT) . '\",\"' .\r\n str_pad($cookedMeasurement[1], MEASUREMENTSEARCH_NUM_MAXLEN, \"0\", STR_PAD_LEFT) . '\",\"' .\r\n str_pad($cookedMeasurement[2], MEASUREMENTSEARCH_NUM_MAXLEN, \"0\", STR_PAD_LEFT) . '\",\"' .\r\n $cookedMeasurement[3] .\r\n '\")';\r\n }\r\n $values = implode(\", \", $values);\r\n\r\n $sql = \"insert into `$db->MeasurementSearchValues`\".\r\n \" (item_id, height, width, depth, unit)\".\r\n \" values $values\";\r\n $db->query($sql);\r\n // die();\r\n\r\n } # if ($cookedMeasuerements)\r\n } # if ($text)\r\n } # if ($item_id)\r\n }",
"public function get_keyword_products( $keyword, $item_page, $sort_by, $amazon_cat ) {\n $ams_product_per_page = get_option( 'ams_product_per_page' );\n $locale = get_option( 'ams_amazon_country' );\n $regions = ams_get_amazon_regions();\n $marketplace = 'www.amazon.'. get_option( 'ams_amazon_country' );\n $serviceName = 'ProductAdvertisingAPI';\n $region = $regions[ $locale ]['RegionCode'];\n $accessKey = get_option( 'ams_access_key_id' );\n $secretKey = get_option( 'ams_secret_access_key' );\n\n $payloadArr = array();\n $payloadArr['Keywords'] = $keyword;\n $payloadArr['Resources'] = array( 'CustomerReviews.Count', 'CustomerReviews.StarRating', 'Images.Primary.Small', 'Images.Primary.Medium', 'Images.Primary.Large', 'Images.Variants.Small', 'Images.Variants.Medium', 'Images.Variants.Large', 'ItemInfo.ByLineInfo', 'ItemInfo.ContentInfo', 'ItemInfo.ContentRating', 'ItemInfo.Classifications', 'ItemInfo.ExternalIds', 'ItemInfo.Features', 'ItemInfo.ManufactureInfo', 'ItemInfo.ProductInfo', 'ItemInfo.TechnicalInfo', 'ItemInfo.Title', 'ItemInfo.TradeInInfo', 'Offers.Listings.Availability.MaxOrderQuantity', 'Offers.Listings.Availability.Message', 'Offers.Listings.Availability.MinOrderQuantity', 'Offers.Listings.Availability.Type', 'Offers.Listings.Condition', 'Offers.Listings.Condition.SubCondition', 'Offers.Listings.DeliveryInfo.IsAmazonFulfilled', 'Offers.Listings.DeliveryInfo.IsFreeShippingEligible', 'Offers.Listings.DeliveryInfo.IsPrimeEligible', 'Offers.Listings.DeliveryInfo.ShippingCharges', 'Offers.Listings.IsBuyBoxWinner', 'Offers.Listings.LoyaltyPoints.Points', 'Offers.Listings.MerchantInfo', 'Offers.Listings.Price', 'Offers.Listings.ProgramEligibility.IsPrimeExclusive', 'Offers.Listings.ProgramEligibility.IsPrimePantry', 'Offers.Listings.Promotions', 'Offers.Listings.SavingBasis', 'Offers.Summaries.HighestPrice', 'Offers.Summaries.LowestPrice', 'Offers.Summaries.OfferCount', 'ParentASIN','SearchRefinements' );\n $payloadArr[\"ItemCount\"] = (int) $ams_product_per_page;\n $payloadArr[\"ItemPage\"] = (int) $item_page;\n $payloadArr[\"SortBy\"] = $sort_by;\n $payloadArr[\"SearchIndex\"] = $amazon_cat;\n $payloadArr['PartnerTag'] = get_option( 'ams_associate_tag' );\n $payloadArr['PartnerType'] = 'Associates';\n $payloadArr['Marketplace'] = $marketplace;\n $payload = json_encode( $payloadArr );\n $host = $regions[ $locale ]['Host'];\n $uri_path = \"/paapi5/searchitems\";\n\n $api = new \\Amazon\\Affiliate\\Api\\Amazon_Product_Api( $accessKey, $secretKey, $region, $serviceName, $uri_path, $payload, $host, 'SearchItems' );\n $response = $api->do_request();\n $results = $response->SearchResult->Items;\n\n return $results;\n }",
"private function normalize_keywords()\r\n {\r\n /*\r\n 'ident_keywords' => array(\r\n 'type'=>'complex',\r\n 'is_repeated'=>true,\r\n 'xpath'=>'//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:descriptiveKeywords/gmd:MD_Keywords',\r\n 'items'=>array(\r\n 'keyword'=> array(\r\n 'type'=>'array',\r\n 'xpath'=>'gmd:keyword',\r\n 'is_repeated'=>true,\r\n ),\r\n 'type'=> array(\r\n 'type'=>'text',\r\n 'xpath'=>'gmd:type',\r\n 'is_repeated'=>false\r\n ),\r\n 'thesaurus'=> array(\r\n 'type'=>'text',\r\n 'xpath'=>'gmd:thesaurusName/gmd:CI_Citation/gmd:title',\r\n 'is_repeated'=>false\r\n )\r\n )\r\n ),\r\n */\r\n \r\n $keywords=$this->xpath_map['ident_keywords']['data'];\r\n \r\n $output=array();\r\n foreach($keywords as $row)\r\n {\r\n foreach($row['keyword'] as $keyword)\r\n { \r\n $output[]=array(\r\n 'keyword' => $keyword,\r\n 'type' => @$row['type'],\r\n 'thesaurus' => @$row['thesaurus'] \r\n ); \r\n }\r\n }\r\n $this->xpath_map['ident_keywords']['data']=$output;\r\n }",
"private function getKeywords()\n {\n $this->tplVar['keys'] = array();\n \n $keywords = array();\n \n // get text related keywords\n $this->model->action('misc','getKeywordIds', \n array('result' => & $keywords,\n 'id_text' => (int)$this->current_id_text));\n\n foreach($keywords as $key)\n {\n $tmp = array();\n $tmp['id_key'] = $key; \n \n $keyword = array();\n $this->model->action('keyword','getKeyword', \n array('result' => & $keyword,\n 'id_key' => (int)$key,\n 'fields' => array('title','id_key'))); \n $branch = array();\n // get keywords branches\n $this->model->action('keyword','getBranch', \n array('result' => & $branch,\n 'id_key' => (int)$key,\n 'fields' => array('title','id_key'))); \n\n $tmp['branch'] = '';\n \n foreach($branch as $bkey)\n {\n $tmp['branch'] .= '/'.$bkey['title'];\n }\n \n $tmp['branch'] .= '/<strong>'.$keyword['title'].'</strong>';\n \n $this->tplVar['keys'][] = $tmp;\n }\n sort($this->tplVar['keys']); \n }",
"public function processItem(): void;",
"public function generateMetaKeywords()\n {\n $this->generateEntityByTypeIdForCategory(\n \\MageWorx\\SeoXTemplates\\Model\\Template\\Category::TYPE_CATEGORY_META_KEYWORDS\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Removes all registered constraints | public function clear(): self
{
$this->constraints = [];
return $this;
} | [
"public function resetConstraints()\n {\n foreach (array_keys($this->constraints) as $key) {\n $this->constraints[$key] = [];\n }\n }",
"public function removeAllValidation()\n {\n if ($this->form) {\n foreach ($this->constraints as $fieldName => $constraints) {\n foreach ($constraints as $constraint) {\n $constraint->removeParsley();\n unset($constraint);\n }\n }\n }\n $this->constraints = array();\n }",
"public function removeConstraint($constraint);",
"public static function destroyAllBindings() {\n static::$_bindings = array();\n static::$_recursion = array();\n }",
"public function removeUnusedRelations(): void\n {\n $this->unusedRelationsRemover->run();\n }",
"public function __destruct()\n {\n $this->applyConstraint();\n }",
"public function removeAllRules()\n {\n $this->db->getCollection($this->itemTable)->update([], ['ruleName' => null]);\n $this->db->getCollection($this->ruleTable)->drop();\n }",
"function removeAllRules();",
"public function deleteConstraintsObject()\r\n\t{\r\n\t\t$survey_questions =& $this->object->getSurveyQuestions();\r\n\t\t$structure =& $_SESSION[\"constraintstructure\"];\r\n\t\tforeach ($_POST as $key => $value)\r\n\t\t{\r\n\t\t\tif (preg_match(\"/^constraint_(\\d+)_(\\d+)/\", $key, $matches)) \r\n\t\t\t{\r\n\t\t\t\t$this->object->deleteConstraint($matches[2]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->ctrl->redirect($this, \"constraints\");\r\n\t}",
"public function deleteConstraintsObject()\n\t{\n\t\t$survey_questions =& $this->object->getSurveyQuestions();\n\t\t$structure =& $_SESSION[\"constraintstructure\"];\n\t\tforeach ($_POST as $key => $value)\n\t\t{\n\t\t\tif (preg_match(\"/^constraint_(\\d+)_(\\d+)/\", $key, $matches)) \n\t\t\t{\n\t\t\t\t$this->object->deleteConstraint($matches[2]);\n\t\t\t}\n\t\t}\n\n\t\t$this->ctrl->redirect($this, \"constraints\");\n\t}",
"public function disableForeignKeyConstraints() : void\n {\n $this->execute('SET CONSTRAINTS ALL DEFERRED');\n }",
"public function clean()\n {\n $this->removeAddenda();\n $this->removeNonSatNSNodes();\n $this->removeNonSatNSschemaLocations();\n $this->removeUnusedNamespaces();\n }",
"public function filterConstraints($constraints);",
"private function remove_all(){\n $module_path = $this->cms_module_path();\n\n // remove widgets\n $this->remove_widget($this->cms_complete_navigation_name('slideshow'));\n $this->remove_widget($this->cms_complete_navigation_name('tab'));\n $this->remove_widget($this->cms_complete_navigation_name('visitor_count'));\n\n // remove navigations\n $this->remove_navigation($this->cms_complete_navigation_name('manage_visitor_counter'));\n $this->remove_navigation($this->cms_complete_navigation_name('manage_tab_content'));\n $this->remove_navigation($this->cms_complete_navigation_name('manage_slide'));\n $this->remove_navigation($this->cms_complete_navigation_name('setting'));\n\n\n // remove parent of all navigations\n $this->remove_navigation($this->cms_complete_navigation_name('index'));\n\n // drop tables\n $this->dbforge->drop_table($this->cms_complete_table_name('visitor_counter'), TRUE);\n $this->dbforge->drop_table($this->cms_complete_table_name('tab_content'), TRUE);\n $this->dbforge->drop_table($this->cms_complete_table_name('slide'), TRUE);\n }",
"public function clearRules() {\n\t\t$this->rules = NULL;\n\t}",
"public function clearRules() {\r\n\t\t$this->rules = NULL;\r\n\t}",
"public function clearContratos()\n\t{\n\t\t$this->collContratos = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function clearConcepts()\n {\n foreach ($this->relationships as $relationship) {\n $relationship->clearConcepts();\n }\n }",
"public function deleteAllDependents() {\n\t\t$this->dependents = array();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
custom single product sales flash | function custom_sales_flash()
{
global $post, $product;
if ( $product->is_on_sale() ) :
echo apply_filters( 'woocommerce_sale_flash', '<span class="onsale uk-card-badge uk-label">' . esc_html__( 'Sale!', 'woocommerce' ) . '</span>', $post, $product );
endif;
} | [
"function qode_startit_woocommerce_sale_flash() {\n\n\t\treturn '<span class=\"qodef-onsale\"><span class=\"qodef-onsale-inner\">' . esc_html__('Sale!', 'startit') . '</span></span>';\n\n\t}",
"function zuhaus_mikado_woocommerce_sale_flash() {\n\t\treturn '<span class=\"mkdf-onsale\">' . esc_html__( 'Sale', 'zuhaus' ) . '</span>';\n\t}",
"public function productshopAction(){\n\n\t\t$this->view->DepotList = $this->ModelObj->getDepotList();\t// get depot list\n\n\t\t$this->view->CustomerList = $this->ModelObj->getCustomerByDepot();\n\n\t\t\n\n\t\t$this->view->ProductShop = $this->ModelObj->getProductList();;\n\n\t\t$this->view->summary = $this->cartsummaryAction();\n\n \t}",
"public function actiongetFlashSale() {\n $wb = new Webservice();\n $favArr = array();\n $fields = $_REQUEST;\n if (isset($fields[\"user_id\"]) && $fields[\"user_id\"] != \"\") {\n $favArr = $this->actiongetFavouriteProduct($fields[\"user_id\"]);\n }\n $langPf=(isset($_REQUEST[\"language_preference\"]) && $_REQUEST[\"language_preference\"]!=''?$_REQUEST[\"language_preference\"]:\"en\");\n $productArr=array();\n $now = date(\"Y-m-d h:i:s\");\n // AND spd.plan_id='\" . $fields['plan_id'] . \"' \n $subsql = \"select fs.*,p.* from flash_sale fs\n LEFT JOIN product p ON p.product_id=fs.product_id\n where fs.sale_start_from<='\".$now.\"'and fs.sale_end >= '\".$now.\"'\";\n\t $subrow = $wb->getAllData($subsql);\n if ($subrow) {\n $msg = \"Data found!\";\n $path = realpath(Yii::app()->basePath . '/../images/product/');\n $productURL = Yii::app()->getBaseUrl(true) . '/images/product/';\n $thumbpath = realpath(Yii::app()->basePath . '/../images/product/thumb/');\n $productthumbURL = Yii::app()->getBaseUrl(true) . '/images/product/thumb/';\n foreach ($subrow as $sk => $sv) {\n $is_favourite = (count($favArr) > 0 && in_array($sv[\"product_id\"], $favArr) ? \"1\" : \"0\");\n $productArr[] = array(\"product_id\" => $sv[\"product_id\"],\n \"flash_sale_id\" => $sv['flash_sale_id'],\n \"flash_sale_title\" => $sv['title'],\n \"sale_start_from\" => $sv['sale_start_from'],\n \"sale_end\" => $sv['sale_end'],\n \"product_name\" => ($langPf==\"cn\" && $sv[\"product_name_cn\"]!=\"\"?$sv[\"product_name_cn\"]:$sv[\"product_name\"]),\n \"image\" => (file_exists($path . \"/\" . $sv[\"image\"]) && $sv[\"image\"] != \"\" ? $productURL . $sv[\"image\"] : \"\"),\n \"thumb_image\" => (file_exists($thumbpath . \"/\" . $sv[\"image\"]) && $sv[\"image\"] != \"\" ? $productthumbURL . $sv[\"image\"] : \"\"),\n \"short_desc\" => ($langPf==\"cn\" && $sv[\"short_desc_cn\"]!=\"\"?$sv[\"short_desc_cn\"]:$sv[\"short_desc\"]),\n \"long_desc\" => ($langPf==\"cn\" && $sv[\"long_desc_cn\"]!=\"\"?$sv[\"long_desc_cn\"]:$sv[\"long_desc\"]),\n \"price\" => $sv[\"price\"],\n \"type\" => ($langPf==\"cn\" && $sv[\"type_cn\"]!=\"\"?$sv[\"type_cn\"]:$sv[\"type\"]),\n \"varietal\" => ($langPf==\"cn\" && $sv[\"varietal_cn\"]!=\"\"?$sv[\"varietal_cn\"]:$sv[\"varietal\"]),\n \"location\" => ($langPf==\"cn\" && $sv[\"location_cn\"]!=\"\"?$sv[\"location_cn\"]:$sv[\"location\"]),\n \"country\" => ($langPf==\"cn\" && $sv[\"country_cn\"]!=\"\"?$sv[\"country_cn\"]:$sv[\"country\"]),\n \"year\" => $sv[\"year\"],\n \"glassware\" => ($langPf==\"cn\" && $sv[\"glassware_cn\"]!=\"\"?$sv[\"glassware_cn\"]:$sv[\"glassware\"]),\n \"flash_sale_product\" => $sv[\"flash_sale_product\"],\n \"product_type\" => $sv[\"product_type\"],\n \"is_favourite\" => $is_favourite);\n $status = '1';\n\n }\n } else {\n $status = '-1';\n $msg = 'No products data found!';\n }\n $response = array('status' =>$status, 'data' => $productArr,\"message\"=>$msg);\n echo json_encode($response);\n die;\n }",
"public function webFlashSaleAction()\r\n {\r\n $promoManager = $this->get(\"yilinker_core.service.promo_manager\");\r\n $promoInstances = $promoManager->getFlashSaleInstancesWithSameTime();\r\n $dateNow = new \\DateTime();\r\n\r\n $currentPromoInstances = array();\r\n $upcomingPromoInstances = array();\r\n $completedPromoInstances = array();\r\n foreach($promoInstances as $key=>$promoInstance){\r\n $promoInstance[\"products\"] = $this->getInstanceProducts($promoInstance[\"promoInstanceIds\"]);\r\n if($promoInstance['dateTimeStart'] <= $dateNow && $dateNow < $promoInstance['dateTimeEnd']){\r\n array_push($currentPromoInstances, $promoInstance);\r\n }\r\n else if($promoInstance['dateTimeStart'] > $dateNow){\r\n array_push($upcomingPromoInstances, $promoInstance);\r\n }\r\n else if($promoInstance['dateTimeEnd'] < $dateNow){\r\n array_push($completedPromoInstances, $promoInstance);\r\n }\r\n }\r\n\r\n $response = $this->render('YilinkerFrontendBundle:FlashSale:product_list.html.twig', compact(\r\n 'upcomingPromoInstances',\r\n 'completedPromoInstances',\r\n 'currentPromoInstances',\r\n 'dateNow'\r\n ));\r\n\r\n return $response;\r\n }",
"function mrseo_elated_woocommerce_sale_flash() {\n\n\t\treturn '<span class=\"eltdf-onsale\">' . esc_html__('Sale', 'mrseo') . '</span>';\n\t}",
"function fluid_edge_woocommerce_sale_flash() {\n\n return '<span class=\"edgtf-onsale\">'.esc_html__('SALE', 'fluid').'</span>';\n }",
"public function startSale()\n {\n }",
"public function EndsaleAction()\r\n {\r\n\r\n $status = Mage::getStoreConfig('flashsale/general/status')==1;\r\n $response = array();\r\n $response['url'] = Mage::getUrl('checkout/cart');\r\n $response['status'] = '200';\r\n /*Check if flashsale is enabled */\r\n if($status && !file_exists(Mage::getBaseDir().'.flashsale'))\r\n {\r\n $cart = Mage::getSingleton('checkout/cart');\r\n $cart->truncate();\r\n $session = Mage::getSingleton('customer/session');\r\n $quote = Mage::getSingleton('checkout/session')->getQuote();\r\n $cart->init();\r\n \r\n $product_ids = $this->getRequest()->getParam('cart');\r\n\r\n /* Add Each Added FlashSale Products to cart */\r\n foreach(json_decode($product_ids,true) as $product_id)\r\n {\r\n\r\n try{\r\n\r\n $productInstance = Mage::getModel('catalog/product')->load($product_id);\r\n $finalPrice = ($productInstance->getFlashsalePrice()? $productInstance->getFlashsalePrice():$productInstance->getFinalPrice() );\r\n $item = $quote->addProduct($productInstance,1);\r\n $item->setCustomPrice($finalPrice);\r\n $item->setOriginalCustomPrice($finalPrice);\r\n $item->getProduct()->setIsSuperMode(true);\r\n }\r\n catch(Exception $exception)\r\n {\r\n Mage::getSingleton('customer/session')->addError($exception->getMessage());\r\n $response['status']= '500';\r\n }\r\n } \r\n $quote->collectTotals()->save();\r\n $cart->save();\r\n }\r\n else\r\n {\r\n $response['status'] = '503';\r\n }\r\n echo json_encode($response);\r\n }",
"function storefront_on_sale_products($args) {\n\n if (is_woocommerce_activated()) {\n\n $args = apply_filters('storefront_on_sale_products_args', array(\n 'limit' => 4,\n 'columns' => 4,\n 'title' => __('On Sale', 'storefront'),\n ));\n\n echo '<section class=\"storefront-product-section storefront-on-sale-products\">';\n\n do_action('storefront_homepage_before_on_sale_products');\n\n echo '<h2 class=\"section-title\">' . wp_kses_post($args['title']) . '</h2>';\n\n do_action('storefront_homepage_after_on_sale_products_title');\n\n echo storefront_do_shortcode('sale_products', array(\n 'per_page' => intval($args['limit']),\n 'columns' => intval($args['columns']),\n ));\n\n do_action('storefront_homepage_after_on_sale_products');\n\n echo '</section>';\n }\n }",
"function chefplaza_woocommerce_show_flash() {\n\n\tglobal $product, $woocommerce_loop;\n\n\tif ( ! $product->is_on_sale() ) {\n\n\t\tif ( 604800 > ( date( 'U' ) - strtotime( $product->post->post_date ) ) ) {\n\t\t\techo '<span class=\"new\">' . esc_html__( 'New', 'chefplaza' ) . '</span>';\n\t\t} else if ( $product->is_featured() ) {\n\t\t\techo '<span class=\"featured\">' . esc_html__( 'Featured', 'chefplaza' ) . '</span>';\n\t\t}\n\t}\n}",
"public function productsAction()\r\n {\r\n \r\n }",
"public function store_sales()\n\t{\n\t\t\n\t\t$SITE_TITLE = SITE_TITLE;\n\t\t$data['title'] = \"$SITE_TITLE Admin || Add Page\";\n\t\t$data['error'] = \"\";\n\t\t\n\t $data['pid1'] \t=\t$this->store_sales_model->getStoreProductId(); \n\t\t\n\t\t$data['store_sales_data'] =\t$this->store_sales_model->getAllStoreProductRow();\n\t\t\n\t\t$this->layout('enduser/store_sales',$data);\n\t\n\t}",
"public function getProductAction();",
"function product_store_show($product_store_id) {\n return $this->hook(\"/product_stores/{$product_store_id}.xml\", \"product-store\");\n }",
"public function fetch_sales_product_list_current(){\n\t\t$data['products']=$this->cafeteria_model->fetch_sales_product_list(date('Y-m-d'));\n\t\t$this->load->view('administrator/products/salesproductList', $data);\t\n\t}",
"function storefront_on_sale_products( $args ) {\n\n\t\tif ( storefront_is_woocommerce_activated() ) {\n\n\t\t\t$args = apply_filters( 'storefront_on_sale_products_args', array(\n\t\t\t\t'limit' => 4,\n\t\t\t\t'columns' => 4,\n\t\t\t\t'title' => __( 'On Sale', 'storefront' ),\n\t\t\t) );\n\n\t\t\techo '<section class=\"storefront-product-section storefront-on-sale-products\" aria-label=\"On Sale Products\">';\n\n\t\t\tdo_action( 'storefront_homepage_before_on_sale_products' );\n\n\t\t\techo '<h2 class=\"section-title\">' . wp_kses_post( $args['title'] ) . '</h2>';\n\n\t\t\tdo_action( 'storefront_homepage_after_on_sale_products_title' );\n\n\t\t\techo storefront_do_shortcode( 'sale_products', array(\n\t\t\t\t'per_page' => intval( $args['limit'] ),\n\t\t\t\t'columns' => intval( $args['columns'] ),\n\t\t\t) );\n\n\t\t\tdo_action( 'storefront_homepage_after_on_sale_products' );\n\n\t\t\techo '</section>';\n\t\t}\n\t}",
"public function upsellproductsAction() {\n\n }",
"function storepage_on_sale_products( $args ) {\n\n\t\tif ( is_woocommerce_activated() ) {\n\n\t\t\t$args = apply_filters( 'storepage_on_sale_products_args', array(\n\t\t\t\t'limit' => 4,\n\t\t\t\t'columns' => 4,\n\t\t\t\t'title' => __( 'On Sale', 'storepage' ),\n\t\t\t) );\n\n\t\t\techo '<section class=\"storepage-product-section storepage-on-sale-products\">';\n\n\t\t\tdo_action( 'storepage_before_on_sale_products' );\n\n\t\t\techo '<h2 class=\"section-title\">' . wp_kses_post( $args['title'] ) . '</h2>';\n\n\t\t\tdo_action( 'storepage_after_on_sale_products_title' );\n\n\t\t\techo storepage_do_shortcode( 'sale_products', array(\n\t\t\t\t'per_page' => intval( $args['limit'] ),\n\t\t\t\t'columns' => intval( $args['columns'] ),\n\t\t\t) );\n\n\t\t\tdo_action( 'storepage_after_on_sale_products' );\n\n\t\t\techo '</section>';\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the defenderFilesAndFoldersToExclude property value. Files and folder to exclude from scans and real time protection. | public function setDefenderFilesAndFoldersToExclude(?array $value): void {
$this->getBackingStore()->set('defenderFilesAndFoldersToExclude', $value);
} | [
"public function getDefenderFilesAndFoldersToExclude()\n {\n if (array_key_exists(\"defenderFilesAndFoldersToExclude\", $this->_propDict)) {\n return $this->_propDict[\"defenderFilesAndFoldersToExclude\"];\n } else {\n return null;\n }\n }",
"function setExcludeFolders($folders) {\n\t\tif ($folders != \"\")\n\t\t\t$this->_excludeFolders = split(',', $folders);\n\t}",
"function setExcludeFilePattern($pattern) {\n\t\t$this->_excludeFilePattern = $pattern;\n\t}",
"private function addExcludesFile() {\n\t\t$excludesFileUp = $this->CONFIGFOLDERPATH.\"/excludes_up.txt\";\n\t\tif(file_exists($excludesFileUp)) {\n\t\t\t$this->CONFIG->excludes_file_up = $excludesFileUp;\n\t\t}\n\t\t$excludesFileDown = $this->CONFIGFOLDERPATH.\"/excludes_down.txt\";\n\t\tif(file_exists($excludesFileDown)) {\n\t\t\t$this->CONFIG->excludes_file_down = $excludesFileDown;\n\t\t}\n\t}",
"public function setExcludePatterns( array $patterns )\n\t{\n\t\t$this->_options->set( Opt::PATH_EXCLUDE_PATTERNS, $patterns );\n\t}",
"public function setExcluded($exclude = true)\n {\n $this->exclude = $exclude;\n }",
"public function setExcludeAll(): void;",
"public function setExcludePatterns( array $patterns )\n\t{\n\t\t$this->_search->setExcludePatterns( $patterns );\n\t}",
"public function getExcludedFiles();",
"function setExclude($exclude)\n\t{\n\t\t$this->excludeClasses = explode(\" \", $exclude);\n\t}",
"public function getDefenderFileExtensionsToExclude()\n {\n if (array_key_exists(\"defenderFileExtensionsToExclude\", $this->_propDict)) {\n return $this->_propDict[\"defenderFileExtensionsToExclude\"];\n } else {\n return null;\n }\n }",
"public function setExcludes($excludes)\n {\n $this->clearExcludes();\n $this->addExcludes($excludes);\n }",
"public function setExcludeAll()\n {\n $this->setExclusionPolicy(EntityConfig::EXCLUSION_POLICY_ALL);\n }",
"public function setExcludeTargets($val)\n {\n $this->_propDict[\"excludeTargets\"] = $val;\n return $this;\n }",
"public function setExcluded(?bool $exclude = true): void\n {\n $this->exclude = $exclude;\n }",
"function setIgnoreHiddenFiles($value) {\n\t\t $this->ignore_hidden_files = $value;\n\t\t}",
"public function exclude($dirs): self;",
"public function getExcludeFiles()\n {\n return array(\n '.',\n '..',\n '.svn',\n '.git',\n $this->autoupgradeDir,\n );\n }",
"public function getDefenderDisableScanNetworkFiles()\n {\n if (array_key_exists(\"defenderDisableScanNetworkFiles\", $this->_propDict)) {\n return $this->_propDict[\"defenderDisableScanNetworkFiles\"];\n } else {\n return null;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The jQuery field sorting callback | public function ajax_sort_field() {
global $wpdb;
$data = array();
foreach ( $_REQUEST['order'] as $k ) :
if ( 'root' !== $k['item_id'] && !empty( $k['item_id'] ) ) :
$data[] = array(
'field_id' => $k['item_id'],
'parent' => $k['parent_id']
);
endif;
endforeach;
foreach ( $data as $k => $v ) :
// Update each field with it's new sequence and parent ID
$wpdb->update( $this->field_table_name, array(
'field_sequence' => $k,
'field_parent' => $v['parent'] ),
array( 'field_id' => $v['field_id'] ),
'%d'
);
endforeach;
die(1);
} | [
"public function getSortFields () {}",
"public function getSortFields() {}",
"protected function _sort() {}",
"public function SortList()\r\n\t{\r\n\t\t$sorton = $this->sorton;\r\n\t\t$FieldPara = $this->getFieldArray();\r\n\t\t$ExtraPara = $this->getExtraParamArray();\r\n\r\n\t\tif(isset($sorton) && $sorton != '0')\r\n\t\t{\r\n\t\t\tfor($i=0;$i< count($FieldPara);$i++)\r\n\t\t\t{\r\n\t\t\t\tif($sorton == $FieldPara[$i][3] && $FieldPara[$i][3] != '0'){\r\n\t\t\t\t\t($this->stat==1)? $sort = $FieldPara[$i][0] : $sort = $FieldPara[$i][0].\" DESC\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$sort = $ExtraPara[1];\r\n\t\t}\r\n\t\treturn $sort;\r\n\t}",
"public function sort($fields) {}",
"private function handle_orderby_field() {\n\t\tif (!$this->orderby_field) return;\n\t\tglobal $wpdb;\n\t\t$pattern = '/\\\\s+ORDER\\\\s+BY\\\\s+FIELD\\\\s*\\(\\\\s*([^\\)]+?)\\\\s*\\)/i';\n\t\tif (preg_match($pattern, $this->_query, $match)) {\n\t\t\tglobal $flipped;\n\t\t\t$params = explode(',', $match[1]);\n\t\t\t$params = array_map('trim', $params);\n\t\t\t$tbl_col = array_shift($params);\n\t\t\t$flipped = array_flip($params);\n\t\t\t$tbl_name = substr($tbl_col, 0, strpos($tbl_col, '.'));\n\t\t\t$tbl_name = str_replace($wpdb->prefix, '', $tbl_name);\n\t\t\tif ($tbl_name && in_array($tbl_name, $wpdb->tables)) {\n\t\t\t\t$query = str_replace($match[0], '', $this->_query);\n\t\t\t\t$_wpdb = new PDODB();\n\t\t\t\t$results = $_wpdb->get_results($query);\n\t\t\t\t$_wpdb = null;\n\t\t\t\t/* $compare = function($a, $b) { */\n\t\t\t\t/* \tglobal $flipped; */\n\t\t\t\t/* \treturn $flipped[$a->ID] - $flipped[$b->ID]; */\n\t\t\t\t/* }; */\n\t\t\t\t/* usort($results, $compare); */\n usort($results, array($this, 'orderby_callback'));\n\t\t\t}\n\t\t\t$wpdb->dbh->pre_ordered_results = $results;\n\t\t}\n\t}",
"public function sort_fileds_list()\r\n\t{\r\n\t\tglobal $wpdb;\r\n\r\n\t\t$order = explode(',', $_POST['order']);\r\n\t\t$counter = 0;\r\n\t\t$new_pos = 10;\r\n\r\n\t\t//multi fields\r\n\t\t$custom_form = $_POST[\"uultra_custom_form\"];\r\n\r\n\t\tif($custom_form!=\"\")\r\n\t\t{\r\n\t\t\t$custom_form = 'usersultra_profile_fields_'.$custom_form;\r\n\t\t\t$fields = get_option($custom_form);\r\n\t\t\t$fields_set_to_update =$custom_form;\r\n\r\n\t\t}else{\r\n\r\n\t\t\t$fields = get_option('usersultra_profile_fields');\r\n\t\t\t$fields_set_to_update ='usersultra_profile_fields';\r\n\r\n\t\t}\r\n\r\n\t\t$new_fields = array();\r\n\r\n\t\t$fields_temp = $fields;\r\n\t\tksort($fields);\r\n\r\n\t\tforeach ($fields as $field)\r\n\t\t{\r\n\r\n\t\t\t$fields_temp[$order[$counter]][\"position\"] = $new_pos;\r\n\t\t\t$new_fields[$new_pos] = $fields_temp[$order[$counter]];\r\n\t\t\t$counter++;\r\n\t\t\t$new_pos=$new_pos+10;\r\n\t\t}\r\n\r\n\t\tksort($new_fields);\r\n\r\n\r\n\t\tupdate_option($fields_set_to_update, $new_fields);\r\n\t\tdie(1);\r\n\r\n }",
"function getFieldHeader_sortLink( $fieldName ) {\r\n\t\t$piVars = array();\r\n\t\t$piVars['sort'] = $fieldName . ':' . ( $this->internal['descFlag'] ? 0 : 1 );\t\r\n\t\tif( $this->piVars['pid'] ) { $piVars['pid'] = intval( $this->piVars['pid'] ); }\r\n\t\tif( $this->piVars['sword'] ) { $piVars['sword'] = htmlspecialchars( $this->piVars['sword'] ); }\r\n\t\r\n\t\treturn $this->pi_linkTP_keepPIvars( \r\n\t\t\t$this->pi_getLL( 'list_field_'.$fieldName ),\r\n\t\t\t$piVars,\r\n\t\t\t0,\r\n\t\t\t$GLOBALS['TSFE']->id\r\n\t\t);\r\n\t}",
"public function uultra_sort_user_menu_ajax() \r\n\t{\r\n\t\tglobal $wpdb;\r\n\t\r\n\t\t$order = explode(',', $_POST['order']);\r\n\t\t$counter = 0;\r\n\t\t$new_pos = 10;\r\n\t\t\r\n\t\t$modules = get_option('userultra_default_user_features_custom');\r\n\t\t\r\n\t\t$new_fields = array();\r\n\t\t\r\n\t\t$fields_temp = $modules;\r\n\t\t//ksort($fields);\r\n\t\t\r\n\t\tforeach($modules as $key => $module)\r\n\t\t{\t\t\t\r\n\t\t\t$fields_temp[$order[$counter]][\"position\"] = $new_pos;\t\t\t\t\t\t\r\n\t\t\t$counter++;\r\n\t\t\t$new_pos=$new_pos+10;\r\n\t\t}\r\n\t\t\r\n\t\t$this->sksort($fields_temp,'position', true);\t\r\n\t\t//print_r($fields_temp);\t\t\t\r\n\t\tupdate_option('userultra_default_user_features_custom', $fields_temp);\t\t\r\n\t\tdie();\r\n\t\t\r\n }",
"function getSortingURL($sortingField) {\n \n // sorting for \"rate\"\n if ($sortingField == \"rate\") {\n // first click -> set order to ASC\n if ( @$_REQUEST['sort'] == \"rateASC\" ) { return array('param' => \"sort=rateDESC\", 'class' => \"is-active sortdesc\"); }\n // second click -> set order to DESC\n if ( @$_REQUEST['sort'] == \"rateDESC\" ) { return array('param' => \"sort=rateASC\", 'class' => \"is-active sortasc\"); }\n\n if ( !@$_REQUEST['sort'] || @$_REQUEST['sort'] ) { return array('param' => \"sort=rateASC\", 'class' => \"\"); }\n }\n \n // sorting for \"length\"\n if ($sortingField == \"length\") {\n // first click -> set order to ASC\n if ( @$_REQUEST['sort'] == \"lengthASC\" ) { return array('param' => \"sort=lengthDESC\", 'class' => \"is-active sortdesc\"); }\n // second click -> set order to DESC\n if ( @$_REQUEST['sort'] == \"lengthDESC\" ) { return array('param' => \"sort=lengthASC\", 'class' => \"is-active sortasc\"); }\n\n if ( !@$_REQUEST['sort'] || @$_REQUEST['sort'] ) { return array('param' => \"sort=lengthASC\", 'class' => \"\"); }\n }\n \n // sorting for \"guests\"\n if ($sortingField == \"guests\") {\n // first click -> set order to ASC\n if ( @$_REQUEST['sort'] == \"guestsASC\" ) { return array('param' => \"sort=guestsDESC\", 'class' => \"is-active sortdesc\"); }\n // second click -> set order to DESC\n if ( @$_REQUEST['sort'] == \"guestsDESC\" ) { return array('param' => \"sort=guestsASC\", 'class' => \"is-active sortasc\"); }\n\n if ( !@$_REQUEST['sort'] || @$_REQUEST['sort'] ) { return array('param' => \"sort=guestsASC\", 'class' => \"\"); }\n }\n \n return \"?\";\n }",
"public function sort( $callback );",
"protected function handle_sort() {\n $params = $this->params;\n if (strlen(@$params['xsort']) > 0) {\n $info = array_shift(xUtil::arrize(json_decode(stripslashes($params['xsort']))));\n $property = @$info->property;\n $direction = @$info->direction;\n // Manages substitutions\n // @see self::$sort_fields_substitutions\n if (in_array($property, array_keys($this->sort_fields_substitutions))) {\n // Substitutes field name\n $info = $this->sort_fields_substitutions[$property];\n if (is_array($info)) {\n $property_substitued = @$info['field'];\n $join = @$info['join'];\n } else {\n $property_substitued = $info;\n $join = null;\n }\n if (!$property_substitued) throw new xException(\"Error substituing field ($property_substitued)\");\n $property = $property_substitued;\n // Activates join(s) relative to field (if applicable),\n // preserving already active joins\n if ($join) {\n $params['xjoin'] = array_merge(\n array_keys(xModel::load($this->model, $params)->joins()),\n array_keys(xModel::load($this->model, array('xjoin' => $join))->joins())\n );\n }\n }\n // Adds model parameters\n $params['xorder_by'] = $property;\n $params['xorder'] = $direction;\n unset($params['xsort']);\n // Sets modified parameters\n $this->params = $params;\n }\n }",
"protected function sort_data() {\n if ($this->sorted) {\n return;\n }\n $sort_start_time = microtime(TRUE);\n if (isset($this->sort_callback_lambda)) {\n if (is_array($this->sort_callback_lambda)) {\n $sort_specification = $this->sort_callback_lambda;\n $callback_func = function($a, $b) use ($sort_specification) {\n foreach($sort_specification as $sort_field => $sort_type) {\n if ($sort_type == 'field_settings') {\n $cmp = cmp_in_array($a->get_raw($sort_field), $b->get_raw($sort_field), tags_for_field($sort_field));\n if ($cmp !== 0) {return $cmp;}\n } else if (is_callable(explode(\" \", $sort_type)[0])) {\n $cmp = $sort_type($a->get_raw($sort_field), $b->get_raw($sort_field));\n if ($cmp !== 0) {return $cmp;}\n } else {\n throw new Exception (\"Unavailable sort_type '$sort_type'\");\n }\n }\n };\n uasort($this->data, $callback_func);\n } else if (is_callable($this->sort_callback_lambda)) {\n uasort($this->data, $this->sort_callback_lambda); \n }\n } else if (method_exists($this, \"sort_callback\")) {\n // If a subclass has implemented a `sort_callback()` method.\n uasort($this->data, array($this, \"sort_callback\"));\n }\n $this->sorted = true;\n $end_time = microtime(TRUE);\n benchtime_log(\"sort_callback\", $end_time - $sort_start_time);\n }",
"function get_sort_field() {\n return '';\n }",
"public function getFacetSort($field_override) {}",
"function catalogue_entries_manual_sort($fields, &$entries, $order_by, $direction)\n{\n $num_entries = count($entries);\n\n for ($i = 0; $i < $num_entries; $i++) { // Bubble sort\n for ($j = $i + 1; $j < $num_entries; $j++) {\n if ($order_by == 'distance') {\n $considered_field = 'DISTANCE_PLAIN'; // Not in there by default, but addons might make it\n } else {\n $considered_field = 'FIELD_' . $order_by;\n }\n\n $a = $entries[$j]['map'][$considered_field];\n if (array_key_exists($considered_field . '_PLAIN', $entries[$j]['map'])) {\n $a = $entries[$j]['map'][$considered_field . '_PLAIN'];\n }\n $b = $entries[$i]['map'][$considered_field];\n\n if (array_key_exists($considered_field . '_PLAIN', $entries[$i]['map'])) {\n $b = $entries[$i]['map'][$considered_field . '_PLAIN'];\n }\n if (is_object($a)) {\n $a = $a->evaluate();\n }\n if (is_object($b)) {\n $b = $b->evaluate();\n }\n\n if ((isset($fields[$order_by])) && ($fields[$order_by]['cf_type'] == 'date')) { // Special case for dates\n $bits = explode(' ', $a, 2);\n $date_bits = explode((strpos($bits[0], '-') !== false) ? '-' : '/', $bits[0], 3);\n if (!array_key_exists(1, $date_bits)) {\n $date_bits[1] = date('m');\n }\n if (!array_key_exists(2, $date_bits)) {\n $date_bits[2] = date('Y');\n }\n $time_bits = explode(':', $bits[1], 3);\n if (!array_key_exists(1, $time_bits)) {\n $time_bits[1] = '00';\n }\n if (!array_key_exists(2, $time_bits)) {\n $time_bits[2] = '00';\n }\n $time_a = mktime(intval($time_bits[0]), intval($time_bits[1]), intval($time_bits[2]), intval($date_bits[1]), intval($date_bits[2]), intval($date_bits[0]));\n $bits = explode(' ', $b, 2);\n $date_bits = explode((strpos($bits[0], '-') !== false) ? '-' : '/', $bits[0], 3);\n if (!array_key_exists(1, $date_bits)) {\n $date_bits[1] = date('m');\n }\n if (!array_key_exists(2, $date_bits)) {\n $date_bits[2] = date('Y');\n }\n $time_bits = explode(':', $bits[1], 3);\n if (!array_key_exists(1, $time_bits)) {\n $time_bits[1] = '00';\n }\n if (!array_key_exists(2, $time_bits)) {\n $time_bits[2] = '00';\n }\n $time_b = mktime(intval($time_bits[0]), intval($time_bits[1]), intval($time_bits[2]), intval($date_bits[1]), intval($date_bits[2]), intval($date_bits[0]));\n\n $r = ($time_a < $time_b) ? -1 : (($time_a == $time_b) ? 0 : 1);\n } elseif ($order_by == 'distance') { // By distance\n if (($a === null) || ($b === null)) {\n $r = 0;\n } else {\n $r = (floatval($a) < floatval($b)) ? -1 : 1;\n }\n } else { // Normal case\n $r = strnatcmp(strtolower($a), strtolower($b));\n }\n if ((($r < 0) && ($direction == 'ASC')) || (($r > 0) && ($direction == 'DESC'))) {\n $temp = $entries[$i];\n $entries[$i] = $entries[$j];\n $entries[$j] = $temp;\n }\n }\n }\n\n return $entries;\n}",
"public function getSortFunction();",
"public function update_sorted_rows() {\n\n\t\t// Only run this on the admin side.\n\t\tif ( ! is_admin() ) {\n\t\t\tdie();\n\t\t}\n\n\t\t// Check our various constants.\n\t\tif ( false === $constants = self::check_ajax_constants() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Check for the specific action.\n\t\tif ( empty( $_POST['action'] ) || 'lw_woo_update_sorted_rows' !== sanitize_text_field( $_POST['action'] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Check to see if our sorted data was provided.\n\t\tif ( empty( $_POST['sorted'] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Fetch my existing fields.\n\t\tif ( false === $current = lw_woo_gdpr_optin_fields() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Filter my fields.\n\t\t$fields = array_filter( $_POST['sorted'], 'sanitize_text_field' );\n\n\t\t// Set my new array variable.\n\t\t$update = array();\n\n\t\t// Loop my field IDs to reconstruct the order.\n\t\tforeach ( $fields as $field_id ) {\n\t\t\t$update[ $field_id ] = $current[ $field_id ];\n\t\t}\n\n\t\t// Update our option. // no idea how to use woocommerce_update_options();\n\t\tlw_woo_gdpr()->update_saved_optin_fields( $update, null );\n\n\t\t// Build our return.\n\t\t$return = array(\n\t\t\t'errcode' => null,\n\t\t\t'message' => lw_woo_gdpr_notice_text( 'success' ),\n\t\t);\n\n\t\t// And handle my JSON return.\n\t\twp_send_json_success( $return );\n\t}",
"private function get_row_action_sort_order()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets string representation of date textbox and calendar button. | public function toString($destroy = true) {
$this
->addItem(
(new CTextBox($this->name, $this->value))
->setId($this->name)
->setAttribute('placeholder', $this->placeholder)
->setAttribute('maxlength', strlen(date($this->date_format)))
->setAriaRequired($this->is_required)
->setEnabled($this->enabled)
->setReadonly($this->readonly)
)
->addItem((new CButton($this->name.'_calendar'))
->addClass(ZBX_STYLE_ICON_CAL)
->setEnabled($this->enabled && !$this->readonly)
->onClick('toggleCalendar(this, "'.$this->name.'", "'.$this->date_format.'");'));
return parent::toString($destroy);
} | [
"public function getHtml()\n {\n $input = form_input('date', $this);\n return $input;\n }",
"private function Datetimefield() {\n return '<input class=\"datetimeChooser\" type=\"text\" size=\"' . ($this->DATELENGTH+6) . '\" name=\"' . $this->name . '\" value=\"' . $this->default_value . '\" />' . \"\\n\";\n }",
"abstract protected function get_create_button_text();",
"public function get_button_text();",
"public function createCalendar() : string\n {\n return Formatter::format( $this );\n }",
"public function getdateInput()\n {\n return $this->dateinput;\n }",
"public function get_date_str() {\n\t\t$array = array();\n\t\tif (isset($this->hour) && $this->hour != '') {\n\t\t\t$array[] = 'hour='.$this->hour;\n\t\t}\n\t\tif (isset($this->day) && $this->day != '') {\n\t\t\t$array[] = 'day='.$this->day;\n\t\t}\n\t\tif (isset($this->month) && $this->month) {\n\t\t\t$array[] = 'month='.$this->month;\n\t\t}\n\t\tif (isset($this->year) && $this->year != '') {\n\t\t\t$array[] = 'year='.$this->year;\n\t\t}\n\t\treturn ('&'.implode('&', $array));\n\t}",
"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}",
"public function getDropDownsDateHtml()\n {\n $fieldsSeparator = ' ';\n $fieldsOrder = Mage::getSingleton('catalog/product_option_type_date')->getConfigData('date_fields_order');\n $fieldsOrder = str_replace(',', $fieldsSeparator, $fieldsOrder);\n\n $monthsHtml = $this->_getSelectFromToHtml('month', 1, 12);\n $daysHtml = $this->_getSelectFromToHtml('day', 1, 31);\n\n $yearStart = Mage::getSingleton('catalog/product_option_type_date')->getYearStart();\n $yearEnd = Mage::getSingleton('catalog/product_option_type_date')->getYearEnd();\n $yearsHtml = $this->_getSelectFromToHtml('year', $yearStart, $yearEnd);\n\n $translations = array(\n 'd' => $daysHtml,\n 'm' => $monthsHtml,\n 'y' => $yearsHtml\n );\n return strtr($fieldsOrder, $translations);\n }",
"function dateTimeField()\n\t{\n\t\tPRINT $this->fieldname . ':<br />';\n\t\tPRINT '<input type=text name=\"' . $this->fieldname . '\" value=\"'. $this->fieldData . '\">';\n\t}",
"function calendar() {\n\t\tglobal $root;\n\t\t\n\t\treturn \"<script src=\\\"\" . $root . \"system/javascripts/common/datePicker.js\\\" type=\\\"text/javascript\\\"></script>\n<link rel=\\\"stylesheet\\\" href=\\\"\" . $root . \"system/styles/common/datePicker.css\\\" type=\\\"text/css\\\">\";\n\t}",
"function createCalanderDay($day){\n\n\t$today = $day;\n\t$dayLower = strtolower($today);\n\t$breakfastLabel = $dayLower . \"Breakfast\";\n\t$breakfastDiv = $breakfastLabel . \"Div\";\n\t$lunchLabel = $dayLower . \"Lunch\";\n\t$lunchDiv = $lunchLabel . \"Div\";\n\t$dinnerLabel = $dayLower . \"Dinner\";\n\t$dinnerDiv = $dinnerLabel . \"Div\";\n\n\t$dayString = \"\";\n\t$dayString .= \"<div>\";\n\t$dayString .= \"<fieldset class=\".\"dayField\".\">\";\n\t$dayString .= \"<legend>\" . $day . \"</legend>\";\n\n\t//Breakfast\n\t$dayString .= \"<label for=\" . $breakfastLabel . \">Breakfast</label>\";\n\t$labelValue1 = checkisset($breakfastLabel);\n\t$dayString .= \"<input type=\\\"text\\\" name=\" . $breakfastLabel . \" value=\\\"$labelValue1\\\" class=\\\"recipeInput\\\" maxlength=\\\"50\\\" />\";\n\t$dayString .= \"<div \".\"id=\".$breakfastDiv.\" class=\\\"leftoverDiv\\\"></div>\";\n\n\t//Lunch\n\t$dayString .= \"<label for=\" . $lunchLabel . \">Lunch</label>\";\n\t$labelValue2 = checkisset($lunchLabel);\n\t$dayString .= \"<input type=\\\"text\\\" name=\" . $lunchLabel . \" value=\\\"$labelValue2\\\" class=\\\"recipeInput\\\" maxlength=\\\"50\\\" />\";\n\t$dayString .= \"<div \".\"id=\".$lunchDiv.\" class=\\\"leftoverDiv\\\"></div>\";\n\n\n\t//Dinner\n\t$dayString .= \"<label for=\" . $dinnerLabel . \">Dinner</label>\";\n\t$labelValue3 = checkisset($dinnerLabel);\n\t$dayString .= \"<input type=\\\"text\\\" name=\" . $dinnerLabel . \" value=\\\"$labelValue3\\\" class=\\\"recipeInput\\\" maxlength=\\\"50\\\" />\";\n\t$dayString .= \"<div \".\"id=\".$dinnerDiv.\" class=\\\"leftoverDiv\\\"></div>\";\n\n\t$dayString .= \"</fieldset>\";\n\t$dayString .= \"</div>\";\n\n\treturn $dayString;\n}",
"public function getDropDownsDateHtml()\r\n {\r\n $sortOrder = $this->getRequest()->getParam('sortOrder');\r\n $option = $this->getOption();\r\n $fieldsSeparator = ' ';\r\n $fieldsOrder = $this->_catalogProductOptionTypeDate->getConfigData('date_fields_order');\r\n $fieldsOrder = str_replace(',', $fieldsSeparator, $fieldsOrder);\r\n\r\n $monthsHtml = $this->_getSelectFromToHtml('month', 1, 12).'<input type=\"hidden\" name=\"bss-fastorder-options['.$sortOrder.']['.$option->getId().'][month]\" class=\"bss-customoption-select-month\" value=\"\" />';\r\n $daysHtml = $this->_getSelectFromToHtml('day', 1, 31).'<input type=\"hidden\" name=\"bss-fastorder-options['.$sortOrder.']['.$option->getId().'][day]\" class=\"bss-customoption-select-day\" value=\"\" />';\r\n\r\n $yearStart = $this->_catalogProductOptionTypeDate->getYearStart();\r\n $yearEnd = $this->_catalogProductOptionTypeDate->getYearEnd();\r\n $yearsHtml = $this->_getSelectFromToHtml('year', $yearStart, $yearEnd).'<input type=\"hidden\" name=\"bss-fastorder-options['.$sortOrder.']['.$option->getId().'][year]\" class=\"bss-customoption-select-year bss-customoption-select-last\" value=\"\" />';\r\n\r\n $translations = ['d' => $daysHtml, 'm' => $monthsHtml, 'y' => $yearsHtml];\r\n return strtr($fieldsOrder, $translations);\r\n }",
"protected function MakeDate() {\n $html = '';\n $dateFormat = 'Y-m-d';\n\n if (!$this->id) $this->id = str_replace(array('[',']'), '_', $this->name);\n\n // figure out what the value of the date field should be\n if ($this->value == 'empty' || $this->value === false || strtotime($this->value) === -1 || $this->value == '0000-00-00' || $this->value == '0000-00-00 00:00:00') {\n $this->value = '';\n } else if ($this->value === true || strlen($this->value) == 0) {\n $this->value = date($dateFormat);\n }\n\n if (isset($this->attributes['on_change'])) {\n $onChange = $this->attributes['on_change'];\n unset($this->attributes['on_change']); // remove it so it dosen't get added to the input\n } else {\n $onChange = '';\n }\n\n $html .= '<input type=\"text\" ' . $this->DisplayAttributes() . ' size=\"10\" maxlength=\"10\" value=\"' . substr($this->value, 0, 10) . '\" />' . EOL;\n $html .= <<<EOA\n<script type=\"text/javascript\">\n$(function() {\n $(\"#{$this->id}\").datepicker(){$onChange};\n});\n</script>\nEOA;\n\n $this->html .= $html;\n }",
"function getDayHTML($day){\n\t\t\t\n\t\t$bookings = $this->getBookings($this->resAdmin, '', '', $day, \"\", \"day\");\n\t\t\n\t\t$unix_day = strtotime($day);\n\t\t$prevDay = \"buildFrontDeskView('\".date(\"Y-m-d\", strtotime('-1 day', $unix_day)).\"');\";\n\t\t$nextDay = \"buildFrontDeskView('\".date(\"Y-m-d\", strtotime('+1 day', $unix_day)).\"');\";\n\n\t\t$bookoffs = null;\n\t\tif($this->fd_show_bookoffs){\n\t\t\t$bookoffs = $this->getBookoffs($this->resAdmin, date(\"m\", $unix_day), date(\"y\", $unix_day), date(\"Y-m-d\", $unix_day), \"1\", \"day\");\n\t\t}\n\t\t$statuses = $this->getStatuses();\n\n\t\t$lang = JFactory::getLanguage();\n\t\tsetlocale(LC_TIME, str_replace(\"-\", \"_\", $lang->getTag()).\".utf8\");\n\t\t// on a Windows server you need to spell it out\n\t\t// offical names can be found here..\n\t\t// http://msdn.microsoft.com/en-ca/library/39cwe7zf(v=vs.80).aspx\n\t\t//setlocale(LC_TIME,\"swedish\");\n\t\t// Using the first two letteres seems to work in many cases.\n\t\tif(WINDOWS){\t\n\t\t\tsetlocale(LC_TIME, substr($lang->getTag(),0,2)); \n\t\t}\n\t\t// for Greek you may need to hard code..\n\t\t//setlocale(LC_TIME, array('el_GR.UTF-8','el_GR','greek'));\n\t\t\n\t\tif(WINDOWS){\n\t\t\t$header = iconv(getIconvCharset(), 'UTF-8//IGNORE',strftime($this->week_view_header_date_format, strtotime($day)));\n\t\t} else {\n\t\t\t$header = strftime($this->week_view_header_date_format, strtotime($day));\t\t\n\t\t}\n\n\t\t$s = \"\";\n\t\t$i=1;\n\t\t\n\t\t$array_daynames = getLongDayNamesArray();\n\t\t$s .= \"<div id=\\\"sv_apptpro_front_desk_top\\\">\\n\";\n\t\t$s .= \"<table width=\\\"100%\\\" align=\\\"center\\\" border=\\\"0\\\" class=\\\"calendar_week_view\\\" cellspacing=\\\"0\\\">\\n\";\n\t\t$s .= \" <tr class=\\\"calendar_week_view_header_row\\\">\\n\";\n\t\t$s .= \" <td width=\\\"5%\\\" align=\\\"center\\\" ><input type=\\\"button\\\" onclick=\\\"$prevDay\\\" value=\\\"<<\\\"></td>\\n\";\n\t\t$s .= \" <td style=\\\"text-align:center\\\" class=\\\"calendarHeader\\\" >$header</td>\\n\"; \n\t\t$s .= \" <td width=\\\"5%\\\" align=\\\"center\\\"><input type=\\\"button\\\" onclick=\\\"$nextDay\\\" value=\\\">>\\\"></td>\\n\";\n\t\t$s .= \" </tr>\\n\";\n\t\t// week day\n\t\t$s .= \" <tr>\\n\";\n\t\t$s .= \" <td colspan=\\\"3\\\">\\n\";\n\t\t$s .= \" <table class=\\\"week_day_table\\\" width=\\\"100%\\\" border=\\\"0\\\" cellspacing=\\\"0\\\">\\n\";\n\t\t$k = 0;\n\t\t$seat_tally = 0;\n\t\t$current_ts = \"\";\n\t\t$previous_ts = \"\";\n\t\t$current_res = 0;\n\t\t$previous_res = 0;\n\t\t$initial_pass = true;\n\t\tforeach($bookings as $booking){\n\t\t\tif($this->showSeatTotals == \"true\"){\n\t\t\t\tif($initial_pass){\n\t\t\t\t\t$current_ts = $booking->display_starttime;\n\t\t\t\t\t$previous_ts = $current_ts;\n\t\t\t\t\t$current_res = $booking->res_id;\n\t\t\t\t\t$previous_res = $current_res;\n\t\t\t\t\t$initial_pass = false;\n\t\t\t\t}\n\t\t\t\t$current_ts = $booking->display_starttime;\n\t\t\t\t$current_res = $booking->res_id;\n\t\t\t\tif($current_ts == $previous_ts AND $previous_res == $current_res){\n\t\t\t\t\tif($booking->request_status == 'accepted'){\n\t\t\t\t\t\t$seat_tally += $booking->booked_seats;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t//moved to next timeslot\n\t\t\t\t\t//write summary and move on\n\t\t\t\t\t$s .= \"<tr class='week_row' >\\n\";\n\t\t\t\t\t$s .= \" <td colspan='4' align='right' style=\\\"border-bottom:solid 1px\\\">\".JText::_('RS1_TS_TOTAL_SEATS').\" </td>\\n\";\n\t\t\t\t\t$s .= \" <td width=\\\"5%\\\" align=\\\"center\\\" style=\\\"border-top:solid 1px;border-bottom:solid 1px\\\"> \".$seat_tally.\"</td>\";\n\t\t\t\t\t$s .= \" <td colspan='3' style=\\\"border-bottom:solid 1px\\\" > </td>\\n\";\n\t\t\t\t\t$s .= \"</tr>\\n\";\n\t\t\t\t\t$previous_ts = $current_ts;\n\t\t\t\t\t$seat_tally = $booking->booked_seats;\t\t\t\t\n\t\t\t\t\t$previous_res = $current_res;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif($this->fd_read_only){\n\t\t\t\tif($this->fd_detail_popup){\n\t\t\t\t\t$link = JRoute::_( 'index.php?option=com_rsappt_pro3&controller=admin_detail&task=edit&cid='. $booking->id_requests.'&frompage=front_desk&Itemid='.$this->Itemid). \"&format=readonly class=\\\"modal\\\" rel=\\\"{handler: 'iframe'}\\\" \";\n\t\t\t\t} else {\n\t\t\t\t\t$link = \"'#' onclick=\\\"alert('\".JText::_('RS1_DETAIL_VIEW_DISABLED').\"');return true;\\\" \";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$link \t= JRoute::_( 'index.php?option=com_rsappt_pro3&controller=admin_detail&task=edit&cid='. $booking->id_requests.'&frompage=front_desk&Itemid='.$this->Itemid);\n\t\t\t}\n\n\t\t\t$s .= \"<tr class='week_row'>\\n\";\n\t\t\t$s .= \" <td align=\\\"center\\\"><input type=\\\"checkbox\\\" id=\\\"cb\".$i.\"\\\" name=\\\"cid[]\\\" value=\\\"\".$booking->id_requests.\"\\\" /></td>\\n\";\n\t\t\tif($this->fd_allow_manifest && !$this->mobile){\n\t\t\t\t$s .= \" <td align=\\\"left\\\" width=\\\"10%\\\"><a href=# onclick='goManifest(\\\"\".$booking->resid.\"\\\",\\\"\".$booking->startdate.\"\\\", \\\"\".$booking->starttime.\"\\\", \\\"\".$booking->endtime.\"\\\");return false;' title='\".JText::_('RS1_DAY_VIEW_TIMESLOT_TOOLTIP').\"'>\".$booking->display_starttime.\"</a></td>\\n\";\n\t\t\t} else {\n\t\t\t\t$s .= \" <td align=\\\"left\\\" width=\\\"10%\\\">\".$booking->display_starttime.\"</td>\\n\";\n\t\t\t}\n\t\t\t$s .= \" <td align=\\\"left\\\"> \".JText::_(stripslashes($booking->resname)).\"</td>\\n\";\n\t\t\tif(!$this->mobile){\n\t\t\t\t$s .= \" <td align=\\\"left\\\"> \".JText::_(stripslashes($booking->ServiceName)).\"</td>\\n\";\n\t\t\t}\n\t\t\tif($this->fd_allow_show_seats){\n\t\t\t\t$s .= \" <td width=\\\"5%\\\" align=\\\"center\\\"> \".$booking->booked_seats.\"</td>\\n\";\n\t\t\t}\n\t\t\t$s .= \" <td align=\\\"left\\\"> <a href=\".$link.\" title='\".JText::_('RS1_DAY_VIEW_NAME_TOOLTIP').\"'>\".stripslashes($booking->name).\"</a></td>\\n\";\n\t\t\tif($this->fd_show_contact_info){\n\t\t\t\tif(!$this->mobile){\n\t\t\t\t\t$s .= \" <td align=\\\"left\\\"><a href=\\\"mailto:\".$booking->email.\"\\\">\".$booking->email.\"</a></td>\\n\";\n\t\t\t\t}\n\t\t\t}\n//\t\t\t\t$s .= \" <td align=\\\"center\\\" width=\\\"10%\\\"><span class='color_\".$booking->payment_status.\"'>\".translated_status($booking->payment_status).\"</span></td>\\n\";\n\n\t\t\tif($this->apptpro_config->status_quick_change == \"No\"){\n\t\t\t\t$s .= \" <td align=\\\"center\\\" width=\\\"10%\\\"><span class='color_\".$booking->request_status.\"'>\".translated_status($booking->request_status).\"</span></td>\\n\";\n\t\t\t} else {\n\t\t\t\t$s .= \" <td align=\\\"center\\\">\\n\";\n\t\t\t\t$s .= \" <select id=\\\"booking_status_\".$booking->id_requests.\"\\\" name=\\\"booking_status\".$booking->id_requests.\"\\\" \"; \n\t\t\t\t$s .= \"\t\t\tonfocus=\\\"this.oldvalue = this.value;\\\" onchange=\\\"quick_status_change('\".$booking->id_requests.\"',this); return false;\\\"\";\n\t\t\t\t$s .= \"\t\t\tstyle=\\\"width:auto\\\">\\n\";\n\t\t\t\tforeach($statuses as $status_row){\n\t\t\t\t\t$s .= \"\t\t<option value=\\\"\".$status_row->internal_value.\"\\\" class=\\\"color_\".$status_row->internal_value.\"\\\" \";\n\t\t\t\t\t\tif($booking->request_status == $status_row->internal_value ? $s .=\" selected='selected' \":\"\");\n\t\t\t\t\t\t$s .= \">\".JText::_($status_row->status).\"</option>\\n\";\n\t\t\t\t}\n\t\t\t\t$s .= \"\t\t</select>\\n\";\n\t\t\t\t$s .= \"</td>\\n\";\n\t\t\t}\n\t\t\tif($this->fd_show_financials){\n\t\t\t\t$s .= \" <td align=\\\"right\\\">\".translated_status($booking->payment_status).($booking->invoice_number != \"\"?\"<br/>(\".$booking->invoice_number.\")\":\"\").\"</td>\\n\";\n\t\t\t}\t\t\t\t\t\n\t\t\t$s .= \"</tr>\\n\";\n\t\t\t$i++;\n\t\t}\t\n\t\tif($this->showSeatTotals == \"true\"){\n\t\t\t$s .= \"<tr class='week_row' >\\n\";\n\t\t\t$s .= \" <td colspan='4' align='right' style=\\\"border-bottom:solid 1px\\\">\".JText::_('RS1_TS_TOTAL_SEATS').\" </td>\\n\";\n\t\t\t$s .= \" <td width=\\\"5%\\\" align=\\\"center\\\" style=\\\"border-top:solid 1px;border-bottom:solid 1px\\\"> \".$seat_tally.\"</td>\";\n\t\t\t$s .= \" <td colspan='3' style=\\\"border-bottom:solid 1px\\\" > </td>\\n\";\n\t\t\t$s .= \"</tr>\\n\";\n\t\t}\t\t\t \n\t $s .= \" </table>\\n\";\n\t\t$s .= \" </tr>\\n\";\n\t\t$s .= \"</table>\\n\";\n\t\t$s .= \"</div>\\n\";\n\t\t$s .= \"<input type=\\\"hidden\\\" name=\\\"cur_day\\\" id=\\\"cur_day\\\" value=\\\"\".$day.\"\\\">\";\n\n\t\tif($this->fd_show_bookoffs){\n\t\t\t$strToday = date(\"Y-m-d\", $unix_day);\n\t\t\tforeach($bookoffs as $bookoff){\n\t\t\t\tif($bookoff->off_date == $strToday){\n\t\t\t\t\tif($bookoff->full_day == \"Yes\"){\n\t\t\t\t\t\t$display_timeoff = JText::_('RS1_FRONTDESK_BO_FULLDAY');\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$display_timeoff = $bookoff->display_bo_starttime.\" - \".$bookoff->display_bo_endtime;\n\t\t\t\t\t\tif($bookoff->description != \"\"){\n\t\t\t\t\t\t\t$display_timeoff .= \"\\n\".$bookoff->description;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$s .= \"<br/><label class='calendar_text_bookoff' title='\".$display_timeoff.\"'>\".$bookoff->name.\" - \".$display_timeoff.\"</label>\";\n\t\t\t\t}\n\t\t\t}\t\t\t\t\n\t\t}\n\n\t\tif($this->printerView == \"Yes\"){\n\t\t\t// remove all links\n\t\t\t$s = preg_replace(array('\"<a href(.*?)>\"', '\"</a>\"'), array('',''), $s);\n\t\t}\t\t\t\n\t\treturn $s; \t\n\t}",
"public function getSortedDateInputs()\n {\n $strtr = array(\n '%b' => '%1$s',\n '%B' => '%1$s',\n '%m' => '%1$s',\n '%d' => '%2$s',\n '%e' => '%2$s',\n '%Y' => '%3$s',\n '%y' => '%3$s'\n );\n\n $dateFormat = preg_replace('/[^\\%\\w]/', '\\\\1', $this->getDateFormat());\n\n return sprintf(strtr($dateFormat, $strtr),\n $this->_dateInputs['m'], $this->_dateInputs['d'], $this->_dateInputs['y']);\n }",
"function getButton(){\r\n\t\treturn '';\r\n\t\treturn '<div style=\"width: 45px; height:18px; border:1px ridge #000000; margin:0; ' .\r\n\t\t\t\t'background-color:#' .$this->get(). '; '.\r\n\t\t\t\t'padding:0; float:left;\" ' .\r\n\t\t\t\t'onClick=\"showColorPicker(this,document.forms[0].rgb2)\"' .\r\n\t\t\t\t'>Change</div>';\r\n\t}",
"function getDatesLists() {\n $result = '<dates>'.LF;\n // add date button\n $result .= sprintf(\n '<add href=\"%s\">%s</add>'.LF,\n papaya_strings::escapeHTMLChars(\n $this->contentObj->getLink(array('cmd' => 'add'))\n ),\n papaya_strings::escapeHTMLChars($this->captions['add_date'])\n );\n // created dates list\n $result .= $this->getDatesList(1); // state 1 = created\n $result .= $this->getDatesList(2); // state 2 = published\n $result .= '</dates>'.LF;\n return $result;\n }",
"function createCalendar($attributesInput=array())\r\n\t{\r\n\t\t$cal = \"<input type='text' \". $this->applyAttrs($attributesInput). \"/>\";\t\t\r\n\t\t$cal .= \"<script> $(\\\"input[name='\".$attributesInput[\"name\"].\"']\\\").addClass(\\\"calendar\\\").datepicker({dateFormat: 'dd-mm-yy'}); $(\\\"input[name='\".$attributesInput[\"name\"].\"']\\\").datepicker($.datepicker.regional['es'])</script>\";\r\n\t\treturn $cal;\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
int64 Id of Form Field Set to use with this bundle | public function getFormFieldSetId() {
return @$this->attributes['form_field_set_id'];
} | [
"public function getFormId();",
"public function getId() {\n return $this->formId;\n }",
"public function getFormId() {\n $form_id = 'my_entity_bundle_add_form';\n return $form_id;\n }",
"public function getSetId() {\r\n\t\treturn $this -> setid;\r\n\t}",
"public function getSetId(){\n\t\treturn $this->setid;\n\t}",
"protected function _getIdForm() {\n\t\treturn $this->_idForm;\n\t}",
"public function elemId()\n {\n return \"GBFORM_\".$this->name();\n }",
"function getIdField() {return $this->_idfield;}",
"public function getFormIdField()\n\t{\n\t\treturn $this->__isFormId() ? '<input type=\"hidden\" name=\"' . $this->__form_id . '\">' : '';\n\t}",
"function JSON_ID_Field($module=\"\")\n {\n if (empty($module)) { $module=$this->ModuleName; }\n\n $setup=$this->ApplicationObj()->App_Sigaa_Module_Setup($module);\n return $setup[ \"ID_Field\" ];\n }",
"public function getFormId(): string\n {\n return $this->formId;\n }",
"public function getId_formulario()\r\n\t{\r\n\t\treturn($this->id_formulario);\r\n\t}",
"public function the_form_uniqId()\n {\n $this->form->the_form_uniqId();\n }",
"protected function getFormId(){\n return (\n (\n $this->_id!==NULL &&\n is_string($this->_id) &&\n strlen(trim($this->_id))\n )\n ?$this->_id\n :$this->setFormId()\n );\n }",
"private function _getElemetId(){\n\t\t\n\t\t$this->element ++;\n\t\treturn $this->formId.'_'.$this->element;\n\t\t\t\n\t}",
"public function getFormId()\n {\n return $this->strFormId;\n }",
"public function get_id(){\n return intval($this->get_info('field_id'));\n }",
"function getId() {\n return $this->getFieldValue('id');\n }",
"public function get_set_id()\n {\n return $this->_set_id;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Upload a file directly to the location in the S3 Bucket specified by the key. And return the download url. | public function upload($file, $key, $contentType)
{
$key = $this->pathApppendage.$key;
$result = $this->s3Service->putObject(array(
'Bucket' => $this->bucket,
'Key' => $key,
'Body' => $file,
'ACL' => 'private', //protect access to the uploaded file
'ContentType' => $contentType
));
$command = $this->s3Service->getCommand('GetObject', [
'Bucket' => $this->bucket,
'Key' => $key,
]);
$request = $this->s3Service->createPresignedRequest($command, '+20 minutes');
$url = (string) $request->getUri(); //The S3 download link including the accesstoken
return $url;
} | [
"public function uploadFileToBucket($bucket_name, $source_file, $key){\n\t\tif($bucket_name == '' || $source_file == '' || $key == ''){\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $this->S3Client->putObject(array(\n\t\t\t'Bucket' => $bucket_name,\n\t\t\t'SourceFile' => $source_file,\n\t\t\t'Key' => $key\n\t\t));\n\t}",
"public static function uploadToS3FromUrl(Request $request){\n $url = $request->input('upload_url');\n $file=file_get_contents($url);\n $s3 = \\Storage::disk('s3');\n $filePath = '/support-tickets/'.uniqid().'.'.'jpg';\n if($s3->put($filePath, $file, 'public')){\n $realPath = (self::DEFAULT_AWS_HOST).$filePath;\n return $realPath; //Path from AWS s3\n }\n return false;\n }",
"function submit_file_to_s3_private($bucket_name, $file_location, $region)\n {\n $s3_client = new \\Aws\\S3\\S3Client([\n 'version' => 'latest',\n 'region' => \"$region\"\n ]);\n\n try\n {\n $s3_client->putObject([\n 'Bucket' => $bucket_name,\n 'Key' => basename($file_location),\n 'SourceFile' => $file_location,\n 'ACL' => 'private'\n ]);\n }\n catch(\\Aws\\S3\\Exception\\S3Exception $s3_exception)\n {\n echo \"Failed to upload db back up to $bucket_name in S3\\n\";\n exit(1);\n }\n }",
"public function uploadFileS3bucket($data = array()){\n $this->s3Client->putObject([\n 'Bucket' => $this->bucket,\n 'Key' => $data['dir'] . \"/\" . $data['name'], // aws path to upload\n 'Body' => file_get_contents($data['tmp_name'], false), //remote URL\n 'ContentType' => $data['type'] ?? NULL,\n ]);\n }",
"public function getSignedUrl($bucket_name, $key){\n\t\tif($bucket_name == '' || $key == ''){\n\t\t\treturn false;\n\t\t}\n\n\t\t//$cmd = $this->getObject($bucket_name, $key);\n\t\t//return $cmd->createPresignedUrl('+3 minutes');\n\t\t$command = $this->S3Client->getCommand('GetObject', array(\n 'Bucket' => $bucket_name,\n 'Key' => $key\n ));\n\n\t\t$object = $this->S3Client->createPresignedRequest($command, \"+3 minutes\")->getUri();\n\t\treturn (string)$object;\n\t}",
"function moveFileFromS3Bucket($sourceBucket = null, $targetBucket = null, $sourceKeyName)\n{\n $imagePath = false;\n\n try {\n global $appConfig;\n\n // Instantiate the client.\n $s3 = \\Illuminate\\Support\\Facades\\App::make('aws')->get('s3');\n\n $targetBucket = trim($targetBucket, '/ ');\n\n // Copy an object.\n $status = $s3->copyObject(array(\n 'Bucket' => $targetBucket,\n 'Key' => \"{$sourceKeyName}\",\n 'CopySource' => \"{$sourceBucket}/{$sourceKeyName}\",\n 'ACL' => 'public-read',\n ));\n\n // Check file is copied\n if ($status) {\n $imagePath = 'https://' . $targetBucket . '/' . $sourceKeyName;\n }\n\n return $imagePath;\n\n } catch (Exception $e) {\n die(exception($e));\n }\n}",
"function uploadImgToS3($bucketName, $imgFilePath, $imgName,$existingUrl=''){\n\n\t$client = S3Client::factory(array(\n\t'key' => 'AKIAJ47YDGMMN7RDQCNA',\n\t'secret' => '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'\n\t));\n\tif($existingUrl !=''){\n\t\t$urlExplode = explode(\"cloudhub-europe.s3.amazonaws.com/\",$existingUrl);\n\t\tif(count($urlExplode)>1){\n\t\t\t$uploadImgResult = $client->deleteObject(array(\n\t\t\t\t'Bucket' => $bucketName,\n\t\t\t\t'Key' => $urlExplode[1],\n\t\t\t\t\n\t\t\t));\n\t\t}\n\t}\n\t\n\t// Below block of code is to upload the modified file into S3\n\t\n\t// Upload an object by streaming the contents of a file\n\t// $pathToFile should be absolute path to a file on disk\n\t$uploadImgResult = $client->putObject(array(\n\t\t'Bucket' => $bucketName,\n\t\t'Key' => $imgName,\n\t\t'SourceFile' => $imgFilePath,\n\t\t'ACL' => 'public-read',\n\t));\n\treturn $uploadImgResult;\n}",
"public function upload_local_file()\n\t{\n if ($this->local_file) {\n \t$s3 = AWS::createClient('s3');\n $s3->putObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location,\n 'SourceFile' => $this->local_file,\n 'ContentType' => $this->mime,\n 'StorageClass' => $this->storage,\n 'ServerSideEncryption' => $this->encryption\n )\n );\n }\n\t}",
"public function genUrl($key)\n {\n return \"https://s3-{$this->region}.amazonaws.com/{$this->bucket}/{$key}\";\n }",
"public function checkFileInS3($targetKey)\n {\n $exist = false;\n try {\n $result = $this->s3Instance->getObject(array(\n 'Bucket' => $this->s3Bucket,\n 'Key' => $targetKey,\n ));\n $url = $this->s3Instance->getObjectUrl($this->s3Bucket, $targetKey);\n $exist = true;\n } catch (\\Aws\\S3\\Exception\\S3Exception $e) {\n if ($e->getCode() == 'NoSuchKey') {\n $exist = false;\n } else {\n throw new \\Aws\\S3\\Exception\\S3Exception($e->getMessage(), $e->getCode());\n }\n }\n\n if ($exist) {\n return $url;\n } else {\n return $exist;\n }\n }",
"private function _send_to_s3( $file_path, $file_name ) {\n\n\t\t// Instantiate the class\n\t\t$s3 = new S3( AWS_ACCESS_KEY, AWS_SECRET_KEY );\n\t\t$s3->putObjectFile( $file_path, AWS_BUCKET_NAME, $file_name, S3::ACL_PUBLIC_READ );\n\n\t}",
"function deleteFileFromS3($bucket, $key)\n{\t/*Bucket and key must start with caps*/\n\t$s3Client = getS3Client();\n\treturn $s3Client->deleteObject(array('Bucket'=>$bucket,'Key'=>$key));\n}",
"public function putInBucketFromUrl($bucket_name, $source_url, $local_path, $key, $folder){\n\t\tif($bucket_name == '' || $source_url == '' || $local_path == '' || $key == '' || $folder == ''){\n\t\t\treturn false;\n\t\t}\n\n\t\t$local_path = $local_path.$key;\n\t\t$local_img = file_put_contents($local_path, file_get_contents($source_url));\n\n\t\tif($local_img){\n\t\t\treturn $this->S3Client->putObject(array(\n\t\t\t\t'Bucket' => $bucket_name,\n\t\t\t\t'SourceFile' => $local_path,\n\t\t\t\t'Key' => $folder.$key\n\t\t\t));\n\t\t}\n\n\t\tunlink($local_path);\n\t}",
"public function uploadFile ($path) {\n S3::putObject($this->getFilePath(), $path);\n }",
"public function urlForS3($file_path, $style = null)\r\n {\r\n if (trim($this->s3_bucket) == '') {\r\n throw new RuntimeException('You haven\\'t set an s3_bucket for this object.');\r\n }\r\n \r\n return 'http://' . $this->s3_bucket . '.s3.amazonaws.com/' . (!is_null($style) ? $style . '/' : '') . $file_path;\r\n }",
"private function uploadFileToS3()\n {\n $this->console->writeLine( \"loading new datafile to S3\" );\n\n if( !isset( $this->subscriptionId ) ) {\n throw new \\Exception( \"subscription id is not set\" );\n }\n $this->remoteBucketPath = '/subscription/' . $this->subscriptionId . '/DATA-WAREHOUSE/'\n . $this->builtFilename;\n return $this->s3Uploader->uploadFile( $this->remoteBucketPath, $this->filenamepath );\n }",
"public function uploadPubKey($pubKeyFilePath, $targetFileName);",
"function get_file_from_s3($bucket_name, $key_name, $file_location, $region)\n {\n $s3_client = new \\Aws\\S3\\S3Client([\n 'version' => 'latest',\n 'region' => \"$region\"\n ]);\n\n try\n {\n $s3_client->getObject([\n 'Bucket' => $bucket_name,\n 'Key' => $key_name,\n 'SaveAs' => $file_location\n ]);\n return \"Success\";\n }\n catch(\\Aws\\S3\\Exception\\S3Exception $s3_exception)\n {\n echo \"Failed to get db backup from bucket $bucket_name \" . $s3_exception->getMessage() .\"\\n\";\n return \"Currently no backups exist, please create a DB backup first before trying to restore\";\n }\n }",
"function upload_image($name, $filepath) {\r\n\r\n // Get the $s3 connection\r\n global $s3;\r\n\r\n // Push the image to S3\r\n $result = $s3->putObject([\r\n 'Bucket' => S3_BUCKET,\r\n 'Key' => $name,\r\n // 'Body' => 'test text',\r\n 'SourceFile' => $filepath,\r\n 'ACL' => 'public-read'\r\n ]);\r\n\r\n // Return the public URL\r\n return $result['ObjectURL'];\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the value of descMedicamento | public function setDescMedicamento($descMedicamento)
{
$this->descMedicamento = $descMedicamento;
return $this;
} | [
"function setDescricao( $descricao ) {\n // seta o valor de: descricao\n $this->descricao = $descricao;\n }",
"function setDescricao( $descricao ) {\n $this->descricao = $descricao;\n }",
"public function updateMedico() {\n\t\tif($this->codigo == null) {\n\t\t\treturn \"ERRO: Código do Médico inválido.\";\n\t\t}\n\t\treturn $this->updateMedicoCompleto(\t$this->codigo,\n\t\t\t\t\t\t\t\t\t\t\t$this->nome, \n\t\t\t\t\t\t\t\t\t\t\t$this->senha, \n\t\t\t\t\t\t\t\t\t\t\t$this->cpf,\n\t\t\t\t\t\t\t\t\t\t\t$this->especialidade,\n\t\t\t\t\t\t\t\t\t\t\t$this->planoDeSaude,\n\t\t\t\t\t\t\t\t\t\t\t$this->dtNascimento,\n\t\t\t\t\t\t\t\t\t\t\t$this->endereco,\n\t\t\t\t\t\t\t\t\t\t\t$this->telefone,\n\t\t\t\t\t\t\t\t\t\t\t$this->email\n\t\t);\n\t}",
"function setDescrizione($descrizione) {\r\n $this->descrizione = $descrizione;\r\n }",
"public function set_unidad_medida_descripcion(string $unidad_medida_descripcion) : void {\n $this->unidad_medida_descripcion = $unidad_medida_descripcion;\n }",
"private function setMediaDesc(bool $desc): void\n {\n $this->query->organisation->all_media->attribute('desc', $desc);\n }",
"public function setDesc($desc) {\n\t\t$this->desc = $desc;\n\t}",
"function set_descripcion($descripcion) {\n $this->descripcion = $descripcion;\n }",
"public function setImagem_descricao($imagem_descricao)\n {\n if (!empty($imagem_descricao) && !is_null($imagem_descricao))\n $this->imagem_descricao = $imagem_descricao;\n }",
"function SetDescription($desc){}",
"function setDescription($value) {\n $this->description = $value;\n }",
"function setDescription($value)\n\t{\n\t\t$this->description = $value;\n\t}",
"function setDescription( $value )\r\n {\r\n $this->Description = $value;\r\n }",
"public function usarMedio() {\n $this->usoDeMedio++; \n }",
"public function setGoods_description($value)\r\n {\r\n \t$this->_goods_description = $value;\r\n }",
"public function _setDescripcion($Descripcion)\n\t {\n\t $this->Descripcion = $Descripcion;\n\t }",
"public function setPaymentDesc($value) {\r\n $this->PaymentDesc = $value;\r\n }",
"public function setDescription($value) {\r\n if ($value == null || $value == \"\") $value = \"Expense Item\";\r\n $this->description = $value;\r\n }",
"function setMaDeThi($ma_de_thi){\r\n\t\t$this->ma_de_thi = $ma_de_thi;\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get data for cached ID given | function cacheGet($id)
{
//TODO: implement
} | [
"public function get_data_to_cache();",
"function oop_cache_get_data($cid) {\n return generic_cache_get_data(OOP_DB__CACHE, $cid);\n}",
"public function getCachedData();",
"public function getDataForCache();",
"public function get($id)\r\n {\r\n return $this->memcache->get($id);\r\n }",
"public function fetch($id)\n {\n return $this->cache->get($this->convertCacheIdentifier($id));\n }",
"public function get() {\n\n if(!$this->isAvailable() || $this->isIgnored()) return false;\n\n return $this->data = \\Kirby\\Toolkit\\Cache::get($this->id); \n \n }",
"public static function get($id) {\r\n\t\t\r\n\t\t$file = glob(self::$cachedir . $id . self::$ext);\r\n\t\tif (!count($file)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n $file = array_shift($file);\r\n\t\tif (!$data = file_get_contents($file)) {\r\n\r\n\t\t\tthrow new Exception('Error reading data from cache file.');\r\n\t\t}\r\n\t\treturn unserialize($data);\r\n\t}",
"public function findByIDCached($id) {\r\n\r\n\t\t$key = md5((is_array($id) ? implode('', $id) : $id));\r\n\t\treturn $this->find('all', array(\r\n\t\t\t'conditions' => array($this->name.'.id' => $id),\r\n\t\t\t'cache' => array('key' => $this->name.'.'.$key),\r\n\t\t));\r\n\r\n\t}",
"public function getDataCache()\n {\n $key = $this->generateKey();\n\n return $this->getRepository()->getMongator()->getDataCache()->get($key);\n }",
"public function getFromCacheDtataProvider() {}",
"public function getData()\n\t{\n\t\t$cacheManager = Application::getInstance()->getManagedCache();\n\t\t$result = NULL;\n\t\t\n\t\tif ($cacheManager->read(self::CACHE_TTL, $this->cacheId))\n\t\t{\n\t\t\t$result = $cacheManager->get($this->cacheId);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$result = $this->getDataFromVk();\n\t\t\t\n\t\t\t$cacheManager->set($this->cacheId, $result);\n\t\t}\n\t\t\n\t\treturn $result;\n\t}",
"protected function GetCachedData($key)\n {\n if (is_null($this->MemConnection) === TRUE) {\n $this->library->load->library(\"memlibrary\");\n $this->MemConnection = $this->library->memlibrary;\n return $this->MemConnection->Get($key);\n } else {\n return $this->MemConnection->Get($key);\n }\n }",
"public static function getCacheIdentifier();",
"public function getCacheId();",
"protected function extractDataFromCache() {\n\n }",
"private function getDataFromCache($key = null)\n\t{\n\t\t//in case caching is disabled return null\n\t\tif ($this->isCacheBypassed()) {\n\t\t\treturn null;\n\t\t}\n\n\t\t$data_from_cache = null;\n\t\t$refresh_required = false;\n\n\t\t//get the content of the entire cache storage\n\t\t$cache = $this->getArrayFromJsonFile($this->cache_file);\n\n\t\t//check if the $key was cached previously\n\t\tif (isset($key) && isset($cache[$key])) {\n\t\t\t$data = $cache[$key];\n\n\t\t\tswitch ($key) {\n\t\t\t\tcase 'users': //users have a simple cache structure\n\t\t\t\t\tforeach ($data as $created => $users) {\n\t\t\t\t\t\tif (strtotime($created) >= (time() - $this->options['cache_minutes'] * 60)) {\n\t\t\t\t\t\t\t//found an entry that is still active\n\t\t\t\t\t\t\t$data_from_cache = $users;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t//stale cache entry so can be dropped\n\t\t\t\t\t\t\tunset($cache[$key][$created]);\n\t\t\t\t\t\t\t$refresh_required = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tdefault: //all other cached data is based on the start date and week count\n\t\t\t\t\t$start_length_key = $this->controller->getScheduleStartingDay() . '__' .\n\t\t\t\t\t\t\t\t\t\t$this->controller->getWeeksToShowCount();\n\t\t\t\t\tif (array_key_exists($start_length_key, $data)) {\n\t\t\t\t\t\tif (strtotime($data[$start_length_key]['created']) >= (time() - $this->options['cache_minutes'] * 60)) {\n\t\t\t\t\t\t\t//found an entry that is still active\n\t\t\t\t\t\t\t$data_from_cache = $data[$start_length_key]['content'];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t//stale cache entry so can be dropped\n\t\t\t\t\t\t\tunset($cache[$key][$start_length_key]);\n\t\t\t\t\t\t\t$refresh_required = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t//need to refresh the cache storage to remove expired keys\n\t\tif ($refresh_required) {\n\t\t\t$this->cacheData(null, $cache);\n\t\t}\n\n\t\treturn $data_from_cache;\n\t}",
"public function getObjFromCache($key);",
"public function getMemcacheData() {\n\n \n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Print javascript for footer notice dismiss functionality. | public static function print_footer_script() {
?>
<script>
(function( $ ) {
$( function() {
var rating_wrapper = $( '#rank-math-footer-ask-review' );
$( 'a', rating_wrapper ).on( 'mousedown', function() {
$.ajax({
url: ajaxurl,
data: {
action: 'rank_math_already_reviewed',
security: rankMath.security,
},
});
rating_wrapper.animate({
opacity: 0.01
}, 1500, function() {
rating_wrapper.html( rating_wrapper.data('original-text') ).css( 'opacity', '1' );
});
});
});
})(jQuery);
</script>
<?php
} | [
"public function printScript() {\n\t\t// Create a nonce.\n\t\t$nonce = wp_create_nonce( 'aioseo-dismiss-deprecated-wordpress' );\n\t\t?>\n\t\t<script>\n\t\t\twindow.addEventListener('load', function () {\n\t\t\t\tvar dismissBtn\n\n\t\t\t\t// Add an event listener to the dismiss button.\n\t\t\t\tdismissBtn = document.querySelector('.aioseo-deprecated-wordpress-notice .notice-dismiss')\n\t\t\t\tdismissBtn.addEventListener('click', function (event) {\n\t\t\t\t\tvar httpRequest = new XMLHttpRequest(),\n\t\t\t\t\t\tpostData = ''\n\n\t\t\t\t\t// Build the data to send in our request.\n\t\t\t\t\tpostData += '&action=aioseo-dismiss-deprecated-wordpress-notice'\n\t\t\t\t\tpostData += '&nonce=<?php echo esc_html( $nonce ); ?>'\n\n\t\t\t\t\thttpRequest.open('POST', '<?php echo esc_url( admin_url( 'admin-ajax.php' ) ); ?>')\n\t\t\t\t\thttpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded')\n\t\t\t\t\thttpRequest.send(postData)\n\t\t\t\t})\n\t\t\t});\n\t\t</script>\n\t\t<?php\n\t}",
"public function print_footer_scripts()\n {\n }",
"public function footer()\n {\n if (count($this->js) > 0) {\n foreach ($this->js as $js) {\n ?>\n <script src=\"<?= $js ?>\"></script>\n <?php\n }\n }\n ?>\n </body></html>\n <?php\n }",
"public function show_footer() {\n\t\tif ( empty( $this->popups ) ) { return; }\n\n\t\t$code = '';\n\t\t$data = $this->get_popup_data();\n\t\tforeach ( $data as $ind => $item ) {\n\t\t\t$code .= $item['html'];\n\t\t}\n\t\techo '' . $code;\n\t}",
"function HideCookieLawInfoInFooter(): string {\n return <<<'END_OF_CSS'\n\n<style>\n #cookie-law-info-bar, #cookie-law-info-again, .cli-modal-dialog,\n .cli-modal-backdrop {\n display: none;\n }\n</style>\n\nEND_OF_CSS;\n}",
"public static function print_inline_js_action() {\n\t\t\t?>\n\t\t\t<script type=\"text/javascript\">\n\t\t\t\tjQuery(function($) {\n\t\t\t\t\t$('#setting-error-tgmpa .notice-dismiss').unbind().on('click.the7.tgmpa.dismiss', function(event) {\n\t\t\t\t\t\tlocation.href = $('#setting-error-tgmpa a.dismiss-notice').attr('href');\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t</script>\n\t\t\t<?php\n\t\t}",
"public static function print_footer_scripts() {\r\n\t\techo self::get_footer_scripts_text();\r\n\t}",
"function showFooter()\n{\n\t$this->layout=false;\n\t$this->autoRender=false;\n\t$this->Cookie->delete('footer');\n\texit;\n}",
"private function destroy_notice()\n {\n ee()->javascript->output(array(\n 'window.setTimeout(function(){$.ee_notice.destroy()}, 4000);'\n ));\n }",
"function dotdigital_action_footer_scripts()\t{\n\t\tif (function_exists('fw_get_db_customizer_option')) {\n\t\t\t$tracking_scripts = fw_get_db_customizer_option('tracking_scripts_bottom', '');\n\t\t\tif (!empty($tracking_scripts)) {\n\t\t\t\tforeach ($tracking_scripts as $script) {\n\t\t\t\t\tif (isset($script['script']) && !empty($script['script'])) {\n\t\t\t\t\t\techo '<!-- wp_footer TS -->'. $script['script'] .'<!-- End wp_footer TS -->';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}",
"public function add_dismiss_script() {\r\n\t\tif ( $this->is_white_label_account() ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif ( ! rocket_is_live_site() ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif ( ! $this->should_display_notice() ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$nonce = wp_create_nonce( 'rocketcdn_dismiss_notice' );\r\n\t\t?>\r\n\t\t<script>\r\n\t\twindow.addEventListener( 'load', function() {\r\n\t\t\tvar dismissBtn = document.querySelectorAll( '#rocketcdn-promote-notice .notice-dismiss, #rocketcdn-promote-notice #rocketcdn-learn-more-dismiss' );\r\n\r\n\t\t\tdismissBtn.forEach(function(element) {\r\n\t\t\t\telement.addEventListener( 'click', function( event ) {\r\n\t\t\t\t\tvar httpRequest = new XMLHttpRequest(),\r\n\t\t\t\t\t\tpostData = '';\r\n\r\n\t\t\t\t\tpostData += 'action=rocketcdn_dismiss_notice';\r\n\t\t\t\t\tpostData += '&nonce=<?php echo esc_attr( $nonce ); ?>';\r\n\t\t\t\t\thttpRequest.open( 'POST', '<?php echo esc_url( admin_url( 'admin-ajax.php' ) ); ?>' );\r\n\t\t\t\t\thttpRequest.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded' )\r\n\t\t\t\t\thttpRequest.send( postData );\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t});\r\n\t\t</script>\r\n\t\t<?php\r\n\t}",
"function print_footer_scripts() {}",
"function tlc_small_business_vat_notice_footer() {\n\t$shipping_page_slug = 'lieferung';\n\t$shipping_page = tlc_get_page_by_slug( $shipping_page_slug );\n\t\n\t?>\n\t<div id=\"tlc_small_business_vat_notice_footer\" class=\"tlc_small_business_vat_notice_footer\">\n\t <div class=\"col-full\">\n\t\t\t<em>\n\t\t\t\t<?php\n\t\t\t\tif ( !is_null( $shipping_page ) )\n\t\t\t\t\tprintf( __( '* All stated prices are final prices excl. <a href=\"%s\">Shipping</a>, exempt from VAT according to Art. 19 of the German VAT law (UStG).', 'thelittlecraft' ), esc_url( get_page_link( $shipping_page ) ) );\n\t\t\t\telse \n\t\t\t\t\techo( __( '* All stated prices are final prices excl. Shipping, exempt from VAT according to Art. 19 of the German VAT law (UStG).', 'thelittlecraft' ) );\n\t\t\t\t?>\n\t\t\t</em>\n\t </div>\n\t</div>\n\t<!-- #small_business_vat_notice_footer -->\n\t<?php\n}",
"public function footer_scripts() {\n\n\t\tif(!empty($this->element_footer_scripts)){\n\t\t\techo \"<script type=\\\"text/javascript\\\">\\r\\n\";\n\t\t\t\tforeach($this->element_footer_scripts as $script){\n\t\t\t\t\techo $script.\"\\r\\n\";\n\t\t\t\t}\n\t\t\techo \"</script>\\r\\n\";\n\t\t}\n\t}",
"function prism_belowfooter() {\n do_action('prism_belowfooter');\n}",
"function iframe_footer() {}",
"function comment_warning_footer() {\r\n\t// add warning to footer for everything that's not a page or post (and to front page if static)\r\n\tif ( (!is_single()&&!is_page()) || (is_front_page()) ){\r\n\t\tglobal $comment_warning;\r\n\t\techo $comment_warning;\r\n\t}\r\n\t// add JavaScript to all pages that are triggered (work for above and comment_warning function)\r\n\techo '\r\n\t<script type=\"text/javascript\">\r\n\t\tjQuery().ready(function($){\r\n\t\t\t$(\\'div#dialog\\').hide();\r\n\t\t\t$(\\'div#dialog\\').jqm({modal:true});\r\n\t\t\t$(\\'div#dialog\\').jqmShow();\r\n\t\t\t$(document).keydown( function( e ) {\r\n\t\t\t\tif( e.which == 27) { // escape, close box\r\n\t\t\t\t\t$(\".jqmWindow\").jqmHide();\r\n\t\t\t\t}\r\n\t\t\t}); \r\n\t\t});\r\n\t</script>\r\n\t';\r\n}",
"public function closemarketing_footer_admin() {\n\t\techo 'Closemarketing - Diseño y Marketing ' . esc_html( date( 'Y' ) );\n\t\techo '. Realizado sobre Gestor Contenidos WordPress.';\n\t}",
"public function footer()\r\n {\r\n print file_get_contents(_HTML_TEMPLATE_FOLDER_.'footer.html');\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function compares the provided value to TRUE using the strict equality operator and outputs the value and whether it is considered true | function outputStrictTruth($value)
{
dump($value);
echo ($value === true) ? "TRUE" : "FALSE";
echo PHP_EOL . "--------------------------------" . PHP_EOL;
} | [
"function is_true($value)\n{\n\tif($value === 1 OR $value === '1' OR $value === TRUE)\n\t{\n\t\treturn TRUE;\n\t}\n\n\treturn FALSE;\n}",
"public function isTrue(): bool\n {\n return true === $this->value;\n }",
"function is_true($value) {\r\n\treturn (($value === true) || ($value === 1) || ($value === \"1\") || ($value === \"true\"));\r\n}",
"protected final function AssertTrue( $value, $strict = true )\n {\n $this->observer->OnAssert();\n\n if( $strict )\n {\n $result = ( $value === true );\n }\n else\n {\n $result = ( $value == true );\n }\n\n Core::Assert( $result, var_export( $value, true ) . ' is not true' );\n }",
"public static function isValidValue($value, bool $strict = true): bool;",
"public function isTrue($value, $message) \n {\n return Testing::truthyness(true, $value, $message, '==');\n }",
"function isTrue($value): bool\n{\n return is_bool($value) && $value === true;\n}",
"function outputLooseTruth($value)\n{\n dump($value);\n\n echo ($value == true) ? \"TRUE\" : \"FALSE\";\n\n echo PHP_EOL . \"--------------------------------\" . PHP_EOL;\n}",
"public function isEqual($value1, $value2): bool;",
"public static function equal($value, $value1)\n {\n return ($value == $value1)?:false;\n }",
"static public function getTrueValue()\n {\n return static::TRUE_VALUE;\n }",
"public function isTrue ($value, $message) {\n return Assert::truthyness(true, $value, $message, '==');\n }",
"function toBool($sValue) {\n\tif(is_numeric($sValue)){\n\t\treturn ((int)$sValue == 1)? TRUE : FALSE;\n\t}//end if\n\telse{\n\t\treturn NULL;\n\t}//end else\n}",
"public function containsSame(mixed $value): bool\n {\n return $this->isOk() && $this->value === $value;\n }",
"public function isSame($value)\n {\n return $this->value === $value;\n }",
"public function _boolval($value) : bool {\n if($value instanceof SandboxedString){\n return (bool)strval($value);\n }\n return is_bool($value) ? $value : (bool)$value;\n }",
"static public function isTrue($value)\n {\n return \\WPRSS_FTP_Utils::multiboolean($value) || (trim($value) === static::getTrueValue());\n }",
"public static function toBoolean( $value ) { return forward_static_call('Cast::toBoolean', $value); }",
"public function test($value): bool\n {\n return false === $value;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks the given priority value for validity. Throws an exception if invalid. | private function checkPriority($priority) {
if ( !in_array($priority, array(self::PRIORITY_LOW, self::PRIORITY_NORMAL, self::PRIORITY_HIGH)) )
throw new \InvalidArgumentException("Invalid priority");
} | [
"protected function validatePriority($priority)\n {\n if (!is_int($priority) || $priority < 0 || $priority > 191) {\n throw new SyslogException('Invalid priority value ' . $priority);\n }\n }",
"public static function validatePriority($priority) {\n if (!self::isValidPriority($priority)) {\n throw new Exception('Unknown priority: ' . $priority);\n }\n }",
"private function validatePriority($priority) {\r\n\t\tif(empty($priority) || ($priority <= 1 AND $priority >= 0 )) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\ttrigger_error(\"Priority $priority is invalid for sitemaps\", E_USER_WARNING);\r\n\r\n\t\treturn false;\r\n\t}",
"public function testPriorityMaxValid() {\n\t\t$value = 4;\n\t\t$this->task->Priority = $value;\n\t\t$this->assertEquals($this->task->getPriority(), $value);\n\t}",
"function testValidPriority() {\n $goodPriority = new Task();\n\n $goodPriority->priority = 3;\n $this->assertEquals(3, $goodPriority->priority);\n\n $goodPriority->priority = 2;\n $this->assertEquals(2, $goodPriority->priority);\n\n $goodPriority->priority = 1;\n $this->assertEquals(1, $goodPriority->priority);\n }",
"public function testPriority(){\n //invalid value should not change its default value\n $this->CI->task->priority = 4;//greater\n $this->assertNull($this->CI->task->priority, 'test >= 4');\n \n //invalid value type should not change its default value\n $this->CI->task->priority = 'text';\n $this->assertNull($this->CI->task->priority, 'test non-integer');\n \n //valid value\n $this->CI->task->priority = 3;\n $this->assertEquals(3, $this->CI->task->priority);\n \n }",
"public function testSetPriorityInvalid()\n {\n $this->class->set_priority('cow');\n\n $value = $this->get_reflection_property_value('elements');\n\n $this->assertArrayHasKey('priority', $value);\n $this->assertEquals('high', $value['priority']);\n }",
"public static function validatePriority()\n\t{\n\t\treturn array(\n\t\t\tnew Main\\Entity\\Validator\\Length(null, 1),\n\t\t);\n\t}",
"protected static function validateValue($value) {\n parent::validateValue($value);\n if ((int)$value <= 0 || (!\\is_int($value) && !\\ctype_digit($value))) {\n throw new \\InvalidArgumentException('Invalid value');\n }\n }",
"public function validateXmlMapPriority($value, array $context = [])\n {\n $value = (float) LocalizationUtility::convertFromLocalizedValue($value, 'float');\n return $value >= 0 && $value <= 1;\n }",
"private function validateActionValue(): void\n {\n if (!$this->value) {\n throw new \\DomainException('Please, declare the action value');\n }\n\n $isBinary = $this->value == 1 || $this->value % 2 == 0;\n if (!$isBinary) {\n throw new \\DomainException('Invalid value number. Please, insert a binary number.');\t\t\t\n }\n }",
"public function validate($value, $type)\n {\n switch ($value) {\n case 'newest':\n case 'oldest':\n case 'relevance':\n return true;\n break;\n default:\n throw new \\Exception(\"The order type values are not correct $type\");\n }\n }",
"public function testPriorityHaveToBeAnInteger()\n {\n //TODO\n }",
"protected function priority_set( $key, $priority )\r\n\t{\r\n\t\t// is priority null?\r\n\t\tif ( null === $priority ) {\r\n\t\t\t// yep, unset it completely\r\n\t\t\tunset( $this->priority_table[ $key ] );\r\n\t\t} else {\r\n\t\t\t// is priority an integer?\r\n\t\t\tif ( is_integer( $priority ) ) {\r\n\t\t\t\t// set priority for key\r\n\t\t\t\t$this->priority_table[ $key ] = $priority;\r\n\t\t\t\t// force resort\r\n\t\t\t\t$this->priority_resort = true;\r\n\t\t\t} else {\r\n\t\t\t\t// invalid priority\r\n\t\t\t\tthrow new InvalidArgumentException( __( 'Priority must be an integer', 'wp-sdl' ) );\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"abstract protected function validateValue($value);",
"public function validateValue($value)\n {\n }",
"public function setPriority($priority);",
"abstract public function isValueValid($value);",
"public function testValidatorRejectsValueThatIsGreaterThanTheComparedOne()\n {\n $this->assertFalse($this->validator->isValid(7, 6));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Removes all entries that don't exist anymore in the imports, for a specific import type. | function drush_excel_import_clean($import_type_id = NULL) {
// Loads all entities for the specified import type.
$query = new EntityFieldQuery();
$query->entityCondition('entity_type', ImportFileEntity::ENTITY_TYPE)
->entityCondition('bundle', ImportFileEntity::BUNDLE)
->entityCondition('field_import_type', $import_type_id);
$results = $query->execute();
$import_file_ids = array_keys($results[ImportFileEntity::ENTITY_TYPE]);
$import_files = entity_load(ImportFileEntity::ENTITY_TYPE, $import_file_ids);
module_load_include('inc', 'excel_import', 'includes/excel_import.clean');
// Run the import cleaner for all the imported entities.
foreach ($import_files as $import_file) {
$wrapper = entity_metadata_wrapper(ImportFileEntity::ENTITY_TYPE, $import_file);
$import_status = $wrapper->field_import_status->value();
// Ensure the entity was successfully imported before cleaning.
if($import_status == 'imported') {
$import_source = $wrapper->field_import_source->value();
// Ensure the imported file exists.
$exists = false;
if ($import_source == 'url') {
$import_file_entity = $wrapper->field_import_url->value();
$import_file_url = $import_file_entity['url'];
$file_headers = @get_headers($import_file_url);
if($file_headers && $file_headers[0] != 'HTTP/1.1 404 Not Found') {
$exists = true;
}
}
else {
$import_file_entity = $wrapper->field_import_file->value();
if (isset($import_file_entity['uri']) && file_exists($import_file_entity['uri'])) {
$exists = true;
}
}
if ($exists) {
$import_type = $wrapper->field_import_type->value();
$mapping_entity = excel_import_load_mapping($import_type);
// Set error for mapping definition if there is none defined.
if (empty($mapping_entity)) {
return drush_set_error('error', dt('A mapping should be defined for the import type id @import_type_id, before import run.', array('@import_type_id' => $import_type_id)));
}
$mapping_wrapper = entity_metadata_wrapper(MappingEntity::ENTITY_TYPE, $mapping_entity);
$mapping_data = $mapping_wrapper->field_mapping->value();
$destination_data = $wrapper->field_import_type->field_destination_bundle->value();
$uri = excel_import_get_uri($import_file);
$context = [
'uri' => $uri,
'entity_type' => $destination_data['entity_type'],
'bundle' => $destination_data['bundle'],
'mapping' => $mapping_data,
'import_file' => $import_file,
];
excel_import_do_clean($context);
}
}
}
} | [
"function cleanImportTables(){\n\t\t\n\t\t$tables = $this->getImportTables();\n\t\t$app =& Dataface_Application::getInstance();\n\t\t$garbageLifetime = $app->_conf['garbage_collector_threshold'];\n\t\tforeach ($tables as $table){\n\t\t\t$matches =array();\n\t\t\tif ( preg_match('/^'.$this->tablename.'__import_(\\d+)_(\\d)$/', $table, $matches) ){\n\t\t\t\tif ( time() - intval($matches[1]) > intval($garbageLifetime) ){\n\t\t\t\t\t$res = mysql_query(\"DROP TABLE `$table`\", $this->db);\n\t\t\t\t\tif ( !$res ){\n\t\t\t\t\t\ttrigger_error(\"Problem occurred attemtping to clean up old import table '$table'. MySQL returned an error: \".mysql_error($this->db).\"\\n\".Dataface_Error::printStackTrace(), E_USER_ERROR);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function clearImport()\n {\n if ($this->sessionManager->has('import-result-status')) {\n $this->removeImportDirectory();\n $this->endImport();\n }\n }",
"public function clear_import_statuses()\n {\n }",
"protected function removeSysFileReferenceRecordsFromImportDataWithRelationToMissingFile() {}",
"public function clearImportFiles()\r\n\t{\r\n\t\t$importdir = IEM_STORAGE_PATH . '/import';\r\n\r\n\t\t// Since this might not necessarily a failure (No import have been done before)\r\n\t\tif (!is_dir($importdir)) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\r\n\t\t$handle = @opendir($importdir);\r\n\t\tif (!$handle) {\r\n\t\t\ttrigger_error(__CLASS__ . '::' . __METHOD__ . ' -- Unable to read import directory', E_USER_WARNING);\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$cutoff_time = time() - self::IMPORT_EXPIRY_TIME;\r\n\r\n\t\twhile (false !== ($file = @readdir($handle))) {\r\n\t\t\tif ($file{0} == '.') {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\t$filedate = @filemtime($importdir . '/' . $file);\r\n\t\t\tif ($filedate === false) {\r\n\t\t\t\ttrigger_error(__CLASS__ . '::' . __METHOD__ . ' -- Unable to obtain import file timestamp', E_USER_WARNING);\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tif ($filedate < $cutoff_time) {\r\n\t\t\t\tif (!unlink($importdir . '/' . $file)) {\r\n\t\t\t\t\ttrigger_error(__CLASS__ . '::' . __METHOD__ . ' -- Unable to delete old import file', E_USER_WARNING);\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t@closedir($handle);\r\n\r\n\t\treturn true;\r\n\t}",
"public function afterImportCollects()\n {\n $schema = DataObject::getSchema()->manyManyComponent(Collection::class, 'Products');\n if (isset($schema['join']) && $join = $schema['join']) {\n DB::query(\"DELETE FROM `$join` WHERE `Imported` = 0\");\n }\n }",
"public function clearImportCache($file = null)\n {\n if ($file === null)\n {\n $this->importCache = [];\n\n return;\n }\n\n unset($this->importCache[$file]);\n }",
"function import_delete_metas()\n{\n\tglobal $spipbb_import;\n\n\tif (isset($GLOBALS['meta']['spipbb_import']) or isset($GLOBALS['spipbb_import'])) {\n\t\tinclude_spip('inc/meta');\n\t\teffacer_meta('spipbb_import');\n\t\tecrire_metas();\n\t\tunset($GLOBALS['spipbb_import']);\n\t\tunset($GLOBALS['meta']['spipbb_import']);\n\t\tunset($spipbb_import);\n\t\tspipbb_log('OK',3,\"A_i_delete_metas\");\n\t}\n}",
"public function clearTypes(): void\n {\n $this->types = [];\n }",
"public function clearCache()\r\n\t{\r\n\t\t// below is all legacy now\r\n\t\tglobal $G_CACHE_ANTOBJTYPES;\r\n\t\t$this->cache->remove($this->dbh->dbname.\"/objectdefs/\".$this->otid);\r\n\t\t$this->cache->remove($this->dbh->dbname.\"/objectdefs/\".$this->object_type.\"/base\"); // purge revision\r\n\t\t$this->cache->remove($this->dbh->dbname.\"/objects/gen/\".$this->object_type); // purge revision\r\n\t\t$G_CACHE_ANTOBJTYPES[$this->dbh->dbname][$this->object_type] = null;\r\n\r\n\t\tforeach ($this->fields as $field)\r\n\t\t{\r\n\t\t\tif ($field['id'])\r\n\t\t\t{\r\n\t\t\t\t$this->cache->remove($this->dbh->dbname . \"/objectdefs/fielddefaults/\" . $this->otid . \"/\" . $field['id']);\r\n\t\t\t\t$G_CACHE_ANTOBJFDEFS[$this->dbh->dbname.\"_fld_\".$field['id']] = null;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tAntObjectDefLoader::getInstance($this->dbh)->clearDef($this->object_type);\r\n\t}",
"public function actionCleanUpModelImport() {\n unset($_SESSION['tags']);\n unset($_SESSION['override']);\n unset($_SESSION['comment']);\n unset($_SESSION['leadRouting']);\n unset($_SESSION['createRecords']);\n unset($_SESSION['imported']);\n unset($_SESSION['failed']);\n unset($_SESSION['created']);\n unset($_SESSION['importMap']);\n unset($_SESSION['offset']);\n unset($_SESSION['metaData']);\n unset($_SESSION['fields']);\n unset($_SESSION['x2attributes']);\n unset($_SESSION['model']);\n if (file_exists($path = $this->safePath('data.csv'))) {\n unlink($path);\n }\n if (file_exists($path = $this->safePath('importMapping.json'))) {\n unlink($path);\n }\n }",
"protected function _removeOldAssets()\n\t{\n\t\t$types = array('css', 'js');\n\t\tforeach ($types as $type)\n\t\t{\n\t\t\t$jsonFile = JPATH_ROOT . '/media/plg_shlib/dist/' . $type . '/version.json';\n\t\t\tif (file_exists($jsonFile))\n\t\t\t{\n\t\t\t\t$rawJson = file_get_contents($jsonFile);\n\t\t\t\t$decoded = json_decode($rawJson, true);\n\t\t\t\t$currentVersion = empty($decoded) ? '' : $decoded['currentVersion'];\n\t\t\t\tif (!empty($currentVersion))\n\t\t\t\t{\n\t\t\t\t\tjimport('joomla.filesystem.folder');\n\t\t\t\t\t$folders = JFolder::folders(JPATH_ROOT . '/media/plg_shlib/dist/' . $type, '^[0-9]{8,25}$');\n\t\t\t\t\tforeach ($folders as $folder)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($folder != $currentVersion)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tJFolder::delete(JPATH_ROOT . '/media/plg_shlib/dist/' . $type . '/' . $folder);\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}",
"function remove_product_types( $types ){\n unset( $types['grouped'] );\n unset( $types['external'] );\n\n return $types;\n}",
"function remove_product_types( $types ){\n unset( $types['grouped'] );\n unset( $types['external'] );\n unset( $types['variable'] );\n\n return $types;\n}",
"public function clearTypeDescriptors()\n {\n $this->typeDescriptors = array();\n }",
"public function cleanLogsTable()\n\t{\n\t\t$daysOld = Carbon::now()->subDays(1);\n\t\t$imports = AppLog::where('created_at', '<=', $daysOld)->where('type', 'import')->orWhere('type', 'trash')->delete();\n\t}",
"public function cleanupRegistryFiles() {\n $storage = \\Drupal::entityTypeManager()->getStorage('registry_file');\n $ids = $storage->getQuery()->condition('id', 'bdd_', 'STARTS_WITH')->execute();\n if (!empty($ids)) {\n $entities = $storage->loadMultiple($ids);\n $storage->delete($entities);\n }\n }",
"protected function removeDeleted() {\n // Delete entries where deleted = 1.\n $this->db->delete($this->import_table)\n ->condition('deleted', '1')\n ->execute();\n }",
"protected function _deleteImport()\n {\n $process = $this->_db->getTable('Process')->find($this->_processId);\n $args = $process->getArguments();\n \n // Delete the items.\n $zoteroImportItems = $this->_db->getTable('ZoteroImportItem')->findByImportId($args['zoteroImportId']);\n foreach ($zoteroImportItems as $zoteroImportItem) {\n if ($zoteroImportItem->item_id) {\n $item = $this->_db->getTable('Item')->find($zoteroImportItem->item_id);\n $item->delete();\n }\n $zoteroImportItem->delete();\n }\n \n // Delete the collection.\n $collection = $this->_db->getTable('Collection')->find($args['collectionId']);\n $collection->delete();\n \n // Delete the import.\n $import = $this->_db->getTable('ZoteroImportImport')->find($args['zoteroImportId']);\n $import->delete();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ removed argument 2 ($post_id) from function extend_downloads_columns below did this because it was causing the admin page to fall down the second arg wasn't being used so instead of returning something that doesn't appear to be needed I've removed it. This argument is in the function that follows | function extend_downloads_columns( $column ) {
$column['download_shortcode'] = 'Download Shortcode';
$column['download_count'] = 'Download Count';
return $column;
} | [
"function da_display_download_attachments( $post_id = 0, $args = array() ) {\n\t$post_id = $post_id !== null ? ( (int) ( empty( $post_id ) ? get_the_ID() : $post_id ) ) : $post_id;\n\n\t$options = Download_Attachments()->options;\n\n\t$defaults = array(\n\t\t'container'\t\t\t\t => 'div',\n\t\t'container_class'\t\t => 'download-attachments',\n\t\t'container_id'\t\t\t => '',\n\t\t'style'\t\t\t\t\t => isset( $options['display_style'] ) ? esc_attr( $options['display_style'] ) : 'list',\n\t\t'link_before'\t\t\t => '',\n\t\t'link_after'\t\t\t => '',\n\t\t'content_before'\t\t => '',\n\t\t'content_after'\t\t\t => '',\n\t\t'display_index'\t\t\t => isset( $options['frontend_columns']['index'] ) ? (int) $options['frontend_columns']['index'] : Download_Attachments()->defaults['general']['frontend_columns']['index'],\n\t\t'display_user'\t\t\t => isset( $options['frontend_columns']['author'] ) ? (int) $options['frontend_columns']['author'] : Download_Attachments()->defaults['general']['frontend_columns']['author'],\n\t\t'display_icon'\t\t\t => isset( $options['frontend_columns']['icon'] ) ? (int) $options['frontend_columns']['icon'] : Download_Attachments()->defaults['general']['frontend_columns']['icon'],\n\t\t'display_count'\t\t\t => isset( $options['frontend_columns']['downloads'] ) ? (int) $options['frontend_columns']['downloads'] : Download_Attachments()->defaults['general']['frontend_columns']['downloads'],\n\t\t'display_size'\t\t\t => isset( $options['frontend_columns']['size'] ) ? (int) $options['frontend_columns']['size'] : Download_Attachments()->defaults['general']['frontend_columns']['size'],\n\t\t'display_date'\t\t\t => isset( $options['frontend_columns']['date'] ) ? (int) $options['frontend_columns']['date'] : Download_Attachments()->defaults['general']['frontend_columns']['date'],\n\t\t'display_caption'\t\t => isset( $options['frontend_content']['caption'] ) ? (int) $options['frontend_content']['caption'] : Download_Attachments()->defaults['general']['frontend_content']['caption'],\n\t\t'display_description'\t => isset( $options['frontend_content']['description'] ) ? (int) $options['frontend_content']['description'] : Download_Attachments()->defaults['general']['frontend_content']['description'],\n\t\t'display_empty'\t\t\t => 0,\n\t\t'display_option_none'\t => __( 'No attachments to download', 'download-attachments' ),\n\t\t'use_desc_for_title'\t => 0,\n\t\t'exclude'\t\t\t\t => '',\n\t\t'include'\t\t\t\t => '',\n\t\t'title'\t\t\t\t\t => __( 'Attachments', 'download-attachments' ),\n\t\t'title_container'\t\t => 'h3',\n\t\t'title_class'\t\t\t => 'attachments-title',\n\t\t'posts_per_page'\t\t => ( isset( $args['number_of_posts'] ) ? (int) $args['number_of_posts'] : -1 ),\n\t\t'offset'\t\t\t\t => 0,\n\t\t'orderby'\t\t\t\t => 'menu_order',\n\t\t'order'\t\t\t\t\t => 'asc',\n\t\t'echo'\t\t\t\t\t => 1\n\t);\n\n\t$args = apply_filters( 'da_display_attachments_defaults', wp_parse_args( $args, $defaults ), $post_id );\n\n\t$args['display_index'] = apply_filters( 'da_display_attachments_index', (int) $args['display_index'] );\n\t$args['display_user'] = apply_filters( 'da_display_attachments_user', (int) $args['display_user'] );\n\t$args['display_icon'] = apply_filters( 'da_display_attachments_icon', (int) $args['display_icon'] );\n\t$args['display_count'] = apply_filters( 'da_display_attachments_count', (int) $args['display_count'] );\n\t$args['display_size'] = apply_filters( 'da_display_attachments_size', (int) $args['display_size'] );\n\t$args['display_date'] = apply_filters( 'da_display_attachments_date', (int) $args['display_date'] );\n\t$args['display_caption'] = apply_filters( 'da_display_attachments_caption', (int) $args['display_caption'] );\n\t$args['display_description'] = apply_filters( 'da_display_attachments_description', (int) $args['display_description'] );\n\t$args['display_empty'] = (int) apply_filters( 'da_display_attachments_empty', (int) $args['display_empty'] );\n\t$args['use_desc_for_title'] = (int) $args['use_desc_for_title'];\n\t$args['echo'] = (int) $args['echo'];\n\t$args['style'] = in_array( $args['style'], array_keys( Download_Attachments()->display_styles ), true ) ? $args['style'] : $defaults['style'];\n\t$args['orderby'] = in_array( $args['orderby'], array( 'menu_order', 'ID', 'date', 'title', 'size', 'downloads' ), true ) ? $args['orderby'] : $defaults['orderby'];\n\t$args['posts_per_page'] = (int) $args['posts_per_page'];\n\t$args['offset'] = (int) $args['offset'];\n\t$args['order'] = in_array( strtolower( $args['order'] ), array( 'asc', 'desc' ), true ) ? $args['order'] : $defaults['order'];\n\t$args['link_before'] = trim( $args['link_before'] );\n\t$args['link_after'] = trim( $args['link_after'] );\n\t$args['display_option_none'] = ( $info = trim( $args['display_option_none'] ) ) !== '' ? $info : $defaults['display_option_none'];\n\n\t$args['title'] = apply_filters( 'da_display_attachments_title', trim( $args['title'] ) );\n\n\t$args['attachments'] = da_get_download_attachments( $post_id, apply_filters(\n\t\t'da_display_attachments_args', array(\n\t\t\t'include'\t\t => $args['include'],\n\t\t\t'exclude'\t\t => $args['exclude'],\n\t\t\t'orderby'\t\t => $args['orderby'],\n\t\t\t'order'\t\t\t => $args['order'],\n\t\t\t'posts_per_page' => $args['posts_per_page'],\n\t\t\t'offset'\t\t => $args['offset']\n\t\t)\n\t) );\n\n\t$args['count'] = count( $args['attachments'] );\n\n\tif ( $args['style'] === 'dynatable' ) {\n\t\twp_register_script( 'download-attachments-dynatable-js', DOWNLOAD_ATTACHMENTS_URL . '/assets/jquery-dynatable/jquery.dynatable.js', array( 'jquery' ) );\n\t\twp_enqueue_script( 'download-attachments-frontend-dynatable', DOWNLOAD_ATTACHMENTS_URL . '/js/frontend.js', array( 'jquery', 'download-attachments-dynatable-js' ) );\n\t\twp_localize_script(\n\t\t\t'download-attachments-frontend-dynatable',\n\t\t\t'daDynatableArgs',\n\t\t\tapply_filters(\n\t\t\t\t'da_display_attachments_dynatable_args',\n\t\t\t\tarray(\n\t\t\t\t\t'features'\t=> array(\n\t\t\t\t\t\t'paginate'\t\t=> true,\n\t\t\t\t\t\t'sort'\t\t\t=> true,\n\t\t\t\t\t\t'pushState'\t\t=> true,\n\t\t\t\t\t\t'search'\t\t=> true,\n\t\t\t\t\t\t'recordCount'\t=> true,\n\t\t\t\t\t\t'perPageSelect'\t=> true\n\t\t\t\t\t),\n\t\t\t\t\t'inputs'\t=> array(\n\t\t\t\t\t\t'recordCountPlacement'\t\t=> 'after',\n\t\t\t\t\t\t'paginationLinkPlacement'\t=> 'after',\n\t\t\t\t\t\t'paginationPrev'\t\t\t=> __( 'Previous', 'download-attachments' ),\n\t\t\t\t\t\t'paginationNext'\t\t\t=> __( 'Next', 'download-attachments' ),\n\t\t\t\t\t\t'paginationGap'\t\t\t\t=> array( 1, 2, 2, 1 ),\n\t\t\t\t\t\t'searchPlacement'\t\t\t=> 'before',\n\t\t\t\t\t\t'perPagePlacement'\t\t\t=> 'before',\n\t\t\t\t\t\t'perPageText'\t\t\t\t=> __( 'Show', 'download-attachments' ) . ': ',\n\t\t\t\t\t\t'recordCountText'\t\t\t=> __( 'Showing', 'download-attachments' ) . ' ',\n\t\t\t\t\t\t'processingText'\t\t\t=> __( 'Processing', 'download-attachments' ). '...'\n\t\t\t\t\t),\n\t\t\t\t\t'dataset'\t=> array(\n\t\t\t\t\t\t'perPageDefault'\t=> 5,\n\t\t\t\t\t\t'perPageOptions'\t=> array( 5, 10, 25, 50 ),\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t}\n\n\tob_start();\n\n\tda_get_template( 'attachments-' . $args['style'] . '.php', $args );\n\n\t$html = ob_get_contents();\n\n\tob_end_clean();\n\n\tif ( $args['echo'] === 1 )\n\t\techo apply_filters( 'da_display_attachments', $html );\n\telse\n\t\treturn apply_filters( 'da_display_attachments', $html );\n}",
"function bml_posts_custom_columns( $column_name, $id ){\n if ( $column_name === 'my_post_thumbs' ){\n echo the_post_thumbnail( 'admin_thumb' );\n }\n }",
"function dfcg_image_column_contents( $column_name, $post_id ) {\r\n \r\n\tglobal $dfcg_baseimgurl, $dfcg_options, $dfcg_postmeta;\r\n \r\n\t// Check we're only messing with my column\r\n\tif( $column_name !== 'dfcg_image_column' ) return;\r\n \r\n\t// First see if we are using Featured Images for the DCG\r\n\tif( $dfcg_options['image-url-type'] == \"auto\" ) {\r\n \t\r\n\t\t// Grab the manual override URL if it exists\r\n if( $image = get_post_meta( $post_id, $dfcg_postmeta['image'], true ) ) {\r\n \r\n \t$image = $dfcg_baseimgurl . $image;\r\n\t\t\techo '<a href=\"'.$image.'\" class=\"thickbox\" title=\"DCG Metabox URL Override: '.$image.'\">DCG Metabox image</a>';\r\n\t\t\techo '<br /><i>'.__('Featured image is overridden by DCG Metabox image.', DFCG_DOMAIN).'</i><br />';\r\n \t\r\n\t\t\treturn;\t\r\n } \r\n \t\r\n \t\r\n // No override, so show the featured image\r\n\t\t$img = dfcg_get_featured_image( $post_id );\r\n\t\t\t\r\n\t\t//$thumb = get_the_post_thumbnail( $post_id, 'DCG Thumb 100x75 TRUE' );\r\n\t\t\t\r\n\t\tif( $img ) {\r\n\t\t\t\r\n\t\t\t$img_title = 'Featured Image. Size of DCG version: '.$img['w'].'x'.$img['h'].' px';\r\n\t\t\t$info = '(DCG gallery dimensions are '.$dfcg_options['gallery-width'].'x'.$dfcg_options['gallery-height'].' px)';\r\n\t\t\t\t\r\n\t\t\techo '<a href=\"'.$img['src'].'\" class=\"thickbox\" title=\"'.$img_title.' '.$info.'\">';\r\n\t\t\tthe_post_thumbnail( 'DCG_Thumb_100x75_true' );\r\n\t\t\techo '</a><br />';\r\n\t\t\techo 'Featured image';\r\n\t\t} else {\r\n\t\t\techo '<i>' . __('Featured image not set', DFCG_DOMAIN) . '</i>';\r\n }\r\n\t\t\r\n\t// We're using FULL or Partial manual images\r\n\t} else {\r\n\t\t\r\n\t\techo 'DCG Metabox URL:<br />';\r\n\t\t\t\r\n\t\tif( $image = get_post_meta( $post_id, $dfcg_postmeta['image'], true ) ) {\r\n\t\t\t$image = $dfcg_baseimgurl . $image;\r\n\t\t\techo '<a href=\"'.$image.'\" class=\"thickbox\" title=\"DCG Metabox URL: '.$image.'\">'.$image.'</a>';\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\techo '<i>' . __('Not found', DFCG_DOMAIN) . '</i>';\r\n\t\t\t\r\n\t\t}\r\n\t}\r\n}",
"function populate_page_columns($column,$post_id){\n\n //featured image column\n if($column == 'page_featured_image'){\n //if this page has a featured image\n if(has_post_thumbnail($post_id)){\n $page_featured_image = get_the_post_thumbnail($post_id,'icon');\n echo $page_featured_image;\n }else{\n echo '—';\n }\n }\n\n //page template column\n if($column == 'page_template'){\n //get the current page template being used for the page \n $page_template_name = get_post_meta( $post_id, '_wp_page_template', true ); \n //get a listing of all of the page templates for our site\n $page_templates = get_page_templates();\n if(in_array($page_template_name,$page_templates)){\n //search through each template\n foreach($page_templates as $key => $value){\n //if the template matches our current template, we found it\n if($page_template_name == $value){\n echo $key . ''; \n }\n } \n }else{\n echo 'Default';\n } \n }\n\n //page content column\n if($column == 'page_content'){\n\n //get the page based on its post_id\n $page = get_post($post_id);\n if($page){\n //get the main content area\n $page_content = apply_filters('the_content', $page->post_content); \n echo $page_content;\n }\n }\n if($column == 'id'){\n echo $post_id;\n } \n}",
"function manage_wp_posts_be_qe_manage_posts_columns( $columns, $post_type ) {\n\t/*if ( $post_type == 'movies' ) {\n\t\t$columns[ 'release_date' ] = 'Release Date';\n\t\t$columns[ 'coming_soon' ] = 'Coming Soon';\n\t\t$columns[ 'film_rating' ] = 'Film Rating';\n\t}\n\t\t\n\treturn $columns;*/\n\t\n\t/**\n\t * The second example adds our new column after the �Title� column.\n\t * Notice that we're specifying a post type because our function covers ALL post types.\n\t */\n\tswitch ( $post_type ) {\n\t\n\t\tcase 'mg_task':\n\t\t\n\t\t\t// building a new array of column data\n\t\t\t$new_columns = array();\n\t\t\t\n\t\t\tforeach( $columns as $key => $value ) {\n\t\t\t\n\t\t\t\t// default-ly add every original column\n\t\t\t\t$new_columns[ $key ] = $value;\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * If currently adding the title column,\n\t\t\t\t * follow immediately with our custom columns.\n\t\t\t\t */\n\t\t\t\tif ( $key == 'title' ) {\n\t\t\t\t\t$new_columns[ 'mg_status' ] = 'Status';\n\t\t\t\t\t$new_columns[ 'issue_type' ] = 'Issue Type';\n\t\t\t\t\t$new_columns[ 'priority' ] = 'Priority';\n\t\t\t\t\t$new_columns[ 'estimated_time' ] = 'Estimated Time';\n\t\t\t\t\t$new_columns[ 'project' ] = 'Project';\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\treturn $new_columns;\n\t\t\t\n\t}\n\t\n\treturn $columns;\n\t\n}",
"function customColumnContent($column_name, $post_ID)\n\t{\n\t\t\n\t\tswitch ($column_name)\n\t\t{\n\t\t\tcase \"shortcode\":\t\t\t\n\t\t\techo '[imperial-document-upload id='.$post_ID.']';\n\t\t\tbreak;\n\t\t\t\n\t\t\t\n\t\t\tcase \"submissions\":\n\t\t\t\n\n\t\t\t\techo '<a href=\"options.php?page=imperial-doc-submissions&ID='.$post_ID.'\"><i class=\"fas fa-file-upload\"></i> Submissions</a>';\n\n\t\t\t\n\t\t\tbreak;\t\t\t\n\n\t\t\t\n\t\t}\n\t\t\n\t\t\t\n\t}",
"function post_columns( $columns ) {\n\t// Remove unnecessary columns\n\tunset( $columns['tags'] );\n\tunset( $columns['comments'] );\n\tunset( $columns['wpseo-score'] );\n\n\t// Add in our modified columns\n\t$columns['modified'] = 'Last Modified';\n\t$columns['wpseo-score']\t= 'SEO'; // Adding this back in, but at the very end\n\n\treturn $columns;\n}",
"function wpex_staff_archive_columns() {\n return get_theme_mod( 'staff_entry_columns', '3' );\n}",
"function combined_downloads($post_id)\r\n{\r\n global $wpdb;\r\n return $wpdb->get_var($wpdb->prepare(\r\n \"SELECT SUM( meta_value ) FROM $wpdb->postmeta AS m\r\n LEFT JOIN $wpdb->posts AS p \r\n ON m.post_id = p.ID\r\n INNER JOIN {$wpdb->prefix}p2p AS r \r\n ON m.post_id = r.p2p_to \r\n WHERE m.meta_key = '_download_count'\r\n AND p.post_type='dlm_download' \r\n AND p.post_status = 'publish'\r\n AND r.p2p_from = %d\r\n \", $post_id));\r\n}",
"function ale_admin_table_columns() {\n\tif (function_exists('aletheme_get_post_types')) {\n\t\tforeach (aletheme_get_post_types() as $type => $config) {\n\t\t\tif (isset($config['columns']) && count($config['columns'])) {\n\t\t\t\tforeach ($config['columns'] as $column) {\n\t\t\t\t\tif (function_exists('ale_admin_posts_' . $column . '_column_head') && function_exists('ale_admin_posts_' . $column . '_column_content')) {\n\t\t\t\t\t\tadd_filter('manage_' . $type . '_posts_columns', 'ale_admin_posts_' . $column . '_column_head', 10); \n\t\t\t\t\t\tadd_action('manage_' . $type . '_posts_custom_column', 'ale_admin_posts_' . $column . '_column_content', 10, 2);\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}\n}",
"function ysg_posts_columns( $column, $post_id ) {\n switch ( $column ) {\n \tcase 'ysg_image':\n\t\t\t$ysgGetId = get_post_meta($post_id, 'valor_url', true );\n\t\t\t$ysgPrintId = ysg_youtubeEmbedFromUrl($ysgGetId);\n\t\t\techo sprintf( '<a href=\"%1$s\" title=\"%2$s\">', admin_url( 'post.php?post=' . $post_id . '&action=edit' ), get_the_title() );\n\t\t\tif ( has_post_thumbnail()) { \n\t\t\t\tthe_post_thumbnail(array(150,90)); \n\t\t\t}else{\n\t\t\t\techo '<img title=\"'. get_the_title().'\" alt=\"'. get_the_title().'\" src=\"http://img.youtube.com/vi/' . $ysgPrintId .'/mqdefault.jpg\" width=\"150\" height=\"90\" />';\t\n\t\t\t}\n\t\t\techo '</a>';\n break;\n\n case 'ysg_title':\n echo sprintf( '<a href=\"%1$s\" title=\"%2$s\">%2$s</a>', admin_url( 'post.php?post=' . $post_id . '&action=edit' ), get_the_title() );\n break;\n \n case \"ysg_categories\":\n\t\t$ysgTerms = get_the_terms($post_id, 'youtube-videos');\n\t\tif ( !empty( $ysgTerms ) )\n\t\t{\n\t\t\t$ysgOut = array();\n\t\t\tforeach ( $ysgTerms as $ysgTerm )\n\t\t\t\t$ysgOut[] = '<a href=\"edit.php?post_type=youtube-gallery&youtube-videos=' . $ysgTerm->slug . '\">' . esc_html(sanitize_term_field('name', $ysgTerm->name, $ysgTerm->term_id, 'youtube-videos', 'display')) . '</a>';\n\t\t\techo join( ', ', $ysgOut );\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo __( 'Sem Categoria', 'youtube-simple-gallery' );\n\t\t}\n\t\tbreak;\n\t\t\t\n case 'ysg_url':\n $idvideo = get_post_meta($post_id, 'valor_url', true ); \n echo ! empty( $idvideo ) ? sprintf( '<a href=\"%1$s\" target=\"_blank\">%1$s</a>', esc_url( $idvideo ) ) : '';\n break;\n }\n}",
"function add_post_columns ( $columns ) {\n return array_merge ( $columns, array ( \n 'designation' => __ ( 'Designation' ),\n 'featured_image' => 'Image'\n ) );\n }",
"function az_add_thumbnail_column( $columns ) {\n\n global $post;\n\n $col_thumb = array( 'thumbnail' => __( 'Thumbnail', 'textdomain' ) );\n $columns = array_slice( $columns, 0, 2, true ) + $col_thumb + array_slice( $columns, 1, NULL, true );\n\n return $columns;\n\n}",
"function tcb_add_post_thumbnail_column($cols){\n $cols['tcb_post_thumb'] = __('Image Preview');\n return $cols;\n}",
"function wp_review_add_admin_columns() {\n\t$post_types = get_post_types( array( 'public' => true ), 'names' );\n\t$excluded_post_types = apply_filters( 'wp_review_excluded_post_types', array( 'attachment' ) );\n\t$allowed_post_types = array_diff( $post_types, $excluded_post_types );\n\tforeach ( $allowed_post_types as $key => $value ) {\n\t\t// Add post list table column.\n\t\tadd_filter( 'manage_' . $value . '_posts_columns', 'wp_review_post_list_column' );\n\t\t// Post list table column content.\n\t\tadd_action( 'manage_' . $value . '_posts_custom_column', 'wp_review_post_list_column_content', 10, 2 );\n\t}\n}",
"function manage_wp_posts_be_qe_manage_posts_columns_zapasy( $columns, $post_type ) {\n\tif ( $post_type == 'klub' ) {\n\t\t//$columns[ 'release_date' ] = 'Release Date';\n\t\t//$columns[ 'coming_soon' ] = 'Coming Soon';\n\t\t//$columns[ 'skore_win' ] = 'Skóre W';\n //$columns[ 'skore_lose' ] = 'Skóre L';\n\t\n\t}\t\n\treturn $columns;\n\t\n\t/**\n\t * The second example adds our new column after the �Title� column.\n\t * Notice that we're specifying a post type because our function covers ALL post types.\n\t */\n\tswitch ( $post_type ) {\n\t\n\t\tcase 'zapas':\n\t\t\n\t\t\t// building a new array of column data\n\t\t\t$new_columns = array();\n\t\t\t\n\t\t\tforeach( $columns as $key => $value ) {\n\t\t\t\n\t\t\t\t// default-ly add every original column\n\t\t\t\t$new_columns[ $key ] = $value;\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * If currently adding the title column,\n\t\t\t\t * follow immediately with our custom columns.\n\t\t\t\t */\n\t\t\t\tif ( $key == 'title' ) {\n\t\t\t\t\t$new_columns[ 'klub_sezona' ] = 'Sezóna';\n\t\t\t\t\t$new_columns[ 'home_klub_win' ] = 'Výhry';\n\t\t\t\t\t$new_columns[ 'home_klub_lose' ] = 'Prohry';\n $new_columns[ 'klub_points' ] = 'Body';\n $new_columns[ 'skore_win' ] = 'Skóre W';\n $new_columns[ 'skore_lose' ] = 'Skóre L';\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\treturn $new_columns;\n\t\t\t\n\t}\n\t\n\treturn $columns;\n\t\n}",
"function attachCustomColumnsToClass( $column, $postId ){\n if( method_exists( $this->attached_class, 'column_' . $column ) ) {\n echo $this->attached_class->{'column_' . $column}($postId);;\n } elseif( method_exists( $this->attached_class, 'column_default' ) ){\n echo $this->attached_class->column_default($postId, $column);\n }\n }",
"function show_suppliers_custom_columns( $column, $post_id){\r\n\t\trequire('include/suppliers_list_extra_columns.php');\r\n\t}",
"function bannerman_custom_column($column_name) {\n global $post;\n\n if ($column_name == 'banner') {\n echo \"<a href='\", get_edit_post_link($post->ID), \"'>\", get_the_post_thumbnail($post->ID, 'banners-list-thumbnail'), \"</a>\";\n }\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Bookings needing approval are listed. | public function testBookingsNeedingApprovalAreListed(): void
{
$this->approvalIsRequired();
$approver = User::factory()->create();
$group = Group::factory()->hasAttached($approver, [], 'approvers')->create();
$booking = Booking::factory()
->for(User::factory()->hasAttached($group))
->create();
$this->actingAs($approver)->get('approvals')
->assertOk()
->assertSeeText($booking->user->name);
} | [
"public function get_bookings() {\n\t\treturn $this->bookings;\n\t}",
"public function showAllApprovedBookings()\n {\n $approved_bookings = Bookings::where('patient','=',Auth::user()->name)->where('status','=','approved')->latest()->paginate(10);\n return view('patients.bookings.approved',compact('approved_bookings'));\n }",
"public function allApprovedDrPatientBookings(Request $request)\n {\n $approved_bookings = Bookings::where('patient','=',Auth::user()->name)->where('status','=','approved')->get();\n if(!$approved_bookings)\n {\n $request->session()->flash('error','No Approved Bookings yet');\n return redirect()->back();\n }\n else\n {\n $booking_count = count($approved_bookings);\n if($booking_count > 0)\n {\n return view('patients.sidebar',compact('booking_count'));\n }\n else\n {\n return false;\n }\n }\n }",
"public function getBookingsAction()\n\t{\n\t\tif ($this->request->hasPost('token')) {\n\t\t\tif ($auth = AuthTokens::findFirstByToken($this->request->getPost('token'))) {\n\n\t\t\t\t// Sort all of the bookings\n\t\t\t\t$bookings = [];\n\t\t\t\tforeach(Bookings::findByUserId($auth->authUserId) as $booking) {\n\t\t\t\t\t$bookings[] = [\n\t\t\t\t\t\t'id' => $booking->bkId,\n\t\t\t\t\t\t'date' => $booking->bkDate,\n\t\t\t\t\t\t'title' => $booking->trips->tripName\n\t\t\t\t\t];\n\t\t\t\t}\n\n\t\t\t\t// Send the bookings as a json response\n\t\t\t\treturn $this->reply->asJson([\n\t\t\t\t\t'success' => true,\n\t\t\t\t\t'message' => '',\n\t\t\t\t\t'bookings' => $bookings\n\t\t\t\t]);\n\t\t\t} else {\n\t\t\t\treturn $this->reply->withFail(Response::ERROR_INVALID_AUTH);\n\t\t\t}\n\t\t} else {\n\t\t\treturn $this->reply->withFail(Response::ERROR_INVALID_PARAMS);\n\t\t}\n\t}",
"public function getBookings()\n {\n\n $from = Util::getLatestRequestTime('booking');\n $to = Util::getNowTime();\n\n $client = new Client([\n 'base_uri' => $this->baseUrl,\n 'timeout' => $this->timeout\n ]);\n\n $url = $this->apiURL . 'bookings?from=' . $from . '&to=' . $to . '&with_items=true';\n\n $response = $client->request('GET', $url, [\n 'headers' => [\n 'Authorization' => $this->apiKey\n ]\n ]);\n\n $this->saveRequestTime($this->apiKey, 'booking');\n \n Booking::saveNewBookings($response->getBody());\n BookingItem::saveItems($response->getBody());\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 testApproverDontGetNotifiedTwiceAboutSamePendingBooking(): void\n {\n $this->approvalIsRequired();\n\n $approver = User::factory()->create();\n $group = Group::factory()->hasAttached($approver, [], 'approvers')->create();\n\n Booking::factory()\n ->count(2)\n ->for(User::factory()->hasAttached($group))\n ->create();\n\n $this->assertCount(1, $approver->notifications);\n }",
"public function maybe_complete_bookings() {\n\t\t\t// If Bookings isn't active, exit.\n\t\t\tif ( ! class_exists( 'WC_Bookings' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Get any bookings that have completed before now.\n\t\t\t$booking_ids = WC_Booking_Data_Store::get_booking_ids_by( [\n\t\t\t\t'status' => get_wc_booking_statuses( 'scheduled' ),\n\t\t\t\t'date_before' => current_time( 'timestamp' ),\n\t\t\t] );\n\n\t\t\tif ( count( $booking_ids ) > 0 ) {\n\t\t\t\t// Get the Cron manager object and mark the bookings as complete.\n\t\t\t\t$cron_manager = new WC_Booking_Cron_Manager();\n\t\t\t\tforeach( $booking_ids as $id ) {\n\t\t\t\t\t$cron_manager->maybe_mark_booking_complete( $id );\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"function cbone_listing_brochures_approval($nid){\n\tglobal $user;\n\t//Select order_id of listing.\n\t$query = db_select('field_data_field_lms_listing_reference', 'lms')\n\t\t->fields('lms', array('entity_id'))\n\t\t->condition('field_lms_listing_reference_nid', $nid, '=')\n\t\t->condition('entity_type', 'commerce_order', '=')\n\t\t->condition('bundle', 'commerce_order', '=');\n\t$order_id = $query->execute()->fetchField();\n\t//Select All node of mc_pdf\n\t/*$query = db_select('field_data_field_lms_listing_reference', 'lms')\n\t\t->fields('lms', array('entity_id'))\n\t\t->condition('field_lms_listing_reference_nid', $nid, '=')\n\t\t->condition('entity_type', 'node', 'LIKE')\n\t\t->condition('bundle', 'mc_pdf', 'LIKE');\n\t$result = $query->execute();*/\n\t$query = db_select('field_data_field_lms_listing_reference', 'lms');\n\t$query->join('field_data_field_template_reference', 'tr', 'lms.entity_id = tr.entity_id');\n\t$query->join('field_data_field_pdf_section', 'ps', 'ps.entity_id = tr.field_template_reference_nid');\n\t$query->fields('lms', array('entity_id'))\n\t\t->condition('lms.field_lms_listing_reference_nid', $nid, '=')\n\t\t->condition('lms.entity_type', 'node', 'LIKE')\n\t\t->condition('lms.bundle', 'mc_pdf', 'LIKE')\n\t\t->condition('ps.field_pdf_section_value', 'pro brochure', 'LIKE');\n\t$result = $query->execute();\n\t$nids = array();\n\tforeach($result as $value){\n\t\t$nids[] = $value->entity_id;\n\t}\n\t//Listing Address\n\t$listing_node = node_load($nid);\n\t$address = array();\n\tif(isset($listing_node->field_lms_listing_address['und']['0']['value'])) {\n\t\t$address[] = $listing_node->field_lms_listing_address['und']['0']['value'];\n\t}\n\tif(isset($listing_node->field_lms_address_unit['und']['0']['value'])) {\n\t\t$address[] = $listing_node->field_lms_address_unit['und']['0']['value'];\n\t}\n\tif(isset($listing_node->field_lms_listing_city['und']['0']['value'])) {\n\t\t$address[] = $listing_node->field_lms_listing_city['und']['0']['value'];\n\t}\n\tif(isset($listing_node->field_lms_listing_state['und']['0']['value'])) {\n\t\t$address[] = $listing_node->field_lms_listing_state['und']['0']['value'];\n\t}\n\tif(isset($listing_node->field_lms_listing_zip['und']['0']['value'])) {\n\t\t$address[] = $listing_node->field_lms_listing_zip['und']['0']['value'];\n\t}\n\t$listing_address = implode(', ', $address);\n\t\t\n\t$variables = array(\n\t\t'listing_nid' => $nid,\n\t\t'listing_address' => $listing_address,\n\t\t'nids' => $nids,\n\t\t'order_id' => $order_id,\n\t);\n\t$output = theme('listing_brochures_approval', array('var_name' => $variables));\n\treturn $output;\n}",
"public function testApproverGetsNotifiedAboutNewBooking(): void\n {\n $this->approvalIsRequired();\n\n $approver = User::factory()->create();\n $approver->notify(new BookingAwaitingApproval());\n $approver->notifications()->update(['created_at' => now()->subHour(), 'read_at' => now()]);\n\n $group = Group::factory()->hasAttached($approver, [], 'approvers')->create();\n\n Booking::factory()\n ->for(User::factory()->hasAttached($group))\n ->create();\n\n $this->assertCount(2, $approver->notifications);\n }",
"function ovr_display_bookings(){\r\n\r\n\tovr_show_appointmenst_html(false,false,true);\t\r\n\r\n}",
"public function forUpLinesApproval()\n {\n if(auth()->user()->hasRole(['Finance Admin']))\n {\n return CommissionRequest::where('status','for review')->get();\n }\n\n return collect($this->getCommissionRequests())->filter(function($value, $key){\n\n if(collect($value->approval)->where('id',auth()->user()->id)->whereNull('approval')->count() > 0)\n return $value->approval;\n });\n }",
"public function getHotelApprovedBookings($hotelID)\n {\n }",
"public function approveAll()\r\n {\r\n foreach ($this->prList as $pr) {\r\n $this->logger->debug(sprintf('Approving %d', $pr['number']));\r\n $this->approvePR($pr);\r\n }\r\n }",
"public function testBookingsAreAvailable()\n {\n $user = factory(User::class)->create();\n $booking = factory(Booking::class)->create([\n 'user_id' => $user->id,\n ]);\n\n $this->actingAs($user)\n ->get('profile/bookings')\n ->assertSuccessful()\n ->assertSee($booking->resource->name);\n }",
"function get_bookings(){\n\t\t$bookings = array();\n\t\tforeach( $this->get_event()->get_bookings()->bookings as $EM_Booking ){\n\t\t\tforeach($EM_Booking->get_tickets_bookings()->tickets_bookings as $EM_Ticket_Booking){\n\t\t\t\tif( $EM_Ticket_Booking->ticket_id == $this->ticket_id ){\n\t\t\t\t\t$bookings[$EM_Booking->booking_id] = $EM_Booking;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->bookings = new EM_Bookings($bookings);\n\t\treturn $this->bookings;\n\t}",
"static function get_bkap_booking_statuses() {\n\n return $allowed_status = array( 'pending-confirmation' => 'Pending Confirmation',\n\t 'confirmed' => 'Confirmed',\n\t 'paid' => 'Paid',\n\t 'cancelled' => 'Cancelled'\n\t );\n\t \n\t}",
"public function pendingBorrowRequest()\n {\n return view('member.pending_books');\n }",
"public function actionApprovalList()\n\t{\n\t\t$user_id = Yii::app()->user->getId();\n\t\t\n\t\t\n\t\t\n\t\t$criteria = new CDbCriteria();\n\t\t$criteria->condition = 't.status_id = :status_id';\n\t\t$criteria->params = array(':status_id'=>AcquisitionRequest::STATUS_NEW);\n\t\t$criteria->with = array('requestedBy');\n\t\t$requestDP=new CActiveDataProvider( 'AcquisitionRequest', array( \t'criteria' => $criteria, \n\t\t'pagination' => array( 'pageSize' => '20', ) ) \n\t\t);\n\t\t/*\n\t\tif(Yii::app()->request->isPostRequest && isset($_POST['ids']))\n\t\t{\n\t\t\t$ids = $_POST['ids'];\n\t\t\n\t\t}else\n\t\t{\n\t\t\t$ids = array(0);\n\t\t}\n\t\t*/\n\t\t$ids = array(0);\n\t\t$itemModel = new AcquisitionRequestItem();//\"searchNewItemByRequestId($ids)\");\n\t\t\n\t\t//$requestItemDP = AcquisitionRequestItem::model()->searchNewItemByRequestId($ids);\n\t\t\n\t\t$this->render('approval_list',array('requestDP'=>$requestDP,'parentID'=>$ids,'itemModel'=>$itemModel));\n\t\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test case for updatePushTemplate Update Push Template. | public function testUpdatePushTemplate()
{
} | [
"public function test_template_updated() {\n $this->resetAfterTest(true);\n $this->setAdminUser();\n $lpg = $this->getDataGenerator()->get_plugin_generator('core_competency');\n\n $template = $lpg->create_template();\n\n // Trigger and capture the event.\n $sink = $this->redirectEvents();\n $template->set('shortname', 'Shortname modified');\n api::update_template($template->to_record());\n\n // Get our event event.\n $events = $sink->get_events();\n $event = reset($events);\n\n // Check that the event data is valid.\n $this->assertInstanceOf('\\core\\event\\competency_template_updated', $event);\n $this->assertEquals($template->get('id'), $event->objectid);\n $this->assertEquals($template->get('contextid'), $event->contextid);\n $this->assertEventContextNotUsed($event);\n $this->assertDebuggingNotCalled();\n }",
"public function testUpdateTemplate()\n {\n }",
"public function testSendTemplatedPush()\n {\n }",
"public function testUpdateTemplate0()\n {\n }",
"public function testUpdateMessageTemplate()\n {\n }",
"public function test_update_template() {\n $cat = $this->getDataGenerator()->create_category();\n $this->resetAfterTest(true);\n $this->setAdminUser();\n\n $syscontext = context_system::instance();\n $template = api::create_template((object) array('shortname' => 'testing', 'contextid' => $syscontext->id));\n\n $this->assertEquals('testing', $template->get('shortname'));\n $this->assertEquals($syscontext->id, $template->get('contextid'));\n\n // Simple update.\n api::update_template((object) array('id' => $template->get('id'), 'shortname' => 'success'));\n $template = api::read_template($template->get('id'));\n $this->assertEquals('success', $template->get('shortname'));\n\n // Trying to change the context.\n api::update_template((object) array('id' => $template->get('id'), 'contextid' => context_coursecat::instance($cat->id)));\n }",
"public function testUpdateDeviceTemplate()\n {\n }",
"public function testUpdateItemTemplate()\n {\n }",
"public function testUpdateEmailTemplate()\n {\n }",
"public function testUpdateObjectTemplate()\n {\n }",
"public function testUpdateEntitlementTemplate()\n {\n }",
"public function testUpdateUserTemplate()\n {\n }",
"public function updated(MailTemplate $template)\n {\n //\n }",
"public function bind_template($params) {\n //get notification template\n// $template = Template::where('code', $template_code)->where('tenant_code', $tenant_code)->where('status', self::STATUS_LIVE)->first();\n $template = $this;\n \n// if (!$template) {\n// throw new Exception(\"Error Processing Request\", 403);\n// }\n $notification = [];\n\n //update notification templates with params\n //WEB_PUSH\n if (isset($template->web_push_template['status']) && $template->web_push_template['status']) {\n $title = isset($template->web_push_template['title']) ? Settings::notification_format($template->web_push_template['title'], $params) : '';\n $message = isset($template->web_push_template['message']) ? Settings::notification_format($template->web_push_template['message'], $params) : '';\n $url = isset($template->web_push_template['url']) ? Settings::notification_format($template->web_push_template['url'], $params) : '';\n $notification['web_push'] = ['title' => $title, 'message' => $message, 'url' => $url];\n }\n \n\n //SMS\n if (isset($template->sms_template['status']) && $template->sms_template['status']) {\n $title = isset($template->sms_template['title']) ? Settings::notification_format($template->sms_template['title'], $params) : '';\n $message = isset($template->sms_template['message']) ? Settings::notification_format($template->sms_template['message'], $params) : '';\n $notification['sms'] = ['title' => $title, 'message' => $message];\n }\n\n //MOBILE_PUSH\n if (isset($template->mobile_push_template['status']) && $template->mobile_push_template['status']) {\n $title = isset($template->mobile_push_template['title']) ? Settings::notification_format($template->mobile_push_template['title'], $params) : '';\n $message = isset($template->mobile_push_template['message']) ? Settings::notification_format($template->mobile_push_template['message'], $params) : '';\n $notification['mobile_push'] = ['title' => $title, 'message' => $message];\n }\n\n //Email\n if (isset($template->email_template['status']) && $template->email_template['status']) {\n $title = isset($template->email_template['title']) ? Settings::notification_format($template->email_template['title'], $params) : '';\n $message = isset($template->email_template['message']) ? Settings::notification_format($template->email_template['message'], $params) : '';\n $notification['email'] = ['title' => $title, 'message' => $message];\n }\n\n\n return $notification;\n }",
"public function testInventoryAttributeGroupTemplatePATCHRequestAttributeGroupTemplatesAttributeGroupTemplateIDUpdate()\n {\n }",
"public function updatetemplateAction()\n {\n $templateid = $this->getRequest()->getPost('templateid');\n $templatename = $this->getRequest()->getPost('templatename');\n $templatebody = $this->getRequest()->getPost('templatebody');\n $this->_getService()->updatetemplateAction($templateid, $templatename, $templatebody);\n $this->_redirect('smsservice/adminhtml/template');\n }",
"public function testSendEmailWithTemplate()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function testErrorActionUpdateTemplateEmptyName()\n\t{\n\t\t$templateParrent = TemplateFolderModelMongo::where('name', 'Templates')->where('parent_id', '0')->first();\n\n\t\t$template = TemplateContentManagerModel::where('folder_id', $templateParrent->_id)->first();\n\n\t\t$contentTemplate = ContentTemplateModelMongo::where('base_id', $template->_id)->first();\n\n\t\t//initialization data\n\t\t$data = [\n\t\t\t'base_id' => $template->_id,\n\t\t\t'content' => 'test 1111 1111 11111111',\n\t\t\t'_id' => $contentTemplate->_id,\n\t\t\t'language'=> 'en',\n\t\t 'region'=> null,\n\t\t 'status'=> $contentTemplate->status,\n\t\t 'thumbnail'=> null,\n\t\t 'name'=> '',\n\t\t 'folderName'=> 'Templates',\n\t\t 'folder_id'=> $templateParrent->_id,\n\t\t 'blocks'=> [],\n\t\t 'extends' => [],\n\t\t];\n\n\t\t$userLoginTest = UserModel::find(6);\n\t\t// login and call test method api post request translation template\n\t\t$request = $this->actingAs($userLoginTest)->put('api/template-content-manager/' . $contentTemplate->_id, $data);\n\n\t\t$request->seeJson(['status' => 0]);\t\t\n\t}",
"public function testUpdateCouponTemplate()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test case for findCustomer Find customer by external ID. | public function testFindCustomer()
{
// TODO: implement
$this->markTestIncomplete('Not implemented');
} | [
"public function testFindCustomerById()\n {\n $testId = \"1\";\n $oneCustomer = Customer::find($testId);\n\n $this->assertInstanceOf(\n Customer::class,\n $oneCustomer\n );\n\n $this->assertEquals(\n $testId,\n $oneCustomer->id\n );\n }",
"public function testGETCustomerIdReturns()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function getCustomerById($id);",
"abstract public function getCustomer($ID);",
"public function testGetCustomerWithInvalidCustomerId(){\n\t\tPayU::$apiLogin = PayUTestUtil::API_LOGIN;\n\t\tPayU::$apiKey = PayUTestUtil::API_KEY;\n\t\tEnvironment::setSubscriptionsCustomUrl(PayUTestUtil::SUBSCRIPTION_CUSTOM_URL);\n\t\n\t\t$customer = PayUCustomers::create(PayUTestUtil::buildSubscriptionParametersCustomer());\n\t\t$parameters[PayUParameters::CUSTOMER_ID] = 'Payer_zXXXXXX111';\n\t\t\n\t\t$response = PayUCustomers::find($parameters);\n\t\n\t}",
"public function findCustomer(string $stripe_id) \n {\n \n $custexists = \\Stripe\\Customer::retrieve($stripe_id);\n Log::debug($custexists);\n\n if (!$custexists){\n\n Log::debug(\"FUNCTION CUSTOMER NOT EXIST\");\n\n return $customerExists = false;\n\n } else {\n\n Log::debug(\"FUNCTION CUSTOMER EXISTS\");\n\n if ($custexists->deleted){\n\n Log::debug(\"FUNCTION CUSTOMER DELETED\");\n return $customerExists = false;\n\n } else {\n\n Log::debug(\"FUNCTION CUSTOMER NOT DELETED\");\n return $customerExists = true;\n\n }\n\n }\n\n }",
"public function testCustomerGetBycustomerCd()\n {\n }",
"public function findAccountByCustomerNumber($customerId);",
"public function findCustomer($id)\n {\n $customer = $this->HHCustomerRepository->find($id);\n return $customer;\n }",
"public function findCustomer($post){\n\t\t$account_id = $this->account_id;\n\t\t$api_key = $this->api_key;\n\t\t$user_id = $this->user_id;\n\t\t\n\t\tif(empty($post['find_customer'])){\n \t\tthrow new Exception('find_customer field is Required');\n\t }\n\t\t\n\t\t$fields = array(\n\t\t\t'type'\t\t\t\t=> 'customer_find',\n\t\t\t'user_id'\t\t\t=> $user_id,\n\t\t\t'user_password'\t\t=> $api_key,\n\t\t\t'account_id'\t\t=> $account_id,\n\t\t\t'find_customer'\t\t=> $post['find_customer']\n\t\t);\n\t\tif(!empty($post['include_balances'])) $fields['include_balances'] = $post['include_balances'];\t\t\n\t\treturn $this->sendData($fields);\n\t}",
"public function getCustomer($id){\n return $this->repository->find($id);\n }",
"public function testRetrieveSpecificCustomerObject() {\n $customer = OmiseCustomer::retrieve('cust_test_4zmrjg2hct06ybwobqc');\n\n $this->assertArrayHasKey('object', $customer);\n $this->assertEquals('customer', $customer['object']);\n }",
"public function testCustomerGetSalesPersonsForCustomerBycustomerCd()\n {\n }",
"public function getCustomerId();",
"public function getCustomerByCustomerId($customerId) {\n $customerDetails['customer-id'] = $customerId;\n $this->defaultValidate($customerDetails);\n return $this->callApi(METHOD_GET, 'customers', 'details-by-id', $customerDetails);\n }",
"public function getCustomer() {\n\t\t$accoutSlugDetail = $this->getAccountSlugDetail();\n\t\treturn $this->getUser('CUSTOMER_' . $accoutSlugDetail['accountId'] . '_');\n\t}",
"public function should_get_account_that_customer_belongs()\n {\n //arrange\n $account = Account::factory()->create();\n $customerData = [\n 'name' => $this->faker->name,\n 'address' => $this->faker->address,\n 'cpf' => $this->faker->randomLetter,\n 'account_id' => $account->id,\n 'phone' => $this->faker->phoneNumber,\n 'city' => $this->faker->city,\n 'state' => $this->faker->country,\n 'obs' => $this->faker->text,\n ];\n $sut = Customer::create($customerData);\n\n //act\n $result = $sut->account;\n\n //assert\n $this->assertInstanceOf(Account::class, $result);\n }",
"function get_customer($id_customer)\n {\n return $this->db->get_where('customer',array('id_customer'=>$id_customer))->row_array();\n }",
"public function getCustomer()\n {\n if (null === $customer && isset($this['CUSTOMER_ID']))\n {\n $this->customer = \\Fastbill\\Customer\\Finder::findOneById($this['CUSTOMER_ID']);\n }\n return $this->customer;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the [tas_alert] column value. | public function getTasAlert ()
{
return $this->tas_alert;
} | [
"public function getAlert()\n\t{\n\t\treturn $this->data[self::APS]['alert'];\n\t}",
"public function getAlert()\n {\n return $this->alert;\n }",
"function getAlert($index)\n {\n if (IsSet($this->alerts[$index]))\n {\n return $this->alert[$index];\n }\n return \"\";\n }",
"public function alerts()\n {\n return $this->data['alerts'];\n }",
"public function getAlertText() {\n $response = $this->execute_rest_request_GET($this->requestURL . \"/alert_text\");\n return $this->extractValueFromJsonResponse($response);\n }",
"public function getAlertText() {\r\n\t\t$response = $this->execute_rest_request_GET($this->requestURL . \"/alert_text\");\r\n\t\treturn $this->extractValueFromJsonResponse($response);\r\n\t}",
"public static function getAlert() {\r\n\t\tif (!empty($_SESSION['alert'])) {\r\n\t\t\t$alert = $_SESSION['alert'];\r\n\t\t\tunset ($_SESSION['alert']);\r\n\t\t} else {\r\n\t\t\t$alert = false;\r\n\t\t}\r\n\t\treturn $alert;\r\n\t}",
"public function getAlertId()\n {\n return $this->alert_id;\n }",
"public function getAlertTime()\n {\n if (!$this->isPropertyAvailable(\"AlertTime\")) {\n return null;\n }\n return $this->getProperty(\"AlertTime\");\n }",
"public function getAlertId()\n {\n return $this->_alertId;\n }",
"public function getAlertEmail()\n {\n return $this->alertEmail;\n }",
"public function getAlertMessage()\n {\n return $this->_alertMessage;\n }",
"public function getSimpleAlert()\n {\n return $this->simpleAlert;\n }",
"function get_alert($alert_id)\n {\n return $this->db->get_where('alerts',array('alert_id'=>$alert_id))->row_array();\n }",
"public function getAlertPoint(){\n\t\treturn($this->alertPoint);\n\t}",
"public function getPendingTatValue()\n {\n # Used while generating TAT report\n # Stored in DB table 'test_type_tat' against test_type_id=0\n global $DEFAULT_PENDING_TAT;\n $saved_db = DbUtil::switchToLabConfig($this->id);\n $query_string = \"SELECT tat FROM test_type_tat WHERE test_type_id=0 LIMIT 1\";\n $record = query_associative_one($query_string);\n $retval = 0;\n if ($record == null) {\n $retval = $DEFAULT_PENDING_TAT*24;\n } elseif ($record['tat'] == null) {\n $retval = $DEFAULT_PENDING_TAT*24;\n } else {\n # Entry present in DB\n $retval = $record['tat'];\n }\n DbUtil::switchRestore($saved_db);\n return $retval;\n }",
"public function time()\n {\n return array_get($this->alert, 'time');\n }",
"public function getPageAlert() {\r\n\t\treturn $this->pageAlert;\r\n\t}",
"private function alert() {\n\t\tif ( pods_v( 'dms-alert', 'get', false, true ) ) {\n\t\t\treturn ht_dms_ui()->elements()->alert( get_option( 'ht_dms_action_message', '' ), 'success' );\n\n\t\t}\n\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the [TransactionDate] field. | public function setTransactionDate($transactionDate) {
$this->container['TransactionDate'] = $transactionDate;
return $this;
} | [
"public function setTransactionDate($value) {\n\t\tself::$_transactionDate = $value;\n\t}",
"public function setDateTransaction($dateTransaction)\n {\n $this->dateTransaction = $dateTransaction;\n\n return $this;\n }",
"public function setTxnDate($date)\n\t{\n\t\treturn $this->setDateType('TxnDate', $date);\n\t}",
"public function setTxnDate($value)\n\t{\n\t\treturn $this->set('TxnDate', $value);\n\t}",
"function setFundDate($fundDate){\n $this->fundDate = $fundDate; \n }",
"public function setDepositDate() {\n if ($this->dateDeposited === null) {\n $this->dateDeposited = new DateTime();\n }\n }",
"function setDate($date)\r\n {\r\n $this->_date = $date;\r\n }",
"protected function setSalesDate()\n {\n $this->salesDate = date(\n 'Y-m-d', \n mktime(\n 0, \n 0, \n 0, \n $this->month,\n $this->day, \n $this->year\n )\n );\n }",
"public function setDate($date = 'now')\n {\n $this->headers->setDate('Date', $date);\n }",
"function setDate( $value )\r\n {\r\n $this->SentDate = $value;\r\n }",
"function setDate( $value )\r\n {\r\n $this->Date = $value;\r\n }",
"public function withTransactionDate($value)\n {\n $this->setTransactionDate($value);\n return $this;\n }",
"public function setDate($date)\n {\n }",
"public function set_contract_date($value) {\r\n $this->contract_date = $value;\r\n data::add(\"contract_date\", $this->contract_date !== \"\" ? $this->contract_date : NOTIME, $this->table_fields);\r\n }",
"public function setPurchaseDate($date)\n {\n $this->purchaseDate = $date;\n }",
"public function setCallerTransactionDate($value) \n {\n $this->_fields['CallerTransactionDate']['FieldValue'] = $value;\n return $this;\n }",
"public function getTransactionDate()\n {\n return $this->transactionDate;\n }",
"function setDate(ilDateTime $a_date = NULL)\n\t{\n\t\t$this->date = $a_date;\n\t}",
"public function setDateOfSale(\\DateTime $date)\n {\n \n // If date of sale < January 1st 2015, don't use customer country\n if ($date < new \\DateTime(\"2015-01-01\"))\n {\n $this->setCustomerCountry($this->getSellerCountry());\n }\n \n // Update product type as customer country may have changed\n $this->setProductType($this->getProductType(true));\n \n $this->dateOfSale = $date;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation restWizardsWizardKeyDataPut Update a wizard data | public function restWizardsWizardKeyDataPut($wizard_key)
{
list($response) = $this->restWizardsWizardKeyDataPutWithHttpInfo($wizard_key);
return $response;
} | [
"protected function restWizardsWizardKeyDataOptionIdPutRequest($wizard_key, $option_id)\n {\n // verify the required parameter 'wizard_key' is set\n if ($wizard_key === null || (is_array($wizard_key) && count($wizard_key) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $wizard_key when calling restWizardsWizardKeyDataOptionIdPut'\n );\n }\n // verify the required parameter 'option_id' is set\n if ($option_id === null || (is_array($option_id) && count($option_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $option_id when calling restWizardsWizardKeyDataOptionIdPut'\n );\n }\n\n $resourcePath = '/rest/wizards/{wizardKey}/data/{optionId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($wizard_key !== null) {\n $resourcePath = str_replace(\n '{' . 'wizardKey' . '}',\n ObjectSerializer::toPathValue($wizard_key),\n $resourcePath\n );\n }\n // path params\n if ($option_id !== null) {\n $resourcePath = str_replace(\n '{' . 'optionId' . '}',\n ObjectSerializer::toPathValue($option_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['*/*']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['*/*'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function setWizardDataForKey($key, $value) {\n\t\t$this->wizardData[$key] = $value;\n\t}",
"protected function restWizardsWizardKeyDataPostRequest($wizard_key)\n {\n // verify the required parameter 'wizard_key' is set\n if ($wizard_key === null || (is_array($wizard_key) && count($wizard_key) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $wizard_key when calling restWizardsWizardKeyDataPost'\n );\n }\n\n $resourcePath = '/rest/wizards/{wizardKey}/data';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($wizard_key !== null) {\n $resourcePath = str_replace(\n '{' . 'wizardKey' . '}',\n ObjectSerializer::toPathValue($wizard_key),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['*/*']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['*/*'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function restWizardsWizardKeyDataPutAsyncWithHttpInfo($wizard_key)\n {\n $returnType = 'object';\n $request = $this->restWizardsWizardKeyDataPutRequest($wizard_key);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function restWizardsWizardKeyDataPutAsync($wizard_key)\n {\n return $this->restWizardsWizardKeyDataPutAsyncWithHttpInfo($wizard_key)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"protected function restWizardsWizardKeyDataGetRequest($wizard_key)\n {\n // verify the required parameter 'wizard_key' is set\n if ($wizard_key === null || (is_array($wizard_key) && count($wizard_key) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $wizard_key when calling restWizardsWizardKeyDataGet'\n );\n }\n\n $resourcePath = '/rest/wizards/{wizardKey}/data';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($wizard_key !== null) {\n $resourcePath = str_replace(\n '{' . 'wizardKey' . '}',\n ObjectSerializer::toPathValue($wizard_key),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['*/*']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['*/*'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function putData($data);",
"public function restWizardsWizardKeyDataPostWithHttpInfo($wizard_key)\n {\n $request = $this->restWizardsWizardKeyDataPostRequest($wizard_key);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('object' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, 'object', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = 'object';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n 'object',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"protected function restWizardsWizardKeyDataOptionIdPostRequest($wizard_key, $option_id)\n {\n // verify the required parameter 'wizard_key' is set\n if ($wizard_key === null || (is_array($wizard_key) && count($wizard_key) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $wizard_key when calling restWizardsWizardKeyDataOptionIdPost'\n );\n }\n // verify the required parameter 'option_id' is set\n if ($option_id === null || (is_array($option_id) && count($option_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $option_id when calling restWizardsWizardKeyDataOptionIdPost'\n );\n }\n\n $resourcePath = '/rest/wizards/{wizardKey}/data/{optionId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($wizard_key !== null) {\n $resourcePath = str_replace(\n '{' . 'wizardKey' . '}',\n ObjectSerializer::toPathValue($wizard_key),\n $resourcePath\n );\n }\n // path params\n if ($option_id !== null) {\n $resourcePath = str_replace(\n '{' . 'optionId' . '}',\n ObjectSerializer::toPathValue($option_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['*/*']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['*/*'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function restWizardsWizardKeyDataPost($wizard_key)\n {\n list($response) = $this->restWizardsWizardKeyDataPostWithHttpInfo($wizard_key);\n return $response;\n }",
"public function putAction()\n {\n\n $this->setHeader();\n\n $modelName = $this->getDefaultModel(true);\n\n $request = $this->getRestRequest();\n\n $dataSet = $request->getParams(true);\n\n if (!is_array($dataSet)) {\n $dataSet = array($dataSet);\n }\n\n foreach ($dataSet as $data) {\n\n $result = new RestResponseResult($this->getRestRequest()->getMethod());\n\n $result->setModel($modelName);\n\n if (!isset($data['id'])) {\n\n } else {\n\n $genericModel = $this->getDefaultModel();\n $model = $genericModel->findFirst(\"id = \" . $data['id']);\n\n foreach ($data as $field => $value) {\n\n if ($field == 'id') {\n continue;\n }\n\n\n if (!isset($model->$field)) {\n $result->setCode(\"400\");\n $result->setStatus('bad put request');\n $result->setResult(\n [\"Field $field is not exists in $modelName model\"]\n );\n continue(2);\n } else {\n $model->$field = $value;\n }\n }\n\n if ($model->save()) {\n $result->setCode(\"200\");\n $result->setStatus('updated');\n $result->setResult($model->dump());\n } else {\n $result->setCode(\"400\");\n $result->setStatus('bad put request');\n $result->setResult($model->getMessages());\n }\n\n }\n $this->getRestResponse()->addResult($result);\n }\n\n echo $this->getRestResponse();\n// die();\n }",
"protected function restWizardsWizardKeyGetRequest($wizard_key)\n {\n // verify the required parameter 'wizard_key' is set\n if ($wizard_key === null || (is_array($wizard_key) && count($wizard_key) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $wizard_key when calling restWizardsWizardKeyGet'\n );\n }\n\n $resourcePath = '/rest/wizards/{wizardKey}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($wizard_key !== null) {\n $resourcePath = str_replace(\n '{' . 'wizardKey' . '}',\n ObjectSerializer::toPathValue($wizard_key),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['*/*']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['*/*'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function testQuestionnaireKeyIsRequiredWhileUpdatingQuestionnaireStage()\n {\n $stage = factory(Stage::class)->create();\n $payload = [\n \"name\" => \"Software Dev Questionnaire\",\n \"type\" => \"questionnaire\"\n ];\n\n $response = $this->json('put', 'api/v1/stages/' . $stage->key, $payload);\n $response->assertStatus(Response::HTTP_UNPROCESSABLE_ENTITY);\n }",
"public function restWizardsWizardKeyDataPostAsyncWithHttpInfo($wizard_key)\n {\n $returnType = 'object';\n $request = $this->restWizardsWizardKeyDataPostRequest($wizard_key);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function set_meta( $data ) {\n\n\t\tupdate_user_meta( get_current_user_id(), 'wpforms_admin_form_embed_wizard', $data );\n\t}",
"public function updateOneEntity (int $key,$data) : void;",
"protected function restWizardsWizardKeyActionsActionKeyPostRequest($wizard_key, $action_key)\n {\n // verify the required parameter 'wizard_key' is set\n if ($wizard_key === null || (is_array($wizard_key) && count($wizard_key) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $wizard_key when calling restWizardsWizardKeyActionsActionKeyPost'\n );\n }\n // verify the required parameter 'action_key' is set\n if ($action_key === null || (is_array($action_key) && count($action_key) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $action_key when calling restWizardsWizardKeyActionsActionKeyPost'\n );\n }\n\n $resourcePath = '/rest/wizards/{wizardKey}/actions/{actionKey}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($wizard_key !== null) {\n $resourcePath = str_replace(\n '{' . 'wizardKey' . '}',\n ObjectSerializer::toPathValue($wizard_key),\n $resourcePath\n );\n }\n // path params\n if ($action_key !== null) {\n $resourcePath = str_replace(\n '{' . 'actionKey' . '}',\n ObjectSerializer::toPathValue($action_key),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['*/*']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['*/*'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function testUpdateSupportTicketUsingPut()\n {\n }",
"public function set( $key, $data );"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return $this>db>query('SELECT from user_access_menu')>result_array(); | public function getUserAcces()
{
$this->db->select('*')
->from('user_access_menu')//jabatan adalah anak & pegawai adalah tabel utama
->join('jabatan', 'jabatan.id_jabatan = user_access_menu.role_id')
->join('user_menu', 'user_menu.id_menu = user_access_menu.menu_id','left');
$query = $this->db->get();
$result = $query->result_array();
return $result;
} | [
"function get_all_role_access_menu()\n {\n $this->db->select('*,role_access_menu.id as id');\n $this->db->join('menu', 'menu.id=role_access_menu.menu_id');\n $this->db->join('role', 'role.id=role_access_menu.role_id');\n return $this->db->get('role_access_menu')->result_array();\n }",
"function get_user_access_menu($id)\n {\n return $this->db->get_where('user_access_menu', array('id' => $id))->row_array();\n }",
"public function get_Aksesmenu()\n {\n $queryAksesmenu = \"SELECT user_access_menu.*, user_menu.menu, user_role.role\n FROM user_access_menu \n JOIN user_menu\n ON user_access_menu.menu_id = user_menu.id\n JOIN user_role\n ON user_access_menu.role_id = user_role.id\";\n\n return $this->db->query($queryAksesmenu)->result_array();\n }",
"function get_all_user_access_menu($user_id)\n {\n $this->db->select('*,user_menu.id as \"menu_id\"');\n $this->db->join('user_menu', 'user_menu.id=user_access_menu.menu_id');\n return $this->db->get_where('user_access_menu', array('user_id' => $user_id))->result_array();\n }",
"function ambil_data(){\n\t\treturn $this->db->get('user');\n\t}",
"public function get_array_db(){\n $query = $this->db->query(\"SELECT * FROM users\");\n return $query->result_array();\n }",
"function get_user_menu($id)\n {\n return $this->db->get_where('user_menu', array('id' => $id))->row_array();\n }",
"public function getUserRights(){\n\t\treturn $GLOBALS['db']->select(\"select * from user_rights order by id\");\t\n\t}",
"function getAccessforUserId($params){\n $querystring = \"SELECT auam.add_rights,auam.edit_rights,auam.view_rights,auam.delete_rights from agrimin_user_access_master auam where menu_master_id = '\".$params['main_menus'].\"' and submenu_master_id = '\".$params['sub_menus'].\"' and user_id = '\".$params['user_access_id'].\"'\";\n $queryforpubid = $this->db->query($querystring);\n\n $result = $queryforpubid->result_array();\n return @$result[0];\n\n }",
"public function getMenuAccessInformation($user_id='') {\n if($user_id!='') {\n $result = $this->db->query(\"SELECT tbl_admin_user_menus.controller_name as controller_name\n FROM tbl_user_menu_access\n JOIN tbl_admin_user_menus ON tbl_user_menu_access.menu_id = tbl_admin_user_menus.id\n WHERE tbl_user_menu_access.user_id=$user_id\n \")->result();\n }else{\n $result = $this->db->query(\"SELECT *\n FROM tbl_admin_user_menus\n \")->result();\n }\n\n return $result;\n }",
"function select_all_admin(){\n\t\t\n\t global $db; \n\t\t$query = \"SELECT * FROM \";\n\t\t$query .= \" admin \";\n\t\t$admin = $db->query($query);\n\t\t \n\t return $admin;\n\t\t}",
"function getdataroleuser()\n\t{\n\t\t$query = $this->db->query(\"SELECT roleuser,koderole FROM roleuser \");\n\t\t// print_r($query);\n\t\t// exit();\n\t\treturn $query->result();\n\t}",
"public static function getActiveMenus() {\n\tUser::$dbObj = new Db();\n $sel = \"SELECT cms_name,cms_title FROM \".User::$dbObj->tablePrefix.\"Cms WHERE cms_status=1 AND cms_type='cms'\"; \n $data = User::$dbObj->selectQuery($sel);\n\treturn $data;\n }",
"public function getSubmenu()\n\t\t{\n\t\t\t// return $this->db->query($query)->result_array();\n\t\t\t$this->db->join('user_menu', 'user_sub_menu.menu_id=user_menu.id');\n\t\t\t$this->db->select('user_menu.menu, user_sub_menu.*');\n\t\t\treturn $this->db->get('user_sub_menu')->result_array();\n\t\t}",
"function fetchAll() {\n\t\t$db = DataConnection::readOnly();\n\t\t$q = $db->menu();\n if(count($q) > 0) {\n foreach($q as $id => $q){\n $res[$id] = $q;\n }\n return $res;\n }else{\n\t\t\tnatural_set_message('Menu not found', 'error');\n throw new Luracast\\Restler\\RestException(404, 'Menu not found');\n }\n\t}",
"function get_menu_olah($id)\n {\n return $this->db->get_where('menu_olah',array('id'=>$id))->row_array();\n }",
"public function getAllMenuItems(){\r\n\t\t$this->db->select('*')->from(TABLES::$MENU_ITEM_TABLE)->order_by('name','asc');\r\n\t\t$query = $this->db->get();\r\n\t\t$result = $query->result_array();\r\n\t\treturn $result;\r\n\t}",
"public function getAllMenu(){\n $query = $this->db->get('s_menu');\n return $query->custom_result_object('Menu');\n }",
"static function getList(){\n $sql = new Sql(\"localhost\", \"dbphp7\", \"root\", \"\");\n return $sql ->select(\"SELECT * FROM tb_usuarios ORDER BY deslogin\");\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set a date as minimum date | public function minDate($date)
{
return $this->setChildBound('date', 'min', $date);
} | [
"public function setMinDate($date) {\n\t\t$this->set('min_date', $date);\n\t}",
"public function setMinDate($date)\n {\n $this->minDate = new \\DateTime($date);\n \n return $this;\n }",
"public function setDateMin($min = null)\n {\n $this->m_date_max = $this->dateArray($min);\n }",
"public function minimumDateCanBeSet()\n {\n $domainModelInstance = new Search();\n $value = '123';\n $domainModelInstance->setMinimumDate($value);\n $this->assertEquals($value, $domainModelInstance->getMinimumDate());\n }",
"public function getMinDate() {\n return $this->minDate;\n }",
"public function getMinDate()\n {\n return $this->minDate;\n }",
"private function getMinDate()\n {\n $date = new \\DateTime();\n\n return $date;\n }",
"public function setStartDate($date = '1/1/1900');",
"public function setMinDay($minDay) {\n $this->minDay = $minDay;\n }",
"function set_start_date($value = null) {\r\n\t\tif(!empty($value))\r\n\t\t$this->start_date = $value;\r\n\t}",
"function _min_date($field, $date)\r\n\t{\r\n\t\treturn (strtotime($this->{$field}) < strtotime($date)) ? FALSE : TRUE;\r\n\t}",
"public static function get_default_min_dt()\n\t{\n\t\treturn self::get_value_dt('1970-01-01T00:00:00');\n\t}",
"public function setDateStart($date)\n {\n $this->date = $date;\n }",
"function setMinimum($min)\r\n {\r\n $oldVal = $this->getMinimum();\r\n\r\n $this->_DM->setMinimum($min);\r\n\r\n if ($oldVal != $min) {\r\n $this->_announce(array('log' => 'setMinimum', 'value' => $min));\r\n }\r\n }",
"public function setMinimumLeadTime($val)\n {\n $this->_propDict[\"minimumLeadTime\"] = $val;\n return $this;\n }",
"function setStartDate($date)\n {\n $this->startDate = @date('D, d M y H:i:s O', @strtotime($date));\n }",
"public function setEarliestDeliveryDate($value)\n {\n $this->_fields['EarliestDeliveryDate']['FieldValue'] = $value;\n return $this;\n }",
"public function minDateFailsThrowsFilterException()\n {\n $minDate = new stubDate('2008-09-26');\n $testDate = new stubDate('2008-09-25');\n $this->periodFilterDecorator->setMinDate($minDate);\n $this->assertEquals('DATE_TOO_EARLY', $this->periodFilterDecorator->getMinDateErrorId());\n $this->assertSame($minDate, $this->periodFilterDecorator->getMinDate());\n $this->assertNull($this->periodFilterDecorator->getMaxDate());\n $this->mockRequestValueErrorFactory->expects($this->once())\n ->method('create')\n ->with($this->equalTo('DATE_TOO_EARLY'))\n ->will($this->returnValue(new stubRequestValueError('foo', array('en_EN' => 'Something wrent wrong.'))));\n $this->periodFilterDecorator->callDoExecute($testDate);\n }",
"public function setEarliestTicketingDate($earliestTicketingDate = null)\n {\n // validation for constraint: string\n if (!is_null($earliestTicketingDate) && !is_string($earliestTicketingDate)) {\n throw new \\InvalidArgumentException(sprintf('Invalid value, please provide a string, \"%s\" given', gettype($earliestTicketingDate)), __LINE__);\n }\n if (is_null($earliestTicketingDate) || (is_array($earliestTicketingDate) && empty($earliestTicketingDate))) {\n unset($this->EarliestTicketingDate);\n } else {\n $this->EarliestTicketingDate = $earliestTicketingDate;\n }\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Utility function to parse a ChangeInfo tag structure | private function parseChangeInfo($tag) {
$info = array();
$info['Id'] = (string) $tag->Id;
$info['Status'] = (string) $tag->Status;
$info['SubmittedAt'] = (string) $tag->SubmittedAt;
return $info;
} | [
"function parseChangelogLine($line) {\n $tmp = explode(\"\\t\", $line);\n if ($tmp!==false && count($tmp)>1) {\n $info = array();\n $info['date'] = $tmp[0]; // unix timestamp\n $info['ip'] = $tmp[1]; // IPv4 address (127.0.0.1)\n $info['type'] = $tmp[2]; // log line type\n $info['id'] = $tmp[3]; // page id\n $info['user'] = $tmp[4]; // user name\n $info['sum'] = $tmp[5]; // edit summary (or action reason)\n $info['extra'] = rtrim($tmp[6], \"\\n\"); // extra data (varies by line type)\n return $info;\n } else { return false; }\n}",
"public static function getTrackedChangeInfo($changeInfo)\n {\n\n if ($changeInfo instanceof ChangeInfoEnvelope) {\n /** @var ChangeInfoEnvelope $changeInfo */\n $sortedChangeInfos = $changeInfo->getReorganizedInfoList();\n if ($sortedChangeInfos[0] instanceof BulkChangeInfo) {\n $ungroupedChangeInfos = $sortedChangeInfos[0]->getChangeInfos();\n return $ungroupedChangeInfos[0];\n }\n return $sortedChangeInfos[0];\n } else {\n return $changeInfo;\n }\n }",
"public function parse_changelog_response( $response ) {\n\t\tif ( $this->validate_response( $response ) ) {\n\t\t\treturn $response;\n\t\t}\n\t\t$arr = [];\n\t\t$response = [ $response ];\n\n\t\tarray_filter(\n\t\t\t$response,\n\t\t\tfunction ( $e ) use ( &$arr ) {\n\t\t\t\t$arr['changes'] = $e->content;\n\t\t\t}\n\t\t);\n\n\t\treturn $arr;\n\t}",
"public function getChangeInfos() {\n return $this->changeInfos;\n }",
"protected function _parseChangelog()\n {\n $raw = file_get_contents($this->_getChangelogPath());\n $split = explode(PHP_EOL, $raw);\n $logString = array_reverse($split);\n \n $releases = [];\n $previousLine = '';\n foreach($logString as $line) {\n // save the new release into the array and continue\n if (strpos($previousLine, SELF::UNDERLINE)!==false) {\n $releases[$line] = array_reverse($release);\n $release = [];\n $previousLine = '';\n continue;\n }\n \n // save every line\n $release[] = $line;\n $previousLine = $line;\n }\n return array_reverse($releases);\n }",
"abstract protected function parsingTag();",
"public function getCostChangeInfo()\n {\n $value = $this->get(self::COSTCHANGEINFO);\n return $value === null ? (string)$value : $value;\n }",
"protected function _parseDescTag() {}",
"public function parseChangelog(string $changelog): string\n {\n $lines = $this->repository->readFile($changelog, 4096);\n $currentChangeLogEntries = [];\n\n foreach ($lines as $line) {\n if (!trim($line)) {\n break;\n }\n\n $currentChangeLogEntries[] = $line;\n }\n\n return implode(\"\\n\", $currentChangeLogEntries);\n }",
"private function parse_changelog( $content ) {\n\t\t$matches = null;\n\t\t$regexp = '~==\\s*Changelog\\s*==(.*)($)~Uis';\n\t\t$changelog = '';\n\n\t\tif ( preg_match( $regexp, $content, $matches ) ) {\n\t\t\t$changes = explode( '\\r\\n', trim( $matches[1] ) );\n\n\t\t\t$changelog .= '<pre class=\"changelog\">';\n\n\t\t\tforeach ( $changes as $index => $line ) {\n\t\t\t\t$changelog .= wp_kses_post( preg_replace( '~(=\\s*Version\\s*(\\d+(?:\\.\\d+)+)\\s*=|$)~Uis', '<span class=\"title\">${1}</span>', $line ) );\n\t\t\t}\n\n\t\t\t$changelog .= '</pre>';\n\t\t}\n\n\t\treturn wp_kses_post( $changelog );\n\t}",
"public function getChange(): array\n {\n return $this->change;\n }",
"public function setChanges(&$var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Google\\Watcher\\V1\\Change::class);\n $this->changes = $arr;\n }",
"private function ParseInfoData(){\n $aInfoArray = explode(\" \", $this->aInfo[1]);\n $iMarkerIndex = 0;\n foreach($aInfoArray as $iKey => $sInfoString){\n if($iKey >=21 && $iKey <= 31) continue;\n\n if($iKey <= 20){\n $this->oFormattedInfoData->priceInfo .= \" \" . $sInfoString;\n continue;\n }\n\n if($iKey >= 32 && $iKey <= 127){\n if(is_numeric($sInfoString)){\n $iMarkerIndex++;\n $this->oFormattedInfoData->marker[$iMarkerIndex]->id = $sInfoString;\n continue;\n }\n\n $this->oFormattedInfoData->marker[$iMarkerIndex]->description .= $sInfoString;\n continue;\n }\n\n if($iKey >= 128){\n $this->oFormattedInfoData->annotations .= \" \" . $sInfoString;\n }\n }\n }",
"function process_changes_file($commit_detail) {\n\t\t$pos = strpos($commit_detail, \"-\");\n\t\tif ($pos == 0)\n\t\t\t$pos_ = nthstrpos($commit_detail, \"-\", 3);\n\t\telse\t\n\t\t\t$pos_ = nthstrpos($commit_detail, \"-\", 2);\n\t\tif ($pos_ == -1 )\n\t\t\t$pos_ = nthstrpos($commit_detail, \"+\", 1);\n\t\t$len = $pos_ + 1;\n\t\t$str = substr($commit_detail, 0, $len);\n\t\t$str = ltrim($str, \"-\");\n\t\t$line = explode(\"-\", $str);\n\t\t$time = $line[0];\n\t\t$email = $line[1];\n\t\t$users = get_user_by_email($email);\n\t\t$user = $users[0];\n\t\tif (isset($user)) {\n\t\t\t$guid = $user->guid;\n\t\t\t$check_date = check_date($time, $guid);\n\t\t}\n\t\t//Check if time is greater than last update only then return the email.\n\t\tif ($check_date == true)\n\t\t\treturn $email;\n\t\telse\n\t\t\treturn null;\n\t}",
"public static function buildChangeInfo(CommitMessage $commitMessage)\n {\n return ChangeInfoEnvelope::buildFromCommitMessage($commitMessage);\n }",
"private function parseChangedTable( SimpleXMLElement $table )\n {\n $addedFields = array();\n foreach ( $table->{'added-fields'}->field as $field )\n {\n $fieldName = (string) $field->name;\n $addedFields[$fieldName] = $this->parseField( $field ); \n }\n\n $changedFields = array();\n foreach ( $table->{'changed-fields'}->field as $field )\n {\n $fieldName = (string) $field->name;\n $changedFields[$fieldName] = $this->parseField( $field ); \n }\n\n $removedFields = array();\n foreach ( $table->{'removed-fields'}->field as $field )\n {\n $fieldName = (string) $field->name;\n if ( (string) $field->removed == 'true' )\n {\n $removedFields[$fieldName] = true;\n }\n }\n\n $addedIndexes = array();\n foreach ( $table->{'added-indexes'}->index as $index )\n {\n $indexName = (string) $index->name;\n $addedIndexes[$indexName] = $this->parseIndex( $index ); \n }\n\n $changedIndexes = array();\n foreach ( $table->{'changed-indexes'}->index as $index )\n {\n $indexName = (string) $index->name;\n $changedIndexes[$indexName] = $this->parseIndex( $index ); \n }\n\n $removedIndexes = array();\n foreach ( $table->{'removed-indexes'}->index as $index )\n {\n $indexName = (string) $index->name;\n if ( (string) $index->removed == 'true' )\n {\n $removedIndexes[$indexName] = true;\n }\n }\n\n return new ezcDbSchemaTableDiff(\n $addedFields, $changedFields, $removedFields, $addedIndexes,\n $changedIndexes, $removedIndexes\n );\n }",
"public function DescribeChange()\n {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n $ret = \"\";\n \n // We build a macro, based upon the various parameters.\n $macro = \"__THE_\";\n switch ($this->object_class_string) {\n case 'c_comdef_meeting':\n $macro .= \"MEETING_\";\n break;\n \n case 'c_comdef_format':\n $macro .= \"FORMAT_\";\n break;\n \n case 'c_comdef_user':\n $macro .= \"USER_\";\n break;\n \n case 'c_comdef_service_body':\n $macro .= \"SERVICE_BODY_\";\n break;\n }\n \n switch ($this->change_type_enum) {\n case 'comdef_change_type_new':\n $macro .= \"WAS_CREATED__\";\n break;\n \n case 'comdef_change_type_delete':\n $macro .= \"WAS_DELETED__\";\n break;\n \n case 'comdef_change_type_change':\n $macro .= \"WAS_CHANGED__\";\n break;\n \n case 'comdef_change_type_rollback':\n $macro .= \"WAS_ROLLED_BACK__\";\n break;\n }\n \n if ($macro != \"__THE_\") {\n $localized_strings = c_comdef_server::GetLocalStrings();\n\n // This is a rather general description of the change.\n $ret = array('change_desc' => $localized_strings['change_type_strings'][$macro]);\n if ($this->GetLocalDescription()) {\n $ret['description'] = $this->GetLocalDescription();\n }\n if ($this->GetLocalName()) {\n $ret['name'] = $this->GetLocalName();\n }\n }\n \n return $ret;\n }",
"public function getChange()\n {\n return $this->get(self::_CHANGE);\n }",
"function parseUnifiedDiff($diff)\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
List unpinned global chat rooms. | public static function getRoomsGlobalUnpinned(?int $userId = null): array
{
if (empty($userId)) {
$userId = User::getCurrentUserId();
}
$query = self::getRoomsUnpinnedQuery('global', $userId);
$dataReader = $query->createCommand()->query();
$rooms = [];
while ($row = $dataReader->read()) {
$row['name'] = Language::translate($row['name'], 'Chat');
$row['roomType'] = 'global';
$rooms[$row['recordid']] = $row;
}
$dataReader->close();
return $rooms;
} | [
"public function getAllChatRooms()\n {\n return $this->doRequest('GET', '/chatrooms?type=all');\n }",
"function getChatRooms(){\n $url=$this->url.'chatrooms';\n $header=array($this->getToken());\n $result=$this->postCurl($url,'', $header, \"GET\");\n return $result;\n }",
"function usersinroom( $room = '' )\r\n{\r\n\t$list = array();\r\n\r\n\tif($room) {\r\n\t\t$stmt = new Statement(\"SELECT userid, state, color, lang, roomid FROM {$GLOBALS['fc_config']['db']['pref']}connections WHERE userid IS NOT NULL AND userid <> ? AND roomid=?\");\r\n\t\t$rs = $stmt->process( SPY_USERID , $room);\r\n\t} else {\r\n\t\t$stmt = new Statement(\"SELECT userid, state, color, lang, roomid FROM {$GLOBALS['fc_config']['db']['pref']}connections WHERE userid IS NOT NULL AND userid <> ? \");\r\n\t\t$rs = $stmt->process( SPY_USERID );\r\n\t}\r\n\r\n\twhile($rec = $rs->next())\r\n\t{\r\n\t\t$usr = ChatServer::getUser($rec['userid']);\r\n\t\tif($usr == null && $GLOBALS['fc_config']['enableBots']) $usr = $GLOBALS['fc_config']['bot']->getUser($rec['userid']);\r\n\t\t$list[] = array_merge($usr, $rec);\r\n\t}\r\n\r\n\r\n\treturn $list;\r\n}",
"public function getAllRoomIds() {\r\n\t\treturn $this->ilRoomSharingDatabaseRoom->getAllRoomIds();\r\n\t}",
"public function getAllRoom()\n\t{\n\t\treturn $this->find('all')->distinct('room_id');\n\t}",
"function get_chat_room_users($rooms, $chat_room, $chat_link)\n{\n\tglobal $db, $cache, $user, $lang;\n\n\t$chatroom_title = $lang['Public_room'];\n\t$chatroom_userlist = '';\n\t$result = array();\n\t$result['rooms'] = array();\n\t$room_class = '';\n\t$chat_room_all = request_var('all_rooms', 0);\n\t$chat_room_all = !empty($chat_room_all) ? true : false;\n\tif (($chat_room == '') && empty($chat_room_all))\n\t{\n\t\t$room_class = ' class=\"active\"';\n\t}\n\t$result['rooms'][] = array(\n\t\t'NAME' => $lang['Public_room'],\n\t\t'LIST' => '',\n\t\t'STYLED_LIST' => '',\n\t\t'CLASS' => $room_class,\n\t\t'LINK' => append_sid($chat_link)\n\t);\n\t$room_list_ids = array();\n\t$room_styled_list_ids = array();\n\tif (!empty($rooms))\n\t{\n\t\t$room_users_list = '';\n\t\tforeach ($rooms as $room)\n\t\t{\n\t\t\t$room_users_list .= $room['shout_room'];\n\t\t}\n\t\t$room_users_sql = array_unique(array_filter(array_map('intval', explode('|', $room_users_list))));\n\t\t$sql = \"SELECT DISTINCT user_id, username, user_color, user_active\n\t\t\t\tFROM \" . USERS_TABLE . \"\n\t\t\t\tWHERE \" . $db->sql_in_set('user_id', $room_users_sql);\n\t\t$results = $db->sql_query($sql);\n\t\t$users = $db->sql_fetchrowset($results);\n\n\t\tforeach ($users as $chat_user)\n\t\t{\n\t\t\tif($user->data['session_logged_in'] && ($chat_user['user_id'] == $user->data['user_id']))\n\t\t\t{\n\t\t\t\t$room_list_ids[$chat_user['user_id']] = $lang['My_id'];\n\t\t\t\t$room_styled_list_ids[$chat_user['user_id']] = colorize_username($chat_user['user_id'], $lang['My_id'], $chat_user['user_color'], $chat_user['user_active'], false, true);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$room_list_ids[$chat_user['user_id']] = $chat_user['username'];\n\t\t\t\t$room_styled_list_ids[$chat_user['user_id']] = colorize_username($chat_user['user_id'], $chat_user['username'], $chat_user['user_color'], $chat_user['user_active'], false, true);\n\t\t\t}\n\t\t}\n\n\t\tforeach ($rooms as $room)\n\t\t{\n\t\t\t$comma = '';\n\t\t\t$list = '';\n\t\t\t$styled_list = '';\n\t\t\t$room_class = '';\n\n\t\t\t$current_room = $room['shout_room'];\n\t\t\t$room_users = array_unique(array_filter(array_map('intval', explode('|', $room['shout_room']))));\n\t\t\tforeach ($room_users as $room_user)\n\t\t\t{\n\t\t\t\t$list .= $comma . $room_list_ids[$room_user];\n\t\t\t\t$styled_list .= $comma . '<span ' . $room_styled_list_ids[$room_user] . '>' . $room_list_ids[$room_user] . '</span>';\n\t\t\t\t$comma = ', ';\n\t\t\t}\n\t\t\tif ($current_room == ('|' . $chat_room . '|'))\n\t\t\t{\n\t\t\t\t$room_class = ' class=\"active\"';\n\t\t\t\t$chatroom_title = $lang['Private_room'];\n\t\t\t\t$chatroom_userlist = $styled_list;\n\t\t\t}\n\t\t\t$result['rooms'][] = array(\n\t\t\t\t'NAME' => $lang['Private_room'],\n\t\t\t\t'LIST' => $list,\n\t\t\t\t'STYLED_LIST' => $styled_list,\n\t\t\t\t'CLASS' => $room_class,\n\t\t\t\t'LINK' => append_sid($chat_link . '&chat_room=' . implode('|', $room_users))\n\t\t\t);\n\t\t}\n\t}\n\t$result['room_list_ids'] = $room_list_ids;\n\t$result['styled_list_ids'] = $room_styled_list_ids;\n\t$result['title'] = $chatroom_title;\n\t$result['userlist'] = $chatroom_userlist;\n\treturn $result;\n}",
"function client_get_chat_rooms($socket)\n{\n global $chat_room_array;\n\n $temp_array = array_merge($chat_room_array);\n usort($temp_array, 'sort_chat_room_array');\n $str = 'setChatRoomList';\n $count = count($temp_array);\n $count = $count > 8 ? 8 : $count;\n\n for ($i = 0; $i < $count; $i++) {\n $chat_room = $temp_array[$i];\n $room_name = $chat_room->chat_room_name;\n $players = count($chat_room->player_array);\n $lang = $players !== 1 ? 'players' : 'player';\n $str .= \"`$room_name - $players $lang\";\n }\n\n if ($str === 'setChatRoomList') {\n $str .= '`No one is chatting. :(';\n }\n\n $socket->write($str);\n}",
"function listRoom() {\n return $this->fetchAll()->toArray();\n }",
"public static function get_nonempty_rooms()\n\t{\n\t\ttry\n\t\t{\t\t\t\n\t\t\t$devices = DB::query(\"\n\t\t\t\tSELECT distinct(r.name) \n\t\t\t\tFROM rooms r \n\t\t\t\tjoin devices d \n\t\t\t\t\ton r.id = d.room_id\n\t\t\t\t\");\n\t\t\treturn $devices;\n\t\t}\n\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\tLog::write('error', $e->getMessage());\n\t\t\tthrow $e;\n\t\t}\n\t}",
"public function getRooms()\n {\n $rooms = Chat::with(['users'])\n ->whereHas('users', function (Builder $query) {\n $query->where('user_id', Auth::id());\n })->get();\n return $rooms->map(function ($item) {\n $item['status'] = UserChat::where('user_id', Auth::id())\n ->where('chat_id', $item->id)->first()->status;\n return $item;\n });\n }",
"public function get_rooms(){\n\t\t$final_rows = array();\n\t\t$rooms = Rooms::where('type', '!=', 'home')->get();\n\t\t\n\t\tforeach($rooms as $room){\n\t\t\t$logged_count = Users::where('chat_room', '=', $room->id)->count();\n\t\t\t$final_rows = array_add($final_rows, $room->id, array('id'=>$room->id, 'room_name'=>$room->room_name, 'logged_count'=>$logged_count, 'access'=>$room->type));\n\t\t}\n\t\t\n\t\treturn $final_rows;\n\t}",
"public static function getRoomsUserUnpinned(?int $userId = null): array\n\t{\n\t\t$rooms = [];\n\t\t$dataReader = static::getRoomsUserUnpinnedQuery($userId)->createCommand()->query();\n\t\twhile ($row = $dataReader->read()) {\n\t\t\t$row['name'] = $row['first_name'] . ' ' . $row['last_name'];\n\t\t\t$row['roomType'] = 'user';\n\t\t\t$row['recordid'] = $row['id'];\n\t\t\t$rooms[$row['id']] = $row;\n\t\t}\n\t\t$dataReader->close();\n\t\treturn $rooms;\n\t}",
"public function all_rooms()\n\t{\n\t\t$this->db->where('room_status = 1');\n\t\t$query = $this->db->get('room');\n\t\t\n\t\treturn $query;\n\t}",
"public static function getRoomPrivateUnpinnedUsers(int $roomId): array\n\t{\n\t\t$userId = User::getCurrentUserId();\n\t\t$roomType = 'private';\n\t\t$pinnedUsersQuery = (new Db\\Query())\n\t\t\t->select(['USER_PINNED.userid'])\n\t\t\t->from(['USER_PINNED' => static::TABLE_NAME['room'][$roomType]])\n\t\t\t->where(['USER_PINNED.private_room_id' => $roomId]);\n\t\t$query = (new Db\\Query())\n\t\t\t->select(['USERS.id', 'USERS.first_name', 'USERS.last_name'])\n\t\t\t->from(['USERS' => static::TABLE_NAME['users']])\n\t\t\t->where(['and', ['USERS.status' => 'Active'], ['USERS.deleted' => 0], ['not', ['USERS.id' => $userId]]])\n\t\t\t->leftJoin(['PINNED' => $pinnedUsersQuery], 'USERS.id = PINNED.userid')\n\t\t\t->andWhere(['PINNED.userid' => null]);\n\t\t$dataReader = $query->createCommand()->query();\n\t\t$rows = [];\n\t\twhile ($row = $dataReader->read()) {\n\t\t\t$row['img'] = User::getImageById($row['id']) ? User::getImageById($row['id'])['url'] : '';\n\t\t\t$row['label'] = $row['last_name'] . ' ' . $row['first_name'];\n\t\t\t$rows[] = $row;\n\t\t}\n\t\t$dataReader->close();\n\t\treturn $rows;\n\t}",
"public static function getUnreadUsers()\n\t{\n\t\t$myId = \\Auth::user()->id;\n\n\t\t// Get all unread messages directed to me\n\t\t$messages = DB::table('messages')->where('status', '=', 'false')\n\t\t\t\t\t\t\t\t\t\t ->where(function($query) use ($myId) {\t\t\t\n\t\t\t$query->or_where('to', '=', $myId);\n\t\t})->get();\n\n\t\t$users = array();\n\n\t\tforeach($messages as $message)\n\t\t{\n\t\t\t$users[] = $message->from;\n\t\t\t// $users['nick'] = $message->nick;\n\t\t}\n\n\t\treturn array_unique($users);\n\t}",
"public function listRooms()\n {\n return $this->makeRequest('/v1/rooms');\n }",
"public function getRoomList() {\n $response = EncounterServiceProvider::getRoomList();\n return $this->sendJsonResponse($response);\n }",
"public static function getRoomsGroupUnpinned(?int $userId = null): array\n\t{\n\t\tif (empty($userId)) {\n\t\t\t$userId = User::getCurrentUserId();\n\t\t}\n\t\t$groups = User::getUserModel($userId)->getGroupNames();\n\t\t$pinned = [];\n\t\t$rows = [];\n\t\t$query = (new Db\\Query())\n\t\t\t->select(['recordid' => 'ROOM_PINNED.groupid'])\n\t\t\t->from(['ROOM_PINNED' => static::TABLE_NAME['room']['group']])\n\t\t\t->where(['ROOM_PINNED.userid' => $userId]);\n\t\t$dataReader = $query->createCommand()->query();\n\t\twhile ($row = $dataReader->read()) {\n\t\t\t$pinned[] = $row['recordid'];\n\t\t}\n\t\t$dataReader->close();\n\t\tforeach ($groups as $id => $groupName) {\n\t\t\tif (!\\in_array($id, $pinned)) {\n\t\t\t\t$rows[$id] = [\n\t\t\t\t\t'recordid' => $id,\n\t\t\t\t\t'name' => $groupName,\n\t\t\t\t\t'roomType' => 'group'\n\t\t\t\t];\n\t\t\t}\n\t\t}\n\t\treturn $rows;\n\t}",
"public function getNotJoinedActiveChats()\n\t{\n\t\t$str1 = \"\";\n\t\t\n\t\t//get current login user\n\t\t$user = $this->Session->read('UserData.userName');\n\t\t$userCourse = $this->Session->read('UserData.usersCourses');\n\t\t$user_course_section = $userCourse[0];\n\t\t//get Course and section name\n\t\t$course_info = $this->getCourseNameOfUser($user_course_section);\n\t\t$course_name = $course_info->course_name;\n\t\t$course_section = $course_info->section_name;\n\t\t//get joined users array\n\t\t$joined_users = array();\n\t\t$joined_users = $this->__joinedRoomUsers($user_course_section);\n\n\t\t//check if current users is the member of the room_name\n\t\t$notJoinedChat = array();\n\t\tforeach ($joined_users as $single_user) {\n\n\t\t\tif (in_array($user,$single_user['users'])) {\n\n\t\t\t} else {\n\t\t\t\t$notJoinedChat[] = array('room_name'=>$single_user['room_name']);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//return $notJoinedChat;\n\t\t$join_img = $this->webroot.\"img/join.png\";\n\t\t$active_users_img = $this->webroot.\"img/active_users.png\";\n\t\tforeach ($notJoinedChat as $chat_session) {\n\t\t\t$str3 = array();\n\t\t\t$room_name = $chat_session['room_name'];\n\t\t\t$new_room = explode('_', $room_name);\n\t\t\t\n\t\t\t//get Active users joined to this room\n\t\t\t$active_users = $this->__getActiveUsersForRoom($room_name);\n\t\t\tforeach ($active_users as $active_user) {\n\t\t\t\t$str3[] = ucfirst($this->__getUserNickName($active_user));\n\t\t\t}\n\t\t\t$str2 = implode(',', $str3);\n\t\t\t$str1 .=\"<li class='pending_chat_session' id='room_\".$room_name.\"'>\n\t\t\t<span>\".ucfirst($course_name).'-'.date('m/d/Y/h:i:s A', $new_room[1]).\" <input type='image' src='$active_users_img' title='Active users' onClick=showGpActiveUsers('$room_name') /> <input title='Click to join' type='image' src='$join_img' onClick=requestForJoin('$room_name') value='Join'/></span>\n\t\t\t<div class='ac_usr' id='ac_$room_name' style='display:none;'> \".ucfirst($str2).\"</div></li>\";\n\t\t}\n\t\tif ($str1 == \"\") {\n\t\t\techo \"<span class='noresultfound'>No result found</span>\";\n\t\t\texit;\n\t\t}\n\t\techo $str1;\n\t\texit;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parses single name binding | protected function parseSingleNameBinding()
{
if ($left = $this->parseIdentifier(static::$bindingIdentifier)) {
$right = $this->isolateContext(
array("allowIn" => true), "parseInitializer"
);
if ($right) {
$node = $this->createNode("AssignmentPattern", $left);
$node->setLeft($left);
$node->setRight($right);
return $this->completeNode($node);
} else {
return $left;
}
}
return null;
} | [
"public function getBindingMemberName();",
"protected function parseName()\n {\n $this->name = $this->column->Field;\n }",
"private function getBindingName()\n {\n return $this->getDefinitionName() . \"Binding\";\n }",
"public abstract function parsername();",
"private function parseNameValue(){\n\n\t\t$index = $this->pos;\n\t\t$this->save();\n\n\n\t\t//$match = $this->MatchReg('/\\\\G([a-zA-Z\\-]+)\\s*:\\s*((?:\\'\")?[a-zA-Z0-9\\-% \\.,!]+?(?:\\'\")?)\\s*([;}])/');\n\t\t$match = $this->MatchReg('/\\\\G([a-zA-Z\\-]+)\\s*:\\s*([\\'\"]?[#a-zA-Z0-9\\-%\\.,]+?[\\'\"]?) *(! *important)?\\s*([;}])/');\n\t\tif( $match ){\n\n\t\t\tif( $match[4] == '}' ){\n\t\t\t\t$this->pos = $index + strlen($match[0])-1;\n\t\t\t}\n\n\t\t\tif( $match[3] ){\n\t\t\t\t$match[2] .= ' !important';\n\t\t\t}\n\n\t\t\treturn $this->NewObj4('Less_Tree_NameValue',array( $match[1], $match[2], $index, $this->env->currentFileInfo));\n\t\t}\n\n\t\t$this->restore();\n\t}",
"public function getNamedStringArgument($name);",
"protected function assignNames()\n {\n $this->nameMap = [];\n $containerCount = 1;\n\n foreach ($this->allBindings as $binding) {\n if ($binding instanceof FieldBinding) {\n $parts = \\explode(NextForm::SEGMENT_DELIM, $binding->getObject());\n if ($parts[0] === $this->segmentNameDrop) {\n unset($parts[0]);\n }\n $baseName = \\implode('_', $parts);\n $name = $baseName;\n $confirmName = $baseName . NextForm::$confirmLabel;\n $append = 0;\n while (\n isset($this->nameMap[$name])\n || isset($this->nameMap[$confirmName])\n ) {\n $name = $baseName . '_' . ++$append;\n $confirmName = $name . '_' . $append . NextForm::$confirmLabel;\n }\n $this->nameMap[$name] = $binding;\n $binding->setNameOnForm($name);\n } elseif ($binding instanceof ContainerBinding) {\n $baseName = 'container_';\n $name = $baseName . $containerCount;\n while (isset($this->nameMap[$name])) {\n $name = $baseName . ++$containerCount;\n }\n $this->nameMap[$name] = $binding;\n $binding->setNameOnForm($name);\n }\n }\n return $this;\n }",
"final public function getBinding($labelbinding) {}",
"public function getBinding(string $symbol);",
"static function get_parse_name($line_str, &$wiki_title, &$name)\n {\n if (!preg_match('#^\\{\\{BS(\\d*)#', $line_str, $matches)) return false;\n $n = intval(@$matches[1][0]);\n $c = !$n ? '' : \"$n\";\n !$n && $n = 1;\n do {\n if (preg_match_all(\"#\\{\\{BS{$c}(\\|[^\\|]*){{$n}}\\|\\|[\\{\\[]{2}BSto\\|([^\\{\\[]+?)\\|([^\\{\\[]+?)[\\}\\]]{2}#\", \n $line_str, $matches)) break;\n if (preg_match_all(\"#\\{\\{BS{$c}(\\|[^\\|]*){{$n}}\\|\\|[\\{\\[]{2}([^\\{\\[]+?)\\|([^\\{\\[]+?)[\\}\\]]{2}#\", \n $line_str, $matches)) break;\n if (preg_match_all(\"#\\{\\{BS{$c}(\\|[^\\|]*){{$n}}\\|\\|[\\{\\[]*([^\\{\\[]+?)[\\{\\[]*\\|#\", \n $line_str, $matches)) break; \n return false;\n } while(0);\n $match_cnt = count($matches);\n $wiki_title = trim($matches[$match_cnt > 3 ? $match_cnt - 2 : $match_cnt - 1][0], '[]{}');\n $name = trim($matches[$match_cnt - 1][0], '[]{}');\n if ($name == 'under construction') return false;\n return true;\n }",
"protected function p_process_name()\n\t{\n\t\t$name = $this->name;\n\n\t\t// define variables\n\t\t$matches = array();\n\t\t$normal_trip = '';\n\t\t$secure_trip = '';\n\n\t\tif (preg_match(\"'^(.*?)(#)(.*)$'\", $this->name, $matches))\n\t\t{\n\t\t\t$matches_trip = array();\n\t\t\t$name = trim($matches[1]);\n\n\t\t\tpreg_match(\"'^(.*?)(?:#+(.*))?$'\", $matches[3], $matches_trip);\n\n\t\t\tif (count($matches_trip) > 1)\n\t\t\t{\n\t\t\t\t$normal_trip = static::process_tripcode($matches_trip[1]);\n\t\t\t\t$normal_trip = $normal_trip ? '!' . $normal_trip : '';\n\t\t\t}\n\n\t\t\tif (count($matches_trip) > 2)\n\t\t\t{\n\t\t\t\t$secure_trip = '!!' . static::process_secure_tripcode($matches_trip[2]);\n\t\t\t}\n\t\t}\n\n\t\t$this->name = $name;\n\t\t$this->trip = $normal_trip . $secure_trip;\n\n\t\treturn array('name' => $name, 'trip' => $normal_trip . $secure_trip);\n\t}",
"protected function getNextParameterName()\n {\n if (!preg_match(\n '(\\G(?<name>' . $this->regex['name'] . ')=)S',\n $this->rawData, $match, 0, $this->currentPos\n )\n ) {\n throw new Exception\\ParseException('Could not find a parameter name');\n }\n\n $this->currentPos += strlen($match[0]);\n\n return $match['name'];\n }",
"protected function parseName($name)\n\t{\n\t\treturn Str::job($name);\n\t}",
"public function getNamedTypeArgument($name);",
"public function setBinding($name, array $binding);",
"private function parseName()\n {\n if (preg_match('/^remotes\\/(?<remote>[^\\/]*)\\/(?<name>.*)$/', $this->name, $matches)) {\n return [$matches['remote'], $matches['name']];\n }\n\n return [null, $this->name];\n }",
"public function getNamedExpressionArgument($name);",
"protected function _safe_bind($name)\n\t{\n\t\t$name = str_replace('.', '_1_', $name);\n\t\t$name = str_replace('-', '_2_', $name);\n\t\t$name = str_replace('/', '_3_', $name);\n\t\t$name = str_replace('\\\\', '_4_', $name);\n\t\t$name = str_replace(' ', '_5_', $name);\n\n\t\treturn $name;\n\t}",
"protected function normalizeName($name) {\n\tif ($name instanceof PHPParser_Node_Name) {\n\t return $name;\n\t} else {\n\t return new PHPParser_Node_Name($name);\n\t}\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns destination image function | private static function getDestinationFunction(string $imgExtension = null): ?string
{
switch ($imgExtension) {
case 'jpg':
case 'jpeg':
$dst['function'] = 'imagejpeg';
break;
case 'png':
$dst['function'] = 'imagepng';
break;
case 'gif':
$dst['function'] = 'imagegif';
break;
default:
$dst['function'] = null;
break;
}
return $dst['function'];
} | [
"public function getImageDestination()\n {\n return $this->image_destination;\n }",
"function imagepalettecopy($destination,$source)\n{\n}",
"public function getAbsolutePicture();",
"function save_actual_image($image)\r\n{\r\n $pathinfo = pathinfo($_SERVER['SCRIPT_FILENAME']);\r\n $filename = \"{$pathinfo['dirname']}/{$pathinfo['filename']}.out.png\";\r\n imagepng($image, $filename);\r\n}",
"private function getImageFieldDestination() {\n $image_field_config = $this->entityTypeManager\n ->getStorage('field_config')\n ->load('media.image.field_media_image');\n $field_settings = $image_field_config->getSettings();\n $destination = trim($field_settings['file_directory'], '/');\n $destination = PlainTextOutput::renderFromHtml($this->token->replace($destination, []));\n return $field_settings['uri_scheme'] . '://' . $destination;\n }",
"function imagecopy($dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h)\n{\n}",
"function _output_image($destination_file, $image_type, $image){\n // right now $image_type can be JPEG or PNG \n global $ERR; \n $destination_file = trim($destination_file); \n $res = false; \n if($image){ \n switch($image_type) { \n case 'JPEG': \n case 'JPG': \n \n $res = ImageJpeg($image, $destination_file, $this->jpeg_quality); \n break; \n case 'PNG': \n $res = Imagepng($image, $destination_file); \n break; \n default: \n $this->error($ERR[\"UNKNOWN_OUTPUT_FORMAT\"].\" $image_type\"); \n break; \n \n } \n }else{ \n $this->error($ERR[\"NO_IMAGE_FOR_OUTPUT\"]); \n } \n if(!$res) $this->error($ERR[\"UNABLE_TO_OUTPUT\"].\" $destination_file\"); \n return $res; \n }",
"public function getPathToImage()\n {\n $path = $this->getPath('origin');\n if(!file_exists($path)){\n $path = false;\n }\n return $path;\n }",
"public function get_destination() {\n return 'images' . DS . 'posters' . DS . basename($this->image->get_image_path());\n }",
"public function generateMainImage();",
"function imagecopy ($dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h) {}",
"function save($destImagePath);",
"function _imageCopyToType($source, $target)\n{\n\t$source = _imageCreateType($source);\n\treturn _imageDisplayType($source, $target);\n}",
"public function dtoImage()\n {\n }",
"function getImageFilename(){}",
"public function getImageInterpolateMethod() {\n\t}",
"function imagecopyresized ($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h) {}",
"function png();",
"function _imagecheckandcreate($function, $img_file) { \n //inner function used from imagecreatefromfile(). \n //Checks if the function exists and returns \n //created image or false \n global $ERR; \n if(function_exists($function)) { \n $img = $function($img_file); \n }else{ \n $img = false; \n $this->error($ERR[\"FUNCTION_DOESNOT_EXIST\"].\" \".$function); \n } \n\n return $img; \n \n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get tax rates for an item. Caches rates in class to avoid multiple look ups. | protected function get_item_tax_rates($item)
{
} | [
"public function taxRates()\n {\n if (!isset($this->tax_rates)) {\n $this->tax_rates = new Services\\TaxRatesService($this->api_client);\n }\n\n return $this->tax_rates;\n }",
"private function get_tax_rates() {\n\n\t\tif ( ! isset( $this->tax_rates ) ) {\n\n\t\t\t$this->tax_rates = array();\n\n\t\t\tglobal $wpdb;\n\n\t\t\tforeach ( $wpdb->get_results( \"SELECT * FROM {$wpdb->prefix}woocommerce_tax_rates\" ) as $row ) {\n\t\t\t\t$this->tax_rates[ $row->tax_rate_id ] = $row;\n\t\t\t}\n\t\t}\n\n\t\treturn $this->tax_rates;\n\t}",
"public function get_database_item_tax_rate($item_id = FALSE)\r\n\t{\r\n\t\t// Check the item tax table exists in the config file and is enabled.\r\n\t\tif ($this->get_enabled_status('item_tax'))\r\n\t\t{\r\n\t\t\t// Set aliases of item tax table data.\r\n\t\t\t$tbl_item_tax = $this->flexi->cart_database['item_tax'];\r\n\t\t\t$tbl_cols_item_tax = $this->flexi->cart_database['item_tax']['columns'];\r\n\t\t\t\r\n\t\t\t// Get current tax location.\r\n\t\t\t$location = $this->flexi->cart_contents['settings']['tax']['location'];\r\n\t\t\t\r\n\t\t\t// Loop through each location and try to match a tax rate with an item id.\r\n\t\t\tfor($i = 0; isset($location[$i]); $i++)\r\n\t\t\t{\r\n\t\t\t\tif ($location[$i]['location_id'] > 0 || $location[$i]['zone_id'] > 0)\r\n\t\t\t\t{\r\n\t\t\t\t\t$sql_where = $tbl_cols_item_tax['status'].\" = '1' AND \".$tbl_cols_item_tax['item'].\" = \".$this->db->escape($item_id).\" AND (\";\r\n\t\t\t\t\t$sql_where .= \"(\".$tbl_cols_item_tax['location'].\" = '0' AND \".$tbl_cols_item_tax['zone'].\" = '0') OR \";\r\n\t\t\t\t\t$sql_where .= ($location[$i]['location_id'] > 0) ? $tbl_cols_item_tax['location'].\" = \".$this->db->escape($location[$i]['location_id']).\" OR \" : NULL;\r\n\t\t\t\t\t$sql_where .= ($location[$i]['zone_id'] > 0) ? $tbl_cols_item_tax['zone'].\" = \".$this->db->escape($location[$i]['zone_id']) : NULL;\r\n\t\t\t\t\t$sql_where = rtrim($sql_where, ' OR ').\")\";\r\n\t\t\t\t\t\r\n\t\t\t\t\t$query = $this->db->select($tbl_cols_item_tax['rate'])\r\n\t\t\t\t\t\t->from($tbl_item_tax['table'])\r\n\t\t\t\t\t\t->where($sql_where)\r\n\t\t\t\t\t\t->order_by($tbl_cols_item_tax['id'], 'ASC')\r\n\t\t\t\t\t\t->limit(1)\r\n\t\t\t\t\t\t->get();\r\n\t\t\t\t\r\n\t\t\t\t\t// If a match is found.\r\n\t\t\t\t\tif ($query->num_rows() > 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$tax_data = $query->row_array();\r\n\t\t\t\t\t\treturn $tax_rate = (float)$tax_data[$tbl_cols_item_tax['rate']];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn FALSE;\r\n\t}",
"public function getTaxRates() {\n\t\t\n\t\t$oDb = Geko_Wp::get( 'db' );\n\t\t\n\t\tif ( NULL == $this->_aRates ) {\n\t\t\n\t\t\t$aRatesFmt = array();\n\t\t\t\n\t\t\t$oQuery = new Geko_Sql_Select();\n\t\t\t$oQuery\n\t\t\t\t->field( 'tr.province_id', 'province_id' )\n\t\t\t\t->field( 'tr.tax_label', 'tax_label' )\n\t\t\t\t->field( 'tr.tax_pct', 'tax_pct' )\n\t\t\t\t->from( '##pfx##geko_pay_tax_rate', 'tr' )\n\t\t\t;\n\t\t\t\n\t\t\t$aRates = $oDb->fetchAllObj( strval( $oQuery ) );\n\t\t\t\n\t\t\tforeach ( $aRates as $oRate ) {\n\t\t\t\t$aRatesFmt[ $oRate->province_id ] = array(\n\t\t\t\t\t'label' => $oRate->tax_label,\n\t\t\t\t\t'pct' => $oRate->tax_pct\n\t\t\t\t);\n\t\t\t}\n\t\t\t\n\t\t\t$this->_aRates = $aRatesFmt;\n\t\t\t\n\t\t}\n\t\t\n\t\treturn $this->_aRates;\n\t}",
"public function taxRates()\n {\n return $this->taxRates;\n }",
"public function getTaxRate();",
"private function GetTaxRatesList()\n\t{\n\t\t$query = \"select * from [|PREFIX|]tax_rates order by taxratename asc\";\n\t\t$result = $GLOBALS['ISC_CLASS_DB']->Query($query);\n\t\treturn $result;\n\t}",
"public function priceTaxRates()\n {\n return $this->priceTaxRates;\n }",
"function get_tax_rates()\n\t{\n\t//These tax rates will need to be updated every year. The tax rates are valid from 1 March until 28 Feb of the next year.\n\n\t\t$place=0;\n\t\t$sql = \"SELECT * FROM tax_rates\";\n\t\t$result = mysql_query($sql);\n\t\twhile ($row = mysql_fetch_assoc($result)) \n\t\t{\n\t\t\t$tax_rates[$place][1] = $row['tax_rate'];\n\t\t\t$tax_rates[$place][2] = $row['start_bracket'];\n\t\t\t$place++;\n\t\t}\n\n\t\treturn $tax_rates;\n\t}",
"protected function _loadTaxes()\n {\n $taxCalculation = Mage::getModel('tax/calculation');\n $request = $taxCalculation->getRateRequest(null, null, null, $this->_id_store);\n\n $connection = $this->_coreResource->getConnection('core_read');\n\n $query = $connection->select();\n $query->from($this->_table['tax_class'])->order(array('class_id', 'tax_calculation_rate_id'));\n $query->joinleft(array('tc' => $this->_table['tax_calculation']),\n 'tc.product_tax_class_id = ' . $this->_table['tax_class'] . '.class_id',\n 'tc.tax_calculation_rate_id');\n $query->joinleft(array('tcr' => $this->_table['tax_calculation_rate']),\n 'tcr.tax_calculation_rate_id = tc.tax_calculation_rate_id',\n array('tcr.rate', 'tax_country_id', 'tax_region_id'));\n $query->joinleft(array('dcr' => $this->_table['directory_country_region']), 'dcr.region_id=tcr.tax_region_id',\n 'code');\n $query->joinInner(array('cg' => $this->_table['customer_group']),\n 'cg.tax_class_id=tc.customer_tax_class_id AND cg.customer_group_code=\\'NOT LOGGED IN\\'');\n $taxCollection = $connection->fetchAll($query);\n $this->_listTaxes = array();\n $tempClassId = '';\n $classValue = 0;\n foreach ($taxCollection as $tax) {\n if ($tempClassId != $tax['class_id']) {\n $classValue = 0;\n } else {\n ++$classValue;\n }\n $tempClassId = $tax['class_id'];\n if ($request['country_id'] == $tax['tax_country_id']) {\n $this->_listTaxes[$tax['class_id']] = $tax['rate'];\n //$this->_listTaxes[$tax['class_id']][$classValue]['code'] = $tax['code'];\n //$this->_listTaxes[$tax['class_id']][$classValue]['country'] = $tax['tax_country_id'];\n }\n }\n if ($this->_debug) {\n $this->_log('Load Tax Class (' . count($this->_listTaxes) . ')');\n }\n\n if (count($this->_listTaxes) == 0) {\n Mage::helper('lensync/data')->log('Tax configuration is not correct, please enable country : ' . $request['country_id']);\n }\n }",
"function get_tax_rate() {\n\t\t$country = new WPSC_Country( get_option( 'base_country' ) );\n\n\t\t$country_data = WPSC_Countries::get_country( get_option( 'base_country' ), true );\n\t\t$add_tax = false;\n\n\t\tif ( $this->selected_country == get_option( 'base_country' ) ) {\n\t\t\t// Tax rules for various countries go here, if your countries tax rules\n\t\t\t// deviate from this, please supply code to add your region\n\t\t\tswitch ( $this->selected_country ) {\n\t\t\t\tcase 'US' : // USA!\n\t\t\t\t\t$tax_region = get_option( 'base_region' );\n\t\t\t\t\tif ( $this->selected_region == get_option( 'base_region' ) && ( get_option( 'lock_tax_to_shipping' ) != '1' ) ) {\n\t\t\t\t\t\t// if they in the state, they pay tax\n\t\t\t\t\t\t$add_tax = true;\n\t\t\t\t\t} else if ( $this->delivery_region == get_option( 'base_region' ) ) {\n\n\t\t\t\t\t\t// if they live outside the state, but are delivering to within the state, they pay tax also\n\t\t\t\t\t\t$add_tax = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'CA' : // Canada! apparently in canada, the region that you are in is used for tax purposes\n\t\t\t\t\tif ( $this->selected_region != null ) {\n\t\t\t\t\t\t$tax_region = $this->selected_region;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$tax_region = get_option( 'base_region' );\n\t\t\t\t\t}\n\n\t\t\t\t\t$add_tax = true;\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault : // Everywhere else!\n\t\t\t\t\t$tax_region = get_option( 'base_region' );\n\t\t\t\t\tif ( $country->has_regions() ) {\n\t\t\t\t\t\tif ( get_option( 'base_region' ) == $tax_region ) {\n\t\t\t\t\t\t\t$add_tax = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$add_tax = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif ( $add_tax == true ) {\n\t\t\tif ( $country->has_regions() ) {\n\t\t\t\t$region = $country->get_region( $tax_region );\n\t\t\t\t$tax_percentage = $region->get_tax();\n\t\t\t} else {\n\t\t\t\t$tax_percentage = $country->get_tax();\n\t\t\t}\n\t\t} else {\n\t\t\t// no tax charged = tax equal to 0%\n\t\t\t$tax_percentage = 0;\n\t\t}\n\n\t\tif ( $this->tax_percentage != $tax_percentage ) {\n\t\t\t$this->clear_cache();\n\t\t\t$this->tax_percentage = $tax_percentage;\n\t\t\t$this->wpsc_refresh_cart_items();\n\t\t}\n\t}",
"public function getItemJurisdictionRates($itemId);",
"function tep_get_tax_rate($class_id, $country_id = -1, $zone_id = -1) {\n\tglobal $customer_zone_id, $customer_country_id;\n\n\tif ( ($country_id == -1) && ($zone_id == -1) ) {\n\t\tif (Session::exists('customer_id') === false) {\n\t\t\t$country_id = sysConfig::get('STORE_COUNTRY');\n\t\t\t$zone_id = sysConfig::get('STORE_ZONE');\n\t\t} else {\n\t\t\t$country_id = $customer_country_id;\n\t\t\t$zone_id = $customer_zone_id;\n\t\t}\n\t}\n\n\t$Qtax = Doctrine_Query::create()\n\t->select('SUM(tax_rate) as tax_rate')\n\t->from('TaxRates tr')\n\t->leftJoin('ZonesToGeoZones za')\n\t->leftJoin('GeoZones tz')\n\t->where('(za.zone_country_id IS NULL OR za.zone_country_id = 0 OR za.zone_country_id = ?) AND TRUE', (int)$country_id)\n\t->andWhere('(za.zone_id IS NULL OR za.zone_id = 0 OR za.zone_id = ?) AND TRUE', (int)$zone_id)\n\t->andWhere('tr.tax_class_id = ?', (int) $class_id)\n\t->groupBy('tr.tax_priority')\n\t->execute(array(), Doctrine_Core::HYDRATE_ARRAY);\n\tif ($Qtax) {\n\t\t$tax_multiplier = 0;\n\t\tforeach($Qtax as $tInfo){\n\t\t\t$tax_multiplier += $tInfo['tax_rate'];\n\t\t}\n\t\treturn $tax_multiplier;\n\t} else {\n\t\treturn 0;\n\t}\n}",
"public static function getTaxrate()\n\t{\n\t\treturn self::$tax_rate;\n\t}",
"function tep_get_tax_rate($class_id, $country_id = -1, $zone_id = -1) {\n global $customer_zone_id, $customer_country_id,$session;\n\n if ( ($country_id == -1) && ($zone_id == -1) ) {\n if (!$session->is_registered('customer_id')) {\n $country_id = STORE_COUNTRY;\n $zone_id = STORE_ZONE;\n } else {\n $country_id = $customer_country_id;\n $zone_id = $customer_zone_id;\n }\n }\n\n $tax_query = tep_db_query(\"select sum(tax_rate) as tax_rate from \" . TABLE_TAX_RATES . \" tr left join \" . TABLE_ZONES_TO_GEO_ZONES . \" za on (tr.tax_zone_id = za.geo_zone_id) left join \" . TABLE_GEO_ZONES . \" tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '\" . (int)$country_id . \"') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '\" . (int)$zone_id . \"') and tr.tax_class_id = '\" . (int)$class_id . \"' group by tr.tax_priority\");\n if (tep_db_num_rows($tax_query)) {\n $tax_multiplier = 1.0;\n while ($tax = tep_db_fetch_array($tax_query)) {\n $tax_multiplier *= 1.0 + ($tax['tax_rate'] / 100);\n }\n return ($tax_multiplier - 1.0) * 100;\n } else {\n return 0;\n }\n }",
"function get_tax_base_rate() {\n\t\t\n\t\tif ( $this->is_taxable() && get_option('woocommerce_calc_taxes')=='yes') :\n\t\t\t\n\t\t\t$_tax = &new woocommerce_tax();\n\t\t\t$rate = $_tax->get_shop_base_rate( $this->data['tax_class'] );\n\t\t\t\n\t\t\treturn $rate;\n\t\t\t\n\t\tendif;\n\t\t\n\t}",
"public function getRates()\n {\n return $this->rates;\n }",
"function tep_get_tax_rate($class_id, $country_id = -1, $zone_id = -1) {\n global $customer_zone_id, $customer_country_id;\n\n if ( ($country_id == -1) && ($zone_id == -1) ) {\n if (!tep_session_is_registered('customer_id')) {\n $country_id = STORE_COUNTRY;\n $zone_id = STORE_ZONE;\n } else {\n $country_id = $customer_country_id;\n $zone_id = $customer_zone_id;\n }\n }\n\n $tax_query = tep_db_query(\"select SUM(tax_rate) as tax_rate from \" . TABLE_TAX_RATES . \" tr left join \" . TABLE_ZONES_TO_GEO_ZONES . \" za ON tr.tax_zone_id = za.geo_zone_id left join \" . TABLE_GEO_ZONES . \" tz ON tz.geo_zone_id = tr.tax_zone_id WHERE (za.zone_country_id IS NULL OR za.zone_country_id = '0' OR za.zone_country_id = '\" . (int)$country_id . \"') AND (za.zone_id IS NULL OR za.zone_id = '0' OR za.zone_id = '\" . (int)$zone_id . \"') AND tr.tax_class_id = '\" . (int)$class_id . \"' GROUP BY tr.tax_priority\");\n if (tep_db_num_rows($tax_query)) {\n $tax_multiplier = 0;\n while ($tax = tep_db_fetch_array($tax_query)) {\n $tax_multiplier += $tax['tax_rate'];\n }\n return $tax_multiplier;\n } else {\n return 0;\n }\n }",
"protected function getPriceByTaxRate( \\Aimeos\\MShop\\Order\\Item\\Base\\Iface $basket )\n\t{\n\t\t$taxrates = [];\n\t\t$manager = \\Aimeos\\MShop\\Factory::createManager( $this->getContext(), 'price' );\n\n\t\tforeach( $basket->getProducts() as $product )\n\t\t{\n\t\t\t$price = $product->getPrice();\n\t\t\t$taxrate = $price->getTaxRate();\n\n\t\t\tif( !isset( $taxrates[$taxrate] ) ) {\n\t\t\t\t$taxrates[$taxrate] = $manager->createItem();\n\t\t\t}\n\n\t\t\t$taxrates[$taxrate]->addItem( $price, $product->getQuantity() );\n\t\t}\n\n\t\tforeach( $basket->getService( 'delivery' ) as $service )\n\t\t{\n\t\t\t$price = clone $service->getPrice();\n\t\t\t$taxrate = $price->getTaxRate();\n\n\t\t\tif( !isset( $taxrates[$taxrate] ) ) {\n\t\t\t\t$taxrates[$taxrate] = $manager->createItem();\n\t\t\t}\n\n\t\t\t$taxrates[$taxrate]->addItem( $price );\n\n\t\t}\n\n\t\tforeach( $basket->getService( 'payment' ) as $service )\n\t\t{\n\t\t\t$price = clone $service->getPrice();\n\t\t\t$taxrate = $price->getTaxRate();\n\n\t\t\tif( !isset( $taxrates[$taxrate] ) ) {\n\t\t\t\t$taxrates[$taxrate] = $manager->createItem();\n\t\t\t}\n\n\t\t\t$taxrates[$taxrate]->addItem( $price );\n\t\t}\n\n\t\treturn $taxrates;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Websocket Account Pull POST /api/v3/userDataStream | public function postUserDataStream(array $data = [], string $version = Version::V3)
{
$this->type = 'POST';
$this->path = '/api/' . $version . '/userDataStream';
$this->data = $data;
return $this->exec();
} | [
"public function userWebsocket($params)\n {\n $this->_makeWebsocketRequest('USER', $params);\n }",
"function getUserRealTimeStream() {\n\t\treturn $this->httpGet($this->_baseUrl.'posts/stream/global');\n\t\t//return $this->httpGet($this->_baseUrl.'streams/user');\n\n\t}",
"public function getUserDataApiEndpoint() {\n $url = 'users/self';\n\n $query = [\n 'access_token' => $this->getAccessToken()\n ];\n\n return $this->endpoint . $url . '/?' . urldecode(http_build_query($query));\n }",
"public function trackUserData(){\n\t\t$userObj = $this->getUserObj();\n\t\tif($userObj){\n\t\t\tnc_analytic::send(array(\n\t\t\t\t\"appname\"=>STATUS == \"live\" ? APP_NAMESPACE : APP_NAMESPACE.\"_staging\",\n\t\t\t\t\"method\"=>\"userData\",\n\t\t\t\t\"param\"=>array(\n\t\t\t\t\t\"name\"=>$userObj[\"name\"],\n\t\t\t\t\t\"email\"=>$userObj[\"email\"],\n\t\t\t\t\t\"fbid\"=>$userObj[\"fbid\"],\n\t\t\t\t\t\"phone\"=>$userObj[\"phone\"],\n\t\t\t\t\t\"ic\"=>$userObj[\"ic\"],\n\t\t\t\t\t\"gender\"=>$userObj[\"sex\"],\n\t\t\t\t\t\"age\"=>$userObj[\"age\"],\n\t\t\t\t\t\"country\"=>$userObj[\"country\"],\n\t\t\t\t\t\"pdpa\"=>$userObj[\"pdpa\"] == 1 ? \"accept\":\"deny\",\n\t\t\t\t\t\"ip\"=>$userObj[\"ip\"]\n\t\t\t\t)\n\t\t\t));\n\t\t}\n\t}",
"function verify_connection($uid, $pid)\r\n{\r\n global $_user;\r\n // user-stream specific id\r\n $user_stream = $uid . '-' . $pid;\r\n $_user['user_stream'] = $user_stream;\r\n $account_data = db::get($user_stream);\r\n if (is_array($account_data)) {\r\n // append stream specific data to _user array\r\n $_user = array_merge($_user, $account_data);\r\n // user is connected\r\n $_user['connected'] = true;\r\n }\r\n}",
"public function getClientStreaming() {}",
"protected function onWebsocketMessage ($data) {\r\n $user_id = $data['user'];\r\n $channel = $data['channel'];\r\n\r\n // Get the personal message channel.\r\n if (!isset($this->im_channels[$user_id])) return;\r\n $im_channel = $this->im_channels[$user_id];\r\n\r\n // Check that it is a personal message channel.\r\n if ($channel != $im_channel) return;\r\n\r\n // Check that the user data exists.\r\n if (!isset($this->users[$user_id])) return;\r\n $user = $this->users[$user_id];\r\n\r\n $this->server->logger->notice(\"Got personal message from user: \" . var_export($data, TRUE));\r\n\r\n // Nothing to do if there's no text.\r\n if (empty($data['text'])) return;\r\n\r\n // print \"Got a message: \" . $data['text'] . \"\\n\";\r\n\r\n // Add additional information about the user.\r\n $data['user_info'] = $user;\r\n\r\n // Create a Session and see if it triggers an action and delivers a Message array.\r\n $session = new Session;\r\n $messages = $session->run($data);\r\n \r\n // print \"Received \" . count($messages) . \" message(s).\\n\";\r\n\r\n // If this is not an array, we're done.\r\n if (!is_array($messages)) {\r\n $this->server->logger->err('Response from user input was not Message class. Response: ' . var_export($messages, true));\r\n\r\n // TODO: Send a friendly error message to user about the problem.\r\n $messages = array(\r\n Message::error('There was an error executing this command.', $session->data->channel),\r\n );\r\n }\r\n\r\n // Dispatch the messages.\r\n foreach ($messages as $message) {\r\n $this->dispatcher->dispatch($message);\r\n }\r\n }",
"public function exportData(){\n\n\t\t//Login & valid password required\n\t\tuser_login_required();\n\t\tcheck_post_password(userID, \"password\");\n\n\t\t//Generate and get data set\n\t\t$data = components()->account->export(userID);\n\n\t\t//Process data set\n\n\n\t\t//Find the users to fetch information about too\n\t\t$users = array();\n\t\t$add_user_id = function(int $userID, array &$list){\n\t\t\tif(!in_array($userID, $list))\n\t\t\t\t$list[] = $userID;\n\t\t};\n\t\t\n\t\t//Friends\n\t\tforeach($data[\"friends_list\"] as $friend)\n\t\t\t$add_user_id($friend->getFriendID(), $users);\n\t\t\n\t\t//Posts\n\t\tforeach($data[\"posts\"] as $num => $post){\n\t\t\t$add_user_id($post->get_userID(), $users);\n\n\t\t\t//Process post comments\n\t\t\tif($post->has_comments()){\n\t\t\t\tforeach($post->get_comments() as $comment)\n\t\t\t\t\t$add_user_id($comment->get_userID(), $users);\n\t\t\t}\n\t\t}\n\t\t\t\n\t\t//Comments\n\t\tforeach($data[\"comments\"] as $num => $comment)\n\t\t\t$add_user_id($comment->get_userID(), $users);\n\t\t\n\t\t//Conversation members\n\t\tforeach($data[\"conversations_list\"] as $num => $conversation){\n\t\t\tforeach($conversation->get_members() as $member)\n\t\t\t\t$add_user_id($member, $users);\n\t\t}\n\n\t\t//Conversation messages\n\t\tforeach($data[\"conversations_messages\"] as $num => $conversation){\n\t\t\tforeach($conversation as $message)\n\t\t\t\t$add_user_id($message->get_userID(), $users);\n\t\t}\n\n\t\t//Fetch information about related users\n\t\t$data[\"users_info\"] = components()->user->getMultipleUserInfos($users);\n\n\n\n\n\t\t//Prepare API return\n\t\t//Advanced user information\n\t\t$data[\"advanced_info\"] = userController::advancedUserToAPI($data[\"advanced_info\"]);\n\n\t\t//Posts\n\t\tforeach($data[\"posts\"] as $num => $post)\n\t\t\t$data[\"posts\"][$num] = PostsController::PostToAPI($post);\n\t\t\n\t\t//Comments\n\t\tforeach($data[\"comments\"] as $num => $comment)\n\t\t\t$data[\"comments\"][$num] = CommentsController::commentToAPI($comment);\n\n\t\t//Likes\n\t\tforeach($data[\"likes\"] as $num => $like)\n\t\t\t$data[\"likes\"][$num] = LikesController::UserLikeToAPI($like);\n\t\t\n\t\t//Survey responses\n\t\tforeach($data[\"survey_responses\"] as $num => $response)\n\t\t\t$data[\"survey_responses\"][$num] = SurveysController::SurveyResponseToAPI($response);\n\t\t\n\t\t//Movies\n\t\tforeach($data[\"movies\"] as $num => $movie)\n\t\t\t$data[\"movies\"][$num] = MoviesController::MovieToAPI($movie);\n\n\t\t//All conversations messages from user\n\t\tforeach($data[\"all_conversation_messages\"] as $num => $message)\n\t\t\t$data[\"all_conversation_messages\"][$num] = ConversationsController::ConvMessageToAPI($message);\n\n\t\t//Conversations list\n\t\tforeach($data[\"conversations_list\"] as $num => $conversation)\n\t\t\t$data[\"conversations_list\"][$num] = ConversationsController::ConvInfoToAPI($conversation);\n\t\t\n\t\t//Conversation messages\n\t\tforeach($data[\"conversations_messages\"] as $convID=>$messages){\n\t\t\tforeach($messages as $num=>$message)\n\t\t\t\t$data[\"conversations_messages\"][$convID][$num] = ConversationsController::ConvMessageToAPI($message); \n\t\t}\n\n\t\t//Friends list\n\t\tforeach($data[\"friends_list\"] as $num => $friend)\n\t\t\t$data[\"friends_list\"][$num] = friendsController::parseFriendAPI($friend);\n\n\t\t//Users information\n\t\tforeach($data[\"users_info\"] as $num => $user)\n\t\t\t$data[\"users_info\"][$num] = userController::userToAPI($user);\n\t\t\n\t\treturn $data;\n\t\n\t}",
"function webhook(){\n\n\t//1 recup de l'header et verifie si signature dropbox\n\t$signature = (isset(getallheaders()['X-Dropbox-Signature'])) ? getallheaders()['X-Dropbox-Signature'] : \"signature invalide\" ;\n\t//comment vérifier la signature ? (non facultatif)\n\n\t//2 recup du json\n\t$data = file_get_contents(\"php://input\"); \n\t$uidList = json_decode($data);\n\t// file_put_contents('dblog.txt',$data.\"\\n\".$uidList);\n\n\t//3 repondre rapidement\n\techo 'Lancement process_user';\n\tprocess_user();\n\t//nb : on n'utilise pas les uid donc cette fonction pourrait se résumer en process_user();\n}",
"protected function outgoingOneUser($connect,$userid){\n\t\t\n $one_user = $this->db_profile->getFriendById($this->getUserIdByConnect($connect),$userid);\n \t \n \t$json = array();\n $json[\"transport\"]=TRANSPORT_PROFILE;\n\t$json[\"type\"]=OUTGOING_USERS_DELTA;\n\t$json[\"last_timestamp\"]=time();\t\n $json[\"users\"]=array();\n\t$json[\"users\"][]=$one_user;\n\t\n\t\n\t$data_string=json_encode($json);\n\t\t\n\tfwrite($connect, $this->encode($data_string));\t\t\n $this->log(\"outgoingOneUser. userid=\".$this->getUserIdByConnect($connect).\" connectId=\".$this->getIdByConnect($connect).\", json=\".json_encode($json)); \n}",
"public function getWebsocketsToken(): WebsocketToken;",
"function getUsersRealTimeStream($user_ids=null) {\n\n\t\t$str = json_encode($user_ids);\n\t\treturn $this->httpGet($this->_baseUrl.'streams/app?user_ids='.$str);\n\n\t}",
"public function process()\n {\n parent::process();\n\n // Get the data from the AllPlayers webhook.\n $data = $this->getData();\n\n // Get RosterID from the partner-mapping API.\n $roster = $method = '';\n $roster = $this->partner_mapping->readPartnerMap(\n PartnerMap::PARTNER_MAP_USER,\n $data['member']['uuid'],\n $data['group']['uuid']\n );\n\n // Create a new user on TeamSnap, if the resource was not found.\n if (isset($roster['message'])) {\n $method = self::HTTP_POST;\n } elseif (isset($roster['external_resource_id'])) {\n $method = self::HTTP_PUT;\n $roster = $roster['external_resource_id'];\n }\n\n // Get TeamID from the partner-mapping API.\n $team = $this->partner_mapping->readPartnerMap(\n PartnerMap::PARTNER_MAP_GROUP,\n $data['group']['uuid'],\n $data['group']['uuid']\n );\n $team = $team['external_resource_id'];\n\n // Build the webhook payload; defaults to account information\n // for missing elements that are required.\n $send = array();\n $webform = $data['webform']['data'];\n if (isset($webform['profile__field_firstname__profile'])) {\n $send['first'] = $webform['profile__field_firstname__profile'];\n } elseif ($method == self::HTTP_POST && !isset($webform['profile__field_firstname__profile'])) {\n // Required element missing, use profile info.\n $send['first'] = $data['member']['first_name'];\n }\n if (isset($webform['profile__field_lastname__profile'])) {\n $send['last'] = $webform['profile__field_lastname__profile'];\n } elseif ($method == self::HTTP_POST && !isset($webform['profile__field_lastname__profile'])) {\n // Required element missing, use profile info.\n $send['last'] = $data['member']['last_name'];\n }\n\n // Override email address with guardians email, if present.\n if (isset($data['member']['guardian'])) {\n $send['roster_email_addresses_attributes'] = $this->getEmailResource(\n $data['member']['guardian']['email'],\n $data['member']['uuid'],\n $data['group']['uuid']\n );\n } else {\n if (isset($webform['profile__field_email__profile'])) {\n $send['roster_email_addresses_attributes'] = $this->getEmailResource(\n $webform['profile__field_email__profile'],\n $data['member']['uuid'],\n $data['group']['uuid']\n );\n } elseif ($method == self::HTTP_POST && !isset($webform['profile__field_email__profile'])) {\n // Required element missing, use profile info.\n $send['roster_email_addresses_attributes'] = $this->getEmailResource(\n $data['member']['email'],\n $data['member']['uuid'],\n $data['group']['uuid']\n );\n }\n }\n\n if (isset($webform['profile__field_birth_date__profile'])) {\n $send['birthdate'] = $webform['profile__field_birth_date__profile'];\n }\n if (isset($webform['profile__field_user_gender__profile'])) {\n $send['gender'] = $webform['profile__field_user_gender__profile'] == 1 ? 'Male' : 'Female';\n }\n\n // Add roster phone numbers, if present.\n $roster_telephones_attributes = array();\n if (isset($webform['profile__field_phone__profile'])) {\n // Check for an existing phone number.\n $query = $this->partner_mapping->readPartnerMap(\n PartnerMap::PARTNER_MAP_USER,\n $data['member']['uuid'],\n $data['group']['uuid'],\n PartnerMap::PARTNER_MAP_SUBTYPE_USER_PHONE\n );\n\n // Dynamically adjust payload label/id.\n $key = $value = null;\n if (array_key_exists('external_resource_id', $query)) {\n $key = 'id';\n $value = $query['external_resource_id'];\n } else {\n $key = 'label';\n $value = 'Home';\n }\n\n // Add home phone info to payload.\n $roster_telephones_attributes[] = array(\n $key => $value,\n 'phone_number' => $webform['profile__field_phone__profile'],\n );\n }\n if (isset($webform['profile__field_phone_cell__profile'])) {\n // Check for existing cell phone number.\n $query = $this->partner_mapping->readPartnerMap(\n PartnerMap::PARTNER_MAP_USER,\n $data['member']['uuid'],\n $data['group']['uuid'],\n PartnerMap::PARTNER_MAP_SUBTYPE_USER_PHONE_CELL\n );\n\n // Dynamically adjust payload label/id.\n $key = $value = null;\n if (array_key_exists('external_resource_id', $query)) {\n $key = 'id';\n $value = $query['external_resource_id'];\n } else {\n $key = 'label';\n $value = 'Cell';\n }\n\n // Add cell phone info to payload.\n $roster_telephones_attributes[] = array(\n $key => $value,\n 'phone_number' => $webform['profile__field_phone_cell__profile'],\n );\n }\n if (isset($webform['profile__field_work_number__profile'])) {\n // Check for existing work phone number.\n $query = $this->partner_mapping->readPartnerMap(\n PartnerMap::PARTNER_MAP_USER,\n $data['member']['uuid'],\n $data['group']['uuid'],\n PartnerMap::PARTNER_MAP_SUBTYPE_USER_PHONE_WORK\n );\n\n // Dynamically adjust payload label/id.\n $key = $value = null;\n if (array_key_exists('external_resource_id', $query)) {\n $key = 'id';\n $value = $query['external_resource_id'];\n } else {\n $key = 'label';\n $value = 'Work';\n }\n\n // Add work phone info to payload.\n $roster_telephones_attributes[] = array(\n $key => $value,\n 'phone_number' => $webform['profile__field_work_number__profile'],\n );\n }\n if (count($roster_telephones_attributes) > 0) {\n $send['roster_telephones_attributes'] = $roster_telephones_attributes;\n }\n\n // Add address fields, if present.\n if (isset($webform['profile__field_home_address_street__profile'])) {\n $send['address'] = $webform['profile__field_home_address_street__profile'];\n }\n if (isset($webform['profile__field_home_address_additional__profile'])) {\n $send['address2'] = $webform['profile__field_home_address_additional__profile'];\n }\n if (isset($webform['profile__field_home_address_city__profile'])) {\n $send['city'] = $webform['profile__field_home_address_city__profile'];\n }\n if (isset($webform['profile__field_home_address_province__profile'])) {\n $send['state'] = $webform['profile__field_home_address_province__profile'];\n }\n if (isset($webform['profile__field_home_address_postal_code__profile'])) {\n $send['zip'] = $webform['profile__field_home_address_postal_code__profile'];\n }\n if (isset($webform['profile__field_home_address_country__profile'])) {\n $send['country'] = $webform['profile__field_home_address_country__profile'];\n }\n\n // Update the request and let PostWebhooks complete.\n $this->setData(array('roster' => $send));\n $this->domain .= '/teams/' . $team . '/as_roster/'\n . $this->webhook->subscriber['commissioner_id']\n . '/rosters';\n\n if ($method == self::HTTP_POST) {\n parent::post();\n } else {\n $this->domain .= '/' . $roster;\n parent::put();\n }\n }",
"public function process()\n {\n parent::process();\n\n // Get the data from the AllPlayers webhook.\n $data = $this->getData();\n\n // Get the UserID from partner-mapping API.\n $method = $roster = '';\n $roster = $this->partner_mapping->readPartnerMap(\n PartnerMap::PARTNER_MAP_USER,\n $data['member']['uuid'],\n $data['group']['uuid']\n );\n\n // Create a new user on TeamSnap, if the resource was not found.\n if (isset($roster['message'])) {\n $method = self::HTTP_POST;\n } elseif (isset($roster['external_resource_id'])) {\n $method = self::HTTP_PUT;\n $roster = $roster['external_resource_id'];\n }\n\n // Get the TeamID from partner-mapping API.\n $team = $this->partner_mapping->readPartnerMap(\n PartnerMap::PARTNER_MAP_GROUP,\n $data['group']['uuid'],\n $data['group']['uuid']\n );\n $team = $team['external_resource_id'];\n\n // Build the webhook payload.\n $send = array();\n switch ($data['member']['role_name']) {\n case 'Owner':\n // Owner role does not exist by default, but it is injected when\n // the UserAddsRole webhook is created during the\n // UserCreatesGroup webhook. This is used to avoid further hacks\n // inside the UserCreatesGroup webhook for adding the creator.\n $send['non_player'] = 1;\n $send['is_manager'] = 1;\n $send['is_commissioner'] = 0;\n $send['is_owner'] = 1;\n break;\n case 'Player':\n $send['non_player'] = 0;\n break;\n case 'Admin':\n case 'Manager':\n case 'Coach':\n $send['is_manager'] = 1;\n break;\n case 'Fan':\n // If the user is being created, specify non-player\n // role, otherwise disregard to avoid overwriting\n // a pre-existing player status.\n if ($method == self::HTTP_POST) {\n $send['non_player'] = 1;\n }\n break;\n case 'Guardian':\n // Ignore AllPlayers guardian changes.\n $this->setSend(self::WEBHOOK_CANCEL);\n break;\n }\n\n // Add email information to the webhook payload.\n if (isset($data['member']['guardian'])) {\n $send['roster_email_addresses_attributes'] = $this->getEmailResource(\n $data['member']['guardian']['email'],\n $data['member']['uuid'],\n $data['group']['uuid']\n );\n } else {\n $send['roster_email_addresses_attributes'] = $this->getEmailResource(\n $data['member']['email'],\n $data['member']['uuid'],\n $data['group']['uuid']\n );\n }\n\n $this->domain .= '/teams/' . $team . '/as_roster/'\n . $this->webhook->subscriber['commissioner_id']\n . '/rosters';\n\n // Create/update partner-mapping information.\n if ($method == self::HTTP_POST) {\n // Add additional information to the payload.\n $send['first'] = $data['member']['first_name'];\n $send['last'] = $data['member']['last_name'];\n\n // Update the request and let PostWebhooks complete.\n $this->setData(array('roster' => $send));\n parent::post();\n } else {\n $this->domain .= '/' . $roster;\n\n // Update the request and let PostWebhooks complete.\n $this->setData(array('roster' => $send));\n parent::put();\n }\n }",
"public function getPushData();",
"function user_profile_post()\n\t{\n\t\t$response = array('status' => false, 'message' => '', 'response' => array());\n\t\t$user_input = $this->client_request;\n\t\textract($user_input);\n \n if(!$user_id)\n\t\t{\n\t\t\t$response = array('status' => false, 'message' => 'Enter user id!', 'response' => array());\n\t\t\tTrackResponse($user_input, $response);\t\t\n\t\t\t$this->response($response);\n\t\t}\n\n\t\t$user_details = user_by_id($user_id);\n\t\t//print_r($user_details);exit;\n\t//echo $this->db->last_query();exit;\n\t\tif(empty($user_details))\n\t\t{\n\t\t\t$response = array('status' => false, 'message' => 'No Data Found!', 'response' => array());\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$response = array('status' => true, 'message' => 'Data Fetched Successfully!', 'response' => $user_details);\n\t\t}\n\n\t\tTrackResponse($user_input, $response);\t\t\n\t\t$this->response($response);\n\t}",
"function remote_login_resource_post_request($merchant , $parameter){\n /*\n * check merchant ID and toke validation\n * */\n $query = db_select(\"remote_login_log\" , \"log\");\n $query->fields(\"log\" , array(\"uid\"));\n $query->condition(\"log.merchant\" , $merchant)->condition(\"log.token\" , $parameter[\"token\"]);\n $uid = $query->execute()->fetch();\n if(empty($uid) || $uid->uid == 0) return array(\"status\" => 401 , \"error\" => \"Authorization Failed!\");\n $uid = $uid->uid;\n\n /*\n * fetch setting of information that should send to user\n * */\n $setting = db_select(\"remote_login_subscription\" , \"subscription\")\n ->fields(\"subscription\" , array(\"setting\"))\n ->condition(\"merchant\" , $merchant)->execute()->fetch();\n $setting = unserialize($setting->setting);\n\n /*\n * send user information to customer\n * */\n $query = db_select(\"users\" , \"user\");\n $query->join(\"profile\" , \"profile\" , \"user.uid = profile.uid and profile.type = 'main' \");\n $query->leftJoin(\"field_data_field_full_name\" , \"full_name\" , \"profile.pid = full_name.entity_id\");\n $query->fields(\"user\" , array(\"uid\" , \"name\" , \"mail\"));\n $query->addField(\"full_name\" , \"field_full_name_value\" , \"full_name\");\n $query->condition(\"user.uid\" , $uid);\n $user = $query->execute()->fetch();\n $info = new stdClass();\n foreach($setting as $value){\n $info->$value = $user->$value;\n }\n\n return array(\"status\" => 200 , \"user\" => $info);\n}",
"public function stream()\n\t{\n\t\t// get user/pass from config/twitter.php\n\t\t$this->CI->config->load('twitter');\n\t\t$user = $this->CI->config->item('user');\n\t\t$pass = $this->CI->config->item('pass');\n\t\t// check if user and pass are set\n\t\tif( !isset($user) || !isset($pass) || !$user || !$pass )\n\t\t{\n\t\t\techo 'ERROR: Username or password not found.'.PHP_EOL;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// start an infinite loop for reconnection attempts\n\t\t\twhile(1)\n\t\t\t{\n\t\t\t\t$fp = fsockopen(\"ssl://stream.twitter.com\", 443, $errno, $errstr, 30); // has to be ssl\n\t\t\t\tif(!$fp)\n\t\t\t\t{\n\t\t\t\t\techo $errstr.'('.$errno.')'.PHP_EOL;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// build request\n\t\t\t\t\t$trackstring=implode(',',$this->terms);\n\t\t\t\t\t$query_data = array('track' => $trackstring,'include_entities' => 'true');\n\t\t\t\t\t$request = \"GET /1/statuses/filter.json?\" . http_build_query($query_data) . \" HTTP/1.1\\r\\n\";\n\t\t\t\t\t$request .= \"Host: stream.twitter.com\\r\\n\";\n\t\t\t\t\t$request .= \"Authorization: Basic \" . base64_encode($user . ':' . $pass) . \"\\r\\n\\r\\n\";\n\t\t\t\t\t// write request\n\t\t\t\t\tfwrite($fp, $request);\n\t\t\t\t\t// set stream to non-blocking - research if this is really needed.\n\t\t\t\t\t// stream_set_blocking($fp, 0);\n\t\t\t\t\twhile(!feof($fp))\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$read = array($fp);\n\t\t\t\t\t\t$write = null;\n\t\t\t\t\t\t$except = null;\n\n\t\t\t\t\t\t// Select, wait up to 10 minutes for a tweet.\n\t\t\t\t\t\t// If no tweet, reconnect by retsarting loop.\n\t\t\t\t\t\t$res = stream_select($read, $write, $except, 600, 0);\n\t\t\t\t\t\tif ( ($res == false) || ($res == 0) )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$json = fgets($fp);\n\t\t\t\t\t\t$data = json_decode($json, true);\n\t\t\t\t\t\tif($data)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->process($data);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfclose($fp);\n\t\t\t\t\t// sleep for ten seconds before reconnecting\n\t\t\t\t\tsleep(10);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function imported_user() {\n\t\t$this->emit_sse_message( array(\n\t\t\t'action' => 'updateDelta',\n\t\t\t'type' => 'users',\n\t\t\t'delta' => 1,\n\t\t));\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation createBlobStoreAsync Create an S3 blob store | public function createBlobStoreAsync($body = null)
{
return $this->createBlobStoreAsyncWithHttpInfo($body)
->then(
function ($response) {
return $response[0];
}
);
} | [
"public function it_should_be_able_to_create_an_s3_storeage_instance()\n {\n $attachment = $this->buildMockAttachment('s3');\n\n $storage = Storage::create($attachment);\n\n $this->assertInstanceOf('Codesleeve\\Stapler\\Storage\\S3', $storage);\n }",
"public function createBlobStoreAsyncWithHttpInfo($body = null)\n {\n $returnType = '';\n $request = $this->createBlobStoreRequest($body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"private function createS3Container()\n {\n $key = $this->ask('Access key ID?');\n $secret = $this->ask('Secret access key?');\n $bucket = $this->ask('Bucket name?');\n $region = $this->askWithCompletion('Region?', $this->s3Regions, 'us-east-1');\n $path = $this->ask('If you want to use a subdirectory for this container, enter the path.', '/');\n\n $data = compact('key', 'secret', 'bucket', 'region', 'path');\n\n // If the validation failed...\n if (! $this->validateS3($data)) {\n // Show them what data they entered\n $this->outputS3RetrySummary($data);\n\n // Retry if they chose not to proceed with the invalid credentials\n if (! $this->confirm('Would you like to create the container anyway?')) {\n return $this->createS3Container();\n }\n }\n\n $this->createContainer('s3', $data);\n }",
"public function create_store();",
"public function createStoreAsync($request)\n {\n return $this->createStoreAsyncWithHttpInfo($request)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function createFileBlobStoreAsyncWithHttpInfo($body = null)\n {\n $returnType = '';\n $request = $this->createFileBlobStoreRequest($body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function createStorage();",
"public function createStore($store_name) {\n\n $file_name = $this->buildTableFileName($store_name);\n\n try {\n\n return $this->createBlankFile($file_name);\n }\n catch (FileAlreadyExists $e) {\n\n throw new KeyPartyException(sprintf('Attempt to create store failed. Jar %s already exists.', $store_name));\n }\n }",
"function create_bucket($bucket = NULL) {\n if (is_null($bucket)) {\n $bucket = $this->get_bucket_name();\n }\n $client = $this->client_factory();\n if (!$client->doesBucketExist($bucket)) {\n drush_log(dt('Creating S3 bucket `%bucket`.', array('%bucket' => $bucket)));\n $result = $client->createBucket(array(\n 'Bucket' => $bucket,\n ));\n // Wait until the bucket is created.\n $client->waitUntilBucketExists(array('Bucket' => $bucket));\n if ($client->doesBucketExist($bucket)) {\n drush_log(dt('Created S3 bucket `%bucket`.', array('%bucket' => $bucket)), 'success');\n return $result;\n }\n else {\n return drush_set_error('ERROR_S3_BUCKET_NOT_CREATED', dt('Could not create S3 bucket `%bucket`.', array('%bucket' => $bucket)));\n }\n }\n else {\n return drush_set_error('ERROR_S3_BUCKET_ALREADY_EXISTS', dt('S3 bucket `%bucket` already exists.', array('%bucket' => $bucket)));\n }\n }",
"function create_storage_unit($name, $properties, $indexes);",
"protected function createFileBlobStoreRequest($body = null)\n {\n\n $resourcePath = '/v1/blobstores/file';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function createFileBlobStore($body = null)\n {\n $this->createFileBlobStoreWithHttpInfo($body);\n }",
"protected function getBlobStoreRequest($name)\n {\n // verify the required parameter 'name' is set\n if ($name === null || (is_array($name) && count($name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $name when calling getBlobStore'\n );\n }\n\n $resourcePath = '/v1/blobstores/s3/{name}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($name !== null) {\n $resourcePath = str_replace(\n '{' . 'name' . '}',\n ObjectSerializer::toPathValue($name),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function createBucket() {\r\n\t\t$response['status'] = 'fail';\r\n\t\t$BUCKET_NAME = 'tutorialbucket001';\r\n\r\n\t\t//Creating S3 Bucket\r\n\t\ttry {\r\n\t\t\t$response['status'] = 'success';\r\n\t\t\t$result = $this->s3->createBucket([\r\n\t\t\t\t'Bucket' => $BUCKET_NAME,\r\n\t\t\t]);\r\n\t\t\t$result = $result->toArray();\r\n\t\t\t$response['data'] = $result;\r\n\t\t\t\r\n\t\t} catch (AwsException $e) {\r\n\t\t\t$response['status'] = 'fail';\r\n\t\t\t// output error message if fails\r\n\t\t\t$response['data'] = $e->getMessage();\r\n\t\t\t//echo $e->getMessage();\r\n\t\t\t//echo \"\\n\";\r\n\t\t}\r\n\t\treturn $response;\r\n\r\n\t}",
"public function createLogstore(CreateLogstoreRequest $request){\r\n $headers = array ();\r\n $params = array ();\r\n $resource = '/logstores';\r\n $project = $request->getProject () !== null ? $request->getProject () : '';\r\n $headers[\"x-log-bodyrawsize\"] = 0;\r\n $headers[\"Content-Type\"] = \"application/json\";\r\n $body = array(\r\n \"logstoreName\" => $request -> getLogstore(),\r\n \"ttl\" => (int)($request -> getTtl()),\r\n \"shardCount\" => (int)($request -> getShardCount())\r\n );\r\n $body_str = json_encode($body);\r\n list($resp,$header) = $this -> send(\"POST\",$project,$body_str,$resource,$params,$headers);\r\n $requestId = isset ( $header ['x-log-requestid'] ) ? $header ['x-log-requestid'] : '';\r\n $resp = $this->parseToJson ( $resp, $requestId );\r\n return new CreateLogstoreResponse($resp,$header);\r\n }",
"public function createBucket($bucketName){\n $bucket = $this->storage->createBucket($bucketName);\n \n echo 'Bucket ' . $bucket->name() . ' created.';\n\n}",
"public function setupS3StorageLocation()\n {\n $this->session = $this->getSession();\n $this->session->visit($this->url('storage_add_s3storage'));\n \n $rcf_creds = $this->getS3Creds();\n $page = $this->session->getPage();\n $page->findById('storage_location_name')->setValue('My S3 Storage');\n $page->findById('s3_access_key')->setValue($rcf_creds['s3_access_key']);\n $page->findById('s3_secret_key')->setValue($rcf_creds['s3_secret_key']);\n $page->findById('s3_bucket')->setValue($rcf_creds['s3_bucket']);\n $page->findButton('m62_settings_submit')->submit();\n \n return $page;\n }",
"public function createLogstore(CreateLogstoreRequest $request)\n {\n $headers = array();\n $params = array();\n $resource = '/logstores';\n $project = $request->getProject() !== null ? $request->getProject() : '';\n $headers[\"x-log-bodyrawsize\"] = 0;\n $headers[\"Content-Type\"] = \"application/json\";\n $body = array(\n \"logstoreName\" => $request->getLogstore(),\n \"ttl\" => (int)($request->getTtl()),\n \"shardCount\" => (int)($request->getShardCount())\n );\n $body_str = json_encode($body);\n $headers[\"x-log-bodyrawsize\"] = strlen($body_str);\n list($resp, $header) = $this->send(\"POST\", $project, $body_str, $resource, $params, $headers);\n $requestId = isset ($header ['x-log-requestid']) ? $header ['x-log-requestid'] : '';\n $resp = $this->parseToJson($resp, $requestId);\n return new CreateLogstoreResponse($resp, $header);\n }",
"private function createBucket(S3Client $s3)\n {\n $s3->createBucket([\n 'ACL' => $this->acl,\n 'Bucket' => $this->bucket,\n 'CreateBucketConfiguration' => [\n 'LocationConstraint' => $this->region,\n ]\n ]);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Database connection function which will retrun (mysqli) connection | public function dbConn(){
$dbFunc = $this->AppSettings();
$host_name = $dbFunc['DATABASE']['HOST'];
$user_name = $dbFunc['DATABASE']['USER_NAME'];
$password = $dbFunc['DATABASE']['PASSWORD'];
$database = $dbFunc['DATABASE']['DATABASE'];
$mysqli = mysqli_connect($host_name, $user_name, $password, $database );
if($mysqli == true){
return $mysqli;
}
else{
echo "Error while connecting database! Error Desc-" .mysqli_connect_error();
}
} | [
"function mysqliConnect()\n{\n\t$address = getconf(\"Address\");\n\t$user = getconf(\"Username\");\n\t$passwd = getconf(\"Password\");\n\t$default = getconf(\"Database\");\n\t\n\t$db = new mysqli($address, $user, $passwd, $default);\n\t\n\tif ($db->connect_errno)\n\t{\n\t\tdie($db->connect_error.\": \".$_SERVER[\"SCRIPT_FILENAME\"].\"\\n\");\n\t}\n\t\n\treturn $db;\n}",
"function TALI_dbConnect() {\r\n\t$db_handle = mysqli_connect(TALI_DB_SERVER, TALI_DB_USERNAME, TALI_DB_PASSWORD);\r\n\t$db_found = mysqli_select_db($db_handle, TALI_DB_DBNAME);\r\n\tif ($db_found) {\r\n\t\t//Database connection successful\r\n\t\treturn $db_handle;\r\n\t}\r\n\telse\r\n\t{\r\n\t\t//Database connection failed\r\n\t\treturn false;\r\n\t}\r\n}",
"function connect_database() {\n\n//\tStore login credentials\n\n\t$servername = \"localhost\";\n\t$username = \"show_usr\";\n\t$password = \"trainz\";\n\t$dbname = \"show_des\";\n\n//\tCreate and check connection\n\n\t$conn = new mysqli($servername, $username, $password, $dbname);\n\n\tif ($conn->connect_error) {\n\t die(\"Database connection failed: \" . $conn->connect_error);\n\t}\n\n//\tReturn connection\n\n\treturn $conn;\n}",
"public function dbConnect() {\n $mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);\n\n if($mysqli->connect_error){\n die('Connect Error (' . mysqli_connect_errno() . ') '. mysqli_connect_error());\n }\n\n return $mysqli;\n }",
"public static function connect() {\r\n return mysqli_connect(config_db::DB_HOST, config_db::DB_USER, config_db::DB_PASSW, config_db::DATABASE);\r\n }",
"function connect() {\n $connection = new mysqli(\"127.0.0.1\", \"patricro\", \"patricro\", \"patricro\");\n if (!$connection || $connection->connect_error) {\n die('Unable to connect to database [' . $connection->connect_error . ']');\n }\n return $connection;\n}",
"function ConnectDataBase()\n{\n\tglobal $DB_CONNECTED;\n\t//Make sure that only 1 connection is created\n\tif($DB_CONNECTED != true) {\n\t\tglobal $DATABASE_SERVER;\n\t\tglobal $DATABASE_PORT;\n\t\tglobal $DATABASE_USER;\n\t\tglobal $DATABASE_NAME;\n\t\tglobal $DATABASE_PASSWORD;\n global $MODE;\n\t\tglobal $DB;\n\t\t//IF port set, use it\n if($MODE=='mysql'){\n if($DATABASE_PORT != \"\") {$DATABASE_SERVER = $DATABASE_SERVER.\":\".$DATABASE_PORT;}\n $DB = @mysql_connect($DATABASE_SERVER, $DATABASE_USER, $DATABASE_PASSWORD);\n if (!$DB) {errorPushTitle(\"Database error\");ErrorPushBody(\"Unable to connect to: \".$DATABASE_SERVER);ErrorCall();}\n $sel = @mysql_select_db($DATABASE_NAME);\n if (!$sel) {errorPushTitle(\"Database error\");ErrorPushBody(\"Unable to select database \".$DATABASE_NAME);ErrorCall();}\n $DB_CONNECTED = true;\n }elseif($MODE=='mysqli'){\n if($DATABASE_PORT != \"\") {$DATABASE_SERVER= $DATABASE_SERVER.\":\".$DATABASE_PORT;}\n $DB = new mysqli($DATABASE_SERVER, $DATABASE_USER, $DATABASE_PASSWORD, $DATABASE_NAME);\n\t\t\tif ($DB->connect_error) {\n\t\t\t print(\"Not connected, error: \" . $DB->connect_error . \"<br>\");\n\t\t\t}\n\n }\n\t\treturn $DB;\n\t}else {return false;}\n}",
"function getConnection() {\n $hostname = \"163.178.107.130\";\n $database = \"b43478-2\";\n $usuario = \"adm\"; \n $password = \"saucr.092\";\n /*$hostname = \"localhost:3306\";\n $database = \"tarea2-expertos\"; \n $usuario = \"root\"; \n $password = \"gamma26\";*/\n\n $connection = mysqli_connect($hostname, $usuario, $password,$database);\n if (!$connection) {\n die(\"Connection failed: \" . mysql_error());\n }\n\n \n return $connection;\n \n}",
"function connect($database=\"chat\"){\n # Set database error reporting --> throws exception if database error\n mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);\n \n # Connection info\n $server=getenv(\"IP\");\n $username=getenv(\"C9_USER\");\n $password=\"\";\n $dbport=\"3306\";\n \n # Connect to database, throw exception if issue\n $dbh=new mysqli($server, $username, $password, $database, $dbport);\n return $dbh;\n }",
"function conn() {\n $cnx = mysqli_connect(\"localhost\", \"root\", \"\", \"mundocountry\"); \n //$cnx = mysqli_connect(\"fdb22.awardspace.net\", \"2835193_mundocountry\", \"27052003MA\", \"2835193_mundocountry\");\n // $cnx = mysqli_connect(\"sql107.byetcluster.com\", \"epiz_24467472\", \"7CjgS7C1lW\", \"epiz_24467472_mundocountry\");\n\t // $cnx = mysqli_connect(\"localhost\", \"id9920261_yasmin\", \"Yasmin210203\", \"id9920261_mundocountry\");\n\tif (!$cnx) die('Deu errado a conexao!');\n return $cnx;\n}",
"function get_connection($config){\n\n // membuka file config\n // dari path yg disediakan\n $configs = parse_ini_file($config,true);\n\n // menggambil value username\n $username = $configs['database']['username'];\n\n // menggambil value password\n $password = $configs['database']['password'];\n\n // menggambil value host\n $host = $configs['database']['host'];\n\n // menggambil value port\n $port = $configs['database']['port'];\n\n // menggambil value database\n $dbname = $configs['database']['name'];\n \n // memanggil fungsi mysqli\n // mysqli adalah fungsi untuk \n // koneksi aman ke database\n // yg saat ini digunakan\n $db = new mysqli($host,$username,$password,$dbname);\n\n // jika terjadi error\n if ($db->connect_error) {\n\n // maka program akan dimatikkan\n // dan ditampilkan error\n die(\"Connection failed: \" . $conn->connect_error);\n }\n\n // mengembalikan object db sebagai hasil\n // dari fungsi koneksi ke database\n return $db;\n}",
"public function connect(){\r\n $this->conn = new mysqli(self::HOST, self::USER, self::PASS, $this->db);\r\n\r\n //pass the object\r\n return $this->conn;\r\n }",
"function mysqli_init () {}",
"function openDBConnection(){\n $temp = new mysqli(\"localhost\",\"strictlyShirts\",\"strictlyShirts\",\"strictly_shirts\");\n return $temp;\n }",
"function OpenDatabase()\r\n{\r\n // Make a connection to the database.\r\n $db = mysqli_connect(cHOST, cUSER, cPASS, cDBASE);\r\n if (!$db) {\r\n die('Could not connect: '.mysqli_error($db));\r\n }\r\n\r\n // Select the database.\r\n $db_selected = mysqli_select_db($db, cDBASE);\r\n if (!$db_selected) {\r\n die ('Can\\'t use '.cDBASE.' : '.mysqli_error($db));\r\n }\r\n\r\n return $db;\r\n}",
"public function open_db_connection(){\n $this->connection = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME); // new oop way\n if($this->connection->connect_errno){\n die(\"database connection failed badly\" . $this->connection->connect_error);\n }\n\n }",
"function getMysqli()\n{\n $_db = new mysqli(HOST, DB_USER, DB_PASS, DB);\n if($_db->connect_errno > 0)\n {\n onError(\"Unable to connect to database.\", $_db->connect_error);\n }\n return $_db;\n}",
"function retornarConexion() {\n\n $con=mysqli_connect(\"192.168.3.26\",\"DAW2_MIRAL\",\"sector1g\",\"daw2_miral\");\n // $con=mysqli_connect(\"oracle.ilerna.com\",\"DAW2_MIRAL\",\"sector1g\",\"daw2_miral\");\n\n return $con;\n\n }",
"function get_database_link()\n\t{\n\t\t\n\t\tif($this->link)\n\t\t{\n\t\t\treturn $this->link;\n\t\t}\n\t\t$this->link = mysqli_connect($this->db_host, $this->db_user, $this->db_password, $this->db_name);\n\t\tif (mysqli_connect_errno())\n\t\t{\n\t\t\t$error = mysqli_connect_error();\n\t\t\t$this->error_function($error);\t\t \n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $this->link;\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Apply the lancaster rule and return the altered string. | protected function applyRule($word, $rule)
{
return substr_replace($word, $rule[self::APPEND_STRING], strlen($word) - $rule[self::REMOVE_TOTAL]);
} | [
"private function apply(): string\n {\n $syntax = $this->syntax();\n\n foreach (array_reverse($this->entities) as $entity) {\n $value = mb_substr($this->text, $entity['offset'], $entity['length']);\n $type = $entity['type'];\n $replacement = match ($type) {\n 'text_link' => sprintf($syntax[$type][$this->mode], $value, $entity['url']),\n 'text_mention' => sprintf($syntax[$type][$this->mode], $entity['user']['username']),\n default => sprintf($syntax[$type][$this->mode], $value),\n };\n\n $this->text = substr_replace($this->text, $replacement, $entity['offset'], $entity['length']);\n }\n\n return $this->text;\n }",
"function applyRule1(string $word = \"\"): string\n{\n return addAy($word);\n}",
"public function getRule(): string;",
"function make_str_rules($source)\n{\n\tglobal $str_rules, $fixed_heading_anchor;\n\n\t$lines = explode(\"\\n\", $source);\n\t$count = count($lines);\n\n\t$modify = TRUE;\n\t$multiline = 0;\n\t$matches = array();\n\tfor ($i = 0; $i < $count; $i++) {\n\t\t$line = & $lines[$i]; // Modify directly\n\n\t\t// Ignore null string and preformatted texts\n\t\tif ($line == '' || $line{0} == ' ' || $line{0} == \"\\t\") continue;\n\n\t\t// Modify this line?\n\t\tif ($modify) {\n\t\t\tif (! PKWKEXP_DISABLE_MULTILINE_PLUGIN_HACK &&\n\t\t\t $multiline == 0 &&\n\t\t\t preg_match('/#[^{]*(\\{\\{+)\\s*$/', $line, $matches)) {\n\t\t\t \t// Multiline convert plugin start\n\t\t\t\t$modify = FALSE;\n\t\t\t\t$multiline = strlen($matches[1]); // Set specific number\n\t\t\t}\n\t\t} else {\n\t\t\tif (! PKWKEXP_DISABLE_MULTILINE_PLUGIN_HACK &&\n\t\t\t $multiline != 0 &&\n\t\t\t preg_match('/^\\}{' . $multiline . '}\\s*$/', $line)) {\n\t\t\t \t// Multiline convert plugin end\n\t\t\t\t$modify = TRUE;\n\t\t\t\t$multiline = 0;\n\t\t\t}\n\t\t}\n\t\tif ($modify === FALSE) continue;\n\n\t\t// Replace with $str_rules\n\t\tforeach ($str_rules as $pattern => $replacement)\n\t\t\t$line = preg_replace('/' . $pattern . '/', $replacement, $line);\n\t\t\n\t\t// Adding fixed anchor into headings\n\t\tif ($fixed_heading_anchor &&\n\t\t preg_match('/^(\\*{1,3}.*?)(?:\\[#([A-Za-z][\\w-]*)\\]\\s*)?$/', $line, $matches) &&\n\t\t (! isset($matches[2]) || $matches[2] == '')) {\n\t\t\t// Generate unique id\n\t\t\t$anchor = generate_fixed_heading_anchor_id($matches[1]);\n\t\t\t$line = rtrim($matches[1]) . ' [#' . $anchor . ']';\n\t\t}\n\t}\n\n\t// Multiline part has no stopper\n\tif (! PKWKEXP_DISABLE_MULTILINE_PLUGIN_HACK &&\n\t $modify === FALSE && $multiline != 0)\n\t\t$lines[] = str_repeat('}', $multiline);\n\n\treturn implode(\"\\n\", $lines);\n}",
"protected function RuleToSql($rule)\n {\n global $g_BizSystem;\n //echo $rule;\n\n if (!$this->m_DataSqlObj) $this->m_DataSqlObj = new BizDataSql();\n\n $rule = Expression::EvaluateExpression($rule,$this);\n\n // replace all [field] with table.column\n foreach($this->m_BizRecord as $bizFld)\n {\n if (!$bizFld->m_Column)\n continue; // ignore if no column mapped\n $fld_pattern = \"[\".$bizFld->m_Name.\"]\";\n if (strpos($rule, $fld_pattern) === false)\n continue; // ignore if no [field] found\n else\n {\n $tableColumn = $this->m_DataSqlObj->GetTableColumn($bizFld->m_Join, $bizFld->m_Column);\n $rule = str_replace($fld_pattern, $tableColumn, $rule);\n }\n }\n\n return $rule;\n }",
"static private function formatRuleLogic($logic)\r\n\t{\r\n\t\t// Replace operators in equation with PHP equivalents and removing line breaks\r\n\t\t$orig = array(\"\\r\\n\", \"\\n\", \"<\" , \"=\" , \"===\", \"====\", \"> ==\", \"< ==\", \">==\" , \"<==\" , \"< >\", \"<>\", \" and \", \" AND \", \" or \", \" OR \");\r\n\t\t$repl = array(\" \" , \" \" , \" < \", \"==\", \"==\" , \"==\" , \">=\" , \"<=\" , \">=\" , \"<=\" , \"<>\" , \"!=\", \" && \" , \" && \" , \" || \", \" || \");\r\n\t\t$logic = str_replace($orig, $repl, $logic);\r\n\t\t// Now reformat any exponential formating in the logic\r\n\t\t$logic = self::replaceExponents($logic);\r\n\t\t// Now reformat any IF statements into PHP ternary operator format\r\n\t\t$logic = convertIfStatement($logic);\r\n\t\t// Return the resulting string\r\n\t\treturn $logic;\r\n\t}",
"public function apply( $str, &$pointer )\n\t{\n\t\tswitch( $this->_type ) {\n\t\t\tcase 'string' :\n\t\t\t\treturn $this->_applyStringRule( $this->_rule, $str, $pointer );\n\t\t\tcase 'callback' :\n\t\t\t\treturn $this->_applyCallback( $this->_rule, $str, $pointer );\n\t\t\tcase 'regexp' :\n\t\t\t\treturn $this->_applyRegexpRule( $this->_rule, $str, $pointer );\n\t\t\t\t\t\t\t\n\t\t}\n\t}",
"public function normalize( $rule ) {\n\t\t$rule = ucwords( str_replace( [ '-', '_' ], ' ', $rule ) );\n\t\t$rule = lcfirst( str_replace( ' ', '', $rule ) );\n\n\t\tswitch ( $rule ) {\n\t\t\tcase 'creditcard':\n\t\t\t\treturn 'creditCard';\n\t\t\tcase 'int':\n\t\t\t\treturn 'integer';\n\t\t\tcase 'bool':\n\t\t\t\treturn 'boolean';\n\t\t\tdefault:\n\t\t\t\treturn $rule;\n\t\t}\n\t}",
"public function apply_rule( $file_name ) {\n\n\t\t$rule = wpfnc_get_option( 'rule' );\n\n\t\tif ( empty( $rule ) ) {\n\t\t\treturn $file_name;\n\t\t}\n\n\t\t$file_name = wpfnc_get_parsed_value( $rule, $file_name );\n\n\t\treturn $file_name;\n\t}",
"public function transform($norm)\n {\n if (null === $norm) {\n return '';\n }\n\n return '(' . substr($norm, 0, 3) . ') ' . substr($norm, 3, 3) . '-' . substr($norm, 6, 4);\n }",
"public function target() : string {\n\t\treturn $this->domain_replace( $this->ruleset->target );\n\t}",
"public function addHumanizationRule($substr, $replacement);",
"public function apply($expression)\n {\n $resultString = [];\n $index = 0;\n foreach($this->rule as $symbol)\n {\n if($symbol == $this->startSymbol)\n {\n $index += count($expression);\n $resultString = array_merge($resultString, $expression);\n }\n else\n {\n $resultString[$index] = $symbol;\n }\n }\n return new LanguageString($resultString);\n }",
"public function __toString()\n {\n $parts = [];\n\n foreach ($this->rules as $rule) {\n $parts[] = $rule->__toString();\n }\n\n return implode(' '.PHP_EOL, $parts);\n }",
"public function getRuleStr()\n {\n if(isset($this->_rulestr))\n return $this->_rulestr;\n\n $rulestr = '';\n\n if(isset($this->FREQ)) //required for building the rrule\n {\n $rulestr = self::rrFREQ.'='.$this->FREQ.';';\n\n if(isset($this->BYDAY) && is_array($this->BYDAY) && count($this->BYDAY))\n {\n if(isset($this->prefixBYDAY) && is_array($this->prefixBYDAY) && count($this->prefixBYDAY))\n {\n $days = '';\n foreach($this->BYDAY as $day)\n foreach($this->prefixBYDAY as $prefix)\n {\n $days .= $prefix . $day .',';\n }\n\n $days = substr($days,0,-1);\n\n $rulestr .= self::rrBYDAY . '='.$days .';';\n }\n else\n {\n $rule = implode(',',$this->BYDAY) .';';\n $rulestr .= self::rrBYDAY . '='.$rule;\n }\n }\n\n if(isset($this->BYMONTH) && is_array($this->BYMONTH) && count($this->BYMONTH))\n {\n $rulestr .= self::rrBYMONTH . '=' . implode(',',$this->BYMONTH) .';';\n }\n\n if(isset($this->BYMONTHDAY) && is_array($this->BYMONTHDAY) && count($this->BYMONTHDAY))\n {\n $rulestr .= self::rrBYMONTHDAY . '=' . implode(',',$this->BYMONTHDAY) .';';\n }\n\n //count or until\n if(!empty($this->COUNT))\n $rulestr .= self::rrCOUNT . '=' . $this->COUNT .';';\n else\n if(!empty($this->UNTIL))\n $rulestr .= self::rrUNTIL . '=' . $this->UNTIL .';';\n\n if(!empty($this->INTERVAL))\n $rulestr .= self::rrINTERVAL . '=' . $this->INTERVAL .';';\n\n }\n\n if(!empty($rulestr))\n {\n $rulestr = substr($rulestr,0,-1);\n $rulestr = $this->getType() .':'. $rulestr;\n\n $dtStart = $this->getIcalDate($this->getDTStart(),!empty($this->TSTART));\n $dtEnd = !empty($this->TEND) ? $this->getIcalDate($this->getDTEnd(),!empty($this->TEND)) : '';\n\n $rulestr = self::rrDTSTART .'='. $dtStart . $this->_dtDelimiter .\n self::rrDTEND .'='. $dtEnd . $this->_dtDelimiter .$rulestr;\n }\n\n $this->_rulestr = $rulestr;\n\n return $this->_rulestr;\n }",
"abstract protected function sanitizerRules();",
"protected function ruleToString($perm, $rule)\n {\n // Some rules only apply to READ.\n if (self::READ & $perm) {\n\n // Host rule.\n if (!empty($rule['host'])) {\n return '.r:' . $rule['host'];\n }\n\n // Listing rule.\n if (!empty($rule['rlistings'])) {\n return '.rlistings';\n }\n }\n\n // READ and WRITE both allow account/user rules.\n if (!empty($rule['account'])) {\n\n // Just an account name.\n if (empty($rule['user'])) {\n return $rule['account'];\n }\n\n // Account + multiple users.\n elseif (is_array($rule['user'])) {\n $buffer = [];\n foreach ($rule['user'] as $user) {\n $buffer[] = $rule['account'] . ':' . $user;\n }\n\n return implode(',', $buffer);\n\n }\n\n // Account + one user.\n else {\n return $rule['account'] . ':' . $rule['user'];\n }\n }\n }",
"protected function _process()\n {\n // just for consistency's sake, use strtolower and call method\n $method = strtolower($this->rule);\n return $this->{$method}();\n }",
"protected\n function grammar_rule( $rule, $same_name = true )\n {\n $result = $this->grammar[$rule]->wrapper_set('@@')\n ->expression(true);\n if ( $same_name ) {\n $result = substr_replace($result, Ando_Regex::option_same_name(), 1, 0);\n }\n return $result;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the first found snippet from a post. | public static function get_first_snippet( int $post_id ) {
$snippets = self::get_snippets( $post_id );
$snippets = array_values( $snippets );
if ( isset( $snippets[0] ) ) {
return $snippets[0];
}
return new Rich_Snippet();
} | [
"public function getFirstPost() {\r\n\t\treturn $this->getPosts()->first();\r\n\t}",
"public function getSnippet()\n {\n return $this->_snippet;\n }",
"public function getPostFirstCategory($post)\r\n {\r\n /** @var \\Mageplaza\\Blog\\Model\\ResourceModel\\Category\\Collection $collection */\r\n $collection = $this->getCategoryCollection($post->getCategoryIds());\r\n\r\n return $collection->getFirstItem();\r\n }",
"function digestforum_get_firstpost_from_discussion($discussionid) {\n global $CFG, $DB;\n\n return $DB->get_record_sql(\"SELECT p.*\n FROM {digestforum_discussions} d,\n {digestforum_posts} p\n WHERE d.id = ?\n AND d.firstpost = p.id \", array($discussionid));\n}",
"function get_first_paragraph(){\n\tglobal $post;\n\t$str = wpautop( get_the_content() );\n\t$str = substr( $str, 0, strpos( $str, '</p>' ) + 4 );\n\t$str = strip_tags($str, '<a><strong><em>');\n\treturn '<p>' . $str . '</p>';\n}",
"function get_first_paragraph() {\n global $post;\n\n $str = apply_filters( 'the_content', get_the_content() );\n $str = substr( $str, 0, strpos( $str, '</p>' ) + 4 );\n $str = strip_tags($str, '<a><strong><em>');\n return '<p>' . $str . '</p>';\n}",
"function get_demo_personalization_block_page() : ?WP_Post {\n\t$existing = new WP_Query(\n\t\t[\n\t\t\t'post_type' => 'page',\n\t\t\t'meta_key' => '_altis_analytics_demo_data',\n\t\t\t'posts_per_page' => 1,\n\t\t]\n\t);\n\n\tif ( ! $existing->found_posts ) {\n\t\treturn null;\n\t}\n\n\treturn $existing->posts[0];\n}",
"function get_first_image ($postID) {\n $post = get_post($postID);\n $first_img = '';\n $output = preg_match_all('/<img.+src=[\\'\"]([^\\'\"]+)[\\'\"].*>/i', $post->post_content, $matches);\n $first_img = $matches [1] [0];\n\n // no image found return NULL\n if(empty($first_img))\n return NULL;\n return $first_img;\n}",
"public function getFirstPost() {\r\n\t\treturn $this->DB->query(\"SELECT * FROM `blog_posts` WHERE `live` = 1 ORDER BY `date` ASC LIMIT 0, 1\");\r\n\t}",
"function get_first_embedded_video($post_id) {\n\n $post = get_post($post_id);\n $content = do_shortcode( apply_filters( 'the_content', $post->post_content ) );\n $embeds = get_media_embedded_in_content( $content );\n\n if( !empty($embeds) ) {\n //check what is the first embed containg video tag, youtube or vimeo\n foreach( $embeds as $embed ) {\n if( strpos( $embed, 'video' ) || strpos( $embed, 'youtube' ) ) {\n return $embed;\n }\n }\n\n } else {\n //No video embedded found\n return false;\n }\n\n}",
"function get_first_wordpress_video( $post_id ){\n //Get the IFrames from the WYSIWYG and return the first one found\n $content = apply_filters('the_content', get_post_field('post_content', $post_id));\n $videos = get_media_embedded_in_content( $content, array('video', 'iframe' ) ); \n if( !empty($videos)){\n return $first_vid = $videos[0];\n }\n return false;\n}",
"static function get_current_post_id( )\n {\n $slug = Request::segment(count(Request::segments()));\n $post = DB::table('posts')\n ->where('slug', $slug)->first(['id','title','featured_image', 'excerpt']);\n return $post;\n }",
"function getPostContent()\n{\n global $post;\n return $post[0]['content'];\n}",
"function getSpecificPost($idPost) \n { \n\n //This is the query to get the different posts for the main page\n $strSQL = 'SELECT POST_ID as id, POST_DATE as date, ' .\n ' POST_TITLE as title, POST_CONTENT as content ' .\n 'FROM T_POST ' .\n 'WHERE POST_ID = ? ';\n\n $post = $this->executeQuery($strSQL, array($idPost));\n\n if($post->rowCount() == 1) {\n $post->setFetchMode(PDO::FETCH_OBJ);\n return $post->fetch();\n } else {\n throw new Exception(\"No post found...\");\n }\n }",
"public function get_first_content_vimeo($post_id, $post = false) {\n\t\tif($post_id != -1)\n\t\t\t$post = get_post($post_id);\n\n\t\t$first_vim = '';\n\t\tob_start();\n\t\tob_end_clean();\n\t\t$output = preg_match_all('/(http:|https:|:)?\\/\\/?vimeo\\.com\\/([0-9]+)\\??|player\\.vimeo\\.com\\/video\\/([0-9]+)\\??/i', $post->post_content, $matches);\n\t\t\n\t\tif(isset($matches[2][0]) && !empty($matches[2][0]))\n\t\t\t$first_vim = $matches[2][0];\n\t\tif(isset($matches[3][0]) && !empty($matches[3][0]))\n\t\t\t$first_vim = $matches[3][0];\n\n\t\tif(empty($first_vim)){\n\t\t\t$first_vim = '';\n\t\t}\n\t\t\n\t\treturn apply_filters('essgrid_get_first_content_vimeo', $first_vim, $post_id, $post);\n\t}",
"public function get_spotlight_post() {\n $spotlight = $this->get_spotlight_data();\n if ( ! $spotlight['enabled'] ) {\n return false;\n }\n $post = Post::get( $spotlight['content'] );\n if ( empty( $post ) ) {\n $posts = new \\WP_Query( [\n 'posts_per_page' => 1,\n 'post_type' => Types::get_original_post_types(),\n 'no_found_rows' => true,\n 'update_post_meta_cache' => false,\n 'update_post_term_cache' => false,\n ] );\n if ( empty( $posts->posts ) ) {\n return false;\n }\n $post_id = $posts->posts[0]->ID;\n $post = Post::get( $post_id );\n }\n // If the Spotlight post is the same as the currently requested post then bail\n if ( $post->get_id() == get_the_ID() ) {\n return false;\n }\n return $post;\n }",
"private function getAndSetFirstPostId()\n {\n\n $html = file_get_contents($this->RCGForumSpyURL);\n preg_match('#var highestid = (.*?);\\s*$#m', $html, $matches);\n return $matches[1];\n }",
"function relevanssi_get_the_title($post_id) {\n\t$post = relevanssi_get_post($post_id);\n\tif (empty($post->post_highlighted_title)) $post->post_highlighted_title = $post->post_title;\n\treturn $post->post_highlighted_title;\n}",
"function first_post_image() {\n\tglobal $post, $posts;\n\t$first_img = '';\n\tob_start();\n\tob_end_clean();\n\tif( preg_match_all('/<img.+src=[\\'\"]([^\\'\"]+)[\\'\"].*>/i', $post->post_content, $matches ) ){\n\t\t$first_img = $matches[1][0];\n\t\treturn $first_img;\n\t}\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the list of points. | public function getPoints(): array
{
return $this->points;
} | [
"public function getPointList()\n {\n return $this->point->getList();\n }",
"public function getPoints();",
"public function getPoints()\n {\n return [$this->point1, $this->point2];\n }",
"public function getPoints()\n {\n return $this->points;\n }",
"public function getPoints()\n {\n return $this->getObjects('File_Therion_ScrapPoint');\n }",
"public function points()\n {\n return $this->points;\n }",
"public function getPoints(): array\n {\n return [$this->point1, $this->point2];\n }",
"public function getListePoint()\n {\n return $this->listePoint;\n }",
"public function getPoints() {\n return $this->getValue('points');\n }",
"public function points() {\n\n /* add point to database */\n $this->hit();\n\n $point = new Point;\n $points = $point->all()->toArray();\n\n /* get points from db */\n \n /**\n * Point:\n * |'city'|'latitude'|'longitude'|'date modified'|'current user'|\n * \n * current user not in db\n */\n\n // $points = [\n // ['ZANZIBAR', -6.13, 33.31, '1598968058', false],\n // ['TOKYO', 35.68, 139.76, '1598967058', false],\n // ['AUCKLAND', -36.85, 174.78, '1598957058', false]\n // ];\n\n // [\"ZANZIBAR\", -6.13, 39.31],\n // [\"TOKYO\", 35.68, 139.76],\n // [\"AUCKLAND\", -36.85, 174.78],\n // [\"BANGKOK\", 13.75, 100.48],\n // [\"DELHI\", 29.01, 77.38],\n // [\"SINGAPORE\", 1.36, 103.75],\n // [\"BRASILIA\", -15.67, -47.43],\n // [\"RIO DE JANEIRO\", -22.9, -43.24],\n // [\"TORONTO\", 43.64, -79.4],\n // [\"EASTER ISLAND\", -27.11, -109.36],\n // [\"SEATTLE\", 47.61, -122.33],\n // // [\"LONDON\", 51.5072, -0.1275]\n \n return $points;\n }",
"public function points(): array\n {\n return [\n new Point($this->Xmin, $this->Ymin),\n new Point($this->Xmax, $this->Ymin),\n new Point($this->Xmax, $this->Ymax),\n new Point($this->Xmin, $this->Ymax),\n ];\n }",
"final public function getPointsArray() {}",
"public function getPoints(): array {\n return [$this->start, $this->end];\n }",
"public function getDataPoints()\n {\n return $this->data_points;\n }",
"public function getListOfCoordinates();",
"public static function getAllPoints() {\n\t\t$db = Flight::db(false);\n\t\t$response = new stdClass();\n\t\t$req = $db->query('select * from point');\n\t\tif ($result = $req->fetchAll(PDO::FETCH_OBJ)) {\n\t\t\t$response->count = count($result);\n\t\t\t$response->result = $result;\n\t\t} else {\n\t\t\t$response->count = 0;\n\t\t\t$response->result = \"error\";\n\t\t}\n\t\treturn Flight::json($response);\n\t}",
"public function getDataPoints();",
"public function getPointsDraw();",
"public function getPoints_de_vie()\n {\n return $this->points_de_vie;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates the main window | public function create() {
$this->window= $this->widget($this->mainwin);
} | [
"function wb_create_window($parent, $wclass, $caption = null, $xpos = null, $ypos = null, $width = null, $height = null, $style = null, $param = null) {}",
"public function create()\n {\n $this->window->destroy();\n $cwindow = new IncomeCreateWindow();\n $cwindow->show_all();\n }",
"protected function createTitleWindow()\n {\n if (null !== $this->windowTitle) {\n ncurses_delwin($this->windowTitle);\n }\n\n $this->windowTitle = ncurses_newwin(2, 0, 0, 0);\n ncurses_getmaxyx($this->windowTitle, $this->windowTitleHeight, $this->windowTitleWidth);\n ncurses_keypad($this->windowTitle, true);\n }",
"public function buildMainwindow()\n {\n return $this->content;\n }",
"private function _init() {\n\t\t\tncurses_init();\n\t\t\t\n\t\t\t// initialize the color functions and set default color\n\t\t\tncurses_start_color();\n\t\t\t$this->setDefaultColor();\n\t\t\t\n\t\t\t//create the main window\n\t\t\t$this->_mainWindow = $this->_newWindow();\n\t\t\t\n\t\t\t// enable or disable the cursor visibility\n\t\t\t$this->setCursorVisibility(intval($this->_options['showCursor']));\n\t\t\t\n\t\t\t// enable or disable the keyboard echo\n\t\t\t$this->setEcho($this->_options['enableEcho']);\n\t\t\t\n\t\t\t//enable or disable the keypad use for the main window\n\t\t\t$this->setKeypad($this->_mainWindow, $this->_options['enableKeypad']);\n\t\t}",
"function _NEW()\t{\r\n\t\tmosMenuBar::startTable();\r\n\t\tmosMenuBar::preview( 'modulewindow' );\r\n\t\tmosMenuBar::spacer();\r\n\t\tmosMenuBar::save();\r\n\t\tmosMenuBar::spacer();\r\n\t\tmosMenuBar::apply();\r\n\t\tmosMenuBar::spacer();\r\n\t\tmosMenuBar::cancel();\r\n\t\tmosMenuBar::endTable();\r\n\t}",
"function _NEW()\t{\n\t\tmosMenuBar::startTable();\n\t\tmosMenuBar::preview( 'modulewindow' );\n\t\tmosMenuBar::spacer();\n\t\tmosMenuBar::save();\n\t\tmosMenuBar::spacer();\n\t\tmosMenuBar::apply();\n\t\tmosMenuBar::spacer();\n\t\tmosMenuBar::cancel();\n\t\tmosMenuBar::spacer();\n\t\tmosMenuBar::help( 'screen.modules.new' );\n\t\tmosMenuBar::endTable();\n\t}",
"public function __construct()\r\n\t{\r\n\r\n\t\tparent::__construct();\r\n\t\tCC_Wm::add_window($this);\r\n\r\n\t\t$this->register_actions();\r\n\t\t//$this->build_toolbar();\r\n\t\t$this->build_menu();\r\n\t\t$this->build_statusbar();\r\n\r\n\t\t$vbox = $this->vbox = new GtkVBox();\r\n\t\t$vbox->pack_start($this->menu, false, false);\r\n\t\t//$vbox->pack_start($this->toolbar, false, false);\r\n\t\t$vbox->pack_end($this->statusbar, false, false);\r\n\t\t$this->add($vbox);\r\n\r\n\t\t$this->connect_simple('destroy',array('gtk','main_quit'));\r\n\t\t$this->connect_simple('delete-event', array($this, 'on_quit'));\r\n\t\treturn;\r\n\t}",
"function createDesktop()\n\t{\n\t\tglobal $ASSETS_PATH;\n\n\t\treturn ('<section id=\"win311\">\n\t\t\t\t<div class=\"logowin311\">\n\t\t\t\t\t<img src=\"' . $ASSETS_PATH . '/img/winCidlogo.png\"\n\t\t\t\t\t\t\talt=\"Parodie du logo windows 3.11(7)\" />\n\t\t\t\t</div>'\n\t\t\t. $this->createDesktopIconContainer() .\n\t\t\t'</section>');\n\t}",
"protected function createSplashWindow()\r\n\t{\r\n\t\t$this->splash = new GladeXML(CC_DIR . 'gui' . DIRECTORY_SEPARATOR . 'callicore.glade',\r\n\t\t\t'main_splash_window');\r\n\t\t// translateable messages\r\n\t\t$bar = $this->splash->get_widget('progressbar1');\r\n\t\t$message = new CC_String('Loading');\r\n\t\t$bar->set_text($message->__toString());\r\n\t\tunset($bar, $message);\r\n\t\t$this->splash->signal_autoconnect_instance($this);\r\n\t\treturn;\r\n\t}",
"function addWindow( )\r\n\t{\r\n\t\t$aArgs = func_get_args();\r\n\r\n\t\tif ( count( $aArgs ) == 2 && is_array( $aArgs[1] ) )\r\n\t\t{\r\n\t\t\t$aConfig = $aArgs[1];\r\n\t\t}\r\n\t\telse \r\n\t\t{\r\n\t\t\t// legacymode \r\n\t\t\t$aConfig = array(\r\n\t\t\t\t\t\t\t\t\t'color'\t\t\t=>\t$aArgs[1],\r\n\t\t\t\t\t\t\t\t\t'opacity'\t\t=>\t$aArgs[2],\r\n\t\t\t\t\t\t\t\t\t'className'\t\t=>\t$aArgs[3],\r\n\t\t\t\t\t\t\t\t\t'frame'\t\t\t=>\t$aArgs[4],\r\n\t\t\t\t\t\t\t\t\t'iPageOverFlow'\t=>\t$aArgs[5],\r\n\t\t\t\t\t\t\t\t\t'bOverlay'\t\t=>\t$aArgs[6] ? $aArgs[6] : true, \r\n\t\t\t\t\t\t\t\t\t'bOverlayClick' =>\t$aArgs[7] ? $aArgs[7] : false\r\n\t\t\t\t\t\t\t);\r\n\t\t}\r\n\r\n\t\t$content = ltrim( $aArgs[0] );\r\n\t\t\t\r\n\t\t$aConfig['cmd'] = 'mw:aw';\r\n\r\n\t\t$this->addCommand( $aConfig, $content );\r\n\t}",
"function newt_open_window($left, $top, $width, $height, $title = NULL)\n{\n}",
"function makeWindow($content, $fbtitle='')\n {\n //Invoke the fb start() function. See the fb api documentation.\n $this->objResponse->script(\"fb.start({ href:\\\"#\\\",\n rev:\\\"width:max height:max scrolling:yes showPrint:true\\\",\n html:\\\"$content\\\",\n title:\\\"$fbtitle\\\" })\");\n }",
"public function showUi();",
"public function displayWin($content)\n {\n $this->om->displayWindow($content);\n \n //add the sidebar menus\n $this->displaySidebars();\n \n }",
"public function actionCreate()\n {\n $name = $this->prompt(\"Please enter a name for the Active Window:\", [\n 'required' => true,\n ]);\n\n $className = $this->createClassName($name, $this->suffix);\n\n $moduleId = $this->selectModule(['text' => 'What module should '.$className.' belong to?', 'onlyAdmin' => true]);\n\n $module = Yii::$app->getModule($moduleId);\n\n $folder = $module->basePath . DIRECTORY_SEPARATOR . 'aws';\n\n $file = $folder . DIRECTORY_SEPARATOR . $className . '.php';\n\n $namespace = $module->getNamespace() . '\\\\aws';\n\n if (FileHelper::createDirectory($folder) && FileHelper::writeFile($file, $this->renderWindowClassView($className, $namespace, $moduleId))) {\n $object = Yii::createObject(['class' => $namespace . '\\\\' . $className]);\n\n if (FileHelper::createDirectory($object->getViewPath()) && FileHelper::writeFile($object->getViewPath() . DIRECTORY_SEPARATOR . 'index.php', $this->renderWindowClassViewFile($className, $moduleId))) {\n $this->outputInfo(\"View file generated.\");\n }\n\n return $this->outputSuccess(\"Active Window '$file' created.\");\n }\n\n return $this->outputError(\"Error while writing the Actice Window file '$file'.\");\n }",
"function wm_start_main_content() {\n\t\tdo_action( 'wm_start_main_content' );\n\t}",
"function SetWindow(wxWindow &$w){}",
"public function testConstruct() {\r\n $this->window2 = new MainWindow('AbstractWindow', Point::createInstance(12, 34), Dimension::createInstance(456, 789));\r\n\r\n $this->assertEquals($this->window2->getPosition()->x, 12);\r\n $this->assertEquals($this->window2->getPosition()->y, 34);\r\n\r\n $this->assertEquals($this->window2->getDimension()->width, 456);\r\n $this->assertEquals($this->window2->getDimension()->height, 789);\r\n\r\n $this->assertNull($this->window2->getControlID());\r\n $this->assertNotNull($this->window2->getID());\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The name of an AMD module extending core/icon_system | public abstract function get_amd_name(); | [
"public function get_module_title();",
"public function get_module_icon(){\n return $this->v_module_icon;\n }",
"static function getModuleName() {\n $module_name = ui_module::GetModuleName();\n return $module_name;\n }",
"public function name()\n {\n return h($this->module->name);\n }",
"public function get_module_title()\n {\n return \"LC__MODULE__NAGIOS\";\n }",
"public function mod_icon_url($iconname, $module);",
"public function getName() {\n\t\t\treturn $this->MODULE_NAME;\t\n\t\t}",
"public static function module_name()\n {\n $class = Controller::curr()->class;\n $file = SS_ClassLoader::instance()->getItemPath($class);\n\n if ($file) {\n $dir = dirname($file);\n while (dirname($dir) != BASE_PATH) {\n $dir = dirname($dir);\n }\n\n $module = basename($dir);\n if ($module == 'openstack') {\n $module = Injector::inst()->get('ViewableData')->ThemeDir();\n }\n\n return $module;\n }\n\n return null;\n }",
"function module_icon_small_url($module_name = false)\n {\n $CI = get_instance();\n if (!$module_name) {\n if (isset($CI->modulerunner)) {\n $module_name = $CI->modulerunner->getRunningModuleName();\n }\n }\n\n if (file_exists($CI->load->resolveModuleDirectory($module_name, false) . '/resources/icon_16.png')) {\n $icon_path = module_resources_url($module_name) . 'icon_16.png';\n } else {\n $icon_path = 'pepiscms/theme/module_16.png';\n }\n\n return $icon_path;\n }",
"public function getIconName() {\n\t\tif ($this->isLibrary()) {\n\t\t\t$icon = 'library';\n\t\t\tif ($this->isClosed)\n\t\t\t\t$icon .= 'Closed';\n\t\t}\n\t\telse if ($this->isCategory()) {\n\t\t\t$icon = 'category';\n\t\t} else {\n\t\t\t$icon = 'libraryRedirect';\n\t\t}\n\n\t\treturn $icon;\n\t}",
"function getModuleName()\n {\n \t$modules_with_odd_names = array(\n \t'Bug Tracker'=>'Bugs'\n \t);\n \tif ( isset ( $modules_with_odd_names [ $this->name ] ) )\n \t\treturn ( $modules_with_odd_names [ $this->name ] ) ;\n\n \treturn $this->name;\n }",
"public function getIconName() {}",
"public function get_icon() {\n\t\treturn 'eicon-heading';\n\t}",
"protected function _getModuleName()\n {\n if (!$this->_moduleName) {\n $class = get_class($this);\n $this->_moduleName = substr($class, 0, strpos($class, '\\\\Helper'));\n }\n return str_replace('\\\\', '_', $this->_moduleName);\n }",
"public function getpackagename(){}",
"public function getModuleName() {\n\t\treturn $this->getModule()->get('name');\n\t}",
"protected function getModuleName()\n\t{\n\t\treturn strstr(get_class($this), '\\\\', true);\n\t}",
"protected function get_module_name() {\n return substr($this->componentname, 4);\n }",
"public function getpackagename()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Find a page in an exhibit by slug. | public function findBySlug($slug, $exhibit, $parent = null)
{
if ($exhibit instanceof Exhibit) {
$exhibit = $exhibit->id;
}
if ($parent instanceof ExhibitPage) {
$parent = $parent->id;
}
$select = $this->getSelect();
$select->where('exhibit_pages.exhibit_id = ?', $exhibit);
$select->where('exhibit_pages.slug = ?', $slug);
if ($parent) {
$select->where('exhibit_pages.parent_id = ?', $parent);
} else {
$select->where('exhibit_pages.parent_id IS NULL');
}
$select->limit(1);
return $this->fetchObject($select);
} | [
"public function find($slug);",
"function get_page_by_slug($slug) \n\t{\n\t\treturn parent::get_by_slug($this->tbl, $slug);\n\t}",
"protected function _findByExhibitSlug($exhibitSlug = null)\n {\n if (!$exhibitSlug) {\n $exhibitSlug = $this->_getParam('slug');\n }\n $exhibit = $this->_helper->db->getTable()->findBySlug($exhibitSlug);\n return $exhibit;\n }",
"private function findPageForSlug($slug)\n {\n $menuItem = app(MenuItemRepository::class)->findByUriInLanguage($slug, locale());\n\n if ($menuItem) {\n return $this->page->find($menuItem->page_id);\n }\n\n return $this->page->findBySlug($slug);\n }",
"public function get_page_details($slug){\n\t\t//$PageTitle=\"Twelve for Twelve - About Us\";\n\t\t$page_details = $this->findOneBy(array(\n\t\t\t\"slug\" => $slug\n\t\t),'webpages');\n\t\treturn $page_details;\n\t}",
"function hsk_get_id_by_slug($page_slug) {\n $page = get_page_by_path($page_slug);\n if ($page) {\n return $page->ID;\n } else {\n return null;\n }\n}",
"public function find_by_slug($slug)\n {\n $sql = 'SELECT *\n FROM ' . $this->table . '\n WHERE sectionSlug='. $this->db->pdb($slug) .'\n LIMIT 1';\n\n $result = $this->db->get_row($sql);\n\n if (is_array($result)) {\n return new $this->singular_classname($result);\n }\n\n return false;\n }",
"public static function find($slug) {\n $post = static::all();\n\n // Get the first item by the given key value pair.\n return $post->firstWhere('slug', $slug);;\n }",
"public function loadPageBySlug($slug) {\n $page = Page::with('type', 'blocks')->where('slug', '/' . ltrim($slug, '/'))->first();\n\n if ($page) {\n return $this->loadPage($page);\n }\n\n return $this->handleNotFound();\n }",
"private function findMatchingPageRule()\n {\n $config = $this->environment->getBootstrap()->getConfiguration();\n $ruleMatcher = new RuleMatcher($config['pages']);\n $entry = $ruleMatcher->find($this->page);\n if ($entry !== null) {\n return $entry;\n }\n throw new NotFoundException('No page rule defined');\n }",
"public function get_optin_by_slug( $slug ) {\n\n\t\treturn get_page_by_path( $slug, OBJECT, 'omapi' );\n\n\t}",
"public function findArticleBySlug(string $slug)\n {\n return Article::whereRaw('lower(slug) = lower(?) AND is_published = true', [$slug])->first();\n }",
"function get_id_by_slug($slug) {\n\t\t$page = get_page_by_path($slug);\n\t\tif($page) return $page->ID;\n\t\telse return false;\n\t}",
"public function findOneBySlug($slug);",
"protected function _findPage()\n {\n if (!empty($this->_page_id)) {\n $where = array(array('page_id', $this->_page_id));\n if (!$this->_is_preview) {\n $where[] = array('published', 1);\n }\n\n $page = Page\\Model_Page::find('first', array(\n 'where' => $where,\n 'related' => ('template_variation'),\n ));\n } else {\n foreach ($this->_contexts_possibles as $context => $domain) {\n $url = mb_substr(\\Uri::base(false).$this->_page_url, mb_strlen($domain));\n\n if (!in_array($url, array('', '/'))) {\n $url = mb_substr($url, 0, -1).'.html';\n } else {\n $url = '';\n }\n\n $where = array(array('page_context', $context));\n if (!$this->_is_preview) {\n $where[] = array('published', 1);\n }\n if (empty($url)) {\n $where[] = array('page_entrance', 1);\n } else {\n $where[] = array('page_virtual_url', $url);\n }\n\n $page = \\Nos\\Page\\Model_Page::find('first', array(\n 'where' => $where,\n 'related' => array('template_variation' => array('related' => 'linked_menus')),\n ));\n\n if (!empty($page)) {\n if ($page->page_entrance && !empty($url)) {\n \\Response::redirect($domain, 'location', 301);\n exit();\n }\n\n $this->_page_url = $url;\n break;\n }\n }\n }\n\n if (empty($page)) {\n throw new NotFoundException('The requested page was not found.');\n }\n\n if ($page->page_type == \\Nos\\Page\\Model_Page::TYPE_EXTERNAL_LINK) {\n \\Response::redirect($page->page_external_link, 'location', 301);\n exit();\n }\n\n $this->setPage($page);\n }",
"function get_id_by_slug($page_slug) {\n \t$page = get_page_by_path($page_slug);\n \tif ($page) {\n \t\treturn $page->ID;\n \t} else {\n \t\treturn null;\n \t}\n }",
"public function testFindBySlugWhenExhibitDoesNotExist()\n {\n\n // Create user two users.\n $user1 = $this->__user(\n $username = 'user1',\n $password = 'password',\n $email = 'email1@test.com');\n $user2 = $this->__user(\n $username = 'user2',\n $password = 'password',\n $email = 'email2@test.com');\n\n // Create NLW exhibits.\n $exhibit1 = $this->__exhibit($user1, 'Test Title 1', 'existing-slug', 1);\n $exhibit2 = $this->__exhibit($user2, 'Test Title 2', 'another-slug', 1);\n\n // False for non-existent slug.\n $this->assertFalse(\n $this->_webExhibitsTable->findBySlug('unused-slug', $user1)\n );\n\n // False for slug reserved by another user's exhibit.\n $this->assertFalse(\n $this->_webExhibitsTable->findBySlug('another-slug', $user1)\n );\n\n }",
"public function findBySlug($slug)\n {\n return $this->getAdapterPlugger()\n ->setModel($this)\n ->setAdapter(Post::class)\n ->plugIn(get_page_by_path($slug, OBJECT, $this->getSlug()))\n ->getConnected()\n ->first();\n }",
"function get_page_id($page_slug) {\n $page = get_page_by_path($page_slug);\n if(!empty($page)) {\n return $page->ID;\n }\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieves the upload validators for a field definition. This is copied from \Drupal\file\Plugin\Field\FieldType\FileItem as there is no entity instance available here that a FileItem would exist for. | protected function getUploadValidators(FieldDefinitionInterface $field_definition) {
$validators = [
// Add in our check of the file name length.
'file_validate_name_length' => [],
];
$settings = $field_definition->getSettings();
// Cap the upload size according to the PHP limit.
$max_filesize = Bytes::toNumber(Environment::getUploadMaxSize());
if (!empty($settings['max_filesize'])) {
$max_filesize = min($max_filesize, Bytes::toNumber($settings['max_filesize']));
}
// There is always a file size limit due to the PHP server limit.
$validators['file_validate_size'] = [$max_filesize];
// Add the extension check if necessary.
if (!empty($settings['file_extensions'])) {
$validators['file_validate_extensions'] = [$settings['file_extensions']];
}
return $validators;
} | [
"public function getUploadValidators() {\n $validators = array();\n $settings = $this->getSettings();\n\n // Cap the upload size according to the PHP limit.\n $max_filesize = Bytes::toInt(file_upload_max_size());\n if (!empty($settings['max_filesize'])) {\n $max_filesize = min($max_filesize, Bytes::toInt($settings['max_filesize']));\n }\n\n // There is always a file size limit due to the PHP server limit.\n $validators['file_validate_size'] = array($max_filesize);\n\n // Add the extension check if necessary.\n if (!empty($settings['file_extensions'])) {\n $validators['file_validate_extensions'] = array($settings['file_extensions']);\n }\n\n return $validators;\n }",
"public function getUploadValidators() {\n $validators = array();\n $settings = $this->getSettings();\n\n // Cap the upload size according to the PHP limit.\n $max_filesize = Bytes::toNumber('5G');\n if (!empty($settings['max_filesize'])) {\n //$max_filesize = min($max_filesize, Bytes::toInt($settings['max_filesize']));\n }\n\n // There is always a file size limit due to the PHP server limit.\n $validators['file_validate_size'] = array($max_filesize);\n\n // Add the extension check if necessary.\n if (!empty($settings['file_extensions'])) {\n $validators['file_validate_extensions'] = array($settings['file_extensions']);\n }\n\n return $validators;\n }",
"public function getFileUploadValidator()\n {\n return $this->_fileUploadValidator;\n }",
"public function getValidators() {\n $validators = array();\n foreach ($this->fields as $fieldName => $field) {\n $validators[$fieldName] = $field->getValidators();\n }\n\n return $validators;\n }",
"public function getFileUploadValidators() {\n return [];\n }",
"function file_get_validators() {\n static $validators = array();\n if (empty($validators)) {\n foreach (module_implements('file_validate') as $module) {\n $validators[$module .'_file_validate'] = array();\n }\n $validators = is_array($validators) ? $validators : array();\n }\n return $validators;\n}",
"public static function validateFromField()\n {\n return array(\n new Main\\Entity\\Validator\\Length(null, 255),\n );\n }",
"public function getBasicFieldValidators()\n {\n $validators = [];\n foreach ($this->requiredFields as $name => $config) {\n $validators[] = [$name, $this->getCustomFieldValidatorByTypeId($config['validatorType'])];\n }\n return $validators;\n }",
"protected function _get_validators($field) {\n return ( isset($this->_validators[$field]) ) ? $this->_validators[$field] : array();\n }",
"protected function getValidators()\n {\n return $this->container->getValidatorsByResourceType($this->getResourceType());\n }",
"public function getValidators ()\n {\n return $this->validators;\n }",
"public function getValidators()\n {\n return $this->_validators;\n }",
"public function getValidators()\n {\n return $this->validators;\n }",
"abstract protected function getFieldValidators();",
"final protected function getFormValidators()\n {\n // Not sure how form validators wouldn't be set, but leaving in place for now\n if (!isset($this->formValidators)) {\n $this->formValidators = $this->generateFormValidators();\n }\n\n return $this->formValidators;\n }",
"public function getValidators() {\n\t\treturn $this->validator->getValidators();\n\t}",
"public function getValidators()\n {\n $validators = array();\n $configParts = explode('/', self::CONFIG_XML_PATH_VALIDATOR);\n $configNodes = Mage::getConfig()->getNode($configParts[0], 'default');\n foreach ($configNodes->children() as $validatorNode) {\n $className = $validatorNode->class;\n $model = Mage::getModel($className);\n if ($model) {\n $validators[]= $model;\n }\n }\n\n return $validators;\n }",
"public static function validators() {\n return [\n 'status' => 'validateStatus',\n 'quota' => 'validateQuota'\n ];\n }",
"public function getUploadedFileConstraints();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get relative directory for given stub group | public function stubGroupDirectory($group)
{
return $this->get("stubs_groups.{$group}.stub_directory", $group);
} | [
"public static function getGroupDirPath()\n {\n return dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . self::GROUP_DIR_NAME . DIRECTORY_SEPARATOR;\n }",
"protected function _group_dir($cache_group)\n\t{\n\t\t$CI =& get_instance();\n\t\t$dir = ($cache_group != NULL) ? md5($cache_group).$this->group_postfix : '';\n\t\treturn $this->cache_path.$dir;\n\t\t\n\t}",
"protected function resolveStubPath($stub)\n {\n return __DIR__ . $stub;\n }",
"protected function resolveStubPath($stub): string\n {\n return __DIR__.$stub;\n }",
"protected function resolveStubPath($stub): string\n {\n return __DIR__.$stub;\n }",
"protected function resolveStubPath($stub)\n {\n return public_path( $stub );\n }",
"public function getSkeletonRelativeDirectory(): string;",
"protected function getPackagePath($env, $package, $group)\n {\n $file = str_replace('/', DS, \"Packages/{$package}/{$env}/{$group}.php\");\n\n return $this->defaultPath .DS .$file;\n }",
"protected function getFilePath($group)\n\t{\n\t\treturn $this->getLangPath($this->language . DIRECTORY_SEPARATOR . $group . '.php');\n\t}",
"protected function getPackagePath($env, $package, $group)\n {\n $file = \"packages/{$package}/{$env}/{$group}.php\";\n\n return $this->defaultPath . '/' . $file;\n }",
"protected function getStubPath()\n {\n return realpath(__DIR__ . '/../../../stubs/');\n }",
"protected function getStub(): String {\n return __DIR__.\"/../../../Stubs/\";\n }",
"protected function getStub(): String {\n return __DIR__.\"/../../Stubs/\";\n }",
"public function guessPackagePath()\n {\n $reflect = new ReflectionClass($this);\n // We want to get the class that is closest to this base class in the chain of\n // classes extending it. That should be the original service provider given\n // by the package and should allow us to guess the location of resources.\n $chain = $this->getClassChain($reflect);\n $path = $chain[count($chain) - 2]->getFileName();\n return realpath(dirname($path) . '/../../');\n }",
"function _getFilePath($id, $group){\n\t\t$folder = $group;\n\t\t$name = md5($this->_application . '-' . $id . '-' . $this->_hash . '-' . $this->_language) . '.php';\n\t\t$dir = $this->_root . DS . $folder;\n\t\t// If the folder doesn't exist try to create it\n\t\tif(!is_dir($dir)){\n\n\t\t\t// Make sure the index file is there\n\t\t\t$indexFile = $dir . DS . 'index.html';\n\t\t\t@ mkdir($dir) && file_put_contents($indexFile, '<html><body bgcolor=\"#FFFFFF\"></body></html>');\n\t\t}\n\n\t\t// Make sure the folder exists\n\t\tif(!is_dir($dir)){\n\t\t\treturn false;\n\t\t}\n\t\treturn $dir . DS . $name;\n\t}",
"protected function resolveStubPath($stub): string\n {\n return file_exists($customPath = $this->laravel->basePath(trim($stub, '/')))\n ? $customPath\n : __DIR__ . $stub;\n }",
"protected function packagePath()\n {\n return $this->normalizePath(realpath(__DIR__.\"/../../../..\"));\n }",
"protected function getStubPath()\n {\n // Stub path.\n $stub_path = __DIR__ . '/../../resources/stubs/';\n // Return the stub path.\n return $stub_path;\n }",
"protected function getPackageDirectory()\n {\n return $this->getClassDirectory() . '/../..';\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets a new fromCurrency The source currency for a conversion. | public function setFromCurrency($fromCurrency)
{
$this->fromCurrency = $fromCurrency;
return $this;
} | [
"public function setFrom(string $convertFrom) : CurrencyApi\n {\n $this->convertFrom = $convertFrom;\n return $this;\n }",
"public function setBaseCurrency(string $baseCurrency): ConversionResult\n {\n if (!isset($this->conversionRates[$baseCurrency])) {\n throw new CurrencyException(\"No conversion result for '$baseCurrency'!\");\n }\n\n if ($baseCurrency == $this->originalBaseCurrency) {\n $this->conversionRates = $this->originalConversionRates;\n return $this;\n }\n\n // Calculate new conversion rates.\n foreach ($this->originalConversionRates as $currency => $rate) {\n $this->conversionRates[$currency] = (float)$rate / (float)$this->originalConversionRates[$baseCurrency];\n }\n\n // Set new base currency.\n $this->baseCurrency = $baseCurrency;\n $this->conversionRates[$baseCurrency] = 1.0;\n\n // Return self\n return $this;\n }",
"public function convertCurrency($amount,$to,$from='USD'){\n \n $fromto = $from.$to;\n \n if( empty($this->response->quotes->$fromto) ){\n \n $this->resetParams();\n \n $this->setEndPoint('live');\n \n if( $from != 'USD' ){\n \n $this->setParam('source',$from);\n \n }\n \n $this->setParam('currencies',$to);\n \n $this->getResponse();\n \n }\n \n $result = $amount * $this->response->quotes->$fromto;\n \n return $result;\n \n }",
"public function setToCurrency($toCurrency)\n {\n $this->toCurrency = $toCurrency;\n return $this;\n }",
"public function setBaseCurrency(string $baseCurrency): CurrencyConverter;",
"public function setSourceCurrency($var)\n {\n GPBUtil::checkString($var, True);\n $this->source_currency = $var;\n\n return $this;\n }",
"public function setCurrency($currency);",
"public function setCurrencyNumber($number);",
"protected function convert($amount, $from_currency = null, $to_currency = null) {\n\t\tif(empty($from_currency)) {\n\t\t\t$from_currency = $this->get_base_currency();\n\t\t}\n\n\t\tif(empty($to_currency)) {\n\t\t\t$to_currency = $this->get_selected_currency();\n\t\t}\n\n\t\treturn $this->currency_switcher()->convert($amount,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $from_currency,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $to_currency);\n\t}",
"function _convertCurrency($_Value, $_FromType, $_ToType){\n\n if(!intval($_FromType)){\n\n if(strlen($_FromType)==3){\n\n $FromCurrency = currGetCurrencyByISO3($_FromType);\n }else{\n\n $FromCurrency = array('currency_value'=>1);\n }\n }else{\n\n $FromCurrency = currGetCurrencyByID($_FromType);\n }\n\n if(!intval($_ToType)){\n\n if(strlen($_ToType)==3){\n\n $ToCurrency = currGetCurrencyByISO3($_ToType);\n }else{\n\n $ToCurrency = array('currency_value'=>1);\n }\n }else{\n\n $ToCurrency = currGetCurrencyByID($_ToType);\n }\n\n return ($_Value/$FromCurrency['currency_value']*$ToCurrency['currency_value']);\n }",
"public function freeConverter($amount, $from_currency, $to_currency)\n {\n\n $from_Currency = urlencode($from_currency);\n $to_Currency = urlencode($to_currency);\n $query = \"{$from_Currency}_{$to_Currency}\";\n\n $json = file_get_contents(\"https://free.currconv.com/api/v7/convert?q={$query}\" . \"&apiKey=259d66e2a7cccb4d60dd\");\n $obj = json_decode($json, true);\n $val = $obj['results'][\"$query\"]['val'];\n $total = $val * $amount;\n return number_format($total, 2, '.', '');\n }",
"public function setCurrency($currency) {\n\t\tif($this->Status == 'Created') {\n\t\t\t$this->MoneyCurrency = $currency;\n\t\t}\n\n\t\treturn $this;\n\t}",
"public function toCurrency($currency)\n {\n // If we're not using a custom Currency model\n if (!is_a($currency, \"Abacus\\\\Currency\")) {\n // Make a new Currency model of the target\n $currency = new Currency($currency);\n }\n\n // New currency = Current / rate * new rate\n $value = $this->value / $this->currency->rate * $currency->rate;\n\n // Return the new Abacus object\n return new Abacus($value, $currency);\n }",
"public function getSourceCurrency();",
"protected function setConvertedAmount ()\r\n\t{\r\n\t\t$this->convertedAmount = $this->buyAmount * $this->exchangeRate;\r\n\t}",
"public function setCurrency($currency)\n {\n if ($this->Status == 'Created') {\n $this->MoneyCurrency = $currency;\n }\n\n return $this;\n }",
"protected function setCurrency() {\n $request = $this->getRequest();\n\n if ( !empty($request['currency']) && $request['currency'] === \"original\" ) \n {\n $regrate = RegistrationRate::getSpecificRateByTempID($this->registration->regrate_id);\n\n $this->currency_char = $regrate->currency;\n \n switch ($this->currency_char) {\n case '$':\n $this->currency_abbr = 'USD';\n break;\n \n case '€':\n $this->currency_abbr = 'EUR';\n break;\n \n case '£':\n $this->currency_abbr = 'GBP';\n break;\n\n default:\n $this->currency_abbr = 'USD';\n break;\n }\n }\n else {\n $this->currency_abbr = 'USD';\n }\n }",
"public function setFromCdeType($fromCdeType) {\n $this->fromCdeType = $fromCdeType;\n return $this;\n }",
"public function setCurrency($code);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Directly call "static::getInstance()" method when the object is called as a function. | public function __invoke()
{
return static::getInstance();
} | [
"public static function get_instance() {}",
"public static function instance(){\n\t\tif ( is_null( self::$instance ) ) {\n\t\t\tself::$instance = new self();\n//\t\t\tself::$instance->hooks();\n\t\t}\n\t}",
"public static function define() {\n if (is_null(self::$instance)) {\n self::$instance = new self();\n self::$instance->functions();\n }\n }",
"public static function instance() {\n\t\t// Store the instance locally to avoid private static replication\n\t\tstatic $instance = null;\n\n\t\t// Only run these methods if they haven't been ran previously\n\t\tif ( null === $instance ) {\n\t\t\t$instance = new audubon_core;\n\t\t\t$instance->setup();\n\n\t\t}\n\n\t\t// Always return the instance\n\t\treturn $instance;\n\t}",
"public static function Instance();",
"public static function getInstance(){\n \t$class = get_called_class();\n \tif( !is_null( $class::$instance ) ){\n \t\treturn $class::$instance;\n \t}\n\n \t$class::$instance = new $class;\n \treturn $class::$instance;\n }",
"public static function getInstance()\n {\n if (static::$instance) {\n return static::$instance;\n }\n static::$instance = self::getSystem();\n return static::$instance;\n }",
"function singleton($class)\n{\n // Make sure we have a valid singleton class\n if (is_singleton($class))\n {\n // Try to instantiate class statically\n try { $obj = call_user_func(array($class, 'getInstance')); }\n\n // Could not instantiate class\n catch (Exception $e) {\n Error :: fatalError('Failed to initialize class \"' . $class . '\"', __CLASS__);\n }\n\n // If we successfully instatiated the class, call it's onload function (if it exists)\n if (isset($obj))\n {\n // Check for onLoad method\n if (method_exists($obj, 'onLoad'))\n {\n // Try to call the onLoad method\n try { $obj->onLoad(); }\n\n // Could not call onLoad method\n catch (Exception $e) {\n Error :: fatalError('Method call onLoad() failed for \"' . $class . '\"', __CLASS__);\n }\n }\n\n // Return the new class\n return $obj;\n }\n }\n\n // Class doesn't exist\n return false;\n}",
"public static function __callStatic($method, $args){}",
"private static function checkStaticInstance()\n {\n if (!isset(self::$staticInstance)) {\n self::$staticInstance = new self();\n }\n }",
"public function __invoke() {}",
"public static function &getInstance()\r\n\t{\r\n\t\t// TODO check if user and platform are correctly initialized\r\n\t\tif(NULL === self::$_instance)\r\n\t\t\tthrow new SonicRuntimeException('Sonic instance not initialized');\r\n\t\t\r\n\t\treturn self::$_instance;\r\n\t}",
"public static function __callStatic($method, $parameters){}",
"public function __invoke();",
"public static function &instance()\n\t{\n\t\t// Return root instance\n\t\treturn get_instance();\n\t}",
"public static function getInstance()\n {\n /** Check if an instance of this object exists */\n if( !(self::$instance instanceof self) ){\n /** No instances exists use late state binding to make one */\n self::$instance = new self;\n /** Check if this object has a sub constructor */\n if( method_exists(self::$instance, 'constructor') ){\n /** Run the constructor */\n self::$instance->constructor();\n }\n }\n /** Return the object instance */\n return self::$instance;\n }",
"public static function getInstance()\n {\n /** Check if an instance of this object exists */\n if( !(self::$instance instanceof self) ){\n /** No instances exists use late state binding to make one */\n self::$instance = new self;\n /** Check if this object has a sub constructor */\n if( method_exists(self::$instance, 'constructor') ){\n /** Run the constructor */\n self::$instance->constructor();\n }\n }\n /** Return the object instance */\n return self::$instance;\n }",
"function gi()\n{\n return Service::getInstance();\n}",
"public function preInstantiateSingletons () {}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns a array of all templates found in template_dir | public static function getAllTemplates () {
return file::getFileList(conf::pathHtdocs() . "/templates", array ('dir_only' => true));
} | [
"function list_templates() {\n\n $files = array();\n foreach ($this->dirkeys as $key => $dirname) \n $files = array_merge($files, $this->_list_files($key, $dirname));\n\n return $files;\n }",
"public function findTemplates()\n {\n $templates = [];\n $Regex = new \\RegexIterator(\n new \\RecursiveIteratorIterator(\n new \\RecursiveDirectoryIterator($this->dir)\n ),\n '/^.+\\.template$/',\n \\RecursiveRegexIterator::GET_MATCH\n );\n\n foreach ($Regex as $file) {\n $template = str_replace($this->dir, '', $file[0]);\n\n\t\t\t// Skip anything from our own skel/ tooling directory.\n if (strpos($template, 'skel/') === 0) {\n \tcontinue;\n }\n\n $templates[] = $template;\n $this->writeVerbose('Found template: `' . $template . '`');\n }\n\n return $templates;\n }",
"public function getTemplateDirs();",
"function loadTemplateFiles() {\n\t\t$templates = array();\n\t\t$finder = new Finder();\n\t\t$finder->in('../app/views/templates');\n\n\t\tforeach ($finder as $file) {\n\t\t\tarray_push($templates, $file->getRelativePathname());\n\t\t}\n\n\t\treturn $templates;\n\t}",
"function get_templates()\n {\n $reallist = array();\n $list = load_class('Filesystem', 'library')->list_folders(APP_PATH . DS . 'templates');\n foreach($list as $file)\n {\n $reallist[] = $file;\n }\n return $reallist;\n }",
"protected function loadTemplates() {\n $templates = [];\n\n foreach (new \\DirectoryIterator(\"./assets/templates\") as $fileInfo) {\n if ($fileInfo->getExtension() === \"html\") {\n $templates[$fileInfo->getBasename(\".html\")] = file_get_contents($fileInfo->getRealPath());\n }\n }\n\n return $templates;\n }",
"public function getTemplatesDirs();",
"private function findTemplatesInFolder($dir)\n {\n $templates = array();\n\n if (is_dir($dir)) {\n $finder = new Finder();\n foreach ($finder->files()->followLinks()->in($dir) as $file) {\n $template = $this->parser->parse($file->getRelativePathname());\n if (false !== $template) {\n $templates[] = $template;\n }\n }\n }\n\n return $templates;\n }",
"public function getMainTemplates()\n {\n $files = File::files($this->templates_dir);\n $files_array = [];\n foreach ($files as $file) {\n $file_array = explode(\"/\", $file);\n $file_piece = end($file_array);\n $file = str_replace(\".blade.php\", \"\", $file_piece);\n $files_array[$file] = $file;\n }\n\n return $files_array;\n }",
"public function getInstalledTemplatePaths()\n {\n $dir = QCUBED_CONFIG_DIR . '/templates';\n\n $paths = [];\n\n if ($dir !== false) { // does the active directory exist?\n foreach (scandir($dir) as $strFileName) {\n if (substr($strFileName, -8) == '.inc.php') {\n $paths2 = include($dir . '/' . $strFileName);\n if ($paths2 && is_array($paths2)) {\n $paths = array_merge($paths, $paths2);\n }\n }\n }\n }\n\n return $paths;\n }",
"protected function getTemplatePaths() {\n\t\treturn apply_filters( __METHOD__, [ __DIR__ . '/templates' ] );\n\t}",
"function feedback_listTemplates()\n{\n\n // Scan available directories\n $dScan = [\n tpl_site.'/plugins/feedback/custom' => ':',\n extras_dir.'/feedback/tpl/custom' => '',\n ];\n $dList = [];\n // Check if there are custom templates in site template\n foreach ($dScan as $dPath => $dPrefix) {\n if (is_dir($dPath) && ($dh = opendir($dPath))) {\n while (($fn = readdir($dh)) !== false) {\n if (in_array($fn, ['.', '..'])) {\n continue;\n }\n if (is_dir($dPath.'/'.$fn)) {\n $dList[] = $dPrefix.$fn;\n }\n }\n }\n }\n\n return $dList;\n}",
"function get_template_list()\n\t{\n\t\t$verzeichnisse = array ();\n\t\t$pfad = PAPOO_ABS_PFAD . \"/templates/\";\n\t\t$handle = opendir( $pfad );\n\t\twhile (($file = readdir($handle)) !== false) {\n\t\t\tif (is_dir($pfad . $file)) {\n\t\t\t\tif (strpos(\"XXX\" . $file, \".\") != 3) {\n\t\t\t\t\t$verzeichnisse[] = $file; // Nur nicht-unsichtbare Verzeichnisse aufnehmen\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// $dir=$this->diverse->lese_dir(PAPOO_ABS_PFAD.\"/css\");\n\t\treturn $verzeichnisse;\n\t}",
"private function getTemplateFiles() {\n\t\tif (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))\n\t\t\tdebug_log('Entered (%%)',5,0,__FILE__,__LINE__,__METHOD__,$fargs);\n\n\t\t$result = array();\n\n\t\tforeach ($this->templates as $template)\n\t\t\tarray_push($result,$template->getFileName());\n\n\t\treturn $result;\n\t}",
"protected function getTemplateNames()\n {\n // TODO: this directory needs to come from the parameter set in the DIC in the ServiceProvider\n $template_dir = dirname(__FILE__) . '/../../../../data/templates';\n if (!file_exists($template_dir)) {\n //Vendored installation\n $template_dir = dirname(__FILE__) . '/../../../../../../templates';\n }\n\n /** @var \\RecursiveDirectoryIterator $files */\n $files = new \\DirectoryIterator($template_dir);\n\n $template_names = array();\n while ($files->valid()) {\n $name = $files->getBasename();\n\n // skip abstract files\n if (!$files->isDir() || in_array($name, array('.', '..'))) {\n $files->next();\n continue;\n }\n\n $template_names[] = $name;\n $files->next();\n }\n\n return $template_names;\n }",
"public static function getAllTemplateUsed() {\n return self::pluck('template')->all();\n }",
"private function getTemplateDirs()\n {\n if (empty($this->twigTemplateDirs)) {\n return array($this->getTemplatesDirectory());\n }\n return $this->twigTemplateDirs;\n }",
"protected function templateDirectories(): array\n {\n return $this->configuration['templateDirectories'] ?? [];\n }",
"public function getAllNames()\n {\n /** @var \\RecursiveDirectoryIterator $files */\n $files = new \\DirectoryIterator($this->getTemplatePath());\n\n $template_names = array();\n while ($files->valid()) {\n $name = $files->getBasename();\n\n // skip abstract files\n if (!$files->isDir() || in_array($name, array('.', '..'))) {\n $files->next();\n continue;\n }\n\n $template_names[] = $name;\n $files->next();\n }\n\n return $template_names;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds a bundle to current student. | public function addBundle(int $id_bundle) : bool
{
if (empty($this->id_student) || $this->id_student <= 0)
throw new \InvalidArgumentException("Student id logged in must be ".
"provided in the constructor");
if (empty($id_bundle) || $id_bundle <= 0)
throw new \InvalidArgumentException("Bundle id cannot be less ".
"than or equal to zero");
// Query construction
$sql = $this->db->prepare("
INSERT INTO purchases
(id_student, id_bundle, date)
VALUES (?, ?, NOW())
");
// Executes query
$sql->execute(array($this->id_student, $id_bundle));
return !empty($sql) && $sql->rowCount() > 0;
} | [
"public function addBundle($spec) {\n $this->bundles[$spec->getName()] = $spec;\n }",
"function addImageBundle($bundle)\n\t{\n\t\tarray_push($this->imageBundles, $bundle);\n\t}",
"protected function add(ResourceBundleInterface $newBundle)\n {\n $this->bundles->add($newBundle->getSystemLocale()->__toString(), $newBundle);\n }",
"public function set_bundle()\n\t{\n\t\t/* Sample use\n\t\t---------------------------------------------------------\n\t\t{exp:stash:set_bundle name=\"contact_form\"}\n\t\t--------------------------------------------------------- */\n\t\t\n\t\tif ( !! $bundle = strtolower($this->EE->TMPL->fetch_param('name', FALSE)) )\n\t\t{\t\t\t\n\t\t\tif ( isset(self::$bundles[$bundle]))\n\t\t\t{\n\t\t\t\t// get params\n\t\t\t\t$bundle_label = strtolower($this->EE->TMPL->fetch_param('label', $bundle));\n\t\t\t\t$unique = (bool) preg_match('/1|on|yes|y/i', $this->EE->TMPL->fetch_param('unique', 'yes'));\n\t\t\t\t$bundle_entry_key = $bundle_entry_label = $bundle;\n\t\t\t\t\n\t\t\t\t// get the bundle id\n\t\t\t\t$bundle_id = $this->EE->stash_model->get_bundle_by_name($bundle, $this->site_id);\n\t\t\t\t\n\t\t\t\t// does this bundle already exist? Let's try to get it's id\n\t\t\t\tif ( ! $bundle_id )\n\t\t\t\t{\n\t\t\t\t\t// doesn't exist, let's create it\n\t\t\t\t\t$bundle_id = $this->EE->stash_model->insert_bundle(\n\t\t\t\t\t\t$bundle,\n\t\t\t\t\t\t$this->site_id,\n\t\t\t\t\t\t$bundle_label\n\t\t\t\t\t);\t\t\n\t\t\t\t}\n\t\t\t\telseif ( ! $unique)\n\t\t\t\t{\n\t\t\t\t\t// bundle exists, but do we want more than one entry per bundle?\n\t\t\t\t\t$entry_count = $this->EE->stash_model->bundle_entry_count($bundle_id, $this->site_id);\n\t\t\t\t\tif ($entry_count > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$bundle_entry_key .= '_'.$entry_count;\n\t\t\t\t\t\t$bundle_entry_label = $bundle_entry_key;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// stash the data under a single key\n\t\t\t\t$this->EE->TMPL->tagparams['name'] = $bundle_entry_key;\n\t\t\t\t$this->EE->TMPL->tagparams['label'] = $bundle_entry_label;\n\t\t\t\t$this->EE->TMPL->tagparams['save'] = 'yes';\n\t\t\t\t$this->EE->TMPL->tagdata = serialize(self::$bundles[$bundle]);\n\t\t\t\t$this->bundle_id = $bundle_id;\n\t\t\t\t\n\t\t\t\tunset(self::$bundles[$bundle]);\n\t\t\t\treturn $this->set();\t\n\t\t\t}\n\t\t}\n\t}",
"public function add_resources($resource_bundle)\n\t{\n\t\t$this->update_resources();\n\t\tforeach ( $resource_bundle as $key => $val )\n\t\t{\n\t\t\t$this->resources->$key->stock += $val;\n\t\t\t\n\t\t\t// Don't let the stock quantity go below zero.\n\t\t\tif ( $this->resources->$key->stock < 0 )\n\t\t\t\t$this->resources->$key->stock = 0;\n\t\t}\n\t}",
"public function addBundleItem()\n {\n if (! Guard::verifyAjaxNonce('cuztom', 'security')) {\n return;\n }\n\n $count = self::$request->get('count');\n $index = self::$request->get('index');\n $field = self::getField();\n\n $data = (new BundleItem(Cuztom::merge(\n $field->original,\n [\n 'parent' => $field,\n 'index' => $index,\n ]\n )))->output();\n\n $response = (! $field->limit || ($field->limit > $count))\n ? new Response(true, $data)\n : new Response(false, __('Limit reached!', 'cuztom'));\n\n echo $response->toJson();\n\n // wp\n exit;\n }",
"function woo_bundles_add_to_cart() {\n\n\t\tglobal $woocommerce, $woocommerce_bundles, $product, $post;\n\n\t\t// Enqueue variation scripts\n\t\twp_enqueue_script( 'wc-add-to-cart-bundle' );\n\n\t\twp_enqueue_style( 'wc-bundle-css' );\n\n\t\t$bundled_items = $product->get_bundled_items();\n\n\t\tif ( $bundled_items )\n\t\t\twc_bundles_get_template( 'single-product/add-to-cart/bundle.php', array(\n\t\t\t\t'available_variations' \t\t=> $product->get_available_bundle_variations(),\n\t\t\t\t'attributes' \t\t\t\t=> $product->get_bundle_variation_attributes(),\n\t\t\t\t'selected_attributes' \t\t=> $product->get_selected_bundle_variation_attributes(),\n\t\t\t\t'bundle_price_data' \t\t=> $product->get_bundle_price_data(),\n\t\t\t\t'bundled_items' \t\t\t=> $bundled_items,\n\t\t\t\t'bundled_item_quantities' \t=> $product->get_bundled_item_quantities()\n\t\t\t), false, $woocommerce_bundles->woo_bundles_plugin_path() . '/templates/' );\n\n\t}",
"public function setBundle(string $bundle);",
"function woo_bundles_add_bundle_to_cart( $bundle_cart_key, $bundle_id, $bundle_quantity, $variation_id, $variation, $cart_item_data ) {\n\n\t\tglobal $woocommerce, $woocommerce_bundles;\n\n\t\tif ( isset( $cart_item_data[ 'stamp' ] ) && ! isset( $cart_item_data[ 'bundled_by' ] ) ) {\n\n\t\t\t// this id is unique, so that bundled and non-bundled versions of the same product will be added separately to the cart.\n\t\t\t$bundled_item_cart_data = array( 'bundled_item_id' => '', 'bundled_by' => $bundle_cart_key, 'stamp' => $cart_item_data[ 'stamp' ], 'dynamic_pricing_allowed' => 'no' );\n\n\t\t\t// the bundle\n\t\t\t$bundle = $woocommerce->cart->cart_contents[ $bundle_cart_key ][ 'data' ];\n\n\t\t\t// Now add all items - yay\n\t\t\tforeach ( $cart_item_data[ 'stamp' ] as $bundled_item_id => $bundled_item_stamp ) {\n\n\t\t\t\tif ( isset ( $bundled_item_stamp[ 'optional_selected' ] ) && $bundled_item_stamp[ 'optional_selected' ] == 'no' )\n\t\t\t\t\tcontinue;\n\n\t\t\t\t// identifier needed for fetching post meta\n\t\t\t\t$bundled_item_cart_data[ 'bundled_item_id' ] = $bundled_item_id;\n\n\t\t\t\t$item_quantity \t= $bundled_item_stamp[ 'quantity' ];\n\t\t\t\t$quantity\t\t= $item_quantity * $bundle_quantity ;\n\n\t\t\t\t$product_id = $bundled_item_stamp[ 'product_id' ];\n\n\t\t\t\t$bundled_product_type = $bundled_item_stamp[ 'type' ];\n\n\t\t\t\tif ( $bundled_product_type == 'simple' || $bundled_product_type == 'subscription' ) {\n\n\t\t\t\t\t$variation_id \t= '';\n\t\t\t\t\t$variations\t\t= array();\n\n\t\t\t\t} elseif ( $bundled_product_type == 'variable' ) {\n\n\t\t\t\t\t$variation_id \t= $bundled_item_stamp[ 'variation_id' ];\n\t\t\t\t\t$variations\t\t= $bundled_item_stamp[ 'attributes' ];\n\t\t\t\t}\n\n\t\t\t\t// Load child cart item data from the parent cart item data array\n\t\t\t\t$bundled_item_cart_data = $woocommerce_bundles->compatibility->get_bundled_cart_item_data_from_parent( $bundled_item_cart_data, $cart_item_data );\n\n\t\t\t\t// Prepare for adding children to cart\n\t\t\t\t$woocommerce_bundles->compatibility->before_bundled_add_to_cart( $product_id, $quantity, $variation_id, $variations, $bundled_item_cart_data );\n\n\t\t\t\t// Add to cart\n\t\t\t\t$bundled_item_cart_key = $this->bundled_add_to_cart( $bundle_id, $product_id, $quantity, $variation_id, $variations, $bundled_item_cart_data, true );\n\n\t\t\t\tif ( ! in_array( $bundled_item_cart_key, $woocommerce->cart->cart_contents[ $bundle_cart_key ][ 'bundled_items' ] ) )\n\t\t\t\t\t$woocommerce->cart->cart_contents[ $bundle_cart_key ][ 'bundled_items' ][] = $bundled_item_cart_key;\n\n\t\t\t\t// Finish\n\t\t\t\t$woocommerce_bundles->compatibility->after_bundled_add_to_cart( $product_id, $quantity, $variation_id, $variations, $bundled_item_cart_data );\n\n\t\t\t}\n\n\t\t}\n\n\t}",
"protected static function addToBundle($items = null, $bundle_quantity = null)\n {\n static $quantity = 1;\n if ($items !== null) {\n if (!isset(self::$bundle[self::$last_bundle_id])) {\n self::$bundle[self::$last_bundle_id] = array();\n }\n $bundle_items = array();\n foreach ($items as $i) {\n $bundle_items[$i['sku_id']] = $i;\n $bundle_items[$i['sku_id']]['bundle_quantity'] = $quantity;\n }\n self::$bundle[self::$last_bundle_id][] = $bundle_items;\n }\n $quantity = $bundle_quantity !== null ? $bundle_quantity : $quantity;\n }",
"function addToStudentList($student)\n {\n $GLOBALS['DB']->exec(\"INSERT INTO courses_students (student_id, course_id) VALUES ({$student->getId()}, {$this->id});\");\n }",
"function add_student() \n\t{\n\t\t$this->view->render('student/add_student');\n\t}",
"public function setBundle($bundle) {\n $this->set('bundle', $bundle);\n }",
"public function add(){\n\t\n\t$studentData['name'] = $this->request['name'];\n\t$studentData['sex'] = $this->request['sex'];\n\t$studentData['age'] = $this->request['age'];\n\t$studentData['grp'] = $this->request['grp'];\n\t$studentData['faculty'] = $this->request['faculty'];\n\t\t\n\tif ($this->model->addStudent($studentData)) $this->response['success'] = true;\n\t$this->set([\n\t\t\"title\" => \"База студентов\",\n\t\t\"students\"=> $this->model->studentsList(),\n\t\t]);\n\t$this->setView('table');\n\t}",
"public function setBundle(?Bundle $value): void {\n $this->getBackingStore()->set('bundle', $value);\n }",
"public function addStudent(){\n\t\t\n\t\t$this->load->view('add_student');\n\t}",
"abstract public function pack(Bundle $bnd);",
"public function bundle_link_add($bundle_link, $link, $title = FALSE)\r\n {\r\n $params[\"bundle_link\"] = $bundle_link;\r\n $params[\"link\"] = $link;\r\n if (is_string($title)) {\r\n $params[\"title\"] = $title;\r\n }\r\n return $this->call_oauth2_metrics(\"v3/bundle/link_add\", $params);\r\n }",
"function testCreateBundle() {\n $bundle = $this->client->bundles->create(array('ids' => array($this->assetId)));\n $this->assertNotNull($bundle);\n $this->assertTrue($bundle->id > 0);\n $this->bundleId = $bundle->id;\n //client.bundles.create ids: [assetId], (err, bundle) ->\n //bundleId = bundle.id\n //err.should.equal(no) and bundle.id.should.be.above(0)\n //do done\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns number of iterations for the PBKDF2 algorithm | public function getIterations()
{
return $this->_pbkdf2_iterations;
} | [
"public static function getPbkdf2Iterations()\n {\n return self::$PBKDF2_ITERATIONS;\n }",
"function pbkdf2_apply($algorithm, $password, $salt, $count, $key_length, $raw_output = false)\r\n{\r\n $algorithm = strtolower($algorithm);\r\n if(!in_array($algorithm, hash_algos(), true))\r\n die('PBKDF2 ERROR: Invalid hash algorithm.');\r\n if($count <= 0 || $key_length <= 0)\r\n die('PBKDF2 ERROR: Invalid parameters.');\r\n $hash_length = strlen(hash($algorithm, \"\", true));\r\n $block_count = ceil($key_length / $hash_length);\r\n $output = \"\";\r\n for ($i = 1; $i <= $block_count; $i++) {\r\n // $i encoded as 4 bytes, big endian.\r\n $last = $salt . pack(\"N\", $i);\r\n // first iteration\r\n $last = $xorsum = hash_hmac($algorithm, $last, $password, true);\r\n // perform the other $count - 1 iterations\r\n for ($j = 1; $j < $count; $j++) {\r\n $xorsum ^= ($last = hash_hmac($algorithm, $last, $password, true));\r\n }\r\n $output .= $xorsum;\r\n }\r\n if($raw_output)\r\n return substr($output, 0, $key_length);\r\n else\r\n return bin2hex(substr($output, 0, $key_length));\r\n}",
"function pbkdf2($algorithm, $password, $salt, $count, $key_length, $raw_output = false)\r\n{\r\n $algorithm = strtolower($algorithm);\r\n if(!in_array($algorithm, hash_algos(), true))\r\n die('PBKDF2 ERROR: Invalid hash algorithm.');\r\n if($count <= 0 || $key_length <= 0)\r\n die('PBKDF2 ERROR: Invalid parameters.');\r\n\r\n $hash_length = strlen(hash($algorithm, \"\", true));\r\n $block_count = ceil($key_length / (float) $hash_length);\r\n\r\n\techo \"key len: $key_length\\n\";\r\n\techo \"hash len: $hash_length\\n\";\r\n\techo \"block count: $block_count\\n\";\r\n\t\r\n $output = \"\"; //\"\";\r\n for($i = 1; $i <= $block_count; $i++) {\r\n // $i encoded as 4 bytes, big endian.\r\n $last = $salt . pack(\"N\", $i);\r\n // first iteration\r\n $last = $xorsum = hash_hmac($algorithm, $last, $password, true);\r\n // perform the other $count - 1 iterations\r\n for ($j = 1; $j < $count; $j++) {\r\n $xorsum ^= ($last = hash_hmac($algorithm, $last, $password, true));\r\n }\r\n $output .= $xorsum;\r\n }\r\n\r\n if($raw_output)\r\n return substr($output, 0, $key_length);\r\n else\r\n return bin2hex(substr($output, 0, $key_length));\r\n}",
"#[Pure]\nfunction hash_pbkdf2(string $algo, string $password, string $salt, int $iterations, int $length = 0, bool $binary = false): string {}",
"function pbkdf2( $p, $s, $c, $kl, $a = 'sha256' ) {\r\n \r\n $hl = strlen(hash($a, null, true)); # Hash length\r\n $kb = ceil($kl / $hl); # Key blocks to compute\r\n $dk = ''; # Derived key\r\n \r\n # Create key\r\n for ( $block = 1; $block <= $kb; $block ++ ) {\r\n \r\n # Initial hash for this block\r\n $ib = $b = hash_hmac($a, $s . pack('N', $block), $p, true);\r\n \r\n # Perform block iterations\r\n for ( $i = 1; $i < $c; $i ++ )\r\n \r\n # XOR each iterate\r\n $ib ^= ($b = hash_hmac($a, $b, $p, true));\r\n \r\n $dk .= $ib; # Append iterated block\r\n }\r\n \r\n # Return derived key of correct length\r\n return substr($dk, 0, $kl);\r\n}",
"function pbkdf2($algorithm, $password, $salt, $count, $key_length, $raw_output = false)\n{\n $algorithm = strtolower($algorithm);\n if(!in_array($algorithm, hash_algos(), true))\n die('PBKDF2 ERROR: Invalid hash algorithm.');\n if($count <= 0 || $key_length <= 0)\n die('PBKDF2 ERROR: Invalid parameters.');\n\n $hash_length = strlen(hash($algorithm, \"\", true));\n $block_count = ceil($key_length / $hash_length);\n\n $output = \"\";\n for($i = 1; $i <= $block_count; $i++) {\n // $i encoded as 4 bytes, big endian.\n $last = $salt . pack(\"N\", $i);\n // first iteration\n $last = $xorsum = hash_hmac($algorithm, $last, $password, true);\n // perform the other $count - 1 iterations\n for ($j = 1; $j < $count; $j++) {\n $xorsum ^= ($last = hash_hmac($algorithm, $last, $password, true));\n }\n $output .= $xorsum;\n }\n\n if($raw_output)\n return substr($output, 0, $key_length);\n else\n return bin2hex(substr($output, 0, $key_length));\n}",
"public static function passwordHashBenchamrk()\n {\n $timeTarget = 0.05;\n $cost = 8;\n\n do\n {\n $cost++;\n $start = microtime(true);\n password_hash(\"test\", PASSWORD_BCRYPT, [\"cost\" => $cost]);\n $end = microtime(true);\n } while (($end - $start) < $timeTarget);\n\n logger::addLog(\"framework core Authorization passwordHashBenchamrk\", \"Appropriate Cost Found: \" . $cost);\n return $cost;\n }",
"function pbkdf2 ($password, $salt, $rounds = 15000, $keyLength = 32, \n $hashAlgorithm = 'sha256', $start = 0)\n{\n // Key blocks to compute\n $kb = $start + $keyLength;\n \n // Derived key\n $dk = '';\n \n // Create key\n for ($block = 1; $block <= $kb; $block ++) {\n // Initial hash for this block\n $ib = $h = hash_hmac($hashAlgorithm, $salt . pack('N', $block), \n $password, true);\n \n // Perform block iterations\n for ($i = 1; $i < $rounds; $i ++) {\n // XOR each iteration\n $ib ^= ($h = hash_hmac($hashAlgorithm, $h, $password, true));\n }\n \n // Append iterated block\n $dk .= $ib;\n }\n \n // Return derived key of correct length\n return base64_encode(substr($dk, $start, $keyLength));\n}",
"public function getKeyLength() {\r\n return ipworksencrypt_pbkdf_get($this->handle, 4 );\r\n }",
"function getSaltLength() ;",
"function pbkdf2($algorithm, $password, $salt, $count, $key_length, $raw_output = false)\n\t{\n\t\t$algorithm = strtolower($algorithm);\n\t\tif(!in_array($algorithm, hash_algos(), true))\n\t\t\tdie('PBKDF2 ERROR: Invalid hash algorithm.');\n\t\tif($count <= 0 || $key_length <= 0)\n\t\t\tdie('PBKDF2 ERROR: Invalid parameters.');\n\n\t\t$hash_length = strlen(hash($algorithm, \"\", true));\n\t\t$block_count = ceil($key_length / $hash_length);\n\n\t\t$output = \"\";\n\t\tfor($i = 1; $i <= $block_count; $i++) {\n\t\t\t// $i encoded as 4 bytes, big endian.\n\t\t\t$last = $salt . pack(\"N\", $i);\n\t\t\t// first iteration\n\t\t\t$last = $xorsum = hash_hmac($algorithm, $last, $password, true);\n\t\t\t// perform the other $count - 1 iterations\n\t\t\tfor ($j = 1; $j < $count; $j++) {\n\t\t\t\t$xorsum ^= ($last = hash_hmac($algorithm, $last, $password, true));\n\t\t\t}\n\t\t\t$output .= $xorsum;\n\t\t}\n\n\t\tif($raw_output)\n\t\t\treturn substr($output, 0, $key_length);\n\t\telse\n\t\t\treturn bin2hex(substr($output, 0, $key_length));\n\t}",
"public function testPbkdf2()\n {\n $manager = new PasswordManager('salt');\n\n $hash = $manager->hash('123', PasswordManagerInterface::HASHED_WITH_PBKDF2);\n\n $this->assertIsString($hash);\n $this->assertGreaterThan(40, strlen($hash));\n $this->assertStringEndsWith('==', $hash);\n\n $this->assertTrue($manager->verify('123', $hash, PasswordManagerInterface::HASHED_WITH_PBKDF2));\n }",
"function password_cost($t=0,$cost=8,$p='test',$algo=PASSWORD_BCRYPT){\r\nif($t==0)$t=0.1;else $t*=0.01; //the target time in milliseconds ;default=100ms\r\ndo {\r\n $cost++;\r\n $start=microtime(true);\r\n password_hash($p,$algo,['cost'=> $cost]);\r\n $end = microtime(true);\r\n} while (($end - $start) < $t);\r\nreturn $cost;\r\n}",
"public function secretLength();",
"public function getSaltLength() {}",
"function mcrypt_enc_get_key_size($td) {}",
"public function kdfAlgorithmIdentifier(): PBKDF2AlgorithmIdentifier\n {\n return $this->_kdf;\n }",
"static function pbkdf2($sAlgorithm, $sPassword, $sSalt, $iCount, $iKeyLength, $bRawOutput = false) {\n\n $sAlgorithm = strToLower($sAlgorithm);\n\n if (!in_array($sAlgorithm, hash_algos(), true)) {\n\n throw new Exception('PBKDF2 ERROR: Invalid hash algorithm.', -1);\n\n } // if invalid hash algorithm\n\n if (0 >= $iCount || 0 >= $iKeyLength) {\n\n throw new Exception('PBKDF2 ERROR: Invalid parameters.', -1);\n\n } // if invalid parameters\n\n $iHashLength = strLen(hash($sAlgorithm, '', true));\n\n $iBlockCount = ceil($iKeyLength / $iHashLength);\n\n $sOutput = '';\n for ($i = 1; $i <= $iBlockCount; $i++) {\n\n // $i encoded as 4 bytes, big endian.\n $sLast = $sSalt . pack('N', $i);\n\n // first iteration\n $sLast = $sXorSum = hash_hmac($sAlgorithm, $sLast, $sPassword, true);\n\n // perform the other $count - 1 iterations\n for ($j = 1; $j < $iCount; $j++) {\n\n $sXorSum ^= ($sLast = hash_hmac($sAlgorithm, $sLast, $sPassword, true));\n\n } // loop j\n\n $sOutput .= $sXorSum;\n\n } // loop i\n\n\n if ($bRawOutput) {\n\n return subStr($sOutput, 0, $iKeyLength);\n\n } else {\n\n return bin2hex(subStr($sOutput, 0, $iKeyLength));\n\n } // if raw output or not\n\n }",
"private static function getCost(){\n\t $timeTarget = 0.2;\n\n\t\t\t$cost = 9;\n\t\t\tdo {\n\t\t\t\t$cost++;\n\t\t\t\t$start = microtime(true);\n\t\t\t\tpassword_hash(\"test\", PASSWORD_DEFAULT, [\"cost\" => $cost]);\n\t\t\t\t$end = microtime(true);\n\t\t\t}while(($end - $start) < $timeTarget);\n\n\t return [\"cost\" => $cost];\n\t }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sets the id of the cell to the $n formal parameter | function setId($n){
$this->id = $n;
} | [
"function set_group_id($value, $index=NULL) {\n\t\t$this->_data['cell_id'] = $value;\n\t}",
"function goToNum( $n )\n\t\t{\n\t\tif( !$this->cursor ) $this->openCursor() ;\n\t\tif( $this->redoquery ) $this->requery() ;\n\n\t\t// Demande au curseur d'aller sur l'enregistrement n° $n\n\t\tif( !$this->cursor->goToRow( $n ) )\n\t\t\t{\n\t\t\t$this->row = null ;\n\t\t\treturn -1 ;\n\t\t\t}\n\n\t\t// Charge le nouvel enregistrement\n\t\t$this->currentnrow = $n ;\n\t\t$this->row = $this->cursor->fetchAssoc() ;\n\t\treturn $this->currentnrow ;\n\t\t}",
"function SetSelection($n){}",
"protected function addColumnAt_String_Int($colname, $n){\n\t\t$i = 0;\n\t\tif($this->has_header && (count($this->rows)>0)){\n\t\t\t$as_keys = array_flip($this->rows[0]->toArray());\n\t\t\tif(strcmp($colname,\"\")==0){\n\t\t\t\t$colname=\"_blank\";\n\t\t\t}\n\t\t\tif(array_key_exists($colname, $as_keys)){\n\t\t\t\t$newindex=1;\n\t\t\t\t$new_name=$colname.\"_\".$newindex;\n\t\t\t\twhile(array_key_exists($new_name, $as_keys)){\n\t\t\t\t\t$newindex++;\n\t\t\t\t\t$new_name=$colname.\"_\".$newindex;\n\t\t\t\t}\n\t\t\t\t$error_message='has_header = true && column has empty name: Renamed to '.$new_name.'';\n\t\t\t\ttrigger_error($error_message, E_USER_WARNING);\n\t\t\t\t$colname=$new_name;\n\n\t\t\t}\n\t\t\t$this->rows[0]->addColumnAt($colname,$n);\n\t\t\t$i++;\n\t\t}\n\t\tfor(; $i < count($this->rows); $i++){\n\t\t\tif(($this->has_header && ($i!=0))||(!$this->has_header)){\n\t\t\t\t$this->rows[$i]->addColumnAt(\"\",$n);\n\t\t\t}\n\t\t}\n\t}",
"function ChangeSelection($n){}",
"function createId($cell)\n\t{\n\t\t$id = $this->nextId;\n\t\t$this->nextId++;\n\t\t\n\t\treturn $id;\n\t}",
"public function testEditDocumentXlsxSetCellByIdentifier()\n {\n }",
"function setColumnName($i,$n) { }",
"function setItemNumber($itemNumber);",
"public function openRowMenuByNumber(int $n): void\n {\n $selector = $this->baseSelector . \"//tbody//tr[{$n}]//\" .\n self::MENU_BUTTON_SELECTOR;\n\n $this->tester->click($selector);\n }",
"public function setRowNum($rowNum);",
"public function setId()\n {\n \t$this->id = self::$increment;\n \tself::$increment++;\n }",
"public function setRowNumber(){\n $sql = \"select rowNumber from \".$this->tableNameNode.\" order by rowNumber desc limit 1\";\n $result = $this->mysql->getConnection()->query($sql);\n\n if($result->num_rows==0)\n $this->rowNumber = 1;\n else{\n $obj = $result->fetch_object();\n $this->rowNumber = $obj->rowNumber+1;\n }\n }",
"public function setCellNo(string $cellNo): self\n {\n $this->cellNo = $cellNo;\n\n return $this;\n }",
"public function testEditDocumentXlsxSetCellByIndex()\n {\n }",
"public function getCellNo(): string\n {\n return $this->cellNo;\n }",
"function piles_setn($piles,$kv){\n foreach($this->np($piles) as $pkey) $this->piles[$pkey]->setn($kv);\n }",
"function setColumnNameAt($i,$n) {\n\t\t$this->tableHeader->setColumnName($i,$n);\n\t}",
"public function setNid($nid) {\n $this->nid = $nid;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Default response for no action requests | protected function getNoop()
{
$response = array(
"action" => "None",
"success" => false,
"error_code" => 404,
"error_message" => 'Sorry, you need to specify a valid action'
);
$this->setContent($response);
} | [
"protected function getNoop()\n\t{\n\t\t$response = array(\n\t\t\t\"action\" => \"None\",\n\t\t\t\"success\" => false,\n\t\t\t\"error_code\" => 404,\n\t\t\t\"error_message\" => 'Sorry, you need to specify a valid action'\n\t\t);\n\n $this->setStatusCode($response[\"error_code\"]);\n\t\t$this->setContent($response);\n\t}",
"public function defaultNoRouteAction() {\n /**\n * get Response from header\n */\n $this->getResponse ()->setHeader ( 'HTTP/1.1', '404 Not Found' );\n /**\n * get Response from header sataus\n */\n $this->getResponse ()->setHeader ( 'Status', '404 File not found' );\n /**\n * Load the Layout\n */\n $this->loadLayout ();\n /**\n * Rendering the Layout Values.\n */\n $this->renderLayout ();\n }",
"public function actionMissing()\n {\n $this->sendResponse(400, 'Action not found');\n }",
"protected function actionDefault()\n\t{\n\t\tzf::halt(\"You can't call this function \\\"actionDefault\\\" directly. You must redefine it in your controller.\");\n\t}",
"public function DefaultAction()\n {\n $this->output(false);\n }",
"private function _unknownAction()\n {\n $this->getResponse()->setStatusCode(Response::STATUS_CODE_405);\n }",
"public function catchAllAction() {\r\n\t\t// If the catchAllAction is not overridden, an undefined action should result in a 404.\r\n\t\t$this->show404();\r\n\t}",
"public function actionDefault() {\n\t\t//\n\t}",
"public function defaultNoRouteAction()\n {\n if(Mage::getStoreConfig(self::XPATH_CONFIG_SETTINGS_ROUTE) > 0){\n \t\t$errorLog = new Ext4mage_Notify4errors_Model_Errorlog();\n \t\t$errorLog->cms404('No route and not default - soft 404');\n \t}\n\n \tparent::defaultNoRouteAction();\n }",
"public function noRouteAction()\n\t\t{\n\t\t\t$this->redirect('/');\n\t\t}",
"protected function callActionMethod()\n {\n if ($this->accessDenied) {\n $this->response->appendContent('');\n } else {\n parent::callActionMethod();\n }\n }",
"public function indexAction(): Response\n {\n return new Response('', Response::HTTP_OK);\n }",
"public function action_404()\n\t{\n\t\treturn Response::forge(Presenter::forge('default/404'), 404);\n\t}",
"abstract protected function _processNoResponse();",
"public function notFound()\n {\n Apollo::getInstance()->getRequest()->error(400, 'Invalid action.');\n }",
"function getDefaultActionIfNoneSpecified() {\r\n if (!isset($this->action) || empty($this->action) || !method_exists($this->controllerInstance, $this->action)) {\r\n if (property_exists($this->controllerInstance, \"defaultAction\")) {\r\n $this->action = $this->controllerInstance->defaultAction;\r\n }\r\n }\r\n }",
"protected function noJobFoundAction()\n {\n }",
"public function action_404()\n\t{\n\t\t$this->response(array('404'));\n\t}",
"public function action_404()\n\t{\n\t\t//return Response::forge(ViewModel::forge('welcome/404'), 404);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns notes by condition id | public function getcondnotes($condid) {
$sql = "SELECT n.* ".
"FROM notes n ".
"where n.condition_id =:condid ".
"order by n.create_dt_tm desc";
$this->connect();
$stmt = $this->db->prepare($sql);
$stmt->bindValue(':condid', $condid, PDO::PARAM_INT);
$stmt->execute();
return($stmt->fetchAll(PDO::FETCH_OBJ));
} | [
"static function get_condition_by_id($id)\n {\n global $db;\n\n // grab the article\n $str = \"SELECT * FROM `conditions` WHERE `condid`='%d'\";\n $sql = sprintf($str, api::cleanse($id));\n return mysqli_fetch_assoc(mysqli_query($db, $sql));\n }",
"public function getNoteById($id);",
"function findNoteById($id);",
"public function find($id)\n {\n return Notes::find($id);\n }",
"public function getNotes($id = false)\n {\n return !$id ? $this->call('get','Notes') : $this->call('get','Notes/'.$id);\n }",
"public function get_notes($id){\n $this->db->where('user_id', $id);\n $query = $this->db->get('notes');\n return $query->result();\n }",
"public function findNotesById($id){\n return $this\n ->createQueryBuilder('n')\n ->select('n.rating')\n ->where(\"n.menu= :id\")\n ->setParameter('id',$id)\n ->getQuery()\n ->getResult();\n }",
"public function findNote($id)\n {\n return $this->notes()->find($id);\n }",
"public function findNoteById($id)\n {\n return $this->repository->find($id);\n }",
"private function get_notes($imageID) {\n\t\tglobal $database;\n\n\t return $database->get_all(\n \"SELECT * \".\n \"FROM notes \".\n \"WHERE enable = ? AND image_id = ? \".\n\t\t\t\t\"ORDER BY date ASC\"\n , array('1', $imageID));\n\t}",
"public function findNoteById($id)\n\t{\n\t\treturn Note::find($id);\n\t}",
"public function get_notes() {\n\t\treturn QuoteNotesQuery::create()->filterByQuotenumber($this->qthdid)->filterByLine($this->qtdtline)->find();\n\t}",
"public static function get_module_notes($cid = NULL, $module_id = NULL){\r\n global $uid, $course_id;\r\n if(is_null($cid)){\r\n $cid = $course_id;\r\n }\r\n if(is_null($module_id)){\r\n return self::get_all_course_notes($cid);\r\n }\r\n return Database::get()->queryArray(\"SELECT id, title, content FROM note WHERE user_id = ?d AND reference_obj_course = ?d \", $uid, $cid);\r\n }",
"private function get_order_notes($order_id) {\n $response_data = array();\n $notes = $this->wpdb->get_results(\"SELECT C.comment_ID AS ID,\n C.comment_date AS created,\n C.comment_content AS content,\n CM.meta_value AS is_customer_note\n\t\t\t\t FROM {$this->wpdb->comments} AS C, {$this->wpdb->commentmeta} AS CM\n\t\t\t\t WHERE C.comment_type = 'order_note' AND C.comment_post_ID = $order_id\n\t\t\t\t AND C.comment_approved = 1 AND CM.meta_key = 'is_customer_note'\n\t\t\t\t AND C.comment_id = CM.comment_id ORDER BY C.comment_ID DESC;\");\n foreach($notes as $note) {\n $note_data = array();\n \n $note_data['ID'] = $note->ID;\n $note_data['date_created'] = $note->created;\n $note_data['date_display'] = date_i18n('m.d.y', strtotime($note_data['date_created']));\n $note_data['time_display'] = date_i18n('g:i a', strtotime($note_data['date_created']));\n $note_data['content'] = $note->content;\n $note_data['is_customer_note'] = $note->is_customer_note;\n \n array_push($response_data, $note_data);\n }\n \n return $response_data;\n }",
"public function getNotes();",
"public function getCustomerCareNoteDetails($care_id){\n $notes = $this->customerCareNote::where('customer_care_id',$care_id)->get();\n return $notes;\n }",
"public function get_order_notes($order_id) {\n\t\tif (empty($this->order_notes[$order_id])) {\n\t\t\t$this->order_notes[$order_id] = $this->api->get_order_notes($order_id);\n\t\t}\n\t\treturn $this->order_notes[$order_id];\n\t}",
"public function getConditionement_article($id){\n\t\t\t\t\t$sql = \"SELECT * FROM conditionement_article WHERE conditionement_article.id = \".$id.\" \";\n\t\t\t\t\t if($this->db != null)\n\t\t\t\t\t {\n\t\t\t\t\t return $this->db->query($sql)->fetch();\n\t\t\t\t\t }else{\n\t\t\t\t\t return null;\n\t\t\t\t\t }\n\t\t\t\t\t }",
"public function getNotes()\n {\n \t// get table for this record class\n return $this->getTable('TranscriptNote')->findBy(array('transcript_id' => $this->id, 'sort_field' => 'order'));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Build the WHERE clause(s) | protected function _build_where() {
return $this->_build_conditions( 'where' );
} | [
"protected function build_where()\n {\n }",
"private function _buildWhere() {\r\n\t\t\tif ( $this->_where ) { // we have where clauses to add\r\n\t\t\t\t// add where\r\n\t\t\t\t$this->_sql .= ' WHERE';\r\n\r\n\t\t\t\tforeach ( $this->_where as $where ) { // loop over where array\r\n\t\t\t\t\t// variable name\r\n\t\t\t\t\t$columnVariableName = ':' . str_replace( '.', '', $where['column'] );\r\n\r\n\t\t\t\t\t// add where column/value to sql statement\r\n\t\t\t\t\t$this->_sql .= ' ' . $where['type'] . ' ' . $where['column'] . ' = ' . $columnVariableName;\r\n\r\n\t\t\t\t\t// map where vars to values to be used on execution\r\n\t\t\t\t\t$this->_executeParams[$columnVariableName] = $where['value'];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}",
"private function buildWhere() {\n\t\t$sql = \"\";\n\t\t\n\t\tif (!empty($this->where))\n\t\t\t$sql .= \" WHERE \" . $this->buildConditionals($this->where);\n\t\treturn $sql;\n\t}",
"private function build_where_sql() {\n\n // if we used a custom where clause, we do not need to build it\n if ($this->used_custom_where || count($this->where_parameters) < 1) {\n return;\n }\n\n $sql = \"WHERE \\n\";\n\n for ($i=0; $i < count($this->where_parameters); $i++) { \n $parameter = $this->where_parameters[$i];\n\n if ($i == 0) {\n $sql .= \"\\t\";\n } else {\n $sql .= \"\\tAND \";\n }\n \n $name = $parameter->name;\n $type = $parameter->type;\n $value = $this->model_object->$name;\n\n if (is_array($value)) {\n\n if (\\PDope\\Utilities:: is_special_type($type)) {\n throw new \\Exception(\"PDopeStatement build_where_sql(), array, does not support special type [{$type}]\");\n }\n\n $sql .= \"(\".\\PDope\\Utilities:: escape_mysql_identifier($name).\" IN (\";\n\n for ($j=0; $j < count($value); $j++) { \n if ($j > 0) {\n $sql .= \", \";\n }\n\n $token = \"{$name}_{$j}\";\n $token = \\PDope\\Utilities:: format_token($token);\n\n $sql .= $token;\n }\n\n $sql .= \"))\";\n } else {\n if (\\PDope\\Utilities:: is_special_type($type)) {\n $token = \\PDope\\Utilities:: translate_special_token($name, $type); \n $sql .= \"(\".\\PDope\\Utilities:: escape_mysql_identifier($name).\" = $token) \\n\"; \n } else {\n $token = \\PDope\\Utilities:: format_token($name);\n $sql .= \"(\".\\PDope\\Utilities:: escape_mysql_identifier($name).\" = $token) \\n\";\n }\n }\n\n }\n $this->sql_where .= $sql;\n\n // $this->log_debug(\"build_where_sql() built \\n$sql\");\n }",
"function _buildQueryWhere()\n {\n // Prepare the WHERE clause\n $where = array();\n global $mainframe;\n \n // Фильтр по виду занятий\n $params =& $mainframe->getPageParameters();\n $training_id = $params->get('id');\n $is_root = $params->get('is_root');\n if(!$is_root AND $training_id)\n {\n $where[] = 'c.training_id = '.$training_id;\n }\n \n // Where date and time more then now\n $where[] = '(c.date > \"'.date('Y-m-d').'\" OR (c.date = \"'.date('Y-m-d').'\" AND c.time_start > \"'.date('H:i').'\"))';\n // return the WHERE clause\n return ($where) ? ' WHERE '.implode(' AND', $where) : '';\n }",
"protected function _build_where() {\n // If there are no WHERE clauses, return empty string\n if (count($this->_where_conditions) === 0) {\n return '';\n }\n\n $where_conditions = array();\n foreach ($this->_where_conditions as $condition) {\n $where_conditions[] = $condition;\n }\n\n return \"WHERE \" . join(\" AND \", $where_conditions);\n }",
"private function _buildWhereSql() {\n\t\t$return = '';\n\t\tif ( $this->getLoadOnlyActive() ) {\n\t\t\t$return .= ' AND movies.active = \"Y\" ';\n\t\t}\n\t\treturn $return;\n\t}",
"protected function generateWhere()\n {\n if(!$this->where->empty())\n {\n $sql = new Builder();\n $startwith = false;\n \n foreach($this->where->get() as $where)\n {\n if(Str::startWith($where, 'AND') && !$startwith)\n {\n $startwith = true;\n $sql->append(Str::move($where, 4) . ' ');\n }\n else if(Str::startWith($where, 'OR') && !$startwith)\n {\n $startwith = true;\n $sql->append(Str::move($where, 3) . ' ');\n }\n else\n {\n $sql->append($where . ' ');\n }\n }\n\n return $sql->get();\n }\n }",
"private function prepare_where() {\n\t\t$parts = array();\n// print_r($this->wherePartConnector);\n\t\tif (is_array($this->whereParts) && count($this->whereParts)) {\n\t\t\tforeach ($this->whereParts as $whereType => $whereParts) {\n\t\t\t\tif (is_array($whereParts) && count($whereParts)) {\n\t\t\t\t\t$statements = array();\n\t\t\t\t\tforeach ($whereParts as $wherePart) {\n\t\t\t\t\t\t$statements[] = $wherePart['whereSQL'];\n\t\t\t\t\t}\n\t\t\t\t\t$parts[] = implode(' '.$this->wherePartConnector[$whereType].' ', $statements);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (count($parts)) {\n\t\t\t$this->query['WHERE'] = '('.implode(') AND (', $parts).')';\n\t\t}\n//\t\t$this->query['WHERE'] = implode(' AND ', $parts);\n\t\t\t// Add enable fields to where-part\n\t\tforeach ($this->tables as $table) {\n\t\t\tif (is_array($ef = $table['enableFields'])) {\n\t\t\t\tforeach ($ef as $key => $where) {\n\t\t\t\t\tif ($table['joinType'] === 'leftjoin') {\n\t\t\t\t\t\t// When doing a LEFT JOIN then check enable fields only for non-NULL results\n\t\t\t\t\t\t// Else this would be similar to a NATURAL JOIN as the enable-field query would yield FALSE for every\n\t\t\t\t\t\t// record which can't join another one.\n\t\t\t\t\t\t$where = '('.$where.') OR ('.$table['asName'].'.uid IS NULL)';\n\t\t\t\t\t}\n\t\t\t\t\t$this->query['WHERE'] .= ($this->query['WHERE']?' AND ':'').'('.$where.')';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n//\t\techo $this->query['WHERE'];\n\t}",
"protected function getGeneralWhereClause() {}",
"private function applyWhereClauses() {\n if (!count($this->whereClauses)) {\n return;\n }\n\n $whereStrings = [];\n foreach ($this->whereClauses as $clause) {\n $placeholder = is_null($clause[2]) ? 'null' : '?';\n $whereStrings[] = \"$this->table.$clause[0] $clause[1] $placeholder\";\n if (!is_null($clause[2])) {\n $this->bindingParams[] = $clause[2];\n }\n }\n\n $this->query .= ' where '.implode(' and ', $whereStrings);\n }",
"protected function construct_where_clause() {\n\t\t\t$wpdadb = WPDADB::get_db_connection( $this->schema_name );\n\n\t\t\tif (\n\t\t\t\tisset( $this->child['default_where'] ) &&\n\t\t\t\tnull !== $this->child['default_where'] &&\n\t\t\t\t'' !== trim( $this->child['default_where'] )\n\t\t\t) {\n\t\t\t\t$default_where = \" and ( {$this->child['default_where']} ) \";\n\t\t\t\t$default_where = WPDA::substitute_environment_vars( $default_where );\n\t\t\t} else {\n\t\t\t\t$default_where = '';\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tisset( $this->child['default_orderby'] ) &&\n\t\t\t\tnull !== $this->child['default_orderby'] &&\n\t\t\t\t'' !== trim( $this->child['default_orderby'] )\n\t\t\t) {\n\t\t\t\t$default_orderby = \" order by {$this->child['default_orderby']} \";\n\t\t\t} else {\n\t\t\t\t$default_orderby = '';\n\t\t\t}\n\n\t\t\tif ( isset( $this->child['relation_nm'] ) ) {\n\t\t\t\t$child_table = $this->child['relation_nm']['child_table'];\n\t\t\t\t$parent_key = $this->child['relation_nm']['parent_key'];\n\t\t\t\t$child_table_select = $this->child['relation_nm']['child_table_select'];\n\t\t\t\t$child_table_where = $this->child['relation_nm']['child_table_where'];\n\t\t\t\t$data_type = $this->child['relation_nm']['data_type'];\n\n\t\t\t\t$parent_key_column_names = '';\n\t\t\t\t$select_column_names = '';\n\t\t\t\t$index = 0;\n\n\t\t\t\tforeach ( $parent_key as $key ) {\n\t\t\t\t\tif ( $key === reset( $parent_key ) ) {\n\t\t\t\t\t\t$parent_key_column_names .= \"(`$key`\";\n\t\t\t\t\t\t$select_column_names .= '`' . $child_table_select[ $index ] . '`';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$parent_key_column_names .= \",`$key`\";\n\t\t\t\t\t\t$select_column_names .= ', `' . $child_table_select[ $index ] . '`';\n\t\t\t\t\t}\n\t\t\t\t\t$index ++;\n\t\t\t\t}\n\t\t\t\t$parent_key_column_names .= ')';\n\n\t\t\t\t$index = 0;\n\t\t\t\t$where = '';\n\n\t\t\t\tforeach ( $child_table_where as $child_where ) {\n\t\t\t\t\tif ( $child_where === reset( $child_table_where ) ) {\n\t\t\t\t\t\t$and = '';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$and = ' and ';\n\t\t\t\t\t}\n\t\t\t\t\tif ( 'number' === strtolower( $data_type[ $index ] ) ) {\n\t\t\t\t\t\t$where .=\n\t\t\t\t\t\t\t$wpdadb->prepare(\n\t\t\t\t\t\t\t\t\" $and `$child_where` = %f \",\n\t\t\t\t\t\t\t\t$this->parent['parent_key_value'][ $this->parent['parent_key'][ $index ] ]\n\t\t\t\t\t\t\t); // WPCS: unprepared SQL OK.\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$where .=\n\t\t\t\t\t\t\t$wpdadb->prepare(\n\t\t\t\t\t\t\t\t\" $and `$child_where` = %s \",\n\t\t\t\t\t\t\t\t$this->parent['parent_key_value'][ $this->parent['parent_key'][ $index ] ]\n\t\t\t\t\t\t\t); // WPCS: unprepared SQL OK.\n\t\t\t\t\t}\n\t\t\t\t\t$index ++;\n\t\t\t\t}\n\n\t\t\t\tif ( '' === $this->schema_name ) {\n\t\t\t\t\t$schema_table_name = \"`$child_table`\";\n\t\t\t\t} else {\n\t\t\t\t\t$schema_table_name = \"`{$wpdadb->dbname}`.`$child_table`\";\n\t\t\t\t}\n\n\t\t\t\t$this->where =\n\t\t\t\t\t\" where ($parent_key_column_names {$this->where_in} \" .\n\t\t\t\t\t\" (select $select_column_names from $schema_table_name where $where)) \"; // WPCS: unprepared SQL OK.\n\t\t\t} elseif ( isset( $this->child['relation_1n'] ) ) {\n\t\t\t\t$child_key = $this->child['relation_1n']['child_key'];\n\t\t\t\t$data_type = $this->child['relation_1n']['data_type'];\n\n\t\t\t\tif (\n\t\t\t\t\tisset( $this->child['relation_1n']['parent_key'] ) &&\n\t\t\t\t\tis_array( $this->child['relation_1n']['parent_key'] )\n\t\t\t\t) {\n\t\t\t\t\t$parent_key = $this->child['relation_1n']['parent_key'];\n\t\t\t\t} else {\n\t\t\t\t\t$parent_key = null;\n\t\t\t\t}\n\n\t\t\t\t$index = 0;\n\t\t\t\t$where = '';\n\n\t\t\t\tforeach ( $child_key as $key ) {\n\t\t\t\t\tif ( $key === reset( $child_key ) ) {\n\t\t\t\t\t\t$and = '';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$and = ' and ';\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( null === $parent_key ) {\n\t\t\t\t\t\t$parent_key_value = $this->parent['parent_key_value'][ $this->parent['parent_key'][ $index ] ];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ( $parent_key == $this->parent['parent_key'] ) {\n\t\t\t\t\t\t\t$parent_key_value = $this->parent['parent_key_value'][ $this->parent['parent_key'][ $index ] ];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ( isset( $_REQUEST[ 'WPDA_PARENT_KEY*' . $parent_key[ $index ] ] ) ) {\n\t\t\t\t\t\t\t\t$parent_key_value = $_REQUEST[ 'WPDA_PARENT_KEY*' . $parent_key[ $index ] ];\n\t\t\t\t\t\t\t} elseif ( isset( $_REQUEST[ $parent_key[ $index ] ] ) ) {\n\t\t\t\t\t\t\t\t$parent_key_value = $_REQUEST[ $parent_key[ $index ] ];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\twp_die( '<p style=\"clear: both; padding: 10px;\">' . __( 'ERROR: No value for parent key found', 'wp-data-access' ) . '</p>' );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( isset( $data_type[ $index ] ) && 'number' === strtolower( $data_type[ $index ] ) ) {\n\t\t\t\t\t\t$where .= $wpdadb->prepare(\n\t\t\t\t\t\t\t\" $and `$key` = %f \",\n\t\t\t\t\t\t\t$parent_key_value\n\t\t\t\t\t\t); // WPCS: unprepared SQL OK.\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$where .= $wpdadb->prepare(\n\t\t\t\t\t\t\t\" $and `$key` = %s \",\n\t\t\t\t\t\t\t$parent_key_value\n\t\t\t\t\t\t); // WPCS: unprepared SQL OK.\n\t\t\t\t\t}\n\n\t\t\t\t\t$index++;\n\t\t\t\t}\n\n\t\t\t\t$this->where = \" where ($where) \"; // WPCS: unprepared SQL OK.\n\t\t\t}\n\n\t\t\t// Add default where\n\t\t\t$this->where .= $default_where;\n\n\t\t\tparent::construct_where_clause();\n\n\t\t\t// Add default order by\n\t\t\t$this->where .= $default_orderby; // WPCS: unprepared SQL OK.\n\t\t}",
"public function generateWhereClause()\n {\n $where_clause = '';\n $i = 1;\n foreach ($this->attributes as $key => $value) {\n $where_clause .= $key . ' = ? ';\n if ($i<count($this->attributes)) {\n $where_clause .= 'and ';\n }\n $i++;\n }\n\n return $where_clause;\n }",
"protected function getWhereSql()\n {\n if (empty($this->conditions)) {\n return '';\n }\n $parts = [];\n foreach ($this->conditions as $condition) {\n $parts[] = $condition->toString();\n $this->parameters = array_merge($this->parameters, $condition->getParameters());\n }\n return ' WHERE ' . implode(' AND ', $parts);\n }",
"protected function getWhereClause() {\r\n\t\tif (!empty($this->whereSql)) {\r\n\t\t\treturn ' WHERE (' . implode(') AND (',$this->whereSql) . ')';\r\n\t\t} else {\r\n\t\t\treturn '';\r\n\t\t}\r\n\t}",
"private function geraWhere(){\n $sql = '';\n if (!empty($this->data)) {\n $sql .= ' WHERE ';\n $i = 0;\n foreach ($this->data as $key => $value) { /* cria parametros do sql*/\n $num = count($this->data);\n $sql .= $key . ' = :' . $key;\n if ($i < $num - 1)\n $sql .= ' AND ';\n\n $i++;\n }\n }\n $this->sql .= $sql;\n }",
"function buildAdvancedWhere() \n\t{\n\t\t$sWhere=\"\";\n\t\tif(isset($this->_where[$this->sessionPrefix.\"_asearchfor\"]))\n\t\t{\n\t\t\tforeach($this->_where[$this->sessionPrefix.\"_asearchfor\"] as $f => $sfor)\n\t\t\t{\n\t\t\t\t$strSearchFor = trim($sfor);\n\t\t\t\t$strSearchFor2 = \"\";\n\t\t\t\t$type=@$this->_where[$this->sessionPrefix.\"_asearchfortype\"][$f];\n\t\t\t\tif(array_key_exists($f,@$this->_where[$this->sessionPrefix.\"_asearchfor2\"]))\n\t\t\t\t\t$strSearchFor2=trim(@$this->_where[$this->sessionPrefix.\"_asearchfor2\"][$f]);\n\t\t\t\tif($strSearchFor!=\"\" || true)\n\t\t\t\t{\n\t\t\t\t\tif (!$sWhere) \n\t\t\t\t\t{\n\t\t\t\t\t\tif($this->_where[$this->sessionPrefix.\"_asearchtype\"]==\"and\")\n\t\t\t\t\t\t\t$sWhere=\"1=1\";\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$sWhere=\"1=0\";\n\t\t\t\t\t}\n\t\t\t\t\t$strSearchOption=trim($this->_where[$this->sessionPrefix.\"_asearchopt\"][$f]);\n\t\t\t\t\tif($where=StrWhereAdv($f, $strSearchFor, $strSearchOption, $strSearchFor2,$type, false))\n\t\t\t\t\t{\n\t\t\t\t\t\tif($this->_where[$this->sessionPrefix.\"_asearchnot\"][$f])\n\t\t\t\t\t\t\t$where=\"not (\".$where.\")\";\n\t\t\t\t\t\tif($this->_where[$this->sessionPrefix.\"_asearchtype\"]==\"and\")\n\t\t\t\t\t\t\t$sWhere .= \" and \".$where;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$sWhere .= \" or \".$where;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\t\n\t\treturn $sWhere;\n\t}",
"public function getConditions() {\n\t\t$sql='';\n\t\tforeach($this->conditions as $table=>$fields) {\n\t\t\t\n\t\t\t$tbl = $this->getTablePh($table);\n\t\t\tif(empty($tbl)) $tbl = $table;\n\t\t\tif(!empty($tbl)) $tbl .= \".\";\n\t\t\t\n\t\t\tforeach($fields as $field=>$conditions) {\n\t\t\t\tforeach($conditions as $condition) {\n\t\t\t\t\tif(!empty($sql)) $sql.=\" AND \";\n\t\t\t\t\tif($condition[0] == 'IN') $cond = $condition[1]; else $cond = sdb::quote($condition[1]);\n\t\t\t\t\t$sql.=\"{$tbl}{$field} {$condition[0]} {$cond}\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tforeach($this->conditionSql as $statement) {\n\t\t\tif(!empty($sql)) $sql .= \" AND \";\n\t\t\t$sql .= \" $statement \";\n\t\t}\n\t\t\n\t\tif($sql) return \" WHERE ($sql) \";\t\t\n\t}",
"private function _getWhereClause( )\n\t{\n\t\tif ( $this->_whereClause == null )\n\t\t{\n\t\t\tif ( $this->_contentid != 0 )\n\t\t\t{\n\t\t\t\t$this->_whereClause = ' WHERE ' . $this->_database->nameQuote('contentid') . ' = ' . $this->_contentid;\n\t\t\t}\n\t\t\telse if ( $this->_galleryimageid != 0 )\n\t\t\t{\n\t\t\t\t$this->_whereClause = ' WHERE ' . $this->_database->nameQuote('galleryimageid') . ' = ' . $this->_galleryimageid;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->_whereClause = ' WHERE ' . $this->_database->nameQuote('contentid') . ' = 0 ' .\n\t\t\t\t\t'AND ' . $this->_database->nameQuote('galleryimageid') . ' = 0'; // should not occur!\n\t\t\t}\n\t\t}\n\n\t\treturn $this->_whereClause;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Build an absolute repository resource locator | public function getAbsoluteResourcePath(RepositoryLocatorInterface $repositoryLocator)
{
return $this->root.str_replace(
'/',
DIRECTORY_SEPARATOR,
$repositoryLocator->withExtension(getenv('OBJECT_RESOURCE_EXTENSION'))
);
} | [
"public function locate_resources();",
"public function getRepositoryPath();",
"function testAssetWithAbsoluteBasePath() {\n $asset = new binarypool_asset($this->getDummyStorage());\n $asset->setBasePath('http://bin.staticlocal.ch/', true);\n $asset->setOriginal('http://bin.staticlocal.ch/vw_golf.jpg');\n $xml = $asset->getXML();\n \n // Load XML\n $dom = DOMDocument::loadXML($xml);\n $xp = new DOMXPath($dom);\n \n // Test\n $this->assertXPath($xp, '/registry/@version', '3.0');\n $this->assertXPath($xp, '/registry/items/item/location', 'http://bin.staticlocal.ch/vw_golf.jpg');\n $this->assertXPath($xp, '/registry/items/item/location/@absolute', 'true');\n return $asset;\n }",
"protected function buildBaseRepoReplacement()\n {\n return [\n \"{{ BaseRepoPath }}\" => $this->rootNameSpace().'Repository\\\\'.config('starry.starry_repository_path')\n ];\n }",
"public function getRepositoryLocator()\n {\n return $this->locator;\n }",
"public function createRepository()\n {\n if (!interface_exists('Puli\\Repository\\Api\\ResourceRepository')) {\n throw new RuntimeException('Please install puli/repository to create ResourceRepository instances.');\n }\n\n $repo = new JsonRepository(__DIR__.'/path-mappings.json', __DIR__.'/..', true);\n\n return $repo;\n }",
"abstract public function getRepository();",
"private function setRepository(): self\n {\n $this->repository = base_dir();\n\n return $this;\n }",
"abstract public function initRepositories();",
"public function get_root_path($rep){\n //temporaney disabled\n //return $this->projects->getRootPath($repository);\n //if only name else get info repository\n $path = '';\n //$repository = \\is_string($rep) ? $this->repositories($rep) : $rep;\n $repository = \\is_string($rep) ? $this->repository($rep) : $rep;\n if ( (!empty($repository) && is_array($repository)) &&\n !empty($repository['path']) &&\n !empty($repository['root']) &&\n !empty($repository['code'])\n ){\n switch( $repository['root'] ){\n case 'app':\n $path = $this->getAppPath();\n break;\n /* case 'cdn':\n die(var_dump('cdn'));\n break;*/\n case 'lib':\n $path = $this->getLibPath();\n $path .= $repository['path'];\n if ( $repository['alias_code'] === 'bbn-project' ){\n $path .= '/src/';\n }\n break;\n }\n }\n return $path;\n }",
"function loadRepository($respository);",
"abstract protected function getRepoNameSpace();",
"public function getFromFullPath($full_path) {\n $repo = $this->getByRepositoryRootMatch('gitolite/repositories', $full_path);\n if (!$repo) {\n $repo = $this->getByRepositoryRootMatch('gitroot', $full_path);\n }\n return $repo;\n }",
"protected function getFileLocatorService()\n {\n return $this->services['file_locator'] = new \\Symfony\\Component\\HttpKernel\\Config\\FileLocator(${($_ = isset($this->services['kernel']) ? $this->services['kernel'] : $this->get('kernel')) && false ?: '_'}, ($this->targetDirs[2].'/Resources'), array(0 => $this->targetDirs[2]));\n }",
"public function getRepositoryAlias(ResourceRepository $resource);",
"protected function getLocalRepoPath()\n {\n return sfConfig::get('sf_data_dir').'/'.str_replace(array('/',':'), '_', $this->getScm()->getHost()).'/'.str_replace(array('/'), '_', $this->getScm()->getPath());\n }",
"public function resourceBaseUrl();",
"function getRepository();",
"public static function CLASSPATH_RESOURCE_LOCATOR() {\n if ( self::$CLASSPATH_RESOURCE_LOCATOR_INSTANCE === null ) {\n require_once('substrate_ClasspathResourceLocator.php');\n self::$CLASSPATH_RESOURCE_LOCATOR_INSTANCE = new substrate_ClasspathResourceLocator();\n }\n return self::$CLASSPATH_RESOURCE_LOCATOR_INSTANCE;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests Fs_Node::chown() with user:group | public function testChown_Security()
{
$this->setExpectedException('Q\SecurityException', "Won't change owner of '{$this->file}' to user 'myusr:mygrp': To change both owner and group, user array(owner, group) instead");
$this->Fs_Node->chown('myusr:mygrp');
} | [
"public function testChown_Chgrp()\n {\n if (!function_exists('posix_getuid')) $this->markTestSkipped(\"Posix functions not available: I don't know if I'm root.\");\n \tif (posix_getuid() !== 0) $this->markTestSkipped(\"Can only chown as root.\");\n\n \t$sysusr = posix_getpwuid(3);\n \tif (!$sysusr) $this->markTestSkipped(\"The system has no user with uid 3, which is used in the test.\");\n\n \t$sysgrp = posix_getgrgid(2);\n \tif (!$sysgrp) $this->markTestSkipped(\"The system has no group with gid 2, which is used in the test.\");\n\n clearstatcache(false, $this->file);\n $this->Fs_Node->chown(array($sysusr['name'], $sysgrp['name']));\n $this->assertEquals(3, fileowner($this->file));\n $this->assertEquals(2, filegroup($this->file));\n\n clearstatcache(false, $this->file);\n $this->Fs_Node->chown(array(0, 0));\n $this->assertEquals(0, fileowner($this->file));\n $this->assertEquals(0, filegroup($this->file));\n }",
"public function testChown_Security()\n {\n \t$this->setExpectedException('Q\\SecurityException', \"Won't change owner of '{$this->file}' to user 'myusr:mygrp': To change both owner and group, user array(owner, group) instead\");\n \t$this->Fs_Node->chown('myusr:mygrp');\n }",
"function lchown ($filename, $user) {}",
"public function testChgrp_Fail()\n {\n if (is_writable('/etc/passwd')) $this->markTestSkipped(\"Want to test this on '/etc/passwd', but I actually have permission to change that file. Run this script as an under-privileged user.\");\n $file = new Fs_File('/etc/passwd');\n $this->setExpectedException('Q\\Fs_Exception', \"Failed to change group of '$file' to '0': Operation not permitted\");\n $file->chgrp(0);\n }",
"protected function chown()\n {\n if (!$this->chown) {\n $this->echo(\"chown was disabled in deploy.php\");\n return;\n }\n $root = $this->paths->root;\n $owner = fileowner($root);\n $group = filegroup($root);\n $this->section(\"Setting owner and group based on root folder...\");\n $this->echo(\"Usage: Can be disabled via \\$deploy->chown = false;\");\n $this->exec(\"chown -R $owner:$group $root\", true);\n $this->ok();\n }",
"function sugar_chown($filename, $user='') {\n\tif(!is_windows()){\n\t\tif(strlen($user)){\n\t\t\treturn chown($filename, $user);\n\t\t}else{\n\t\t\tif(strlen($GLOBALS['sugar_config']['default_permissions']['user'])){\n\t\t\t\t$user = $GLOBALS['sugar_config']['default_permissions']['user'];\n\t\t\t\treturn chown($filename, $user);\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}",
"public function testChangeOwner() {\n\t\tif (!function_exists('posix_getpwuid') || false === posix_getpwuid(1)) {\n\t\t\t$this->markTestSkipped(\n\t\t\t\t'Either the posix_getpwuid() function is not available, or there is no user with UID of 1');\n\t\t}\n\n\t\t$file = 'test.txt';\n\t\t$fullPath = $this->testBasePath . $file;\n\n\t\ttouch($fullPath);\n\n\t\t$this->assertTrue(file_exists($fullPath), 'Precondition failed. Unable to create test file: ' . $fullPath);\n\t\t$this->assertEquals(0, fileowner($fullPath), 'Precondition failed. Invalid owner for new file.');\n\t\tclearstatcache();\n\t\t$this->assertTrue(file_exists($fullPath), 'Precondition failed. Unable to create test file: ' . $fullPath);\n\t\t$this->assertEquals(0, fileowner($fullPath), 'Precondition failed. Invalid owner for new file.');\n\n\t\tclearstatcache();\n\n\t\t$this->fileHandler->changeOwner($fullPath, null, 1);\n\t\t$this->assertEquals(1, fileowner($fullPath), 'Failed to change owner of the test file');\n\n\t\tclearstatcache();\n\n\t\t$this->fileHandler->changeOwner($fullPath, 1, 1);\n\t\t$this->assertEquals(1, filegroup($fullPath), 'Failed to change group of the test file');\n\t\t$this->assertEquals(1, fileowner($fullPath), 'Invalid user set for file when changing both group and user');\n\n\t\tclearstatcache();\n\n\t\t$this->fileHandler->changeOwner($fullPath, 0);\n\t\t$this->assertEquals(0, filegroup($fullPath), 'Failed to change group of the test file');\n\t\t$this->assertEquals(1, fileowner($fullPath), 'Changing only the group should not change the owner of a file');\n\t}",
"public function chown($file, $owner, $recursive = true);",
"public function chown($file, $owner, $recursive = false);",
"public function testChgrp_Fail()\n {\n $this->markTestIncomplete(\"Find the best way to test this\");\n \tif (is_writable('/etc/passwd')) $this->markTestSkipped(\"Want to test this on '/etc/passwd', but I actually have permission to change that file. Run this script as an under-privileged user.\");\n $file = new Fs_Fifo('/etc/passwd');\n $this->setExpectedException('Q\\Fs_Exception', \"Failed to change group of '$file' to '0': Operation not permitted\");\n $file->chgrp(0);\n }",
"function chgrp ($filename, $group) {}",
"function chown_chgrp_R($mypath, $uid, $gid) \n{\n $d = opendir ($mypath) ;\n while(($file = readdir($d)) !== false) {\n if (($file != \".\") && ($file != \"..\")) {\n $typepath = $mypath . \"/\" . $file ;\n //print $typepath. \" : \" . filetype ($typepath). \"<BR>\" ; \n if (filetype ($typepath) == 'dir') { \n chown_chgrp_R ($typepath, $uid, $gid); \n }\n if (!chown($typepath, $uid)) { echo \"\\nERROR chown $typepath to $uid\\n\"; }\n\t\t clearstatcache();\n if (!chgrp($typepath, $gid)) { echo \"\\nERROR chgrp $typepath to $gid\\n\"; }\n\t\t clearstatcache();\n }\n }\n }",
"public function changeOwnerRecursive ($hdfsPath, $owner = null, $group = null)\n {\n if (!trim($owner) && !trim($group))\n {\n throw new Exception\\IllegalArgumentException(\"Either owner or group should be specified\", false);\n }\n\n $result = $this->cli->exec('-chown', '-R', $owner.($group ? \":$group\" : \"\"), $hdfsPath);\n if ($result->getException())\n {\n throw $result->getException();\n }\n }",
"function assignOwner($user) {\n\tsystem(\"chown root:root \" . $user['home_dir'],$retval);\n\tif ($retval == 0) {\n\t\techo \"Successfully changed jail permissions\\n\";\n\t}\n}",
"function chgrp($files, $group, $recursive = false);",
"public static function chownFile($file, $owner, $group = false)\n {\n if ($group !== false) {\n $command = \"/bin/chown $owner:$group $file\";\n } else {\n $command = \"/bin/chown $owner $file\";\n }\n exec($command.' 2>&1', $output, $exitCode);\n if ($exitCode != 0) {\n return implode(\"\\n\", $output);\n }\n return true;\n }",
"public function changeOwner($path, $group = null, $user = null) {\n\t\tif (!$this->checkIsPathExists($path)) {\n\t\t\tthrow new NotFoundException($path, 'Resource not found while changing owner: ' . $path);\n\t\t}\n\t\tif (!is_null($group) && !chgrp($path, $group)) {\n\t\t\tthrow new Exception('Failed to set the group \"' . $group . '\" of the resource: ' . $path);\n\t\t}\n\t\tif (!is_null($user) && !chown($path, $user)) {\n\t\t\tthrow new Exception('Failed to set the user \"' . $user . '\" of the resource: ' . $path);\n\t\t}\n\t}",
"function chown(iterable|string $files, string $user, bool $recursive = false): void\n{\n static $fileSystem;\n\n if (null === $fileSystem) {\n $fileSystem = new FileSystem();\n }\n\n $fileSystem->chown($files, $user, $recursive);\n}",
"public function chown(string $path, int $uid, int $gid): int\n {\n /** @var int */\n return $this->fallbackIfDefault(__FUNCTION__, func_get_args());\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.